@tectra-ng/editor 0.2.5 → 0.3.0
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.
- package/README.md +1 -0
- package/fesm2022/tectra-ng-editor-content.mjs +15 -2
- package/fesm2022/tectra-ng-editor-content.mjs.map +1 -1
- package/fesm2022/tectra-ng-editor.mjs +82 -3
- package/fesm2022/tectra-ng-editor.mjs.map +1 -1
- package/package.json +5 -5
- package/types/tectra-ng-editor-content.d.ts +2 -0
- package/types/tectra-ng-editor-content.d.ts.map +1 -1
- package/types/tectra-ng-editor.d.ts +1 -0
- package/types/tectra-ng-editor.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<a href="https://github.com/kulakovskyi/tectra-ng/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-2560e4" alt="MIT license" /></a>
|
|
12
12
|
<a href="https://angular.dev"><img src="https://img.shields.io/badge/Angular-22-dd0031?logo=angular&logoColor=white" alt="Angular 22" /></a>
|
|
13
13
|
<a href="https://www.bestpractices.dev/projects/16576"><img src="https://www.bestpractices.dev/projects/16576/badge" alt="OpenSSF Best Practices" /></a>
|
|
14
|
+
<a href="https://www.bestpractices.dev/projects/16576/baseline-2"><img src="https://www.bestpractices.dev/projects/16576/baseline" alt="OpenSSF Baseline" /></a>
|
|
14
15
|
</p>
|
|
15
16
|
|
|
16
17
|
<p align="center">
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ChangeDetectionStrategy, Component, DOCUMENT, ViewEncapsulation, afterRenderEffect, booleanAttribute, computed, inject, input, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { provideTxIconDefaults, txIconCode, txIconTable, txIconVideo } from "@tectra-ng/icons";
|
|
4
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
|
+
import { editorContentTokens, toStyleObject } from "@tectra-ng/themes";
|
|
3
6
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
4
|
-
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
7
|
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
6
8
|
import { TxStyleLoader } from "@tectra-ng/core/styles";
|
|
7
9
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
8
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
9
10
|
import { TxDialog } from "@tectra-ng/ui/dialog";
|
|
10
11
|
function parseHtmlBody(html, document) {
|
|
11
12
|
const Parser = globalThis.DOMParser;
|
|
@@ -432,7 +433,14 @@ function sanitizeEditorHtml(html, document) {
|
|
|
432
433
|
cleanNode(body);
|
|
433
434
|
return body.innerHTML;
|
|
434
435
|
}
|
|
436
|
+
const CONTENT_ICON_DEFAULTS = {
|
|
437
|
+
code: txIconCode,
|
|
438
|
+
table: txIconTable,
|
|
439
|
+
video: txIconVideo
|
|
440
|
+
};
|
|
441
|
+
const CONTENT_THEME = { editorContent: editorContentTokens };
|
|
435
442
|
var TxEditorProseStyles = class TxEditorProseStyles {
|
|
443
|
+
contentTheme = injectTokens(CONTENT_THEME);
|
|
436
444
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
437
445
|
minVersion: "12.0.0",
|
|
438
446
|
version: "22.2.5",
|
|
@@ -451,6 +459,7 @@ var TxEditorProseStyles = class TxEditorProseStyles {
|
|
|
451
459
|
template: "",
|
|
452
460
|
isInline: true,
|
|
453
461
|
styles: ["@charset \"UTF-8\";.tx-editor-prose{--_gap: var(--tx-editor-content-block-gap);--_paragraph-gap: var(--tx-editor-content-paragraph-gap);color:var(--tx-editor-content-color);font-family:var(--tx-font-family);font-size:var(--tx-editor-content-font-size);line-height:var(--tx-editor-content-line-height);overflow-wrap:break-word}.tx-editor-prose>:first-child{margin-top:0}.tx-editor-prose>:last-child{margin-bottom:0}.tx-editor-prose p,.tx-editor-prose ul,.tx-editor-prose ol,.tx-editor-prose blockquote{margin:0 0 var(--_paragraph-gap)}.tx-editor-prose pre,.tx-editor-prose table,.tx-editor-prose figure,.tx-editor-prose img,.tx-editor-prose iframe{margin-block:var(--_gap)}.tx-editor-prose h1,.tx-editor-prose h2,.tx-editor-prose h3,.tx-editor-prose h4,.tx-editor-prose h5,.tx-editor-prose h6{margin:var(--tx-editor-content-heading-space-before) 0 var(--tx-editor-content-heading-space-after);font-weight:var(--tx-editor-content-heading-font-weight);letter-spacing:-.01em;line-height:var(--tx-editor-content-heading-line-height)}.tx-editor-prose h1{font-size:var(--tx-editor-content-heading-h1-size);letter-spacing:-.02em}.tx-editor-prose h2{font-size:var(--tx-editor-content-heading-h2-size)}.tx-editor-prose h3{font-size:var(--tx-editor-content-heading-h3-size)}.tx-editor-prose h4{font-size:var(--tx-editor-content-heading-h4-size)}.tx-editor-prose h5{font-size:var(--tx-editor-content-heading-h5-size)}.tx-editor-prose h6{color:var(--tx-editor-content-heading-h6-color);font-size:var(--tx-editor-content-heading-h6-size);letter-spacing:.02em;text-transform:uppercase}.tx-editor-prose a{color:var(--tx-editor-content-link-color);text-decoration:underline;text-decoration-color:var(--tx-editor-content-link-underline-color);text-decoration-thickness:1px;text-underline-offset:.2em;cursor:pointer;transition:text-decoration-color var(--tx-motion-duration) var(--tx-motion-easing)}.tx-editor-prose a:hover{text-decoration-color:var(--tx-editor-content-link-hover-underline-color)}.tx-editor-prose ul,.tx-editor-prose ol{padding-left:var(--tx-editor-content-list-indent)}.tx-editor-prose ul ul,.tx-editor-prose ul ol,.tx-editor-prose ol ul,.tx-editor-prose ol ol{margin:var(--tx-editor-content-list-item-gap) 0 0}.tx-editor-prose ul{list-style:disc}.tx-editor-prose ul ul{list-style:circle}.tx-editor-prose ul ul ul{list-style:square}.tx-editor-prose ol{list-style:decimal}.tx-editor-prose ol ol{list-style:lower-alpha}.tx-editor-prose ol ol ol{list-style:lower-roman}.tx-editor-prose li{margin:0}.tx-editor-prose li+li{margin-top:var(--tx-editor-content-list-item-gap)}.tx-editor-prose li>p{margin:0}.tx-editor-prose li::marker{color:var(--tx-editor-content-list-marker-color)}.tx-editor-prose ul[data-type=taskList]{padding-left:0;list-style:none}.tx-editor-prose ul[data-type=taskList] li{display:flex;align-items:flex-start;gap:var(--tx-editor-content-task-gap)}.tx-editor-prose ul[data-type=taskList] li>label{display:inline-flex;flex-shrink:0;align-items:center;height:calc(1em * var(--tx-editor-content-line-height));margin:0;-webkit-user-select:none;user-select:none}.tx-editor-prose ul[data-type=taskList] li>div{flex:1 1 auto;min-width:0}.tx-editor-prose ul[data-type=taskList] li[data-checked=true]>div{color:var(--tx-editor-content-task-done-color);text-decoration:line-through;text-decoration-color:var(--tx-editor-content-task-done-color)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]{display:grid;place-content:center;width:var(--tx-editor-content-task-size);height:var(--tx-editor-content-task-size);margin:0;border:1.5px solid var(--tx-editor-content-task-border-color);border-radius:var(--tx-editor-content-task-border-radius);background:transparent;cursor:pointer;appearance:none;transition:background-color var(--tx-motion-duration) var(--tx-motion-easing),border-color var(--tx-motion-duration) var(--tx-motion-easing)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]:after{width:4px;height:8px;margin-top:-2px;border:solid var(--tx-editor-content-task-checked-color);border-width:0 2px 2px 0;content:\"\";opacity:0;transform:rotate(45deg) scale(.6);transition:opacity var(--tx-motion-duration) var(--tx-motion-easing),transform var(--tx-motion-duration) var(--tx-motion-easing)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]:checked{border-color:var(--tx-editor-content-task-checked-background);background:var(--tx-editor-content-task-checked-background)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]:checked:after{opacity:1;transform:rotate(45deg) scale(1)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]:disabled{cursor:default}.tx-editor-prose blockquote{padding:var(--tx-editor-content-quote-padding);border-left:var(--tx-editor-content-quote-border-width) solid var(--tx-editor-content-quote-border-color);color:var(--tx-editor-content-quote-color)}.tx-editor-prose blockquote>:last-child{margin-bottom:0}.tx-editor-prose code{padding:var(--tx-editor-content-code-padding);border-radius:var(--tx-editor-content-code-border-radius);background:var(--tx-editor-content-code-background);color:var(--tx-editor-content-code-color);font-family:var(--tx-editor-content-code-font-family);font-size:var(--tx-editor-content-code-font-size);-webkit-box-decoration-break:clone;box-decoration-break:clone}.tx-editor-prose pre{overflow-x:auto;padding:var(--tx-editor-content-code-block-padding);border:1px solid var(--tx-editor-content-code-block-border-color);border-radius:var(--tx-editor-content-code-block-border-radius);background:var(--tx-editor-content-code-block-background);font-family:var(--tx-editor-content-code-font-family);font-size:var(--tx-editor-content-code-block-font-size);line-height:var(--tx-editor-content-code-block-line-height);tab-size:2;white-space:pre}.tx-editor-prose pre code{padding:0;border-radius:0;background:none;font-size:inherit}.tx-editor-prose hr{height:0;margin:var(--tx-editor-content-rule-spacing) 0;border:0;border-top:1px solid var(--tx-editor-content-rule-color)}.tx-editor-prose img{display:block;max-width:100%;height:auto;border-radius:var(--tx-editor-content-image-border-radius)}.tx-editor-prose iframe{display:block;width:100%;max-width:640px;height:auto;border:0;border-radius:var(--tx-editor-content-video-border-radius);aspect-ratio:var(--tx-editor-content-video-aspect-ratio)}.tx-editor-prose [data-type=mention]{padding:var(--tx-editor-content-mention-padding);border-radius:var(--tx-editor-content-mention-border-radius);background:var(--tx-editor-content-mention-background);color:var(--tx-editor-content-mention-color);font-weight:var(--tx-editor-content-mention-font-weight);white-space:nowrap;-webkit-box-decoration-break:clone;box-decoration-break:clone}.tx-editor-prose [data-type=callout]{--_tone: var(--tx-editor-content-callout-info-color);position:relative;margin-block:var(--_gap);padding:var(--tx-editor-content-callout-padding-block) var(--tx-editor-content-callout-padding-inline-end) var(--tx-editor-content-callout-padding-block) var(--tx-editor-content-callout-padding-inline-start);border-radius:var(--tx-editor-content-callout-border-radius);background:color-mix(in srgb,var(--_tone) var(--tx-editor-content-callout-tint),transparent)}.tx-editor-prose [data-type=callout]:before{position:absolute;inset-block-start:calc(var(--tx-editor-content-callout-padding-block) + (var(--tx-editor-content-font-size) * var(--tx-editor-content-line-height) - var(--tx-editor-content-callout-marker-size)) / 2);inset-inline-start:var(--tx-editor-content-callout-marker-start);display:grid;place-items:center;width:var(--tx-editor-content-callout-marker-size);height:var(--tx-editor-content-callout-marker-size);border-radius:var(--tx-radius-full);background:var(--_tone);color:var(--tx-editor-content-callout-marker-color);content:\"i\";font-size:var(--tx-editor-content-callout-marker-font-size);font-weight:var(--tx-font-weight-bold);line-height:1}.tx-editor-prose [data-type=callout]>:last-child{margin-bottom:0}.tx-editor-prose [data-type=callout][data-tone=success]{--_tone: var(--tx-editor-content-callout-success-color)}.tx-editor-prose [data-type=callout][data-tone=success]:before{content:\"\\2713\"}.tx-editor-prose [data-type=callout][data-tone=warn]{--_tone: var(--tx-editor-content-callout-warn-color)}.tx-editor-prose [data-type=callout][data-tone=warn]:before{content:\"!\"}.tx-editor-prose [data-type=callout][data-tone=danger]{--_tone: var(--tx-editor-content-callout-danger-color)}.tx-editor-prose [data-type=callout][data-tone=danger]:before{content:\"!\"}.tx-editor-prose table{width:100%;border-collapse:collapse;table-layout:fixed}.tx-editor-prose th,.tx-editor-prose td{padding:var(--tx-editor-content-table-cell-padding);border:1px solid var(--tx-editor-content-table-border-color);text-align:start;vertical-align:top}.tx-editor-prose th>p,.tx-editor-prose td>p{margin:0}.tx-editor-prose th{background:var(--tx-editor-content-table-header-background);font-weight:var(--tx-font-weight-semibold)}.tx-editor-prose .ql-align-center{text-align:center}.tx-editor-prose .ql-align-right{text-align:right}.tx-editor-prose .ql-align-justify{text-align:justify}.tx-editor-prose .ql-size-small{font-size:.75em}.tx-editor-prose .ql-size-large{font-size:1.5em}.tx-editor-prose .ql-size-huge{font-size:2.5em}.tx-editor-prose .ql-font-serif{font-family:serif}.tx-editor-prose .ql-font-monospace{font-family:var(--tx-font-mono)}.tx-editor-prose .ql-direction-rtl{direction:rtl;text-align:inherit}.tx-editor-prose .ql-indent-1:not(li){padding-left:3em}.tx-editor-prose .ql-indent-2:not(li){padding-left:6em}.tx-editor-prose .ql-indent-3:not(li){padding-left:9em}.tx-editor-prose .ql-indent-4:not(li){padding-left:12em}.tx-editor-prose .ql-indent-5:not(li){padding-left:15em}.tx-editor-prose .ql-indent-6:not(li){padding-left:18em}.tx-editor-prose .ql-indent-7:not(li){padding-left:21em}.tx-editor-prose .ql-indent-8:not(li){padding-left:24em}.tx-editor-prose ol:has(>li[data-list]){padding-left:var(--tx-editor-content-list-indent);list-style:none;counter-reset:tx-ql-0}.tx-editor-prose ol:has(>li[data-list])>li[data-list]{position:relative;counter-increment:tx-ql-0}.tx-editor-prose ol:has(>li[data-list])>li[data-list]:before{position:absolute;right:calc(100% + .5em);color:var(--tx-editor-content-list-marker-color);white-space:nowrap}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=bullet]:before{content:\"\\2022\"}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=ordered]:before{content:counter(tx-ql-0) \".\"}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=checked]:before{content:\"\\2611\"}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=unchecked]:before{content:\"\\2610\"}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=checked]{color:var(--tx-editor-content-task-done-color);text-decoration:line-through}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-1{padding-left:1.5em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-2{padding-left:3em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-3{padding-left:4.5em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-4{padding-left:6em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-5{padding-left:7.5em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-6{padding-left:9em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-7{padding-left:10.5em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-8{padding-left:12em}.tx-editor-prose .ql-code-block-container{margin-block:var(--_gap);padding:var(--tx-editor-content-code-block-padding);border:1px solid var(--tx-editor-content-code-block-border-color);border-radius:var(--tx-editor-content-code-block-border-radius);background:var(--tx-editor-content-code-block-background);font-family:var(--tx-editor-content-code-font-family);font-size:var(--tx-editor-content-code-block-font-size);line-height:var(--tx-editor-content-code-block-line-height);white-space:pre}@media(prefers-reduced-motion:reduce){.tx-editor-prose a,.tx-editor-prose input[type=checkbox],.tx-editor-prose input[type=checkbox]:after{transition:none}}\n"],
|
|
462
|
+
viewProviders: [provideTxIconDefaults(CONTENT_ICON_DEFAULTS)],
|
|
454
463
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
455
464
|
encapsulation: i0.ViewEncapsulation.None
|
|
456
465
|
});
|
|
@@ -467,11 +476,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
467
476
|
template: "",
|
|
468
477
|
encapsulation: ViewEncapsulation.None,
|
|
469
478
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
479
|
+
viewProviders: [provideTxIconDefaults(CONTENT_ICON_DEFAULTS)],
|
|
470
480
|
styles: ["@charset \"UTF-8\";.tx-editor-prose{--_gap: var(--tx-editor-content-block-gap);--_paragraph-gap: var(--tx-editor-content-paragraph-gap);color:var(--tx-editor-content-color);font-family:var(--tx-font-family);font-size:var(--tx-editor-content-font-size);line-height:var(--tx-editor-content-line-height);overflow-wrap:break-word}.tx-editor-prose>:first-child{margin-top:0}.tx-editor-prose>:last-child{margin-bottom:0}.tx-editor-prose p,.tx-editor-prose ul,.tx-editor-prose ol,.tx-editor-prose blockquote{margin:0 0 var(--_paragraph-gap)}.tx-editor-prose pre,.tx-editor-prose table,.tx-editor-prose figure,.tx-editor-prose img,.tx-editor-prose iframe{margin-block:var(--_gap)}.tx-editor-prose h1,.tx-editor-prose h2,.tx-editor-prose h3,.tx-editor-prose h4,.tx-editor-prose h5,.tx-editor-prose h6{margin:var(--tx-editor-content-heading-space-before) 0 var(--tx-editor-content-heading-space-after);font-weight:var(--tx-editor-content-heading-font-weight);letter-spacing:-.01em;line-height:var(--tx-editor-content-heading-line-height)}.tx-editor-prose h1{font-size:var(--tx-editor-content-heading-h1-size);letter-spacing:-.02em}.tx-editor-prose h2{font-size:var(--tx-editor-content-heading-h2-size)}.tx-editor-prose h3{font-size:var(--tx-editor-content-heading-h3-size)}.tx-editor-prose h4{font-size:var(--tx-editor-content-heading-h4-size)}.tx-editor-prose h5{font-size:var(--tx-editor-content-heading-h5-size)}.tx-editor-prose h6{color:var(--tx-editor-content-heading-h6-color);font-size:var(--tx-editor-content-heading-h6-size);letter-spacing:.02em;text-transform:uppercase}.tx-editor-prose a{color:var(--tx-editor-content-link-color);text-decoration:underline;text-decoration-color:var(--tx-editor-content-link-underline-color);text-decoration-thickness:1px;text-underline-offset:.2em;cursor:pointer;transition:text-decoration-color var(--tx-motion-duration) var(--tx-motion-easing)}.tx-editor-prose a:hover{text-decoration-color:var(--tx-editor-content-link-hover-underline-color)}.tx-editor-prose ul,.tx-editor-prose ol{padding-left:var(--tx-editor-content-list-indent)}.tx-editor-prose ul ul,.tx-editor-prose ul ol,.tx-editor-prose ol ul,.tx-editor-prose ol ol{margin:var(--tx-editor-content-list-item-gap) 0 0}.tx-editor-prose ul{list-style:disc}.tx-editor-prose ul ul{list-style:circle}.tx-editor-prose ul ul ul{list-style:square}.tx-editor-prose ol{list-style:decimal}.tx-editor-prose ol ol{list-style:lower-alpha}.tx-editor-prose ol ol ol{list-style:lower-roman}.tx-editor-prose li{margin:0}.tx-editor-prose li+li{margin-top:var(--tx-editor-content-list-item-gap)}.tx-editor-prose li>p{margin:0}.tx-editor-prose li::marker{color:var(--tx-editor-content-list-marker-color)}.tx-editor-prose ul[data-type=taskList]{padding-left:0;list-style:none}.tx-editor-prose ul[data-type=taskList] li{display:flex;align-items:flex-start;gap:var(--tx-editor-content-task-gap)}.tx-editor-prose ul[data-type=taskList] li>label{display:inline-flex;flex-shrink:0;align-items:center;height:calc(1em * var(--tx-editor-content-line-height));margin:0;-webkit-user-select:none;user-select:none}.tx-editor-prose ul[data-type=taskList] li>div{flex:1 1 auto;min-width:0}.tx-editor-prose ul[data-type=taskList] li[data-checked=true]>div{color:var(--tx-editor-content-task-done-color);text-decoration:line-through;text-decoration-color:var(--tx-editor-content-task-done-color)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]{display:grid;place-content:center;width:var(--tx-editor-content-task-size);height:var(--tx-editor-content-task-size);margin:0;border:1.5px solid var(--tx-editor-content-task-border-color);border-radius:var(--tx-editor-content-task-border-radius);background:transparent;cursor:pointer;appearance:none;transition:background-color var(--tx-motion-duration) var(--tx-motion-easing),border-color var(--tx-motion-duration) var(--tx-motion-easing)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]:after{width:4px;height:8px;margin-top:-2px;border:solid var(--tx-editor-content-task-checked-color);border-width:0 2px 2px 0;content:\"\";opacity:0;transform:rotate(45deg) scale(.6);transition:opacity var(--tx-motion-duration) var(--tx-motion-easing),transform var(--tx-motion-duration) var(--tx-motion-easing)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]:checked{border-color:var(--tx-editor-content-task-checked-background);background:var(--tx-editor-content-task-checked-background)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]:checked:after{opacity:1;transform:rotate(45deg) scale(1)}.tx-editor-prose ul[data-type=taskList] input[type=checkbox]:disabled{cursor:default}.tx-editor-prose blockquote{padding:var(--tx-editor-content-quote-padding);border-left:var(--tx-editor-content-quote-border-width) solid var(--tx-editor-content-quote-border-color);color:var(--tx-editor-content-quote-color)}.tx-editor-prose blockquote>:last-child{margin-bottom:0}.tx-editor-prose code{padding:var(--tx-editor-content-code-padding);border-radius:var(--tx-editor-content-code-border-radius);background:var(--tx-editor-content-code-background);color:var(--tx-editor-content-code-color);font-family:var(--tx-editor-content-code-font-family);font-size:var(--tx-editor-content-code-font-size);-webkit-box-decoration-break:clone;box-decoration-break:clone}.tx-editor-prose pre{overflow-x:auto;padding:var(--tx-editor-content-code-block-padding);border:1px solid var(--tx-editor-content-code-block-border-color);border-radius:var(--tx-editor-content-code-block-border-radius);background:var(--tx-editor-content-code-block-background);font-family:var(--tx-editor-content-code-font-family);font-size:var(--tx-editor-content-code-block-font-size);line-height:var(--tx-editor-content-code-block-line-height);tab-size:2;white-space:pre}.tx-editor-prose pre code{padding:0;border-radius:0;background:none;font-size:inherit}.tx-editor-prose hr{height:0;margin:var(--tx-editor-content-rule-spacing) 0;border:0;border-top:1px solid var(--tx-editor-content-rule-color)}.tx-editor-prose img{display:block;max-width:100%;height:auto;border-radius:var(--tx-editor-content-image-border-radius)}.tx-editor-prose iframe{display:block;width:100%;max-width:640px;height:auto;border:0;border-radius:var(--tx-editor-content-video-border-radius);aspect-ratio:var(--tx-editor-content-video-aspect-ratio)}.tx-editor-prose [data-type=mention]{padding:var(--tx-editor-content-mention-padding);border-radius:var(--tx-editor-content-mention-border-radius);background:var(--tx-editor-content-mention-background);color:var(--tx-editor-content-mention-color);font-weight:var(--tx-editor-content-mention-font-weight);white-space:nowrap;-webkit-box-decoration-break:clone;box-decoration-break:clone}.tx-editor-prose [data-type=callout]{--_tone: var(--tx-editor-content-callout-info-color);position:relative;margin-block:var(--_gap);padding:var(--tx-editor-content-callout-padding-block) var(--tx-editor-content-callout-padding-inline-end) var(--tx-editor-content-callout-padding-block) var(--tx-editor-content-callout-padding-inline-start);border-radius:var(--tx-editor-content-callout-border-radius);background:color-mix(in srgb,var(--_tone) var(--tx-editor-content-callout-tint),transparent)}.tx-editor-prose [data-type=callout]:before{position:absolute;inset-block-start:calc(var(--tx-editor-content-callout-padding-block) + (var(--tx-editor-content-font-size) * var(--tx-editor-content-line-height) - var(--tx-editor-content-callout-marker-size)) / 2);inset-inline-start:var(--tx-editor-content-callout-marker-start);display:grid;place-items:center;width:var(--tx-editor-content-callout-marker-size);height:var(--tx-editor-content-callout-marker-size);border-radius:var(--tx-radius-full);background:var(--_tone);color:var(--tx-editor-content-callout-marker-color);content:\"i\";font-size:var(--tx-editor-content-callout-marker-font-size);font-weight:var(--tx-font-weight-bold);line-height:1}.tx-editor-prose [data-type=callout]>:last-child{margin-bottom:0}.tx-editor-prose [data-type=callout][data-tone=success]{--_tone: var(--tx-editor-content-callout-success-color)}.tx-editor-prose [data-type=callout][data-tone=success]:before{content:\"\\2713\"}.tx-editor-prose [data-type=callout][data-tone=warn]{--_tone: var(--tx-editor-content-callout-warn-color)}.tx-editor-prose [data-type=callout][data-tone=warn]:before{content:\"!\"}.tx-editor-prose [data-type=callout][data-tone=danger]{--_tone: var(--tx-editor-content-callout-danger-color)}.tx-editor-prose [data-type=callout][data-tone=danger]:before{content:\"!\"}.tx-editor-prose table{width:100%;border-collapse:collapse;table-layout:fixed}.tx-editor-prose th,.tx-editor-prose td{padding:var(--tx-editor-content-table-cell-padding);border:1px solid var(--tx-editor-content-table-border-color);text-align:start;vertical-align:top}.tx-editor-prose th>p,.tx-editor-prose td>p{margin:0}.tx-editor-prose th{background:var(--tx-editor-content-table-header-background);font-weight:var(--tx-font-weight-semibold)}.tx-editor-prose .ql-align-center{text-align:center}.tx-editor-prose .ql-align-right{text-align:right}.tx-editor-prose .ql-align-justify{text-align:justify}.tx-editor-prose .ql-size-small{font-size:.75em}.tx-editor-prose .ql-size-large{font-size:1.5em}.tx-editor-prose .ql-size-huge{font-size:2.5em}.tx-editor-prose .ql-font-serif{font-family:serif}.tx-editor-prose .ql-font-monospace{font-family:var(--tx-font-mono)}.tx-editor-prose .ql-direction-rtl{direction:rtl;text-align:inherit}.tx-editor-prose .ql-indent-1:not(li){padding-left:3em}.tx-editor-prose .ql-indent-2:not(li){padding-left:6em}.tx-editor-prose .ql-indent-3:not(li){padding-left:9em}.tx-editor-prose .ql-indent-4:not(li){padding-left:12em}.tx-editor-prose .ql-indent-5:not(li){padding-left:15em}.tx-editor-prose .ql-indent-6:not(li){padding-left:18em}.tx-editor-prose .ql-indent-7:not(li){padding-left:21em}.tx-editor-prose .ql-indent-8:not(li){padding-left:24em}.tx-editor-prose ol:has(>li[data-list]){padding-left:var(--tx-editor-content-list-indent);list-style:none;counter-reset:tx-ql-0}.tx-editor-prose ol:has(>li[data-list])>li[data-list]{position:relative;counter-increment:tx-ql-0}.tx-editor-prose ol:has(>li[data-list])>li[data-list]:before{position:absolute;right:calc(100% + .5em);color:var(--tx-editor-content-list-marker-color);white-space:nowrap}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=bullet]:before{content:\"\\2022\"}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=ordered]:before{content:counter(tx-ql-0) \".\"}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=checked]:before{content:\"\\2611\"}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=unchecked]:before{content:\"\\2610\"}.tx-editor-prose ol:has(>li[data-list])>li[data-list][data-list=checked]{color:var(--tx-editor-content-task-done-color);text-decoration:line-through}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-1{padding-left:1.5em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-2{padding-left:3em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-3{padding-left:4.5em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-4{padding-left:6em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-5{padding-left:7.5em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-6{padding-left:9em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-7{padding-left:10.5em}.tx-editor-prose ol:has(>li[data-list])>li.ql-indent-8{padding-left:12em}.tx-editor-prose .ql-code-block-container{margin-block:var(--_gap);padding:var(--tx-editor-content-code-block-padding);border:1px solid var(--tx-editor-content-code-block-border-color);border-radius:var(--tx-editor-content-code-block-border-radius);background:var(--tx-editor-content-code-block-background);font-family:var(--tx-editor-content-code-font-family);font-size:var(--tx-editor-content-code-block-font-size);line-height:var(--tx-editor-content-code-block-line-height);white-space:pre}@media(prefers-reduced-motion:reduce){.tx-editor-prose a,.tx-editor-prose input[type=checkbox],.tx-editor-prose input[type=checkbox]:after{transition:none}}\n"]
|
|
471
481
|
}]
|
|
472
482
|
}]
|
|
473
483
|
});
|
|
474
484
|
var TxEditorContent = class TxEditorContent {
|
|
485
|
+
contentTheme = injectTokens(CONTENT_THEME);
|
|
475
486
|
sanitizer = inject(DomSanitizer);
|
|
476
487
|
document = inject(DOCUMENT);
|
|
477
488
|
html = input(null, ...ngDevMode ? [{ debugName: "html" }] : /* istanbul ignore next */ []);
|
|
@@ -679,6 +690,7 @@ var TxEditorContent = class TxEditorContent {
|
|
|
679
690
|
"closed"
|
|
680
691
|
]
|
|
681
692
|
}],
|
|
693
|
+
viewProviders: [provideTxIconDefaults(CONTENT_ICON_DEFAULTS)],
|
|
682
694
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
683
695
|
});
|
|
684
696
|
};
|
|
@@ -725,6 +737,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
725
737
|
"[attr.data-styled]": "!isUnstyled() || null",
|
|
726
738
|
"[class.tx-editor-content--zoom]": "previewImages()"
|
|
727
739
|
},
|
|
740
|
+
viewProviders: [provideTxIconDefaults(CONTENT_ICON_DEFAULTS)],
|
|
728
741
|
styles: [":host{display:block;min-width:0}:host(.tx-editor-content--zoom) .tx-editor-content__body ::ng-deep img{cursor:zoom-in}.tx-editor-content__preview{display:block;max-width:100%;max-height:75vh;margin:0 auto;border-radius:var(--tx-editor-content-image-border-radius);object-fit:contain}\n"]
|
|
729
742
|
}]
|
|
730
743
|
}],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-editor-content.mjs","names":[],"sources":["../../../../packages/editor/content/src/parse-html.ts","../../../../packages/editor/content/src/editor-html.ts","../../../../packages/editor/content/src/editor-sanitizer.ts","../../../../packages/editor/content/src/editor-prose-styles.component.ts","../../../../packages/editor/content/src/editor-content.component.ts"],"sourcesContent":["export function parseHtmlBody(html: string, document?: Document | null): HTMLElement | null {\n const Parser = globalThis.DOMParser;\n if (Parser) {\n return new Parser().parseFromString(`<body>${html}</body>`, 'text/html').body;\n }\n const inert = document?.implementation.createHTMLDocument('');\n if (!inert) {\n return null;\n }\n inert.body.innerHTML = html;\n return inert.body;\n}\n\nexport function appendNodes(parent: Node, nodes: Iterable<Node>): void {\n for (const node of Array.from(nodes)) {\n parent.appendChild(node);\n }\n}\n\nexport function replaceNode(node: Node, replacement: Node): void {\n node.parentNode?.replaceChild(replacement, node);\n}\n\nexport function unwrapNode(node: Node): void {\n const parent = node.parentNode;\n if (!parent) {\n return;\n }\n for (const child of Array.from(node.childNodes)) {\n parent.insertBefore(child, node);\n }\n parent.removeChild(node);\n}\n","import { TxEditorFormat } from './editor-content.types';\nimport { appendNodes, parseHtmlBody, replaceNode } from './parse-html';\n\nconst QUILL_SIZES: Record<string, string> = { small: '0.75em', large: '1.5em', huge: '2.5em' };\nconst QUILL_FONTS: Record<string, string> = { serif: 'serif', monospace: 'monospace' };\nconst INDENT_STEP_EM = 3;\nconst ALIGNMENTS = ['left', 'center', 'right', 'justify'];\nconst QUILL_MARKERS = /data-list=|class=\"[^\"]*\\bql-|ql-code-block|ql-video/;\n\ntype TxListKind = 'bullet' | 'ordered' | 'checked' | 'unchecked';\n\nfunction classValue(element: Element, prefix: string): string | null {\n const match = Array.from(element.classList).find((name) => name.startsWith(prefix));\n if (!match) {\n return null;\n }\n element.classList.remove(match);\n return match.slice(prefix.length);\n}\n\nfunction cleanClassAttribute(element: Element): void {\n if (element.getAttribute('class') === '') {\n element.removeAttribute('class');\n }\n}\n\nfunction styleOf(element: Element): CSSStyleDeclaration | null {\n return (element as HTMLElement).style ?? null;\n}\n\nfunction indentLevel(element: Element): number {\n const value = Number(element.getAttribute('data-indent') ?? NaN);\n if (!Number.isNaN(value)) {\n return value;\n }\n const margin = styleOf(element)?.marginLeft ?? '';\n return margin.endsWith('em') ? Math.round(parseFloat(margin) / INDENT_STEP_EM) : 0;\n}\n\nfunction quillListKind(item: Element, list: Element): TxListKind {\n const data = item.getAttribute('data-list');\n if (data === 'bullet' || data === 'ordered' || data === 'checked' || data === 'unchecked') {\n return data;\n }\n return list.tagName === 'UL' ? 'bullet' : 'ordered';\n}\n\nfunction createList(document: Document, kind: TxListKind): HTMLElement {\n const list = document.createElement(kind === 'ordered' ? 'ol' : 'ul');\n if (kind === 'checked' || kind === 'unchecked') {\n list.setAttribute('data-type', 'taskList');\n }\n return list;\n}\n\nfunction sameListKind(a: TxListKind, b: TxListKind): boolean {\n const task = (kind: TxListKind) => kind === 'checked' || kind === 'unchecked';\n return a === b || (task(a) && task(b));\n}\n\nfunction convertQuillList(list: Element): void {\n const document = list.ownerDocument;\n const items = Array.from(list.children).filter((child) => child.tagName === 'LI');\n const fragment = document.createDocumentFragment();\n const stack: { level: number; kind: TxListKind; element: HTMLElement }[] = [];\n for (const item of items) {\n const kind = quillListKind(item, list);\n const level = Number(classValue(item, 'ql-indent-') ?? 0);\n while (stack.length && stack[stack.length - 1].level > level) {\n stack.pop();\n }\n const top = stack[stack.length - 1];\n if (top && top.level === level && !sameListKind(top.kind, kind)) {\n stack.pop();\n }\n if (!stack.length || stack[stack.length - 1].level < level) {\n const element = createList(document, kind);\n const parent = stack[stack.length - 1];\n if (parent) {\n const lastItem = parent.element.lastElementChild ?? parent.element.appendChild(document.createElement('li'));\n lastItem.appendChild(element);\n } else {\n fragment.appendChild(element);\n }\n stack.push({ level, kind, element });\n }\n const current = stack[stack.length - 1];\n const next = document.createElement('li');\n const paragraph = document.createElement('p');\n const align = classValue(item, 'ql-align-');\n if (align && ALIGNMENTS.includes(align)) {\n paragraph.style.textAlign = align;\n }\n item.querySelectorAll('.ql-ui').forEach((node) => node.remove());\n appendNodes(paragraph, item.childNodes);\n if (kind === 'checked' || kind === 'unchecked') {\n next.setAttribute('data-type', 'taskItem');\n next.setAttribute('data-checked', String(kind === 'checked'));\n }\n next.appendChild(paragraph);\n current.element.appendChild(next);\n }\n replaceNode(list, fragment);\n}\n\nfunction convertQuillCode(container: Element): void {\n const document = container.ownerDocument;\n const lines = Array.from(container.querySelectorAll('.ql-code-block'));\n const pre = document.createElement('pre');\n const code = document.createElement('code');\n const language = lines[0]?.getAttribute('data-language');\n if (language && language !== 'plain') {\n code.className = `language-${language}`;\n }\n code.textContent = lines.map((line) => line.textContent ?? '').join('\\n');\n pre.appendChild(code);\n replaceNode(container, pre);\n}\n\nexport function isQuillHtml(html: string | null | undefined): boolean {\n return !!html && QUILL_MARKERS.test(html);\n}\n\nexport function fromQuillHtml(html: string | null | undefined, document?: Document | null): string {\n if (!html) {\n return '';\n }\n if (!isQuillHtml(html)) {\n return html;\n }\n const body = parseHtmlBody(html, document);\n if (!body) {\n return html;\n }\n body.querySelectorAll('.ql-cursor, .ql-ui').forEach((node) => node.remove());\n body.querySelectorAll('.ql-code-block-container').forEach(convertQuillCode);\n body.querySelectorAll('pre.ql-syntax').forEach((pre) => {\n const code = body.ownerDocument.createElement('code');\n code.textContent = pre.textContent ?? '';\n pre.textContent = '';\n pre.appendChild(code);\n pre.classList.remove('ql-syntax');\n cleanClassAttribute(pre);\n });\n Array.from(body.querySelectorAll('ol, ul'))\n .filter((list) => Array.from(list.children).some((item) => item.hasAttribute('data-list') || /\\bql-indent-/.test(item.className)))\n .filter((list) => !list.parentElement?.closest('ol, ul'))\n .forEach(convertQuillList);\n body.querySelectorAll('[class*=\"ql-\"]').forEach((element) => {\n const style = styleOf(element);\n const align = classValue(element, 'ql-align-');\n if (align && ALIGNMENTS.includes(align) && style) {\n style.textAlign = align;\n }\n const indent = Number(classValue(element, 'ql-indent-') ?? 0);\n if (indent > 0 && style) {\n element.setAttribute('data-indent', String(indent));\n style.marginLeft = `${indent * INDENT_STEP_EM}em`;\n }\n const size = classValue(element, 'ql-size-');\n if (size && QUILL_SIZES[size] && style) {\n style.fontSize = QUILL_SIZES[size];\n }\n const font = classValue(element, 'ql-font-');\n if (font && QUILL_FONTS[font] && style) {\n style.fontFamily = QUILL_FONTS[font];\n }\n if (classValue(element, 'ql-direction-') === 'rtl') {\n element.setAttribute('dir', 'rtl');\n }\n if (element.tagName === 'IFRAME' && element.classList.contains('ql-video')) {\n element.classList.remove('ql-video');\n element.setAttribute('data-type', 'video');\n }\n cleanClassAttribute(element);\n });\n return body.innerHTML;\n}\n\nfunction flattenList(list: Element, level: number, out: HTMLElement): void {\n const document = list.ownerDocument;\n const task = list.getAttribute('data-type') === 'taskList';\n for (const item of Array.from(list.children).filter((child) => child.tagName === 'LI')) {\n const kind: TxListKind = task ? (item.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked') : list.tagName === 'OL' ? 'ordered' : 'bullet';\n const next = document.createElement('li');\n next.setAttribute('data-list', kind);\n if (level > 0) {\n next.classList.add(`ql-indent-${level}`);\n }\n const nested: Element[] = [];\n const blocks = task ? Array.from(item.querySelector(':scope > div')?.children ?? item.children) : Array.from(item.children);\n const inline: Node[] = [];\n for (const child of blocks) {\n if (child.tagName === 'UL' || child.tagName === 'OL') {\n nested.push(child);\n } else if (child.tagName === 'LABEL') {\n continue;\n } else {\n const align = styleOf(child)?.textAlign;\n if (align && ALIGNMENTS.includes(align) && align !== 'left') {\n next.classList.add(`ql-align-${align}`);\n }\n if (inline.length) {\n inline.push(document.createElement('br'));\n }\n inline.push(...Array.from(child.childNodes));\n }\n }\n appendNodes(next, inline);\n out.appendChild(next);\n nested.forEach((child) => flattenList(child, level + 1, out));\n }\n}\n\nexport function toQuillHtml(html: string | null | undefined, document?: Document | null): string {\n if (!html) {\n return '';\n }\n const body = parseHtmlBody(html, document);\n if (!body) {\n return html;\n }\n const owner = body.ownerDocument;\n const topLists = Array.from(body.querySelectorAll('ol, ul')).filter((list) => !list.parentElement?.closest('ol, ul'));\n let previous: HTMLElement | null = null;\n for (const list of topLists) {\n const target: HTMLElement = previous && previous.nextSibling === list ? previous : owner.createElement('ol');\n flattenList(list, 0, target);\n if (target === previous) {\n list.remove();\n } else {\n replaceNode(list, target);\n }\n previous = target;\n }\n body.querySelectorAll('pre').forEach((pre) => {\n const code = pre.querySelector('code');\n const language = Array.from(code?.classList ?? []).find((name) => name.startsWith('language-'))?.slice(9) ?? 'plain';\n const container = owner.createElement('div');\n container.className = 'ql-code-block-container';\n container.setAttribute('spellcheck', 'false');\n for (const line of (code?.textContent ?? pre.textContent ?? '').split('\\n')) {\n const block = owner.createElement('div');\n block.className = 'ql-code-block';\n block.setAttribute('data-language', language);\n block.textContent = line;\n if (!line) {\n block.appendChild(owner.createElement('br'));\n }\n container.appendChild(block);\n }\n replaceNode(pre, container);\n });\n body.querySelectorAll('[style], [data-indent], [dir], iframe[data-type=\"video\"]').forEach((element) => {\n const style = styleOf(element);\n if (style?.textAlign && ALIGNMENTS.includes(style.textAlign)) {\n if (style.textAlign !== 'left') {\n element.classList.add(`ql-align-${style.textAlign}`);\n }\n style.removeProperty('text-align');\n }\n const indent = indentLevel(element);\n if (indent > 0) {\n element.classList.add(`ql-indent-${indent}`);\n }\n element.removeAttribute('data-indent');\n style?.removeProperty('margin-left');\n const size = Object.entries(QUILL_SIZES).find(([, value]) => value === style?.fontSize)?.[0];\n if (size) {\n element.classList.add(`ql-size-${size}`);\n style?.removeProperty('font-size');\n }\n const font = Object.entries(QUILL_FONTS).find(([, value]) => value === style?.fontFamily)?.[0];\n if (font) {\n element.classList.add(`ql-font-${font}`);\n style?.removeProperty('font-family');\n }\n if (element.getAttribute('dir') === 'rtl') {\n element.classList.add('ql-direction-rtl');\n element.removeAttribute('dir');\n }\n if (element.tagName === 'IFRAME') {\n element.removeAttribute('data-type');\n element.classList.add('ql-video');\n element.setAttribute('frameborder', '0');\n element.setAttribute('allowfullscreen', 'true');\n }\n if (element.getAttribute('style') === '') {\n element.removeAttribute('style');\n }\n });\n body.querySelectorAll('p:empty, h1:empty, h2:empty, h3:empty, h4:empty, h5:empty, h6:empty').forEach((block) => block.appendChild(owner.createElement('br')));\n return body.innerHTML;\n}\n\nexport function toEditorHtml(html: string | null | undefined, document?: Document | null): string {\n return fromQuillHtml(html, document);\n}\n\nexport function formatEditorHtml(html: string, format: TxEditorFormat, document?: Document | null): string {\n return format === 'quill' ? toQuillHtml(html, document) : html;\n}\n","import { parseHtmlBody, unwrapNode } from './parse-html';\n\nconst ALLOWED_TAGS = new Set([\n 'p', 'br', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'strong', 'b', 'em', 'i', 'u', 's', 'strike', 'del', 'code', 'pre',\n 'blockquote', 'ul', 'ol', 'li', 'a', 'img', 'span', 'sub', 'sup', 'hr', 'mark', 'div', 'label', 'input',\n 'table', 'thead', 'tbody', 'tfoot', 'tr', 'th', 'td', 'colgroup', 'col', 'iframe',\n]);\n\nconst DROP_WITH_CONTENT = new Set(['script', 'style', 'template', 'noscript', 'object', 'embed', 'svg', 'math', 'textarea', 'select', 'button', 'form']);\n\nconst ALLOWED_ATTRIBUTES = new Set([\n 'class', 'style', 'href', 'target', 'rel', 'src', 'alt', 'title', 'width', 'height', 'colspan', 'rowspan', 'start', 'dir',\n 'data-list', 'data-type', 'data-checked', 'data-indent', 'data-language', 'data-id', 'data-label', 'data-mention-suggestion-char',\n 'colwidth', 'data-colwidth', 'data-tone', 'type', 'checked', 'disabled', 'frameborder', 'allowfullscreen', 'spellcheck',\n]);\n\nconst ALLOWED_STYLES = new Set(['color', 'background-color', 'text-align', 'font-size', 'font-family', 'margin-left', 'padding-left', 'width', 'min-width']);\n\nconst SAFE_STYLE_VALUE = /^[#(),.%\\w\\s'\"-]+$/;\nconst SAFE_CLASS = /^(ql-[\\w-]+|tx-[\\w-]+|language-[\\w-]+)$/;\nconst SAFE_LINK = /^(https?:|mailto:|tel:|sms:|#|\\/(?!\\/))/i;\nconst SAFE_IMAGE = /^(https?:|data:image\\/(png|jpe?g|gif|webp|avif|bmp|svg\\+xml);base64,|blob:|\\/(?!\\/))/i;\nconst SAFE_FRAME = /^https:\\/\\//i;\n\nfunction cleanStyle(value: string): string {\n return value\n .split(';')\n .map((declaration) => declaration.split(':'))\n .filter(([property, ...rest]) => property && rest.length)\n .map(([property, ...rest]) => [property.trim().toLowerCase(), rest.join(':').trim()])\n .filter(([property, propertyValue]) => ALLOWED_STYLES.has(property) && SAFE_STYLE_VALUE.test(propertyValue) && !/url\\s*\\(|expression\\s*\\(/i.test(propertyValue))\n .map(([property, propertyValue]) => `${property}: ${propertyValue}`)\n .join('; ');\n}\n\nfunction cleanAttribute(element: Element, name: string, value: string): string | null {\n const tag = element.tagName.toLowerCase();\n switch (name) {\n case 'style': {\n const style = cleanStyle(value);\n return style || null;\n }\n case 'class': {\n const classes = value.split(/\\s+/).filter((item) => SAFE_CLASS.test(item));\n return classes.length ? classes.join(' ') : null;\n }\n case 'href':\n return tag === 'a' && SAFE_LINK.test(value.trim()) ? value.trim() : null;\n case 'src':\n if (tag === 'img') {\n return SAFE_IMAGE.test(value.trim()) ? value.trim() : null;\n }\n return tag === 'iframe' && SAFE_FRAME.test(value.trim()) ? value.trim() : null;\n case 'target':\n return value === '_blank' ? value : null;\n case 'type':\n return tag === 'input' && value === 'checkbox' ? value : null;\n default:\n return value;\n }\n}\n\nfunction cleanNode(node: Node): void {\n for (const child of Array.from(node.childNodes)) {\n if (child.nodeType === 3) {\n continue;\n }\n if (child.nodeType !== 1) {\n child.remove();\n continue;\n }\n const element = child as Element;\n const tag = element.tagName.toLowerCase();\n if (DROP_WITH_CONTENT.has(tag)) {\n element.remove();\n continue;\n }\n if (!ALLOWED_TAGS.has(tag)) {\n cleanNode(element);\n unwrapNode(element);\n continue;\n }\n for (const attribute of Array.from(element.attributes)) {\n const name = attribute.name.toLowerCase();\n const cleaned = ALLOWED_ATTRIBUTES.has(name) ? cleanAttribute(element, name, attribute.value) : null;\n if (cleaned === null) {\n element.removeAttribute(attribute.name);\n } else if (cleaned !== attribute.value) {\n element.setAttribute(attribute.name, cleaned);\n }\n }\n if (tag === 'a' && element.getAttribute('target') === '_blank') {\n element.setAttribute('rel', 'noopener noreferrer nofollow');\n }\n if (tag === 'input') {\n element.setAttribute('disabled', '');\n }\n if (tag === 'iframe') {\n if (!element.getAttribute('src')) {\n element.remove();\n continue;\n }\n element.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-presentation allow-popups');\n element.setAttribute('loading', 'lazy');\n }\n cleanNode(element);\n }\n}\n\nexport function sanitizeEditorHtml(html: string | null | undefined, document?: Document | null): string {\n if (!html) {\n return '';\n }\n const body = parseHtmlBody(html, document);\n if (!body) {\n return '';\n }\n cleanNode(body);\n return body.innerHTML;\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'tx-editor-prose-styles',\n template: '',\n styleUrl: './editor-prose.styles.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TxEditorProseStyles {}\n","import { ChangeDetectionStrategy, Component, DOCUMENT, ElementRef, afterRenderEffect, booleanAttribute, computed, inject, input, output, signal, viewChild } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { TxStyleLoader } from '@tectra-ng/core/styles';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraEditorContentTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxDialog } from '@tectra-ng/ui/dialog';\nimport { TxEditorContentPart, TxEditorImageClickEvent } from './editor-content.types';\nimport { fromQuillHtml } from './editor-html';\nimport { TxEditorProseStyles } from './editor-prose-styles.component';\nimport { sanitizeEditorHtml } from './editor-sanitizer';\n\n@Component({\n selector: 'tx-editor-content',\n imports: [TxDialog],\n template: `\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- clicks and keys come from the images inside, which get a tab stop -->\n <div\n #body\n class=\"tx-editor-content__body\"\n [class.tx-editor-prose]=\"!isUnstyled()\"\n [class]=\"passThrough().body?.class\"\n [style]=\"passThrough().body?.style\"\n [innerHTML]=\"safeHtml()\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n ></div>\n @if (previewImages()) {\n <tx-dialog\n size=\"large\"\n [header]=\"preview()?.alt || translations().editorImagePreview\"\n [visible]=\"previewOpen()\"\n (visibleChange)=\"previewOpen.set($event)\"\n >\n @if (preview(); as image) {\n <img class=\"tx-editor-content__preview\" [src]=\"image.src\" [alt]=\"image.alt\" />\n }\n </tx-dialog>\n }\n `,\n styleUrl: './editor-content.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-editor-content',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-editor-content--zoom]': 'previewImages()',\n },\n})\nexport class TxEditorContent {\n private sanitizer = inject(DomSanitizer);\n private document = inject(DOCUMENT);\n\n readonly html = input<string | null | undefined>(null);\n readonly previewImages = input(true, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraEditorContentTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxEditorContentPart, TxEditorContent> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly imageClick = output<TxEditorImageClickEvent>();\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('editorContent', this, this.pt, this.ptOptions);\n private readonly body = viewChild<ElementRef<HTMLElement>>('body');\n protected readonly preview = signal<{ src: string; alt: string } | null>(null);\n protected readonly previewOpen = signal(false);\n protected readonly safeHtml = computed(() => this.sanitizer.bypassSecurityTrustHtml(sanitizeEditorHtml(fromQuillHtml(this.html(), this.document), this.document)));\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-editor-content'), ...this.passThrough().root?.style }));\n\n constructor() {\n inject(TxStyleLoader).load(TxEditorProseStyles);\n afterRenderEffect(() => {\n this.safeHtml();\n const preview = this.previewImages();\n this.body()\n ?.nativeElement.querySelectorAll('img')\n .forEach((image) => {\n if (preview) {\n image.setAttribute('tabindex', '0');\n image.setAttribute('role', 'button');\n } else {\n image.removeAttribute('tabindex');\n image.removeAttribute('role');\n }\n });\n });\n }\n\n protected onClick(event: MouseEvent): void {\n const target = event.target as HTMLElement | null;\n if (target instanceof HTMLImageElement) {\n this.open(target, event);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const target = event.target as HTMLElement | null;\n if (target instanceof HTMLImageElement && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n this.open(target, event);\n }\n }\n\n private open(target: HTMLImageElement, event: Event): void {\n const image = { src: target.currentSrc || target.src, alt: target.alt };\n this.imageClick.emit({ originalEvent: event as MouseEvent | KeyboardEvent, ...image });\n if (this.previewImages()) {\n this.preview.set(image);\n this.previewOpen.set(true);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAgB,cAAc,MAAc,UAA0B;CACpE,MAAM,SAAS,WAAW;CAC1B,IAAI,QACF,OAAO,IAAI,OAAM,CAAE,CAAC,gBAAgB,SAAS,KAAI,UAAW,WAAW,CAAC,CAAC;CAE3E,MAAM,QAAQ,UAAU,eAAe,mBAAmB,EAAE;CAC5D,IAAI,CAAC,OACH,OAAO;CAET,MAAM,KAAK,YAAY;CACvB,OAAO,MAAM;AACf;AAEA,SAAgB,YAAY,QAAc,OAAqB;CAC7D,KAAK,MAAM,QAAQ,MAAM,KAAK,KAAK,GACjC,OAAO,YAAY,IAAI;AAE3B;AAEA,SAAgB,YAAY,MAAY,aAAiB;CACvD,KAAK,YAAY,aAAa,aAAa,IAAI;AACjD;AAEA,SAAgB,WAAW,MAAU;CACnC,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QACH;CAEF,KAAK,MAAM,SAAS,MAAM,KAAK,KAAK,UAAU,GAC5C,OAAO,aAAa,OAAO,IAAI;CAEjC,OAAO,YAAY,IAAI;AACzB;AC7BA,MAAM,cAAsC;CAAE,OAAO;CAAU,OAAO;CAAS,MAAM;AAAO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,SACpB,CAAC,QAAQ;GAAC,UACT;;;;;;;;;;;;;;;;;;;;;;;;;GAwBT,iBAEgB,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,mCAAmC;GACpC;GAAA,QAAA,CAAA,+RAAA;EAAA,CAAA;CAkB0D,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-editor-content.mjs","names":[],"sources":["../../../../packages/editor/content/src/parse-html.ts","../../../../packages/editor/content/src/editor-html.ts","../../../../packages/editor/content/src/editor-sanitizer.ts","../../../../packages/editor/content/src/content.icons.ts","../../../../packages/editor/content/src/content.theme.ts","../../../../packages/editor/content/src/editor-prose-styles.component.ts","../../../../packages/editor/content/src/editor-content.component.ts"],"sourcesContent":["export function parseHtmlBody(html: string, document?: Document | null): HTMLElement | null {\n const Parser = globalThis.DOMParser;\n if (Parser) {\n return new Parser().parseFromString(`<body>${html}</body>`, 'text/html').body;\n }\n const inert = document?.implementation.createHTMLDocument('');\n if (!inert) {\n return null;\n }\n inert.body.innerHTML = html;\n return inert.body;\n}\n\nexport function appendNodes(parent: Node, nodes: Iterable<Node>): void {\n for (const node of Array.from(nodes)) {\n parent.appendChild(node);\n }\n}\n\nexport function replaceNode(node: Node, replacement: Node): void {\n node.parentNode?.replaceChild(replacement, node);\n}\n\nexport function unwrapNode(node: Node): void {\n const parent = node.parentNode;\n if (!parent) {\n return;\n }\n for (const child of Array.from(node.childNodes)) {\n parent.insertBefore(child, node);\n }\n parent.removeChild(node);\n}\n","import { TxEditorFormat } from './editor-content.types';\nimport { appendNodes, parseHtmlBody, replaceNode } from './parse-html';\n\nconst QUILL_SIZES: Record<string, string> = { small: '0.75em', large: '1.5em', huge: '2.5em' };\nconst QUILL_FONTS: Record<string, string> = { serif: 'serif', monospace: 'monospace' };\nconst INDENT_STEP_EM = 3;\nconst ALIGNMENTS = ['left', 'center', 'right', 'justify'];\nconst QUILL_MARKERS = /data-list=|class=\"[^\"]*\\bql-|ql-code-block|ql-video/;\n\ntype TxListKind = 'bullet' | 'ordered' | 'checked' | 'unchecked';\n\nfunction classValue(element: Element, prefix: string): string | null {\n const match = Array.from(element.classList).find((name) => name.startsWith(prefix));\n if (!match) {\n return null;\n }\n element.classList.remove(match);\n return match.slice(prefix.length);\n}\n\nfunction cleanClassAttribute(element: Element): void {\n if (element.getAttribute('class') === '') {\n element.removeAttribute('class');\n }\n}\n\nfunction styleOf(element: Element): CSSStyleDeclaration | null {\n return (element as HTMLElement).style ?? null;\n}\n\nfunction indentLevel(element: Element): number {\n const value = Number(element.getAttribute('data-indent') ?? NaN);\n if (!Number.isNaN(value)) {\n return value;\n }\n const margin = styleOf(element)?.marginLeft ?? '';\n return margin.endsWith('em') ? Math.round(parseFloat(margin) / INDENT_STEP_EM) : 0;\n}\n\nfunction quillListKind(item: Element, list: Element): TxListKind {\n const data = item.getAttribute('data-list');\n if (data === 'bullet' || data === 'ordered' || data === 'checked' || data === 'unchecked') {\n return data;\n }\n return list.tagName === 'UL' ? 'bullet' : 'ordered';\n}\n\nfunction createList(document: Document, kind: TxListKind): HTMLElement {\n const list = document.createElement(kind === 'ordered' ? 'ol' : 'ul');\n if (kind === 'checked' || kind === 'unchecked') {\n list.setAttribute('data-type', 'taskList');\n }\n return list;\n}\n\nfunction sameListKind(a: TxListKind, b: TxListKind): boolean {\n const task = (kind: TxListKind) => kind === 'checked' || kind === 'unchecked';\n return a === b || (task(a) && task(b));\n}\n\nfunction convertQuillList(list: Element): void {\n const document = list.ownerDocument;\n const items = Array.from(list.children).filter((child) => child.tagName === 'LI');\n const fragment = document.createDocumentFragment();\n const stack: { level: number; kind: TxListKind; element: HTMLElement }[] = [];\n for (const item of items) {\n const kind = quillListKind(item, list);\n const level = Number(classValue(item, 'ql-indent-') ?? 0);\n while (stack.length && stack[stack.length - 1].level > level) {\n stack.pop();\n }\n const top = stack[stack.length - 1];\n if (top && top.level === level && !sameListKind(top.kind, kind)) {\n stack.pop();\n }\n if (!stack.length || stack[stack.length - 1].level < level) {\n const element = createList(document, kind);\n const parent = stack[stack.length - 1];\n if (parent) {\n const lastItem = parent.element.lastElementChild ?? parent.element.appendChild(document.createElement('li'));\n lastItem.appendChild(element);\n } else {\n fragment.appendChild(element);\n }\n stack.push({ level, kind, element });\n }\n const current = stack[stack.length - 1];\n const next = document.createElement('li');\n const paragraph = document.createElement('p');\n const align = classValue(item, 'ql-align-');\n if (align && ALIGNMENTS.includes(align)) {\n paragraph.style.textAlign = align;\n }\n item.querySelectorAll('.ql-ui').forEach((node) => node.remove());\n appendNodes(paragraph, item.childNodes);\n if (kind === 'checked' || kind === 'unchecked') {\n next.setAttribute('data-type', 'taskItem');\n next.setAttribute('data-checked', String(kind === 'checked'));\n }\n next.appendChild(paragraph);\n current.element.appendChild(next);\n }\n replaceNode(list, fragment);\n}\n\nfunction convertQuillCode(container: Element): void {\n const document = container.ownerDocument;\n const lines = Array.from(container.querySelectorAll('.ql-code-block'));\n const pre = document.createElement('pre');\n const code = document.createElement('code');\n const language = lines[0]?.getAttribute('data-language');\n if (language && language !== 'plain') {\n code.className = `language-${language}`;\n }\n code.textContent = lines.map((line) => line.textContent ?? '').join('\\n');\n pre.appendChild(code);\n replaceNode(container, pre);\n}\n\nexport function isQuillHtml(html: string | null | undefined): boolean {\n return !!html && QUILL_MARKERS.test(html);\n}\n\nexport function fromQuillHtml(html: string | null | undefined, document?: Document | null): string {\n if (!html) {\n return '';\n }\n if (!isQuillHtml(html)) {\n return html;\n }\n const body = parseHtmlBody(html, document);\n if (!body) {\n return html;\n }\n body.querySelectorAll('.ql-cursor, .ql-ui').forEach((node) => node.remove());\n body.querySelectorAll('.ql-code-block-container').forEach(convertQuillCode);\n body.querySelectorAll('pre.ql-syntax').forEach((pre) => {\n const code = body.ownerDocument.createElement('code');\n code.textContent = pre.textContent ?? '';\n pre.textContent = '';\n pre.appendChild(code);\n pre.classList.remove('ql-syntax');\n cleanClassAttribute(pre);\n });\n Array.from(body.querySelectorAll('ol, ul'))\n .filter((list) => Array.from(list.children).some((item) => item.hasAttribute('data-list') || /\\bql-indent-/.test(item.className)))\n .filter((list) => !list.parentElement?.closest('ol, ul'))\n .forEach(convertQuillList);\n body.querySelectorAll('[class*=\"ql-\"]').forEach((element) => {\n const style = styleOf(element);\n const align = classValue(element, 'ql-align-');\n if (align && ALIGNMENTS.includes(align) && style) {\n style.textAlign = align;\n }\n const indent = Number(classValue(element, 'ql-indent-') ?? 0);\n if (indent > 0 && style) {\n element.setAttribute('data-indent', String(indent));\n style.marginLeft = `${indent * INDENT_STEP_EM}em`;\n }\n const size = classValue(element, 'ql-size-');\n if (size && QUILL_SIZES[size] && style) {\n style.fontSize = QUILL_SIZES[size];\n }\n const font = classValue(element, 'ql-font-');\n if (font && QUILL_FONTS[font] && style) {\n style.fontFamily = QUILL_FONTS[font];\n }\n if (classValue(element, 'ql-direction-') === 'rtl') {\n element.setAttribute('dir', 'rtl');\n }\n if (element.tagName === 'IFRAME' && element.classList.contains('ql-video')) {\n element.classList.remove('ql-video');\n element.setAttribute('data-type', 'video');\n }\n cleanClassAttribute(element);\n });\n return body.innerHTML;\n}\n\nfunction flattenList(list: Element, level: number, out: HTMLElement): void {\n const document = list.ownerDocument;\n const task = list.getAttribute('data-type') === 'taskList';\n for (const item of Array.from(list.children).filter((child) => child.tagName === 'LI')) {\n const kind: TxListKind = task ? (item.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked') : list.tagName === 'OL' ? 'ordered' : 'bullet';\n const next = document.createElement('li');\n next.setAttribute('data-list', kind);\n if (level > 0) {\n next.classList.add(`ql-indent-${level}`);\n }\n const nested: Element[] = [];\n const blocks = task ? Array.from(item.querySelector(':scope > div')?.children ?? item.children) : Array.from(item.children);\n const inline: Node[] = [];\n for (const child of blocks) {\n if (child.tagName === 'UL' || child.tagName === 'OL') {\n nested.push(child);\n } else if (child.tagName === 'LABEL') {\n continue;\n } else {\n const align = styleOf(child)?.textAlign;\n if (align && ALIGNMENTS.includes(align) && align !== 'left') {\n next.classList.add(`ql-align-${align}`);\n }\n if (inline.length) {\n inline.push(document.createElement('br'));\n }\n inline.push(...Array.from(child.childNodes));\n }\n }\n appendNodes(next, inline);\n out.appendChild(next);\n nested.forEach((child) => flattenList(child, level + 1, out));\n }\n}\n\nexport function toQuillHtml(html: string | null | undefined, document?: Document | null): string {\n if (!html) {\n return '';\n }\n const body = parseHtmlBody(html, document);\n if (!body) {\n return html;\n }\n const owner = body.ownerDocument;\n const topLists = Array.from(body.querySelectorAll('ol, ul')).filter((list) => !list.parentElement?.closest('ol, ul'));\n let previous: HTMLElement | null = null;\n for (const list of topLists) {\n const target: HTMLElement = previous && previous.nextSibling === list ? previous : owner.createElement('ol');\n flattenList(list, 0, target);\n if (target === previous) {\n list.remove();\n } else {\n replaceNode(list, target);\n }\n previous = target;\n }\n body.querySelectorAll('pre').forEach((pre) => {\n const code = pre.querySelector('code');\n const language = Array.from(code?.classList ?? []).find((name) => name.startsWith('language-'))?.slice(9) ?? 'plain';\n const container = owner.createElement('div');\n container.className = 'ql-code-block-container';\n container.setAttribute('spellcheck', 'false');\n for (const line of (code?.textContent ?? pre.textContent ?? '').split('\\n')) {\n const block = owner.createElement('div');\n block.className = 'ql-code-block';\n block.setAttribute('data-language', language);\n block.textContent = line;\n if (!line) {\n block.appendChild(owner.createElement('br'));\n }\n container.appendChild(block);\n }\n replaceNode(pre, container);\n });\n body.querySelectorAll('[style], [data-indent], [dir], iframe[data-type=\"video\"]').forEach((element) => {\n const style = styleOf(element);\n if (style?.textAlign && ALIGNMENTS.includes(style.textAlign)) {\n if (style.textAlign !== 'left') {\n element.classList.add(`ql-align-${style.textAlign}`);\n }\n style.removeProperty('text-align');\n }\n const indent = indentLevel(element);\n if (indent > 0) {\n element.classList.add(`ql-indent-${indent}`);\n }\n element.removeAttribute('data-indent');\n style?.removeProperty('margin-left');\n const size = Object.entries(QUILL_SIZES).find(([, value]) => value === style?.fontSize)?.[0];\n if (size) {\n element.classList.add(`ql-size-${size}`);\n style?.removeProperty('font-size');\n }\n const font = Object.entries(QUILL_FONTS).find(([, value]) => value === style?.fontFamily)?.[0];\n if (font) {\n element.classList.add(`ql-font-${font}`);\n style?.removeProperty('font-family');\n }\n if (element.getAttribute('dir') === 'rtl') {\n element.classList.add('ql-direction-rtl');\n element.removeAttribute('dir');\n }\n if (element.tagName === 'IFRAME') {\n element.removeAttribute('data-type');\n element.classList.add('ql-video');\n element.setAttribute('frameborder', '0');\n element.setAttribute('allowfullscreen', 'true');\n }\n if (element.getAttribute('style') === '') {\n element.removeAttribute('style');\n }\n });\n body.querySelectorAll('p:empty, h1:empty, h2:empty, h3:empty, h4:empty, h5:empty, h6:empty').forEach((block) => block.appendChild(owner.createElement('br')));\n return body.innerHTML;\n}\n\nexport function toEditorHtml(html: string | null | undefined, document?: Document | null): string {\n return fromQuillHtml(html, document);\n}\n\nexport function formatEditorHtml(html: string, format: TxEditorFormat, document?: Document | null): string {\n return format === 'quill' ? toQuillHtml(html, document) : html;\n}\n","import { parseHtmlBody, unwrapNode } from './parse-html';\n\nconst ALLOWED_TAGS = new Set([\n 'p', 'br', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'strong', 'b', 'em', 'i', 'u', 's', 'strike', 'del', 'code', 'pre',\n 'blockquote', 'ul', 'ol', 'li', 'a', 'img', 'span', 'sub', 'sup', 'hr', 'mark', 'div', 'label', 'input',\n 'table', 'thead', 'tbody', 'tfoot', 'tr', 'th', 'td', 'colgroup', 'col', 'iframe',\n]);\n\nconst DROP_WITH_CONTENT = new Set(['script', 'style', 'template', 'noscript', 'object', 'embed', 'svg', 'math', 'textarea', 'select', 'button', 'form']);\n\nconst ALLOWED_ATTRIBUTES = new Set([\n 'class', 'style', 'href', 'target', 'rel', 'src', 'alt', 'title', 'width', 'height', 'colspan', 'rowspan', 'start', 'dir',\n 'data-list', 'data-type', 'data-checked', 'data-indent', 'data-language', 'data-id', 'data-label', 'data-mention-suggestion-char',\n 'colwidth', 'data-colwidth', 'data-tone', 'type', 'checked', 'disabled', 'frameborder', 'allowfullscreen', 'spellcheck',\n]);\n\nconst ALLOWED_STYLES = new Set(['color', 'background-color', 'text-align', 'font-size', 'font-family', 'margin-left', 'padding-left', 'width', 'min-width']);\n\nconst SAFE_STYLE_VALUE = /^[#(),.%\\w\\s'\"-]+$/;\nconst SAFE_CLASS = /^(ql-[\\w-]+|tx-[\\w-]+|language-[\\w-]+)$/;\nconst SAFE_LINK = /^(https?:|mailto:|tel:|sms:|#|\\/(?!\\/))/i;\nconst SAFE_IMAGE = /^(https?:|data:image\\/(png|jpe?g|gif|webp|avif|bmp|svg\\+xml);base64,|blob:|\\/(?!\\/))/i;\nconst SAFE_FRAME = /^https:\\/\\//i;\n\nfunction cleanStyle(value: string): string {\n return value\n .split(';')\n .map((declaration) => declaration.split(':'))\n .filter(([property, ...rest]) => property && rest.length)\n .map(([property, ...rest]) => [property.trim().toLowerCase(), rest.join(':').trim()])\n .filter(([property, propertyValue]) => ALLOWED_STYLES.has(property) && SAFE_STYLE_VALUE.test(propertyValue) && !/url\\s*\\(|expression\\s*\\(/i.test(propertyValue))\n .map(([property, propertyValue]) => `${property}: ${propertyValue}`)\n .join('; ');\n}\n\nfunction cleanAttribute(element: Element, name: string, value: string): string | null {\n const tag = element.tagName.toLowerCase();\n switch (name) {\n case 'style': {\n const style = cleanStyle(value);\n return style || null;\n }\n case 'class': {\n const classes = value.split(/\\s+/).filter((item) => SAFE_CLASS.test(item));\n return classes.length ? classes.join(' ') : null;\n }\n case 'href':\n return tag === 'a' && SAFE_LINK.test(value.trim()) ? value.trim() : null;\n case 'src':\n if (tag === 'img') {\n return SAFE_IMAGE.test(value.trim()) ? value.trim() : null;\n }\n return tag === 'iframe' && SAFE_FRAME.test(value.trim()) ? value.trim() : null;\n case 'target':\n return value === '_blank' ? value : null;\n case 'type':\n return tag === 'input' && value === 'checkbox' ? value : null;\n default:\n return value;\n }\n}\n\nfunction cleanNode(node: Node): void {\n for (const child of Array.from(node.childNodes)) {\n if (child.nodeType === 3) {\n continue;\n }\n if (child.nodeType !== 1) {\n child.remove();\n continue;\n }\n const element = child as Element;\n const tag = element.tagName.toLowerCase();\n if (DROP_WITH_CONTENT.has(tag)) {\n element.remove();\n continue;\n }\n if (!ALLOWED_TAGS.has(tag)) {\n cleanNode(element);\n unwrapNode(element);\n continue;\n }\n for (const attribute of Array.from(element.attributes)) {\n const name = attribute.name.toLowerCase();\n const cleaned = ALLOWED_ATTRIBUTES.has(name) ? cleanAttribute(element, name, attribute.value) : null;\n if (cleaned === null) {\n element.removeAttribute(attribute.name);\n } else if (cleaned !== attribute.value) {\n element.setAttribute(attribute.name, cleaned);\n }\n }\n if (tag === 'a' && element.getAttribute('target') === '_blank') {\n element.setAttribute('rel', 'noopener noreferrer nofollow');\n }\n if (tag === 'input') {\n element.setAttribute('disabled', '');\n }\n if (tag === 'iframe') {\n if (!element.getAttribute('src')) {\n element.remove();\n continue;\n }\n element.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-presentation allow-popups');\n element.setAttribute('loading', 'lazy');\n }\n cleanNode(element);\n }\n}\n\nexport function sanitizeEditorHtml(html: string | null | undefined, document?: Document | null): string {\n if (!html) {\n return '';\n }\n const body = parseHtmlBody(html, document);\n if (!body) {\n return '';\n }\n cleanNode(body);\n return body.innerHTML;\n}\n","import { TxIconSet, txIconCode, txIconTable, txIconVideo } from '@tectra-ng/icons';\n\nexport const CONTENT_ICON_DEFAULTS: TxIconSet = {\n code: txIconCode,\n table: txIconTable,\n video: txIconVideo,\n};\n","import { editorContentTokens } from '@tectra-ng/themes';\n\nexport const CONTENT_THEME = {\n editorContent: editorContentTokens,\n};\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { CONTENT_ICON_DEFAULTS } from './content.icons';\nimport { injectTokens } from '@tectra-ng/core/config';\nimport { CONTENT_THEME } from './content.theme';\n\n@Component({\n selector: 'tx-editor-prose-styles',\n template: '',\n styleUrl: './editor-prose.styles.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [provideTxIconDefaults(CONTENT_ICON_DEFAULTS)],\n})\nexport class TxEditorProseStyles {\n private readonly contentTheme = injectTokens(CONTENT_THEME);\n}\n","import { ChangeDetectionStrategy, Component, DOCUMENT, ElementRef, afterRenderEffect, booleanAttribute, computed, inject, input, output, signal, viewChild } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { TxStyleLoader } from '@tectra-ng/core/styles';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraEditorContentTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxDialog } from '@tectra-ng/ui/dialog';\nimport { TxEditorContentPart, TxEditorImageClickEvent } from './editor-content.types';\nimport { fromQuillHtml } from './editor-html';\nimport { TxEditorProseStyles } from './editor-prose-styles.component';\nimport { sanitizeEditorHtml } from './editor-sanitizer';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { CONTENT_ICON_DEFAULTS } from './content.icons';\nimport { CONTENT_THEME } from './content.theme';\n\n@Component({\n selector: 'tx-editor-content',\n imports: [TxDialog],\n template: `\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- clicks and keys come from the images inside, which get a tab stop -->\n <div\n #body\n class=\"tx-editor-content__body\"\n [class.tx-editor-prose]=\"!isUnstyled()\"\n [class]=\"passThrough().body?.class\"\n [style]=\"passThrough().body?.style\"\n [innerHTML]=\"safeHtml()\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n ></div>\n @if (previewImages()) {\n <tx-dialog\n size=\"large\"\n [header]=\"preview()?.alt || translations().editorImagePreview\"\n [visible]=\"previewOpen()\"\n (visibleChange)=\"previewOpen.set($event)\"\n >\n @if (preview(); as image) {\n <img class=\"tx-editor-content__preview\" [src]=\"image.src\" [alt]=\"image.alt\" />\n }\n </tx-dialog>\n }\n `,\n styleUrl: './editor-content.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-editor-content',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-editor-content--zoom]': 'previewImages()',\n },\n viewProviders: [provideTxIconDefaults(CONTENT_ICON_DEFAULTS)],\n})\nexport class TxEditorContent {\n private readonly contentTheme = injectTokens(CONTENT_THEME);\n\n private sanitizer = inject(DomSanitizer);\n private document = inject(DOCUMENT);\n\n readonly html = input<string | null | undefined>(null);\n readonly previewImages = input(true, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraEditorContentTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxEditorContentPart, TxEditorContent> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly imageClick = output<TxEditorImageClickEvent>();\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('editorContent', this, this.pt, this.ptOptions);\n private readonly body = viewChild<ElementRef<HTMLElement>>('body');\n protected readonly preview = signal<{ src: string; alt: string } | null>(null);\n protected readonly previewOpen = signal(false);\n protected readonly safeHtml = computed(() => this.sanitizer.bypassSecurityTrustHtml(sanitizeEditorHtml(fromQuillHtml(this.html(), this.document), this.document)));\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-editor-content'), ...this.passThrough().root?.style }));\n\n constructor() {\n inject(TxStyleLoader).load(TxEditorProseStyles);\n afterRenderEffect(() => {\n this.safeHtml();\n const preview = this.previewImages();\n this.body()\n ?.nativeElement.querySelectorAll('img')\n .forEach((image) => {\n if (preview) {\n image.setAttribute('tabindex', '0');\n image.setAttribute('role', 'button');\n } else {\n image.removeAttribute('tabindex');\n image.removeAttribute('role');\n }\n });\n });\n }\n\n protected onClick(event: MouseEvent): void {\n const target = event.target as HTMLElement | null;\n if (target instanceof HTMLImageElement) {\n this.open(target, event);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const target = event.target as HTMLElement | null;\n if (target instanceof HTMLImageElement && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n this.open(target, event);\n }\n }\n\n private open(target: HTMLImageElement, event: Event): void {\n const image = { src: target.currentSrc || target.src, alt: target.alt };\n this.imageClick.emit({ originalEvent: event as MouseEvent | KeyboardEvent, ...image });\n if (this.previewImages()) {\n this.preview.set(image);\n this.previewOpen.set(true);\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAgB,cAAc,MAAc,UAA0B;CACpE,MAAM,SAAS,WAAW;CAC1B,IAAI,QACF,OAAO,IAAI,OAAM,CAAE,CAAC,gBAAgB,SAAS,KAAI,UAAW,WAAW,CAAC,CAAC;CAE3E,MAAM,QAAQ,UAAU,eAAe,mBAAmB,EAAE;CAC5D,IAAI,CAAC,OACH,OAAO;CAET,MAAM,KAAK,YAAY;CACvB,OAAO,MAAM;AACf;AAEA,SAAgB,YAAY,QAAc,OAAqB;CAC7D,KAAK,MAAM,QAAQ,MAAM,KAAK,KAAK,GACjC,OAAO,YAAY,IAAI;AAE3B;AAEA,SAAgB,YAAY,MAAY,aAAiB;CACvD,KAAK,YAAY,aAAa,aAAa,IAAI;AACjD;AAEA,SAAgB,WAAW,MAAU;CACnC,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QACH;CAEF,KAAK,MAAM,SAAS,MAAM,KAAK,KAAK,UAAU,GAC5C,OAAO,aAAa,OAAO,IAAI;CAEjC,OAAO,YAAY,IAAI;AACzB;AC7BA,MAAM,cAAsC;CAAE,OAAO;CAAU,OAAO;CAAS,MAAM;AAAO;AAC5F,MAAM,cAAsC;CAAE,OAAO;CAAS,WAAW;AAAW;AACpF,MAAM,iBAAiB;AACvB,MAAM,aAAa;CAAC;CAAQ;CAAU;CAAS;AAAS;AACxD,MAAM,gBAAgB;AAItB,SAAS,WAAW,SAAkB,QAAc;CAClD,MAAM,QAAQ,MAAM,KAAK,QAAQ,SAAS,CAAC,CAAC,MAAM,SAAS,KAAK,WAAW,MAAM,CAAC;CAClF,IAAI,CAAC,OACH,OAAO;CAET,QAAQ,UAAU,OAAO,KAAK;CAC9B,OAAO,MAAM,MAAM,OAAO,MAAM;AAClC;AAEA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AO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,mCAAmC;GACpC;GAAA,eACc,CAAC,sBAAsB,qBAAqB,CAAC;GAAC,QAAA,CAAA,+RAAA;EAAA,CAAA;CAoBF,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -6,7 +6,7 @@ import { DOMParser, DOMSerializer, Fragment, NodeRange, Schema, Slice } from "pr
|
|
|
6
6
|
import { CdkConnectedOverlay, CdkOverlayOrigin } from "@angular/cdk/overlay";
|
|
7
7
|
import { NgTemplateOutlet } from "@angular/common";
|
|
8
8
|
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
9
|
-
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
9
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
10
10
|
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
11
11
|
import { TxFormControlBase, injectFieldInvalid } from "@tectra-ng/core/forms";
|
|
12
12
|
import { TxLocaleService, injectTranslations } from "@tectra-ng/core/i18n";
|
|
@@ -14,8 +14,8 @@ import { TxOverlayAnchor, txPositions, txScrollStrategy } from "@tectra-ng/core/
|
|
|
14
14
|
import { TxStyleLoader } from "@tectra-ng/core/styles";
|
|
15
15
|
import { optionalBoolean, optionalNumber } from "@tectra-ng/core/utils";
|
|
16
16
|
import { TxEditorProseStyles, formatEditorHtml, fromQuillHtml } from "@tectra-ng/editor/content";
|
|
17
|
-
import { TxIcon, TxIconRegistry } from "@tectra-ng/icons";
|
|
18
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
17
|
+
import { TxIcon, TxIconRegistry, provideTxIconDefaults, txIconAlignCenter, txIconAlignJustify, txIconAlignLeft, txIconAlignRight, txIconBan, txIconBell, txIconBlockQuote, txIconBold, txIconBox, txIconCalendar, txIconCheck, txIconChevronDown, txIconClock, txIconCode, txIconDollar, txIconEraser, txIconFile, txIconFlag, txIconFolder, txIconGift, txIconGlobe, txIconHammer, txIconHeading, txIconHeading1, txIconHeading2, txIconHeading3, txIconHeart, txIconHighlighter, txIconHorizontalRule, txIconHourglass, txIconImage, txIconInbox, txIconIndent, txIconInfo, txIconInfoCircle, txIconItalic, txIconKey, txIconLanguage, txIconLink, txIconList, txIconListCheck, txIconListOl, txIconLock, txIconMoon, txIconOutdent, txIconParagraphLeft, txIconPencil, txIconPhone, txIconQuestion, txIconSearch, txIconSlash, txIconSparkles, txIconStar, txIconStop, txIconStrikethrough, txIconSubscript, txIconSun, txIconSuperscript, txIconTable, txIconText, txIconTextColor, txIconTrash, txIconTrophy, txIconUnderline, txIconUndo, txIconVideo, txIconWindowMaximize, txIconWindowMinimize, txIconWrench } from "@tectra-ng/icons";
|
|
18
|
+
import { editorContentTokens, editorTokens, formFieldTokens, toStyleObject } from "@tectra-ng/themes";
|
|
19
19
|
import { TxButton } from "@tectra-ng/ui/button";
|
|
20
20
|
import { TxDialog } from "@tectra-ng/ui/dialog";
|
|
21
21
|
import { TxInput } from "@tectra-ng/ui/input";
|
|
@@ -3272,6 +3272,82 @@ function editorPlugins(options) {
|
|
|
3272
3272
|
aiPlugin()
|
|
3273
3273
|
];
|
|
3274
3274
|
}
|
|
3275
|
+
const EDITOR_ICON_DEFAULTS = {
|
|
3276
|
+
"align-center": txIconAlignCenter,
|
|
3277
|
+
"align-justify": txIconAlignJustify,
|
|
3278
|
+
"align-left": txIconAlignLeft,
|
|
3279
|
+
"align-right": txIconAlignRight,
|
|
3280
|
+
ban: txIconBan,
|
|
3281
|
+
bell: txIconBell,
|
|
3282
|
+
"block-quote": txIconBlockQuote,
|
|
3283
|
+
bold: txIconBold,
|
|
3284
|
+
box: txIconBox,
|
|
3285
|
+
calendar: txIconCalendar,
|
|
3286
|
+
check: txIconCheck,
|
|
3287
|
+
"chevron-down": txIconChevronDown,
|
|
3288
|
+
clock: txIconClock,
|
|
3289
|
+
code: txIconCode,
|
|
3290
|
+
dollar: txIconDollar,
|
|
3291
|
+
eraser: txIconEraser,
|
|
3292
|
+
file: txIconFile,
|
|
3293
|
+
flag: txIconFlag,
|
|
3294
|
+
folder: txIconFolder,
|
|
3295
|
+
gift: txIconGift,
|
|
3296
|
+
globe: txIconGlobe,
|
|
3297
|
+
hammer: txIconHammer,
|
|
3298
|
+
heading: txIconHeading,
|
|
3299
|
+
"heading-1": txIconHeading1,
|
|
3300
|
+
"heading-2": txIconHeading2,
|
|
3301
|
+
"heading-3": txIconHeading3,
|
|
3302
|
+
heart: txIconHeart,
|
|
3303
|
+
highlighter: txIconHighlighter,
|
|
3304
|
+
"horizontal-rule": txIconHorizontalRule,
|
|
3305
|
+
hourglass: txIconHourglass,
|
|
3306
|
+
image: txIconImage,
|
|
3307
|
+
inbox: txIconInbox,
|
|
3308
|
+
indent: txIconIndent,
|
|
3309
|
+
info: txIconInfo,
|
|
3310
|
+
"info-circle": txIconInfoCircle,
|
|
3311
|
+
italic: txIconItalic,
|
|
3312
|
+
key: txIconKey,
|
|
3313
|
+
language: txIconLanguage,
|
|
3314
|
+
link: txIconLink,
|
|
3315
|
+
list: txIconList,
|
|
3316
|
+
"list-check": txIconListCheck,
|
|
3317
|
+
"list-ol": txIconListOl,
|
|
3318
|
+
lock: txIconLock,
|
|
3319
|
+
moon: txIconMoon,
|
|
3320
|
+
outdent: txIconOutdent,
|
|
3321
|
+
"paragraph-left": txIconParagraphLeft,
|
|
3322
|
+
pencil: txIconPencil,
|
|
3323
|
+
phone: txIconPhone,
|
|
3324
|
+
question: txIconQuestion,
|
|
3325
|
+
search: txIconSearch,
|
|
3326
|
+
slash: txIconSlash,
|
|
3327
|
+
sparkles: txIconSparkles,
|
|
3328
|
+
star: txIconStar,
|
|
3329
|
+
stop: txIconStop,
|
|
3330
|
+
strikethrough: txIconStrikethrough,
|
|
3331
|
+
subscript: txIconSubscript,
|
|
3332
|
+
sun: txIconSun,
|
|
3333
|
+
superscript: txIconSuperscript,
|
|
3334
|
+
table: txIconTable,
|
|
3335
|
+
text: txIconText,
|
|
3336
|
+
"text-color": txIconTextColor,
|
|
3337
|
+
trash: txIconTrash,
|
|
3338
|
+
trophy: txIconTrophy,
|
|
3339
|
+
underline: txIconUnderline,
|
|
3340
|
+
undo: txIconUndo,
|
|
3341
|
+
video: txIconVideo,
|
|
3342
|
+
"window-maximize": txIconWindowMaximize,
|
|
3343
|
+
"window-minimize": txIconWindowMinimize,
|
|
3344
|
+
wrench: txIconWrench
|
|
3345
|
+
};
|
|
3346
|
+
const EDITOR_THEME = {
|
|
3347
|
+
editor: editorTokens,
|
|
3348
|
+
editorContent: editorContentTokens,
|
|
3349
|
+
formField: formFieldTokens
|
|
3350
|
+
};
|
|
3275
3351
|
const NO_BOX = {
|
|
3276
3352
|
left: 0,
|
|
3277
3353
|
top: 0,
|
|
@@ -3279,6 +3355,7 @@ const NO_BOX = {
|
|
|
3279
3355
|
height: 0
|
|
3280
3356
|
};
|
|
3281
3357
|
var TxEditor = class TxEditor extends TxFormControlBase {
|
|
3358
|
+
editorTheme = injectTokens(EDITOR_THEME);
|
|
3282
3359
|
document = inject(DOCUMENT);
|
|
3283
3360
|
host = inject(ElementRef);
|
|
3284
3361
|
destroyRef = inject(DestroyRef);
|
|
@@ -5007,6 +5084,7 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
5007
5084
|
exportAs: ["txTooltip"]
|
|
5008
5085
|
}
|
|
5009
5086
|
],
|
|
5087
|
+
viewProviders: [provideTxIconDefaults(EDITOR_ICON_DEFAULTS)],
|
|
5010
5088
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
5011
5089
|
});
|
|
5012
5090
|
};
|
|
@@ -5050,6 +5128,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5050
5128
|
"[class.tx-editor--full]": "fullView()",
|
|
5051
5129
|
"[style.min-height.px]": "placeholderHeight()"
|
|
5052
5130
|
},
|
|
5131
|
+
viewProviders: [provideTxIconDefaults(EDITOR_ICON_DEFAULTS)],
|
|
5053
5132
|
template: "<div\n #frame\n class=\"tx-editor__frame\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [class.tx-editor__frame--focused]=\"hasFocus()\"\n [class.tx-editor__frame--disabled]=\"isDisabled()\"\n [class.tx-editor__frame--invalid]=\"isInvalid()\"\n [class.tx-editor__frame--full]=\"fullView()\"\n [style]=\"hostStyle()\"\n>\n @if (groups().length || ai() || showFullViewButton() || toolbarEnd()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the tools inside take the focus; the toolbar only moves it with the arrows -->\n <div\n #toolbarElement\n class=\"tx-editor__toolbar\"\n role=\"toolbar\"\n [attr.aria-label]=\"translations().editorToolbar\"\n [attr.aria-controls]=\"id + '-content'\"\n [class]=\"passThrough().toolbar?.class\"\n [style]=\"passThrough().toolbar?.style\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (group of groups(); track $index; let first = $first) {\n @if (!first) {\n <span class=\"tx-editor__separator\" aria-hidden=\"true\"></span>\n }\n @for (item of group; track item.tool) {\n <button\n type=\"button\"\n class=\"tx-editor__tool\"\n data-tool\n [class.tx-editor__tool--label]=\"item.tool === 'blockStyle'\"\n [class.tx-editor__tool--active]=\"state()?.active?.[item.tool]\"\n [attr.data-tool-name]=\"item.tool\"\n [attr.tabindex]=\"item.index === focusIndex() ? 0 : -1\"\n [attr.aria-label]=\"item.tool === 'blockStyle' ? translations().editorTextStyle + ': ' + blockLabel() : toolName(item.tool)\"\n [attr.aria-pressed]=\"isToggleTool(item.tool) ? !!state()?.active?.[item.tool] : null\"\n [attr.aria-haspopup]=\"isMenuTool(item.tool) ? 'menu' : isPopoverTool(item.tool) ? 'dialog' : null\"\n [disabled]=\"toolDisabled(item.tool)\"\n [txTooltip]=\"toolLabel(item.tool)\"\n [class]=\"passThrough().tool?.class\"\n [style]=\"passThrough().tool?.style\"\n (mousedown)=\"keepFocus($event)\"\n (click)=\"onToolClick($event, item.tool, item.index)\"\n >\n @switch (item.tool) {\n @case ('blockStyle') {\n <span class=\"tx-editor__tool-text\">{{ blockLabel() }}</span>\n <tx-icon class=\"tx-editor__chevron\" name=\"chevron-down\" />\n }\n @case ('align') {\n <tx-icon [name]=\"toolIcon(item.tool)\" />\n <tx-icon class=\"tx-editor__chevron\" name=\"chevron-down\" />\n }\n @case ('fontSize') {\n <tx-icon [name]=\"toolIcon(item.tool)\" />\n <tx-icon class=\"tx-editor__chevron\" name=\"chevron-down\" />\n }\n @case ('textColor') {\n <span class=\"tx-editor__color-icon\">\n <tx-icon [name]=\"toolIcon(item.tool)\" />\n <span class=\"tx-editor__color-bar\" [style.background]=\"state()?.color || null\"></span>\n </span>\n }\n @case ('highlight') {\n <span class=\"tx-editor__color-icon\">\n <tx-icon [name]=\"toolIcon(item.tool)\" />\n <span class=\"tx-editor__color-bar\" [style.background]=\"state()?.background || null\"></span>\n </span>\n }\n @default {\n <tx-icon [name]=\"toolIcon(item.tool)\" />\n }\n }\n </button>\n }\n }\n <span class=\"tx-editor__toolbar-end\">\n <ng-content select=\"[txEditorToolbarEnd]\" />\n @if (ai()) {\n <button\n type=\"button\"\n class=\"tx-editor__ai\"\n data-tool\n [attr.tabindex]=\"groups().length ? -1 : 0\"\n [txTooltip]=\"aiLabel() ?? translations().editorAi\"\n [attr.aria-label]=\"aiLabel() ?? translations().editorAi\"\n [disabled]=\"isDisabled()\"\n (mousedown)=\"keepFocus($event)\"\n (click)=\"requestAi()\"\n >\n <tx-icon class=\"tx-editor__ai-icon\" name=\"sparkles\" />\n <span>AI</span>\n </button>\n }\n @if (showFullViewButton()) {\n <button\n type=\"button\"\n class=\"tx-editor__tool\"\n data-tool\n [attr.tabindex]=\"-1\"\n [attr.aria-pressed]=\"fullView()\"\n [attr.aria-label]=\"fullView() ? translations().editorNormalView : translations().editorFullView\"\n [txTooltip]=\"fullView() ? translations().editorNormalView : translations().editorFullView\"\n (mousedown)=\"keepFocus($event)\"\n (click)=\"toggleFullView()\"\n >\n <tx-icon [name]=\"fullView() ? 'window-minimize' : 'window-maximize'\" />\n </button>\n }\n </span>\n </div>\n }\n\n <div\n #mount\n class=\"tx-editor__content\"\n [class]=\"passThrough().content?.class\"\n [style]=\"passThrough().content?.style\"\n [style.height]=\"contentStyle().height\"\n [style.min-height]=\"contentStyle().minHeight\"\n [style.max-height]=\"contentStyle().maxHeight\"\n ></div>\n\n @if (showCount() || maxLength()) {\n <div class=\"tx-editor__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <span class=\"tx-editor__count\" [class.tx-editor__count--limit]=\"!!maxLength() && (state()?.count ?? 0) >= maxLength()!\" aria-live=\"polite\">\n {{ countLabel() }}\n </span>\n </div>\n }\n\n <div\n #bubbleAnchor\n cdkOverlayOrigin\n #bubbleOrigin=\"cdkOverlayOrigin\"\n class=\"tx-editor__anchor\"\n aria-hidden=\"true\"\n [style.left.px]=\"bubbleBox().left\"\n [style.top.px]=\"bubbleBox().top\"\n [style.width.px]=\"bubbleBox().width\"\n [style.height.px]=\"bubbleBox().height\"\n ></div>\n <div\n #suggestAnchor\n cdkOverlayOrigin\n #suggestOrigin=\"cdkOverlayOrigin\"\n class=\"tx-editor__anchor\"\n aria-hidden=\"true\"\n [style.left.px]=\"suggestBox().left\"\n [style.top.px]=\"suggestBox().top\"\n [style.width.px]=\"suggestBox().width\"\n [style.height.px]=\"suggestBox().height\"\n ></div>\n</div>\n\n<tx-dialog\n size=\"fullscreen\"\n [visible]=\"fullView()\"\n [ariaLabel]=\"translations().editorFullView\"\n [closeOnEscape]=\"!suggestion() && !popoverOpen()\"\n [dt]=\"{ content: { padding: '0', lastPaddingBottom: '0' } }\"\n (visibleChange)=\"!$event && fullView.set(false)\"\n (opened)=\"onFullViewOpened()\"\n (closed)=\"unmountFullView()\"\n>\n <div #fullHost class=\"tx-editor__full-host\"></div>\n</tx-dialog>\n\n<input #imageInput class=\"tx-editor__file\" type=\"file\" accept=\"image/*\" multiple tabindex=\"-1\" aria-hidden=\"true\" (change)=\"onImagePicked($event)\" />\n\n<tx-menu #blockMenuRef popup [model]=\"blockMenu()\" [ariaLabel]=\"translations().editorTextStyle\" />\n<tx-menu #alignMenuRef popup [model]=\"alignMenu()\" [ariaLabel]=\"translations().editorAlign\" />\n<tx-menu #aiMenuRef popup [model]=\"aiMenu()\" [ariaLabel]=\"aiLabel() ?? translations().editorAi\" />\n<tx-menu #sizeMenuRef popup [model]=\"sizeMenu()\" [ariaLabel]=\"translations().editorFontSize\" />\n\n<tx-popover #popover [arrow]=\"false\" placement=\"bottom-start\" [ariaLabel]=\"popoverLabel()\" (closed)=\"onPopoverClosed()\">\n @switch (popoverKind()) {\n @case ('link') {\n <form class=\"tx-editor__form\" (submit)=\"$event.preventDefault(); applyLink()\">\n <input\n txInput\n class=\"tx-editor__field\"\n type=\"text\"\n inputmode=\"url\"\n autocomplete=\"off\"\n placeholder=\"https://\"\n [attr.aria-label]=\"translations().editorLinkUrl\"\n [value]=\"linkDraft()\"\n (input)=\"linkDraft.set($any($event.target).value)\"\n />\n <span class=\"tx-editor__form-actions\">\n @if (state()?.link) {\n <button txButton type=\"button\" size=\"small\" text severity=\"danger\" icon=\"tx-editor-unlink\" (click)=\"removeLink()\">\n {{ translations().editorLinkRemove }}\n </button>\n }\n <button txButton type=\"submit\" size=\"small\">{{ translations().editorLinkApply }}</button>\n </span>\n </form>\n }\n @case ('video') {\n <form class=\"tx-editor__form\" (submit)=\"$event.preventDefault(); applyVideo()\">\n <input\n txInput\n class=\"tx-editor__field\"\n type=\"text\"\n inputmode=\"url\"\n autocomplete=\"off\"\n placeholder=\"https://\"\n [attr.aria-label]=\"translations().editorVideoUrl\"\n [attr.aria-describedby]=\"id + '-video-hint'\"\n [value]=\"videoDraft()\"\n (input)=\"videoDraft.set($any($event.target).value)\"\n />\n <span class=\"tx-editor__hint\" [id]=\"id + '-video-hint'\">{{ translations().editorVideoHint }}</span>\n <span class=\"tx-editor__form-actions\">\n <button txButton type=\"submit\" size=\"small\">{{ translations().editorInsert }}</button>\n </span>\n </form>\n }\n @case ('textColor') {\n <ng-container [ngTemplateOutlet]=\"swatches\" [ngTemplateOutletContext]=\"{ $implicit: 'textColor', colors: textColors(), current: state()?.color }\" />\n }\n @case ('highlight') {\n <ng-container [ngTemplateOutlet]=\"swatches\" [ngTemplateOutletContext]=\"{ $implicit: 'highlight', colors: highlightColors(), current: state()?.background }\" />\n }\n }\n</tx-popover>\n\n<ng-template #swatches let-kind let-colors=\"colors\" let-current=\"current\">\n <div class=\"tx-editor__swatches\" role=\"group\" [attr.aria-label]=\"popoverLabel()\">\n <button\n type=\"button\"\n class=\"tx-editor__swatch tx-editor__swatch--none\"\n [attr.aria-label]=\"translations().editorDefaultColor\"\n [attr.aria-pressed]=\"!current\"\n [txTooltip]=\"translations().editorDefaultColor\"\n (click)=\"applyColor(kind, null)\"\n >\n <tx-icon name=\"ban\" />\n </button>\n @for (color of colors; track color.value) {\n <button\n type=\"button\"\n class=\"tx-editor__swatch\"\n [attr.data-kind]=\"kind\"\n [style.--_swatch]=\"color.value\"\n [attr.aria-label]=\"colorLabel(color)\"\n [attr.aria-pressed]=\"current === color.value\"\n [txTooltip]=\"colorLabel(color)\"\n (click)=\"applyColor(kind, color.value)\"\n >\n @if (kind === 'textColor') {\n <span class=\"tx-editor__swatch-letter\" aria-hidden=\"true\">A</span>\n }\n </button>\n }\n </div>\n</ng-template>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n #bubbleOverlay=\"cdkConnectedOverlay\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayOrigin]=\"bubbleOrigin\"\n [cdkConnectedOverlayOpen]=\"showBubble()\"\n [cdkConnectedOverlayPositions]=\"bubblePositions()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n [cdkConnectedOverlayPush]=\"true\"\n>\n <div\n class=\"tx-editor__bubble\"\n role=\"toolbar\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.aria-label]=\"translations().editorToolbar\"\n [style]=\"hostStyle()\"\n [class]=\"passThrough().bubble?.class\"\n (mousedown)=\"keepFocus($event)\"\n >\n @if (state()?.ai?.done) {\n <span class=\"tx-editor__bubble-label\"><tx-icon class=\"tx-editor__ai-icon\" name=\"sparkles\" />AI</span>\n <span class=\"tx-editor__separator\" aria-hidden=\"true\"></span>\n <button txButton type=\"button\" size=\"small\" text severity=\"secondary\" icon=\"check\" tabindex=\"-1\" (click)=\"keepAi()\">{{ translations().editorAiKeep }}</button>\n <button txButton type=\"button\" size=\"small\" text severity=\"secondary\" icon=\"undo\" tabindex=\"-1\" (click)=\"discardAi()\">{{ translations().editorAiDiscard }}</button>\n } @else if (state()?.empty && !state()?.link && state()?.table) {\n <button type=\"button\" class=\"tx-editor__tool\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorRowAbove\" [txTooltip]=\"translations().editorRowAbove\" (click)=\"tableAction('rowAbove')\">\n <tx-icon name=\"tx-editor-row-above\" />\n </button>\n <button type=\"button\" class=\"tx-editor__tool\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorRowBelow\" [txTooltip]=\"translations().editorRowBelow\" (click)=\"tableAction('rowBelow')\">\n <tx-icon name=\"tx-editor-row-below\" />\n </button>\n <button type=\"button\" class=\"tx-editor__tool\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorColumnLeft\" [txTooltip]=\"translations().editorColumnLeft\" (click)=\"tableAction('columnLeft')\">\n <tx-icon name=\"tx-editor-column-left\" />\n </button>\n <button type=\"button\" class=\"tx-editor__tool\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorColumnRight\" [txTooltip]=\"translations().editorColumnRight\" (click)=\"tableAction('columnRight')\">\n <tx-icon name=\"tx-editor-column-right\" />\n </button>\n <span class=\"tx-editor__separator\" aria-hidden=\"true\"></span>\n <button\n type=\"button\"\n class=\"tx-editor__tool\"\n tabindex=\"-1\"\n [class.tx-editor__tool--active]=\"state()?.headerRow\"\n [attr.aria-pressed]=\"!!state()?.headerRow\"\n [attr.aria-label]=\"translations().editorHeaderRow\"\n [txTooltip]=\"translations().editorHeaderRow\"\n (click)=\"tableAction('header')\"\n >\n <tx-icon name=\"tx-editor-header-row\" />\n </button>\n <span class=\"tx-editor__separator\" aria-hidden=\"true\"></span>\n <button type=\"button\" class=\"tx-editor__tool\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorDeleteRow\" [txTooltip]=\"translations().editorDeleteRow\" (click)=\"tableAction('deleteRow')\">\n <tx-icon name=\"tx-editor-delete-row\" />\n </button>\n <button type=\"button\" class=\"tx-editor__tool\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorDeleteColumn\" [txTooltip]=\"translations().editorDeleteColumn\" (click)=\"tableAction('deleteColumn')\">\n <tx-icon name=\"tx-editor-delete-column\" />\n </button>\n <button type=\"button\" class=\"tx-editor__tool tx-editor__tool--danger\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorDeleteTable\" [txTooltip]=\"translations().editorDeleteTable\" (click)=\"tableAction('delete')\">\n <tx-icon name=\"trash\" />\n </button>\n } @else if (state()?.empty && state()?.link; as link) {\n <a class=\"tx-editor__bubble-link\" [href]=\"link.href\" target=\"_blank\" rel=\"noopener noreferrer\" tabindex=\"-1\">{{ link.href }}</a>\n <span class=\"tx-editor__separator\" aria-hidden=\"true\"></span>\n <button type=\"button\" class=\"tx-editor__tool\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorLinkEdit\" [txTooltip]=\"translations().editorLinkEdit\" (click)=\"openLink(bubbleAnchor)\">\n <tx-icon name=\"pencil\" />\n </button>\n <button type=\"button\" class=\"tx-editor__tool\" tabindex=\"-1\" [attr.aria-label]=\"translations().editorLinkRemove\" [txTooltip]=\"translations().editorLinkRemove\" (click)=\"removeLink()\">\n <tx-icon name=\"tx-editor-unlink\" />\n </button>\n } @else {\n @for (tool of bubbleTools; track tool) {\n <button\n type=\"button\"\n class=\"tx-editor__tool\"\n tabindex=\"-1\"\n [class.tx-editor__tool--active]=\"state()?.active?.[tool]\"\n [attr.aria-pressed]=\"!!state()?.active?.[tool]\"\n [attr.aria-label]=\"toolName(tool)\"\n [txTooltip]=\"toolLabel(tool)\"\n (click)=\"onToolClick($event, tool, -1)\"\n >\n <tx-icon [name]=\"toolIcon(tool)\" />\n </button>\n }\n <span class=\"tx-editor__separator\" aria-hidden=\"true\"></span>\n @if (aiActions().length) {\n <button\n type=\"button\"\n class=\"tx-editor__tool tx-editor__tool--ai\"\n tabindex=\"-1\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"aiLabel() ?? translations().editorAi\"\n [txTooltip]=\"aiLabel() ?? translations().editorAi\"\n (click)=\"openAiMenu($event)\"\n >\n <tx-icon class=\"tx-editor__ai-icon\" name=\"sparkles\" />\n </button>\n }\n <button\n type=\"button\"\n class=\"tx-editor__tool\"\n tabindex=\"-1\"\n [class.tx-editor__tool--active]=\"state()?.active?.link\"\n [attr.aria-label]=\"toolName('link')\"\n [txTooltip]=\"toolLabel('link')\"\n (click)=\"openLink(bubbleAnchor)\"\n >\n <tx-icon name=\"link\" />\n </button>\n }\n </div>\n</ng-template>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n #suggestOverlay=\"cdkConnectedOverlay\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayOrigin]=\"suggestOrigin\"\n [cdkConnectedOverlayOpen]=\"showSuggestions()\"\n [cdkConnectedOverlayPositions]=\"suggestPositions\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n [cdkConnectedOverlayPush]=\"true\"\n>\n <div\n class=\"tx-editor__suggestions\"\n role=\"listbox\"\n [id]=\"id + '-suggestions'\"\n [attr.data-kind]=\"suggestion()?.kind\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.aria-label]=\"suggestionLabel()\"\n [style]=\"hostStyle()\"\n [class]=\"passThrough().suggestions?.class\"\n (mousedown)=\"keepFocus($event)\"\n >\n @for (item of suggestionItems(); track item.id; let index = $index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the editor handles the keys for the list -->\n <div\n class=\"tx-editor__suggestion\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [attr.aria-selected]=\"index === suggestionIndex()\"\n (mouseenter)=\"suggestionIndex.set(index)\"\n (click)=\"pickSuggestion(item)\"\n >\n @if (item.glyph) {\n <span class=\"tx-editor__glyph\" aria-hidden=\"true\">{{ item.glyph }}</span>\n } @else if (item.icon) {\n <span class=\"tx-editor__command-icon\" aria-hidden=\"true\"><tx-icon [name]=\"item.icon\" /></span>\n } @else if (item.avatar) {\n <img class=\"tx-editor__avatar\" alt=\"\" [src]=\"item.avatar\" />\n } @else {\n <span class=\"tx-editor__avatar\" aria-hidden=\"true\">{{ initials(item.label) }}</span>\n }\n <span class=\"tx-editor__suggestion-text\">\n <span class=\"tx-editor__suggestion-label\">{{ item.label }}</span>\n @if (item.description) {\n <span class=\"tx-editor__suggestion-description\">{{ item.description }}</span>\n }\n </span>\n @if (item.shortcut) {\n <kbd class=\"tx-editor__shortcut\">{{ item.shortcut }}</kbd>\n }\n </div>\n } @empty {\n <div class=\"tx-editor__suggestion-empty\">{{ translations().editorNoMatches }}</div>\n }\n </div>\n</ng-template>\n",
|
|
5054
5133
|
styles: ["@charset \"UTF-8\";:host{position:relative;display:block;min-width:0}.tx-editor__frame{position:relative;display:flex;flex-direction:column;min-width:0}.tx-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center}.tx-editor__toolbar-end{display:inline-flex;align-items:center;margin-inline-start:auto}.tx-editor__tool,.tx-editor__ai{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.tx-editor__tool:disabled,.tx-editor__ai:disabled{cursor:default}.tx-editor__color-icon{position:relative;display:inline-flex;flex-direction:column;align-items:center}.tx-editor__content{position:relative;display:flex;flex-direction:column;overflow:auto}.tx-editor__full-host{display:flex;flex-direction:column;height:100%;min-height:0}.tx-editor__full-host>.tx-editor__frame{flex:1 1 auto;min-height:0}.tx-editor__anchor{position:absolute;pointer-events:none;visibility:hidden}.tx-editor__file{display:none}.tx-editor__form,.tx-editor__swatches{display:flex}.tx-editor__form{flex-direction:column}.tx-editor__form-actions{display:flex;justify-content:flex-end}.tx-editor__bubble{display:flex;align-items:center}.tx-editor__bubble-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-editor__suggestions{overflow-y:auto}.tx-editor__suggestion{display:flex;align-items:center;cursor:pointer}.tx-editor__suggestion-text{display:flex;flex-direction:column;min-width:0}.tx-editor__suggestion-label,.tx-editor__suggestion-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-editor__frame ::ng-deep .tx-editor__prose{flex:1 0 auto;outline:none;white-space:pre-wrap;word-wrap:break-word;font-variant-ligatures:none;font-feature-settings:\"liga\" 0}.tx-editor__frame ::ng-deep .tx-editor__prose [contenteditable=false]{white-space:normal}.tx-editor__frame ::ng-deep .tx-editor__prose pre{white-space:pre-wrap}.tx-editor__frame ::ng-deep .tx-editor__image{position:relative;width:fit-content;max-width:100%;margin-block:var(--tx-editor-content-block-gap)}.tx-editor__frame ::ng-deep .tx-editor__image img{margin:0}.tx-editor__frame ::ng-deep .tx-editor__image-handle{position:absolute;top:50%;display:none;cursor:ew-resize;touch-action:none;transform:translate(-50%,-50%)}.tx-editor__frame ::ng-deep .tx-editor__image-handle[data-side=right]{left:100%}.tx-editor__frame ::ng-deep .tx-editor__image-handle[data-side=left]{left:0}.tx-editor__frame ::ng-deep .tx-editor__image--selected .tx-editor__image-handle{display:block}.tx-editor__frame ::ng-deep .tx-editor__prose [data-type=callout]:before{display:none}.tx-editor__frame ::ng-deep .tx-editor__callout-body>:last-child{margin-bottom:0}.tx-editor__frame ::ng-deep .tx-editor__callout-marker{position:absolute;inset-block-start:calc(var(--tx-editor-content-callout-padding-block) + (var(--tx-editor-content-font-size) * var(--tx-editor-content-line-height) - var(--tx-editor-content-callout-marker-size)) / 2);inset-inline-start:var(--tx-editor-content-callout-marker-start);display:grid;place-items:center;width:var(--tx-editor-content-callout-marker-size);height:var(--tx-editor-content-callout-marker-size);margin:0;padding:0;border:0;border-radius:var(--tx-radius-full);background:var(--_tone);color:var(--tx-editor-content-callout-marker-color);font-family:inherit;font-size:var(--tx-editor-content-callout-marker-font-size);font-weight:var(--tx-font-weight-bold);line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;transition:transform var(--_duration, .2s) var(--_easing, ease)}.tx-editor__frame ::ng-deep .tx-editor__callout-marker:before{content:\"i\"}.tx-editor__frame ::ng-deep .tx-editor__callout-marker:hover:not(:disabled){transform:scale(1.12)}.tx-editor__frame ::ng-deep .tx-editor__callout-marker:disabled{cursor:default}.tx-editor__frame ::ng-deep [data-tone=success]>.tx-editor__callout-marker:before{content:\"\\2713\"}.tx-editor__frame ::ng-deep [data-tone=warn]>.tx-editor__callout-marker:before,.tx-editor__frame ::ng-deep [data-tone=danger]>.tx-editor__callout-marker:before{content:\"!\"}.tx-editor__frame ::ng-deep .tx-editor__ai-pending{background:linear-gradient(90deg,var(--tx-editor-ai-color) 0%,color-mix(in srgb,var(--tx-editor-ai-color) 35%,transparent) 50%,var(--tx-editor-ai-color) 100%) 0 0/200% 100%;color:transparent;-webkit-background-clip:text;background-clip:text;animation:tx-editor-shimmer 1.4s linear infinite}.tx-editor__frame ::ng-deep .tx-editor__ai-result{border-radius:var(--tx-radius-xs);background:var(--tx-editor-ai-background);-webkit-box-decoration-break:clone;box-decoration-break:clone}.tx-editor__frame ::ng-deep .tx-editor--column-resize{cursor:col-resize}.tx-editor__frame ::ng-deep .tx-editor__prose td,.tx-editor__frame ::ng-deep .tx-editor__prose th{position:relative;min-width:48px}.tx-editor__frame ::ng-deep .tx-editor__drop-cursor{position:absolute;z-index:3;pointer-events:none}.tx-editor__frame ::ng-deep .tx-editor__video{position:relative;max-width:640px}.tx-editor__frame ::ng-deep .tx-editor__video-shield{position:absolute;inset:0;cursor:pointer}.tx-editor__frame[data-styled]{--_duration: var(--tx-editor-transition-duration);--_easing: var(--tx-editor-easing);color:var(--tx-editor-content-color);font-family:var(--tx-font-family)}.tx-editor__frame[data-styled]{border:1px solid var(--tx-form-field-border-color);border-radius:var(--tx-editor-border-radius);background:var(--tx-editor-background);box-shadow:var(--tx-form-field-shadow);transition:border-color var(--_duration) var(--_easing),box-shadow var(--_duration) var(--_easing)}.tx-editor__frame[data-styled]:not(.tx-editor__frame--disabled):not(.tx-editor__frame--focused):hover{border-color:var(--tx-form-field-hover-border-color)}.tx-editor__frame[data-styled].tx-editor__frame--focused{border-color:var(--tx-form-field-focus-border-color);box-shadow:var(--tx-form-field-focus-ring-shadow)}.tx-editor__frame[data-styled].tx-editor__frame--invalid{border-color:var(--tx-form-field-invalid-border-color)}.tx-editor__frame[data-styled].tx-editor__frame--disabled{background:var(--tx-form-field-disabled-background);opacity:.7}.tx-editor__frame[data-styled] .tx-editor__toolbar{gap:var(--tx-editor-toolbar-gap);padding:var(--tx-editor-toolbar-padding);border-bottom:1px solid var(--tx-editor-toolbar-border-color);border-radius:calc(var(--tx-editor-border-radius) - 1px) calc(var(--tx-editor-border-radius) - 1px) 0 0;background:var(--tx-editor-toolbar-background)}.tx-editor__frame[data-styled] .tx-editor__separator{flex-shrink:0;width:1px;height:var(--tx-editor-toolbar-separator-height);margin:0 var(--tx-editor-toolbar-separator-spacing);background:var(--tx-editor-toolbar-separator-color)}.tx-editor__frame[data-styled] .tx-editor__toolbar-end{gap:var(--tx-editor-toolbar-gap)}.tx-editor__frame[data-styled] .tx-editor__tool,.tx-editor__bubble[data-styled] .tx-editor__tool{gap:2px;min-width:var(--tx-editor-tool-size);height:var(--tx-editor-tool-size);border-radius:var(--tx-editor-tool-border-radius);outline:var(--tx-editor-tool-focus-ring-width) solid transparent;outline-offset:-1px;color:var(--tx-editor-tool-color);font-size:var(--tx-editor-tool-icon-size);transition:background-color var(--_duration, .2s) var(--_easing, ease),color var(--_duration, .2s) var(--_easing, ease),outline-color var(--_duration, .2s) var(--_easing, ease)}.tx-editor__frame[data-styled] .tx-editor__tool:hover:not(:disabled),.tx-editor__bubble[data-styled] .tx-editor__tool:hover:not(:disabled){background:var(--tx-editor-tool-hover-background);color:var(--tx-editor-tool-hover-color)}.tx-editor__frame[data-styled] .tx-editor__tool:focus-visible,.tx-editor__bubble[data-styled] .tx-editor__tool:focus-visible{outline-color:var(--tx-editor-tool-focus-ring-color)}.tx-editor__frame[data-styled] .tx-editor__tool:disabled,.tx-editor__bubble[data-styled] .tx-editor__tool:disabled{opacity:var(--tx-editor-tool-disabled-opacity)}.tx-editor__bubble[data-styled] .tx-editor__tool--danger:hover{background:color-mix(in srgb,var(--tx-danger-base) 12%,transparent);color:var(--tx-danger-base)}.tx-editor__frame[data-styled] .tx-editor__tool--active,.tx-editor__bubble[data-styled] .tx-editor__tool--active{background:var(--tx-editor-tool-active-background);color:var(--tx-editor-tool-active-color)}.tx-editor__frame[data-styled] .tx-editor__tool--active:hover:not(:disabled),.tx-editor__bubble[data-styled] .tx-editor__tool--active:hover:not(:disabled){background:var(--tx-editor-tool-active-background);color:var(--tx-editor-tool-active-color)}.tx-editor__frame[data-styled] .tx-editor__tool--label{justify-content:space-between;min-width:112px;padding:var(--tx-editor-tool-label-padding);font-size:var(--tx-editor-tool-label-font-size);font-weight:var(--tx-editor-tool-label-font-weight)}.tx-editor__frame[data-styled] .tx-editor__tool-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-editor__frame[data-styled] .tx-editor__chevron{font-size:.7em;opacity:.7}.tx-editor__frame[data-styled] .tx-editor__tool:not(.tx-editor__tool--label):has(.tx-editor__chevron){padding:0 5px 0 7px}.tx-editor__frame[data-styled] .tx-editor__color-bar{width:1em;height:3px;margin-top:1px;border-radius:var(--tx-radius-full);background:currentColor;opacity:.85}.tx-editor__frame[data-styled] .tx-editor__ai{gap:6px;height:var(--tx-editor-tool-size);padding:0 10.5px;border-radius:var(--tx-editor-tool-border-radius);outline:var(--tx-editor-tool-focus-ring-width) solid transparent;outline-offset:1px;background:var(--tx-editor-ai-background);color:var(--tx-editor-ai-color);font-size:var(--tx-editor-tool-label-font-size);font-weight:var(--tx-font-weight-semibold);transition:background-color var(--_duration) var(--_easing)}.tx-editor__frame[data-styled] .tx-editor__ai:hover:not(:disabled){background:var(--tx-editor-ai-hover-background)}.tx-editor__frame[data-styled] .tx-editor__ai:focus-visible{outline-color:var(--tx-editor-tool-focus-ring-color)}.tx-editor__frame[data-styled] .tx-editor__ai-icon{animation:tx-editor-ai-breathe var(--tx-editor-ai-animation-duration) ease-in-out infinite}.tx-editor__frame[data-styled] .tx-editor__content{min-height:var(--tx-editor-content-min-height);cursor:text}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__prose{padding:var(--tx-editor-content-padding)}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__placeholder:first-child:before{float:left;height:0;color:var(--tx-editor-content-placeholder-color);content:attr(data-placeholder);pointer-events:none}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__image--selected img,.tx-editor__frame[data-styled] ::ng-deep .tx-editor__video--selected{outline:var(--tx-editor-content-image-selected-outline);outline-offset:2px;border-radius:var(--tx-editor-content-image-border-radius)}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__image--selected img{cursor:grab}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__image-handle{width:var(--tx-editor-image-handle-width);height:var(--tx-editor-image-handle-height);border:1.5px solid var(--tx-editor-image-handle-border-color);border-radius:var(--tx-radius-full);background:var(--tx-editor-image-handle-background);box-shadow:var(--tx-editor-image-handle-shadow);transition:transform var(--_duration) var(--_easing)}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__image-handle:hover{transform:translate(-50%,-50%) scaleY(1.12)}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__image--resizing img{opacity:.85}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__drop-cursor{border-radius:var(--tx-radius-full);background:var(--tx-editor-image-drop-cursor-color)}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__prose hr.ProseMirror-selectednode{border-top-color:var(--tx-editor-tool-active-color)}.tx-editor__frame[data-styled] ::ng-deep .tx-editor__prose ::selection{background:var(--tx-editor-tool-active-background)}.tx-editor__frame[data-styled] .tx-editor__footer{display:flex;justify-content:flex-end;padding:var(--tx-editor-footer-padding);color:var(--tx-editor-footer-color);font-size:var(--tx-editor-footer-font-size);font-variant-numeric:tabular-nums}.tx-editor__frame[data-styled] .tx-editor__count--limit{color:var(--tx-editor-footer-limit-color)}.tx-editor__frame[data-styled].tx-editor__frame--full{height:100%;border:0;border-radius:0;box-shadow:none}.tx-editor__frame[data-styled].tx-editor__frame--full .tx-editor__toolbar{border-radius:0}.tx-editor__frame[data-styled].tx-editor__frame--full .tx-editor__content{flex:1 1 auto;min-height:0}.tx-editor__bubble[data-styled]{gap:var(--tx-editor-bubble-gap);padding:var(--tx-editor-bubble-padding);border:1px solid var(--tx-editor-bubble-border-color);border-radius:var(--tx-editor-bubble-border-radius);background:var(--tx-editor-bubble-background);box-shadow:var(--tx-editor-bubble-shadow);color:var(--tx-text-primary);font-family:var(--tx-font-family);animation:tx-editor-pop var(--tx-editor-transition-duration) var(--tx-editor-easing)}.tx-editor__bubble[data-styled] .tx-editor__separator{flex-shrink:0;width:1px;height:var(--tx-editor-toolbar-separator-height);margin:0 var(--tx-editor-toolbar-separator-spacing);background:var(--tx-editor-toolbar-separator-color)}.tx-editor__bubble[data-styled] .tx-editor__bubble-label{display:inline-flex;align-items:center;gap:6px;padding:0 7px;color:var(--tx-editor-ai-color);font-size:var(--tx-font-size-sm);font-weight:var(--tx-font-weight-semibold)}.tx-editor__bubble[data-styled] .tx-editor__tool--ai{color:var(--tx-editor-ai-color)}.tx-editor__bubble[data-styled] .tx-editor__ai-icon{animation:tx-editor-ai-breathe var(--tx-editor-ai-animation-duration) ease-in-out infinite}.tx-editor__bubble[data-styled] .tx-editor__bubble-link{max-width:var(--tx-editor-bubble-link-max-width);padding:0 7px;color:var(--tx-editor-content-link-color);font-size:var(--tx-font-size-sm);text-decoration:none}.tx-editor__bubble[data-styled] .tx-editor__bubble-link:hover{text-decoration:underline}.tx-editor__form{gap:var(--tx-editor-popover-gap);width:var(--tx-editor-popover-width);max-width:100%}.tx-editor__form-actions{gap:4px}.tx-editor__field{width:100%}.tx-editor__hint{margin-top:calc(var(--tx-editor-popover-gap) * -.5);color:var(--tx-text-muted);font-size:var(--tx-font-size-xs)}.tx-editor__swatches{display:grid;grid-template-columns:repeat(5,var(--tx-editor-swatch-size));gap:var(--tx-editor-swatch-gap)}.tx-editor__swatch{display:inline-flex;align-items:center;justify-content:center;width:var(--tx-editor-swatch-size);height:var(--tx-editor-swatch-size);margin:0;padding:0;border:0;border-radius:var(--tx-editor-swatch-border-radius);outline:2px solid transparent;outline-offset:1px;background:var(--_swatch, transparent);box-shadow:inset 0 0 0 1px var(--tx-editor-swatch-ring);color:var(--tx-text-muted);font-family:var(--tx-font-family);font-size:var(--tx-font-size-sm);font-weight:var(--tx-font-weight-semibold);cursor:pointer;transition:transform var(--tx-editor-transition-duration) var(--tx-editor-easing),outline-color var(--tx-editor-transition-duration) var(--tx-editor-easing)}.tx-editor__swatch:hover{transform:scale(1.08)}.tx-editor__swatch:focus-visible,.tx-editor__swatch[aria-pressed=true]{outline-color:var(--tx-editor-swatch-selected-ring)}.tx-editor__swatch[data-kind=textColor]{background:transparent;color:var(--_swatch)}.tx-editor__suggestions[data-styled]{width:var(--tx-editor-suggestion-width);max-height:var(--tx-editor-suggestion-max-height);padding:var(--tx-editor-suggestion-padding);border:1px solid var(--tx-editor-bubble-border-color);border-radius:var(--tx-editor-bubble-border-radius);background:var(--tx-editor-bubble-background);box-shadow:var(--tx-editor-bubble-shadow);color:var(--tx-text-primary);font-family:var(--tx-font-family);font-size:var(--tx-font-size-md);animation:tx-editor-pop var(--tx-editor-transition-duration) var(--tx-editor-easing)}.tx-editor__suggestions[data-styled] .tx-editor__suggestion{gap:var(--tx-editor-suggestion-item-gap);padding:var(--tx-editor-suggestion-item-padding);border-radius:var(--tx-editor-suggestion-item-radius)}.tx-editor__suggestions[data-styled] .tx-editor__suggestion[aria-selected=true]{background:var(--tx-editor-suggestion-item-focus-background)}.tx-editor__suggestions[data-styled] .tx-editor__avatar{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--tx-editor-suggestion-avatar-size);height:var(--tx-editor-suggestion-avatar-size);border-radius:var(--tx-radius-full);background:var(--tx-editor-content-mention-background);color:var(--tx-editor-content-mention-color);font-size:var(--tx-font-size-xs);font-weight:var(--tx-font-weight-semibold);object-fit:cover}.tx-editor__suggestions[data-styled] .tx-editor__glyph{display:inline-flex;flex-shrink:0;justify-content:center;width:var(--tx-editor-suggestion-avatar-size);font-size:1.15em;line-height:1}.tx-editor__suggestions[data-styled] .tx-editor__command-icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:calc(var(--tx-editor-suggestion-avatar-size) + 6px);height:calc(var(--tx-editor-suggestion-avatar-size) + 6px);border:1px solid var(--tx-editor-bubble-border-color);border-radius:var(--tx-radius-md);background:var(--tx-editor-toolbar-background);color:var(--tx-text-muted);font-size:var(--tx-editor-tool-icon-size)}.tx-editor__suggestions[data-styled] .tx-editor__suggestion-text{flex:1 1 auto}.tx-editor__suggestions[data-styled] .tx-editor__shortcut{flex-shrink:0;color:var(--tx-editor-suggestion-secondary-color);font-family:var(--tx-font-family);font-size:var(--tx-font-size-xs)}.tx-editor__suggestions[data-styled] .tx-editor__suggestion-description,.tx-editor__suggestions[data-styled] .tx-editor__suggestion-empty{color:var(--tx-editor-suggestion-secondary-color);font-size:var(--tx-font-size-xs)}.tx-editor__suggestions[data-styled] .tx-editor__suggestion-empty{padding:var(--tx-editor-suggestion-item-padding)}@keyframes tx-editor-ai-breathe{0%,to{opacity:1;transform:rotate(0) scale(1)}50%{opacity:.75;transform:rotate(18deg) scale(1.12)}}@keyframes tx-editor-shimmer{to{background-position:-200% 0}}@keyframes tx-editor-pop{0%{opacity:0;transform:translateY(2px) scale(.97)}}@media(prefers-reduced-motion:reduce){.tx-editor__frame[data-styled] .tx-editor__frame,.tx-editor__frame[data-styled] .tx-editor__tool,.tx-editor__frame[data-styled] .tx-editor__ai,.tx-editor__swatch{transition:none}.tx-editor__frame[data-styled] .tx-editor__ai-icon,.tx-editor__bubble[data-styled] .tx-editor__ai-icon,.tx-editor__frame ::ng-deep .tx-editor__ai-pending,.tx-editor__bubble[data-styled],.tx-editor__suggestions[data-styled]{animation:none}.tx-editor__swatch:hover{transform:none}}\n"]
|
|
5055
5134
|
}]
|