@besaitech/ng-design-system 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/charts/index.d.ts +1 -1
- package/fesm2022/besaitech-ng-design-system-rich-text.mjs +223 -5
- package/fesm2022/besaitech-ng-design-system-rich-text.mjs.map +1 -1
- package/fesm2022/besaitech-ng-design-system.mjs +4 -0
- package/fesm2022/besaitech-ng-design-system.mjs.map +1 -1
- package/index.d.ts +24 -20
- package/package.json +2 -1
- package/rich-text/index.d.ts +36 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"besaitech-ng-design-system-rich-text.mjs","sources":["../../../projects/saitech-design-system/rich-text/rich-text-types.ts","../../../projects/saitech-design-system/rich-text/sds-rich-text-editor.ts","../../../projects/saitech-design-system/rich-text/sds-localized-rich-text-editor.ts","../../../projects/saitech-design-system/rich-text/public-api.ts","../../../projects/saitech-design-system/rich-text/besaitech-ng-design-system-rich-text.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** A toolbar action of {@link SdsRichTextEditor}. The tools also decide what the document may contain. */\nexport type SdsRichTextTool =\n | 'paragraph'\n | 'heading2'\n | 'heading3'\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strike'\n | 'bulletList'\n | 'orderedList'\n | 'blockquote'\n | 'link'\n | 'horizontalRule'\n | 'clearFormatting'\n | 'undo'\n | 'redo';\n\n/** The toolbar shown when `[tools]` is not set. */\nexport const SDS_RICH_TEXT_DEFAULT_TOOLS: readonly SdsRichTextTool[] = [\n 'heading2',\n 'heading3',\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'bulletList',\n 'orderedList',\n 'blockquote',\n 'link',\n 'clearFormatting',\n 'undo',\n 'redo',\n];\n\nexport type SdsRichTextAppearance = 'default' | 'filled';\n\n/** Every string the editor shows or speaks. Translate them in a multi-language app. */\nexport interface SdsRichTextLabels {\n /** Accessible name of the toolbar. */\n toolbar: string;\n paragraph: string;\n heading2: string;\n heading3: string;\n bold: string;\n italic: string;\n underline: string;\n strike: string;\n bulletList: string;\n orderedList: string;\n blockquote: string;\n link: string;\n horizontalRule: string;\n clearFormatting: string;\n undo: string;\n redo: string;\n /** Label of the link address field. */\n linkUrl: string;\n linkPlaceholder: string;\n linkApply: string;\n linkRemove: string;\n linkCancel: string;\n /** Shown under the address field when it is not an http(s), mailto, tel, relative or anchor link. */\n linkInvalid: string;\n /** Spoken counter with a `[maxLength]`; tokens `{count}` and `{max}`. */\n countLimit: string;\n /** Spoken counter without a limit; token `{count}`. */\n count: string;\n}\n\nexport const SDS_RICH_TEXT_LABELS_EN: SdsRichTextLabels = {\n toolbar: 'Formatting',\n paragraph: 'Normal text',\n heading2: 'Heading',\n heading3: 'Subheading',\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n strike: 'Strikethrough',\n bulletList: 'Bulleted list',\n orderedList: 'Numbered list',\n blockquote: 'Quote',\n link: 'Link',\n horizontalRule: 'Divider',\n clearFormatting: 'Clear formatting',\n undo: 'Undo',\n redo: 'Redo',\n linkUrl: 'Link address',\n linkPlaceholder: 'https://… or e-mail address',\n linkApply: 'Apply',\n linkRemove: 'Remove link',\n linkCancel: 'Cancel',\n linkInvalid: 'Enter a web address (https://…), an e-mail address or a path starting with /.',\n countLimit: '{count} of {max} characters used',\n count: '{count} characters',\n};\n\n/**\n * App-wide label overrides for every {@link SdsRichTextEditor} — provide a (partial) translation once, e.g.\n * `{ provide: SDS_RICH_TEXT_LABELS, useValue: { bold: 'Gras', … } }`. A component's own `[labels]` win over it.\n * For an app that switches language at runtime, bind `[labels]` instead.\n */\nexport const SDS_RICH_TEXT_LABELS = new InjectionToken<Partial<SdsRichTextLabels>>(\n 'SDS_RICH_TEXT_LABELS',\n { factory: () => ({}) },\n);\n\nconst SCHEME = /^([a-z][a-z0-9+-]*):/i;\nconst ALLOWED_SCHEMES = new Set(['http', 'https', 'mailto', 'tel']);\nconst BARE_EMAIL = /^[^\\s@/]+@[^\\s@/]+\\.[^\\s@/]+$/;\nconst BARE_DOMAIN = /^[a-z0-9-]+(\\.[a-z0-9-]+)+(:\\d+)?([/?#].*)?$/i;\n\n/**\n * The link target the editor accepts for `raw`, normalised — or `null` when it is not safe to link to.\n * Accepted: `http(s):`, `mailto:` and `tel:` URLs, site-relative paths (`/formations`) and anchors (`#faq`);\n * a bare domain (`example.ch/page`) gets `https://`, a bare e-mail address gets `mailto:`. Everything else —\n * `javascript:`, `data:`, protocol-relative `//host`, whitespace — is refused. The editor applies the same\n * rule to pasted and loaded HTML, so an unsafe link never survives in its output.\n */\nexport function sdsSafeHref(raw: string | null | undefined): string | null {\n const url = (raw ?? '').trim();\n if (!url || /[\\s\\u0000-\\u001f\\u007f]/.test(url)) {\n return null;\n }\n if (url.startsWith('#')) {\n return url;\n }\n if (url.startsWith('/')) {\n return url.startsWith('//') ? null : url;\n }\n const scheme = SCHEME.exec(url);\n if (scheme) {\n return ALLOWED_SCHEMES.has(scheme[1].toLowerCase()) ? url : null;\n }\n if (BARE_EMAIL.test(url)) {\n return `mailto:${url}`;\n }\n if (BARE_DOMAIN.test(url)) {\n return `https://${url}`;\n }\n return null;\n}\n","import {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n numberAttribute,\n signal,\n untracked,\n viewChild,\n viewChildren,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { SdsButton, SdsIcon, SdsIconName } from '@besaitech/ng-design-system';\nimport { Editor, EditorOptions, Extensions } from '@tiptap/core';\nimport { CharacterCount, Placeholder } from '@tiptap/extensions';\nimport StarterKit from '@tiptap/starter-kit';\nimport {\n SDS_RICH_TEXT_DEFAULT_TOOLS,\n SDS_RICH_TEXT_LABELS,\n SDS_RICH_TEXT_LABELS_EN,\n SdsRichTextAppearance,\n SdsRichTextLabels,\n SdsRichTextTool,\n sdsSafeHref,\n} from './rich-text-types';\n\nlet nextId = 0;\n\ninterface ToolDef {\n tool: SdsRichTextTool;\n icon: SdsIconName;\n group: number;\n /** A formatting state the button reflects with `aria-pressed`. */\n toggle: boolean;\n /** Tiptap's keyboard shortcut, shown in the tooltip (`Mod` = ⌘ on Apple, Ctrl elsewhere). */\n shortcut?: string;\n}\n\nconst TOOL_DEFS: readonly ToolDef[] = [\n { tool: 'paragraph', icon: 'pilcrow', group: 0, toggle: true, shortcut: 'Mod-Alt-0' },\n { tool: 'heading2', icon: 'heading-2', group: 0, toggle: true, shortcut: 'Mod-Alt-2' },\n { tool: 'heading3', icon: 'heading-3', group: 0, toggle: true, shortcut: 'Mod-Alt-3' },\n { tool: 'bold', icon: 'bold', group: 1, toggle: true, shortcut: 'Mod-B' },\n { tool: 'italic', icon: 'italic', group: 1, toggle: true, shortcut: 'Mod-I' },\n { tool: 'underline', icon: 'underline', group: 1, toggle: true, shortcut: 'Mod-U' },\n { tool: 'strike', icon: 'strikethrough', group: 1, toggle: true, shortcut: 'Mod-Shift-S' },\n { tool: 'bulletList', icon: 'list', group: 2, toggle: true, shortcut: 'Mod-Shift-8' },\n { tool: 'orderedList', icon: 'list-ordered', group: 2, toggle: true, shortcut: 'Mod-Shift-7' },\n { tool: 'blockquote', icon: 'text-quote', group: 2, toggle: true, shortcut: 'Mod-Shift-B' },\n { tool: 'link', icon: 'link', group: 3, toggle: true, shortcut: 'Mod-K' },\n { tool: 'horizontalRule', icon: 'minus', group: 3, toggle: false },\n { tool: 'clearFormatting', icon: 'remove-formatting', group: 4, toggle: false },\n { tool: 'undo', icon: 'undo-2', group: 5, toggle: false, shortcut: 'Mod-Z' },\n { tool: 'redo', icon: 'redo-2', group: 5, toggle: false, shortcut: 'Mod-Shift-Z' },\n];\n\n/** One line of the editable area, for `[rows]` → min-height. */\nconst LINE_EM = 1.6;\n\nconst FRAME_BASE = 'overflow-hidden rounded-control border text-ink transition-colors';\n\nconst TOOL_BUTTON =\n 'inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ink-soft transition-colors ' +\n 'hover:bg-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 ' +\n 'disabled:pointer-events-none disabled:opacity-40';\n/**\n * Pressed (active) state: the brand tint, like a tertiary button. In dark mode it takes the preset's\n * `--sds-dark-tint` / `--sds-dark-on-tint` and falls back to a neutral white tint (see theme/dark-fills.ts —\n * internal to the root entry, hence the literals here; Tailwind finds them by scanning the bundle).\n */\nconst TOOL_BUTTON_ON =\n 'bg-brand-50 text-brand-700 hover:bg-brand-100 hover:text-brand-700 ' +\n 'dark:bg-[color:var(--sds-dark-tint,rgb(255_255_255/0.12))] ' +\n 'dark:text-[color:var(--sds-dark-on-tint,var(--color-ink))] ' +\n 'dark:hover:bg-[color:var(--sds-dark-tint-hover,rgb(255_255_255/0.16))] ' +\n 'dark:hover:text-[color:var(--sds-dark-on-tint,var(--color-ink))]';\n\n/**\n * Marks content projected at the END of an {@link SdsRichTextEditor}'s toolbar — a language switcher (as in\n * {@link SdsLocalizedRichTextEditor}), an \"insert variable\" menu… It stays visible in `readonly` mode, where\n * the formatting buttons are hidden: `<div sdsRichTextToolbarEnd>…</div>`.\n */\n@Directive({ selector: '[sdsRichTextToolbarEnd]' })\nexport class SdsRichTextToolbarEnd {}\n\n/**\n * A rich-text field — headings, bold / italic / underline / strike, lists, quotes, links, dividers, undo/redo —\n * for content that is stored and shown as HTML (course pages, instructions, articles). Built on Tiptap\n * (ProseMirror), so the HTML it emits is always clean and structured: no inline styles, no `<font>`/`<span>`\n * soup from Word or web pages, nothing outside the enabled tools.\n *\n * **The tools are the schema.** `[tools]` chooses the toolbar AND what the document may contain: drop\n * `heading2`/`heading3` and pasted headings become paragraphs; drop `link` and links are unwrapped. Links\n * only accept http(s), mailto, tel, site-relative paths and anchors ({@link sdsSafeHref}) — `javascript:`\n * and friends are stripped from typed, pasted and loaded HTML alike, and links open in a new tab with\n * `rel=\"noopener noreferrer nofollow\"`. Still sanitise on display, as for any stored HTML.\n *\n * Implements ControlValueAccessor over an HTML string — use with reactive forms or `[(ngModel)]`. An empty\n * document is `''` (not `<p></p>`), so `Validators.required` works. Writing a value never marks the control\n * dirty. Keyboard: the usual shortcuts (⌘/Ctrl+B, I, U, K for a link, ⌘/Ctrl+Alt+2/3 for headings, Markdown\n * shortcuts like `## ` or `- `); the toolbar is one Tab stop, arrows move inside it.\n *\n * Strings are English by default: pass `[labels]` (or provide {@link SDS_RICH_TEXT_LABELS}) in another\n * language. Import from the secondary entry point `@besaitech/ng-design-system/rich-text`.\n */\n@Component({\n selector: 'sds-rich-text-editor',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [SdsIcon, SdsButton],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SdsRichTextEditor),\n multi: true,\n },\n ],\n host: { class: 'block' },\n template: `\n @if (label()) {\n <label\n [id]=\"fieldId + '-label'\"\n class=\"mb-1.5 block text-sm font-medium text-ink\"\n (click)=\"focus()\"\n >{{ label() }}\n @if (required()) {\n <span class=\"ml-0.5 text-danger\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n <div [class]=\"frameClasses()\">\n @if (showToolbar() || toolbarEnd()) {\n <div\n [attr.role]=\"showToolbar() ? 'toolbar' : null\"\n [attr.aria-label]=\"showToolbar() ? l().toolbar : null\"\n [attr.aria-controls]=\"showToolbar() ? fieldId : null\"\n [attr.aria-disabled]=\"showToolbar() && !interactive() ? 'true' : null\"\n class=\"flex flex-wrap items-center gap-0.5 border-b border-border px-1.5 py-1\"\n [class.bg-muted]=\"appearance() === 'default'\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (group of showToolbar() ? groups() : []; track $index; let gi = $index) {\n @if (gi > 0) {\n <span class=\"mx-1 h-5 w-px shrink-0 bg-border\" aria-hidden=\"true\"></span>\n }\n @for (def of group; track def.tool) {\n <button\n #toolButton\n type=\"button\"\n [attr.data-tool]=\"def.tool\"\n [attr.tabindex]=\"def.tool === rovingTool() ? 0 : -1\"\n [attr.aria-pressed]=\"def.toggle ? (isOn(def.tool) ? 'true' : 'false') : null\"\n [attr.aria-label]=\"l()[def.tool]\"\n [attr.title]=\"tooltip(def)\"\n [disabled]=\"!interactive() || !canRun(def.tool)\"\n [class]=\"buttonClass(def)\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"run(def.tool)\"\n (focus)=\"rovingTool.set(def.tool)\"\n >\n <sds-icon [name]=\"def.icon\" [size]=\"16\" />\n </button>\n }\n }\n <div class=\"ml-auto flex shrink-0 items-center pl-1\">\n <ng-content select=\"[sdsRichTextToolbarEnd]\" />\n </div>\n </div>\n }\n\n @if (linkOpen()) {\n <div\n role=\"group\"\n [attr.aria-label]=\"l().link\"\n class=\"flex flex-wrap items-center gap-2 border-b border-border bg-surface px-2 py-2\"\n >\n <label class=\"sr-only\" [for]=\"fieldId + '-url'\">{{ l().linkUrl }}</label>\n <input\n #linkInput\n [id]=\"fieldId + '-url'\"\n type=\"text\"\n inputmode=\"url\"\n autocomplete=\"url\"\n spellcheck=\"false\"\n [value]=\"linkDraft()\"\n [placeholder]=\"l().linkPlaceholder\"\n [attr.aria-invalid]=\"linkError() ? 'true' : null\"\n [attr.aria-describedby]=\"linkError() ? fieldId + '-url-err' : null\"\n class=\"h-8 min-w-0 flex-1 basis-48 rounded-control border bg-surface px-2.5 text-sm text-ink outline-none placeholder:text-ink-faint focus:ring-2\"\n [class]=\"\n linkError()\n ? 'border-danger focus:ring-danger/25'\n : 'border-border focus:border-brand-500 focus:ring-brand-500/25'\n \"\n (input)=\"onLinkInput($event)\"\n (keydown)=\"onLinkKeydown($event)\"\n />\n <sds-button size=\"sm\" (click)=\"applyLink()\">{{ l().linkApply }}</sds-button>\n @if (isOn('link')) {\n <sds-button size=\"sm\" variant=\"ghost\" (click)=\"removeLink()\">\n <sds-icon name=\"unlink\" [size]=\"15\" />\n {{ l().linkRemove }}\n </sds-button>\n }\n <sds-button size=\"sm\" variant=\"ghost\" (click)=\"closeLink(true)\">{{\n l().linkCancel\n }}</sds-button>\n @if (linkError()) {\n <p [id]=\"fieldId + '-url-err'\" class=\"basis-full text-xs font-medium text-danger\">\n {{ l().linkInvalid }}\n </p>\n }\n </div>\n }\n\n <div\n #content\n class=\"sds-rte\"\n [class.overflow-y-auto]=\"maxRows() > 0\"\n [style.max-height]=\"maxHeight()\"\n (click)=\"onAreaClick($event)\"\n ></div>\n </div>\n\n @if (hasCounter()) {\n <div class=\"mt-1.5 flex items-start gap-2 text-xs\">\n @if (error()) {\n <p [id]=\"fieldId + '-err'\" class=\"flex-1 font-medium text-danger\">{{ error() }}</p>\n } @else if (hint()) {\n <p [id]=\"fieldId + '-hint'\" class=\"flex-1 text-ink-faint\">{{ hint() }}</p>\n } @else {\n <span class=\"flex-1\"></span>\n }\n <span\n [id]=\"fieldId + '-count'\"\n aria-live=\"polite\"\n [attr.aria-label]=\"countLabel()\"\n class=\"shrink-0 tabular-nums\"\n [class.text-ink-faint]=\"!atLimit()\"\n [class.text-danger]=\"atLimit()\"\n >{{ characters() }}{{ maxLength() ? ' / ' + maxLength() : '' }}</span\n >\n </div>\n } @else if (error()) {\n <p [id]=\"fieldId + '-err'\" class=\"mt-1.5 text-xs font-medium text-danger\">{{ error() }}</p>\n } @else if (hint()) {\n <p [id]=\"fieldId + '-hint'\" class=\"mt-1.5 text-xs text-ink-faint\">{{ hint() }}</p>\n }\n `,\n styles: `\n /*\n * The editable document is created by ProseMirror, outside Angular's templates, so these rules are\n * global (no view encapsulation) and every selector is scoped to the editor's own class. Tailwind's\n * preflight resets lists and headings, hence the explicit typography.\n */\n .sds-rte-content {\n outline: none;\n padding: 0.625rem 0.875rem;\n color: var(--color-ink);\n font-size: 0.875rem;\n line-height: ${LINE_EM};\n overflow-wrap: anywhere;\n white-space: pre-wrap;\n }\n .sds-rte-content > :first-child {\n margin-top: 0;\n }\n .sds-rte-content > :last-child {\n margin-bottom: 0;\n }\n .sds-rte-content p,\n .sds-rte-content ul,\n .sds-rte-content ol,\n .sds-rte-content blockquote {\n margin: 0 0 0.75em;\n }\n .sds-rte-content h2 {\n font-size: 1.25em;\n font-weight: 600;\n line-height: 1.3;\n margin: 1.1em 0 0.5em;\n }\n .sds-rte-content h3 {\n font-size: 1.1em;\n font-weight: 600;\n line-height: 1.35;\n margin: 1em 0 0.4em;\n }\n .sds-rte-content ul {\n list-style: disc;\n padding-left: 1.5em;\n }\n .sds-rte-content ol {\n list-style: decimal;\n padding-left: 1.5em;\n }\n .sds-rte-content li > p {\n margin: 0;\n }\n .sds-rte-content li + li {\n margin-top: 0.25em;\n }\n .sds-rte-content li > ul,\n .sds-rte-content li > ol {\n margin: 0.25em 0 0;\n }\n .sds-rte-content blockquote {\n border-left: 3px solid var(--color-border);\n padding-left: 0.875em;\n color: var(--color-ink-soft);\n }\n .sds-rte-content a {\n color: var(--color-brand-700, var(--color-accent-blue));\n text-decoration: underline;\n text-underline-offset: 2px;\n }\n /* A monochrome preset's dark brand steps are near the surface: links follow the dark tint text. */\n .dark .sds-rte-content a {\n color: var(--sds-dark-on-tint, var(--color-ink));\n }\n .sds-rte-content hr {\n border: 0;\n border-top: 1px solid var(--color-border);\n margin: 1em 0;\n }\n .sds-rte-content hr.ProseMirror-selectednode {\n outline: 2px solid var(--color-brand-500, var(--color-accent-blue));\n outline-offset: 2px;\n }\n .sds-rte-content p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n color: var(--color-ink-faint);\n float: left;\n height: 0;\n pointer-events: none;\n }\n .sds-rte-content[contenteditable='false'] {\n cursor: default;\n }\n `,\n})\nexport class SdsRichTextEditor implements ControlValueAccessor {\n readonly fieldId = `sds-rte-${nextId++}`;\n\n readonly label = input<string>('');\n /** Accessible name used when no visible [label] is provided. */\n readonly ariaLabel = input<string>('');\n /** Shown in the empty document. */\n readonly placeholder = input<string>('');\n readonly hint = input<string>('');\n readonly error = input<string>('');\n /** Mark the field invalid (danger frame + `aria-invalid`) without showing an [error] message. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /**\n * Language of the content (`lang` on the editable document), so the browser spell-checks it in the right\n * language — e.g. `'de'` for the German version of a translated text.\n */\n readonly contentLanguage = input<string>('');\n /** Asterisk after the [label] (hidden from screen readers) + `aria-required`. It does not validate. */\n readonly required = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Shows the content without the toolbar; it can be selected and copied but not changed. */\n readonly readonly = input(false, { transform: booleanAttribute });\n /**\n * The toolbar, in display order (groups are fixed: block, text, lists, insert, clear, history) — and the\n * content the document may hold. Defaults to {@link SDS_RICH_TEXT_DEFAULT_TOOLS}. Set once: changing it\n * rebuilds the editor (the content is kept, minus what the new tools no longer allow).\n */\n readonly tools = input<readonly SdsRichTextTool[]>(SDS_RICH_TEXT_DEFAULT_TOOLS);\n /** Minimum visible lines of the editing area. */\n readonly rows = input(6, { transform: numberAttribute });\n /** Lines after which the area scrolls instead of growing; 0 (default) grows with the content. */\n readonly maxRows = input(0, { transform: numberAttribute });\n /** Cap on the plain-text length (markup is not counted); 0 means no limit. Typing stops at the cap. */\n readonly maxLength = input(0, { transform: numberAttribute });\n /** Show the character counter (always shown with a [maxLength]). */\n readonly showCount = input(false, { transform: booleanAttribute });\n /** `filled`: a borderless field on a muted ground, like `sds-textarea`'s. */\n readonly appearance = input<SdsRichTextAppearance>('default');\n /** Per-instance strings (merged over {@link SDS_RICH_TEXT_LABELS} and the English defaults). */\n readonly labels = input<Partial<SdsRichTextLabels>>({});\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appLabels = inject(SDS_RICH_TEXT_LABELS);\n private readonly contentHost = viewChild.required<ElementRef<HTMLDivElement>>('content');\n private readonly linkInput = viewChild<ElementRef<HTMLInputElement>>('linkInput');\n private readonly toolButtons = viewChildren<ElementRef<HTMLButtonElement>>('toolButton');\n protected readonly toolbarEnd = contentChild(SdsRichTextToolbarEnd);\n\n private editor: Editor | null = null;\n /** The HTML last written to or emitted by the control — '' for an empty document. */\n private html = '';\n private builtTools = '';\n private readonly ready = signal(false);\n private readonly cvaDisabled = signal(false);\n\n /** Formatting active at the selection, per tool (refreshed on every transaction). */\n private readonly activeTools = signal<ReadonlySet<SdsRichTextTool>>(new Set());\n private readonly history = signal({ undo: false, redo: false });\n protected readonly characters = signal(0);\n protected readonly rovingTool = signal<SdsRichTextTool | null>(null);\n protected readonly linkOpen = signal(false);\n protected readonly linkDraft = signal('');\n protected readonly linkError = signal(false);\n\n protected readonly l = computed<SdsRichTextLabels>(() => ({\n ...SDS_RICH_TEXT_LABELS_EN,\n ...this.appLabels,\n ...this.labels(),\n }));\n\n protected readonly isDisabled = computed(() => this.disabled() || this.cvaDisabled());\n /** The document can be changed (and the toolbar used). */\n protected readonly interactive = computed(() => !this.isDisabled() && !this.readonly());\n protected readonly showToolbar = computed(() => !this.readonly() && this.groups().length > 0);\n\n private readonly toolSet = computed(() => new Set(this.tools()));\n\n protected readonly groups = computed(() => {\n const enabled = this.toolSet();\n const byGroup = new Map<number, ToolDef[]>();\n for (const def of TOOL_DEFS) {\n if (enabled.has(def.tool)) {\n byGroup.set(def.group, [...(byGroup.get(def.group) ?? []), def]);\n }\n }\n return [...byGroup.entries()].sort(([a], [b]) => a - b).map(([, defs]) => defs);\n });\n\n protected readonly hasCounter = computed(() => this.showCount() || this.maxLength() > 0);\n protected readonly atLimit = computed(\n () => this.maxLength() > 0 && this.characters() >= this.maxLength(),\n );\n protected readonly countLabel = computed(() =>\n (this.maxLength() ? this.l().countLimit : this.l().count)\n .replace('{count}', String(this.characters()))\n .replace('{max}', String(this.maxLength())),\n );\n\n protected readonly maxHeight = computed(() =>\n this.maxRows() > 0 ? `calc(${this.maxRows() * LINE_EM}em + 1.25rem)` : null,\n );\n\n private readonly danger = computed(() => !!this.error() || this.invalid());\n\n protected readonly frameClasses = computed(() => {\n const parts = [FRAME_BASE];\n if (this.appearance() === 'filled') {\n parts.push('bg-muted');\n parts.push(\n this.danger()\n ? 'border-danger focus-within:ring-2 focus-within:ring-danger/30'\n : 'border-transparent focus-within:ring-2 focus-within:ring-brand-500/25',\n );\n } else {\n parts.push('bg-surface');\n parts.push(\n this.danger()\n ? 'border-danger focus-within:border-danger focus-within:ring-2 focus-within:ring-danger/25'\n : 'border-border focus-within:border-brand-500 focus-within:ring-2 focus-within:ring-brand-500/25',\n );\n }\n if (this.isDisabled()) {\n parts.push('opacity-60 cursor-not-allowed');\n }\n return parts.join(' ');\n });\n\n private readonly describedBy = computed(() => {\n const ids: string[] = [];\n if (this.error()) ids.push(`${this.fieldId}-err`);\n else if (this.hint()) ids.push(`${this.fieldId}-hint`);\n if (this.hasCounter()) ids.push(`${this.fieldId}-count`);\n return ids.join(' ');\n });\n\n /** Attributes of the contenteditable document (ProseMirror's own element). */\n private readonly documentAttributes = computed<Record<string, string>>(() => {\n const attrs: Record<string, string> = {\n id: this.fieldId,\n class: 'sds-rte-content',\n role: 'textbox',\n 'aria-multiline': 'true',\n style: `min-height: calc(${Math.max(1, this.rows()) * LINE_EM}em + 1.25rem)`,\n };\n if (this.label()) attrs['aria-labelledby'] = `${this.fieldId}-label`;\n else if (this.ariaLabel()) attrs['aria-label'] = this.ariaLabel();\n if (this.describedBy()) attrs['aria-describedby'] = this.describedBy();\n if (this.danger()) attrs['aria-invalid'] = 'true';\n if (this.contentLanguage()) attrs['lang'] = this.contentLanguage();\n if (this.required()) attrs['aria-required'] = 'true';\n if (this.readonly()) attrs['aria-readonly'] = 'true';\n if (this.isDisabled()) attrs['aria-disabled'] = 'true';\n return attrs;\n });\n\n private readonly isApple =\n typeof navigator !== 'undefined' &&\n /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);\n\n constructor() {\n // The editor needs the DOM: create it after the first render, in the browser only (SSR-safe).\n afterNextRender(() => this.build());\n\n effect(() => {\n const props = this.editorProps(this.documentAttributes());\n if (this.ready()) {\n untracked(() => this.editor?.setOptions({ editorProps: props }));\n }\n });\n effect(() => {\n const editable = this.interactive();\n if (this.ready()) {\n untracked(() => {\n this.editor?.setEditable(editable, false);\n if (!editable) this.linkOpen.set(false);\n });\n }\n });\n // A new tool set (or a new length cap) changes the schema: rebuild, keeping the content.\n effect(() => {\n const key = JSON.stringify([this.tools(), this.maxLength()]);\n if (this.ready() && key !== this.builtTools) {\n untracked(() => this.build());\n }\n });\n effect(() => {\n // Keep one toolbar button tabbable: the first enabled one unless the user moved.\n const first = this.groups()[0]?.[0]?.tool ?? null;\n const current = untracked(this.rovingTool);\n if (!current || !this.toolSet().has(current)) this.rovingTool.set(first);\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.editor?.destroy();\n this.editor = null;\n });\n }\n\n /** Move the caret into the document. */\n focus(): void {\n this.editor?.commands.focus();\n }\n\n /**\n * Insert plain text at the caret (replacing the selection) — for an \"insert variable\" button in the\n * {@link SdsRichTextToolbarEnd} slot, say. The text is inserted as text, never parsed as HTML. No-op while\n * disabled or read-only.\n */\n insertText(text: string): void {\n if (!this.editor || !this.interactive() || !text) return;\n this.editor.chain().focus().insertContent({ type: 'text', text }).run();\n }\n\n // --- ControlValueAccessor -------------------------------------------------\n private onChange: (value: string) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(value: string | null): void {\n this.html = value ?? '';\n const editor = this.editor;\n if (editor && this.currentHtml(editor) !== this.html) {\n // A value written by the form is the starting point, not an edit: keep it out of the undo history,\n // or ⌘Z right after loading would empty the document.\n editor\n .chain()\n .setMeta('addToHistory', false)\n .setContent(this.html, { emitUpdate: false })\n .run();\n this.refresh(editor);\n }\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n\n // --- toolbar ----------------------------------------------------------------\n\n protected isOn(tool: SdsRichTextTool): boolean {\n return this.activeTools().has(tool);\n }\n\n protected canRun(tool: SdsRichTextTool): boolean {\n if (tool === 'undo') return this.history().undo;\n if (tool === 'redo') return this.history().redo;\n return true;\n }\n\n protected buttonClass(def: ToolDef): string {\n return def.toggle && this.isOn(def.tool) ? `${TOOL_BUTTON} ${TOOL_BUTTON_ON}` : TOOL_BUTTON;\n }\n\n protected tooltip(def: ToolDef): string {\n const name = this.l()[def.tool];\n if (!def.shortcut) return name;\n const keys = def.shortcut\n .split('-')\n .map((k) =>\n k === 'Mod'\n ? this.isApple\n ? '⌘'\n : 'Ctrl'\n : k === 'Alt'\n ? this.isApple\n ? '⌥'\n : 'Alt'\n : k === 'Shift'\n ? this.isApple\n ? '⇧'\n : 'Shift'\n : k,\n );\n return `${name} (${keys.join(this.isApple ? '' : '+')})`;\n }\n\n protected run(tool: SdsRichTextTool): void {\n const editor = this.editor;\n if (!editor || !this.interactive()) return;\n const chain = editor.chain().focus();\n switch (tool) {\n case 'paragraph':\n chain.setParagraph().run();\n break;\n case 'heading2':\n chain.toggleHeading({ level: 2 }).run();\n break;\n case 'heading3':\n chain.toggleHeading({ level: 3 }).run();\n break;\n case 'bold':\n chain.toggleBold().run();\n break;\n case 'italic':\n chain.toggleItalic().run();\n break;\n case 'underline':\n chain.toggleUnderline().run();\n break;\n case 'strike':\n chain.toggleStrike().run();\n break;\n case 'bulletList':\n chain.toggleBulletList().run();\n break;\n case 'orderedList':\n chain.toggleOrderedList().run();\n break;\n case 'blockquote':\n chain.toggleBlockquote().run();\n break;\n case 'horizontalRule':\n chain.setHorizontalRule().run();\n break;\n case 'clearFormatting':\n chain.unsetAllMarks().clearNodes().run();\n break;\n case 'undo':\n chain.undo().run();\n break;\n case 'redo':\n chain.redo().run();\n break;\n case 'link':\n this.openLink();\n break;\n }\n }\n\n /** Roving focus inside the toolbar: one Tab stop, arrows / Home / End move between the buttons. */\n protected onToolbarKeydown(event: KeyboardEvent): void {\n const buttons = this.toolButtons()\n .map((b) => b.nativeElement)\n .filter((b) => !b.disabled);\n const index = buttons.indexOf(document.activeElement as HTMLButtonElement);\n if (index < 0) return;\n let next = -1;\n if (event.key === 'ArrowRight') next = (index + 1) % buttons.length;\n else if (event.key === 'ArrowLeft') next = (index - 1 + buttons.length) % buttons.length;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = buttons.length - 1;\n if (next >= 0) {\n event.preventDefault();\n buttons[next].focus();\n }\n }\n\n /** A click in the blank area under the last line still places the caret (at the end). */\n protected onAreaClick(event: MouseEvent): void {\n const editor = this.editor;\n if (editor && this.interactive() && event.target === this.contentHost().nativeElement) {\n editor.commands.focus('end');\n }\n }\n\n // --- link -------------------------------------------------------------------\n\n protected openLink(): void {\n const editor = this.editor;\n if (!editor || !this.interactive() || !this.toolSet().has('link')) return;\n this.linkDraft.set((editor.getAttributes('link')['href'] as string | undefined) ?? '');\n this.linkError.set(false);\n this.linkOpen.set(true);\n // Render the field and move focus into it NOW: deferring to the next render lets keystrokes typed\n // right after ⌘K land in the document and replace the selection.\n this.cdr.detectChanges();\n this.linkInput()?.nativeElement.focus();\n }\n\n protected onLinkInput(event: Event): void {\n this.linkDraft.set((event.target as HTMLInputElement).value);\n this.linkError.set(false);\n }\n\n protected onLinkKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter') {\n // Never let Enter submit a surrounding form.\n event.preventDefault();\n this.applyLink();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n this.closeLink(true);\n }\n }\n\n protected applyLink(): void {\n const editor = this.editor;\n if (!editor) return;\n const href = sdsSafeHref(this.linkDraft());\n if (!href) {\n this.linkError.set(true);\n this.linkInput()?.nativeElement.focus();\n return;\n }\n if (editor.state.selection.empty && !editor.isActive('link')) {\n // Nothing selected: insert the address itself as the link text.\n const text = href.replace(/^mailto:/i, '').replace(/^tel:/i, '');\n editor\n .chain()\n .focus()\n .insertContent({ type: 'text', text, marks: [{ type: 'link', attrs: { href } }] })\n .run();\n } else {\n editor.chain().focus().extendMarkRange('link').setLink({ href }).run();\n }\n this.linkOpen.set(false);\n }\n\n protected removeLink(): void {\n this.editor?.chain().focus().extendMarkRange('link').unsetLink().run();\n this.linkOpen.set(false);\n }\n\n protected closeLink(refocus: boolean): void {\n this.linkOpen.set(false);\n if (refocus) this.editor?.commands.focus();\n }\n\n // --- editor -----------------------------------------------------------------\n\n private build(): void {\n const element = this.contentHost().nativeElement;\n const content = this.editor ? this.currentHtml(this.editor) : this.html;\n this.editor?.destroy();\n element.replaceChildren();\n this.builtTools = JSON.stringify([this.tools(), this.maxLength()]);\n\n const editor = new Editor({\n element,\n extensions: this.extensions(),\n content,\n editable: this.interactive(),\n editorProps: this.editorProps(this.documentAttributes()),\n onUpdate: ({ editor }) => this.emit(editor),\n onTransaction: ({ editor }) => this.refresh(editor),\n onBlur: ({ event }) => {\n const next = event.relatedTarget as Node | null;\n if (!next || !this.host.nativeElement.contains(next)) this.onTouched();\n },\n });\n this.editor = editor;\n this.refresh(editor);\n this.ready.set(true);\n }\n\n private extensions(): Extensions {\n const tools = this.toolSet();\n const on = (tool: SdsRichTextTool) => (tools.has(tool) ? {} : false);\n const levels = ([2, 3] as const).filter((level) => tools.has(`heading${level}`));\n const lists = tools.has('bulletList') || tools.has('orderedList');\n return [\n StarterKit.configure({\n heading: levels.length ? { levels: [...levels] } : false,\n bold: on('bold'),\n italic: on('italic'),\n underline: on('underline'),\n strike: on('strike'),\n bulletList: on('bulletList'),\n orderedList: on('orderedList'),\n listItem: lists ? {} : false,\n listKeymap: lists ? {} : false,\n blockquote: on('blockquote'),\n horizontalRule: on('horizontalRule'),\n code: false,\n codeBlock: false,\n link: tools.has('link')\n ? {\n openOnClick: false,\n autolink: true,\n linkOnPaste: true,\n defaultProtocol: 'https',\n isAllowedUri: (url) => sdsSafeHref(url) === url.trim(),\n HTMLAttributes: { target: '_blank', rel: 'noopener noreferrer nofollow' },\n }\n : false,\n }),\n Placeholder.configure({ placeholder: () => this.placeholder() }),\n CharacterCount.configure({ limit: this.maxLength() > 0 ? this.maxLength() : null }),\n ];\n }\n\n private editorProps(attributes: Record<string, string>): EditorOptions['editorProps'] {\n return {\n attributes,\n handleKeyDown: (_view, event) => this.onDocumentKeydown(event),\n };\n }\n\n /**\n * ⌘/Ctrl+K opens the link field. The editor owns the shortcut while it has focus: the event is stopped\n * so an app-wide ⌘K (a command palette such as `sds-search-command`) does not open on top of it.\n */\n private onDocumentKeydown(event: KeyboardEvent): boolean {\n const modK =\n (event.metaKey || event.ctrlKey) &&\n !event.altKey &&\n !event.shiftKey &&\n event.key.toLowerCase() === 'k';\n if (!modK || !this.toolSet().has('link')) return false;\n event.preventDefault();\n event.stopPropagation();\n this.openLink();\n return true;\n }\n\n /**\n * The control's value for the editor's document: '' when it is empty, and without the empty paragraphs\n * the editor keeps after a final list / quote / divider so the caret can leave it (Tiptap's trailing node).\n */\n private currentHtml(editor: Editor): string {\n return editor.isEmpty ? '' : editor.getHTML().replace(/(?:<p><\\/p>)+$/, '');\n }\n\n private emit(editor: Editor): void {\n const html = this.currentHtml(editor);\n if (html !== this.html) {\n this.html = html;\n this.onChange(html);\n }\n }\n\n private refresh(editor: Editor): void {\n const active = new Set<SdsRichTextTool>();\n const check = (tool: SdsRichTextTool, name: string, attrs?: Record<string, unknown>) => {\n if (this.toolSet().has(tool) && editor.isActive(name, attrs)) active.add(tool);\n };\n check('heading2', 'heading', { level: 2 });\n check('heading3', 'heading', { level: 3 });\n check('paragraph', 'paragraph');\n check('bold', 'bold');\n check('italic', 'italic');\n check('underline', 'underline');\n check('strike', 'strike');\n check('bulletList', 'bulletList');\n check('orderedList', 'orderedList');\n check('blockquote', 'blockquote');\n check('link', 'link');\n this.activeTools.set(active);\n this.history.set({ undo: editor.can().undo(), redo: editor.can().redo() });\n this.characters.set(editor.storage.characterCount.characters());\n }\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n ElementRef,\n forwardRef,\n inject,\n input,\n numberAttribute,\n signal,\n viewChildren,\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { SdsLocalizedValue } from '@besaitech/ng-design-system';\nimport {\n SDS_RICH_TEXT_DEFAULT_TOOLS,\n SdsRichTextAppearance,\n SdsRichTextLabels,\n SdsRichTextTool,\n} from './rich-text-types';\nimport { SdsRichTextEditor, SdsRichTextToolbarEnd } from './sds-rich-text-editor';\n\nlet nextId = 0;\n\nconst TAB_BASE =\n 'flex items-center gap-1 rounded px-1.5 py-1 text-[11px] font-semibold uppercase leading-none transition-colors ' +\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 ' +\n 'disabled:cursor-not-allowed disabled:opacity-50';\nconst TAB_ON =\n 'bg-brand-50 text-brand-700 ' +\n 'dark:bg-[color:var(--sds-dark-tint,rgb(255_255_255/0.12))] ' +\n 'dark:text-[color:var(--sds-dark-on-tint,var(--color-ink))]';\nconst TAB_OFF = 'text-ink-faint hover:bg-muted hover:text-ink-soft';\n\n/**\n * The translatable twin of {@link SdsRichTextEditor}: one rich-text field over a {@link SdsLocalizedValue} —\n * `{ fr: '<p>…</p>', de: '<p>…</p>', en: … }` — for content stored per language (course pages, homework\n * instructions, articles). It works like `sds-localized-input`: one language is edited at a time, a compact\n * switcher at the end of the toolbar flips the language, and a dot marks the languages that already have\n * content (green), a required one that is still empty (danger) or a missing translation (faint). Empty\n * translations are pruned from the emitted value, so an untouched language never appears in the map.\n *\n * Each language has its own editor underneath, kept alive while hidden: undo / redo, the caret and the\n * scroll position stay per language, and undoing after a switch can never bring another language's text\n * back. The document carries its `lang`, so the browser spell-checks each translation in its language.\n *\n * The active language defaults to {@link currentLanguage} when it is one of {@link languages}, otherwise the\n * first accepted language. Everything else — `[tools]` (the schema), safe links, `rows` / `maxRows`,\n * `maxLength` (per language), labels — behaves as in {@link SdsRichTextEditor}.\n *\n * Implements ControlValueAccessor over the map — use with reactive forms or `[(ngModel)]`:\n * `<sds-localized-rich-text-editor [languages]=\"['fr','de','en']\" formControlName=\"description\" />`.\n * Import from `@besaitech/ng-design-system/rich-text`.\n */\n@Component({\n selector: 'sds-localized-rich-text-editor',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, SdsRichTextEditor, SdsRichTextToolbarEnd],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SdsLocalizedRichTextEditor),\n multi: true,\n },\n ],\n host: {\n class: 'block',\n '(focusout)': 'onFocusOut($event)',\n },\n template: `\n @if (label()) {\n <label\n [id]=\"baseId + '-label'\"\n class=\"mb-1.5 block text-sm font-medium text-ink\"\n (click)=\"focus()\"\n >{{ label() }}\n @if (required()) {\n <span class=\"ml-0.5 text-danger\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n @for (lang of languages(); track lang) {\n <sds-rich-text-editor\n [style.display]=\"lang === activeLang() ? null : 'none'\"\n [attr.data-active-language]=\"lang === activeLang() ? '' : null\"\n [ariaLabel]=\"editorName(lang)\"\n [contentLanguage]=\"lang\"\n [placeholder]=\"placeholderFor(lang)\"\n [hint]=\"hint()\"\n [error]=\"error()\"\n [invalid]=\"invalid()\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [tools]=\"tools()\"\n [rows]=\"rows()\"\n [maxRows]=\"maxRows()\"\n [maxLength]=\"maxLength()\"\n [showCount]=\"showCount()\"\n [appearance]=\"appearance()\"\n [labels]=\"labels()\"\n [ngModel]=\"valueMap()[lang] ?? ''\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"write(lang, $event)\"\n >\n @if (languages().length > 1) {\n <div\n sdsRichTextToolbarEnd\n role=\"tablist\"\n class=\"flex items-center gap-0.5\"\n [attr.aria-label]=\"languageSwitcherLabel()\"\n (keydown)=\"onTabsKeydown($event)\"\n >\n @for (code of languages(); track code) {\n <button\n type=\"button\"\n role=\"tab\"\n [attr.data-lang]=\"code\"\n [attr.aria-selected]=\"code === activeLang() ? 'true' : 'false'\"\n [attr.tabindex]=\"code === activeLang() ? 0 : -1\"\n [attr.title]=\"tabTitle(code)\"\n [disabled]=\"isDisabled()\"\n [class]=\"tabClass(code)\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"select(code, 'editor')\"\n >\n {{ code }}\n <span class=\"inline-block h-1.5 w-1.5 rounded-full\" [class]=\"dotClass(code)\"></span>\n </button>\n }\n </div>\n }\n </sds-rich-text-editor>\n }\n `,\n})\nexport class SdsLocalizedRichTextEditor implements ControlValueAccessor {\n protected readonly baseId = `sds-lrte-${nextId++}`;\n\n readonly label = input<string>('');\n /** Accessible name when there is no visible {@link label}; each language's editor adds its code. */\n readonly ariaLabel = input<string>('');\n readonly placeholder = input<string>('');\n readonly hint = input<string>('');\n /** Error message under the field (danger frame + `aria-invalid`); replaces the hint. */\n readonly error = input<string>('');\n /** Mark the field invalid (danger frame + `aria-invalid`) without showing an [error] message. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /** An asterisk after the [label] and `aria-required`. It does not validate — keep your own validator. */\n readonly required = input(false, { transform: booleanAttribute });\n /**\n * Languages that must be filled (e.g. the site's main language): while empty, their switcher dot shows in the\n * danger colour and its title says {@link requiredLanguageLabel}. Display only — validate in the form.\n */\n readonly requiredLanguages = input<string[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Every translation can be read (the switcher still works) but none changed; the toolbar is hidden. */\n readonly readonly = input(false, { transform: booleanAttribute });\n\n /** The accepted language codes, in display order (e.g. `['fr','de','en']`). */\n readonly languages = input<string[]>([]);\n /** Language to open on; used when it is one of {@link languages}, else the first accepted language. */\n readonly currentLanguage = input<string | null>(null);\n\n /** The toolbar and the schema, as on {@link SdsRichTextEditor}. */\n readonly tools = input<readonly SdsRichTextTool[]>(SDS_RICH_TEXT_DEFAULT_TOOLS);\n readonly rows = input(6, { transform: numberAttribute });\n readonly maxRows = input(0, { transform: numberAttribute });\n /** Cap on each language's plain-text length; 0 means no limit. */\n readonly maxLength = input(0, { transform: numberAttribute });\n /** Show the character counter of the language being edited (always shown with a [maxLength]). */\n readonly showCount = input(false, { transform: booleanAttribute });\n readonly appearance = input<SdsRichTextAppearance>('default');\n /** Editor strings, as on {@link SdsRichTextEditor}. */\n readonly labels = input<Partial<SdsRichTextLabels>>({});\n\n /**\n * Accessible name of the language switcher, and the title suffixes of an empty language. English defaults;\n * translate them in a multi-language app (the tabs show only the language code).\n */\n readonly languageSwitcherLabel = input<string>('Language');\n readonly untranslatedLabel = input<string>('not translated yet');\n /** Title suffix of a required language that is still empty (see {@link requiredLanguages}). */\n readonly requiredLanguageLabel = input<string>('required');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly editors = viewChildren(SdsRichTextEditor);\n\n protected readonly valueMap = signal<SdsLocalizedValue>({});\n /** Language chosen with the switcher; null means \"follow currentLanguage / the first language\". */\n private readonly manual = signal<string | null>(null);\n private readonly cvaDisabled = signal(false);\n\n protected readonly isDisabled = computed(() => this.disabled() || this.cvaDisabled());\n\n /** The language being edited. */\n protected readonly activeLang = computed(() => {\n const langs = this.languages();\n if (!langs.length) return '';\n const manual = this.manual();\n if (manual && langs.includes(manual)) return manual;\n const preferred = this.currentLanguage();\n return preferred && langs.includes(preferred) ? preferred : langs[0];\n });\n\n /** Move the caret into the active language's document. */\n focus(): void {\n this.editorFor(this.activeLang())?.focus();\n }\n\n protected filled(lang: string): boolean {\n const html = this.valueMap()[lang];\n return !!html && html.trim().length > 0;\n }\n\n /** A required language (see {@link requiredLanguages}) that is still empty. */\n protected mustFill(lang: string): boolean {\n return this.requiredLanguages().includes(lang) && !this.filled(lang);\n }\n\n protected editorName(lang: string): string {\n const name = this.label() || this.ariaLabel();\n return name ? `${name} (${lang.toUpperCase()})` : lang.toUpperCase();\n }\n\n protected placeholderFor(lang: string): string {\n const base = this.placeholder();\n return base ? `${base} (${lang.toUpperCase()})` : '';\n }\n\n protected tabTitle(lang: string): string {\n const code = lang.toUpperCase();\n if (this.filled(lang)) return code;\n return `${code} — ${this.mustFill(lang) ? this.requiredLanguageLabel() : this.untranslatedLabel()}`;\n }\n\n protected tabClass(lang: string): string {\n return `${TAB_BASE} ${lang === this.activeLang() ? TAB_ON : TAB_OFF}`;\n }\n\n protected dotClass(lang: string): string {\n return this.filled(lang) ? 'bg-success' : this.mustFill(lang) ? 'bg-danger' : 'bg-current/30';\n }\n\n /**\n * Switch language. From a click, the caret goes into the new language's document (ready to type); from the\n * arrow keys, focus follows to the new language's tab. Rendered at once so focus never lands on the\n * editor that was just hidden.\n */\n protected select(lang: string, focusTarget: 'editor' | 'tab'): void {\n if (lang === this.activeLang()) {\n if (focusTarget === 'editor') this.focus();\n return;\n }\n this.manual.set(lang);\n // Switching language counts as touching the field, as in sds-localized-input.\n this.onTouched();\n this.cdr.detectChanges();\n if (focusTarget === 'editor') {\n this.editorFor(lang)?.focus();\n } else {\n this.host.nativeElement\n .querySelector<HTMLButtonElement>(\n `sds-rich-text-editor[data-active-language] [role=\"tab\"][data-lang=\"${CSS.escape(lang)}\"]`,\n )\n ?.focus();\n }\n }\n\n /** The switcher is one Tab stop; arrows / Home / End change the language (automatic activation). */\n protected onTabsKeydown(event: KeyboardEvent): void {\n const langs = this.languages();\n const index = langs.indexOf(this.activeLang());\n let next = -1;\n if (event.key === 'ArrowRight') next = (index + 1) % langs.length;\n else if (event.key === 'ArrowLeft') next = (index - 1 + langs.length) % langs.length;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = langs.length - 1;\n if (next >= 0 && !this.isDisabled()) {\n event.preventDefault();\n event.stopPropagation();\n this.select(langs[next], 'tab');\n }\n }\n\n protected write(lang: string, html: string): void {\n const current = this.valueMap()[lang] ?? '';\n if ((html ?? '') === current) return;\n const next: SdsLocalizedValue = { ...this.valueMap() };\n if (html) {\n next[lang] = html;\n } else {\n delete next[lang];\n }\n this.valueMap.set(next);\n this.onChange(next);\n }\n\n /** Touched once focus leaves the whole field (moving between toolbar, link field and document is not leaving). */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (!next || !this.host.nativeElement.contains(next)) this.onTouched();\n }\n\n private editorFor(lang: string): SdsRichTextEditor | undefined {\n return this.editors()[this.languages().indexOf(lang)];\n }\n\n // --- ControlValueAccessor -------------------------------------------------\n private onChange: (value: SdsLocalizedValue) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(value: SdsLocalizedValue | null): void {\n this.valueMap.set(value ? { ...value } : {});\n }\n registerOnChange(fn: (value: SdsLocalizedValue) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n}\n","/*\n * Secondary entry point `@besaitech/ng-design-system/rich-text` — the Tiptap (ProseMirror) powered\n * rich-text editor.\n *\n * Kept out of the root entry for the same reason as the charts: the root is one module, so anything it\n * exports that an app uses anywhere lands in the app's initial chunk. Importing the editor from here lets\n * the bundler keep it, and ProseMirror, in the lazy chunk of the page that edits rich text.\n */\nexport * from './rich-text-types';\nexport * from './sds-rich-text-editor';\nexport * from './sds-localized-rich-text-editor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["nextId"],"mappings":";;;;;;;;;AAoBA;AACO,MAAM,2BAA2B,GAA+B;IACrE,UAAU;IACV,UAAU;IACV,MAAM;IACN,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,MAAM;IACN,iBAAiB;IACjB,MAAM;IACN,MAAM;;AAsCD,MAAM,uBAAuB,GAAsB;AACxD,IAAA,OAAO,EAAE,YAAY;AACrB,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,QAAQ,EAAE,YAAY;AACtB,IAAA,IAAI,EAAE,MAAM;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A,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAgFpD,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAnFtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gCAAgC;oBAC1C,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,WAAW,EAAE,iBAAiB,EAAE,qBAAqB,CAAC;AAChE,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,gCAAgC,CAAC;AACzD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,OAAO;AACd,wBAAA,YAAY,EAAE,oBAAoB;AACnC,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkET,EAAA,CAAA;AACF,iBAAA;0uEAoDyC,iBAAiB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC9L3D;;;;;;;AAOG;;ACPH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"besaitech-ng-design-system-rich-text.mjs","sources":["../../../projects/saitech-design-system/rich-text/rich-text-types.ts","../../../projects/saitech-design-system/rich-text/sds-rich-text-editor.ts","../../../projects/saitech-design-system/rich-text/sds-localized-rich-text-editor.ts","../../../projects/saitech-design-system/rich-text/public-api.ts","../../../projects/saitech-design-system/rich-text/besaitech-ng-design-system-rich-text.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** A toolbar action of {@link SdsRichTextEditor}. The tools also decide what the document may contain. */\nexport type SdsRichTextTool =\n | 'paragraph'\n | 'heading2'\n | 'heading3'\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strike'\n | 'bulletList'\n | 'orderedList'\n | 'blockquote'\n | 'link'\n | 'table'\n | 'horizontalRule'\n | 'clearFormatting'\n | 'undo'\n | 'redo';\n\n/** The toolbar shown when `[tools]` is not set. */\nexport const SDS_RICH_TEXT_DEFAULT_TOOLS: readonly SdsRichTextTool[] = [\n 'heading2',\n 'heading3',\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'bulletList',\n 'orderedList',\n 'blockquote',\n 'link',\n 'table',\n 'clearFormatting',\n 'undo',\n 'redo',\n];\n\nexport type SdsRichTextAppearance = 'default' | 'filled';\n\n/** Every string the editor shows or speaks. Translate them in a multi-language app. */\nexport interface SdsRichTextLabels {\n /** Accessible name of the toolbar. */\n toolbar: string;\n paragraph: string;\n heading2: string;\n heading3: string;\n bold: string;\n italic: string;\n underline: string;\n strike: string;\n bulletList: string;\n orderedList: string;\n blockquote: string;\n link: string;\n /** Insert a table (3 × 3, header row). */\n table: string;\n horizontalRule: string;\n clearFormatting: string;\n undo: string;\n redo: string;\n /** Label of the link address field. */\n linkUrl: string;\n linkPlaceholder: string;\n linkApply: string;\n linkRemove: string;\n linkCancel: string;\n /** Shown under the address field when it is not an http(s), mailto, tel, relative or anchor link. */\n linkInvalid: string;\n /** Accessible name of the table bar shown while the caret is in a table. */\n tableTools: string;\n tableAddRow: string;\n tableAddColumn: string;\n tableDeleteRow: string;\n tableDeleteColumn: string;\n /** Toggles the first row between header and data cells. */\n tableHeaderRow: string;\n tableDelete: string;\n /**\n * Warning when the loaded HTML holds elements the enabled tools cannot keep; token `{elements}` (e.g.\n * `<img>, <iframe>`).\n */\n unsupportedContent: string;\n /** Spoken counter with a `[maxLength]`; tokens `{count}` and `{max}`. */\n countLimit: string;\n /** Spoken counter without a limit; token `{count}`. */\n count: string;\n}\n\nexport const SDS_RICH_TEXT_LABELS_EN: SdsRichTextLabels = {\n toolbar: 'Formatting',\n paragraph: 'Normal text',\n heading2: 'Heading',\n heading3: 'Subheading',\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n strike: 'Strikethrough',\n bulletList: 'Bulleted list',\n orderedList: 'Numbered list',\n blockquote: 'Quote',\n link: 'Link',\n table: 'Table',\n horizontalRule: 'Divider',\n clearFormatting: 'Clear formatting',\n undo: 'Undo',\n redo: 'Redo',\n linkUrl: 'Link address',\n linkPlaceholder: 'https://… or e-mail address',\n linkApply: 'Apply',\n linkRemove: 'Remove link',\n linkCancel: 'Cancel',\n linkInvalid: 'Enter a web address (https://…), an e-mail address or a path starting with /.',\n tableTools: 'Table',\n tableAddRow: 'Row below',\n tableAddColumn: 'Column right',\n tableDeleteRow: 'Delete row',\n tableDeleteColumn: 'Delete column',\n tableHeaderRow: 'Header row',\n tableDelete: 'Delete table',\n unsupportedContent:\n 'This text contains elements this editor cannot keep: {elements}. Changing it will remove them.',\n countLimit: '{count} of {max} characters used',\n count: '{count} characters',\n};\n\n/**\n * App-wide label overrides for every {@link SdsRichTextEditor} — provide a (partial) translation once, e.g.\n * `{ provide: SDS_RICH_TEXT_LABELS, useValue: { bold: 'Gras', … } }`. A component's own `[labels]` win over it.\n * For an app that switches language at runtime, bind `[labels]` instead.\n */\nexport const SDS_RICH_TEXT_LABELS = new InjectionToken<Partial<SdsRichTextLabels>>(\n 'SDS_RICH_TEXT_LABELS',\n { factory: () => ({}) },\n);\n\nconst SCHEME = /^([a-z][a-z0-9+-]*):/i;\nconst ALLOWED_SCHEMES = new Set(['http', 'https', 'mailto', 'tel']);\nconst BARE_EMAIL = /^[^\\s@/]+@[^\\s@/]+\\.[^\\s@/]+$/;\nconst BARE_DOMAIN = /^[a-z0-9-]+(\\.[a-z0-9-]+)+(:\\d+)?([/?#].*)?$/i;\n\n/**\n * The link target the editor accepts for `raw`, normalised — or `null` when it is not safe to link to.\n * Accepted: `http(s):`, `mailto:` and `tel:` URLs, site-relative paths (`/formations`) and anchors (`#faq`);\n * a bare domain (`example.ch/page`) gets `https://`, a bare e-mail address gets `mailto:`. Everything else —\n * `javascript:`, `data:`, protocol-relative `//host`, whitespace — is refused. The editor applies the same\n * rule to pasted and loaded HTML, so an unsafe link never survives in its output.\n */\nexport function sdsSafeHref(raw: string | null | undefined): string | null {\n const url = (raw ?? '').trim();\n if (!url || /[\\s\\u0000-\\u001f\\u007f]/.test(url)) {\n return null;\n }\n if (url.startsWith('#')) {\n return url;\n }\n if (url.startsWith('/')) {\n return url.startsWith('//') ? null : url;\n }\n const scheme = SCHEME.exec(url);\n if (scheme) {\n return ALLOWED_SCHEMES.has(scheme[1].toLowerCase()) ? url : null;\n }\n if (BARE_EMAIL.test(url)) {\n return `mailto:${url}`;\n }\n if (BARE_DOMAIN.test(url)) {\n return `https://${url}`;\n }\n return null;\n}\n","import {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n numberAttribute,\n signal,\n untracked,\n viewChild,\n viewChildren,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { SdsButton, SdsIcon, SdsIconName } from '@besaitech/ng-design-system';\nimport { Editor, EditorOptions, Extensions } from '@tiptap/core';\nimport { CharacterCount, Placeholder } from '@tiptap/extensions';\nimport { TableKit } from '@tiptap/extension-table';\nimport StarterKit from '@tiptap/starter-kit';\nimport {\n SDS_RICH_TEXT_DEFAULT_TOOLS,\n SDS_RICH_TEXT_LABELS,\n SDS_RICH_TEXT_LABELS_EN,\n SdsRichTextAppearance,\n SdsRichTextLabels,\n SdsRichTextTool,\n sdsSafeHref,\n} from './rich-text-types';\n\nlet nextId = 0;\n\ninterface ToolDef {\n tool: SdsRichTextTool;\n icon: SdsIconName;\n group: number;\n /** A formatting state the button reflects with `aria-pressed`. */\n toggle: boolean;\n /** Tiptap's keyboard shortcut, shown in the tooltip (`Mod` = ⌘ on Apple, Ctrl elsewhere). */\n shortcut?: string;\n}\n\nconst TOOL_DEFS: readonly ToolDef[] = [\n { tool: 'paragraph', icon: 'pilcrow', group: 0, toggle: true, shortcut: 'Mod-Alt-0' },\n { tool: 'heading2', icon: 'heading-2', group: 0, toggle: true, shortcut: 'Mod-Alt-2' },\n { tool: 'heading3', icon: 'heading-3', group: 0, toggle: true, shortcut: 'Mod-Alt-3' },\n { tool: 'bold', icon: 'bold', group: 1, toggle: true, shortcut: 'Mod-B' },\n { tool: 'italic', icon: 'italic', group: 1, toggle: true, shortcut: 'Mod-I' },\n { tool: 'underline', icon: 'underline', group: 1, toggle: true, shortcut: 'Mod-U' },\n { tool: 'strike', icon: 'strikethrough', group: 1, toggle: true, shortcut: 'Mod-Shift-S' },\n { tool: 'bulletList', icon: 'list', group: 2, toggle: true, shortcut: 'Mod-Shift-8' },\n { tool: 'orderedList', icon: 'list-ordered', group: 2, toggle: true, shortcut: 'Mod-Shift-7' },\n { tool: 'blockquote', icon: 'text-quote', group: 2, toggle: true, shortcut: 'Mod-Shift-B' },\n { tool: 'link', icon: 'link', group: 3, toggle: true, shortcut: 'Mod-K' },\n { tool: 'table', icon: 'table', group: 3, toggle: false },\n { tool: 'horizontalRule', icon: 'minus', group: 3, toggle: false },\n { tool: 'clearFormatting', icon: 'remove-formatting', group: 4, toggle: false },\n { tool: 'undo', icon: 'undo-2', group: 5, toggle: false, shortcut: 'Mod-Z' },\n { tool: 'redo', icon: 'redo-2', group: 5, toggle: false, shortcut: 'Mod-Shift-Z' },\n];\n\ntype TableAction = 'addRow' | 'addColumn' | 'deleteRow' | 'deleteColumn' | 'headerRow' | 'delete';\n\nconst TABLE_ACTIONS: readonly {\n action: TableAction;\n label: keyof SdsRichTextLabels;\n icon: SdsIconName | null;\n}[] = [\n { action: 'addRow', label: 'tableAddRow', icon: 'between-horizontal-end' },\n { action: 'addColumn', label: 'tableAddColumn', icon: 'between-vertical-end' },\n { action: 'deleteRow', label: 'tableDeleteRow', icon: 'minus' },\n { action: 'deleteColumn', label: 'tableDeleteColumn', icon: 'minus' },\n { action: 'headerRow', label: 'tableHeaderRow', icon: null },\n { action: 'delete', label: 'tableDelete', icon: 'grid-2x2-x' },\n];\n\n/**\n * Elements whose CONTENT (not just formatting) is lost when the schema cannot hold them — pictures, embeds,\n * tables, form controls… Loaded HTML holding one of them that the editor drops triggers the warning.\n */\nconst LOSSY_TAGS = new Set([\n 'img',\n 'picture',\n 'figure',\n 'svg',\n 'canvas',\n 'video',\n 'audio',\n 'iframe',\n 'embed',\n 'object',\n 'table',\n 'hr',\n 'form',\n 'input',\n 'select',\n 'textarea',\n 'button',\n 'math',\n]);\n\n/** One line of the editable area, for `[rows]` → min-height. */\nconst LINE_EM = 1.6;\n\nconst FRAME_BASE = 'overflow-hidden rounded-control border text-ink transition-colors';\n\nconst TOOL_BUTTON =\n 'inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ink-soft transition-colors ' +\n 'hover:bg-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 ' +\n 'disabled:pointer-events-none disabled:opacity-40';\n/**\n * Pressed (active) state: the brand tint, like a tertiary button. In dark mode it takes the preset's\n * `--sds-dark-tint` / `--sds-dark-on-tint` and falls back to a neutral white tint (see theme/dark-fills.ts —\n * internal to the root entry, hence the literals here; Tailwind finds them by scanning the bundle).\n */\nconst TOOL_BUTTON_ON =\n 'bg-brand-50 text-brand-700 hover:bg-brand-100 hover:text-brand-700 ' +\n 'dark:bg-[color:var(--sds-dark-tint,rgb(255_255_255/0.12))] ' +\n 'dark:text-[color:var(--sds-dark-on-tint,var(--color-ink))] ' +\n 'dark:hover:bg-[color:var(--sds-dark-tint-hover,rgb(255_255_255/0.16))] ' +\n 'dark:hover:text-[color:var(--sds-dark-on-tint,var(--color-ink))]';\n\n/**\n * Marks content projected at the END of an {@link SdsRichTextEditor}'s toolbar — a language switcher (as in\n * {@link SdsLocalizedRichTextEditor}), an \"insert variable\" menu… It stays visible in `readonly` mode, where\n * the formatting buttons are hidden: `<div sdsRichTextToolbarEnd>…</div>`.\n */\n@Directive({ selector: '[sdsRichTextToolbarEnd]' })\nexport class SdsRichTextToolbarEnd {}\n\n/**\n * A rich-text field — headings, bold / italic / underline / strike, lists, quotes, links, dividers, undo/redo —\n * for content that is stored and shown as HTML (course pages, instructions, articles). Built on Tiptap\n * (ProseMirror), so the HTML it emits is always clean and structured: no inline styles, no `<font>`/`<span>`\n * soup from Word or web pages, nothing outside the enabled tools.\n *\n * **The tools are the schema.** `[tools]` chooses the toolbar AND what the document may contain: drop\n * `heading2`/`heading3` and pasted headings become paragraphs; drop `link` and links are unwrapped. Links\n * only accept http(s), mailto, tel, site-relative paths and anchors ({@link sdsSafeHref}) — `javascript:`\n * and friends are stripped from typed, pasted and loaded HTML alike, and links open in a new tab with\n * `rel=\"noopener noreferrer nofollow\"`. Still sanitise on display, as for any stored HTML.\n *\n * Implements ControlValueAccessor over an HTML string — use with reactive forms or `[(ngModel)]`. An empty\n * document is `''` (not `<p></p>`), so `Validators.required` works. Writing a value never marks the control\n * dirty. Keyboard: the usual shortcuts (⌘/Ctrl+B, I, U, K for a link, ⌘/Ctrl+Alt+2/3 for headings, Markdown\n * shortcuts like `## ` or `- `); the toolbar is one Tab stop, arrows move inside it.\n *\n * Strings are English by default: pass `[labels]` (or provide {@link SDS_RICH_TEXT_LABELS}) in another\n * language. Import from the secondary entry point `@besaitech/ng-design-system/rich-text`.\n */\n@Component({\n selector: 'sds-rich-text-editor',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [SdsIcon, SdsButton],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SdsRichTextEditor),\n multi: true,\n },\n ],\n host: { class: 'block' },\n template: `\n @if (label()) {\n <label\n [id]=\"fieldId + '-label'\"\n class=\"mb-1.5 block text-sm font-medium text-ink\"\n (click)=\"focus()\"\n >{{ label() }}\n @if (required()) {\n <span class=\"ml-0.5 text-danger\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n <div [class]=\"frameClasses()\">\n @if (showToolbar() || toolbarEnd()) {\n <div\n [attr.role]=\"showToolbar() ? 'toolbar' : null\"\n [attr.aria-label]=\"showToolbar() ? l().toolbar : null\"\n [attr.aria-controls]=\"showToolbar() ? fieldId : null\"\n [attr.aria-disabled]=\"showToolbar() && !interactive() ? 'true' : null\"\n class=\"flex flex-wrap items-center gap-0.5 border-b border-border px-1.5 py-1\"\n [class.bg-muted]=\"appearance() === 'default'\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (group of showToolbar() ? groups() : []; track $index; let gi = $index) {\n @if (gi > 0) {\n <span class=\"mx-1 h-5 w-px shrink-0 bg-border\" aria-hidden=\"true\"></span>\n }\n @for (def of group; track def.tool) {\n <button\n #toolButton\n type=\"button\"\n [attr.data-tool]=\"def.tool\"\n [attr.tabindex]=\"def.tool === rovingTool() ? 0 : -1\"\n [attr.aria-pressed]=\"def.toggle ? (isOn(def.tool) ? 'true' : 'false') : null\"\n [attr.aria-label]=\"l()[def.tool]\"\n [attr.title]=\"tooltip(def)\"\n [disabled]=\"!interactive() || !canRun(def.tool)\"\n [class]=\"buttonClass(def)\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"run(def.tool)\"\n (focus)=\"rovingTool.set(def.tool)\"\n >\n <sds-icon [name]=\"def.icon\" [size]=\"16\" />\n </button>\n }\n }\n <div class=\"ml-auto flex shrink-0 items-center pl-1\">\n <ng-content select=\"[sdsRichTextToolbarEnd]\" />\n </div>\n </div>\n }\n\n @if (linkOpen()) {\n <div\n role=\"group\"\n [attr.aria-label]=\"l().link\"\n class=\"flex flex-wrap items-center gap-2 border-b border-border bg-surface px-2 py-2\"\n >\n <label class=\"sr-only\" [for]=\"fieldId + '-url'\">{{ l().linkUrl }}</label>\n <input\n #linkInput\n [id]=\"fieldId + '-url'\"\n type=\"text\"\n inputmode=\"url\"\n autocomplete=\"url\"\n spellcheck=\"false\"\n [value]=\"linkDraft()\"\n [placeholder]=\"l().linkPlaceholder\"\n [attr.aria-invalid]=\"linkError() ? 'true' : null\"\n [attr.aria-describedby]=\"linkError() ? fieldId + '-url-err' : null\"\n class=\"h-8 min-w-0 flex-1 basis-48 rounded-control border bg-surface px-2.5 text-sm text-ink outline-none placeholder:text-ink-faint focus:ring-2\"\n [class]=\"\n linkError()\n ? 'border-danger focus:ring-danger/25'\n : 'border-border focus:border-brand-500 focus:ring-brand-500/25'\n \"\n (input)=\"onLinkInput($event)\"\n (keydown)=\"onLinkKeydown($event)\"\n />\n <sds-button size=\"sm\" (click)=\"applyLink()\">{{ l().linkApply }}</sds-button>\n @if (isOn('link')) {\n <sds-button size=\"sm\" variant=\"ghost\" (click)=\"removeLink()\">\n <sds-icon name=\"unlink\" [size]=\"15\" />\n {{ l().linkRemove }}\n </sds-button>\n }\n <sds-button size=\"sm\" variant=\"ghost\" (click)=\"closeLink(true)\">{{\n l().linkCancel\n }}</sds-button>\n @if (linkError()) {\n <p [id]=\"fieldId + '-url-err'\" class=\"basis-full text-xs font-medium text-danger\">\n {{ l().linkInvalid }}\n </p>\n }\n </div>\n }\n\n @if (isOn('table') && interactive()) {\n <div\n role=\"toolbar\"\n [attr.aria-label]=\"l().tableTools\"\n class=\"flex flex-wrap items-center gap-0.5 border-b border-border bg-surface px-1.5 py-1\"\n >\n @for (t of tableActions; track t.action) {\n <button\n type=\"button\"\n [attr.data-table-action]=\"t.action\"\n [attr.aria-pressed]=\"\n t.action === 'headerRow' ? (headerRow() ? 'true' : 'false') : null\n \"\n [class]=\"tableButtonClass(t.action)\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"runTable(t.action)\"\n >\n @if (t.icon) {\n <sds-icon [name]=\"t.icon\" [size]=\"14\" />\n }\n {{ l()[t.label] }}\n </button>\n }\n </div>\n }\n\n <div\n #content\n class=\"sds-rte\"\n [class.overflow-y-auto]=\"maxRows() > 0\"\n [style.max-height]=\"maxHeight()\"\n (click)=\"onAreaClick($event)\"\n ></div>\n </div>\n\n @if (lostElements().length) {\n <p\n [id]=\"fieldId + '-lost'\"\n class=\"mt-1.5 flex items-start gap-1.5 rounded-control border border-warning/40 bg-warning/10 px-2.5 py-1.5 text-xs text-ink\"\n >\n <sds-icon name=\"triangle-alert\" [size]=\"14\" class=\"mt-px shrink-0 text-warning\" />\n <span>{{ lostLabel() }}</span>\n </p>\n }\n\n @if (hasCounter()) {\n <div class=\"mt-1.5 flex items-start gap-2 text-xs\">\n @if (error()) {\n <p [id]=\"fieldId + '-err'\" class=\"flex-1 font-medium text-danger\">{{ error() }}</p>\n } @else if (hint()) {\n <p [id]=\"fieldId + '-hint'\" class=\"flex-1 text-ink-faint\">{{ hint() }}</p>\n } @else {\n <span class=\"flex-1\"></span>\n }\n <span\n [id]=\"fieldId + '-count'\"\n aria-live=\"polite\"\n [attr.aria-label]=\"countLabel()\"\n class=\"shrink-0 tabular-nums\"\n [class.text-ink-faint]=\"!atLimit()\"\n [class.text-danger]=\"atLimit()\"\n >{{ characters() }}{{ maxLength() ? ' / ' + maxLength() : '' }}</span\n >\n </div>\n } @else if (error()) {\n <p [id]=\"fieldId + '-err'\" class=\"mt-1.5 text-xs font-medium text-danger\">{{ error() }}</p>\n } @else if (hint()) {\n <p [id]=\"fieldId + '-hint'\" class=\"mt-1.5 text-xs text-ink-faint\">{{ hint() }}</p>\n }\n `,\n styles: `\n /*\n * The editable document is created by ProseMirror, outside Angular's templates, so these rules are\n * global (no view encapsulation) and every selector is scoped to the editor's own class. Tailwind's\n * preflight resets lists and headings, hence the explicit typography.\n */\n .sds-rte-content {\n outline: none;\n padding: 0.625rem 0.875rem;\n color: var(--color-ink);\n font-size: 0.875rem;\n line-height: ${LINE_EM};\n overflow-wrap: anywhere;\n white-space: pre-wrap;\n }\n .sds-rte-content > :first-child {\n margin-top: 0;\n }\n .sds-rte-content > :last-child {\n margin-bottom: 0;\n }\n .sds-rte-content p,\n .sds-rte-content ul,\n .sds-rte-content ol,\n .sds-rte-content blockquote {\n margin: 0 0 0.75em;\n }\n .sds-rte-content h2 {\n font-size: 1.25em;\n font-weight: 600;\n line-height: 1.3;\n margin: 1.1em 0 0.5em;\n }\n .sds-rte-content h3 {\n font-size: 1.1em;\n font-weight: 600;\n line-height: 1.35;\n margin: 1em 0 0.4em;\n }\n .sds-rte-content ul {\n list-style: disc;\n padding-left: 1.5em;\n }\n .sds-rte-content ol {\n list-style: decimal;\n padding-left: 1.5em;\n }\n .sds-rte-content li > p {\n margin: 0;\n }\n .sds-rte-content li + li {\n margin-top: 0.25em;\n }\n .sds-rte-content li > ul,\n .sds-rte-content li > ol {\n margin: 0.25em 0 0;\n }\n .sds-rte-content blockquote {\n border-left: 3px solid var(--color-border);\n padding-left: 0.875em;\n color: var(--color-ink-soft);\n }\n .sds-rte-content a {\n color: var(--color-brand-700, var(--color-accent-blue));\n text-decoration: underline;\n text-underline-offset: 2px;\n }\n /* A monochrome preset's dark brand steps are near the surface: links follow the dark tint text. */\n .dark .sds-rte-content a {\n color: var(--sds-dark-on-tint, var(--color-ink));\n }\n .sds-rte {\n overflow-x: auto;\n }\n .sds-rte-content table {\n border-collapse: collapse;\n width: 100%;\n margin: 0 0 0.75em;\n }\n .sds-rte-content th,\n .sds-rte-content td {\n border: 1px solid var(--color-border);\n padding: 0.375em 0.5em;\n vertical-align: top;\n text-align: left;\n min-width: 4em;\n }\n .sds-rte-content th {\n background: var(--color-muted);\n font-weight: 600;\n }\n .sds-rte-content th > p,\n .sds-rte-content td > p {\n margin: 0;\n }\n .sds-rte-content .selectedCell {\n background: color-mix(\n in oklab,\n var(--color-brand-500, var(--color-accent-blue)) 14%,\n transparent\n );\n }\n .sds-rte-content hr {\n border: 0;\n border-top: 1px solid var(--color-border);\n margin: 1em 0;\n }\n .sds-rte-content hr.ProseMirror-selectednode {\n outline: 2px solid var(--color-brand-500, var(--color-accent-blue));\n outline-offset: 2px;\n }\n .sds-rte-content p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n color: var(--color-ink-faint);\n float: left;\n height: 0;\n pointer-events: none;\n }\n .sds-rte-content[contenteditable='false'] {\n cursor: default;\n }\n `,\n})\nexport class SdsRichTextEditor implements ControlValueAccessor {\n readonly fieldId = `sds-rte-${nextId++}`;\n\n readonly label = input<string>('');\n /** Accessible name used when no visible [label] is provided. */\n readonly ariaLabel = input<string>('');\n /** Shown in the empty document. */\n readonly placeholder = input<string>('');\n readonly hint = input<string>('');\n readonly error = input<string>('');\n /** Mark the field invalid (danger frame + `aria-invalid`) without showing an [error] message. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /**\n * Language of the content (`lang` on the editable document), so the browser spell-checks it in the right\n * language — e.g. `'de'` for the German version of a translated text.\n */\n readonly contentLanguage = input<string>('');\n /** Asterisk after the [label] (hidden from screen readers) + `aria-required`. It does not validate. */\n readonly required = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Shows the content without the toolbar; it can be selected and copied but not changed. */\n readonly readonly = input(false, { transform: booleanAttribute });\n /**\n * The toolbar, in display order (groups are fixed: block, text, lists, insert, clear, history) — and the\n * content the document may hold. Defaults to {@link SDS_RICH_TEXT_DEFAULT_TOOLS}. Set once: changing it\n * rebuilds the editor (the content is kept, minus what the new tools no longer allow).\n */\n readonly tools = input<readonly SdsRichTextTool[]>(SDS_RICH_TEXT_DEFAULT_TOOLS);\n /** Minimum visible lines of the editing area. */\n readonly rows = input(6, { transform: numberAttribute });\n /** Lines after which the area scrolls instead of growing; 0 (default) grows with the content. */\n readonly maxRows = input(0, { transform: numberAttribute });\n /** Cap on the plain-text length (markup is not counted); 0 means no limit. Typing stops at the cap. */\n readonly maxLength = input(0, { transform: numberAttribute });\n /** Show the character counter (always shown with a [maxLength]). */\n readonly showCount = input(false, { transform: booleanAttribute });\n /** `filled`: a borderless field on a muted ground, like `sds-textarea`'s. */\n readonly appearance = input<SdsRichTextAppearance>('default');\n /** Per-instance strings (merged over {@link SDS_RICH_TEXT_LABELS} and the English defaults). */\n readonly labels = input<Partial<SdsRichTextLabels>>({});\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appLabels = inject(SDS_RICH_TEXT_LABELS);\n private readonly contentHost = viewChild.required<ElementRef<HTMLDivElement>>('content');\n private readonly linkInput = viewChild<ElementRef<HTMLInputElement>>('linkInput');\n private readonly toolButtons = viewChildren<ElementRef<HTMLButtonElement>>('toolButton');\n protected readonly toolbarEnd = contentChild(SdsRichTextToolbarEnd);\n\n private editor: Editor | null = null;\n /** The HTML last written to or emitted by the control — '' for an empty document. */\n private html = '';\n private builtTools = '';\n private readonly ready = signal(false);\n private readonly cvaDisabled = signal(false);\n\n /** Formatting active at the selection, per tool (refreshed on every transaction). */\n private readonly activeTools = signal<ReadonlySet<SdsRichTextTool>>(new Set());\n private readonly history = signal({ undo: false, redo: false });\n /** The first row of the table holding the caret is a header row. */\n protected readonly headerRow = signal(false);\n /** Elements of the loaded HTML the enabled tools could not keep (see {@link LOSSY_TAGS}). */\n protected readonly lostElements = signal<string[]>([]);\n protected readonly tableActions = TABLE_ACTIONS;\n protected readonly characters = signal(0);\n protected readonly rovingTool = signal<SdsRichTextTool | null>(null);\n protected readonly linkOpen = signal(false);\n protected readonly linkDraft = signal('');\n protected readonly linkError = signal(false);\n\n protected readonly l = computed<SdsRichTextLabels>(() => ({\n ...SDS_RICH_TEXT_LABELS_EN,\n ...this.appLabels,\n ...this.labels(),\n }));\n\n protected readonly isDisabled = computed(() => this.disabled() || this.cvaDisabled());\n /** The document can be changed (and the toolbar used). */\n protected readonly interactive = computed(() => !this.isDisabled() && !this.readonly());\n protected readonly showToolbar = computed(() => !this.readonly() && this.groups().length > 0);\n\n private readonly toolSet = computed(() => new Set(this.tools()));\n\n protected readonly groups = computed(() => {\n const enabled = this.toolSet();\n const byGroup = new Map<number, ToolDef[]>();\n for (const def of TOOL_DEFS) {\n if (enabled.has(def.tool)) {\n byGroup.set(def.group, [...(byGroup.get(def.group) ?? []), def]);\n }\n }\n return [...byGroup.entries()].sort(([a], [b]) => a - b).map(([, defs]) => defs);\n });\n\n protected readonly hasCounter = computed(() => this.showCount() || this.maxLength() > 0);\n protected readonly lostLabel = computed(() =>\n this.l().unsupportedContent.replace(\n '{elements}',\n this.lostElements()\n .map((tag) => `<${tag}>`)\n .join(', '),\n ),\n );\n protected readonly atLimit = computed(\n () => this.maxLength() > 0 && this.characters() >= this.maxLength(),\n );\n protected readonly countLabel = computed(() =>\n (this.maxLength() ? this.l().countLimit : this.l().count)\n .replace('{count}', String(this.characters()))\n .replace('{max}', String(this.maxLength())),\n );\n\n protected readonly maxHeight = computed(() =>\n this.maxRows() > 0 ? `calc(${this.maxRows() * LINE_EM}em + 1.25rem)` : null,\n );\n\n private readonly danger = computed(() => !!this.error() || this.invalid());\n\n protected readonly frameClasses = computed(() => {\n const parts = [FRAME_BASE];\n if (this.appearance() === 'filled') {\n parts.push('bg-muted');\n parts.push(\n this.danger()\n ? 'border-danger focus-within:ring-2 focus-within:ring-danger/30'\n : 'border-transparent focus-within:ring-2 focus-within:ring-brand-500/25',\n );\n } else {\n parts.push('bg-surface');\n parts.push(\n this.danger()\n ? 'border-danger focus-within:border-danger focus-within:ring-2 focus-within:ring-danger/25'\n : 'border-border focus-within:border-brand-500 focus-within:ring-2 focus-within:ring-brand-500/25',\n );\n }\n if (this.isDisabled()) {\n parts.push('opacity-60 cursor-not-allowed');\n }\n return parts.join(' ');\n });\n\n private readonly describedBy = computed(() => {\n const ids: string[] = [];\n if (this.error()) ids.push(`${this.fieldId}-err`);\n else if (this.hint()) ids.push(`${this.fieldId}-hint`);\n if (this.hasCounter()) ids.push(`${this.fieldId}-count`);\n if (this.lostElements().length) ids.push(`${this.fieldId}-lost`);\n return ids.join(' ');\n });\n\n /** Attributes of the contenteditable document (ProseMirror's own element). */\n private readonly documentAttributes = computed<Record<string, string>>(() => {\n const attrs: Record<string, string> = {\n id: this.fieldId,\n class: 'sds-rte-content',\n role: 'textbox',\n 'aria-multiline': 'true',\n style: `min-height: calc(${Math.max(1, this.rows()) * LINE_EM}em + 1.25rem)`,\n };\n if (this.label()) attrs['aria-labelledby'] = `${this.fieldId}-label`;\n else if (this.ariaLabel()) attrs['aria-label'] = this.ariaLabel();\n if (this.describedBy()) attrs['aria-describedby'] = this.describedBy();\n if (this.danger()) attrs['aria-invalid'] = 'true';\n if (this.contentLanguage()) attrs['lang'] = this.contentLanguage();\n if (this.required()) attrs['aria-required'] = 'true';\n if (this.readonly()) attrs['aria-readonly'] = 'true';\n if (this.isDisabled()) attrs['aria-disabled'] = 'true';\n return attrs;\n });\n\n private readonly isApple =\n typeof navigator !== 'undefined' &&\n /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);\n\n constructor() {\n // The editor needs the DOM: create it after the first render, in the browser only (SSR-safe).\n afterNextRender(() => this.build());\n\n effect(() => {\n const props = this.editorProps(this.documentAttributes());\n if (this.ready()) {\n untracked(() => this.editor?.setOptions({ editorProps: props }));\n }\n });\n effect(() => {\n const editable = this.interactive();\n if (this.ready()) {\n untracked(() => {\n this.editor?.setEditable(editable, false);\n if (!editable) this.linkOpen.set(false);\n });\n }\n });\n // A new tool set (or a new length cap) changes the schema: rebuild, keeping the content.\n effect(() => {\n const key = JSON.stringify([this.tools(), this.maxLength()]);\n if (this.ready() && key !== this.builtTools) {\n untracked(() => this.build());\n }\n });\n effect(() => {\n // Keep one toolbar button tabbable: the first enabled one unless the user moved.\n const first = this.groups()[0]?.[0]?.tool ?? null;\n const current = untracked(this.rovingTool);\n if (!current || !this.toolSet().has(current)) this.rovingTool.set(first);\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.editor?.destroy();\n this.editor = null;\n });\n }\n\n /** Move the caret into the document. */\n focus(): void {\n this.editor?.commands.focus();\n }\n\n /**\n * Insert plain text at the caret (replacing the selection) — for an \"insert variable\" button in the\n * {@link SdsRichTextToolbarEnd} slot, say. The text is inserted as text, never parsed as HTML. No-op while\n * disabled or read-only.\n */\n insertText(text: string): void {\n if (!this.editor || !this.interactive() || !text) return;\n this.editor.chain().focus().insertContent({ type: 'text', text }).run();\n }\n\n // --- ControlValueAccessor -------------------------------------------------\n private onChange: (value: string) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(value: string | null): void {\n this.html = value ?? '';\n const editor = this.editor;\n if (editor && this.currentHtml(editor) !== this.html) {\n // A value written by the form is the starting point, not an edit: keep it out of the undo history,\n // or ⌘Z right after loading would empty the document.\n editor\n .chain()\n .setMeta('addToHistory', false)\n .setContent(this.html, { emitUpdate: false })\n .run();\n this.refresh(editor);\n }\n if (editor) this.detectLoss(this.html, editor);\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n\n // --- toolbar ----------------------------------------------------------------\n\n protected isOn(tool: SdsRichTextTool): boolean {\n return this.activeTools().has(tool);\n }\n\n protected canRun(tool: SdsRichTextTool): boolean {\n if (tool === 'undo') return this.history().undo;\n if (tool === 'redo') return this.history().redo;\n // no table inside a table\n if (tool === 'table') return !this.isOn('table');\n return true;\n }\n\n protected buttonClass(def: ToolDef): string {\n return def.toggle && this.isOn(def.tool) ? `${TOOL_BUTTON} ${TOOL_BUTTON_ON}` : TOOL_BUTTON;\n }\n\n protected tooltip(def: ToolDef): string {\n const name = this.l()[def.tool];\n if (!def.shortcut) return name;\n const keys = def.shortcut\n .split('-')\n .map((k) =>\n k === 'Mod'\n ? this.isApple\n ? '⌘'\n : 'Ctrl'\n : k === 'Alt'\n ? this.isApple\n ? '⌥'\n : 'Alt'\n : k === 'Shift'\n ? this.isApple\n ? '⇧'\n : 'Shift'\n : k,\n );\n return `${name} (${keys.join(this.isApple ? '' : '+')})`;\n }\n\n protected run(tool: SdsRichTextTool): void {\n const editor = this.editor;\n if (!editor || !this.interactive()) return;\n const chain = editor.chain().focus();\n switch (tool) {\n case 'paragraph':\n chain.setParagraph().run();\n break;\n case 'heading2':\n chain.toggleHeading({ level: 2 }).run();\n break;\n case 'heading3':\n chain.toggleHeading({ level: 3 }).run();\n break;\n case 'bold':\n chain.toggleBold().run();\n break;\n case 'italic':\n chain.toggleItalic().run();\n break;\n case 'underline':\n chain.toggleUnderline().run();\n break;\n case 'strike':\n chain.toggleStrike().run();\n break;\n case 'bulletList':\n chain.toggleBulletList().run();\n break;\n case 'orderedList':\n chain.toggleOrderedList().run();\n break;\n case 'blockquote':\n chain.toggleBlockquote().run();\n break;\n case 'horizontalRule':\n chain.setHorizontalRule().run();\n break;\n case 'table':\n chain.insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run();\n break;\n case 'clearFormatting':\n chain.unsetAllMarks().clearNodes().run();\n break;\n case 'undo':\n chain.undo().run();\n break;\n case 'redo':\n chain.redo().run();\n break;\n case 'link':\n this.openLink();\n break;\n }\n }\n\n /** Roving focus inside the toolbar: one Tab stop, arrows / Home / End move between the buttons. */\n protected onToolbarKeydown(event: KeyboardEvent): void {\n const buttons = this.toolButtons()\n .map((b) => b.nativeElement)\n .filter((b) => !b.disabled);\n const index = buttons.indexOf(document.activeElement as HTMLButtonElement);\n if (index < 0) return;\n let next = -1;\n if (event.key === 'ArrowRight') next = (index + 1) % buttons.length;\n else if (event.key === 'ArrowLeft') next = (index - 1 + buttons.length) % buttons.length;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = buttons.length - 1;\n if (next >= 0) {\n event.preventDefault();\n buttons[next].focus();\n }\n }\n\n /** A click in the blank area under the last line still places the caret (at the end). */\n protected onAreaClick(event: MouseEvent): void {\n const editor = this.editor;\n if (editor && this.interactive() && event.target === this.contentHost().nativeElement) {\n editor.commands.focus('end');\n }\n }\n\n protected tableButtonClass(action: TableAction): string {\n const base =\n 'inline-flex h-7 items-center gap-1 rounded-md px-2 text-xs font-medium transition-colors ' +\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500';\n if (action === 'headerRow' && this.headerRow()) return `${base} ${TOOL_BUTTON_ON}`;\n if (action === 'delete') return `${base} text-danger hover:bg-danger/10`;\n return `${base} text-ink-soft hover:bg-muted hover:text-ink`;\n }\n\n protected runTable(action: TableAction): void {\n const editor = this.editor;\n if (!editor || !this.interactive()) return;\n const chain = editor.chain().focus();\n switch (action) {\n case 'addRow':\n chain.addRowAfter().run();\n break;\n case 'addColumn':\n chain.addColumnAfter().run();\n break;\n case 'deleteRow':\n chain.deleteRow().run();\n break;\n case 'deleteColumn':\n chain.deleteColumn().run();\n break;\n case 'headerRow':\n chain.toggleHeaderRow().run();\n break;\n case 'delete':\n chain.deleteTable().run();\n break;\n }\n }\n\n // --- link -------------------------------------------------------------------\n\n protected openLink(): void {\n const editor = this.editor;\n if (!editor || !this.interactive() || !this.toolSet().has('link')) return;\n this.linkDraft.set((editor.getAttributes('link')['href'] as string | undefined) ?? '');\n this.linkError.set(false);\n this.linkOpen.set(true);\n // Render the field and move focus into it NOW: deferring to the next render lets keystrokes typed\n // right after ⌘K land in the document and replace the selection.\n this.cdr.detectChanges();\n this.linkInput()?.nativeElement.focus();\n }\n\n protected onLinkInput(event: Event): void {\n this.linkDraft.set((event.target as HTMLInputElement).value);\n this.linkError.set(false);\n }\n\n protected onLinkKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter') {\n // Never let Enter submit a surrounding form.\n event.preventDefault();\n this.applyLink();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n this.closeLink(true);\n }\n }\n\n protected applyLink(): void {\n const editor = this.editor;\n if (!editor) return;\n const href = sdsSafeHref(this.linkDraft());\n if (!href) {\n this.linkError.set(true);\n this.linkInput()?.nativeElement.focus();\n return;\n }\n if (editor.state.selection.empty && !editor.isActive('link')) {\n // Nothing selected: insert the address itself as the link text.\n const text = href.replace(/^mailto:/i, '').replace(/^tel:/i, '');\n editor\n .chain()\n .focus()\n .insertContent({ type: 'text', text, marks: [{ type: 'link', attrs: { href } }] })\n .run();\n } else {\n editor.chain().focus().extendMarkRange('link').setLink({ href }).run();\n }\n this.linkOpen.set(false);\n }\n\n protected removeLink(): void {\n this.editor?.chain().focus().extendMarkRange('link').unsetLink().run();\n this.linkOpen.set(false);\n }\n\n protected closeLink(refocus: boolean): void {\n this.linkOpen.set(false);\n if (refocus) this.editor?.commands.focus();\n }\n\n // --- editor -----------------------------------------------------------------\n\n private build(): void {\n const element = this.contentHost().nativeElement;\n const content = this.editor ? this.currentHtml(this.editor) : this.html;\n this.editor?.destroy();\n element.replaceChildren();\n this.builtTools = JSON.stringify([this.tools(), this.maxLength()]);\n\n const editor = new Editor({\n element,\n extensions: this.extensions(),\n content,\n editable: this.interactive(),\n editorProps: this.editorProps(this.documentAttributes()),\n onUpdate: ({ editor }) => this.emit(editor),\n onTransaction: ({ editor }) => this.refresh(editor),\n onBlur: ({ event }) => {\n const next = event.relatedTarget as Node | null;\n if (!next || !this.host.nativeElement.contains(next)) this.onTouched();\n },\n });\n this.editor = editor;\n this.refresh(editor);\n this.detectLoss(content, editor);\n this.ready.set(true);\n }\n\n private extensions(): Extensions {\n const tools = this.toolSet();\n const on = (tool: SdsRichTextTool) => (tools.has(tool) ? {} : false);\n const levels = ([2, 3] as const).filter((level) => tools.has(`heading${level}`));\n const lists = tools.has('bulletList') || tools.has('orderedList');\n return [\n StarterKit.configure({\n heading: levels.length ? { levels: [...levels] } : false,\n bold: on('bold'),\n italic: on('italic'),\n underline: on('underline'),\n strike: on('strike'),\n bulletList: on('bulletList'),\n orderedList: on('orderedList'),\n listItem: lists ? {} : false,\n listKeymap: lists ? {} : false,\n blockquote: on('blockquote'),\n horizontalRule: on('horizontalRule'),\n code: false,\n codeBlock: false,\n link: tools.has('link')\n ? {\n openOnClick: false,\n autolink: true,\n linkOnPaste: true,\n defaultProtocol: 'https',\n isAllowedUri: (url) => sdsSafeHref(url) === url.trim(),\n HTMLAttributes: { target: '_blank', rel: 'noopener noreferrer nofollow' },\n }\n : false,\n }),\n ...(tools.has('table') ? [TableKit.configure({ table: { resizable: false } })] : []),\n Placeholder.configure({ placeholder: () => this.placeholder() }),\n CharacterCount.configure({ limit: this.maxLength() > 0 ? this.maxLength() : null }),\n ];\n }\n\n private editorProps(attributes: Record<string, string>): EditorOptions['editorProps'] {\n return {\n attributes,\n handleKeyDown: (_view, event) => this.onDocumentKeydown(event),\n };\n }\n\n /**\n * ⌘/Ctrl+K opens the link field. The editor owns the shortcut while it has focus: the event is stopped\n * so an app-wide ⌘K (a command palette such as `sds-search-command`) does not open on top of it.\n */\n private onDocumentKeydown(event: KeyboardEvent): boolean {\n const modK =\n (event.metaKey || event.ctrlKey) &&\n !event.altKey &&\n !event.shiftKey &&\n event.key.toLowerCase() === 'k';\n if (!modK || !this.toolSet().has('link')) return false;\n event.preventDefault();\n event.stopPropagation();\n this.openLink();\n return true;\n }\n\n /**\n * The control's value for the editor's document: '' when it is empty, and without the editor's own\n * scaffolding — the empty paragraphs kept after a final list / quote / table so the caret can leave it\n * (Tiptap's trailing node), and the table layout hints (`<colgroup>`, `style=\"min-width…\"`, the default\n * `colspan=\"1\" rowspan=\"1\"`) that columns no one resized do not need.\n */\n private currentHtml(editor: Editor): string {\n if (isBlank(editor)) return '';\n return editor\n .getHTML()\n .replace(/<colgroup>[\\s\\S]*?<\\/colgroup>/g, '')\n .replace(/<table style=\"[^\"]*\">/g, '<table>')\n .replace(/ (?:colspan|rowspan)=\"1\"/g, '')\n .replace(/(?:<p><\\/p>)+$/, '');\n }\n\n /** Flags the elements of `source` whose content the schema could not keep (shown under the field). */\n private detectLoss(source: string, editor: Editor): void {\n if (!source || typeof DOMParser === 'undefined') {\n this.lostElements.set([]);\n return;\n }\n const kept = tagsOf(editor.getHTML());\n this.lostElements.set(\n [...tagsOf(source)].filter((tag) => LOSSY_TAGS.has(tag) && !kept.has(tag)),\n );\n }\n\n private emit(editor: Editor): void {\n const html = this.currentHtml(editor);\n if (html !== this.html) {\n this.html = html;\n this.onChange(html);\n }\n }\n\n private refresh(editor: Editor): void {\n const active = new Set<SdsRichTextTool>();\n const check = (tool: SdsRichTextTool, name: string, attrs?: Record<string, unknown>) => {\n if (this.toolSet().has(tool) && editor.isActive(name, attrs)) active.add(tool);\n };\n check('heading2', 'heading', { level: 2 });\n check('heading3', 'heading', { level: 3 });\n check('paragraph', 'paragraph');\n check('bold', 'bold');\n check('italic', 'italic');\n check('underline', 'underline');\n check('strike', 'strike');\n check('bulletList', 'bulletList');\n check('orderedList', 'orderedList');\n check('blockquote', 'blockquote');\n check('link', 'link');\n check('table', 'table');\n this.activeTools.set(active);\n this.headerRow.set(active.has('table') && firstRowIsHeader(editor));\n this.history.set({ undo: editor.can().undo(), redo: editor.can().redo() });\n this.characters.set(editor.storage.characterCount.characters());\n }\n}\n\n/** The tag names (lower case) of every element in an HTML fragment. */\nfunction tagsOf(html: string): Set<string> {\n const body = new DOMParser().parseFromString(html, 'text/html').body;\n return new Set(Array.from(body.querySelectorAll('*'), (el) => el.tagName.toLowerCase()));\n}\n\n/** Whether the table around the selection starts with a row of header cells. */\nfunction firstRowIsHeader(editor: Editor): boolean {\n const { $from } = editor.state.selection;\n for (let depth = $from.depth; depth > 0; depth--) {\n const node = $from.node(depth);\n if (node.type.name === 'table') {\n return node.firstChild?.firstChild?.type.name === 'tableHeader';\n }\n }\n return false;\n}\n\n/**\n * A document holding nothing but one empty paragraph. (Tiptap's `isEmpty` only looks at the text, so a fresh\n * empty table or a lone divider would count as empty and be dropped from the value.)\n */\nfunction isBlank(editor: Editor): boolean {\n const doc = editor.state.doc;\n return (\n doc.childCount === 0 ||\n (doc.childCount === 1 &&\n doc.firstChild!.type.name === 'paragraph' &&\n doc.firstChild!.content.size === 0)\n );\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n ElementRef,\n forwardRef,\n inject,\n input,\n numberAttribute,\n signal,\n viewChildren,\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { SdsLocalizedValue } from '@besaitech/ng-design-system';\nimport {\n SDS_RICH_TEXT_DEFAULT_TOOLS,\n SdsRichTextAppearance,\n SdsRichTextLabels,\n SdsRichTextTool,\n} from './rich-text-types';\nimport { SdsRichTextEditor, SdsRichTextToolbarEnd } from './sds-rich-text-editor';\n\nlet nextId = 0;\n\nconst TAB_BASE =\n 'flex items-center gap-1 rounded px-1.5 py-1 text-[11px] font-semibold uppercase leading-none transition-colors ' +\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 ' +\n 'disabled:cursor-not-allowed disabled:opacity-50';\nconst TAB_ON =\n 'bg-brand-50 text-brand-700 ' +\n 'dark:bg-[color:var(--sds-dark-tint,rgb(255_255_255/0.12))] ' +\n 'dark:text-[color:var(--sds-dark-on-tint,var(--color-ink))]';\nconst TAB_OFF = 'text-ink-faint hover:bg-muted hover:text-ink-soft';\n\n/**\n * The translatable twin of {@link SdsRichTextEditor}: one rich-text field over a {@link SdsLocalizedValue} —\n * `{ fr: '<p>…</p>', de: '<p>…</p>', en: … }` — for content stored per language (course pages, homework\n * instructions, articles). It works like `sds-localized-input`: one language is edited at a time, a compact\n * switcher at the end of the toolbar flips the language, and a dot marks the languages that already have\n * content (green), a required one that is still empty (danger) or a missing translation (faint). Empty\n * translations are pruned from the emitted value, so an untouched language never appears in the map.\n *\n * Each language has its own editor underneath, kept alive while hidden: undo / redo, the caret and the\n * scroll position stay per language, and undoing after a switch can never bring another language's text\n * back. The document carries its `lang`, so the browser spell-checks each translation in its language.\n *\n * The active language defaults to {@link currentLanguage} when it is one of {@link languages}, otherwise the\n * first accepted language. Everything else — `[tools]` (the schema), safe links, `rows` / `maxRows`,\n * `maxLength` (per language), labels — behaves as in {@link SdsRichTextEditor}.\n *\n * Implements ControlValueAccessor over the map — use with reactive forms or `[(ngModel)]`:\n * `<sds-localized-rich-text-editor [languages]=\"['fr','de','en']\" formControlName=\"description\" />`.\n * Import from `@besaitech/ng-design-system/rich-text`.\n */\n@Component({\n selector: 'sds-localized-rich-text-editor',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, SdsRichTextEditor, SdsRichTextToolbarEnd],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SdsLocalizedRichTextEditor),\n multi: true,\n },\n ],\n host: {\n class: 'block',\n '(focusout)': 'onFocusOut($event)',\n },\n template: `\n @if (label()) {\n <label\n [id]=\"baseId + '-label'\"\n class=\"mb-1.5 block text-sm font-medium text-ink\"\n (click)=\"focus()\"\n >{{ label() }}\n @if (required()) {\n <span class=\"ml-0.5 text-danger\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n @for (lang of languages(); track lang) {\n <sds-rich-text-editor\n [style.display]=\"lang === activeLang() ? null : 'none'\"\n [attr.data-active-language]=\"lang === activeLang() ? '' : null\"\n [ariaLabel]=\"editorName(lang)\"\n [contentLanguage]=\"lang\"\n [placeholder]=\"placeholderFor(lang)\"\n [hint]=\"hint()\"\n [error]=\"error()\"\n [invalid]=\"invalid()\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [tools]=\"tools()\"\n [rows]=\"rows()\"\n [maxRows]=\"maxRows()\"\n [maxLength]=\"maxLength()\"\n [showCount]=\"showCount()\"\n [appearance]=\"appearance()\"\n [labels]=\"labels()\"\n [ngModel]=\"valueMap()[lang] ?? ''\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"write(lang, $event)\"\n >\n @if (languages().length > 1) {\n <div\n sdsRichTextToolbarEnd\n role=\"tablist\"\n class=\"flex items-center gap-0.5\"\n [attr.aria-label]=\"languageSwitcherLabel()\"\n (keydown)=\"onTabsKeydown($event)\"\n >\n @for (code of languages(); track code) {\n <button\n type=\"button\"\n role=\"tab\"\n [attr.data-lang]=\"code\"\n [attr.aria-selected]=\"code === activeLang() ? 'true' : 'false'\"\n [attr.tabindex]=\"code === activeLang() ? 0 : -1\"\n [attr.title]=\"tabTitle(code)\"\n [disabled]=\"isDisabled()\"\n [class]=\"tabClass(code)\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"select(code, 'editor')\"\n >\n {{ code }}\n <span class=\"inline-block h-1.5 w-1.5 rounded-full\" [class]=\"dotClass(code)\"></span>\n </button>\n }\n </div>\n }\n </sds-rich-text-editor>\n }\n `,\n})\nexport class SdsLocalizedRichTextEditor implements ControlValueAccessor {\n protected readonly baseId = `sds-lrte-${nextId++}`;\n\n readonly label = input<string>('');\n /** Accessible name when there is no visible {@link label}; each language's editor adds its code. */\n readonly ariaLabel = input<string>('');\n readonly placeholder = input<string>('');\n readonly hint = input<string>('');\n /** Error message under the field (danger frame + `aria-invalid`); replaces the hint. */\n readonly error = input<string>('');\n /** Mark the field invalid (danger frame + `aria-invalid`) without showing an [error] message. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /** An asterisk after the [label] and `aria-required`. It does not validate — keep your own validator. */\n readonly required = input(false, { transform: booleanAttribute });\n /**\n * Languages that must be filled (e.g. the site's main language): while empty, their switcher dot shows in the\n * danger colour and its title says {@link requiredLanguageLabel}. Display only — validate in the form.\n */\n readonly requiredLanguages = input<string[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Every translation can be read (the switcher still works) but none changed; the toolbar is hidden. */\n readonly readonly = input(false, { transform: booleanAttribute });\n\n /** The accepted language codes, in display order (e.g. `['fr','de','en']`). */\n readonly languages = input<string[]>([]);\n /** Language to open on; used when it is one of {@link languages}, else the first accepted language. */\n readonly currentLanguage = input<string | null>(null);\n\n /** The toolbar and the schema, as on {@link SdsRichTextEditor}. */\n readonly tools = input<readonly SdsRichTextTool[]>(SDS_RICH_TEXT_DEFAULT_TOOLS);\n readonly rows = input(6, { transform: numberAttribute });\n readonly maxRows = input(0, { transform: numberAttribute });\n /** Cap on each language's plain-text length; 0 means no limit. */\n readonly maxLength = input(0, { transform: numberAttribute });\n /** Show the character counter of the language being edited (always shown with a [maxLength]). */\n readonly showCount = input(false, { transform: booleanAttribute });\n readonly appearance = input<SdsRichTextAppearance>('default');\n /** Editor strings, as on {@link SdsRichTextEditor}. */\n readonly labels = input<Partial<SdsRichTextLabels>>({});\n\n /**\n * Accessible name of the language switcher, and the title suffixes of an empty language. English defaults;\n * translate them in a multi-language app (the tabs show only the language code).\n */\n readonly languageSwitcherLabel = input<string>('Language');\n readonly untranslatedLabel = input<string>('not translated yet');\n /** Title suffix of a required language that is still empty (see {@link requiredLanguages}). */\n readonly requiredLanguageLabel = input<string>('required');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly editors = viewChildren(SdsRichTextEditor);\n\n protected readonly valueMap = signal<SdsLocalizedValue>({});\n /** Language chosen with the switcher; null means \"follow currentLanguage / the first language\". */\n private readonly manual = signal<string | null>(null);\n private readonly cvaDisabled = signal(false);\n\n protected readonly isDisabled = computed(() => this.disabled() || this.cvaDisabled());\n\n /** The language being edited. */\n protected readonly activeLang = computed(() => {\n const langs = this.languages();\n if (!langs.length) return '';\n const manual = this.manual();\n if (manual && langs.includes(manual)) return manual;\n const preferred = this.currentLanguage();\n return preferred && langs.includes(preferred) ? preferred : langs[0];\n });\n\n /** Move the caret into the active language's document. */\n focus(): void {\n this.editorFor(this.activeLang())?.focus();\n }\n\n protected filled(lang: string): boolean {\n const html = this.valueMap()[lang];\n return !!html && html.trim().length > 0;\n }\n\n /** A required language (see {@link requiredLanguages}) that is still empty. */\n protected mustFill(lang: string): boolean {\n return this.requiredLanguages().includes(lang) && !this.filled(lang);\n }\n\n protected editorName(lang: string): string {\n const name = this.label() || this.ariaLabel();\n return name ? `${name} (${lang.toUpperCase()})` : lang.toUpperCase();\n }\n\n protected placeholderFor(lang: string): string {\n const base = this.placeholder();\n return base ? `${base} (${lang.toUpperCase()})` : '';\n }\n\n protected tabTitle(lang: string): string {\n const code = lang.toUpperCase();\n if (this.filled(lang)) return code;\n return `${code} — ${this.mustFill(lang) ? this.requiredLanguageLabel() : this.untranslatedLabel()}`;\n }\n\n protected tabClass(lang: string): string {\n return `${TAB_BASE} ${lang === this.activeLang() ? TAB_ON : TAB_OFF}`;\n }\n\n protected dotClass(lang: string): string {\n return this.filled(lang) ? 'bg-success' : this.mustFill(lang) ? 'bg-danger' : 'bg-current/30';\n }\n\n /**\n * Switch language. From a click, the caret goes into the new language's document (ready to type); from the\n * arrow keys, focus follows to the new language's tab. Rendered at once so focus never lands on the\n * editor that was just hidden.\n */\n protected select(lang: string, focusTarget: 'editor' | 'tab'): void {\n if (lang === this.activeLang()) {\n if (focusTarget === 'editor') this.focus();\n return;\n }\n this.manual.set(lang);\n // Switching language counts as touching the field, as in sds-localized-input.\n this.onTouched();\n this.cdr.detectChanges();\n if (focusTarget === 'editor') {\n this.editorFor(lang)?.focus();\n } else {\n this.host.nativeElement\n .querySelector<HTMLButtonElement>(\n `sds-rich-text-editor[data-active-language] [role=\"tab\"][data-lang=\"${CSS.escape(lang)}\"]`,\n )\n ?.focus();\n }\n }\n\n /** The switcher is one Tab stop; arrows / Home / End change the language (automatic activation). */\n protected onTabsKeydown(event: KeyboardEvent): void {\n const langs = this.languages();\n const index = langs.indexOf(this.activeLang());\n let next = -1;\n if (event.key === 'ArrowRight') next = (index + 1) % langs.length;\n else if (event.key === 'ArrowLeft') next = (index - 1 + langs.length) % langs.length;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = langs.length - 1;\n if (next >= 0 && !this.isDisabled()) {\n event.preventDefault();\n event.stopPropagation();\n this.select(langs[next], 'tab');\n }\n }\n\n protected write(lang: string, html: string): void {\n const current = this.valueMap()[lang] ?? '';\n if ((html ?? '') === current) return;\n const next: SdsLocalizedValue = { ...this.valueMap() };\n if (html) {\n next[lang] = html;\n } else {\n delete next[lang];\n }\n this.valueMap.set(next);\n this.onChange(next);\n }\n\n /** Touched once focus leaves the whole field (moving between toolbar, link field and document is not leaving). */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (!next || !this.host.nativeElement.contains(next)) this.onTouched();\n }\n\n private editorFor(lang: string): SdsRichTextEditor | undefined {\n return this.editors()[this.languages().indexOf(lang)];\n }\n\n // --- ControlValueAccessor -------------------------------------------------\n private onChange: (value: SdsLocalizedValue) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(value: SdsLocalizedValue | null): void {\n this.valueMap.set(value ? { ...value } : {});\n }\n registerOnChange(fn: (value: SdsLocalizedValue) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n}\n","/*\n * Secondary entry point `@besaitech/ng-design-system/rich-text` — the Tiptap (ProseMirror) powered\n * rich-text editor.\n *\n * Kept out of the root entry for the same reason as the charts: the root is one module, so anything it\n * exports that an app uses anywhere lands in the app's initial chunk. Importing the editor from here lets\n * the bundler keep it, and ProseMirror, in the lazy chunk of the page that edits rich text.\n */\nexport * from './rich-text-types';\nexport * from './sds-rich-text-editor';\nexport * from './sds-localized-rich-text-editor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["nextId"],"mappings":";;;;;;;;;;AAqBA;AACO,MAAM,2BAA2B,GAA+B;IACrE,UAAU;IACV,UAAU;IACV,MAAM;IACN,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,MAAM;IACN,OAAO;IACP,iBAAiB;IACjB,MAAM;IACN,MAAM;;AAsDD,MAAM,uBAAuB,GAAsB;AACxD,IAAA,OAAO,EAAE,YAAY;AACrB,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,QAAQ,EAAE,YAAY;AACtB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,MA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AAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC9L3D;;;;;;;AAOG;;ACPH;;AAEG;;;;"}
|
|
@@ -87,6 +87,7 @@ const SDS_ICONS = {
|
|
|
87
87
|
bell: '<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>',
|
|
88
88
|
phone: '<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/>',
|
|
89
89
|
settings: '<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>',
|
|
90
|
+
printer: '<path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><path d="M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6"/><rect x="6" y="14" width="12" height="8" rx="1"/>',
|
|
90
91
|
'align-left': '<path d="M15 12H3"/><path d="M17 18H3"/><path d="M21 6H3"/>',
|
|
91
92
|
'toggle-left': '<rect width="20" height="12" x="2" y="6" rx="6" ry="6"/><circle cx="8" cy="12" r="2"/>',
|
|
92
93
|
'arrow-up': '<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',
|
|
@@ -187,6 +188,9 @@ const SDS_ICONS = {
|
|
|
187
188
|
'undo-2': '<path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"/>',
|
|
188
189
|
'redo-2': '<path d="m15 14 5-5-5-5"/><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"/>',
|
|
189
190
|
'remove-formatting': '<path d="M4 7V4h16v3"/><path d="M5 20h6"/><path d="M13 4 8 20"/><path d="m15 15 5 5"/><path d="m20 15-5 5"/>',
|
|
191
|
+
'between-horizontal-end': '<rect width="13" height="7" x="3" y="3" rx="1"/><path d="m22 15-3-3 3-3"/><rect width="13" height="7" x="3" y="14" rx="1"/>',
|
|
192
|
+
'between-vertical-end': '<rect width="7" height="13" x="3" y="3" rx="1"/><path d="m9 22 3-3 3 3"/><rect width="7" height="13" x="14" y="3" rx="1"/>',
|
|
193
|
+
'grid-2x2-x': '<path d="M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3"/><path d="m16 16 5 5"/><path d="m16 21 5-5"/>',
|
|
190
194
|
};
|
|
191
195
|
|
|
192
196
|
const SIZE_PX = { sm: 16, md: 20, lg: 24, xl: 32 };
|