@tectra-ng/editor 0.2.6 → 0.3.1
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/fesm2022/tectra-ng-editor-content.mjs +15 -4
- package/fesm2022/tectra-ng-editor-content.mjs.map +1 -1
- package/fesm2022/tectra-ng-editor.mjs +113 -40
- 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 +2 -2
- package/types/tectra-ng-editor.d.ts.map +1 -1
|
@@ -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";
|
|
@@ -76,7 +76,7 @@ function blockAttrsToDom(attrs) {
|
|
|
76
76
|
const dom = {};
|
|
77
77
|
const styles = [];
|
|
78
78
|
if (attrs["align"]) styles.push(`text-align: ${attrs["align"]}`);
|
|
79
|
-
const indent = Number(attrs["indent"]
|
|
79
|
+
const indent = Number(attrs["indent"]);
|
|
80
80
|
if (indent > 0) {
|
|
81
81
|
dom["data-indent"] = String(indent);
|
|
82
82
|
styles.push(`margin-left: ${indent * 3}em`);
|
|
@@ -247,7 +247,7 @@ const nodes$1 = {
|
|
|
247
247
|
tag: "img[src]",
|
|
248
248
|
getAttrs: (dom) => {
|
|
249
249
|
const element = dom;
|
|
250
|
-
const src = element.getAttribute("src")
|
|
250
|
+
const src = element.getAttribute("src");
|
|
251
251
|
return SAFE_IMAGE.test(src) ? {
|
|
252
252
|
src,
|
|
253
253
|
alt: element.getAttribute("alt"),
|
|
@@ -271,7 +271,7 @@ const nodes$1 = {
|
|
|
271
271
|
parseDOM: [{
|
|
272
272
|
tag: "iframe[src]",
|
|
273
273
|
getAttrs: (dom) => {
|
|
274
|
-
const src = toVideoEmbed(dom.getAttribute("src")
|
|
274
|
+
const src = toVideoEmbed(dom.getAttribute("src"));
|
|
275
275
|
return src ? { src } : false;
|
|
276
276
|
}
|
|
277
277
|
}],
|
|
@@ -433,7 +433,7 @@ const nodes$1 = {
|
|
|
433
433
|
const id = element.getAttribute("data-id");
|
|
434
434
|
return id ? {
|
|
435
435
|
id,
|
|
436
|
-
label: element.getAttribute("data-label") ?? element.textContent
|
|
436
|
+
label: element.getAttribute("data-label") ?? element.textContent.replace(/^@/, "")
|
|
437
437
|
} : false;
|
|
438
438
|
}
|
|
439
439
|
}],
|
|
@@ -464,7 +464,7 @@ const txEditorSchema = new Schema({
|
|
|
464
464
|
tag: "a[href]",
|
|
465
465
|
getAttrs: (dom) => {
|
|
466
466
|
const element = dom;
|
|
467
|
-
const href = element.getAttribute("href")
|
|
467
|
+
const href = element.getAttribute("href");
|
|
468
468
|
return SAFE_LINK.test(href) ? {
|
|
469
469
|
href,
|
|
470
470
|
target: element.getAttribute("target") === "_blank" ? "_blank" : null,
|
|
@@ -726,7 +726,7 @@ function shiftIndent(delta) {
|
|
|
726
726
|
if (!TEXT_BLOCKS.has(node.type.name)) return true;
|
|
727
727
|
const parent = state.doc.resolve(pos).parent;
|
|
728
728
|
if (parent.type.name === "list_item" || parent.type.name === "task_item") return false;
|
|
729
|
-
const indent = Math.max(0, Math.min(8, Number(node.attrs["indent"]
|
|
729
|
+
const indent = Math.max(0, Math.min(8, Number(node.attrs["indent"]) + delta));
|
|
730
730
|
if (indent !== node.attrs["indent"]) tr.setNodeMarkup(pos, void 0, {
|
|
731
731
|
...node.attrs,
|
|
732
732
|
indent
|
|
@@ -879,7 +879,6 @@ const liftEmptyBlock = (state, dispatch) => {
|
|
|
879
879
|
const splitBlock = (state, dispatch) => {
|
|
880
880
|
const { $from, $to } = state.selection;
|
|
881
881
|
if (state.selection instanceof NodeSelection && state.selection.node.isBlock) return false;
|
|
882
|
-
if (!$from.parent.isBlock) return false;
|
|
883
882
|
if (state.selection.empty && $from.parentOffset === 0 && $from.parent.type.name === "heading" && $from.parent.content.size > 0) {
|
|
884
883
|
dispatch?.(state.tr.insert($from.before(), txEditorSchema.nodes["paragraph"].create()).scrollIntoView());
|
|
885
884
|
return true;
|
|
@@ -1198,14 +1197,10 @@ function splitListItem(itemType) {
|
|
|
1198
1197
|
if ($from.parent.content.size === 0 && item.childCount === $from.indexAfter(-1)) return false;
|
|
1199
1198
|
const nextType = $to.pos === $from.end() ? item.contentMatchAt(0).defaultType : null;
|
|
1200
1199
|
const tr = state.tr.delete($from.pos, $to.pos);
|
|
1201
|
-
const
|
|
1202
|
-
const types = nextType ? [{
|
|
1203
|
-
type,
|
|
1204
|
-
attrs: itemAttrs ?? void 0
|
|
1205
|
-
}, { type: nextType }] : [{
|
|
1200
|
+
const types = [{
|
|
1206
1201
|
type,
|
|
1207
|
-
attrs:
|
|
1208
|
-
}];
|
|
1202
|
+
attrs: (type.name === "task_item" ? { checked: false } : null) ?? void 0
|
|
1203
|
+
}, nextType ? { type: nextType } : null];
|
|
1209
1204
|
if (!canSplit(tr.doc, $from.pos, 2, types)) return false;
|
|
1210
1205
|
dispatch?.(tr.split($from.pos, 2, types).scrollIntoView());
|
|
1211
1206
|
return true;
|
|
@@ -2222,8 +2217,8 @@ function normalizeHref(value) {
|
|
|
2222
2217
|
}
|
|
2223
2218
|
function linkMatches(text) {
|
|
2224
2219
|
return Array.from(text.matchAll(URL_PATTERN)).map((match) => ({
|
|
2225
|
-
start: match.index
|
|
2226
|
-
end:
|
|
2220
|
+
start: match.index,
|
|
2221
|
+
end: match.index + match[0].length,
|
|
2227
2222
|
href: normalizeHref(match[0])
|
|
2228
2223
|
}));
|
|
2229
2224
|
}
|
|
@@ -3119,7 +3114,7 @@ function blockRule(match, type, attrs) {
|
|
|
3119
3114
|
handler: (state, found, start, end) => {
|
|
3120
3115
|
const $start = state.doc.resolve(start);
|
|
3121
3116
|
if (!$start.node(-1).canReplaceWith($start.index(-1), $start.indexAfter(-1), type)) return null;
|
|
3122
|
-
return state.tr.delete(start, end).setBlockType(start, start, type, attrs
|
|
3117
|
+
return state.tr.delete(start, end).setBlockType(start, start, type, attrs(found));
|
|
3123
3118
|
}
|
|
3124
3119
|
};
|
|
3125
3120
|
}
|
|
@@ -3144,7 +3139,6 @@ function markRule(match, type) {
|
|
|
3144
3139
|
prefix: true,
|
|
3145
3140
|
handler: (state, found, start, end) => {
|
|
3146
3141
|
const inner = found[2];
|
|
3147
|
-
if (!inner) return null;
|
|
3148
3142
|
const marker = (found[0].length - found[1].length - inner.length) / 2;
|
|
3149
3143
|
const tr = state.tr;
|
|
3150
3144
|
tr.delete(start + marker + inner.length, end);
|
|
@@ -3272,6 +3266,82 @@ function editorPlugins(options) {
|
|
|
3272
3266
|
aiPlugin()
|
|
3273
3267
|
];
|
|
3274
3268
|
}
|
|
3269
|
+
const EDITOR_ICON_DEFAULTS = {
|
|
3270
|
+
"align-center": txIconAlignCenter,
|
|
3271
|
+
"align-justify": txIconAlignJustify,
|
|
3272
|
+
"align-left": txIconAlignLeft,
|
|
3273
|
+
"align-right": txIconAlignRight,
|
|
3274
|
+
ban: txIconBan,
|
|
3275
|
+
bell: txIconBell,
|
|
3276
|
+
"block-quote": txIconBlockQuote,
|
|
3277
|
+
bold: txIconBold,
|
|
3278
|
+
box: txIconBox,
|
|
3279
|
+
calendar: txIconCalendar,
|
|
3280
|
+
check: txIconCheck,
|
|
3281
|
+
"chevron-down": txIconChevronDown,
|
|
3282
|
+
clock: txIconClock,
|
|
3283
|
+
code: txIconCode,
|
|
3284
|
+
dollar: txIconDollar,
|
|
3285
|
+
eraser: txIconEraser,
|
|
3286
|
+
file: txIconFile,
|
|
3287
|
+
flag: txIconFlag,
|
|
3288
|
+
folder: txIconFolder,
|
|
3289
|
+
gift: txIconGift,
|
|
3290
|
+
globe: txIconGlobe,
|
|
3291
|
+
hammer: txIconHammer,
|
|
3292
|
+
heading: txIconHeading,
|
|
3293
|
+
"heading-1": txIconHeading1,
|
|
3294
|
+
"heading-2": txIconHeading2,
|
|
3295
|
+
"heading-3": txIconHeading3,
|
|
3296
|
+
heart: txIconHeart,
|
|
3297
|
+
highlighter: txIconHighlighter,
|
|
3298
|
+
"horizontal-rule": txIconHorizontalRule,
|
|
3299
|
+
hourglass: txIconHourglass,
|
|
3300
|
+
image: txIconImage,
|
|
3301
|
+
inbox: txIconInbox,
|
|
3302
|
+
indent: txIconIndent,
|
|
3303
|
+
info: txIconInfo,
|
|
3304
|
+
"info-circle": txIconInfoCircle,
|
|
3305
|
+
italic: txIconItalic,
|
|
3306
|
+
key: txIconKey,
|
|
3307
|
+
language: txIconLanguage,
|
|
3308
|
+
link: txIconLink,
|
|
3309
|
+
list: txIconList,
|
|
3310
|
+
"list-check": txIconListCheck,
|
|
3311
|
+
"list-ol": txIconListOl,
|
|
3312
|
+
lock: txIconLock,
|
|
3313
|
+
moon: txIconMoon,
|
|
3314
|
+
outdent: txIconOutdent,
|
|
3315
|
+
"paragraph-left": txIconParagraphLeft,
|
|
3316
|
+
pencil: txIconPencil,
|
|
3317
|
+
phone: txIconPhone,
|
|
3318
|
+
question: txIconQuestion,
|
|
3319
|
+
search: txIconSearch,
|
|
3320
|
+
slash: txIconSlash,
|
|
3321
|
+
sparkles: txIconSparkles,
|
|
3322
|
+
star: txIconStar,
|
|
3323
|
+
stop: txIconStop,
|
|
3324
|
+
strikethrough: txIconStrikethrough,
|
|
3325
|
+
subscript: txIconSubscript,
|
|
3326
|
+
sun: txIconSun,
|
|
3327
|
+
superscript: txIconSuperscript,
|
|
3328
|
+
table: txIconTable,
|
|
3329
|
+
text: txIconText,
|
|
3330
|
+
"text-color": txIconTextColor,
|
|
3331
|
+
trash: txIconTrash,
|
|
3332
|
+
trophy: txIconTrophy,
|
|
3333
|
+
underline: txIconUnderline,
|
|
3334
|
+
undo: txIconUndo,
|
|
3335
|
+
video: txIconVideo,
|
|
3336
|
+
"window-maximize": txIconWindowMaximize,
|
|
3337
|
+
"window-minimize": txIconWindowMinimize,
|
|
3338
|
+
wrench: txIconWrench
|
|
3339
|
+
};
|
|
3340
|
+
const EDITOR_THEME = {
|
|
3341
|
+
editor: editorTokens,
|
|
3342
|
+
editorContent: editorContentTokens,
|
|
3343
|
+
formField: formFieldTokens
|
|
3344
|
+
};
|
|
3275
3345
|
const NO_BOX = {
|
|
3276
3346
|
left: 0,
|
|
3277
3347
|
top: 0,
|
|
@@ -3279,6 +3349,7 @@ const NO_BOX = {
|
|
|
3279
3349
|
height: 0
|
|
3280
3350
|
};
|
|
3281
3351
|
var TxEditor = class TxEditor extends TxFormControlBase {
|
|
3352
|
+
editorTheme = injectTokens(EDITOR_THEME);
|
|
3282
3353
|
document = inject(DOCUMENT);
|
|
3283
3354
|
host = inject(ElementRef);
|
|
3284
3355
|
destroyRef = inject(DestroyRef);
|
|
@@ -3413,6 +3484,7 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
3413
3484
|
"code"
|
|
3414
3485
|
];
|
|
3415
3486
|
scrollStrategy = txScrollStrategy(inject(Injector));
|
|
3487
|
+
suggestScrollStrategy = txScrollStrategy(inject(Injector));
|
|
3416
3488
|
abovePositions = txPositions("top", 8);
|
|
3417
3489
|
belowPositions = txPositions("bottom", 8);
|
|
3418
3490
|
bubblePositions = computed(() => {
|
|
@@ -3431,7 +3503,6 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
3431
3503
|
index: index++
|
|
3432
3504
|
}))).filter((group) => group.length);
|
|
3433
3505
|
}, ...ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []);
|
|
3434
|
-
toolCount = computed(() => this.groups().reduce((sum, group) => sum + group.length, 0) + (this.ai() ? 1 : 0) + (this.showFullViewButton() ? 1 : 0), ...ngDevMode ? [{ debugName: "toolCount" }] : /* istanbul ignore next */ []);
|
|
3435
3506
|
showFullViewButton = computed(() => this.fullViewButton() ?? this.toolbar() === "full", ...ngDevMode ? [{ debugName: "showFullViewButton" }] : /* istanbul ignore next */ []);
|
|
3436
3507
|
levels = computed(() => this.headingLevels() ?? (this.toolbar() === "full" ? [
|
|
3437
3508
|
1,
|
|
@@ -3598,6 +3669,7 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
3598
3669
|
clearTimeout(this.draftTimer);
|
|
3599
3670
|
this.unmountFullView();
|
|
3600
3671
|
this.view?.destroy();
|
|
3672
|
+
this.view = null;
|
|
3601
3673
|
});
|
|
3602
3674
|
}
|
|
3603
3675
|
writeValue(value) {
|
|
@@ -3609,7 +3681,7 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
3609
3681
|
}
|
|
3610
3682
|
clear() {
|
|
3611
3683
|
this.setContent("");
|
|
3612
|
-
this.emitValue();
|
|
3684
|
+
this.emitValue(true);
|
|
3613
3685
|
}
|
|
3614
3686
|
getHtml() {
|
|
3615
3687
|
return this.lastValue;
|
|
@@ -3779,10 +3851,6 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
3779
3851
|
view.focus();
|
|
3780
3852
|
}
|
|
3781
3853
|
}
|
|
3782
|
-
openCurrentLink() {
|
|
3783
|
-
const href = this.state()?.link?.href;
|
|
3784
|
-
if (href) this.document.defaultView?.open(href, "_blank", "noopener,noreferrer");
|
|
3785
|
-
}
|
|
3786
3854
|
applyColor(kind, value) {
|
|
3787
3855
|
this.closePopover();
|
|
3788
3856
|
this.run(setTextStyle(kind === "textColor" ? "color" : "background", value));
|
|
@@ -4022,16 +4090,19 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
4022
4090
|
this.view = new EditorView(host, {
|
|
4023
4091
|
state,
|
|
4024
4092
|
editable: () => this.editable(),
|
|
4025
|
-
attributes: () =>
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4093
|
+
attributes: () => {
|
|
4094
|
+
const labelledBy = this.ariaLabelledBy();
|
|
4095
|
+
return {
|
|
4096
|
+
class: "tx-editor__prose tx-editor-prose",
|
|
4097
|
+
role: "textbox",
|
|
4098
|
+
"aria-multiline": "true",
|
|
4099
|
+
...labelledBy ? { "aria-labelledby": labelledBy } : { "aria-label": this.ariaLabel() ?? this.translations().editorLabel },
|
|
4100
|
+
"aria-readonly": String(this.readonly()),
|
|
4101
|
+
"aria-disabled": String(this.isDisabled()),
|
|
4102
|
+
"aria-invalid": String(this.isInvalid()),
|
|
4103
|
+
id: `${this.id}-content`
|
|
4104
|
+
};
|
|
4105
|
+
},
|
|
4035
4106
|
nodeViews: {
|
|
4036
4107
|
task_item: (node, view, getPos) => new TxTaskItemView(node, view, getPos, () => this.translations().editorTaskList),
|
|
4037
4108
|
video: (node, view, getPos) => new TxVideoView(node, view, getPos),
|
|
@@ -4232,7 +4303,7 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
4232
4303
|
shortcut: item.shortcut ? shortcutLabel(item.shortcut, this.mac) : void 0,
|
|
4233
4304
|
value: item
|
|
4234
4305
|
}));
|
|
4235
|
-
} else options =
|
|
4306
|
+
} else options = matchEmoji(match.query).map((emoji) => ({
|
|
4236
4307
|
id: emoji.name,
|
|
4237
4308
|
label: `:${emoji.name}:`,
|
|
4238
4309
|
glyph: emoji.char,
|
|
@@ -4771,7 +4842,7 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
4771
4842
|
],
|
|
4772
4843
|
usesInheritance: true,
|
|
4773
4844
|
ngImport: i0,
|
|
4774
|
-
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",
|
|
4845
|
+
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]=\"suggestScrollStrategy\"\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",
|
|
4775
4846
|
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"],
|
|
4776
4847
|
dependencies: [
|
|
4777
4848
|
{
|
|
@@ -5007,6 +5078,7 @@ var TxEditor = class TxEditor extends TxFormControlBase {
|
|
|
5007
5078
|
exportAs: ["txTooltip"]
|
|
5008
5079
|
}
|
|
5009
5080
|
],
|
|
5081
|
+
viewProviders: [provideTxIconDefaults(EDITOR_ICON_DEFAULTS)],
|
|
5010
5082
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
5011
5083
|
});
|
|
5012
5084
|
};
|
|
@@ -5050,7 +5122,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5050
5122
|
"[class.tx-editor--full]": "fullView()",
|
|
5051
5123
|
"[style.min-height.px]": "placeholderHeight()"
|
|
5052
5124
|
},
|
|
5053
|
-
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",
|
|
5125
|
+
viewProviders: [provideTxIconDefaults(EDITOR_ICON_DEFAULTS)],
|
|
5126
|
+
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]=\"suggestScrollStrategy\"\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
5127
|
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
5128
|
}]
|
|
5056
5129
|
}],
|