@blinkk/editor
Version:
Structured content editor with live previews.
29 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModalsPart = void 0;
const _1 = require(".");
const selective_edit_1 = require("@blinkk/selective-edit");
const selective_edit_2 = require("@blinkk/selective-edit");
/**
* Modals are centralized in the display to be outside of other
* modals and structures. Modal windows live as siblings in the
* DOM.
*
* This helps to prevent issues where one modal is clipping
* another without having to pass the modal through the template
* stack to be outside of another modal.
*
* This also allows reuse of modals across parts of the editor.
*/
class ModalsPart extends _1.BasePart {
constructor() {
super();
this.modals = {};
}
template(editor) {
const keys = Object.keys(this.modals).sort();
return selective_edit_1.html `${selective_edit_2.repeat(keys, (key) => key, (key) => this.modals[key].template(editor))}`;
}
}
exports.ModalsPart = ModalsPart;
//# sourceMappingURL=modals.js.map