UNPKG

@blinkk/editor

Version:

Structured content editor with live previews.

37 lines 1.43 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AsideField = void 0; const selective_edit_1 = require("@blinkk/selective-edit"); const marked_1 = __importDefault(require("marked")); class AsideField extends selective_edit_1.Field { constructor(types, config, globalConfig, fieldType = 'aside') { super(types, config, globalConfig, fieldType); this.config = config; } /** * Template for determining how to render the field. * * @param editor Selective editor used to render the template. * @param data Data provided to render the template. */ template(editor, data) { return this.templateWrapper(editor, data); } /** * Template for rendering the field structure. * * Used for controlling the order that parts of the field are rendered. * * @param editor Selective editor used to render the template. * @param data Data provided to render the template. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars templateStructure(editor, data) { return selective_edit_1.html `${selective_edit_1.unsafeHTML(marked_1.default(this.config.source))}`; } } exports.AsideField = AsideField; //# sourceMappingURL=aside.js.map