@esfaenza/text-editors 20.3.27 → 20.3.28
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.
|
@@ -671,13 +671,13 @@ class EditorComponent {
|
|
|
671
671
|
this.EditorRef?.chain().focus().insertContent(select.value).run();
|
|
672
672
|
select.value = "";
|
|
673
673
|
}
|
|
674
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
675
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
674
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: EditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
675
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.34", type: EditorComponent, isStandalone: true, selector: "es-editor", inputs: { EmojiSupport: { classPropertyName: "EmojiSupport", publicName: "EmojiSupport", isSignal: true, isRequired: false, transformFunction: null }, BulletListSupport: { classPropertyName: "BulletListSupport", publicName: "BulletListSupport", isSignal: true, isRequired: false, transformFunction: null }, TablesSupport: { classPropertyName: "TablesSupport", publicName: "TablesSupport", isSignal: true, isRequired: false, transformFunction: null }, Mode: { classPropertyName: "Mode", publicName: "Mode", isSignal: true, isRequired: true, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, MentionEntities: { classPropertyName: "MentionEntities", publicName: "MentionEntities", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { inputChange: "inputChange", inputFocus: "inputFocus", inputFinalized: "inputFinalized" }, host: { listeners: { "document:mousedown": "onDocumentMouseDown($event)", "document:keydown.escape": "closeTableMenu()" } }, providers: [
|
|
676
676
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => EditorComponent), multi: true },
|
|
677
677
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => EditorComponent), multi: true }
|
|
678
678
|
], viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, isSignal: true }, { propertyName: "tableMenuRef", first: true, predicate: ["tableMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"editor-shell\" [class.readonly]=\"readonly()\" [attr.style]=\"style()\">\r\n @if(!readonly()){\r\n <!-- (mousedown) preventDefault sui pulsanti: il click non toglie il focus all'editor, quindi la selezione resta visibile -->\r\n <div class=\"editor-toolbar\" role=\"toolbar\" aria-label=\"Formattazione\">\r\n\r\n <!-- Typography -->\r\n <select class=\"heading-select\" title=\"Stile del paragrafo\" (change)=\"setTypography($event)\">\r\n <option value=\"paragraph\" [selected]=\"Toolbar().block == 'paragraph'\">Paragrafo</option>\r\n <option value=\"h1\" [selected]=\"Toolbar().block == 'h1'\">Intestazione 1</option>\r\n <option value=\"h2\" [selected]=\"Toolbar().block == 'h2'\">Intestazione 2</option>\r\n <option value=\"h3\" [selected]=\"Toolbar().block == 'h3'\">Intestazione 3</option>\r\n <option value=\"h4\" [selected]=\"Toolbar().block == 'h4'\">Intestazione 4</option>\r\n <option value=\"h5\" [selected]=\"Toolbar().block == 'h5'\">Intestazione 5</option>\r\n <option value=\"h6\" [selected]=\"Toolbar().block == 'h6'\">Intestazione 6</option>\r\n </select>\r\n\r\n <!-- Font: solo html, il markdown non ha una sintassi per rappresentarli -->\r\n @if(Mode() == \"html\"){\r\n <select class=\"font-family-select\" title=\"Carattere\" (change)=\"setFontFamily($event)\">\r\n <option value=\"\" [selected]=\"Toolbar().fontFamily == ''\">Carattere</option>\r\n @for(f of FontFamilies; track f.value){\r\n <option [value]=\"f.value\" [selected]=\"Toolbar().fontFamily == f.value\" [style.font-family]=\"f.value\">{{ f.label }}</option>\r\n }\r\n </select>\r\n <select class=\"font-size-select\" title=\"Dimensione\" (change)=\"setFontSize($event)\">\r\n <option value=\"\" [selected]=\"Toolbar().fontSize == ''\">Dimensione</option>\r\n @for(s of FontSizes; track s){\r\n <option [value]=\"s\" [selected]=\"Toolbar().fontSize == s\">{{ s }}</option>\r\n }\r\n </select>\r\n }\r\n\r\n <div class=\"divider\"></div>\r\n\r\n <!-- Formatting -->\r\n <button type=\"button\" class=\"tb-btn\" title=\"Grassetto\" aria-label=\"Grassetto\" [class.is-active]=\"Toolbar().bold\" [attr.aria-pressed]=\"Toolbar().bold\" (mousedown)=\"$event.preventDefault()\" (click)=\"setBold()\">\r\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8\" /></svg>\r\n </button>\r\n <button type=\"button\" class=\"tb-btn\" title=\"Corsivo\" aria-label=\"Corsivo\" [class.is-active]=\"Toolbar().italic\" [attr.aria-pressed]=\"Toolbar().italic\" (mousedown)=\"$event.preventDefault()\" (click)=\"setItalic()\">\r\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M19 4h-9M14 20H5M15 4 9 20\" /></svg>\r\n </button>\r\n <button type=\"button\" class=\"tb-btn\" title=\"Sottolineato\" aria-label=\"Sottolineato\" [class.is-active]=\"Toolbar().underline\" [attr.aria-pressed]=\"Toolbar().underline\" (mousedown)=\"$event.preventDefault()\" (click)=\"setUnderlined()\">\r\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M6 4v6a6 6 0 0 0 12 0V4M4 20h16\" /></svg>\r\n </button>\r\n\r\n <!-- Lists -->\r\n @if(BulletListSupport()){\r\n <button type=\"button\" class=\"tb-btn\" title=\"Elenco puntato\" aria-label=\"Elenco puntato\" [class.is-active]=\"Toolbar().bulletList\" [attr.aria-pressed]=\"Toolbar().bulletList\" (mousedown)=\"$event.preventDefault()\" (click)=\"setBulletList()\">\r\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M9 6h11M9 12h11M9 18h11M4 6h.01M4 12h.01M4 18h.01\" /></svg>\r\n </button>\r\n }\r\n\r\n <!-- Tables: un unico menu, le voci che agiscono su una tabella esistente sono attive solo con il cursore al suo interno -->\r\n @if(Mode() == \"html\" && TablesSupport()){\r\n <div class=\"divider\"></div>\r\n <div class=\"tb-dropdown\" #tableMenu>\r\n <button #tableMenuButton type=\"button\" class=\"tb-btn tb-btn-text\" title=\"Tabella\" aria-haspopup=\"menu\" [class.is-active]=\"!!TableMenu()\" [attr.aria-expanded]=\"!!TableMenu()\" (mousedown)=\"$event.preventDefault()\" (click)=\"toggleTableMenu(tableMenuButton)\">\r\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" /><path d=\"M3 9h18M3 15h18M12 3v18\" /></svg>\r\n <span>Tabella</span>\r\n <svg class=\"chevron\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m6 9 6 6 6-6\" /></svg>\r\n </button>\r\n @if(TableMenu(); as pos){\r\n <div class=\"tb-dropdown-menu\" role=\"menu\" [style.top.px]=\"pos.top\" [style.left.px]=\"pos.left\">\r\n <button type=\"button\" role=\"menuitem\" (mousedown)=\"$event.preventDefault()\" (click)=\"tableAction('insert')\">Inserisci tabella</button>\r\n <div class=\"tb-dropdown-separator\"></div>\r\n <button type=\"button\" role=\"menuitem\" [disabled]=\"!Toolbar().inTable\" (mousedown)=\"$event.preventDefault()\" (click)=\"tableAction('addRow')\">Aggiungi riga sotto</button>\r\n <button type=\"button\" role=\"menuitem\" [disabled]=\"!Toolbar().inTable\" (mousedown)=\"$event.preventDefault()\" (click)=\"tableAction('addColumn')\">Aggiungi colonna a destra</button>\r\n <div class=\"tb-dropdown-separator\"></div>\r\n <button type=\"button\" role=\"menuitem\" class=\"danger\" [disabled]=\"!Toolbar().inTable\" (mousedown)=\"$event.preventDefault()\" (click)=\"tableAction('deleteRow')\">Elimina riga</button>\r\n <button type=\"button\" role=\"menuitem\" class=\"danger\" [disabled]=\"!Toolbar().inTable\" (mousedown)=\"$event.preventDefault()\" (click)=\"tableAction('deleteColumn')\">Elimina colonna</button>\r\n <button type=\"button\" role=\"menuitem\" class=\"danger\" [disabled]=\"!Toolbar().inTable\" (mousedown)=\"$event.preventDefault()\" (click)=\"tableAction('delete')\">Elimina tabella</button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"divider\"></div>\r\n\r\n <!-- History -->\r\n <button type=\"button\" class=\"tb-btn\" title=\"Annulla\" aria-label=\"Annulla\" [disabled]=\"!Toolbar().canUndo\" (mousedown)=\"$event.preventDefault()\" (click)=\"undoAction()\">\r\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M9 14 4 9l5-5\" /><path d=\"M4 9h10.5a5.5 5.5 0 0 1 0 11H11\" /></svg>\r\n </button>\r\n <button type=\"button\" class=\"tb-btn\" title=\"Ripeti\" aria-label=\"Ripeti\" [disabled]=\"!Toolbar().canRedo\" (mousedown)=\"$event.preventDefault()\" (click)=\"redoAction()\">\r\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m15 14 5-5-5-5\" /><path d=\"M20 9H9.5a5.5 5.5 0 0 0 0 11H13\" /></svg>\r\n </button>\r\n\r\n @if(EmojiSupport()){\r\n <select class=\"emoji-select\" title=\"Emoji\" aria-label=\"Emoji\" (change)=\"setEmoji($event)\">\r\n <option value=\"\" hidden selected>\uD83D\uDE0A</option>\r\n <option value=\"\uD83D\uDE0A\">\uD83D\uDE0A</option>\r\n <option value=\"\uD83D\uDE00\">\uD83D\uDE00</option>\r\n <option value=\"\uD83D\uDE02\">\uD83D\uDE02</option>\r\n <option value=\"\uD83D\uDD25\">\uD83D\uDD25</option>\r\n <option value=\"\uD83C\uDF89\">\uD83C\uDF89</option>\r\n <option value=\"\uD83D\uDE80\">\uD83D\uDE80</option>\r\n <option value=\"\u2764\uFE0F\">\u2764\uFE0F</option>\r\n <option value=\"\uD83D\uDC4D\">\uD83D\uDC4D</option>\r\n </select>\r\n }\r\n </div>\r\n }\r\n <div #element></div>\r\n</div>\r\n", styles: [".editor-shell{--es-editor-border: #e2e4e9;--es-editor-toolbar-bg: #fafbfc;--es-editor-text: #1f2328;--es-editor-icon: #4b5563;--es-editor-hover: #eef0f3;--es-editor-accent: #2342c0;--es-editor-accent-soft: #e5ebff;--es-editor-focus: rgba(35, 66, 192, .28);border:1px solid var(--es-editor-border);border-radius:10px;background:#fff;overflow:hidden;isolation:isolate;box-shadow:0 1px 2px #0000000a,0 6px 24px #0000000d;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.editor-shell.readonly{border:none;overflow:visible;box-shadow:none}.editor-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:2px;padding:6px 8px;background:var(--es-editor-toolbar-bg);border-bottom:1px solid var(--es-editor-border);font-size:13px;color:var(--es-editor-text)}.editor-toolbar svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.editor-toolbar .tb-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:none;border-radius:6px;background:transparent;color:var(--es-editor-icon);cursor:pointer;transition:background .12s ease,color .12s ease}.editor-toolbar .tb-btn:hover:not(:disabled){background:var(--es-editor-hover);color:var(--es-editor-text)}.editor-toolbar .tb-btn.is-active{background:var(--es-editor-accent-soft);color:var(--es-editor-accent)}.editor-toolbar .tb-btn:disabled{opacity:.35;cursor:default}.editor-toolbar .tb-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--es-editor-focus)}.editor-toolbar select{height:32px;padding:0 28px 0 10px;border:1px solid var(--es-editor-border);border-radius:6px;appearance:none;background:#fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\") no-repeat right 8px center/14px;font:inherit;color:var(--es-editor-text);cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.editor-toolbar select:hover{border-color:#c9cdd4}.editor-toolbar select:focus-visible{outline:none;border-color:var(--es-editor-accent);box-shadow:0 0 0 3px var(--es-editor-focus)}.editor-toolbar .heading-select{width:136px}.editor-toolbar .font-family-select{width:148px;margin-left:4px}.editor-toolbar .font-size-select{width:112px;margin-left:4px}.editor-toolbar .emoji-select{width:44px;padding:0 0 0 10px;border-color:transparent;background:transparent;font-size:16px}.editor-toolbar .emoji-select:hover{border-color:transparent;background:var(--es-editor-hover)}.editor-toolbar .tb-btn.tb-btn-text{width:auto;gap:6px;padding:0 6px 0 8px;font:inherit}.editor-toolbar .tb-btn.tb-btn-text .chevron{width:14px;height:14px;opacity:.7}.editor-toolbar .tb-dropdown{display:inline-flex}.editor-toolbar .tb-dropdown-menu{position:fixed;z-index:1000;display:flex;flex-direction:column;min-width:210px;padding:4px;background:#fff;border:1px solid var(--es-editor-border);border-radius:8px;box-shadow:0 12px 30px #0000001a,0 2px 8px #0000000f}.editor-toolbar .tb-dropdown-menu button{padding:7px 10px;border:none;border-radius:6px;background:transparent;font:inherit;color:var(--es-editor-text);text-align:left;white-space:nowrap;cursor:pointer}.editor-toolbar .tb-dropdown-menu button:hover:not(:disabled),.editor-toolbar .tb-dropdown-menu button:focus-visible{outline:none;background:var(--es-editor-hover)}.editor-toolbar .tb-dropdown-menu button.danger:hover:not(:disabled){background:#fdecec;color:#c62828}.editor-toolbar .tb-dropdown-menu button:disabled{opacity:.4;cursor:default}.editor-toolbar .tb-dropdown-separator{height:1px;margin:4px 2px;background:var(--es-editor-border)}.editor-toolbar .divider{width:1px;height:20px;background:var(--es-editor-border);margin:0 6px}.ProseMirror{min-height:60px;padding:12px;outline:none;font-size:16px;line-height:1.7;color:#1f1f1f;caret-color:#2563eb}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3{line-height:1.2;margin-top:.8em;margin-bottom:.4em;font-weight:700;letter-spacing:-.02em}.ProseMirror h1{font-size:2rem}.ProseMirror h2{font-size:1.5rem}.ProseMirror h3{font-size:1.25rem}.ProseMirror p{margin:0}.ProseMirror ul,.ProseMirror ol{padding-left:1.5rem;margin:5px 0;display:flow-root}.ProseMirror li{margin:0}.ProseMirror blockquote{margin:1.4rem 0;padding-left:1rem;border-left:4px solid #c7d2fe;color:#555}.ProseMirror code{background:#f3f4f6;color:#d63384;padding:.15em .35em;border-radius:4px;font-size:.92em}.ProseMirror pre{background:#1f2937;color:#f9fafb;padding:16px 18px;border-radius:10px;overflow-x:auto;margin:1.2rem 0}.ProseMirror pre code{background:transparent;color:inherit;padding:0}.ProseMirror a{color:#2563eb;text-decoration:underline}.ProseMirror hr{border:none;border-top:1px solid #e2e2e2;margin:2rem 0}.ProseMirror table{width:100%;border-collapse:collapse;margin:1.2rem 0}.ProseMirror th,.ProseMirror td{border:1px solid #ddd;padding:5px;position:relative}.ProseMirror th{background:#f5f5f5;text-align:left}.ProseMirror .column-resize-handle{position:absolute;top:0;right:-2px;width:5px;height:100%;cursor:col-resize;background:transparent;z-index:20}.ProseMirror ::selection{background:#6082ff40}.suggestion-popup{display:flex;flex-direction:column;min-width:220px;padding:6px;background:#fff;z-index:99999999;border:1px solid #e5e5e5;border-radius:10px;box-shadow:0 12px 30px #00000014,0 2px 8px #0000000d}.suggestion-popup button{border:none;background:transparent;border-radius:8px;padding:8px 10px;text-align:left;cursor:pointer;font-size:14px}.suggestion-popup button:hover,.suggestion-popup button.is-selected{background:#eef2ff}.mention{display:inline-flex;align-items:center;background:#eef2ff;color:#304ffe;padding:2px 6px;border-radius:5px;font-weight:500}.img-wrapper{position:relative;display:inline-block;margin:12px 0}.img-wrapper img{max-width:100%;border-radius:10px;transition:opacity .2s ease}.img-wrapper.ProseMirror-selectednode img{outline:2px solid var(--es-editor-accent, #2342c0);outline-offset:2px}.img-toolbar{position:absolute;top:8px;left:8px;display:flex;align-items:center;gap:2px;background:#fffffff5;border:1px solid var(--es-editor-border, #e2e4e9);border-radius:8px;padding:3px;box-shadow:0 8px 20px #00000014;opacity:0;pointer-events:none;transition:opacity .12s ease}.img-toolbar.readonly{display:none}.img-wrapper:hover .img-toolbar,.img-wrapper.ProseMirror-selectednode .img-toolbar{opacity:1;pointer-events:auto}.img-toolbar button{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:6px;background:transparent;color:var(--es-editor-icon, #4b5563);cursor:pointer}.img-toolbar button:hover{background:var(--es-editor-hover, #eef0f3)}.img-toolbar button.is-active{background:var(--es-editor-accent-soft, #e5ebff);color:var(--es-editor-accent, #2342c0)}.img-toolbar button.danger:hover{background:#fdecec;color:#c62828}.img-toolbar svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.img-toolbar-divider{width:1px;height:16px;margin:0 3px;background:var(--es-editor-border, #e2e4e9)}.img-resize-handle{position:absolute;right:-5px;bottom:-5px;width:12px;height:12px;background:#fff;border:2px solid var(--es-editor-accent, #2342c0);border-radius:3px;box-shadow:0 1px 3px #0003;cursor:se-resize;opacity:0;transition:opacity .12s ease}.img-resize-handle.readonly{display:none}.img-wrapper:hover .img-resize-handle,.img-wrapper.ProseMirror-selectednode .img-resize-handle{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
679
679
|
}
|
|
680
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
680
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: EditorComponent, decorators: [{
|
|
681
681
|
type: Component,
|
|
682
682
|
args: [{ selector: "es-editor", standalone: true, imports: [CommonModule, FormsModule], encapsulation: ViewEncapsulation.None, providers: [
|
|
683
683
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => EditorComponent), multi: true },
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esfaenza/text-editors",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.28",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.0.0"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@angular/common": "^20.3.
|
|
9
|
-
"@angular/core": "^20.3.
|
|
8
|
+
"@angular/common": "^20.3.34",
|
|
9
|
+
"@angular/core": "^20.3.34",
|
|
10
10
|
"@tiptap/core": "3.17.1",
|
|
11
11
|
"@tiptap/extension-color": "3.17.1",
|
|
12
12
|
"@tiptap/extension-image": "3.17.1",
|