@ecodev/natural-editor 66.0.16 → 66.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1759,7 +1759,7 @@ class NaturalEditorComponent {
|
|
|
1759
1759
|
this.view.focus();
|
|
1760
1760
|
}
|
|
1761
1761
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1762
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.7", type: NaturalEditorComponent, isStandalone: true, selector: "natural-editor", inputs: { imageUploader: { classPropertyName: "imageUploader", publicName: "imageUploader", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contentChange: "contentChange", save: "save" }, providers: [ImagePlugin], viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/cyclomatic-complexity -->\n@if (menu && !disabled) {\n <div class=\"menu-container\">\n <div class=\"menu\">\n @if (save$.observed) {\n <button matIconButton i18n-matTooltip matTooltip=\"Enregistrer\" (click)=\"save$.next()\">\n <mat-icon fontIcon=\"save\" />\n </button>\n }\n <mat-button-toggle-group hideMultipleSelectionIndicator multiple>\n @if (menu.toggleStrong) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Gras\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n >\n <mat-icon fontIcon=\"format_bold\" />\n </mat-button-toggle>\n }\n @if (menu.toggleEm) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Italique\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n >\n <mat-icon fontIcon=\"format_italic\" />\n </mat-button-toggle>\n }\n @if (menu.toggleCode) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Code\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n >\n <mat-icon fontIcon=\"code\" />\n </mat-button-toggle>\n }\n @if (menu.toggleLink) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer un lien...\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n >\n <mat-icon fontIcon=\"insert_link\" />\n </mat-button-toggle>\n }\n @if (menu.textColor) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Couleur du texte...\"\n [disabled]=\"menu.textColor.disabled\"\n [checked]=\"menu.textColor.active\"\n (click)=\"run($event, 'textColor')\"\n >\n <mat-icon fontIcon=\"format_color_text\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n <mat-menu #blockMenu=\"matMenu\">\n @if (menu.makeParagraph) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n >Paragraphe\n </button>\n }\n @if (menu.makeCodeBlock) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n >Code\n </button>\n }\n @if (menu.makeHead1) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead1.disabled\" (click)=\"run($event, 'makeHead1')\"\n >Titre 1\n </button>\n }\n @if (menu.makeHead2) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead2.disabled\" (click)=\"run($event, 'makeHead2')\"\n >Titre 2\n </button>\n }\n @if (menu.makeHead3) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead3.disabled\" (click)=\"run($event, 'makeHead3')\"\n >Titre 3\n </button>\n }\n @if (menu.makeHead4) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead4.disabled\" (click)=\"run($event, 'makeHead4')\"\n >Titre 4\n </button>\n }\n @if (menu.makeHead5) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead5.disabled\" (click)=\"run($event, 'makeHead5')\"\n >Titre 5\n </button>\n }\n @if (menu.makeHead6) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead6.disabled\" (click)=\"run($event, 'makeHead6')\"\n >Titre 6\n </button>\n }\n @if (menu.blockClass || menu.blockId) {\n <mat-divider />\n }\n @if (menu.blockClass) {\n <button mat-menu-item i18n [disabled]=\"menu.blockClass.disabled\" (click)=\"run($event, 'blockClass')\"\n >Classe...\n </button>\n }\n @if (menu.blockId) {\n <button i18n mat-menu-item [disabled]=\"menu.blockId.disabled\" (click)=\"run($event, 'blockId')\"\n >ID...\n </button>\n }\n </mat-menu>\n @if (menu.addColumnBefore) {\n <button mat-button [matMenuTriggerFor]=\"tableMenu\">\n <span i18n>Tableau</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n }\n <mat-menu #tableMenu=\"matMenu\">\n @if (menu.insertTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n >Ins\u00E9rer un tableau\n </button>\n }\n @if (menu.deleteTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n >Supprimer le tableau\n </button>\n }\n @if (menu.mergeCells) {\n <button mat-menu-item i18n [disabled]=\"menu.mergeCells.disabled\" (click)=\"run($event, 'mergeCells')\"\n >Fusionner les cellules\n </button>\n }\n @if (menu.splitCell) {\n <button mat-menu-item i18n [disabled]=\"menu.splitCell.disabled\" (click)=\"run($event, 'splitCell')\"\n >Scinder les cellules\n </button>\n }\n @if (menu.cellBackgroundColor) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.cellBackgroundColor.disabled\"\n (click)=\"run($event, 'cellBackgroundColor')\"\n >Couleur de fond...\n </button>\n }\n @if (menu.tableClass) {\n <button mat-menu-item i18n [disabled]=\"menu.tableClass.disabled\" (click)=\"run($event, 'tableClass')\"\n >Classe...\n </button>\n }\n @if (menu.tableId) {\n <button i18n mat-menu-item [disabled]=\"menu.tableId.disabled\" (click)=\"run($event, 'tableId')\"\n >ID...\n </button>\n }\n <mat-divider />\n @if (menu.addColumnBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n >Ins\u00E9rer une colonne avant\n </button>\n }\n @if (menu.addColumnAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n >Ins\u00E9rer une colonne apr\u00E8s\n </button>\n }\n @if (menu.deleteColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n >Supprimer la colonne\n </button>\n }\n <mat-divider />\n @if (menu.addRowBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n >Ins\u00E9rer une ligne avant\n </button>\n }\n @if (menu.addRowAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n >Ins\u00E9rer une ligne apr\u00E8s\n </button>\n }\n @if (menu.deleteRow) {\n <button mat-menu-item i18n [disabled]=\"menu.deleteRow.disabled\" (click)=\"run($event, 'deleteRow')\"\n >Supprimer la ligne\n </button>\n }\n <mat-divider />\n @if (menu.toggleHeaderColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n >Ent\u00EAte de colonne\n </button>\n }\n @if (menu.toggleHeaderRow) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n >Ent\u00EAte de ligne\n </button>\n }\n @if (menu.toggleHeaderCell) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n >Ent\u00EAte de cellule\n </button>\n }\n </mat-menu>\n @if (imageUploader()) {\n <button\n matIconButton\n naturalFileDrop\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer une image\"\n [accept]=\"commonImageMimeTypes\"\n [selectable]=\"true\"\n [broadcast]=\"false\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon fontIcon=\"insert_photo\" />\n </button>\n }\n @if (menu.alignLeft) {\n <mat-button-toggle-group hideSingleSelectionIndicator>\n @if (menu.alignLeft) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner gauche\"\n [disabled]=\"menu.alignLeft.disabled\"\n [checked]=\"menu.alignLeft.active\"\n (click)=\"run($event, 'alignLeft')\"\n >\n <mat-icon fontIcon=\"format_align_left\" />\n </mat-button-toggle>\n }\n @if (menu.alignCenter) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Centrer\"\n [disabled]=\"menu.alignCenter.disabled\"\n [checked]=\"menu.alignCenter.active\"\n (click)=\"run($event, 'alignCenter')\"\n >\n <mat-icon fontIcon=\"format_align_center\" />\n </mat-button-toggle>\n }\n @if (menu.alignRight) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner droite\"\n [disabled]=\"menu.alignRight.disabled\"\n [checked]=\"menu.alignRight.active\"\n (click)=\"run($event, 'alignRight')\"\n >\n <mat-icon fontIcon=\"format_align_right\" />\n </mat-button-toggle>\n }\n @if (menu.alignJustify) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Justifier\"\n [disabled]=\"menu.alignJustify.disabled\"\n [checked]=\"menu.alignJustify.active\"\n (click)=\"run($event, 'alignJustify')\"\n >\n <mat-icon fontIcon=\"format_align_justify\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n }\n @if (menu.undo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Annuler\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n >\n <mat-icon fontIcon=\"undo\" />\n </button>\n }\n @if (menu.redo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Refaire\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n >\n <mat-icon fontIcon=\"redo\" />\n </button>\n }\n @if (menu.wrapBulletList && menu.wrapBulletList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 puce\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n >\n <mat-icon fontIcon=\"format_list_bulleted\" />\n </button>\n }\n @if (menu.wrapOrderedList && menu.wrapOrderedList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 num\u00E9ro\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n >\n <mat-icon fontIcon=\"format_list_numbered\" />\n </button>\n }\n @if (menu.wrapBlockQuote && menu.wrapBlockQuote.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Citation\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n >\n <mat-icon fontIcon=\"format_quote\" />\n </button>\n }\n @if (menu.joinUp && menu.joinUp.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'\u00E9l\u00E9ment du haut\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n >\n <mat-icon fontIcon=\"move_up\" />\n </button>\n }\n @if (menu.lift && menu.lift.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"D\u00E9sindenter\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n >\n <mat-icon fontIcon=\"format_indent_decrease\" />\n </button>\n }\n @if (menu.selectParentNode && menu.selectParentNode.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"S\u00E9lectionner l'\u00E9l\u00E9ment parent\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n >\n <mat-icon fontIcon=\"select_all\" />\n </button>\n }\n </div>\n </div>\n}\n<div #editor class=\"editor-container\"></div>\n", styles: [":host{display:block;border-radius:16px;background-color:var(--mat-sys-surface-container);padding:10px}.menu{display:flex;flex-wrap:wrap;padding:10px 18px}.menu-container{position:sticky;top:-20px;z-index:999}::ng-deep .ProseMirror{--padding-right: 8px;--padding-left: 14px;position:relative;outline:none;padding:4px var(--padding-right) 4px var(--padding-left);width:calc(100% - var(--padding-right) - var(--padding-left));line-height:1.2;word-wrap:break-word;border-radius:10px;background-color:var(--mat-sys-surface);-webkit-font-variant-ligatures:none;font-variant-ligatures:none;white-space:pre-wrap}::ng-deep .ProseMirror pre{white-space:pre-wrap}::ng-deep .ProseMirror li{position:relative}::ng-deep .ProseMirror-hideselection *::selection{background:transparent}::ng-deep .ProseMirror-hideselection *::-moz-selection{background:transparent}::ng-deep .ProseMirror-hideselection{caret-color:transparent}::ng-deep .ProseMirror-selectednode{outline:2px solid #8cf}::ng-deep li.ProseMirror-selectednode{outline:none}::ng-deep li.ProseMirror-selectednode:after{position:absolute;inset:-2px -2px -2px -32px;border:2px solid #8cf;pointer-events:none;content:\"\"}::ng-deep .ProseMirror-gapcursor{display:none;position:absolute;pointer-events:none}::ng-deep .ProseMirror-gapcursor:after{display:block;position:absolute;top:-2px;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite;border-top:1px solid black;width:20px;content:\"\"}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}::ng-deep .ProseMirror-focused .ProseMirror-gapcursor{display:block}::ng-deep .ProseMirror-example-setup-style hr{margin:1em 0;border:none;padding:2px 10px}::ng-deep .ProseMirror-example-setup-style hr:after{display:block;background-color:silver;height:1px;content:\"\";line-height:2px}::ng-deep .ProseMirror ul,::ng-deep .ProseMirror ol{padding-left:30px}::ng-deep .ProseMirror blockquote{margin-right:0;margin-left:0;border-left:3px solid #eee;padding-left:1em}::ng-deep .ProseMirror-example-setup-style img{cursor:default}::ng-deep .ProseMirror p:first-child,::ng-deep .ProseMirror h1:first-child,::ng-deep .ProseMirror h2:first-child,::ng-deep .ProseMirror h3:first-child,::ng-deep .ProseMirror h4:first-child,::ng-deep .ProseMirror h5:first-child,::ng-deep .ProseMirror h6:first-child{margin-top:10px}::ng-deep .ProseMirror p{margin-bottom:1em}::ng-deep .ProseMirror .tableWrapper{overflow-x:auto}::ng-deep .ProseMirror table{border-collapse:collapse;width:100%;table-layout:fixed;overflow:hidden}::ng-deep .ProseMirror td,::ng-deep .ProseMirror th{position:relative;vertical-align:top;box-sizing:border-box}::ng-deep .ProseMirror .column-resize-handle{position:absolute;top:0;right:-2px;bottom:0;z-index:20;background-color:#adf;width:4px;pointer-events:none}::ng-deep .ProseMirror.resize-cursor{cursor:col-resize}::ng-deep .ProseMirror .selectedCell:after{position:absolute;inset:0;z-index:2;background:#c8c8ff66;pointer-events:none;content:\"\"}::ng-deep .ProseMirror table{margin:0}::ng-deep .ProseMirror th,::ng-deep .ProseMirror td{border:1px solid #ddd;padding:3px 5px;min-width:1em}::ng-deep .ProseMirror .tableWrapper{margin:1em 0}::ng-deep .ProseMirror th{font-weight:700;text-align:left}::ng-deep placeholder{display:block;animation:gradient 3s none infinite;background-size:500% 100%!important;background:linear-gradient(90deg,var(--mat-sys-primary),var(--mat-sys-primary),var(--mat-sys-tertiary),var(--mat-sys-primary),var(--mat-sys-primary));width:50px;height:50px}@keyframes gradient{0%{background-position:100% 100%}to{background-position:0 0}}button.natural-file-over{background:var(--mat-sys-primary)}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: NaturalFileDropDirective, selector: ":not([naturalFileSelect])[naturalFileDrop]", outputs: ["fileOver"] }] });
|
|
1762
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.7", type: NaturalEditorComponent, isStandalone: true, selector: "natural-editor", inputs: { imageUploader: { classPropertyName: "imageUploader", publicName: "imageUploader", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contentChange: "contentChange", save: "save" }, providers: [ImagePlugin], viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/cyclomatic-complexity -->\n@if (menu && !disabled) {\n <div class=\"menu-container\">\n <div class=\"menu\">\n @if (save$.observed) {\n <button matIconButton i18n-matTooltip matTooltip=\"Enregistrer\" (click)=\"save$.next()\">\n <mat-icon fontIcon=\"save\" />\n </button>\n }\n <mat-button-toggle-group hideMultipleSelectionIndicator multiple>\n @if (menu.toggleStrong) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Gras\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n >\n <mat-icon fontIcon=\"format_bold\" />\n </mat-button-toggle>\n }\n @if (menu.toggleEm) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Italique\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n >\n <mat-icon fontIcon=\"format_italic\" />\n </mat-button-toggle>\n }\n @if (menu.toggleCode) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Code\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n >\n <mat-icon fontIcon=\"code\" />\n </mat-button-toggle>\n }\n @if (menu.toggleLink) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer un lien...\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n >\n <mat-icon fontIcon=\"insert_link\" />\n </mat-button-toggle>\n }\n @if (menu.textColor) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Couleur du texte...\"\n [disabled]=\"menu.textColor.disabled\"\n [checked]=\"menu.textColor.active\"\n (click)=\"run($event, 'textColor')\"\n >\n <mat-icon fontIcon=\"format_color_text\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n <mat-menu #blockMenu=\"matMenu\">\n @if (menu.makeParagraph) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n >Paragraphe\n </button>\n }\n @if (menu.makeCodeBlock) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n >Code\n </button>\n }\n @if (menu.makeHead1) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead1.disabled\" (click)=\"run($event, 'makeHead1')\"\n >Titre 1\n </button>\n }\n @if (menu.makeHead2) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead2.disabled\" (click)=\"run($event, 'makeHead2')\"\n >Titre 2\n </button>\n }\n @if (menu.makeHead3) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead3.disabled\" (click)=\"run($event, 'makeHead3')\"\n >Titre 3\n </button>\n }\n @if (menu.makeHead4) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead4.disabled\" (click)=\"run($event, 'makeHead4')\"\n >Titre 4\n </button>\n }\n @if (menu.makeHead5) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead5.disabled\" (click)=\"run($event, 'makeHead5')\"\n >Titre 5\n </button>\n }\n @if (menu.makeHead6) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead6.disabled\" (click)=\"run($event, 'makeHead6')\"\n >Titre 6\n </button>\n }\n @if (menu.blockClass || menu.blockId) {\n <mat-divider />\n }\n @if (menu.blockClass) {\n <button mat-menu-item i18n [disabled]=\"menu.blockClass.disabled\" (click)=\"run($event, 'blockClass')\"\n >Classe...\n </button>\n }\n @if (menu.blockId) {\n <button i18n mat-menu-item [disabled]=\"menu.blockId.disabled\" (click)=\"run($event, 'blockId')\"\n >ID...\n </button>\n }\n </mat-menu>\n @if (menu.addColumnBefore) {\n <button mat-button [matMenuTriggerFor]=\"tableMenu\">\n <span i18n>Tableau</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n }\n <mat-menu #tableMenu=\"matMenu\">\n @if (menu.insertTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n >Ins\u00E9rer un tableau\n </button>\n }\n @if (menu.deleteTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n >Supprimer le tableau\n </button>\n }\n @if (menu.mergeCells) {\n <button mat-menu-item i18n [disabled]=\"menu.mergeCells.disabled\" (click)=\"run($event, 'mergeCells')\"\n >Fusionner les cellules\n </button>\n }\n @if (menu.splitCell) {\n <button mat-menu-item i18n [disabled]=\"menu.splitCell.disabled\" (click)=\"run($event, 'splitCell')\"\n >Scinder les cellules\n </button>\n }\n @if (menu.cellBackgroundColor) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.cellBackgroundColor.disabled\"\n (click)=\"run($event, 'cellBackgroundColor')\"\n >Couleur de fond...\n </button>\n }\n @if (menu.tableClass) {\n <button mat-menu-item i18n [disabled]=\"menu.tableClass.disabled\" (click)=\"run($event, 'tableClass')\"\n >Classe...\n </button>\n }\n @if (menu.tableId) {\n <button i18n mat-menu-item [disabled]=\"menu.tableId.disabled\" (click)=\"run($event, 'tableId')\"\n >ID...\n </button>\n }\n <mat-divider />\n @if (menu.addColumnBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n >Ins\u00E9rer une colonne avant\n </button>\n }\n @if (menu.addColumnAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n >Ins\u00E9rer une colonne apr\u00E8s\n </button>\n }\n @if (menu.deleteColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n >Supprimer la colonne\n </button>\n }\n <mat-divider />\n @if (menu.addRowBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n >Ins\u00E9rer une ligne avant\n </button>\n }\n @if (menu.addRowAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n >Ins\u00E9rer une ligne apr\u00E8s\n </button>\n }\n @if (menu.deleteRow) {\n <button mat-menu-item i18n [disabled]=\"menu.deleteRow.disabled\" (click)=\"run($event, 'deleteRow')\"\n >Supprimer la ligne\n </button>\n }\n <mat-divider />\n @if (menu.toggleHeaderColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n >Ent\u00EAte de colonne\n </button>\n }\n @if (menu.toggleHeaderRow) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n >Ent\u00EAte de ligne\n </button>\n }\n @if (menu.toggleHeaderCell) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n >Ent\u00EAte de cellule\n </button>\n }\n </mat-menu>\n @if (imageUploader()) {\n <button\n matIconButton\n naturalFileDrop\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer une image\"\n [accept]=\"commonImageMimeTypes\"\n [selectable]=\"true\"\n [broadcast]=\"false\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon fontIcon=\"insert_photo\" />\n </button>\n }\n @if (menu.alignLeft) {\n <mat-button-toggle-group hideSingleSelectionIndicator>\n @if (menu.alignLeft) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner gauche\"\n [disabled]=\"menu.alignLeft.disabled\"\n [checked]=\"menu.alignLeft.active\"\n (click)=\"run($event, 'alignLeft')\"\n >\n <mat-icon fontIcon=\"format_align_left\" />\n </mat-button-toggle>\n }\n @if (menu.alignCenter) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Centrer\"\n [disabled]=\"menu.alignCenter.disabled\"\n [checked]=\"menu.alignCenter.active\"\n (click)=\"run($event, 'alignCenter')\"\n >\n <mat-icon fontIcon=\"format_align_center\" />\n </mat-button-toggle>\n }\n @if (menu.alignRight) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner droite\"\n [disabled]=\"menu.alignRight.disabled\"\n [checked]=\"menu.alignRight.active\"\n (click)=\"run($event, 'alignRight')\"\n >\n <mat-icon fontIcon=\"format_align_right\" />\n </mat-button-toggle>\n }\n @if (menu.alignJustify) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Justifier\"\n [disabled]=\"menu.alignJustify.disabled\"\n [checked]=\"menu.alignJustify.active\"\n (click)=\"run($event, 'alignJustify')\"\n >\n <mat-icon fontIcon=\"format_align_justify\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n }\n @if (menu.undo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Annuler\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n >\n <mat-icon fontIcon=\"undo\" />\n </button>\n }\n @if (menu.redo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Refaire\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n >\n <mat-icon fontIcon=\"redo\" />\n </button>\n }\n @if (menu.wrapBulletList && menu.wrapBulletList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 puce\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n >\n <mat-icon fontIcon=\"format_list_bulleted\" />\n </button>\n }\n @if (menu.wrapOrderedList && menu.wrapOrderedList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 num\u00E9ro\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n >\n <mat-icon fontIcon=\"format_list_numbered\" />\n </button>\n }\n @if (menu.wrapBlockQuote && menu.wrapBlockQuote.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Citation\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n >\n <mat-icon fontIcon=\"format_quote\" />\n </button>\n }\n @if (menu.joinUp && menu.joinUp.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'\u00E9l\u00E9ment du haut\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n >\n <mat-icon fontIcon=\"move_up\" />\n </button>\n }\n @if (menu.lift && menu.lift.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"D\u00E9sindenter\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n >\n <mat-icon fontIcon=\"format_indent_decrease\" />\n </button>\n }\n @if (menu.selectParentNode && menu.selectParentNode.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"S\u00E9lectionner l'\u00E9l\u00E9ment parent\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n >\n <mat-icon fontIcon=\"select_all\" />\n </button>\n }\n </div>\n </div>\n}\n<div #editor class=\"editor-container\"></div>\n", styles: [":host{--background-color: var(--mat-sys-surface-container);display:block;border-radius:var(--mat-sys-corner-large);background-color:var(--background-color);padding:10px}.menu{display:flex;flex-wrap:wrap;background-color:color-mix(in srgb,var(--background-color) 90%,transparent);padding-block:10px}@supports (backdrop-filter: blur()){.menu{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:color-mix(in srgb,var(--background-color) 70%,transparent)}}.menu-container{position:sticky;top:-20px;z-index:999}::ng-deep .ProseMirror{--padding-right: 8px;--padding-left: 14px;position:relative;outline:none;padding:4px var(--padding-right) 4px var(--padding-left);width:calc(100% - var(--padding-right) - var(--padding-left));line-height:1.2;word-wrap:break-word;border-radius:10px;background-color:var(--mat-sys-surface-bright);-webkit-font-variant-ligatures:none;font-variant-ligatures:none;white-space:pre-wrap}::ng-deep .ProseMirror pre{white-space:pre-wrap}::ng-deep .ProseMirror li{position:relative}::ng-deep .ProseMirror-hideselection *::selection{background:transparent}::ng-deep .ProseMirror-hideselection *::-moz-selection{background:transparent}::ng-deep .ProseMirror-hideselection{caret-color:transparent}::ng-deep .ProseMirror-selectednode{outline:2px solid #8cf}::ng-deep li.ProseMirror-selectednode{outline:none}::ng-deep li.ProseMirror-selectednode:after{position:absolute;inset:-2px -2px -2px -32px;border:2px solid #8cf;pointer-events:none;content:\"\"}::ng-deep .ProseMirror-gapcursor{display:none;position:absolute;pointer-events:none}::ng-deep .ProseMirror-gapcursor:after{display:block;position:absolute;top:-2px;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite;border-top:1px solid black;width:20px;content:\"\"}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}::ng-deep .ProseMirror-focused .ProseMirror-gapcursor{display:block}::ng-deep .ProseMirror-example-setup-style hr{margin:1em 0;border:none;padding:2px 10px}::ng-deep .ProseMirror-example-setup-style hr:after{display:block;background-color:silver;height:1px;content:\"\";line-height:2px}::ng-deep .ProseMirror ul,::ng-deep .ProseMirror ol{padding-left:30px}::ng-deep .ProseMirror blockquote{margin-right:0;margin-left:0;border-left:3px solid #eee;padding-left:1em}::ng-deep .ProseMirror-example-setup-style img{cursor:default}::ng-deep .ProseMirror p:first-child,::ng-deep .ProseMirror h1:first-child,::ng-deep .ProseMirror h2:first-child,::ng-deep .ProseMirror h3:first-child,::ng-deep .ProseMirror h4:first-child,::ng-deep .ProseMirror h5:first-child,::ng-deep .ProseMirror h6:first-child{margin-top:10px}::ng-deep .ProseMirror p{margin-bottom:1em}::ng-deep .ProseMirror .tableWrapper{overflow-x:auto}::ng-deep .ProseMirror table{border-collapse:collapse;width:100%;table-layout:fixed;overflow:hidden}::ng-deep .ProseMirror td,::ng-deep .ProseMirror th{position:relative;vertical-align:top;box-sizing:border-box}::ng-deep .ProseMirror .column-resize-handle{position:absolute;top:0;right:-2px;bottom:0;z-index:20;background-color:#adf;width:4px;pointer-events:none}::ng-deep .ProseMirror.resize-cursor{cursor:col-resize}::ng-deep .ProseMirror .selectedCell:after{position:absolute;inset:0;z-index:2;background:#c8c8ff66;pointer-events:none;content:\"\"}::ng-deep .ProseMirror table{margin:0}::ng-deep .ProseMirror th,::ng-deep .ProseMirror td{border:1px solid #ddd;padding:3px 5px;min-width:1em}::ng-deep .ProseMirror .tableWrapper{margin:1em 0}::ng-deep .ProseMirror th{font-weight:700;text-align:left}::ng-deep placeholder{display:block;animation:gradient 3s none infinite;background-size:500% 100%!important;background:linear-gradient(90deg,var(--mat-sys-primary),var(--mat-sys-primary),var(--mat-sys-tertiary),var(--mat-sys-primary),var(--mat-sys-primary));width:50px;height:50px}@keyframes gradient{0%{background-position:100% 100%}to{background-position:0 0}}button.natural-file-over{background:var(--mat-sys-primary)}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: NaturalFileDropDirective, selector: ":not([naturalFileSelect])[naturalFileDrop]", outputs: ["fileOver"] }] });
|
|
1763
1763
|
}
|
|
1764
1764
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalEditorComponent, decorators: [{
|
|
1765
1765
|
type: Component,
|
|
@@ -1775,7 +1775,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
|
|
|
1775
1775
|
MatMenuTrigger,
|
|
1776
1776
|
MatDivider,
|
|
1777
1777
|
NaturalFileDropDirective,
|
|
1778
|
-
], providers: [ImagePlugin], template: "<!-- eslint-disable @angular-eslint/template/cyclomatic-complexity -->\n@if (menu && !disabled) {\n <div class=\"menu-container\">\n <div class=\"menu\">\n @if (save$.observed) {\n <button matIconButton i18n-matTooltip matTooltip=\"Enregistrer\" (click)=\"save$.next()\">\n <mat-icon fontIcon=\"save\" />\n </button>\n }\n <mat-button-toggle-group hideMultipleSelectionIndicator multiple>\n @if (menu.toggleStrong) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Gras\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n >\n <mat-icon fontIcon=\"format_bold\" />\n </mat-button-toggle>\n }\n @if (menu.toggleEm) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Italique\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n >\n <mat-icon fontIcon=\"format_italic\" />\n </mat-button-toggle>\n }\n @if (menu.toggleCode) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Code\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n >\n <mat-icon fontIcon=\"code\" />\n </mat-button-toggle>\n }\n @if (menu.toggleLink) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer un lien...\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n >\n <mat-icon fontIcon=\"insert_link\" />\n </mat-button-toggle>\n }\n @if (menu.textColor) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Couleur du texte...\"\n [disabled]=\"menu.textColor.disabled\"\n [checked]=\"menu.textColor.active\"\n (click)=\"run($event, 'textColor')\"\n >\n <mat-icon fontIcon=\"format_color_text\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n <mat-menu #blockMenu=\"matMenu\">\n @if (menu.makeParagraph) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n >Paragraphe\n </button>\n }\n @if (menu.makeCodeBlock) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n >Code\n </button>\n }\n @if (menu.makeHead1) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead1.disabled\" (click)=\"run($event, 'makeHead1')\"\n >Titre 1\n </button>\n }\n @if (menu.makeHead2) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead2.disabled\" (click)=\"run($event, 'makeHead2')\"\n >Titre 2\n </button>\n }\n @if (menu.makeHead3) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead3.disabled\" (click)=\"run($event, 'makeHead3')\"\n >Titre 3\n </button>\n }\n @if (menu.makeHead4) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead4.disabled\" (click)=\"run($event, 'makeHead4')\"\n >Titre 4\n </button>\n }\n @if (menu.makeHead5) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead5.disabled\" (click)=\"run($event, 'makeHead5')\"\n >Titre 5\n </button>\n }\n @if (menu.makeHead6) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead6.disabled\" (click)=\"run($event, 'makeHead6')\"\n >Titre 6\n </button>\n }\n @if (menu.blockClass || menu.blockId) {\n <mat-divider />\n }\n @if (menu.blockClass) {\n <button mat-menu-item i18n [disabled]=\"menu.blockClass.disabled\" (click)=\"run($event, 'blockClass')\"\n >Classe...\n </button>\n }\n @if (menu.blockId) {\n <button i18n mat-menu-item [disabled]=\"menu.blockId.disabled\" (click)=\"run($event, 'blockId')\"\n >ID...\n </button>\n }\n </mat-menu>\n @if (menu.addColumnBefore) {\n <button mat-button [matMenuTriggerFor]=\"tableMenu\">\n <span i18n>Tableau</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n }\n <mat-menu #tableMenu=\"matMenu\">\n @if (menu.insertTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n >Ins\u00E9rer un tableau\n </button>\n }\n @if (menu.deleteTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n >Supprimer le tableau\n </button>\n }\n @if (menu.mergeCells) {\n <button mat-menu-item i18n [disabled]=\"menu.mergeCells.disabled\" (click)=\"run($event, 'mergeCells')\"\n >Fusionner les cellules\n </button>\n }\n @if (menu.splitCell) {\n <button mat-menu-item i18n [disabled]=\"menu.splitCell.disabled\" (click)=\"run($event, 'splitCell')\"\n >Scinder les cellules\n </button>\n }\n @if (menu.cellBackgroundColor) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.cellBackgroundColor.disabled\"\n (click)=\"run($event, 'cellBackgroundColor')\"\n >Couleur de fond...\n </button>\n }\n @if (menu.tableClass) {\n <button mat-menu-item i18n [disabled]=\"menu.tableClass.disabled\" (click)=\"run($event, 'tableClass')\"\n >Classe...\n </button>\n }\n @if (menu.tableId) {\n <button i18n mat-menu-item [disabled]=\"menu.tableId.disabled\" (click)=\"run($event, 'tableId')\"\n >ID...\n </button>\n }\n <mat-divider />\n @if (menu.addColumnBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n >Ins\u00E9rer une colonne avant\n </button>\n }\n @if (menu.addColumnAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n >Ins\u00E9rer une colonne apr\u00E8s\n </button>\n }\n @if (menu.deleteColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n >Supprimer la colonne\n </button>\n }\n <mat-divider />\n @if (menu.addRowBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n >Ins\u00E9rer une ligne avant\n </button>\n }\n @if (menu.addRowAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n >Ins\u00E9rer une ligne apr\u00E8s\n </button>\n }\n @if (menu.deleteRow) {\n <button mat-menu-item i18n [disabled]=\"menu.deleteRow.disabled\" (click)=\"run($event, 'deleteRow')\"\n >Supprimer la ligne\n </button>\n }\n <mat-divider />\n @if (menu.toggleHeaderColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n >Ent\u00EAte de colonne\n </button>\n }\n @if (menu.toggleHeaderRow) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n >Ent\u00EAte de ligne\n </button>\n }\n @if (menu.toggleHeaderCell) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n >Ent\u00EAte de cellule\n </button>\n }\n </mat-menu>\n @if (imageUploader()) {\n <button\n matIconButton\n naturalFileDrop\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer une image\"\n [accept]=\"commonImageMimeTypes\"\n [selectable]=\"true\"\n [broadcast]=\"false\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon fontIcon=\"insert_photo\" />\n </button>\n }\n @if (menu.alignLeft) {\n <mat-button-toggle-group hideSingleSelectionIndicator>\n @if (menu.alignLeft) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner gauche\"\n [disabled]=\"menu.alignLeft.disabled\"\n [checked]=\"menu.alignLeft.active\"\n (click)=\"run($event, 'alignLeft')\"\n >\n <mat-icon fontIcon=\"format_align_left\" />\n </mat-button-toggle>\n }\n @if (menu.alignCenter) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Centrer\"\n [disabled]=\"menu.alignCenter.disabled\"\n [checked]=\"menu.alignCenter.active\"\n (click)=\"run($event, 'alignCenter')\"\n >\n <mat-icon fontIcon=\"format_align_center\" />\n </mat-button-toggle>\n }\n @if (menu.alignRight) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner droite\"\n [disabled]=\"menu.alignRight.disabled\"\n [checked]=\"menu.alignRight.active\"\n (click)=\"run($event, 'alignRight')\"\n >\n <mat-icon fontIcon=\"format_align_right\" />\n </mat-button-toggle>\n }\n @if (menu.alignJustify) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Justifier\"\n [disabled]=\"menu.alignJustify.disabled\"\n [checked]=\"menu.alignJustify.active\"\n (click)=\"run($event, 'alignJustify')\"\n >\n <mat-icon fontIcon=\"format_align_justify\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n }\n @if (menu.undo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Annuler\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n >\n <mat-icon fontIcon=\"undo\" />\n </button>\n }\n @if (menu.redo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Refaire\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n >\n <mat-icon fontIcon=\"redo\" />\n </button>\n }\n @if (menu.wrapBulletList && menu.wrapBulletList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 puce\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n >\n <mat-icon fontIcon=\"format_list_bulleted\" />\n </button>\n }\n @if (menu.wrapOrderedList && menu.wrapOrderedList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 num\u00E9ro\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n >\n <mat-icon fontIcon=\"format_list_numbered\" />\n </button>\n }\n @if (menu.wrapBlockQuote && menu.wrapBlockQuote.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Citation\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n >\n <mat-icon fontIcon=\"format_quote\" />\n </button>\n }\n @if (menu.joinUp && menu.joinUp.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'\u00E9l\u00E9ment du haut\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n >\n <mat-icon fontIcon=\"move_up\" />\n </button>\n }\n @if (menu.lift && menu.lift.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"D\u00E9sindenter\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n >\n <mat-icon fontIcon=\"format_indent_decrease\" />\n </button>\n }\n @if (menu.selectParentNode && menu.selectParentNode.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"S\u00E9lectionner l'\u00E9l\u00E9ment parent\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n >\n <mat-icon fontIcon=\"select_all\" />\n </button>\n }\n </div>\n </div>\n}\n<div #editor class=\"editor-container\"></div>\n", styles: [":host{display:block;border-radius:16px;background-color:var(--mat-sys-surface-container);padding:10px}.menu{display:flex;flex-wrap:wrap;padding:10px 18px}.menu-container{position:sticky;top:-20px;z-index:999}::ng-deep .ProseMirror{--padding-right: 8px;--padding-left: 14px;position:relative;outline:none;padding:4px var(--padding-right) 4px var(--padding-left);width:calc(100% - var(--padding-right) - var(--padding-left));line-height:1.2;word-wrap:break-word;border-radius:10px;background-color:var(--mat-sys-surface);-webkit-font-variant-ligatures:none;font-variant-ligatures:none;white-space:pre-wrap}::ng-deep .ProseMirror pre{white-space:pre-wrap}::ng-deep .ProseMirror li{position:relative}::ng-deep .ProseMirror-hideselection *::selection{background:transparent}::ng-deep .ProseMirror-hideselection *::-moz-selection{background:transparent}::ng-deep .ProseMirror-hideselection{caret-color:transparent}::ng-deep .ProseMirror-selectednode{outline:2px solid #8cf}::ng-deep li.ProseMirror-selectednode{outline:none}::ng-deep li.ProseMirror-selectednode:after{position:absolute;inset:-2px -2px -2px -32px;border:2px solid #8cf;pointer-events:none;content:\"\"}::ng-deep .ProseMirror-gapcursor{display:none;position:absolute;pointer-events:none}::ng-deep .ProseMirror-gapcursor:after{display:block;position:absolute;top:-2px;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite;border-top:1px solid black;width:20px;content:\"\"}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}::ng-deep .ProseMirror-focused .ProseMirror-gapcursor{display:block}::ng-deep .ProseMirror-example-setup-style hr{margin:1em 0;border:none;padding:2px 10px}::ng-deep .ProseMirror-example-setup-style hr:after{display:block;background-color:silver;height:1px;content:\"\";line-height:2px}::ng-deep .ProseMirror ul,::ng-deep .ProseMirror ol{padding-left:30px}::ng-deep .ProseMirror blockquote{margin-right:0;margin-left:0;border-left:3px solid #eee;padding-left:1em}::ng-deep .ProseMirror-example-setup-style img{cursor:default}::ng-deep .ProseMirror p:first-child,::ng-deep .ProseMirror h1:first-child,::ng-deep .ProseMirror h2:first-child,::ng-deep .ProseMirror h3:first-child,::ng-deep .ProseMirror h4:first-child,::ng-deep .ProseMirror h5:first-child,::ng-deep .ProseMirror h6:first-child{margin-top:10px}::ng-deep .ProseMirror p{margin-bottom:1em}::ng-deep .ProseMirror .tableWrapper{overflow-x:auto}::ng-deep .ProseMirror table{border-collapse:collapse;width:100%;table-layout:fixed;overflow:hidden}::ng-deep .ProseMirror td,::ng-deep .ProseMirror th{position:relative;vertical-align:top;box-sizing:border-box}::ng-deep .ProseMirror .column-resize-handle{position:absolute;top:0;right:-2px;bottom:0;z-index:20;background-color:#adf;width:4px;pointer-events:none}::ng-deep .ProseMirror.resize-cursor{cursor:col-resize}::ng-deep .ProseMirror .selectedCell:after{position:absolute;inset:0;z-index:2;background:#c8c8ff66;pointer-events:none;content:\"\"}::ng-deep .ProseMirror table{margin:0}::ng-deep .ProseMirror th,::ng-deep .ProseMirror td{border:1px solid #ddd;padding:3px 5px;min-width:1em}::ng-deep .ProseMirror .tableWrapper{margin:1em 0}::ng-deep .ProseMirror th{font-weight:700;text-align:left}::ng-deep placeholder{display:block;animation:gradient 3s none infinite;background-size:500% 100%!important;background:linear-gradient(90deg,var(--mat-sys-primary),var(--mat-sys-primary),var(--mat-sys-tertiary),var(--mat-sys-primary),var(--mat-sys-primary));width:50px;height:50px}@keyframes gradient{0%{background-position:100% 100%}to{background-position:0 0}}button.natural-file-over{background:var(--mat-sys-primary)}\n"] }]
|
|
1778
|
+
], providers: [ImagePlugin], template: "<!-- eslint-disable @angular-eslint/template/cyclomatic-complexity -->\n@if (menu && !disabled) {\n <div class=\"menu-container\">\n <div class=\"menu\">\n @if (save$.observed) {\n <button matIconButton i18n-matTooltip matTooltip=\"Enregistrer\" (click)=\"save$.next()\">\n <mat-icon fontIcon=\"save\" />\n </button>\n }\n <mat-button-toggle-group hideMultipleSelectionIndicator multiple>\n @if (menu.toggleStrong) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Gras\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n >\n <mat-icon fontIcon=\"format_bold\" />\n </mat-button-toggle>\n }\n @if (menu.toggleEm) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Italique\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n >\n <mat-icon fontIcon=\"format_italic\" />\n </mat-button-toggle>\n }\n @if (menu.toggleCode) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Code\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n >\n <mat-icon fontIcon=\"code\" />\n </mat-button-toggle>\n }\n @if (menu.toggleLink) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer un lien...\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n >\n <mat-icon fontIcon=\"insert_link\" />\n </mat-button-toggle>\n }\n @if (menu.textColor) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Couleur du texte...\"\n [disabled]=\"menu.textColor.disabled\"\n [checked]=\"menu.textColor.active\"\n (click)=\"run($event, 'textColor')\"\n >\n <mat-icon fontIcon=\"format_color_text\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n <mat-menu #blockMenu=\"matMenu\">\n @if (menu.makeParagraph) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n >Paragraphe\n </button>\n }\n @if (menu.makeCodeBlock) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n >Code\n </button>\n }\n @if (menu.makeHead1) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead1.disabled\" (click)=\"run($event, 'makeHead1')\"\n >Titre 1\n </button>\n }\n @if (menu.makeHead2) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead2.disabled\" (click)=\"run($event, 'makeHead2')\"\n >Titre 2\n </button>\n }\n @if (menu.makeHead3) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead3.disabled\" (click)=\"run($event, 'makeHead3')\"\n >Titre 3\n </button>\n }\n @if (menu.makeHead4) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead4.disabled\" (click)=\"run($event, 'makeHead4')\"\n >Titre 4\n </button>\n }\n @if (menu.makeHead5) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead5.disabled\" (click)=\"run($event, 'makeHead5')\"\n >Titre 5\n </button>\n }\n @if (menu.makeHead6) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead6.disabled\" (click)=\"run($event, 'makeHead6')\"\n >Titre 6\n </button>\n }\n @if (menu.blockClass || menu.blockId) {\n <mat-divider />\n }\n @if (menu.blockClass) {\n <button mat-menu-item i18n [disabled]=\"menu.blockClass.disabled\" (click)=\"run($event, 'blockClass')\"\n >Classe...\n </button>\n }\n @if (menu.blockId) {\n <button i18n mat-menu-item [disabled]=\"menu.blockId.disabled\" (click)=\"run($event, 'blockId')\"\n >ID...\n </button>\n }\n </mat-menu>\n @if (menu.addColumnBefore) {\n <button mat-button [matMenuTriggerFor]=\"tableMenu\">\n <span i18n>Tableau</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n }\n <mat-menu #tableMenu=\"matMenu\">\n @if (menu.insertTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n >Ins\u00E9rer un tableau\n </button>\n }\n @if (menu.deleteTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n >Supprimer le tableau\n </button>\n }\n @if (menu.mergeCells) {\n <button mat-menu-item i18n [disabled]=\"menu.mergeCells.disabled\" (click)=\"run($event, 'mergeCells')\"\n >Fusionner les cellules\n </button>\n }\n @if (menu.splitCell) {\n <button mat-menu-item i18n [disabled]=\"menu.splitCell.disabled\" (click)=\"run($event, 'splitCell')\"\n >Scinder les cellules\n </button>\n }\n @if (menu.cellBackgroundColor) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.cellBackgroundColor.disabled\"\n (click)=\"run($event, 'cellBackgroundColor')\"\n >Couleur de fond...\n </button>\n }\n @if (menu.tableClass) {\n <button mat-menu-item i18n [disabled]=\"menu.tableClass.disabled\" (click)=\"run($event, 'tableClass')\"\n >Classe...\n </button>\n }\n @if (menu.tableId) {\n <button i18n mat-menu-item [disabled]=\"menu.tableId.disabled\" (click)=\"run($event, 'tableId')\"\n >ID...\n </button>\n }\n <mat-divider />\n @if (menu.addColumnBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n >Ins\u00E9rer une colonne avant\n </button>\n }\n @if (menu.addColumnAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n >Ins\u00E9rer une colonne apr\u00E8s\n </button>\n }\n @if (menu.deleteColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n >Supprimer la colonne\n </button>\n }\n <mat-divider />\n @if (menu.addRowBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n >Ins\u00E9rer une ligne avant\n </button>\n }\n @if (menu.addRowAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n >Ins\u00E9rer une ligne apr\u00E8s\n </button>\n }\n @if (menu.deleteRow) {\n <button mat-menu-item i18n [disabled]=\"menu.deleteRow.disabled\" (click)=\"run($event, 'deleteRow')\"\n >Supprimer la ligne\n </button>\n }\n <mat-divider />\n @if (menu.toggleHeaderColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n >Ent\u00EAte de colonne\n </button>\n }\n @if (menu.toggleHeaderRow) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n >Ent\u00EAte de ligne\n </button>\n }\n @if (menu.toggleHeaderCell) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n >Ent\u00EAte de cellule\n </button>\n }\n </mat-menu>\n @if (imageUploader()) {\n <button\n matIconButton\n naturalFileDrop\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer une image\"\n [accept]=\"commonImageMimeTypes\"\n [selectable]=\"true\"\n [broadcast]=\"false\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon fontIcon=\"insert_photo\" />\n </button>\n }\n @if (menu.alignLeft) {\n <mat-button-toggle-group hideSingleSelectionIndicator>\n @if (menu.alignLeft) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner gauche\"\n [disabled]=\"menu.alignLeft.disabled\"\n [checked]=\"menu.alignLeft.active\"\n (click)=\"run($event, 'alignLeft')\"\n >\n <mat-icon fontIcon=\"format_align_left\" />\n </mat-button-toggle>\n }\n @if (menu.alignCenter) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Centrer\"\n [disabled]=\"menu.alignCenter.disabled\"\n [checked]=\"menu.alignCenter.active\"\n (click)=\"run($event, 'alignCenter')\"\n >\n <mat-icon fontIcon=\"format_align_center\" />\n </mat-button-toggle>\n }\n @if (menu.alignRight) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner droite\"\n [disabled]=\"menu.alignRight.disabled\"\n [checked]=\"menu.alignRight.active\"\n (click)=\"run($event, 'alignRight')\"\n >\n <mat-icon fontIcon=\"format_align_right\" />\n </mat-button-toggle>\n }\n @if (menu.alignJustify) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Justifier\"\n [disabled]=\"menu.alignJustify.disabled\"\n [checked]=\"menu.alignJustify.active\"\n (click)=\"run($event, 'alignJustify')\"\n >\n <mat-icon fontIcon=\"format_align_justify\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n }\n @if (menu.undo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Annuler\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n >\n <mat-icon fontIcon=\"undo\" />\n </button>\n }\n @if (menu.redo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Refaire\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n >\n <mat-icon fontIcon=\"redo\" />\n </button>\n }\n @if (menu.wrapBulletList && menu.wrapBulletList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 puce\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n >\n <mat-icon fontIcon=\"format_list_bulleted\" />\n </button>\n }\n @if (menu.wrapOrderedList && menu.wrapOrderedList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 num\u00E9ro\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n >\n <mat-icon fontIcon=\"format_list_numbered\" />\n </button>\n }\n @if (menu.wrapBlockQuote && menu.wrapBlockQuote.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Citation\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n >\n <mat-icon fontIcon=\"format_quote\" />\n </button>\n }\n @if (menu.joinUp && menu.joinUp.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'\u00E9l\u00E9ment du haut\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n >\n <mat-icon fontIcon=\"move_up\" />\n </button>\n }\n @if (menu.lift && menu.lift.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"D\u00E9sindenter\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n >\n <mat-icon fontIcon=\"format_indent_decrease\" />\n </button>\n }\n @if (menu.selectParentNode && menu.selectParentNode.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"S\u00E9lectionner l'\u00E9l\u00E9ment parent\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n >\n <mat-icon fontIcon=\"select_all\" />\n </button>\n }\n </div>\n </div>\n}\n<div #editor class=\"editor-container\"></div>\n", styles: [":host{--background-color: var(--mat-sys-surface-container);display:block;border-radius:var(--mat-sys-corner-large);background-color:var(--background-color);padding:10px}.menu{display:flex;flex-wrap:wrap;background-color:color-mix(in srgb,var(--background-color) 90%,transparent);padding-block:10px}@supports (backdrop-filter: blur()){.menu{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:color-mix(in srgb,var(--background-color) 70%,transparent)}}.menu-container{position:sticky;top:-20px;z-index:999}::ng-deep .ProseMirror{--padding-right: 8px;--padding-left: 14px;position:relative;outline:none;padding:4px var(--padding-right) 4px var(--padding-left);width:calc(100% - var(--padding-right) - var(--padding-left));line-height:1.2;word-wrap:break-word;border-radius:10px;background-color:var(--mat-sys-surface-bright);-webkit-font-variant-ligatures:none;font-variant-ligatures:none;white-space:pre-wrap}::ng-deep .ProseMirror pre{white-space:pre-wrap}::ng-deep .ProseMirror li{position:relative}::ng-deep .ProseMirror-hideselection *::selection{background:transparent}::ng-deep .ProseMirror-hideselection *::-moz-selection{background:transparent}::ng-deep .ProseMirror-hideselection{caret-color:transparent}::ng-deep .ProseMirror-selectednode{outline:2px solid #8cf}::ng-deep li.ProseMirror-selectednode{outline:none}::ng-deep li.ProseMirror-selectednode:after{position:absolute;inset:-2px -2px -2px -32px;border:2px solid #8cf;pointer-events:none;content:\"\"}::ng-deep .ProseMirror-gapcursor{display:none;position:absolute;pointer-events:none}::ng-deep .ProseMirror-gapcursor:after{display:block;position:absolute;top:-2px;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite;border-top:1px solid black;width:20px;content:\"\"}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}::ng-deep .ProseMirror-focused .ProseMirror-gapcursor{display:block}::ng-deep .ProseMirror-example-setup-style hr{margin:1em 0;border:none;padding:2px 10px}::ng-deep .ProseMirror-example-setup-style hr:after{display:block;background-color:silver;height:1px;content:\"\";line-height:2px}::ng-deep .ProseMirror ul,::ng-deep .ProseMirror ol{padding-left:30px}::ng-deep .ProseMirror blockquote{margin-right:0;margin-left:0;border-left:3px solid #eee;padding-left:1em}::ng-deep .ProseMirror-example-setup-style img{cursor:default}::ng-deep .ProseMirror p:first-child,::ng-deep .ProseMirror h1:first-child,::ng-deep .ProseMirror h2:first-child,::ng-deep .ProseMirror h3:first-child,::ng-deep .ProseMirror h4:first-child,::ng-deep .ProseMirror h5:first-child,::ng-deep .ProseMirror h6:first-child{margin-top:10px}::ng-deep .ProseMirror p{margin-bottom:1em}::ng-deep .ProseMirror .tableWrapper{overflow-x:auto}::ng-deep .ProseMirror table{border-collapse:collapse;width:100%;table-layout:fixed;overflow:hidden}::ng-deep .ProseMirror td,::ng-deep .ProseMirror th{position:relative;vertical-align:top;box-sizing:border-box}::ng-deep .ProseMirror .column-resize-handle{position:absolute;top:0;right:-2px;bottom:0;z-index:20;background-color:#adf;width:4px;pointer-events:none}::ng-deep .ProseMirror.resize-cursor{cursor:col-resize}::ng-deep .ProseMirror .selectedCell:after{position:absolute;inset:0;z-index:2;background:#c8c8ff66;pointer-events:none;content:\"\"}::ng-deep .ProseMirror table{margin:0}::ng-deep .ProseMirror th,::ng-deep .ProseMirror td{border:1px solid #ddd;padding:3px 5px;min-width:1em}::ng-deep .ProseMirror .tableWrapper{margin:1em 0}::ng-deep .ProseMirror th{font-weight:700;text-align:left}::ng-deep placeholder{display:block;animation:gradient 3s none infinite;background-size:500% 100%!important;background:linear-gradient(90deg,var(--mat-sys-primary),var(--mat-sys-primary),var(--mat-sys-tertiary),var(--mat-sys-primary),var(--mat-sys-primary));width:50px;height:50px}@keyframes gradient{0%{background-position:100% 100%}to{background-position:0 0}}button.natural-file-over{background:var(--mat-sys-primary)}\n"] }]
|
|
1779
1779
|
}], ctorParameters: () => [], propDecorators: { editor: [{ type: i0.ViewChild, args: ['editor', { ...{ read: ElementRef }, isSignal: true }] }], contentChange: [{ type: i0.Output, args: ["contentChange"] }], imageUploader: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUploader", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], save: [{ type: i0.Output, args: ["save"] }] } });
|
|
1780
1780
|
|
|
1781
1781
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecodev-natural-editor.mjs","sources":["../../../projects/natural-editor/src/lib/custom-css/custom-css.directive.ts","../../../projects/natural-editor/src/lib/utils/image.ts","../../../projects/natural-editor/src/lib/utils/schema/paragraph-with-alignment.ts","../../../projects/natural-editor/src/lib/utils/schema/heading.ts","../../../projects/natural-editor/src/lib/utils/schema/table.ts","../../../projects/natural-editor/src/lib/utils/schema/text-color.ts","../../../projects/natural-editor/src/lib/utils/schema/schema.ts","../../../projects/natural-editor/src/lib/utils/items/item.ts","../../../projects/natural-editor/src/lib/utils/items/text-align-item.ts","../../../projects/natural-editor/src/lib/color-dialog/color-dialog.component.ts","../../../projects/natural-editor/src/lib/color-dialog/color-dialog.component.html","../../../projects/natural-editor/src/lib/utils/items/cell-background-color-item.ts","../../../projects/natural-editor/src/lib/link-dialog/link-dialog.component.ts","../../../projects/natural-editor/src/lib/link-dialog/link-dialog.component.html","../../../projects/natural-editor/src/lib/utils/items/utils.ts","../../../projects/natural-editor/src/lib/utils/items/link-item.ts","../../../projects/natural-editor/src/lib/utils/items/horizontal-rule-item.ts","../../../projects/natural-editor/src/lib/utils/items/wrap-list-item.ts","../../../projects/natural-editor/src/lib/class-dialog/class-dialog.component.ts","../../../projects/natural-editor/src/lib/class-dialog/class-dialog.component.html","../../../projects/natural-editor/src/lib/utils/items/class-item.ts","../../../projects/natural-editor/src/lib/id-dialog/id-dialog.component.ts","../../../projects/natural-editor/src/lib/id-dialog/id-dialog.component.html","../../../projects/natural-editor/src/lib/utils/items/id-item.ts","../../../projects/natural-editor/src/lib/utils/items/table-item.ts","../../../projects/natural-editor/src/lib/utils/items/text-color-item.ts","../../../projects/natural-editor/src/lib/utils/menu.ts","../../../projects/natural-editor/src/lib/utils/inputrules.ts","../../../projects/natural-editor/src/lib/utils/keymap.ts","../../../projects/natural-editor/src/lib/editor/editor.component.ts","../../../projects/natural-editor/src/lib/editor/editor.component.html","../../../projects/natural-editor/src/public-api.ts","../../../projects/natural-editor/src/ecodev-natural-editor.ts"],"sourcesContent":["import {Directive, DOCUMENT, effect, inject, input, OnDestroy} from '@angular/core';\n\n/**\n * Prefix all CSS selectors with the given selector\n *\n * This is meant to be relatively simple and might not cover advanced CSS syntax\n */\nexport function prefixCss(prefix: string, css: string): string {\n prefix = '\\n' + prefix + ' ';\n\n return css\n .replace(/([^{}]*){/gs, selectors =>\n selectors\n .split(',')\n .map(selector => {\n if (selector.trim().startsWith('@media')) {\n return selector.trim();\n } else {\n return prefix + selector.trim();\n }\n })\n .join(','),\n )\n .trim();\n}\n\nlet uniqueId = 0;\nlet componentCount = 0;\n\n/**\n * Inject custom CSS into component and scope the CSS only to this component\n *\n * Usage :\n *\n * ```html\n * <div [naturalCustomCss]=\".my-class {background: red}\">\n * <p class=\"my-class\">foo bar</p>\n * </div>\n * ```\n */\n@Directive({\n selector: '[naturalCustomCss]',\n host: {\n '[attr.data-natural-id]': 'id',\n },\n})\nexport class NaturalCustomCssDirective implements OnDestroy {\n private readonly document = inject(DOCUMENT);\n private style: HTMLStyleElement | null = null;\n protected readonly id = 'n' + ++uniqueId;\n public readonly naturalCustomCss = input.required<string | undefined>();\n\n public constructor() {\n effect(() => {\n const value = this.naturalCustomCss();\n\n if (value && !this.style) {\n this.style = this.document.createElement('style');\n this.document.head.appendChild(this.style);\n }\n\n if (this.style) {\n this.style.innerHTML = value ? prefixCss(`[data-natural-id=${this.id}]`, value) : '';\n }\n });\n }\n\n public ngOnDestroy(): void {\n this.style?.remove();\n\n // Reset uniqueId if we have no component alive anymore, so that we never reach max int\n componentCount--;\n if (componentCount <= 0) {\n uniqueId = 0;\n }\n }\n}\n","import {Decoration, DecorationSet, EditorView} from 'prosemirror-view';\nimport {EditorState, Plugin} from 'prosemirror-state';\nimport {Observable} from 'rxjs';\nimport {Schema} from 'prosemirror-model';\nimport {DOCUMENT, inject, Injectable} from '@angular/core';\n\n/**\n * Callback to upload the image to the server, and return the URL used to view the uploaded image.\n */\nexport type ImageUploader = (file: File) => Observable<string>;\n\n@Injectable({providedIn: 'root'})\nexport class ImagePlugin {\n public readonly plugin: Plugin<DecorationSet>;\n\n public constructor() {\n const document = inject(DOCUMENT);\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this.plugin = new Plugin<DecorationSet>({\n state: {\n init(): DecorationSet {\n return DecorationSet.empty;\n },\n apply(tr, set): DecorationSet {\n // Adjust decoration positions to changes made by the transaction\n set = set.map(tr.mapping, tr.doc);\n\n // See if the transaction adds or removes any placeholders\n const action = tr.getMeta(self.plugin);\n if (action?.add) {\n const widget = document.createElement('placeholder');\n const deco = Decoration.widget(action.add.pos, widget, {id: action.add.id});\n set = set.add(tr.doc, [deco]);\n } else if (action?.remove) {\n set = set.remove(set.find(undefined, undefined, spec => spec.id === action.remove.id));\n }\n\n return set;\n },\n },\n props: {\n decorations(state: EditorState): DecorationSet | undefined {\n return this.getState(state);\n },\n },\n });\n }\n\n private findPlaceholder(state: EditorState, id: Record<string, never>): number | null {\n const decorators = this.plugin.getState(state);\n const found = decorators?.find(undefined, undefined, spec => spec.id === id);\n return found?.length ? found[0].from : null;\n }\n\n public startImageUpload(view: EditorView, file: File, uploader: ImageUploader, schema: Schema): void {\n // A fresh object to act as the ID for this upload\n const id = {};\n\n // Replace the selection with a placeholder\n const tr = view.state.tr;\n if (!tr.selection.empty) {\n tr.deleteSelection();\n }\n\n tr.setMeta(this.plugin, {add: {id, pos: tr.selection.from}});\n view.dispatch(tr);\n\n uploader(file).subscribe({\n next: url => {\n const pos = this.findPlaceholder(view.state, id);\n // If the content around the placeholder has been deleted, drop\n // the image\n if (pos === null) {\n return;\n }\n\n // Otherwise, insert it at the placeholder's position, and remove\n // the placeholder\n view.dispatch(\n view.state.tr\n .replaceWith(pos, pos, schema.nodes.image.create({src: url}))\n .setMeta(this.plugin, {remove: {id}}),\n );\n },\n error: () => {\n // On failure, just clean up the placeholder\n view?.dispatch(tr.setMeta(this.plugin, {remove: {id}}));\n },\n });\n }\n}\n","import {NodeSpec} from 'prosemirror-model';\n\nconst ALIGN_PATTERN = /(left|right|center|justify)/;\ntype Attributes = {\n align: null | string;\n class: string;\n id: string;\n};\n\n/**\n * A plain paragraph textblock. Represented in the DOM\n * as a `<p>` element.\n *\n * https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js\n */\nexport const paragraphWithAlignment: NodeSpec = {\n attrs: {\n align: {default: null},\n class: {default: null},\n id: {default: null},\n },\n content: 'inline*',\n group: 'block',\n parseDOM: [\n {\n tag: 'p',\n getAttrs: (dom: Node | string): null | Attributes => {\n if (!(dom instanceof HTMLElement)) {\n return null;\n }\n\n const {textAlign} = dom.style;\n\n let align: string | null = dom.getAttribute('align') || textAlign || '';\n align = ALIGN_PATTERN.test(align) ? align : null;\n\n const id = dom.getAttribute('id') || '';\n\n return {align, class: dom.className, id};\n },\n },\n ],\n toDOM: node => {\n const {align, id} = node.attrs;\n const attrs: Record<string, string> = {};\n\n let style = '';\n if (align && align !== 'left') {\n style += `text-align: ${align};`;\n }\n\n if (style) {\n attrs.style = style;\n }\n\n if (id) {\n attrs.id = id;\n }\n\n if (node.attrs.class) {\n attrs.class = node.attrs.class;\n }\n\n return ['p', attrs, 0];\n },\n};\n","import {Attrs, NodeSpec} from 'prosemirror-model';\n\ntype Attributes = {\n class: string;\n id: null | string;\n level: number;\n};\n\nconst getAttrsForLevel = function (level: number): (node: HTMLElement | string) => Attrs | false | null {\n return (dom: Node | string): null | Attributes => {\n if (!(dom instanceof HTMLElement)) {\n return null;\n }\n const id = dom.getAttribute('id') || null;\n const attrs: Attributes = {level: level, class: dom.className, id: id};\n\n return attrs;\n };\n};\n\n/**\n * A heading textblock, with a `level` attribute that should hold the number 1 to 6,\n * with optional ID and class attributes. Parsed and serialized as `<h1>` to <h6>`\n *\n * https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js\n */\nexport const heading: NodeSpec = {\n attrs: {\n level: {default: 1},\n class: {default: null},\n id: {default: null},\n },\n content: 'inline*',\n group: 'block',\n defining: true,\n parseDOM: [\n {\n tag: 'h1',\n getAttrs: getAttrsForLevel(1),\n },\n {\n tag: 'h2',\n getAttrs: getAttrsForLevel(2),\n },\n {\n tag: 'h3',\n getAttrs: getAttrsForLevel(3),\n },\n {\n tag: 'h4',\n getAttrs: getAttrsForLevel(4),\n },\n {\n tag: 'h5',\n getAttrs: getAttrsForLevel(5),\n },\n {\n tag: 'h6',\n getAttrs: getAttrsForLevel(6),\n },\n ],\n toDOM: node => {\n const {id} = node.attrs;\n const attrs: Record<string, string> = {};\n\n if (id) {\n attrs.id = id;\n }\n\n if (node.attrs.class) {\n attrs.class = node.attrs.class;\n }\n\n return ['h' + node.attrs.level, attrs, 0];\n },\n};\n","import {MutableAttrs, TableNodes, TableNodesOptions} from 'prosemirror-tables';\nimport {Attrs, Node as ProsemirrorNode} from 'prosemirror-model';\n\ntype CellAttributes = TableNodesOptions['cellAttributes'];\n\nfunction getCellAttrs(dom: Node | string, extraAttrs: CellAttributes): null | Attrs {\n if (!(dom instanceof HTMLElement)) {\n return null;\n }\n\n const widthAttr = dom.getAttribute('data-colwidth');\n const widths = widthAttr && /^\\d+(,\\d+)*$/.test(widthAttr) ? widthAttr.split(',').map(s => Number(s)) : null;\n const colspan = Number(dom.getAttribute('colspan') || 1);\n const result: MutableAttrs = {\n colspan,\n rowspan: Number(dom.getAttribute('rowspan') || 1),\n colwidth: widths && widths.length == colspan ? widths : null,\n };\n\n for (const prop in extraAttrs) {\n const getter = extraAttrs[prop].getFromDOM;\n const value = getter?.(dom);\n if (value != null) result[prop] = value;\n }\n\n return result;\n}\n\nfunction setCellAttrs(node: ProsemirrorNode, extraAttrs: CellAttributes): undefined | Record<string, string> {\n const attrs: Record<string, string> = {};\n if (node.attrs.colspan != 1) attrs.colspan = node.attrs.colspan;\n if (node.attrs.rowspan != 1) attrs.rowspan = node.attrs.rowspan;\n if (node.attrs.colwidth) attrs['data-colwidth'] = node.attrs.colwidth.join(',');\n\n for (const prop in extraAttrs) {\n const setter = extraAttrs[prop].setDOMAttr;\n if (setter) setter(node.attrs[prop], attrs);\n }\n\n return attrs;\n}\n\n/**\n * This function creates a set of [node\n * specs](http://prosemirror.net/docs/ref/#model.SchemaSpec.nodes) for\n * `table`, `table_row`, and `table_cell` nodes types.\n *\n * It is very directly inspired by prosemirror-table\n */\nexport function tableNodes(options: TableNodesOptions): TableNodes {\n const extraAttrs = options.cellAttributes || {};\n const cellAttrs: CellAttributes = {\n colspan: {default: 1},\n rowspan: {default: 1},\n colwidth: {default: null},\n };\n\n for (const prop in extraAttrs) {\n cellAttrs[prop] = {\n default: extraAttrs[prop].default,\n };\n }\n\n return {\n table: {\n attrs: {\n class: {default: null},\n id: {default: ''},\n },\n content: 'table_row+',\n tableRole: 'table',\n isolating: true,\n group: options.tableGroup,\n parseDOM: [\n {\n tag: 'table',\n getAttrs: (dom: Node | string): null | Attrs => {\n if (!(dom instanceof HTMLElement)) {\n return null;\n }\n\n return {\n class: dom.className,\n id: dom.id,\n };\n },\n },\n ],\n toDOM: node => {\n const attrs: Record<string, string> = {};\n if (node.attrs.class) {\n attrs.class = node.attrs.class;\n }\n if (node.attrs.id) {\n attrs.id = node.attrs.id;\n }\n\n return ['table', attrs, ['tbody', 0]];\n },\n },\n table_row: {\n content: '(table_cell | table_header)*',\n tableRole: 'row',\n parseDOM: [{tag: 'tr'}],\n toDOM: () => {\n return ['tr', 0];\n },\n },\n table_cell: {\n content: options.cellContent,\n attrs: cellAttrs,\n tableRole: 'cell',\n isolating: true,\n parseDOM: [{tag: 'td', getAttrs: dom => getCellAttrs(dom, extraAttrs)}],\n toDOM: node => {\n return ['td', setCellAttrs(node, extraAttrs), 0];\n },\n },\n table_header: {\n content: options.cellContent,\n attrs: cellAttrs,\n tableRole: 'header_cell',\n isolating: true,\n parseDOM: [{tag: 'th', getAttrs: dom => getCellAttrs(dom, extraAttrs)}],\n toDOM: node => {\n return ['th', setCellAttrs(node, extraAttrs), 0];\n },\n },\n };\n}\n","import {Attrs, MarkSpec} from 'prosemirror-model';\n\nexport const textColor: MarkSpec = {\n attrs: {color: {default: '#FF0000'}},\n parseDOM: [\n {\n style: 'color',\n getAttrs: (value: string | HTMLElement): null | Attrs => {\n if (typeof value === 'string') {\n return {color: value};\n }\n\n return null;\n },\n },\n ],\n toDOM(mark) {\n return ['span', {style: `color: ${mark.attrs.color}`}, 0];\n },\n};\n","import {marks, nodes} from 'prosemirror-schema-basic';\nimport {addListNodes} from 'prosemirror-schema-list';\nimport {Schema} from 'prosemirror-model';\nimport {paragraphWithAlignment} from './paragraph-with-alignment';\nimport {heading} from './heading';\nimport {tableNodes} from './table';\nimport {textColor} from './text-color';\n\n// Keep only basic elements\ntype BasicNodes = Omit<typeof nodes, 'image' | 'code_block' | 'blockquote' | 'horizontal_rule'>;\nconst basicNodes: BasicNodes = {\n doc: nodes.doc,\n paragraph: nodes.paragraph,\n heading: nodes.heading,\n text: nodes.text,\n hard_break: nodes.hard_break,\n};\n\ntype BasicMarks = Omit<typeof marks, 'code'>;\nconst basicMarks: BasicMarks = {\n link: marks.link,\n em: marks.em,\n strong: marks.strong,\n};\n\nconst advancedMarks = {\n ...basicMarks,\n textColor: textColor,\n};\n\nconst tmpSchema = new Schema({nodes: basicNodes, marks: basicMarks});\n\nexport const basicSchema = new Schema({\n nodes: addListNodes(tmpSchema.spec.nodes, 'paragraph block*', 'block'),\n marks: tmpSchema.spec.marks,\n});\n\nconst tmpSchemaAdvanced = new Schema({\n nodes: {\n ...nodes,\n heading: heading,\n ...tableNodes({\n tableGroup: 'block',\n cellContent: 'block+',\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom) {\n return dom.style.backgroundColor || null;\n },\n setDOMAttr(value, attrs) {\n if (typeof value === 'string' && value) {\n attrs.style = ((attrs.style as string) || '') + `background-color: ${value};`;\n }\n },\n },\n },\n }),\n paragraph: paragraphWithAlignment,\n },\n marks: advancedMarks,\n});\n\nexport const advancedSchema = new Schema({\n nodes: addListNodes(tmpSchemaAdvanced.spec.nodes, 'paragraph block*', 'block'),\n marks: advancedMarks,\n});\n","import {MenuItemSpec} from 'prosemirror-menu';\nimport {EditorState} from 'prosemirror-state';\nimport {EditorView} from 'prosemirror-view';\n\n/**\n * One item of the menu.\n *\n * This is the equivalent of `MenuItem` but without all the rendering logic since we use Angular\n * templates for rendering. Also it caches the state of the item everytime the editor state changes,\n * so Angular can query the state as often as needed without performance hit.\n */\nexport class Item {\n /**\n * Whether the item is 'active' (for example, the item for toggling the strong mark might be active when the cursor is in strong text).\n */\n public active = false;\n\n /**\n * Button is shown but disabled, because the item cannot be (un-)applied\n */\n public disabled = false;\n\n /**\n * Whether the item is shown at the moment\n */\n public show = true;\n\n public constructor(public readonly spec: MenuItemSpec) {}\n\n /**\n * Update the item state according to the editor state\n */\n public update(view: EditorView, state: EditorState): void {\n if (this.spec.active) {\n this.active = this.spec.active(state);\n }\n\n if (this.spec.enable) {\n this.disabled = !this.spec.enable(state);\n }\n\n if (this.spec.select) {\n this.show = this.spec.select(state);\n }\n }\n}\n","import {Node, NodeType, Schema} from 'prosemirror-model';\nimport {AllSelection, TextSelection, Transaction} from 'prosemirror-state';\nimport {Item} from './item';\n\ntype Alignment = 'left' | 'right' | 'center' | 'justify';\n\nfunction setTextAlign(tr: Transaction, schema: Schema, alignment: null | Alignment): Transaction {\n const {selection, doc} = tr;\n if (!selection || !doc) {\n return tr;\n }\n const {from, to} = selection;\n const {nodes} = schema;\n\n const tasks: {\n node: Node;\n pos: number;\n nodeType: NodeType;\n }[] = [];\n\n alignment = alignment || null;\n\n const allowedNodeTypes = new Set([\n nodes.paragraph,\n // nodes['blockquote'],\n // nodes['listItem'],\n // nodes['heading'],\n ]);\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type;\n const align = node.attrs.align || null;\n if (align !== alignment && allowedNodeTypes.has(nodeType)) {\n tasks.push({\n node,\n pos,\n nodeType,\n });\n }\n return true;\n });\n\n if (!tasks.length) {\n return tr;\n }\n\n tasks.forEach(job => {\n const {node, pos, nodeType} = job;\n const newAttrs = {\n ...node.attrs,\n align: alignment ? alignment : null,\n };\n\n tr = tr.setNodeMarkup(pos, nodeType, newAttrs, node.marks);\n });\n\n return tr;\n}\n\nexport class TextAlignItem extends Item {\n public constructor(alignment: Alignment) {\n super({\n active: state => {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let active = false;\n doc.nodesBetween(from, to, node => {\n if (keepLooking && node.attrs.align === alignment) {\n keepLooking = false;\n active = true;\n }\n return keepLooking;\n });\n\n return active;\n },\n\n enable: state => {\n const {selection} = state;\n return selection instanceof TextSelection || selection instanceof AllSelection;\n },\n\n run: (state, dispatch): boolean => {\n const {schema, selection} = state;\n\n const tr = setTextAlign(state.tr.setSelection(selection), schema, this.active ? null : alignment);\n if (tr.docChanged) {\n dispatch?.(tr);\n return true;\n } else {\n return false;\n }\n },\n });\n }\n}\n","import {Component, inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';\nimport {ifValid, NaturalIconDirective} from '@ecodev/natural';\nimport {MatInput} from '@angular/material/input';\nimport {MatError, MatFormField, MatLabel, MatSuffix} from '@angular/material/form-field';\nimport {MatIcon} from '@angular/material/icon';\nimport {MatButton} from '@angular/material/button';\n\nexport type ColorDialogData = {\n /**\n * Empty string means no color set at all. Anything else must be a valid CSS color in hexa format.\n *\n * Eg:\n *\n * - `\"\"`\n * - `\"#ff4000\"`\n */\n color: string;\n};\n\n@Component({\n selector: 'natural-editor-color-dialog',\n imports: [\n MatDialogModule,\n FormsModule,\n ReactiveFormsModule,\n MatButton,\n MatIcon,\n NaturalIconDirective,\n MatFormField,\n MatLabel,\n MatError,\n MatSuffix,\n MatInput,\n ],\n templateUrl: './color-dialog.component.html',\n styleUrl: './color-dialog.component.scss',\n})\nexport class ColorDialogComponent {\n private dialogRef = inject<MatDialogRef<ColorDialogComponent, ColorDialogData>>(MatDialogRef);\n\n public readonly colors: string[][] = [\n [\n '#000000',\n '#111111',\n '#1c1c1c',\n '#333333',\n '#666666',\n '#808080',\n '#999999',\n '#b2b2b2',\n '#cccccc',\n '#dddddd',\n '#eeeeee',\n '#ffffff',\n ],\n [\n '#ffff00',\n '#ffbf00',\n '#ff8000',\n '#ff4000',\n '#ff0000',\n '#bf0041',\n '#800080',\n '#55308d',\n '#2a6099',\n '#158466',\n '#00a933',\n '#81d41a',\n ],\n [\n '#ffffd7',\n '#fff5ce',\n '#ffdbb6',\n '#ffd8ce',\n '#ffd7d7',\n '#f7d1d5',\n '#e0c2cd',\n '#dedce6',\n '#dee6ef',\n '#dee7e5',\n '#dde8cb',\n '#f6f9d4',\n ],\n [\n '#ffffa6',\n '#ffe994',\n '#ffb66c',\n '#ffaa95',\n '#ffa6a6',\n '#ec9ba4',\n '#bf819e',\n '#b7b3ca',\n '#b4c7dc',\n '#b3cac7',\n '#afd095',\n '#e8f2a1',\n ],\n [\n '#ffff6d',\n '#ffde59',\n '#ff972f',\n '#ff7b59',\n '#ff6d6d',\n '#e16173',\n '#a1467e',\n '#8e86ae',\n '#729fcf',\n '#81aca6',\n '#77bc65',\n '#d4ea6b',\n ],\n [\n '#ffff38',\n '#ffd428',\n '#ff860d',\n '#ff5429',\n '#ff3838',\n '#d62e4e',\n '#8d1d75',\n '#6b5e9b',\n '#5983b0',\n '#50938a',\n '#3faf46',\n '#bbe33d',\n ],\n [\n '#e6e905',\n '#e8a202',\n '#ea7500',\n '#ed4c05',\n '#f10d0c',\n '#a7074b',\n '#780373',\n '#5b277d',\n '#3465a4',\n '#168253',\n '#069a2e',\n '#5eb91e',\n ],\n [\n '#acb20c',\n '#b47804',\n '#b85c00',\n '#be480a',\n '#c9211e',\n '#861141',\n '#650953',\n '#55215b',\n '#355269',\n '#1e6a39',\n '#127622',\n '#468a1a',\n ],\n [\n '#706e0c',\n '#784b04',\n '#7b3d00',\n '#813709',\n '#8d281e',\n '#611729',\n '#4e102d',\n '#481d32',\n '#383d3c',\n '#28471f',\n '#224b12',\n '#395511',\n ],\n [\n '#443205',\n '#472702',\n '#492300',\n '#4b2204',\n '#50200c',\n '#41190d',\n '#3b160e',\n '#3a1a0f',\n '#362413',\n '#302709',\n '#2e2706',\n '#342a06',\n ],\n ];\n\n public readonly colorControl = new FormControl('', {\n validators: Validators.pattern(/^#\\p{Hex_Digit}{6}/u),\n nonNullable: true,\n });\n public readonly form = new FormGroup({\n color: this.colorControl,\n });\n\n public constructor() {\n const data = inject<ColorDialogData>(MAT_DIALOG_DATA);\n\n this.form.setValue(data);\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.getRawValue());\n }\n\n public selectColor(color: string): void {\n this.colorControl.setValue(color);\n this.maybeConfirm();\n }\n}\n","<h2 i18n mat-dialog-title>Sélectionner une couleur</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <div>\n @for (row of colors; track row) {\n <div>\n @for (color of row; track color) {\n <div class=\"color\" [style]=\"{backgroundColor: color}\" (click)=\"selectColor(color)\"> </div>\n }\n </div>\n }\n </div>\n\n <div>\n <button mat-button (click)=\"selectColor('')\">\n <mat-icon naturalIcon=\"format_color_reset\" />\n <span i18n>Transparent</span></button\n >\n </div>\n\n <mat-form-field>\n <mat-label i18n>Couleur</mat-label>\n <input matInput cdkFocusInitial [formControl]=\"colorControl\" (keydown.enter)=\"maybeConfirm()\" />\n <div\n class=\"sample\"\n matTextSuffix\n [style]=\"{backgroundColor: colorControl.valid ? colorControl.value : ''}\"\n ></div>\n @if (colorControl.hasError('pattern')) {\n <mat-error i18n>Doit être le format hexadecimal. Par exemple: #ff4000 </mat-error>\n }\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button mat-dialog-close i18n>Annuler</button>\n <button mat-stroked-button [disabled]=\"!form.valid\" (click)=\"maybeConfirm()\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {EditorState, Transaction} from 'prosemirror-state';\nimport {CellSelection, isInTable, selectionCell, setCellAttr} from 'prosemirror-tables';\nimport {EditorView} from 'prosemirror-view';\nimport {Item} from './item';\nimport {MatDialog} from '@angular/material/dialog';\nimport {ColorDialogComponent, ColorDialogData} from '../../color-dialog/color-dialog.component';\n\nconst setCellBackgroundColor = setCellAttr.bind(null, 'background');\n\nfunction findFirstBackgroundColorInSelection(state: EditorState): string {\n if (!isInTable(state)) {\n return '';\n }\n\n // For single cell selection\n const $cell = selectionCell(state);\n let foundColor: string = $cell?.nodeAfter?.attrs.background ?? '';\n if (foundColor) {\n return foundColor;\n }\n\n // For multiple cells selection\n let keepLooking = true;\n if (state.selection instanceof CellSelection) {\n state.selection.forEachCell(node => {\n const color = node.attrs.background;\n if (keepLooking && color) {\n keepLooking = false;\n foundColor = color;\n }\n });\n }\n\n return foundColor;\n}\n\nexport class CellBackgroundColorItem extends Item {\n public constructor(dialog: MatDialog) {\n super({\n enable(state: EditorState): boolean {\n // Pretend to set a unique color that is not already set, to test if we can any color at all\n const cmd = setCellBackgroundColor('#000001');\n\n return cmd(state);\n },\n run(state: EditorState, dispatch: (p: Transaction) => void, view: EditorView): void {\n dialog\n .open<ColorDialogComponent, ColorDialogData, ColorDialogData>(ColorDialogComponent, {\n data: {\n color: findFirstBackgroundColorInSelection(state),\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (dispatch && result) {\n const cmd = setCellBackgroundColor(result.color);\n cmd(state, dispatch);\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {Component, inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';\nimport {ifValid, NaturalErrorMessagePipe} from '@ecodev/natural';\nimport {MatButton} from '@angular/material/button';\nimport {MatInput} from '@angular/material/input';\nimport {MatError, MatFormField, MatLabel} from '@angular/material/form-field';\n\nexport type LinkDialogData = {\n href: string;\n title?: string;\n};\n\n@Component({\n selector: 'natural-editor-link-dialog',\n imports: [\n FormsModule,\n MatButton,\n MatDialogModule,\n MatError,\n MatFormField,\n MatInput,\n MatLabel,\n NaturalErrorMessagePipe,\n ReactiveFormsModule,\n ],\n templateUrl: './link-dialog.component.html',\n styleUrl: './link-dialog.component.scss',\n})\nexport class LinkDialogComponent {\n private dialogRef = inject<MatDialogRef<LinkDialogComponent, LinkDialogData>>(MatDialogRef);\n\n public readonly hrefControl = new FormControl('', {validators: Validators.required, nonNullable: true});\n public readonly titleControl = new FormControl('', {nonNullable: true});\n public readonly form = new FormGroup({\n href: this.hrefControl,\n title: this.titleControl,\n });\n\n public constructor() {\n const data = inject<LinkDialogData>(MAT_DIALOG_DATA);\n\n this.form.setValue({title: '', ...data});\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.getRawValue());\n }\n}\n","<h2 i18n mat-dialog-title>Insérer un lien</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>URL</mat-label>\n <input matInput [formControl]=\"hrefControl\" (keydown.enter)=\"maybeConfirm()\" />\n <mat-error>{{ hrefControl.errors | errorMessage }}</mat-error>\n </mat-form-field>\n <mat-form-field>\n <mat-label i18n>Titre</mat-label>\n <input matInput [formControl]=\"titleControl\" (keydown.enter)=\"maybeConfirm()\" />\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button mat-dialog-close i18n>Annuler</button>\n <button mat-stroked-button [disabled]=\"!form.valid\" (click)=\"maybeConfirm()\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {Command, EditorState} from 'prosemirror-state';\nimport {MarkType} from 'prosemirror-model';\nimport {MenuItem, MenuItemSpec} from 'prosemirror-menu';\nimport {Item} from './item';\nimport {toggleMark} from 'prosemirror-commands';\n\nexport function markActive(state: EditorState, type: MarkType): boolean {\n const {from, $from, to, empty} = state.selection;\n if (empty) {\n return !!type.isInSet(state.storedMarks || $from.marks());\n } else {\n return state.doc.rangeHasMark(from, to, type);\n }\n}\n\n/**\n * Convert built-in `MenuItem` into our Angular specific `Item`\n */\nexport function menuItemToItem(item: MenuItem): Item {\n return new Item(item.spec);\n}\n\n/**\n * From a `Command`, creates a new `Item` that will have an automatic `enable` spec\n */\nexport function cmdToItem(cmd: Command, options: Partial<MenuItemSpec> = {}): Item {\n const passedOptions: MenuItemSpec = {\n run: cmd,\n ...options,\n };\n\n if (!options.enable && !options.select) {\n passedOptions.enable = state => cmd(state);\n }\n\n return new Item(passedOptions);\n}\n\n/**\n * From a `MarkType`, creates a new `Item` that will have an automatic `active` and `enable` spec\n */\nexport function markTypeToItem(markType: MarkType): Item {\n return cmdToItem(toggleMark(markType), {\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n });\n}\n\nexport function selectionContainsNodeType(state: EditorState, allowedNodeTypes: string[]): boolean {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let found = false;\n\n doc.nodesBetween(from, to, node => {\n if (keepLooking && allowedNodeTypes.includes(node.type.name)) {\n keepLooking = false;\n found = true;\n }\n\n return keepLooking;\n });\n\n return found;\n}\n","import {Item} from './item';\nimport {MarkType} from 'prosemirror-model';\nimport {MatDialog} from '@angular/material/dialog';\nimport {EditorState, Transaction} from 'prosemirror-state';\nimport {EditorView} from 'prosemirror-view';\nimport {toggleMark} from 'prosemirror-commands';\nimport {LinkDialogComponent, LinkDialogData} from '../../link-dialog/link-dialog.component';\nimport {markActive} from './utils';\n\nexport class LinkItem extends Item {\n public constructor(markType: MarkType, dialog: MatDialog) {\n super({\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n enable(state: EditorState): boolean {\n return !state.selection.empty;\n },\n run(state: EditorState, dispatch: (p: Transaction) => void, view: EditorView): void {\n if (markActive(state, markType)) {\n toggleMark(markType)(state, dispatch);\n return;\n }\n\n dialog\n .open<LinkDialogComponent, LinkDialogData, LinkDialogData>(LinkDialogComponent, {\n data: {\n href: '',\n title: '',\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (result) {\n if (!result.title) {\n delete result.title;\n }\n\n toggleMark(markType, result)(view.state, view.dispatch);\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {Item} from './item';\nimport {EditorState} from 'prosemirror-state';\nimport {NodeType} from 'prosemirror-model';\n\nfunction canInsert(state: EditorState, nodeType: NodeType): boolean {\n const $from = state.selection.$from;\n for (let d = $from.depth; d >= 0; d--) {\n const index = $from.index(d);\n if ($from.node(d).canReplaceWith(index, index, nodeType)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport class HorizontalRuleItem extends Item {\n public constructor(hr: NodeType) {\n super({\n enable(state): boolean {\n return canInsert(state, hr);\n },\n run(state, dispatch): void {\n dispatch(state.tr.replaceSelectionWith(hr.create()));\n },\n });\n }\n}\n","import {NodeType} from 'prosemirror-model';\nimport {Item} from './item';\nimport {wrapInList} from 'prosemirror-schema-list';\nimport {cmdToItem} from './utils';\n\nexport function wrapListItem(nodeType: NodeType): Item {\n return cmdToItem(wrapInList(nodeType));\n}\n","import {ifValid} from '@ecodev/natural';\nimport {Component, inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';\nimport {MatButton} from '@angular/material/button';\nimport {MatInput} from '@angular/material/input';\nimport {MatError, MatFormField, MatLabel} from '@angular/material/form-field';\n\nexport type ClassDialogData = {\n /**\n * CSS class names\n *\n * Eg:\n *\n * - `\"\"`\n * - `\"my-class my-other-class\"`\n */\n class: string;\n};\n\n@Component({\n selector: 'natural-editor-class-dialog',\n imports: [MatDialogModule, FormsModule, ReactiveFormsModule, MatFormField, MatLabel, MatError, MatInput, MatButton],\n templateUrl: './class-dialog.component.html',\n styleUrl: './class-dialog.component.scss',\n})\nexport class ClassDialogComponent {\n private dialogRef = inject<MatDialogRef<ClassDialogComponent, ClassDialogData>>(MatDialogRef);\n\n public readonly classControl = new FormControl('', {\n validators: Validators.pattern(/(^\\s*(-?[_a-zA-Z]+[_a-zA-Z0-9-]*\\s*)+)/),\n nonNullable: true,\n });\n public readonly form = new FormGroup({\n class: this.classControl,\n });\n\n public constructor() {\n const data = inject<ClassDialogData>(MAT_DIALOG_DATA);\n\n this.form.setValue(data);\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.getRawValue());\n }\n}\n","<h2 i18n mat-dialog-title>Saisir les classes CSS</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>Classes CSS</mat-label>\n <input matInput cdkFocusInitial [formControl]=\"classControl\" (keydown.enter)=\"maybeConfirm()\" />\n @if (classControl.hasError('pattern')) {\n <mat-error i18n>Doit être un ou plusieurs nom de classe CSS</mat-error>\n }\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button mat-dialog-close i18n>Annuler</button>\n <button mat-stroked-button [disabled]=\"!form.valid\" (click)=\"maybeConfirm()\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {Node, NodeType} from 'prosemirror-model';\nimport {EditorState, Transaction} from 'prosemirror-state';\nimport {Item} from './item';\nimport {selectionContainsNodeType} from './utils';\nimport {MatDialog} from '@angular/material/dialog';\nimport {ClassDialogComponent, ClassDialogData} from '../../class-dialog/class-dialog.component';\n\nfunction setClass(tr: Transaction, classValue: string, allowedNodeTypes: string[]): Transaction {\n const {selection, doc} = tr;\n if (!selection || !doc) {\n return tr;\n }\n const {from, to} = selection;\n\n const tasks: {\n node: Node;\n pos: number;\n nodeType: NodeType;\n }[] = [];\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type;\n const currentClass = node.attrs.class || null;\n if (currentClass !== classValue && allowedNodeTypes.includes(nodeType.name)) {\n tasks.push({\n node,\n pos,\n nodeType,\n });\n }\n return true;\n });\n\n if (!tasks.length) {\n return tr;\n }\n\n tasks.forEach(job => {\n const {node, pos, nodeType} = job;\n const newAttrs = {\n ...node.attrs,\n class: classValue ? classValue : null,\n };\n\n tr = tr.setNodeMarkup(pos, nodeType, newAttrs, node.marks);\n });\n\n return tr;\n}\n\n/**\n * Returns the first `class` attribute that is non-empty in the selection.\n * If not found, return empty string.\n */\nfunction findFirstClassInSelection(state: EditorState, allowedNodeTypes: string[]): string {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let foundClass = '';\n\n doc.nodesBetween(from, to, node => {\n if (keepLooking && allowedNodeTypes.includes(node.type.name) && node.attrs.class) {\n keepLooking = false;\n foundClass = node.attrs.class;\n }\n\n return keepLooking;\n });\n\n return foundClass;\n}\n\nexport class ClassItem extends Item {\n public constructor(dialog: MatDialog, nodeTypes: string[]) {\n super({\n active: state => {\n return !!findFirstClassInSelection(state, nodeTypes);\n },\n\n enable: state => {\n return selectionContainsNodeType(state, nodeTypes);\n },\n\n run: (state, dispatch, view): void => {\n dialog\n .open<ClassDialogComponent, ClassDialogData, ClassDialogData>(ClassDialogComponent, {\n data: {\n class: findFirstClassInSelection(state, nodeTypes),\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (dispatch && result) {\n const {selection} = state;\n\n const tr = setClass(state.tr.setSelection(selection), result.class, nodeTypes);\n if (tr.docChanged) {\n dispatch?.(tr);\n }\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {ifValid} from '@ecodev/natural';\nimport {Component, inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';\nimport {MatButton} from '@angular/material/button';\nimport {MatInput} from '@angular/material/input';\nimport {MatError, MatFormField, MatLabel} from '@angular/material/form-field';\n\nexport type IdDialogData = {\n /**\n * ID name\n *\n * Eg:\n *\n * - `\"\"`\n * - `\"my-id\"`\n */\n id: string;\n};\n\n@Component({\n selector: 'natural-editor-id-dialog',\n imports: [MatDialogModule, FormsModule, ReactiveFormsModule, MatFormField, MatLabel, MatError, MatInput, MatButton],\n templateUrl: './id-dialog.component.html',\n styleUrl: './id-dialog.component.scss',\n})\nexport class IdDialogComponent {\n private dialogRef = inject<MatDialogRef<IdDialogComponent, IdDialogData>>(MatDialogRef);\n\n public readonly idControl = new FormControl('', {\n validators: Validators.pattern(/(^(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)+)/),\n nonNullable: true,\n });\n public readonly form = new FormGroup({\n id: this.idControl,\n });\n\n public constructor() {\n const data = inject<IdDialogData>(MAT_DIALOG_DATA);\n\n this.form.setValue(data);\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.getRawValue());\n }\n}\n","<h2 i18n mat-dialog-title>Saisir le ID</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>ID</mat-label>\n <input matInput cdkFocusInitial [formControl]=\"idControl\" (keydown.enter)=\"maybeConfirm()\" />\n @if (idControl.hasError('pattern')) {\n <mat-error i18n>Doit être un ID valide</mat-error>\n }\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button mat-dialog-close i18n>Annuler</button>\n <button mat-stroked-button [disabled]=\"!form.valid\" (click)=\"maybeConfirm()\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {Node, NodeType} from 'prosemirror-model';\nimport {EditorState, Transaction} from 'prosemirror-state';\nimport {Item} from './item';\nimport {selectionContainsNodeType} from './utils';\nimport {MatDialog} from '@angular/material/dialog';\nimport {IdDialogComponent, IdDialogData} from '../../id-dialog/id-dialog.component';\n\nfunction setId(tr: Transaction, idValue: string, allowedNodeTypes: string[]): Transaction {\n const {selection, doc} = tr;\n if (!selection || !doc) {\n return tr;\n }\n const {from, to} = selection;\n\n const tasks: {\n node: Node;\n pos: number;\n nodeType: NodeType;\n }[] = [];\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type;\n const currentId = node.attrs.id || null;\n if (currentId !== idValue && allowedNodeTypes.includes(nodeType.name)) {\n tasks.push({\n node,\n pos,\n nodeType,\n });\n }\n return true;\n });\n\n if (!tasks.length) {\n return tr;\n }\n\n tasks.forEach(job => {\n const {node, pos, nodeType} = job;\n const newAttrs = {\n ...node.attrs,\n id: idValue ? idValue : null,\n };\n\n tr = tr.setNodeMarkup(pos, nodeType, newAttrs, node.marks);\n });\n\n return tr;\n}\n\n/**\n * Returns the first `id` attribute that is non-empty in the selection.\n * If not found, return empty string.\n */\nfunction findFirstIdInSelection(state: EditorState, allowedNodeTypes: string[]): string {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let foundId = '';\n\n doc.nodesBetween(from, to, node => {\n if (keepLooking && allowedNodeTypes.includes(node.type.name) && node.attrs.id) {\n keepLooking = false;\n foundId = node.attrs.id;\n }\n\n return keepLooking;\n });\n\n return foundId;\n}\n\nexport class IdItem extends Item {\n public constructor(dialog: MatDialog, nodeTypes: string[]) {\n super({\n active: state => {\n return !!findFirstIdInSelection(state, nodeTypes);\n },\n\n enable: state => {\n return selectionContainsNodeType(state, nodeTypes);\n },\n\n run: (state, dispatch, view): void => {\n dialog\n .open<IdDialogComponent, IdDialogData, IdDialogData>(IdDialogComponent, {\n data: {\n id: findFirstIdInSelection(state, nodeTypes),\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (dispatch && result) {\n const {selection} = state;\n\n const tr = setId(state.tr.setSelection(selection), result.id, nodeTypes);\n if (tr.docChanged) {\n dispatch?.(tr);\n }\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {EditorState, TextSelection, Transaction} from 'prosemirror-state';\nimport {Fragment, Node as ProsemirrorNode, NodeType} from 'prosemirror-model';\nimport {tableNodeTypes} from 'prosemirror-tables';\nimport {Item} from './item';\n\nfunction createCell(\n cellType: NodeType,\n cellContent?: Fragment | ProsemirrorNode | ProsemirrorNode[],\n): ProsemirrorNode | null | undefined {\n return cellContent ? cellType.createChecked(null, cellContent) : cellType.createAndFill();\n}\n\nfunction createTable(\n state: EditorState,\n rowsCount: number,\n colsCount: number,\n withHeaderRow: boolean,\n cellContent?: Fragment | ProsemirrorNode | ProsemirrorNode[],\n): ProsemirrorNode {\n const types = tableNodeTypes(state.schema);\n const headerCells = [];\n const cells = [];\n\n for (let index = 0; index < colsCount; index += 1) {\n const cell = createCell(types.cell, cellContent);\n\n if (cell) {\n cells.push(cell);\n }\n\n if (withHeaderRow) {\n const headerCell = createCell(types.header_cell, cellContent);\n\n if (headerCell) {\n headerCells.push(headerCell);\n }\n }\n }\n\n const rows = [];\n\n for (let index = 0; index < rowsCount; index += 1) {\n rows.push(types.row.createChecked(null, withHeaderRow && index === 0 ? headerCells : cells));\n }\n\n return types.table.createChecked(null, rows);\n}\n\nfunction addTable(\n state: EditorState,\n dispatch?: (tr: Transaction) => void,\n {\n rowsCount = 3,\n colsCount = 3,\n withHeaderRow = true,\n cellContent,\n }: {\n rowsCount?: number;\n colsCount?: number;\n withHeaderRow?: boolean;\n cellContent?: Fragment | ProsemirrorNode | ProsemirrorNode[];\n } = {},\n): void {\n const offset = state.tr.selection.anchor + 1;\n\n const nodes = createTable(state, rowsCount, colsCount, withHeaderRow, cellContent);\n const tr = state.tr.replaceSelectionWith(nodes).scrollIntoView();\n const resolvedPos = tr.doc.resolve(offset);\n\n // move cursor into table\n tr.setSelection(TextSelection.near(resolvedPos));\n\n dispatch?.(tr);\n}\n\nexport class AddTableItem extends Item {\n public constructor() {\n super({run: (editor, tr) => addTable(editor, tr)});\n }\n}\n","import {EditorState, Transaction} from 'prosemirror-state';\nimport {EditorView} from 'prosemirror-view';\nimport {Item} from './item';\nimport {MatDialog} from '@angular/material/dialog';\nimport {ColorDialogComponent, ColorDialogData} from '../../color-dialog/color-dialog.component';\nimport {MarkType} from 'prosemirror-model';\nimport {markActive} from './utils';\nimport {toggleMark} from 'prosemirror-commands';\nimport {rgbToHex} from '@ecodev/natural';\n\nfunction findFirstColorInSelection(state: EditorState, markType: MarkType): string {\n const {selection, doc} = state;\n const {from, to} = selection;\n let foundColor = '';\n\n doc.nodesBetween(from, to, node => {\n if (foundColor) {\n return false;\n }\n\n const mark = node.marks.find(mark => mark.type === markType);\n if (mark?.attrs.color) {\n foundColor = mark.attrs.color;\n }\n\n return !foundColor;\n });\n\n return rgbToHex(foundColor);\n}\n\nexport class TextColorItem extends Item {\n public constructor(markType: MarkType, dialog: MatDialog) {\n super({\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n enable(state: EditorState): boolean {\n return !state.selection.empty;\n },\n run(state: EditorState, dispatch: (p: Transaction) => void, view: EditorView): void {\n dialog\n .open<ColorDialogComponent, ColorDialogData, ColorDialogData>(ColorDialogComponent, {\n data: {\n color: findFirstColorInSelection(state, markType),\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (result) {\n // Remove existing color before applying new one\n if (markActive(state, markType)) {\n toggleMark(markType, {}, {})(view.state, view.dispatch);\n }\n\n // Apply new color, unless we selected \"transparent\"\n if (result.color) {\n toggleMark(markType, result, {})(view.state, view.dispatch);\n }\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {\n blockTypeItem,\n joinUpItem,\n liftItem,\n redoItem,\n selectParentNodeItem,\n undoItem,\n wrapItem,\n} from 'prosemirror-menu';\nimport {MarkType, NodeType, Schema} from 'prosemirror-model';\nimport {MatDialog} from '@angular/material/dialog';\nimport {\n addColumnAfter,\n addColumnBefore,\n addRowAfter,\n addRowBefore,\n deleteColumn,\n deleteRow,\n deleteTable,\n mergeCells,\n splitCell,\n toggleHeaderCell,\n toggleHeaderColumn,\n toggleHeaderRow,\n} from 'prosemirror-tables';\nimport {Item} from './items/item';\nimport {paragraphWithAlignment} from './schema/paragraph-with-alignment';\nimport {TextAlignItem} from './items/text-align-item';\nimport {CellBackgroundColorItem} from './items/cell-background-color-item';\nimport {LinkItem} from './items/link-item';\nimport {HorizontalRuleItem} from './items/horizontal-rule-item';\nimport {cmdToItem, markTypeToItem, menuItemToItem} from './items/utils';\nimport {wrapListItem} from './items/wrap-list-item';\nimport {ClassItem} from './items/class-item';\nimport {IdItem} from './items/id-item';\nimport {AddTableItem} from './items/table-item';\nimport {TextColorItem} from './items/text-color-item';\n\nexport type Key =\n | 'toggleStrong'\n | 'toggleEm'\n | 'toggleCode'\n | 'toggleLink'\n | 'textColor'\n | 'wrapBulletList'\n | 'wrapOrderedList'\n | 'wrapBlockQuote'\n | 'makeParagraph'\n | 'makeCodeBlock'\n | 'makeHead1'\n | 'makeHead2'\n | 'makeHead3'\n | 'makeHead4'\n | 'makeHead5'\n | 'makeHead6'\n | 'alignLeft'\n | 'alignRight'\n | 'alignCenter'\n | 'alignJustify'\n | 'insertHorizontalRule'\n | 'joinUp'\n | 'lift'\n | 'selectParentNode'\n | 'undo'\n | 'redo'\n | 'insertTable'\n | 'addColumnBefore'\n | 'addColumnAfter'\n | 'deleteColumn'\n | 'addRowBefore'\n | 'addRowAfter'\n | 'deleteRow'\n | 'deleteTable'\n | 'mergeCells'\n | 'splitCell'\n | 'toggleHeaderColumn'\n | 'toggleHeaderRow'\n | 'toggleHeaderCell'\n | 'cellBackgroundColor'\n | 'tableClass'\n | 'tableId'\n | 'blockClass'\n | 'blockId';\n\nexport type MenuItems = Partial<Record<Key, Item>>;\n\n/**\n * Given a schema, look for default mark and node types in it and\n * return an object with relevant menu items relating to those marks:\n */\nexport function buildMenuItems(schema: Schema, dialog: MatDialog): MenuItems {\n const r: MenuItems = {\n joinUp: menuItemToItem(joinUpItem),\n lift: menuItemToItem(liftItem),\n selectParentNode: menuItemToItem(selectParentNodeItem),\n undo: menuItemToItem(undoItem),\n redo: menuItemToItem(redoItem),\n };\n\n let type: MarkType | NodeType | undefined;\n type = schema.marks.strong;\n if (type) {\n r.toggleStrong = markTypeToItem(type);\n }\n\n type = schema.marks.em;\n if (type) {\n r.toggleEm = markTypeToItem(type);\n }\n\n type = schema.marks.code;\n if (type) {\n r.toggleCode = markTypeToItem(type);\n }\n\n type = schema.marks.link;\n if (type) {\n r.toggleLink = new LinkItem(type, dialog);\n }\n\n type = schema.marks.textColor;\n if (type) {\n r.textColor = new TextColorItem(type, dialog);\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n r.wrapBulletList = wrapListItem(type);\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n r.wrapOrderedList = wrapListItem(type);\n }\n\n type = schema.nodes.blockquote;\n if (type) {\n r.wrapBlockQuote = menuItemToItem(wrapItem(type, {}));\n }\n\n type = schema.nodes.paragraph;\n if (type) {\n r.makeParagraph = menuItemToItem(blockTypeItem(type, {}));\n\n if (type.spec === paragraphWithAlignment) {\n r.alignLeft = new TextAlignItem('left');\n r.alignRight = new TextAlignItem('right');\n r.alignCenter = new TextAlignItem('center');\n r.alignJustify = new TextAlignItem('justify');\n }\n }\n\n type = schema.nodes.code_block;\n if (type) {\n r.makeCodeBlock = menuItemToItem(blockTypeItem(type, {}));\n }\n\n type = schema.nodes.heading;\n if (type) {\n r.makeHead1 = menuItemToItem(blockTypeItem(type, {attrs: {level: 1}}));\n r.makeHead2 = menuItemToItem(blockTypeItem(type, {attrs: {level: 2}}));\n r.makeHead3 = menuItemToItem(blockTypeItem(type, {attrs: {level: 3}}));\n r.makeHead4 = menuItemToItem(blockTypeItem(type, {attrs: {level: 4}}));\n r.makeHead5 = menuItemToItem(blockTypeItem(type, {attrs: {level: 5}}));\n r.makeHead6 = menuItemToItem(blockTypeItem(type, {attrs: {level: 6}}));\n }\n if (schema.nodes.paragraph?.spec === paragraphWithAlignment) {\n r.blockId = new IdItem(dialog, ['heading', 'paragraph']);\n r.blockClass = new ClassItem(dialog, ['heading', 'paragraph']);\n }\n\n type = schema.nodes.horizontal_rule;\n if (type) {\n r.insertHorizontalRule = new HorizontalRuleItem(type);\n }\n\n type = schema.nodes.table;\n if (type) {\n r.insertTable = new AddTableItem();\n r.addColumnBefore = cmdToItem(addColumnBefore);\n r.addColumnAfter = cmdToItem(addColumnAfter);\n r.deleteColumn = cmdToItem(deleteColumn);\n r.addRowBefore = cmdToItem(addRowBefore);\n r.addRowAfter = cmdToItem(addRowAfter);\n r.deleteRow = cmdToItem(deleteRow);\n r.deleteTable = cmdToItem(deleteTable);\n r.mergeCells = cmdToItem(mergeCells);\n r.splitCell = cmdToItem(splitCell);\n r.toggleHeaderColumn = cmdToItem(toggleHeaderColumn);\n r.toggleHeaderRow = cmdToItem(toggleHeaderRow);\n r.toggleHeaderCell = cmdToItem(toggleHeaderCell);\n r.cellBackgroundColor = new CellBackgroundColorItem(dialog);\n r.tableClass = new ClassItem(dialog, ['table']);\n r.tableId = new IdItem(dialog, ['table']);\n }\n\n return r;\n}\n","import {\n ellipsis,\n emDash,\n InputRule,\n inputRules,\n textblockTypeInputRule,\n wrappingInputRule,\n} from 'prosemirror-inputrules';\nimport {NodeType, Schema} from 'prosemirror-model';\nimport {Plugin} from 'prosemirror-state';\n\n/**\n * Given a blockquote node type, returns an input rule that turns `\"> \"`\n * at the start of a textblock into a blockquote.\n */\nfunction blockQuoteRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(/^\\s*>\\s$/, nodeType);\n}\n\n/**\n * Given a list node type, returns an input rule that turns a number\n * followed by a dot at the start of a textblock into an ordered list.\n */\nfunction orderedListRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(\n /^(\\d+)\\.\\s$/,\n nodeType,\n match => ({order: +match[1]}),\n (match, node) => node.childCount + node.attrs.order === +match[1],\n );\n}\n\n/**\n * Given a list node type, returns an input rule that turns a bullet\n * (dash, plush, or asterisk) at the start of a textblock into a\n * bullet list.\n */\nfunction bulletListRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(/^\\s*([-+*])\\s$/, nodeType);\n}\n\n/**\n * Given a code block node type, returns an input rule that turns a\n * textblock starting with three backticks into a code block.\n */\nfunction codeBlockRule(nodeType: NodeType): InputRule {\n return textblockTypeInputRule(/^```$/, nodeType);\n}\n\n/**\n * Given a node type and a maximum level, creates an input rule that\n * turns up to that number of `#` characters followed by a space at\n * the start of a textblock into a heading whose level corresponds to\n * the number of `#` signs.\n */\nfunction headingRule(nodeType: NodeType, maxLevel: number): InputRule {\n return textblockTypeInputRule(new RegExp('^(#{1,' + maxLevel + '})\\\\s$'), nodeType, match => ({\n level: match[1].length,\n }));\n}\n\n/**\n * A set of input rules for creating the basic block quotes, lists,\n * code blocks, and heading.\n */\nexport function buildInputRules(schema: Schema): Plugin {\n const rules = [ellipsis, emDash];\n\n let type = schema.nodes.blockquote;\n if (type) {\n rules.push(blockQuoteRule(type));\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n rules.push(orderedListRule(type));\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n rules.push(bulletListRule(type));\n }\n\n type = schema.nodes.code_block;\n if (type) {\n rules.push(codeBlockRule(type));\n }\n\n type = schema.nodes.heading;\n if (type) {\n rules.push(headingRule(type, 6));\n }\n\n return inputRules({rules});\n}\n","import {\n chainCommands,\n exitCode,\n joinDown,\n joinUp,\n lift,\n selectParentNode,\n setBlockType,\n toggleMark,\n wrapIn,\n} from 'prosemirror-commands';\nimport {liftListItem, sinkListItem, splitListItem, wrapInList} from 'prosemirror-schema-list';\nimport {redo, undo} from 'prosemirror-history';\nimport {undoInputRule} from 'prosemirror-inputrules';\nimport {MarkType, NodeType, Schema} from 'prosemirror-model';\nimport {Command} from 'prosemirror-state';\n\ntype Keymap = Record<string, Command>;\n\n/**\n * Inspect the given schema looking for marks and nodes from the\n * basic schema, and if found, add key bindings related to them.\n * This will add:\n *\n * * **Mod-b** for toggling [strong](#schema-basic.StrongMark)\n * * **Mod-i** for toggling [emphasis](#schema-basic.EmMark)\n * * **Mod-`** for toggling [code font](#schema-basic.CodeMark)\n * * **Ctrl-Shift-0** for making the current textblock a paragraph\n * * **Ctrl-Shift-1** to **Ctrl-Shift-Digit6** for making the current\n * textblock a heading of the corresponding level\n * * **Ctrl-Shift-Backslash** to make the current textblock a code block\n * * **Ctrl-Shift-8** to wrap the selection in an ordered list\n * * **Ctrl-Shift-9** to wrap the selection in a bullet list\n * * **Ctrl->** to wrap the selection in a block quote\n * * **Enter** to split a non-empty textblock in a list item while at\n * the same time splitting the list item\n * * **Mod-Enter** to insert a hard break\n * * **Mod-_** to insert a horizontal rule\n * * **Backspace** to undo an input rule\n * * **Alt-ArrowUp** to `joinUp`\n * * **Alt-ArrowDown** to `joinDown`\n * * **Mod-BracketLeft** to `lift`\n * * **Escape** to `selectParentNode`\n *\n * You can suppress or map these bindings by passing a `mapKeys`\n * argument, which maps key names (say `\"Mod-B\"` to either `false`, to\n * remove the binding, or a new key name string.\n */\nexport function buildKeymap(schema: Schema, isMac: boolean): Keymap {\n const keys: Keymap = {};\n\n keys['Mod-z'] = undo;\n keys['Shift-Mod-z'] = redo;\n keys.Backspace = undoInputRule;\n if (!isMac) {\n keys['Mod-y'] = redo;\n }\n\n keys['Alt-ArrowUp'] = joinUp;\n keys['Alt-ArrowDown'] = joinDown;\n keys['Mod-BracketLeft'] = lift;\n keys.Escape = selectParentNode;\n\n let type: MarkType | NodeType = schema.marks.strong;\n if (type) {\n keys['Mod-b'] = toggleMark(type);\n keys['Mod-B'] = toggleMark(type);\n }\n\n type = schema.marks.em;\n if (type) {\n keys['Mod-i'] = toggleMark(type);\n keys['Mod-I'] = toggleMark(type);\n }\n\n type = schema.marks.code;\n if (type) {\n keys['Mod-`'] = toggleMark(type);\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n keys['Shift-Ctrl-8'] = wrapInList(type);\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n keys['Shift-Ctrl-9'] = wrapInList(type);\n }\n\n type = schema.nodes.blockquote;\n if (type) {\n keys['Ctrl->'] = wrapIn(type);\n }\n\n type = schema.nodes.hard_break;\n if (type) {\n const br = type;\n const cmd = chainCommands(exitCode, (state, dispatch) => {\n dispatch?.(state.tr.replaceSelectionWith(br.create()).scrollIntoView());\n return true;\n });\n keys['Mod-Enter'] = cmd;\n keys['Shift-Enter'] = cmd;\n if (isMac) {\n keys['Ctrl-Enter'] = cmd;\n }\n }\n\n type = schema.nodes.list_item;\n if (type) {\n keys.Enter = splitListItem(type);\n keys['Mod-['] = liftListItem(type);\n keys['Mod-]'] = sinkListItem(type);\n }\n\n type = schema.nodes.paragraph;\n if (type) {\n keys['Shift-Ctrl-0'] = setBlockType(type);\n }\n\n type = schema.nodes.code_block;\n if (type) {\n keys['Shift-Ctrl-\\\\'] = setBlockType(type);\n }\n\n type = schema.nodes.heading;\n if (type) {\n for (let i = 1; i <= 6; i++) {\n keys['Shift-Ctrl-' + i] = setBlockType(type, {level: i});\n }\n }\n\n type = schema.nodes.horizontal_rule;\n if (type) {\n const hr = type;\n keys['Mod-_'] = (state, dispatch) => {\n dispatch?.(state.tr.replaceSelectionWith(hr.create()).scrollIntoView());\n return true;\n };\n }\n\n return keys;\n}\n","import {Component, DOCUMENT, ElementRef, inject, input, OnDestroy, OnInit, output, viewChild} from '@angular/core';\nimport {ControlValueAccessor, NgControl} from '@angular/forms';\nimport {EditorView} from 'prosemirror-view';\nimport {EditorState, Plugin, Transaction} from 'prosemirror-state';\nimport {DOMParser, DOMSerializer, Schema} from 'prosemirror-model';\nimport {MatDialog} from '@angular/material/dialog';\nimport {goToNextCell, tableEditing} from 'prosemirror-tables';\nimport {keymap} from 'prosemirror-keymap';\nimport {ImagePlugin, ImageUploader} from '../utils/image';\nimport {advancedSchema, basicSchema} from '../utils/schema/schema';\nimport {buildMenuItems, Key, MenuItems} from '../utils/menu';\nimport {history} from 'prosemirror-history';\nimport {baseKeymap} from 'prosemirror-commands';\nimport {dropCursor} from 'prosemirror-dropcursor';\nimport {gapCursor} from 'prosemirror-gapcursor';\nimport {buildInputRules} from '../utils/inputrules';\nimport {buildKeymap} from '../utils/keymap';\nimport {commonImageMimeTypes, NaturalFileDropDirective} from '@ecodev/natural';\nimport {MatDivider} from '@angular/material/divider';\nimport {MatMenu, MatMenuItem, MatMenuTrigger} from '@angular/material/menu';\nimport {MatButtonToggle, MatButtonToggleGroup} from '@angular/material/button-toggle';\nimport {MatIcon} from '@angular/material/icon';\nimport {MatTooltip} from '@angular/material/tooltip';\nimport {MatButton, MatIconButton} from '@angular/material/button';\nimport {Subject} from 'rxjs';\nimport {outputFromObservable} from '@angular/core/rxjs-interop';\n\n/**\n * Prosemirror component\n *\n * Usage :\n *\n * ```html\n * <natural-editor [(ngModel)]=\"htmlString\" />\n * ```\n */\n// @dynamic\n@Component({\n selector: 'natural-editor',\n imports: [\n MatButton,\n MatIconButton,\n MatTooltip,\n MatIcon,\n MatButtonToggleGroup,\n MatButtonToggle,\n MatMenu,\n MatMenuItem,\n MatMenuTrigger,\n MatDivider,\n NaturalFileDropDirective,\n ],\n templateUrl: './editor.component.html',\n styleUrl: './editor.component.scss',\n providers: [ImagePlugin],\n})\nexport class NaturalEditorComponent implements OnInit, OnDestroy, ControlValueAccessor {\n private readonly ngControl = inject(NgControl, {optional: true, self: true});\n private readonly document = inject(DOCUMENT);\n private readonly dialog = inject(MatDialog);\n private readonly imagePlugin = inject(ImagePlugin);\n protected readonly commonImageMimeTypes = commonImageMimeTypes;\n\n private view: EditorView | null = null;\n\n private readonly editor = viewChild.required('editor', {read: ElementRef});\n\n public readonly contentChange = output<string>();\n\n /**\n * Callback to upload an image and return the URL to view the image.\n *\n * If given it will enable advanced schema, including image and tables.\n * It must be given on initialization and cannot be changed later on.\n */\n public readonly imageUploader = input<ImageUploader | null>(null);\n\n /**\n * Mode must be set on initialization. Later changes will have no effect. Possible values are:\n *\n * - `basic`, the default, only offers minimal formatting options\n * - `advanced`, adds text colors, headings, alignments, and tables. If `imageUploader` is given, it will force `advanced` mode.\n */\n public readonly mode = input<'basic' | 'advanced'>('basic');\n\n private schema: Schema = basicSchema;\n\n /**\n * Interface with ControlValueAccessor\n * Notifies parent model / form controller\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * HTML string\n */\n private content = '';\n\n public menu: MenuItems | null = null;\n\n protected readonly save$ = new Subject<void>();\n\n /**\n * If subscribed to, then the save button will be shown and click events forwarded\n */\n public readonly save = outputFromObservable(this.save$);\n\n public disabled = false;\n\n public constructor() {\n if (this.ngControl !== null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n public ngOnInit(): void {\n this.schema = this.imageUploader() || this.mode() === 'advanced' ? advancedSchema : basicSchema;\n this.menu = buildMenuItems(this.schema, this.dialog);\n const serializer = DOMSerializer.fromSchema(this.schema);\n const state = this.createState();\n\n this.view = new EditorView(this.editor().nativeElement, {\n state: state,\n editable: () => !this.disabled,\n dispatchTransaction: (transaction: Transaction) => {\n if (!this.view) {\n return;\n }\n\n const newState = this.view.state.apply(transaction);\n this.view.updateState(newState);\n\n // Transform doc into HTML string\n const dom = serializer.serializeFragment(this.view.state.doc as any);\n const el = this.document.createElement('_');\n el.appendChild(dom);\n\n const newContent = el.innerHTML;\n if (this.content === newContent || this.disabled) {\n return;\n }\n\n this.content = el.innerHTML;\n\n if (this.onChange) {\n this.onChange(this.content);\n }\n this.contentChange.emit(this.content);\n },\n });\n this.update();\n }\n\n public writeValue(val: string | undefined): void {\n if (typeof val === 'string' && val !== this.content) {\n this.content = val;\n }\n\n if (this.view !== null) {\n const state = this.createState();\n this.view.updateState(state);\n }\n }\n\n private createState(): EditorState {\n const template = this.document.createElement('_');\n template.innerHTML = '<div>' + this.content + '</div>';\n if (!template.firstChild) {\n throw new Error('child of template element could not be created');\n }\n\n const parser = DOMParser.fromSchema(this.schema);\n const doc = parser.parse(template.firstChild);\n\n return EditorState.create({\n doc: doc,\n plugins: this.createPlugins(),\n });\n }\n\n private createPlugins(): Plugin[] {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const isMac = !!this.document.defaultView?.navigator.platform.match(/Mac/);\n\n const plugins = [\n buildInputRules(this.schema),\n keymap(buildKeymap(this.schema, isMac)),\n keymap(baseKeymap),\n dropCursor(),\n gapCursor(),\n history(),\n new Plugin({\n props: {\n attributes: {class: 'ProseMirror-example-setup-style'},\n },\n }),\n new Plugin({\n view: () => this,\n }),\n ];\n\n if (this.imageUploader()) {\n plugins.push(this.imagePlugin.plugin);\n }\n\n if (this.schema === advancedSchema) {\n plugins.push(\n tableEditing(),\n keymap({\n Tab: goToNextCell(1),\n 'Shift-Tab': goToNextCell(-1),\n }),\n );\n }\n\n return plugins;\n }\n\n /**\n * Called by Prosemirror whenever the editor state changes. So we update our menu states.\n */\n public update(): void {\n if (!this.view || !this.menu) {\n return;\n }\n\n for (const item of Object.values(this.menu)) {\n item.update(this.view, this.view.state);\n }\n }\n\n public registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(): void {\n // noop\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n public ngOnDestroy(): void {\n if (this.view) {\n this.view.destroy();\n this.view = null;\n }\n }\n\n public run(event: Event, key: Key): void {\n if (!this.view || !this.menu) {\n return;\n }\n\n const item = this.menu[key];\n if (!item || item.disabled || !item.show) {\n return;\n }\n\n item.spec.run(this.view.state, this.view.dispatch, this.view, event);\n this.view.focus();\n }\n\n public upload(file: File): void {\n const imageUploader = this.imageUploader();\n if (!this.view || !imageUploader) {\n return;\n }\n\n if (this.view.state.selection.$from.parent.inlineContent) {\n this.imagePlugin.startImageUpload(this.view, file, imageUploader, this.schema);\n }\n\n this.view.focus();\n }\n}\n","<!-- eslint-disable @angular-eslint/template/cyclomatic-complexity -->\n@if (menu && !disabled) {\n <div class=\"menu-container\">\n <div class=\"menu\">\n @if (save$.observed) {\n <button matIconButton i18n-matTooltip matTooltip=\"Enregistrer\" (click)=\"save$.next()\">\n <mat-icon fontIcon=\"save\" />\n </button>\n }\n <mat-button-toggle-group hideMultipleSelectionIndicator multiple>\n @if (menu.toggleStrong) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Gras\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n >\n <mat-icon fontIcon=\"format_bold\" />\n </mat-button-toggle>\n }\n @if (menu.toggleEm) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Italique\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n >\n <mat-icon fontIcon=\"format_italic\" />\n </mat-button-toggle>\n }\n @if (menu.toggleCode) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Code\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n >\n <mat-icon fontIcon=\"code\" />\n </mat-button-toggle>\n }\n @if (menu.toggleLink) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Insérer un lien...\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n >\n <mat-icon fontIcon=\"insert_link\" />\n </mat-button-toggle>\n }\n @if (menu.textColor) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Couleur du texte...\"\n [disabled]=\"menu.textColor.disabled\"\n [checked]=\"menu.textColor.active\"\n (click)=\"run($event, 'textColor')\"\n >\n <mat-icon fontIcon=\"format_color_text\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n <mat-menu #blockMenu=\"matMenu\">\n @if (menu.makeParagraph) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n >Paragraphe\n </button>\n }\n @if (menu.makeCodeBlock) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n >Code\n </button>\n }\n @if (menu.makeHead1) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead1.disabled\" (click)=\"run($event, 'makeHead1')\"\n >Titre 1\n </button>\n }\n @if (menu.makeHead2) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead2.disabled\" (click)=\"run($event, 'makeHead2')\"\n >Titre 2\n </button>\n }\n @if (menu.makeHead3) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead3.disabled\" (click)=\"run($event, 'makeHead3')\"\n >Titre 3\n </button>\n }\n @if (menu.makeHead4) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead4.disabled\" (click)=\"run($event, 'makeHead4')\"\n >Titre 4\n </button>\n }\n @if (menu.makeHead5) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead5.disabled\" (click)=\"run($event, 'makeHead5')\"\n >Titre 5\n </button>\n }\n @if (menu.makeHead6) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead6.disabled\" (click)=\"run($event, 'makeHead6')\"\n >Titre 6\n </button>\n }\n @if (menu.blockClass || menu.blockId) {\n <mat-divider />\n }\n @if (menu.blockClass) {\n <button mat-menu-item i18n [disabled]=\"menu.blockClass.disabled\" (click)=\"run($event, 'blockClass')\"\n >Classe...\n </button>\n }\n @if (menu.blockId) {\n <button i18n mat-menu-item [disabled]=\"menu.blockId.disabled\" (click)=\"run($event, 'blockId')\"\n >ID...\n </button>\n }\n </mat-menu>\n @if (menu.addColumnBefore) {\n <button mat-button [matMenuTriggerFor]=\"tableMenu\">\n <span i18n>Tableau</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n }\n <mat-menu #tableMenu=\"matMenu\">\n @if (menu.insertTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n >Insérer un tableau\n </button>\n }\n @if (menu.deleteTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n >Supprimer le tableau\n </button>\n }\n @if (menu.mergeCells) {\n <button mat-menu-item i18n [disabled]=\"menu.mergeCells.disabled\" (click)=\"run($event, 'mergeCells')\"\n >Fusionner les cellules\n </button>\n }\n @if (menu.splitCell) {\n <button mat-menu-item i18n [disabled]=\"menu.splitCell.disabled\" (click)=\"run($event, 'splitCell')\"\n >Scinder les cellules\n </button>\n }\n @if (menu.cellBackgroundColor) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.cellBackgroundColor.disabled\"\n (click)=\"run($event, 'cellBackgroundColor')\"\n >Couleur de fond...\n </button>\n }\n @if (menu.tableClass) {\n <button mat-menu-item i18n [disabled]=\"menu.tableClass.disabled\" (click)=\"run($event, 'tableClass')\"\n >Classe...\n </button>\n }\n @if (menu.tableId) {\n <button i18n mat-menu-item [disabled]=\"menu.tableId.disabled\" (click)=\"run($event, 'tableId')\"\n >ID...\n </button>\n }\n <mat-divider />\n @if (menu.addColumnBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n >Insérer une colonne avant\n </button>\n }\n @if (menu.addColumnAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n >Insérer une colonne après\n </button>\n }\n @if (menu.deleteColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n >Supprimer la colonne\n </button>\n }\n <mat-divider />\n @if (menu.addRowBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n >Insérer une ligne avant\n </button>\n }\n @if (menu.addRowAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n >Insérer une ligne après\n </button>\n }\n @if (menu.deleteRow) {\n <button mat-menu-item i18n [disabled]=\"menu.deleteRow.disabled\" (click)=\"run($event, 'deleteRow')\"\n >Supprimer la ligne\n </button>\n }\n <mat-divider />\n @if (menu.toggleHeaderColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n >Entête de colonne\n </button>\n }\n @if (menu.toggleHeaderRow) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n >Entête de ligne\n </button>\n }\n @if (menu.toggleHeaderCell) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n >Entête de cellule\n </button>\n }\n </mat-menu>\n @if (imageUploader()) {\n <button\n matIconButton\n naturalFileDrop\n i18n-matTooltip\n matTooltip=\"Insérer une image\"\n [accept]=\"commonImageMimeTypes\"\n [selectable]=\"true\"\n [broadcast]=\"false\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon fontIcon=\"insert_photo\" />\n </button>\n }\n @if (menu.alignLeft) {\n <mat-button-toggle-group hideSingleSelectionIndicator>\n @if (menu.alignLeft) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner gauche\"\n [disabled]=\"menu.alignLeft.disabled\"\n [checked]=\"menu.alignLeft.active\"\n (click)=\"run($event, 'alignLeft')\"\n >\n <mat-icon fontIcon=\"format_align_left\" />\n </mat-button-toggle>\n }\n @if (menu.alignCenter) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Centrer\"\n [disabled]=\"menu.alignCenter.disabled\"\n [checked]=\"menu.alignCenter.active\"\n (click)=\"run($event, 'alignCenter')\"\n >\n <mat-icon fontIcon=\"format_align_center\" />\n </mat-button-toggle>\n }\n @if (menu.alignRight) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner droite\"\n [disabled]=\"menu.alignRight.disabled\"\n [checked]=\"menu.alignRight.active\"\n (click)=\"run($event, 'alignRight')\"\n >\n <mat-icon fontIcon=\"format_align_right\" />\n </mat-button-toggle>\n }\n @if (menu.alignJustify) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Justifier\"\n [disabled]=\"menu.alignJustify.disabled\"\n [checked]=\"menu.alignJustify.active\"\n (click)=\"run($event, 'alignJustify')\"\n >\n <mat-icon fontIcon=\"format_align_justify\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n }\n @if (menu.undo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Annuler\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n >\n <mat-icon fontIcon=\"undo\" />\n </button>\n }\n @if (menu.redo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Refaire\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n >\n <mat-icon fontIcon=\"redo\" />\n </button>\n }\n @if (menu.wrapBulletList && menu.wrapBulletList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste à puce\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n >\n <mat-icon fontIcon=\"format_list_bulleted\" />\n </button>\n }\n @if (menu.wrapOrderedList && menu.wrapOrderedList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste à numéro\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n >\n <mat-icon fontIcon=\"format_list_numbered\" />\n </button>\n }\n @if (menu.wrapBlockQuote && menu.wrapBlockQuote.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Citation\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n >\n <mat-icon fontIcon=\"format_quote\" />\n </button>\n }\n @if (menu.joinUp && menu.joinUp.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'élément du haut\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n >\n <mat-icon fontIcon=\"move_up\" />\n </button>\n }\n @if (menu.lift && menu.lift.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Désindenter\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n >\n <mat-icon fontIcon=\"format_indent_decrease\" />\n </button>\n }\n @if (menu.selectParentNode && menu.selectParentNode.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Sélectionner l'élément parent\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n >\n <mat-icon fontIcon=\"select_all\" />\n </button>\n }\n </div>\n </div>\n}\n<div #editor class=\"editor-container\"></div>\n","/*\n * Public API Surface of natural-editor\n */\n\nexport {NaturalCustomCssDirective} from './lib/custom-css/custom-css.directive';\nexport {NaturalEditorComponent} from './lib/editor/editor.component';\nexport type {ImageUploader} from './lib/utils/image';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;AAIG;AACG,SAAU,SAAS,CAAC,MAAc,EAAE,GAAW,EAAA;AACjD,IAAA,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,GAAG;AAE5B,IAAA,OAAO;AACF,SAAA,OAAO,CAAC,aAAa,EAAE,SAAS,IAC7B;SACK,KAAK,CAAC,GAAG;SACT,GAAG,CAAC,QAAQ,IAAG;QACZ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;AACtC,YAAA,OAAO,QAAQ,CAAC,IAAI,EAAE;QAC1B;aAAO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AC;AAE7E,IAAA,MAAM,GAAe;AACjC,QAAA;YACI,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;AACZ,SAAA;AACD,QAAA;YACI,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;AACZ,SAAA;AACD,QAAA;YACI,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;AACZ,SAAA;AACD,QAAA;YACI,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;AACZ,SAAA;AACD,QAAA;YACI,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;AACZ,SAAA;AACD,QAAA;YACI,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;AACZ,SAAA;AACD,QAAA;YACI,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;AACZ,SAAA;AACD,QAAA;YACI,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YAC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EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,eAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjE7E;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ecodev-natural-editor.mjs","sources":["../../../projects/natural-editor/src/lib/custom-css/custom-css.directive.ts","../../../projects/natural-editor/src/lib/utils/image.ts","../../../projects/natural-editor/src/lib/utils/schema/paragraph-with-alignment.ts","../../../projects/natural-editor/src/lib/utils/schema/heading.ts","../../../projects/natural-editor/src/lib/utils/schema/table.ts","../../../projects/natural-editor/src/lib/utils/schema/text-color.ts","../../../projects/natural-editor/src/lib/utils/schema/schema.ts","../../../projects/natural-editor/src/lib/utils/items/item.ts","../../../projects/natural-editor/src/lib/utils/items/text-align-item.ts","../../../projects/natural-editor/src/lib/color-dialog/color-dialog.component.ts","../../../projects/natural-editor/src/lib/color-dialog/color-dialog.component.html","../../../projects/natural-editor/src/lib/utils/items/cell-background-color-item.ts","../../../projects/natural-editor/src/lib/link-dialog/link-dialog.component.ts","../../../projects/natural-editor/src/lib/link-dialog/link-dialog.component.html","../../../projects/natural-editor/src/lib/utils/items/utils.ts","../../../projects/natural-editor/src/lib/utils/items/link-item.ts","../../../projects/natural-editor/src/lib/utils/items/horizontal-rule-item.ts","../../../projects/natural-editor/src/lib/utils/items/wrap-list-item.ts","../../../projects/natural-editor/src/lib/class-dialog/class-dialog.component.ts","../../../projects/natural-editor/src/lib/class-dialog/class-dialog.component.html","../../../projects/natural-editor/src/lib/utils/items/class-item.ts","../../../projects/natural-editor/src/lib/id-dialog/id-dialog.component.ts","../../../projects/natural-editor/src/lib/id-dialog/id-dialog.component.html","../../../projects/natural-editor/src/lib/utils/items/id-item.ts","../../../projects/natural-editor/src/lib/utils/items/table-item.ts","../../../projects/natural-editor/src/lib/utils/items/text-color-item.ts","../../../projects/natural-editor/src/lib/utils/menu.ts","../../../projects/natural-editor/src/lib/utils/inputrules.ts","../../../projects/natural-editor/src/lib/utils/keymap.ts","../../../projects/natural-editor/src/lib/editor/editor.component.ts","../../../projects/natural-editor/src/lib/editor/editor.component.html","../../../projects/natural-editor/src/public-api.ts","../../../projects/natural-editor/src/ecodev-natural-editor.ts"],"sourcesContent":["import {Directive, DOCUMENT, effect, inject, input, OnDestroy} from '@angular/core';\n\n/**\n * Prefix all CSS selectors with the given selector\n *\n * This is meant to be relatively simple and might not cover advanced CSS syntax\n */\nexport function prefixCss(prefix: string, css: string): string {\n prefix = '\\n' + prefix + ' ';\n\n return css\n .replace(/([^{}]*){/gs, selectors =>\n selectors\n .split(',')\n .map(selector => {\n if (selector.trim().startsWith('@media')) {\n return selector.trim();\n } else {\n return prefix + selector.trim();\n }\n })\n .join(','),\n )\n .trim();\n}\n\nlet uniqueId = 0;\nlet componentCount = 0;\n\n/**\n * Inject custom CSS into component and scope the CSS only to this component\n *\n * Usage :\n *\n * ```html\n * <div [naturalCustomCss]=\".my-class {background: red}\">\n * <p class=\"my-class\">foo bar</p>\n * </div>\n * ```\n */\n@Directive({\n selector: '[naturalCustomCss]',\n host: {\n '[attr.data-natural-id]': 'id',\n },\n})\nexport class NaturalCustomCssDirective implements OnDestroy {\n private readonly document = inject(DOCUMENT);\n private style: HTMLStyleElement | null = null;\n protected readonly id = 'n' + ++uniqueId;\n public readonly naturalCustomCss = input.required<string | undefined>();\n\n public constructor() {\n effect(() => {\n const value = this.naturalCustomCss();\n\n if (value && !this.style) {\n this.style = this.document.createElement('style');\n this.document.head.appendChild(this.style);\n }\n\n if (this.style) {\n this.style.innerHTML = value ? prefixCss(`[data-natural-id=${this.id}]`, value) : '';\n }\n });\n }\n\n public ngOnDestroy(): void {\n this.style?.remove();\n\n // Reset uniqueId if we have no component alive anymore, so that we never reach max int\n componentCount--;\n if (componentCount <= 0) {\n uniqueId = 0;\n }\n }\n}\n","import {Decoration, DecorationSet, EditorView} from 'prosemirror-view';\nimport {EditorState, Plugin} from 'prosemirror-state';\nimport {Observable} from 'rxjs';\nimport {Schema} from 'prosemirror-model';\nimport {DOCUMENT, inject, Injectable} from '@angular/core';\n\n/**\n * Callback to upload the image to the server, and return the URL used to view the uploaded image.\n */\nexport type ImageUploader = (file: File) => Observable<string>;\n\n@Injectable({providedIn: 'root'})\nexport class ImagePlugin {\n public readonly plugin: Plugin<DecorationSet>;\n\n public constructor() {\n const document = inject(DOCUMENT);\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this.plugin = new Plugin<DecorationSet>({\n state: {\n init(): DecorationSet {\n return DecorationSet.empty;\n },\n apply(tr, set): DecorationSet {\n // Adjust decoration positions to changes made by the transaction\n set = set.map(tr.mapping, tr.doc);\n\n // See if the transaction adds or removes any placeholders\n const action = tr.getMeta(self.plugin);\n if (action?.add) {\n const widget = document.createElement('placeholder');\n const deco = Decoration.widget(action.add.pos, widget, {id: action.add.id});\n set = set.add(tr.doc, [deco]);\n } else if (action?.remove) {\n set = set.remove(set.find(undefined, undefined, spec => spec.id === action.remove.id));\n }\n\n return set;\n },\n },\n props: {\n decorations(state: EditorState): DecorationSet | undefined {\n return this.getState(state);\n },\n },\n });\n }\n\n private findPlaceholder(state: EditorState, id: Record<string, never>): number | null {\n const decorators = this.plugin.getState(state);\n const found = decorators?.find(undefined, undefined, spec => spec.id === id);\n return found?.length ? found[0].from : null;\n }\n\n public startImageUpload(view: EditorView, file: File, uploader: ImageUploader, schema: Schema): void {\n // A fresh object to act as the ID for this upload\n const id = {};\n\n // Replace the selection with a placeholder\n const tr = view.state.tr;\n if (!tr.selection.empty) {\n tr.deleteSelection();\n }\n\n tr.setMeta(this.plugin, {add: {id, pos: tr.selection.from}});\n view.dispatch(tr);\n\n uploader(file).subscribe({\n next: url => {\n const pos = this.findPlaceholder(view.state, id);\n // If the content around the placeholder has been deleted, drop\n // the image\n if (pos === null) {\n return;\n }\n\n // Otherwise, insert it at the placeholder's position, and remove\n // the placeholder\n view.dispatch(\n view.state.tr\n .replaceWith(pos, pos, schema.nodes.image.create({src: url}))\n .setMeta(this.plugin, {remove: {id}}),\n );\n },\n error: () => {\n // On failure, just clean up the placeholder\n view?.dispatch(tr.setMeta(this.plugin, {remove: {id}}));\n },\n });\n }\n}\n","import {NodeSpec} from 'prosemirror-model';\n\nconst ALIGN_PATTERN = /(left|right|center|justify)/;\ntype Attributes = {\n align: null | string;\n class: string;\n id: string;\n};\n\n/**\n * A plain paragraph textblock. Represented in the DOM\n * as a `<p>` element.\n *\n * https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js\n */\nexport const paragraphWithAlignment: NodeSpec = {\n attrs: {\n align: {default: null},\n class: {default: null},\n id: {default: null},\n },\n content: 'inline*',\n group: 'block',\n parseDOM: [\n {\n tag: 'p',\n getAttrs: (dom: Node | string): null | Attributes => {\n if (!(dom instanceof HTMLElement)) {\n return null;\n }\n\n const {textAlign} = dom.style;\n\n let align: string | null = dom.getAttribute('align') || textAlign || '';\n align = ALIGN_PATTERN.test(align) ? align : null;\n\n const id = dom.getAttribute('id') || '';\n\n return {align, class: dom.className, id};\n },\n },\n ],\n toDOM: node => {\n const {align, id} = node.attrs;\n const attrs: Record<string, string> = {};\n\n let style = '';\n if (align && align !== 'left') {\n style += `text-align: ${align};`;\n }\n\n if (style) {\n attrs.style = style;\n }\n\n if (id) {\n attrs.id = id;\n }\n\n if (node.attrs.class) {\n attrs.class = node.attrs.class;\n }\n\n return ['p', attrs, 0];\n },\n};\n","import {Attrs, NodeSpec} from 'prosemirror-model';\n\ntype Attributes = {\n class: string;\n id: null | string;\n level: number;\n};\n\nconst getAttrsForLevel = function (level: number): (node: HTMLElement | string) => Attrs | false | null {\n return (dom: Node | string): null | Attributes => {\n if (!(dom instanceof HTMLElement)) {\n return null;\n }\n const id = dom.getAttribute('id') || null;\n const attrs: Attributes = {level: level, class: dom.className, id: id};\n\n return attrs;\n };\n};\n\n/**\n * A heading textblock, with a `level` attribute that should hold the number 1 to 6,\n * with optional ID and class attributes. Parsed and serialized as `<h1>` to <h6>`\n *\n * https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js\n */\nexport const heading: NodeSpec = {\n attrs: {\n level: {default: 1},\n class: {default: null},\n id: {default: null},\n },\n content: 'inline*',\n group: 'block',\n defining: true,\n parseDOM: [\n {\n tag: 'h1',\n getAttrs: getAttrsForLevel(1),\n },\n {\n tag: 'h2',\n getAttrs: getAttrsForLevel(2),\n },\n {\n tag: 'h3',\n getAttrs: getAttrsForLevel(3),\n },\n {\n tag: 'h4',\n getAttrs: getAttrsForLevel(4),\n },\n {\n tag: 'h5',\n getAttrs: getAttrsForLevel(5),\n },\n {\n tag: 'h6',\n getAttrs: getAttrsForLevel(6),\n },\n ],\n toDOM: node => {\n const {id} = node.attrs;\n const attrs: Record<string, string> = {};\n\n if (id) {\n attrs.id = id;\n }\n\n if (node.attrs.class) {\n attrs.class = node.attrs.class;\n }\n\n return ['h' + node.attrs.level, attrs, 0];\n },\n};\n","import {MutableAttrs, TableNodes, TableNodesOptions} from 'prosemirror-tables';\nimport {Attrs, Node as ProsemirrorNode} from 'prosemirror-model';\n\ntype CellAttributes = TableNodesOptions['cellAttributes'];\n\nfunction getCellAttrs(dom: Node | string, extraAttrs: CellAttributes): null | Attrs {\n if (!(dom instanceof HTMLElement)) {\n return null;\n }\n\n const widthAttr = dom.getAttribute('data-colwidth');\n const widths = widthAttr && /^\\d+(,\\d+)*$/.test(widthAttr) ? widthAttr.split(',').map(s => Number(s)) : null;\n const colspan = Number(dom.getAttribute('colspan') || 1);\n const result: MutableAttrs = {\n colspan,\n rowspan: Number(dom.getAttribute('rowspan') || 1),\n colwidth: widths && widths.length == colspan ? widths : null,\n };\n\n for (const prop in extraAttrs) {\n const getter = extraAttrs[prop].getFromDOM;\n const value = getter?.(dom);\n if (value != null) result[prop] = value;\n }\n\n return result;\n}\n\nfunction setCellAttrs(node: ProsemirrorNode, extraAttrs: CellAttributes): undefined | Record<string, string> {\n const attrs: Record<string, string> = {};\n if (node.attrs.colspan != 1) attrs.colspan = node.attrs.colspan;\n if (node.attrs.rowspan != 1) attrs.rowspan = node.attrs.rowspan;\n if (node.attrs.colwidth) attrs['data-colwidth'] = node.attrs.colwidth.join(',');\n\n for (const prop in extraAttrs) {\n const setter = extraAttrs[prop].setDOMAttr;\n if (setter) setter(node.attrs[prop], attrs);\n }\n\n return attrs;\n}\n\n/**\n * This function creates a set of [node\n * specs](http://prosemirror.net/docs/ref/#model.SchemaSpec.nodes) for\n * `table`, `table_row`, and `table_cell` nodes types.\n *\n * It is very directly inspired by prosemirror-table\n */\nexport function tableNodes(options: TableNodesOptions): TableNodes {\n const extraAttrs = options.cellAttributes || {};\n const cellAttrs: CellAttributes = {\n colspan: {default: 1},\n rowspan: {default: 1},\n colwidth: {default: null},\n };\n\n for (const prop in extraAttrs) {\n cellAttrs[prop] = {\n default: extraAttrs[prop].default,\n };\n }\n\n return {\n table: {\n attrs: {\n class: {default: null},\n id: {default: ''},\n },\n content: 'table_row+',\n tableRole: 'table',\n isolating: true,\n group: options.tableGroup,\n parseDOM: [\n {\n tag: 'table',\n getAttrs: (dom: Node | string): null | Attrs => {\n if (!(dom instanceof HTMLElement)) {\n return null;\n }\n\n return {\n class: dom.className,\n id: dom.id,\n };\n },\n },\n ],\n toDOM: node => {\n const attrs: Record<string, string> = {};\n if (node.attrs.class) {\n attrs.class = node.attrs.class;\n }\n if (node.attrs.id) {\n attrs.id = node.attrs.id;\n }\n\n return ['table', attrs, ['tbody', 0]];\n },\n },\n table_row: {\n content: '(table_cell | table_header)*',\n tableRole: 'row',\n parseDOM: [{tag: 'tr'}],\n toDOM: () => {\n return ['tr', 0];\n },\n },\n table_cell: {\n content: options.cellContent,\n attrs: cellAttrs,\n tableRole: 'cell',\n isolating: true,\n parseDOM: [{tag: 'td', getAttrs: dom => getCellAttrs(dom, extraAttrs)}],\n toDOM: node => {\n return ['td', setCellAttrs(node, extraAttrs), 0];\n },\n },\n table_header: {\n content: options.cellContent,\n attrs: cellAttrs,\n tableRole: 'header_cell',\n isolating: true,\n parseDOM: [{tag: 'th', getAttrs: dom => getCellAttrs(dom, extraAttrs)}],\n toDOM: node => {\n return ['th', setCellAttrs(node, extraAttrs), 0];\n },\n },\n };\n}\n","import {Attrs, MarkSpec} from 'prosemirror-model';\n\nexport const textColor: MarkSpec = {\n attrs: {color: {default: '#FF0000'}},\n parseDOM: [\n {\n style: 'color',\n getAttrs: (value: string | HTMLElement): null | Attrs => {\n if (typeof value === 'string') {\n return {color: value};\n }\n\n return null;\n },\n },\n ],\n toDOM(mark) {\n return ['span', {style: `color: ${mark.attrs.color}`}, 0];\n },\n};\n","import {marks, nodes} from 'prosemirror-schema-basic';\nimport {addListNodes} from 'prosemirror-schema-list';\nimport {Schema} from 'prosemirror-model';\nimport {paragraphWithAlignment} from './paragraph-with-alignment';\nimport {heading} from './heading';\nimport {tableNodes} from './table';\nimport {textColor} from './text-color';\n\n// Keep only basic elements\ntype BasicNodes = Omit<typeof nodes, 'image' | 'code_block' | 'blockquote' | 'horizontal_rule'>;\nconst basicNodes: BasicNodes = {\n doc: nodes.doc,\n paragraph: nodes.paragraph,\n heading: nodes.heading,\n text: nodes.text,\n hard_break: nodes.hard_break,\n};\n\ntype BasicMarks = Omit<typeof marks, 'code'>;\nconst basicMarks: BasicMarks = {\n link: marks.link,\n em: marks.em,\n strong: marks.strong,\n};\n\nconst advancedMarks = {\n ...basicMarks,\n textColor: textColor,\n};\n\nconst tmpSchema = new Schema({nodes: basicNodes, marks: basicMarks});\n\nexport const basicSchema = new Schema({\n nodes: addListNodes(tmpSchema.spec.nodes, 'paragraph block*', 'block'),\n marks: tmpSchema.spec.marks,\n});\n\nconst tmpSchemaAdvanced = new Schema({\n nodes: {\n ...nodes,\n heading: heading,\n ...tableNodes({\n tableGroup: 'block',\n cellContent: 'block+',\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom) {\n return dom.style.backgroundColor || null;\n },\n setDOMAttr(value, attrs) {\n if (typeof value === 'string' && value) {\n attrs.style = ((attrs.style as string) || '') + `background-color: ${value};`;\n }\n },\n },\n },\n }),\n paragraph: paragraphWithAlignment,\n },\n marks: advancedMarks,\n});\n\nexport const advancedSchema = new Schema({\n nodes: addListNodes(tmpSchemaAdvanced.spec.nodes, 'paragraph block*', 'block'),\n marks: advancedMarks,\n});\n","import {MenuItemSpec} from 'prosemirror-menu';\nimport {EditorState} from 'prosemirror-state';\nimport {EditorView} from 'prosemirror-view';\n\n/**\n * One item of the menu.\n *\n * This is the equivalent of `MenuItem` but without all the rendering logic since we use Angular\n * templates for rendering. Also it caches the state of the item everytime the editor state changes,\n * so Angular can query the state as often as needed without performance hit.\n */\nexport class Item {\n /**\n * Whether the item is 'active' (for example, the item for toggling the strong mark might be active when the cursor is in strong text).\n */\n public active = false;\n\n /**\n * Button is shown but disabled, because the item cannot be (un-)applied\n */\n public disabled = false;\n\n /**\n * Whether the item is shown at the moment\n */\n public show = true;\n\n public constructor(public readonly spec: MenuItemSpec) {}\n\n /**\n * Update the item state according to the editor state\n */\n public update(view: EditorView, state: EditorState): void {\n if (this.spec.active) {\n this.active = this.spec.active(state);\n }\n\n if (this.spec.enable) {\n this.disabled = !this.spec.enable(state);\n }\n\n if (this.spec.select) {\n this.show = this.spec.select(state);\n }\n }\n}\n","import {Node, NodeType, Schema} from 'prosemirror-model';\nimport {AllSelection, TextSelection, Transaction} from 'prosemirror-state';\nimport {Item} from './item';\n\ntype Alignment = 'left' | 'right' | 'center' | 'justify';\n\nfunction setTextAlign(tr: Transaction, schema: Schema, alignment: null | Alignment): Transaction {\n const {selection, doc} = tr;\n if (!selection || !doc) {\n return tr;\n }\n const {from, to} = selection;\n const {nodes} = schema;\n\n const tasks: {\n node: Node;\n pos: number;\n nodeType: NodeType;\n }[] = [];\n\n alignment = alignment || null;\n\n const allowedNodeTypes = new Set([\n nodes.paragraph,\n // nodes['blockquote'],\n // nodes['listItem'],\n // nodes['heading'],\n ]);\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type;\n const align = node.attrs.align || null;\n if (align !== alignment && allowedNodeTypes.has(nodeType)) {\n tasks.push({\n node,\n pos,\n nodeType,\n });\n }\n return true;\n });\n\n if (!tasks.length) {\n return tr;\n }\n\n tasks.forEach(job => {\n const {node, pos, nodeType} = job;\n const newAttrs = {\n ...node.attrs,\n align: alignment ? alignment : null,\n };\n\n tr = tr.setNodeMarkup(pos, nodeType, newAttrs, node.marks);\n });\n\n return tr;\n}\n\nexport class TextAlignItem extends Item {\n public constructor(alignment: Alignment) {\n super({\n active: state => {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let active = false;\n doc.nodesBetween(from, to, node => {\n if (keepLooking && node.attrs.align === alignment) {\n keepLooking = false;\n active = true;\n }\n return keepLooking;\n });\n\n return active;\n },\n\n enable: state => {\n const {selection} = state;\n return selection instanceof TextSelection || selection instanceof AllSelection;\n },\n\n run: (state, dispatch): boolean => {\n const {schema, selection} = state;\n\n const tr = setTextAlign(state.tr.setSelection(selection), schema, this.active ? null : alignment);\n if (tr.docChanged) {\n dispatch?.(tr);\n return true;\n } else {\n return false;\n }\n },\n });\n }\n}\n","import {Component, inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';\nimport {ifValid, NaturalIconDirective} from '@ecodev/natural';\nimport {MatInput} from '@angular/material/input';\nimport {MatError, MatFormField, MatLabel, MatSuffix} from '@angular/material/form-field';\nimport {MatIcon} from '@angular/material/icon';\nimport {MatButton} from '@angular/material/button';\n\nexport type ColorDialogData = {\n /**\n * Empty string means no color set at all. Anything else must be a valid CSS color in hexa format.\n *\n * Eg:\n *\n * - `\"\"`\n * - `\"#ff4000\"`\n */\n color: string;\n};\n\n@Component({\n selector: 'natural-editor-color-dialog',\n imports: [\n MatDialogModule,\n FormsModule,\n ReactiveFormsModule,\n MatButton,\n MatIcon,\n NaturalIconDirective,\n MatFormField,\n MatLabel,\n MatError,\n MatSuffix,\n MatInput,\n ],\n templateUrl: './color-dialog.component.html',\n styleUrl: './color-dialog.component.scss',\n})\nexport class ColorDialogComponent {\n private dialogRef = inject<MatDialogRef<ColorDialogComponent, ColorDialogData>>(MatDialogRef);\n\n public readonly colors: string[][] = [\n [\n '#000000',\n '#111111',\n '#1c1c1c',\n '#333333',\n '#666666',\n '#808080',\n '#999999',\n '#b2b2b2',\n '#cccccc',\n '#dddddd',\n '#eeeeee',\n '#ffffff',\n ],\n [\n '#ffff00',\n '#ffbf00',\n '#ff8000',\n '#ff4000',\n '#ff0000',\n '#bf0041',\n '#800080',\n '#55308d',\n '#2a6099',\n '#158466',\n '#00a933',\n '#81d41a',\n ],\n [\n '#ffffd7',\n '#fff5ce',\n '#ffdbb6',\n '#ffd8ce',\n '#ffd7d7',\n '#f7d1d5',\n '#e0c2cd',\n '#dedce6',\n '#dee6ef',\n '#dee7e5',\n '#dde8cb',\n '#f6f9d4',\n ],\n [\n '#ffffa6',\n '#ffe994',\n '#ffb66c',\n '#ffaa95',\n '#ffa6a6',\n '#ec9ba4',\n '#bf819e',\n '#b7b3ca',\n '#b4c7dc',\n '#b3cac7',\n '#afd095',\n '#e8f2a1',\n ],\n [\n '#ffff6d',\n '#ffde59',\n '#ff972f',\n '#ff7b59',\n '#ff6d6d',\n '#e16173',\n '#a1467e',\n '#8e86ae',\n '#729fcf',\n '#81aca6',\n '#77bc65',\n '#d4ea6b',\n ],\n [\n '#ffff38',\n '#ffd428',\n '#ff860d',\n '#ff5429',\n '#ff3838',\n '#d62e4e',\n '#8d1d75',\n '#6b5e9b',\n '#5983b0',\n '#50938a',\n '#3faf46',\n '#bbe33d',\n ],\n [\n '#e6e905',\n '#e8a202',\n '#ea7500',\n '#ed4c05',\n '#f10d0c',\n '#a7074b',\n '#780373',\n '#5b277d',\n '#3465a4',\n '#168253',\n '#069a2e',\n '#5eb91e',\n ],\n [\n '#acb20c',\n '#b47804',\n '#b85c00',\n '#be480a',\n '#c9211e',\n '#861141',\n '#650953',\n '#55215b',\n '#355269',\n '#1e6a39',\n '#127622',\n '#468a1a',\n ],\n [\n '#706e0c',\n '#784b04',\n '#7b3d00',\n '#813709',\n '#8d281e',\n '#611729',\n '#4e102d',\n '#481d32',\n '#383d3c',\n '#28471f',\n '#224b12',\n '#395511',\n ],\n [\n '#443205',\n '#472702',\n '#492300',\n '#4b2204',\n '#50200c',\n '#41190d',\n '#3b160e',\n '#3a1a0f',\n '#362413',\n '#302709',\n '#2e2706',\n '#342a06',\n ],\n ];\n\n public readonly colorControl = new FormControl('', {\n validators: Validators.pattern(/^#\\p{Hex_Digit}{6}/u),\n nonNullable: true,\n });\n public readonly form = new FormGroup({\n color: this.colorControl,\n });\n\n public constructor() {\n const data = inject<ColorDialogData>(MAT_DIALOG_DATA);\n\n this.form.setValue(data);\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.getRawValue());\n }\n\n public selectColor(color: string): void {\n this.colorControl.setValue(color);\n this.maybeConfirm();\n }\n}\n","<h2 i18n mat-dialog-title>Sélectionner une couleur</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <div>\n @for (row of colors; track row) {\n <div>\n @for (color of row; track color) {\n <div class=\"color\" [style]=\"{backgroundColor: color}\" (click)=\"selectColor(color)\"> </div>\n }\n </div>\n }\n </div>\n\n <div>\n <button mat-button (click)=\"selectColor('')\">\n <mat-icon naturalIcon=\"format_color_reset\" />\n <span i18n>Transparent</span></button\n >\n </div>\n\n <mat-form-field>\n <mat-label i18n>Couleur</mat-label>\n <input matInput cdkFocusInitial [formControl]=\"colorControl\" (keydown.enter)=\"maybeConfirm()\" />\n <div\n class=\"sample\"\n matTextSuffix\n [style]=\"{backgroundColor: colorControl.valid ? colorControl.value : ''}\"\n ></div>\n @if (colorControl.hasError('pattern')) {\n <mat-error i18n>Doit être le format hexadecimal. Par exemple: #ff4000 </mat-error>\n }\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button mat-dialog-close i18n>Annuler</button>\n <button mat-stroked-button [disabled]=\"!form.valid\" (click)=\"maybeConfirm()\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {EditorState, Transaction} from 'prosemirror-state';\nimport {CellSelection, isInTable, selectionCell, setCellAttr} from 'prosemirror-tables';\nimport {EditorView} from 'prosemirror-view';\nimport {Item} from './item';\nimport {MatDialog} from '@angular/material/dialog';\nimport {ColorDialogComponent, ColorDialogData} from '../../color-dialog/color-dialog.component';\n\nconst setCellBackgroundColor = setCellAttr.bind(null, 'background');\n\nfunction findFirstBackgroundColorInSelection(state: EditorState): string {\n if (!isInTable(state)) {\n return '';\n }\n\n // For single cell selection\n const $cell = selectionCell(state);\n let foundColor: string = $cell?.nodeAfter?.attrs.background ?? '';\n if (foundColor) {\n return foundColor;\n }\n\n // For multiple cells selection\n let keepLooking = true;\n if (state.selection instanceof CellSelection) {\n state.selection.forEachCell(node => {\n const color = node.attrs.background;\n if (keepLooking && color) {\n keepLooking = false;\n foundColor = color;\n }\n });\n }\n\n return foundColor;\n}\n\nexport class CellBackgroundColorItem extends Item {\n public constructor(dialog: MatDialog) {\n super({\n enable(state: EditorState): boolean {\n // Pretend to set a unique color that is not already set, to test if we can any color at all\n const cmd = setCellBackgroundColor('#000001');\n\n return cmd(state);\n },\n run(state: EditorState, dispatch: (p: Transaction) => void, view: EditorView): void {\n dialog\n .open<ColorDialogComponent, ColorDialogData, ColorDialogData>(ColorDialogComponent, {\n data: {\n color: findFirstBackgroundColorInSelection(state),\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (dispatch && result) {\n const cmd = setCellBackgroundColor(result.color);\n cmd(state, dispatch);\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {Component, inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';\nimport {ifValid, NaturalErrorMessagePipe} from '@ecodev/natural';\nimport {MatButton} from '@angular/material/button';\nimport {MatInput} from '@angular/material/input';\nimport {MatError, MatFormField, MatLabel} from '@angular/material/form-field';\n\nexport type LinkDialogData = {\n href: string;\n title?: string;\n};\n\n@Component({\n selector: 'natural-editor-link-dialog',\n imports: [\n FormsModule,\n MatButton,\n MatDialogModule,\n MatError,\n MatFormField,\n MatInput,\n MatLabel,\n NaturalErrorMessagePipe,\n ReactiveFormsModule,\n ],\n templateUrl: './link-dialog.component.html',\n styleUrl: './link-dialog.component.scss',\n})\nexport class LinkDialogComponent {\n private dialogRef = inject<MatDialogRef<LinkDialogComponent, LinkDialogData>>(MatDialogRef);\n\n public readonly hrefControl = new FormControl('', {validators: Validators.required, nonNullable: true});\n public readonly titleControl = new FormControl('', {nonNullable: true});\n public readonly form = new FormGroup({\n href: this.hrefControl,\n title: this.titleControl,\n });\n\n public constructor() {\n const data = inject<LinkDialogData>(MAT_DIALOG_DATA);\n\n this.form.setValue({title: '', ...data});\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.getRawValue());\n }\n}\n","<h2 i18n mat-dialog-title>Insérer un lien</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>URL</mat-label>\n <input matInput [formControl]=\"hrefControl\" (keydown.enter)=\"maybeConfirm()\" />\n <mat-error>{{ hrefControl.errors | errorMessage }}</mat-error>\n </mat-form-field>\n <mat-form-field>\n <mat-label i18n>Titre</mat-label>\n <input matInput [formControl]=\"titleControl\" (keydown.enter)=\"maybeConfirm()\" />\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button mat-dialog-close i18n>Annuler</button>\n <button mat-stroked-button [disabled]=\"!form.valid\" (click)=\"maybeConfirm()\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {Command, EditorState} from 'prosemirror-state';\nimport {MarkType} from 'prosemirror-model';\nimport {MenuItem, MenuItemSpec} from 'prosemirror-menu';\nimport {Item} from './item';\nimport {toggleMark} from 'prosemirror-commands';\n\nexport function markActive(state: EditorState, type: MarkType): boolean {\n const {from, $from, to, empty} = state.selection;\n if (empty) {\n return !!type.isInSet(state.storedMarks || $from.marks());\n } else {\n return state.doc.rangeHasMark(from, to, type);\n }\n}\n\n/**\n * Convert built-in `MenuItem` into our Angular specific `Item`\n */\nexport function menuItemToItem(item: MenuItem): Item {\n return new Item(item.spec);\n}\n\n/**\n * From a `Command`, creates a new `Item` that will have an automatic `enable` spec\n */\nexport function cmdToItem(cmd: Command, options: Partial<MenuItemSpec> = {}): Item {\n const passedOptions: MenuItemSpec = {\n run: cmd,\n ...options,\n };\n\n if (!options.enable && !options.select) {\n passedOptions.enable = state => cmd(state);\n }\n\n return new Item(passedOptions);\n}\n\n/**\n * From a `MarkType`, creates a new `Item` that will have an automatic `active` and `enable` spec\n */\nexport function markTypeToItem(markType: MarkType): Item {\n return cmdToItem(toggleMark(markType), {\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n });\n}\n\nexport function selectionContainsNodeType(state: EditorState, allowedNodeTypes: string[]): boolean {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let found = false;\n\n doc.nodesBetween(from, to, node => {\n if (keepLooking && allowedNodeTypes.includes(node.type.name)) {\n keepLooking = false;\n found = true;\n }\n\n return keepLooking;\n });\n\n return found;\n}\n","import {Item} from './item';\nimport {MarkType} from 'prosemirror-model';\nimport {MatDialog} from '@angular/material/dialog';\nimport {EditorState, Transaction} from 'prosemirror-state';\nimport {EditorView} from 'prosemirror-view';\nimport {toggleMark} from 'prosemirror-commands';\nimport {LinkDialogComponent, LinkDialogData} from '../../link-dialog/link-dialog.component';\nimport {markActive} from './utils';\n\nexport class LinkItem extends Item {\n public constructor(markType: MarkType, dialog: MatDialog) {\n super({\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n enable(state: EditorState): boolean {\n return !state.selection.empty;\n },\n run(state: EditorState, dispatch: (p: Transaction) => void, view: EditorView): void {\n if (markActive(state, markType)) {\n toggleMark(markType)(state, dispatch);\n return;\n }\n\n dialog\n .open<LinkDialogComponent, LinkDialogData, LinkDialogData>(LinkDialogComponent, {\n data: {\n href: '',\n title: '',\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (result) {\n if (!result.title) {\n delete result.title;\n }\n\n toggleMark(markType, result)(view.state, view.dispatch);\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {Item} from './item';\nimport {EditorState} from 'prosemirror-state';\nimport {NodeType} from 'prosemirror-model';\n\nfunction canInsert(state: EditorState, nodeType: NodeType): boolean {\n const $from = state.selection.$from;\n for (let d = $from.depth; d >= 0; d--) {\n const index = $from.index(d);\n if ($from.node(d).canReplaceWith(index, index, nodeType)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport class HorizontalRuleItem extends Item {\n public constructor(hr: NodeType) {\n super({\n enable(state): boolean {\n return canInsert(state, hr);\n },\n run(state, dispatch): void {\n dispatch(state.tr.replaceSelectionWith(hr.create()));\n },\n });\n }\n}\n","import {NodeType} from 'prosemirror-model';\nimport {Item} from './item';\nimport {wrapInList} from 'prosemirror-schema-list';\nimport {cmdToItem} from './utils';\n\nexport function wrapListItem(nodeType: NodeType): Item {\n return cmdToItem(wrapInList(nodeType));\n}\n","import {ifValid} from '@ecodev/natural';\nimport {Component, inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';\nimport {MatButton} from '@angular/material/button';\nimport {MatInput} from '@angular/material/input';\nimport {MatError, MatFormField, MatLabel} from '@angular/material/form-field';\n\nexport type ClassDialogData = {\n /**\n * CSS class names\n *\n * Eg:\n *\n * - `\"\"`\n * - `\"my-class my-other-class\"`\n */\n class: string;\n};\n\n@Component({\n selector: 'natural-editor-class-dialog',\n imports: [MatDialogModule, FormsModule, ReactiveFormsModule, MatFormField, MatLabel, MatError, MatInput, MatButton],\n templateUrl: './class-dialog.component.html',\n styleUrl: './class-dialog.component.scss',\n})\nexport class ClassDialogComponent {\n private dialogRef = inject<MatDialogRef<ClassDialogComponent, ClassDialogData>>(MatDialogRef);\n\n public readonly classControl = new FormControl('', {\n validators: Validators.pattern(/(^\\s*(-?[_a-zA-Z]+[_a-zA-Z0-9-]*\\s*)+)/),\n nonNullable: true,\n });\n public readonly form = new FormGroup({\n class: this.classControl,\n });\n\n public constructor() {\n const data = inject<ClassDialogData>(MAT_DIALOG_DATA);\n\n this.form.setValue(data);\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.getRawValue());\n }\n}\n","<h2 i18n mat-dialog-title>Saisir les classes CSS</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>Classes CSS</mat-label>\n <input matInput cdkFocusInitial [formControl]=\"classControl\" (keydown.enter)=\"maybeConfirm()\" />\n @if (classControl.hasError('pattern')) {\n <mat-error i18n>Doit être un ou plusieurs nom de classe CSS</mat-error>\n }\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button mat-dialog-close i18n>Annuler</button>\n <button mat-stroked-button [disabled]=\"!form.valid\" (click)=\"maybeConfirm()\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {Node, NodeType} from 'prosemirror-model';\nimport {EditorState, Transaction} from 'prosemirror-state';\nimport {Item} from './item';\nimport {selectionContainsNodeType} from './utils';\nimport {MatDialog} from '@angular/material/dialog';\nimport {ClassDialogComponent, ClassDialogData} from '../../class-dialog/class-dialog.component';\n\nfunction setClass(tr: Transaction, classValue: string, allowedNodeTypes: string[]): Transaction {\n const {selection, doc} = tr;\n if (!selection || !doc) {\n return tr;\n }\n const {from, to} = selection;\n\n const tasks: {\n node: Node;\n pos: number;\n nodeType: NodeType;\n }[] = [];\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type;\n const currentClass = node.attrs.class || null;\n if (currentClass !== classValue && allowedNodeTypes.includes(nodeType.name)) {\n tasks.push({\n node,\n pos,\n nodeType,\n });\n }\n return true;\n });\n\n if (!tasks.length) {\n return tr;\n }\n\n tasks.forEach(job => {\n const {node, pos, nodeType} = job;\n const newAttrs = {\n ...node.attrs,\n class: classValue ? classValue : null,\n };\n\n tr = tr.setNodeMarkup(pos, nodeType, newAttrs, node.marks);\n });\n\n return tr;\n}\n\n/**\n * Returns the first `class` attribute that is non-empty in the selection.\n * If not found, return empty string.\n */\nfunction findFirstClassInSelection(state: EditorState, allowedNodeTypes: string[]): string {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let foundClass = '';\n\n doc.nodesBetween(from, to, node => {\n if (keepLooking && allowedNodeTypes.includes(node.type.name) && node.attrs.class) {\n keepLooking = false;\n foundClass = node.attrs.class;\n }\n\n return keepLooking;\n });\n\n return foundClass;\n}\n\nexport class ClassItem extends Item {\n public constructor(dialog: MatDialog, nodeTypes: string[]) {\n super({\n active: state => {\n return !!findFirstClassInSelection(state, nodeTypes);\n },\n\n enable: state => {\n return selectionContainsNodeType(state, nodeTypes);\n },\n\n run: (state, dispatch, view): void => {\n dialog\n .open<ClassDialogComponent, ClassDialogData, ClassDialogData>(ClassDialogComponent, {\n data: {\n class: findFirstClassInSelection(state, nodeTypes),\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (dispatch && result) {\n const {selection} = state;\n\n const tr = setClass(state.tr.setSelection(selection), result.class, nodeTypes);\n if (tr.docChanged) {\n dispatch?.(tr);\n }\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {ifValid} from '@ecodev/natural';\nimport {Component, inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';\nimport {MatButton} from '@angular/material/button';\nimport {MatInput} from '@angular/material/input';\nimport {MatError, MatFormField, MatLabel} from '@angular/material/form-field';\n\nexport type IdDialogData = {\n /**\n * ID name\n *\n * Eg:\n *\n * - `\"\"`\n * - `\"my-id\"`\n */\n id: string;\n};\n\n@Component({\n selector: 'natural-editor-id-dialog',\n imports: [MatDialogModule, FormsModule, ReactiveFormsModule, MatFormField, MatLabel, MatError, MatInput, MatButton],\n templateUrl: './id-dialog.component.html',\n styleUrl: './id-dialog.component.scss',\n})\nexport class IdDialogComponent {\n private dialogRef = inject<MatDialogRef<IdDialogComponent, IdDialogData>>(MatDialogRef);\n\n public readonly idControl = new FormControl('', {\n validators: Validators.pattern(/(^(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)+)/),\n nonNullable: true,\n });\n public readonly form = new FormGroup({\n id: this.idControl,\n });\n\n public constructor() {\n const data = inject<IdDialogData>(MAT_DIALOG_DATA);\n\n this.form.setValue(data);\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.getRawValue());\n }\n}\n","<h2 i18n mat-dialog-title>Saisir le ID</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>ID</mat-label>\n <input matInput cdkFocusInitial [formControl]=\"idControl\" (keydown.enter)=\"maybeConfirm()\" />\n @if (idControl.hasError('pattern')) {\n <mat-error i18n>Doit être un ID valide</mat-error>\n }\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button mat-dialog-close i18n>Annuler</button>\n <button mat-stroked-button [disabled]=\"!form.valid\" (click)=\"maybeConfirm()\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {Node, NodeType} from 'prosemirror-model';\nimport {EditorState, Transaction} from 'prosemirror-state';\nimport {Item} from './item';\nimport {selectionContainsNodeType} from './utils';\nimport {MatDialog} from '@angular/material/dialog';\nimport {IdDialogComponent, IdDialogData} from '../../id-dialog/id-dialog.component';\n\nfunction setId(tr: Transaction, idValue: string, allowedNodeTypes: string[]): Transaction {\n const {selection, doc} = tr;\n if (!selection || !doc) {\n return tr;\n }\n const {from, to} = selection;\n\n const tasks: {\n node: Node;\n pos: number;\n nodeType: NodeType;\n }[] = [];\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type;\n const currentId = node.attrs.id || null;\n if (currentId !== idValue && allowedNodeTypes.includes(nodeType.name)) {\n tasks.push({\n node,\n pos,\n nodeType,\n });\n }\n return true;\n });\n\n if (!tasks.length) {\n return tr;\n }\n\n tasks.forEach(job => {\n const {node, pos, nodeType} = job;\n const newAttrs = {\n ...node.attrs,\n id: idValue ? idValue : null,\n };\n\n tr = tr.setNodeMarkup(pos, nodeType, newAttrs, node.marks);\n });\n\n return tr;\n}\n\n/**\n * Returns the first `id` attribute that is non-empty in the selection.\n * If not found, return empty string.\n */\nfunction findFirstIdInSelection(state: EditorState, allowedNodeTypes: string[]): string {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let foundId = '';\n\n doc.nodesBetween(from, to, node => {\n if (keepLooking && allowedNodeTypes.includes(node.type.name) && node.attrs.id) {\n keepLooking = false;\n foundId = node.attrs.id;\n }\n\n return keepLooking;\n });\n\n return foundId;\n}\n\nexport class IdItem extends Item {\n public constructor(dialog: MatDialog, nodeTypes: string[]) {\n super({\n active: state => {\n return !!findFirstIdInSelection(state, nodeTypes);\n },\n\n enable: state => {\n return selectionContainsNodeType(state, nodeTypes);\n },\n\n run: (state, dispatch, view): void => {\n dialog\n .open<IdDialogComponent, IdDialogData, IdDialogData>(IdDialogComponent, {\n data: {\n id: findFirstIdInSelection(state, nodeTypes),\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (dispatch && result) {\n const {selection} = state;\n\n const tr = setId(state.tr.setSelection(selection), result.id, nodeTypes);\n if (tr.docChanged) {\n dispatch?.(tr);\n }\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {EditorState, TextSelection, Transaction} from 'prosemirror-state';\nimport {Fragment, Node as ProsemirrorNode, NodeType} from 'prosemirror-model';\nimport {tableNodeTypes} from 'prosemirror-tables';\nimport {Item} from './item';\n\nfunction createCell(\n cellType: NodeType,\n cellContent?: Fragment | ProsemirrorNode | ProsemirrorNode[],\n): ProsemirrorNode | null | undefined {\n return cellContent ? cellType.createChecked(null, cellContent) : cellType.createAndFill();\n}\n\nfunction createTable(\n state: EditorState,\n rowsCount: number,\n colsCount: number,\n withHeaderRow: boolean,\n cellContent?: Fragment | ProsemirrorNode | ProsemirrorNode[],\n): ProsemirrorNode {\n const types = tableNodeTypes(state.schema);\n const headerCells = [];\n const cells = [];\n\n for (let index = 0; index < colsCount; index += 1) {\n const cell = createCell(types.cell, cellContent);\n\n if (cell) {\n cells.push(cell);\n }\n\n if (withHeaderRow) {\n const headerCell = createCell(types.header_cell, cellContent);\n\n if (headerCell) {\n headerCells.push(headerCell);\n }\n }\n }\n\n const rows = [];\n\n for (let index = 0; index < rowsCount; index += 1) {\n rows.push(types.row.createChecked(null, withHeaderRow && index === 0 ? headerCells : cells));\n }\n\n return types.table.createChecked(null, rows);\n}\n\nfunction addTable(\n state: EditorState,\n dispatch?: (tr: Transaction) => void,\n {\n rowsCount = 3,\n colsCount = 3,\n withHeaderRow = true,\n cellContent,\n }: {\n rowsCount?: number;\n colsCount?: number;\n withHeaderRow?: boolean;\n cellContent?: Fragment | ProsemirrorNode | ProsemirrorNode[];\n } = {},\n): void {\n const offset = state.tr.selection.anchor + 1;\n\n const nodes = createTable(state, rowsCount, colsCount, withHeaderRow, cellContent);\n const tr = state.tr.replaceSelectionWith(nodes).scrollIntoView();\n const resolvedPos = tr.doc.resolve(offset);\n\n // move cursor into table\n tr.setSelection(TextSelection.near(resolvedPos));\n\n dispatch?.(tr);\n}\n\nexport class AddTableItem extends Item {\n public constructor() {\n super({run: (editor, tr) => addTable(editor, tr)});\n }\n}\n","import {EditorState, Transaction} from 'prosemirror-state';\nimport {EditorView} from 'prosemirror-view';\nimport {Item} from './item';\nimport {MatDialog} from '@angular/material/dialog';\nimport {ColorDialogComponent, ColorDialogData} from '../../color-dialog/color-dialog.component';\nimport {MarkType} from 'prosemirror-model';\nimport {markActive} from './utils';\nimport {toggleMark} from 'prosemirror-commands';\nimport {rgbToHex} from '@ecodev/natural';\n\nfunction findFirstColorInSelection(state: EditorState, markType: MarkType): string {\n const {selection, doc} = state;\n const {from, to} = selection;\n let foundColor = '';\n\n doc.nodesBetween(from, to, node => {\n if (foundColor) {\n return false;\n }\n\n const mark = node.marks.find(mark => mark.type === markType);\n if (mark?.attrs.color) {\n foundColor = mark.attrs.color;\n }\n\n return !foundColor;\n });\n\n return rgbToHex(foundColor);\n}\n\nexport class TextColorItem extends Item {\n public constructor(markType: MarkType, dialog: MatDialog) {\n super({\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n enable(state: EditorState): boolean {\n return !state.selection.empty;\n },\n run(state: EditorState, dispatch: (p: Transaction) => void, view: EditorView): void {\n dialog\n .open<ColorDialogComponent, ColorDialogData, ColorDialogData>(ColorDialogComponent, {\n data: {\n color: findFirstColorInSelection(state, markType),\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (result) {\n // Remove existing color before applying new one\n if (markActive(state, markType)) {\n toggleMark(markType, {}, {})(view.state, view.dispatch);\n }\n\n // Apply new color, unless we selected \"transparent\"\n if (result.color) {\n toggleMark(markType, result, {})(view.state, view.dispatch);\n }\n }\n\n view.focus();\n });\n },\n });\n }\n}\n","import {\n blockTypeItem,\n joinUpItem,\n liftItem,\n redoItem,\n selectParentNodeItem,\n undoItem,\n wrapItem,\n} from 'prosemirror-menu';\nimport {MarkType, NodeType, Schema} from 'prosemirror-model';\nimport {MatDialog} from '@angular/material/dialog';\nimport {\n addColumnAfter,\n addColumnBefore,\n addRowAfter,\n addRowBefore,\n deleteColumn,\n deleteRow,\n deleteTable,\n mergeCells,\n splitCell,\n toggleHeaderCell,\n toggleHeaderColumn,\n toggleHeaderRow,\n} from 'prosemirror-tables';\nimport {Item} from './items/item';\nimport {paragraphWithAlignment} from './schema/paragraph-with-alignment';\nimport {TextAlignItem} from './items/text-align-item';\nimport {CellBackgroundColorItem} from './items/cell-background-color-item';\nimport {LinkItem} from './items/link-item';\nimport {HorizontalRuleItem} from './items/horizontal-rule-item';\nimport {cmdToItem, markTypeToItem, menuItemToItem} from './items/utils';\nimport {wrapListItem} from './items/wrap-list-item';\nimport {ClassItem} from './items/class-item';\nimport {IdItem} from './items/id-item';\nimport {AddTableItem} from './items/table-item';\nimport {TextColorItem} from './items/text-color-item';\n\nexport type Key =\n | 'toggleStrong'\n | 'toggleEm'\n | 'toggleCode'\n | 'toggleLink'\n | 'textColor'\n | 'wrapBulletList'\n | 'wrapOrderedList'\n | 'wrapBlockQuote'\n | 'makeParagraph'\n | 'makeCodeBlock'\n | 'makeHead1'\n | 'makeHead2'\n | 'makeHead3'\n | 'makeHead4'\n | 'makeHead5'\n | 'makeHead6'\n | 'alignLeft'\n | 'alignRight'\n | 'alignCenter'\n | 'alignJustify'\n | 'insertHorizontalRule'\n | 'joinUp'\n | 'lift'\n | 'selectParentNode'\n | 'undo'\n | 'redo'\n | 'insertTable'\n | 'addColumnBefore'\n | 'addColumnAfter'\n | 'deleteColumn'\n | 'addRowBefore'\n | 'addRowAfter'\n | 'deleteRow'\n | 'deleteTable'\n | 'mergeCells'\n | 'splitCell'\n | 'toggleHeaderColumn'\n | 'toggleHeaderRow'\n | 'toggleHeaderCell'\n | 'cellBackgroundColor'\n | 'tableClass'\n | 'tableId'\n | 'blockClass'\n | 'blockId';\n\nexport type MenuItems = Partial<Record<Key, Item>>;\n\n/**\n * Given a schema, look for default mark and node types in it and\n * return an object with relevant menu items relating to those marks:\n */\nexport function buildMenuItems(schema: Schema, dialog: MatDialog): MenuItems {\n const r: MenuItems = {\n joinUp: menuItemToItem(joinUpItem),\n lift: menuItemToItem(liftItem),\n selectParentNode: menuItemToItem(selectParentNodeItem),\n undo: menuItemToItem(undoItem),\n redo: menuItemToItem(redoItem),\n };\n\n let type: MarkType | NodeType | undefined;\n type = schema.marks.strong;\n if (type) {\n r.toggleStrong = markTypeToItem(type);\n }\n\n type = schema.marks.em;\n if (type) {\n r.toggleEm = markTypeToItem(type);\n }\n\n type = schema.marks.code;\n if (type) {\n r.toggleCode = markTypeToItem(type);\n }\n\n type = schema.marks.link;\n if (type) {\n r.toggleLink = new LinkItem(type, dialog);\n }\n\n type = schema.marks.textColor;\n if (type) {\n r.textColor = new TextColorItem(type, dialog);\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n r.wrapBulletList = wrapListItem(type);\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n r.wrapOrderedList = wrapListItem(type);\n }\n\n type = schema.nodes.blockquote;\n if (type) {\n r.wrapBlockQuote = menuItemToItem(wrapItem(type, {}));\n }\n\n type = schema.nodes.paragraph;\n if (type) {\n r.makeParagraph = menuItemToItem(blockTypeItem(type, {}));\n\n if (type.spec === paragraphWithAlignment) {\n r.alignLeft = new TextAlignItem('left');\n r.alignRight = new TextAlignItem('right');\n r.alignCenter = new TextAlignItem('center');\n r.alignJustify = new TextAlignItem('justify');\n }\n }\n\n type = schema.nodes.code_block;\n if (type) {\n r.makeCodeBlock = menuItemToItem(blockTypeItem(type, {}));\n }\n\n type = schema.nodes.heading;\n if (type) {\n r.makeHead1 = menuItemToItem(blockTypeItem(type, {attrs: {level: 1}}));\n r.makeHead2 = menuItemToItem(blockTypeItem(type, {attrs: {level: 2}}));\n r.makeHead3 = menuItemToItem(blockTypeItem(type, {attrs: {level: 3}}));\n r.makeHead4 = menuItemToItem(blockTypeItem(type, {attrs: {level: 4}}));\n r.makeHead5 = menuItemToItem(blockTypeItem(type, {attrs: {level: 5}}));\n r.makeHead6 = menuItemToItem(blockTypeItem(type, {attrs: {level: 6}}));\n }\n if (schema.nodes.paragraph?.spec === paragraphWithAlignment) {\n r.blockId = new IdItem(dialog, ['heading', 'paragraph']);\n r.blockClass = new ClassItem(dialog, ['heading', 'paragraph']);\n }\n\n type = schema.nodes.horizontal_rule;\n if (type) {\n r.insertHorizontalRule = new HorizontalRuleItem(type);\n }\n\n type = schema.nodes.table;\n if (type) {\n r.insertTable = new AddTableItem();\n r.addColumnBefore = cmdToItem(addColumnBefore);\n r.addColumnAfter = cmdToItem(addColumnAfter);\n r.deleteColumn = cmdToItem(deleteColumn);\n r.addRowBefore = cmdToItem(addRowBefore);\n r.addRowAfter = cmdToItem(addRowAfter);\n r.deleteRow = cmdToItem(deleteRow);\n r.deleteTable = cmdToItem(deleteTable);\n r.mergeCells = cmdToItem(mergeCells);\n r.splitCell = cmdToItem(splitCell);\n r.toggleHeaderColumn = cmdToItem(toggleHeaderColumn);\n r.toggleHeaderRow = cmdToItem(toggleHeaderRow);\n r.toggleHeaderCell = cmdToItem(toggleHeaderCell);\n r.cellBackgroundColor = new CellBackgroundColorItem(dialog);\n r.tableClass = new ClassItem(dialog, ['table']);\n r.tableId = new IdItem(dialog, ['table']);\n }\n\n return r;\n}\n","import {\n ellipsis,\n emDash,\n InputRule,\n inputRules,\n textblockTypeInputRule,\n wrappingInputRule,\n} from 'prosemirror-inputrules';\nimport {NodeType, Schema} from 'prosemirror-model';\nimport {Plugin} from 'prosemirror-state';\n\n/**\n * Given a blockquote node type, returns an input rule that turns `\"> \"`\n * at the start of a textblock into a blockquote.\n */\nfunction blockQuoteRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(/^\\s*>\\s$/, nodeType);\n}\n\n/**\n * Given a list node type, returns an input rule that turns a number\n * followed by a dot at the start of a textblock into an ordered list.\n */\nfunction orderedListRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(\n /^(\\d+)\\.\\s$/,\n nodeType,\n match => ({order: +match[1]}),\n (match, node) => node.childCount + node.attrs.order === +match[1],\n );\n}\n\n/**\n * Given a list node type, returns an input rule that turns a bullet\n * (dash, plush, or asterisk) at the start of a textblock into a\n * bullet list.\n */\nfunction bulletListRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(/^\\s*([-+*])\\s$/, nodeType);\n}\n\n/**\n * Given a code block node type, returns an input rule that turns a\n * textblock starting with three backticks into a code block.\n */\nfunction codeBlockRule(nodeType: NodeType): InputRule {\n return textblockTypeInputRule(/^```$/, nodeType);\n}\n\n/**\n * Given a node type and a maximum level, creates an input rule that\n * turns up to that number of `#` characters followed by a space at\n * the start of a textblock into a heading whose level corresponds to\n * the number of `#` signs.\n */\nfunction headingRule(nodeType: NodeType, maxLevel: number): InputRule {\n return textblockTypeInputRule(new RegExp('^(#{1,' + maxLevel + '})\\\\s$'), nodeType, match => ({\n level: match[1].length,\n }));\n}\n\n/**\n * A set of input rules for creating the basic block quotes, lists,\n * code blocks, and heading.\n */\nexport function buildInputRules(schema: Schema): Plugin {\n const rules = [ellipsis, emDash];\n\n let type = schema.nodes.blockquote;\n if (type) {\n rules.push(blockQuoteRule(type));\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n rules.push(orderedListRule(type));\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n rules.push(bulletListRule(type));\n }\n\n type = schema.nodes.code_block;\n if (type) {\n rules.push(codeBlockRule(type));\n }\n\n type = schema.nodes.heading;\n if (type) {\n rules.push(headingRule(type, 6));\n }\n\n return inputRules({rules});\n}\n","import {\n chainCommands,\n exitCode,\n joinDown,\n joinUp,\n lift,\n selectParentNode,\n setBlockType,\n toggleMark,\n wrapIn,\n} from 'prosemirror-commands';\nimport {liftListItem, sinkListItem, splitListItem, wrapInList} from 'prosemirror-schema-list';\nimport {redo, undo} from 'prosemirror-history';\nimport {undoInputRule} from 'prosemirror-inputrules';\nimport {MarkType, NodeType, Schema} from 'prosemirror-model';\nimport {Command} from 'prosemirror-state';\n\ntype Keymap = Record<string, Command>;\n\n/**\n * Inspect the given schema looking for marks and nodes from the\n * basic schema, and if found, add key bindings related to them.\n * This will add:\n *\n * * **Mod-b** for toggling [strong](#schema-basic.StrongMark)\n * * **Mod-i** for toggling [emphasis](#schema-basic.EmMark)\n * * **Mod-`** for toggling [code font](#schema-basic.CodeMark)\n * * **Ctrl-Shift-0** for making the current textblock a paragraph\n * * **Ctrl-Shift-1** to **Ctrl-Shift-Digit6** for making the current\n * textblock a heading of the corresponding level\n * * **Ctrl-Shift-Backslash** to make the current textblock a code block\n * * **Ctrl-Shift-8** to wrap the selection in an ordered list\n * * **Ctrl-Shift-9** to wrap the selection in a bullet list\n * * **Ctrl->** to wrap the selection in a block quote\n * * **Enter** to split a non-empty textblock in a list item while at\n * the same time splitting the list item\n * * **Mod-Enter** to insert a hard break\n * * **Mod-_** to insert a horizontal rule\n * * **Backspace** to undo an input rule\n * * **Alt-ArrowUp** to `joinUp`\n * * **Alt-ArrowDown** to `joinDown`\n * * **Mod-BracketLeft** to `lift`\n * * **Escape** to `selectParentNode`\n *\n * You can suppress or map these bindings by passing a `mapKeys`\n * argument, which maps key names (say `\"Mod-B\"` to either `false`, to\n * remove the binding, or a new key name string.\n */\nexport function buildKeymap(schema: Schema, isMac: boolean): Keymap {\n const keys: Keymap = {};\n\n keys['Mod-z'] = undo;\n keys['Shift-Mod-z'] = redo;\n keys.Backspace = undoInputRule;\n if (!isMac) {\n keys['Mod-y'] = redo;\n }\n\n keys['Alt-ArrowUp'] = joinUp;\n keys['Alt-ArrowDown'] = joinDown;\n keys['Mod-BracketLeft'] = lift;\n keys.Escape = selectParentNode;\n\n let type: MarkType | NodeType = schema.marks.strong;\n if (type) {\n keys['Mod-b'] = toggleMark(type);\n keys['Mod-B'] = toggleMark(type);\n }\n\n type = schema.marks.em;\n if (type) {\n keys['Mod-i'] = toggleMark(type);\n keys['Mod-I'] = toggleMark(type);\n }\n\n type = schema.marks.code;\n if (type) {\n keys['Mod-`'] = toggleMark(type);\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n keys['Shift-Ctrl-8'] = wrapInList(type);\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n keys['Shift-Ctrl-9'] = wrapInList(type);\n }\n\n type = schema.nodes.blockquote;\n if (type) {\n keys['Ctrl->'] = wrapIn(type);\n }\n\n type = schema.nodes.hard_break;\n if (type) {\n const br = type;\n const cmd = chainCommands(exitCode, (state, dispatch) => {\n dispatch?.(state.tr.replaceSelectionWith(br.create()).scrollIntoView());\n return true;\n });\n keys['Mod-Enter'] = cmd;\n keys['Shift-Enter'] = cmd;\n if (isMac) {\n keys['Ctrl-Enter'] = cmd;\n }\n }\n\n type = schema.nodes.list_item;\n if (type) {\n keys.Enter = splitListItem(type);\n keys['Mod-['] = liftListItem(type);\n keys['Mod-]'] = sinkListItem(type);\n }\n\n type = schema.nodes.paragraph;\n if (type) {\n keys['Shift-Ctrl-0'] = setBlockType(type);\n }\n\n type = schema.nodes.code_block;\n if (type) {\n keys['Shift-Ctrl-\\\\'] = setBlockType(type);\n }\n\n type = schema.nodes.heading;\n if (type) {\n for (let i = 1; i <= 6; i++) {\n keys['Shift-Ctrl-' + i] = setBlockType(type, {level: i});\n }\n }\n\n type = schema.nodes.horizontal_rule;\n if (type) {\n const hr = type;\n keys['Mod-_'] = (state, dispatch) => {\n dispatch?.(state.tr.replaceSelectionWith(hr.create()).scrollIntoView());\n return true;\n };\n }\n\n return keys;\n}\n","import {Component, DOCUMENT, ElementRef, inject, input, OnDestroy, OnInit, output, viewChild} from '@angular/core';\nimport {ControlValueAccessor, NgControl} from '@angular/forms';\nimport {EditorView} from 'prosemirror-view';\nimport {EditorState, Plugin, Transaction} from 'prosemirror-state';\nimport {DOMParser, DOMSerializer, Schema} from 'prosemirror-model';\nimport {MatDialog} from '@angular/material/dialog';\nimport {goToNextCell, tableEditing} from 'prosemirror-tables';\nimport {keymap} from 'prosemirror-keymap';\nimport {ImagePlugin, ImageUploader} from '../utils/image';\nimport {advancedSchema, basicSchema} from '../utils/schema/schema';\nimport {buildMenuItems, Key, MenuItems} from '../utils/menu';\nimport {history} from 'prosemirror-history';\nimport {baseKeymap} from 'prosemirror-commands';\nimport {dropCursor} from 'prosemirror-dropcursor';\nimport {gapCursor} from 'prosemirror-gapcursor';\nimport {buildInputRules} from '../utils/inputrules';\nimport {buildKeymap} from '../utils/keymap';\nimport {commonImageMimeTypes, NaturalFileDropDirective} from '@ecodev/natural';\nimport {MatDivider} from '@angular/material/divider';\nimport {MatMenu, MatMenuItem, MatMenuTrigger} from '@angular/material/menu';\nimport {MatButtonToggle, MatButtonToggleGroup} from '@angular/material/button-toggle';\nimport {MatIcon} from '@angular/material/icon';\nimport {MatTooltip} from '@angular/material/tooltip';\nimport {MatButton, MatIconButton} from '@angular/material/button';\nimport {Subject} from 'rxjs';\nimport {outputFromObservable} from '@angular/core/rxjs-interop';\n\n/**\n * Prosemirror component\n *\n * Usage :\n *\n * ```html\n * <natural-editor [(ngModel)]=\"htmlString\" />\n * ```\n */\n// @dynamic\n@Component({\n selector: 'natural-editor',\n imports: [\n MatButton,\n MatIconButton,\n MatTooltip,\n MatIcon,\n MatButtonToggleGroup,\n MatButtonToggle,\n MatMenu,\n MatMenuItem,\n MatMenuTrigger,\n MatDivider,\n NaturalFileDropDirective,\n ],\n templateUrl: './editor.component.html',\n styleUrl: './editor.component.scss',\n providers: [ImagePlugin],\n})\nexport class NaturalEditorComponent implements OnInit, OnDestroy, ControlValueAccessor {\n private readonly ngControl = inject(NgControl, {optional: true, self: true});\n private readonly document = inject(DOCUMENT);\n private readonly dialog = inject(MatDialog);\n private readonly imagePlugin = inject(ImagePlugin);\n protected readonly commonImageMimeTypes = commonImageMimeTypes;\n\n private view: EditorView | null = null;\n\n private readonly editor = viewChild.required('editor', {read: ElementRef});\n\n public readonly contentChange = output<string>();\n\n /**\n * Callback to upload an image and return the URL to view the image.\n *\n * If given it will enable advanced schema, including image and tables.\n * It must be given on initialization and cannot be changed later on.\n */\n public readonly imageUploader = input<ImageUploader | null>(null);\n\n /**\n * Mode must be set on initialization. Later changes will have no effect. Possible values are:\n *\n * - `basic`, the default, only offers minimal formatting options\n * - `advanced`, adds text colors, headings, alignments, and tables. If `imageUploader` is given, it will force `advanced` mode.\n */\n public readonly mode = input<'basic' | 'advanced'>('basic');\n\n private schema: Schema = basicSchema;\n\n /**\n * Interface with ControlValueAccessor\n * Notifies parent model / form controller\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * HTML string\n */\n private content = '';\n\n public menu: MenuItems | null = null;\n\n protected readonly save$ = new Subject<void>();\n\n /**\n * If subscribed to, then the save button will be shown and click events forwarded\n */\n public readonly save = outputFromObservable(this.save$);\n\n public disabled = false;\n\n public constructor() {\n if (this.ngControl !== null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n public ngOnInit(): void {\n this.schema = this.imageUploader() || this.mode() === 'advanced' ? advancedSchema : basicSchema;\n this.menu = buildMenuItems(this.schema, this.dialog);\n const serializer = DOMSerializer.fromSchema(this.schema);\n const state = this.createState();\n\n this.view = new EditorView(this.editor().nativeElement, {\n state: state,\n editable: () => !this.disabled,\n dispatchTransaction: (transaction: Transaction) => {\n if (!this.view) {\n return;\n }\n\n const newState = this.view.state.apply(transaction);\n this.view.updateState(newState);\n\n // Transform doc into HTML string\n const dom = serializer.serializeFragment(this.view.state.doc as any);\n const el = this.document.createElement('_');\n el.appendChild(dom);\n\n const newContent = el.innerHTML;\n if (this.content === newContent || this.disabled) {\n return;\n }\n\n this.content = el.innerHTML;\n\n if (this.onChange) {\n this.onChange(this.content);\n }\n this.contentChange.emit(this.content);\n },\n });\n this.update();\n }\n\n public writeValue(val: string | undefined): void {\n if (typeof val === 'string' && val !== this.content) {\n this.content = val;\n }\n\n if (this.view !== null) {\n const state = this.createState();\n this.view.updateState(state);\n }\n }\n\n private createState(): EditorState {\n const template = this.document.createElement('_');\n template.innerHTML = '<div>' + this.content + '</div>';\n if (!template.firstChild) {\n throw new Error('child of template element could not be created');\n }\n\n const parser = DOMParser.fromSchema(this.schema);\n const doc = parser.parse(template.firstChild);\n\n return EditorState.create({\n doc: doc,\n plugins: this.createPlugins(),\n });\n }\n\n private createPlugins(): Plugin[] {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const isMac = !!this.document.defaultView?.navigator.platform.match(/Mac/);\n\n const plugins = [\n buildInputRules(this.schema),\n keymap(buildKeymap(this.schema, isMac)),\n keymap(baseKeymap),\n dropCursor(),\n gapCursor(),\n history(),\n new Plugin({\n props: {\n attributes: {class: 'ProseMirror-example-setup-style'},\n },\n }),\n new Plugin({\n view: () => this,\n }),\n ];\n\n if (this.imageUploader()) {\n plugins.push(this.imagePlugin.plugin);\n }\n\n if (this.schema === advancedSchema) {\n plugins.push(\n tableEditing(),\n keymap({\n Tab: goToNextCell(1),\n 'Shift-Tab': goToNextCell(-1),\n }),\n );\n }\n\n return plugins;\n }\n\n /**\n * Called by Prosemirror whenever the editor state changes. So we update our menu states.\n */\n public update(): void {\n if (!this.view || !this.menu) {\n return;\n }\n\n for (const item of Object.values(this.menu)) {\n item.update(this.view, this.view.state);\n }\n }\n\n public registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(): void {\n // noop\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n public ngOnDestroy(): void {\n if (this.view) {\n this.view.destroy();\n this.view = null;\n }\n }\n\n public run(event: Event, key: Key): void {\n if (!this.view || !this.menu) {\n return;\n }\n\n const item = this.menu[key];\n if (!item || item.disabled || !item.show) {\n return;\n }\n\n item.spec.run(this.view.state, this.view.dispatch, this.view, event);\n this.view.focus();\n }\n\n public upload(file: File): void {\n const imageUploader = this.imageUploader();\n if (!this.view || !imageUploader) {\n return;\n }\n\n if (this.view.state.selection.$from.parent.inlineContent) {\n this.imagePlugin.startImageUpload(this.view, file, imageUploader, this.schema);\n }\n\n this.view.focus();\n }\n}\n","<!-- eslint-disable @angular-eslint/template/cyclomatic-complexity -->\n@if (menu && !disabled) {\n <div class=\"menu-container\">\n <div class=\"menu\">\n @if (save$.observed) {\n <button matIconButton i18n-matTooltip matTooltip=\"Enregistrer\" (click)=\"save$.next()\">\n <mat-icon fontIcon=\"save\" />\n </button>\n }\n <mat-button-toggle-group hideMultipleSelectionIndicator multiple>\n @if (menu.toggleStrong) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Gras\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n >\n <mat-icon fontIcon=\"format_bold\" />\n </mat-button-toggle>\n }\n @if (menu.toggleEm) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Italique\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n >\n <mat-icon fontIcon=\"format_italic\" />\n </mat-button-toggle>\n }\n @if (menu.toggleCode) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Code\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n >\n <mat-icon fontIcon=\"code\" />\n </mat-button-toggle>\n }\n @if (menu.toggleLink) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Insérer un lien...\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n >\n <mat-icon fontIcon=\"insert_link\" />\n </mat-button-toggle>\n }\n @if (menu.textColor) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Couleur du texte...\"\n [disabled]=\"menu.textColor.disabled\"\n [checked]=\"menu.textColor.active\"\n (click)=\"run($event, 'textColor')\"\n >\n <mat-icon fontIcon=\"format_color_text\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n <mat-menu #blockMenu=\"matMenu\">\n @if (menu.makeParagraph) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n >Paragraphe\n </button>\n }\n @if (menu.makeCodeBlock) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n >Code\n </button>\n }\n @if (menu.makeHead1) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead1.disabled\" (click)=\"run($event, 'makeHead1')\"\n >Titre 1\n </button>\n }\n @if (menu.makeHead2) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead2.disabled\" (click)=\"run($event, 'makeHead2')\"\n >Titre 2\n </button>\n }\n @if (menu.makeHead3) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead3.disabled\" (click)=\"run($event, 'makeHead3')\"\n >Titre 3\n </button>\n }\n @if (menu.makeHead4) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead4.disabled\" (click)=\"run($event, 'makeHead4')\"\n >Titre 4\n </button>\n }\n @if (menu.makeHead5) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead5.disabled\" (click)=\"run($event, 'makeHead5')\"\n >Titre 5\n </button>\n }\n @if (menu.makeHead6) {\n <button mat-menu-item i18n [disabled]=\"menu.makeHead6.disabled\" (click)=\"run($event, 'makeHead6')\"\n >Titre 6\n </button>\n }\n @if (menu.blockClass || menu.blockId) {\n <mat-divider />\n }\n @if (menu.blockClass) {\n <button mat-menu-item i18n [disabled]=\"menu.blockClass.disabled\" (click)=\"run($event, 'blockClass')\"\n >Classe...\n </button>\n }\n @if (menu.blockId) {\n <button i18n mat-menu-item [disabled]=\"menu.blockId.disabled\" (click)=\"run($event, 'blockId')\"\n >ID...\n </button>\n }\n </mat-menu>\n @if (menu.addColumnBefore) {\n <button mat-button [matMenuTriggerFor]=\"tableMenu\">\n <span i18n>Tableau</span>\n <mat-icon fontIcon=\"arrow_drop_down\" />\n </button>\n }\n <mat-menu #tableMenu=\"matMenu\">\n @if (menu.insertTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n >Insérer un tableau\n </button>\n }\n @if (menu.deleteTable) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n >Supprimer le tableau\n </button>\n }\n @if (menu.mergeCells) {\n <button mat-menu-item i18n [disabled]=\"menu.mergeCells.disabled\" (click)=\"run($event, 'mergeCells')\"\n >Fusionner les cellules\n </button>\n }\n @if (menu.splitCell) {\n <button mat-menu-item i18n [disabled]=\"menu.splitCell.disabled\" (click)=\"run($event, 'splitCell')\"\n >Scinder les cellules\n </button>\n }\n @if (menu.cellBackgroundColor) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.cellBackgroundColor.disabled\"\n (click)=\"run($event, 'cellBackgroundColor')\"\n >Couleur de fond...\n </button>\n }\n @if (menu.tableClass) {\n <button mat-menu-item i18n [disabled]=\"menu.tableClass.disabled\" (click)=\"run($event, 'tableClass')\"\n >Classe...\n </button>\n }\n @if (menu.tableId) {\n <button i18n mat-menu-item [disabled]=\"menu.tableId.disabled\" (click)=\"run($event, 'tableId')\"\n >ID...\n </button>\n }\n <mat-divider />\n @if (menu.addColumnBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n >Insérer une colonne avant\n </button>\n }\n @if (menu.addColumnAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n >Insérer une colonne après\n </button>\n }\n @if (menu.deleteColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n >Supprimer la colonne\n </button>\n }\n <mat-divider />\n @if (menu.addRowBefore) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n >Insérer une ligne avant\n </button>\n }\n @if (menu.addRowAfter) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n >Insérer une ligne après\n </button>\n }\n @if (menu.deleteRow) {\n <button mat-menu-item i18n [disabled]=\"menu.deleteRow.disabled\" (click)=\"run($event, 'deleteRow')\"\n >Supprimer la ligne\n </button>\n }\n <mat-divider />\n @if (menu.toggleHeaderColumn) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n >Entête de colonne\n </button>\n }\n @if (menu.toggleHeaderRow) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n >Entête de ligne\n </button>\n }\n @if (menu.toggleHeaderCell) {\n <button\n mat-menu-item\n i18n\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n >Entête de cellule\n </button>\n }\n </mat-menu>\n @if (imageUploader()) {\n <button\n matIconButton\n naturalFileDrop\n i18n-matTooltip\n matTooltip=\"Insérer une image\"\n [accept]=\"commonImageMimeTypes\"\n [selectable]=\"true\"\n [broadcast]=\"false\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon fontIcon=\"insert_photo\" />\n </button>\n }\n @if (menu.alignLeft) {\n <mat-button-toggle-group hideSingleSelectionIndicator>\n @if (menu.alignLeft) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner gauche\"\n [disabled]=\"menu.alignLeft.disabled\"\n [checked]=\"menu.alignLeft.active\"\n (click)=\"run($event, 'alignLeft')\"\n >\n <mat-icon fontIcon=\"format_align_left\" />\n </mat-button-toggle>\n }\n @if (menu.alignCenter) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Centrer\"\n [disabled]=\"menu.alignCenter.disabled\"\n [checked]=\"menu.alignCenter.active\"\n (click)=\"run($event, 'alignCenter')\"\n >\n <mat-icon fontIcon=\"format_align_center\" />\n </mat-button-toggle>\n }\n @if (menu.alignRight) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Aligner droite\"\n [disabled]=\"menu.alignRight.disabled\"\n [checked]=\"menu.alignRight.active\"\n (click)=\"run($event, 'alignRight')\"\n >\n <mat-icon fontIcon=\"format_align_right\" />\n </mat-button-toggle>\n }\n @if (menu.alignJustify) {\n <mat-button-toggle\n i18n-matTooltip\n matTooltip=\"Justifier\"\n [disabled]=\"menu.alignJustify.disabled\"\n [checked]=\"menu.alignJustify.active\"\n (click)=\"run($event, 'alignJustify')\"\n >\n <mat-icon fontIcon=\"format_align_justify\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n }\n @if (menu.undo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Annuler\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n >\n <mat-icon fontIcon=\"undo\" />\n </button>\n }\n @if (menu.redo) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Refaire\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n >\n <mat-icon fontIcon=\"redo\" />\n </button>\n }\n @if (menu.wrapBulletList && menu.wrapBulletList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste à puce\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n >\n <mat-icon fontIcon=\"format_list_bulleted\" />\n </button>\n }\n @if (menu.wrapOrderedList && menu.wrapOrderedList.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Liste à numéro\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n >\n <mat-icon fontIcon=\"format_list_numbered\" />\n </button>\n }\n @if (menu.wrapBlockQuote && menu.wrapBlockQuote.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Citation\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n >\n <mat-icon fontIcon=\"format_quote\" />\n </button>\n }\n @if (menu.joinUp && menu.joinUp.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'élément du haut\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n >\n <mat-icon fontIcon=\"move_up\" />\n </button>\n }\n @if (menu.lift && menu.lift.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Désindenter\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n >\n <mat-icon fontIcon=\"format_indent_decrease\" />\n </button>\n }\n @if (menu.selectParentNode && menu.selectParentNode.show) {\n <button\n matIconButton\n i18n-matTooltip\n matTooltip=\"Sélectionner l'élément parent\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n >\n <mat-icon fontIcon=\"select_all\" />\n </button>\n }\n </div>\n </div>\n}\n<div #editor class=\"editor-container\"></div>\n","/*\n * Public API Surface of natural-editor\n */\n\nexport {NaturalCustomCssDirective} from './lib/custom-css/custom-css.directive';\nexport {NaturalEditorComponent} from './lib/editor/editor.component';\nexport type {ImageUploader} from './lib/utils/image';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;AAIG;AACG,SAAU,SAAS,CAAC,MAAc,EAAE,GAAW,EAAA;AACjD,IAAA,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,GAAG;AAE5B,IAAA,OAAO;AACF,SAAA,OAAO,CAAC,aAAa,EAAE,SAAS,IAC7B;SACK,KAAK,CAAC,GAAG;SACT,GAAG,CAAC,QAAQ,IAAG;QACZ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;AACtC,YAAA,OAAO,QAAQ,CAAC,IAAI,EAAE;QAC1B;aAAO;AACH,YAAA,OAAO,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE;QACnC;AACJ,IAAA,CAAC;SACA,IAAI,CAAC,GAAG,CAAC;AAEjB,SAAA,IAAI,EAAE;AACf;AAEA,IAAI,QAAQ,GAAG,CAAC;AAChB,IAAI,cAAc,GAAG,CAAC;AAEtB;;;;;;;;;;AAUG;MAOU,yBAAyB,CAAA;AACjB,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACpC,KAAK,GAA4B,IAAI;AAC1B,IAAA,EAAE,GAAG,GAAG,GAAG,EAAE,QAAQ;AACxB,IAAA,gBAAgB,GAAG,KAAK,CAAC,QAAQ,2DAAsB;AAEvE,IAAA,WAAA,GAAA;QACI,MAAM,CAAC,MAAK;AACR,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EAAE;AAErC,YAAA,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;gBACjD,IAAI,CAAC,QAAQ,CAAC,IAAI,CA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