@4sh/ui-kit 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +75 -15
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +5 -3
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/mcp/data/text-search-docs.json +37 -7
- package/mcp/data/ui-config.json +154 -1
- package/mcp/package.json +1 -1
- package/package.json +1 -1
- package/styles/component-vars.scss +8 -1
- package/styles/utils/_mixins.scss +9 -10
- package/types/4sh-ui-kit-forms-ui-input-group.d.ts +47 -15
- package/types/4sh-ui-kit-forms-ui-select.d.ts +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-editor.mjs","sources":["../../../projects/ui-kit/forms/ui-editor/src/lib/ui-editor-commands.ts","../../../projects/ui-kit/forms/ui-editor/src/lib/ui-editor.ts","../../../projects/ui-kit/forms/ui-editor/src/lib/ui-editor.html","../../../projects/ui-kit/forms/ui-editor/src/public-api.ts","../../../projects/ui-kit/forms/ui-editor/src/4sh-ui-kit-forms-ui-editor.ts"],"sourcesContent":["import { DEFAULT_SWATCH_PALETTE } from '@4sh/ui-kit/forms/ui-swatch-picker';\n\n/**\n * Rich-text command layer — the only place that talks to the legacy editing API.\n *\n * `document.execCommand` is deprecated but remains the sole cross-browser way to\n * apply inline formatting to a `contenteditable` selection without pulling in an\n * editing engine (ProseMirror, Quill…). It is confined to this file so the kit\n * keeps a single third-party-free dependency surface, and so a future Selection/\n * Range implementation only has to replace these functions.\n */\n\n/**\n * A formatting action the toolbar can trigger.\n *\n * `separator` is purely visual; `fontFamily` renders a dropdown rather than a\n * button, since it picks among values instead of toggling one.\n */\nexport type EditorTool =\n | 'bold'\n | 'italic'\n | 'underline'\n | 'bulletList'\n | 'orderedList'\n | 'codeBlock'\n | 'fontFamily'\n | 'fontSize'\n | 'indent'\n | 'outdent'\n | 'alignLeft'\n | 'alignCenter'\n | 'alignRight'\n | 'alignJustify'\n | 'textColor'\n | 'highlightColor'\n | 'link'\n | 'clearFormat'\n | 'separator';\n\n/** Tools rendered as a dropdown: they pick among values instead of toggling one. */\nexport type EditorSelectTool = 'fontFamily' | 'fontSize';\n\n/** Tools rendered as an icon button. */\nexport type EditorButtonTool = Exclude<EditorTool, 'separator' | EditorSelectTool>;\n\nexport const EDITOR_SELECT_TOOLS: readonly EditorSelectTool[] = [\n 'fontFamily',\n 'fontSize',\n];\n\n/** Commands whose active/inactive state the toolbar reflects via `aria-pressed`. */\nexport type EditorToggleTool = Extract<\n EditorTool,\n | 'bold'\n | 'italic'\n | 'underline'\n | 'bulletList'\n | 'orderedList'\n | 'codeBlock'\n | 'alignLeft'\n | 'alignCenter'\n | 'alignRight'\n | 'alignJustify'\n>;\n\n/** Active formatting at the caret, recomputed after every interaction. */\nexport type EditorState = Record<EditorToggleTool, boolean>;\n\n/**\n * Type families the editor can apply.\n *\n * A closed list on purpose: a free font picker would write an arbitrary family\n * into the value and step outside the `--fontfamily-*` tokens. The system has no\n * serif face, so the list is the three families the tokens actually carry.\n */\nexport type EditorFont = 'base' | 'title' | 'monospace';\n\n/**\n * Font key → class written into the value, token holding the family, and the\n * fallback label used when the real name cannot be read (SSR, unset token).\n *\n * The dropdown shows the **actual** face name, resolved from the token at runtime\n * (see {@link resolveFontLabel}) rather than hardcoded: a project that rebinds\n * `--fontfamily-base` would otherwise see a menu naming a font it no longer uses.\n */\nexport const EDITOR_FONTS: readonly {\n key: EditorFont;\n className: string;\n cssVar: string;\n label: string;\n}[] = [\n { key: 'base', className: 'ui-editor-font-base', cssVar: '--fontfamily-base', label: 'Standard' },\n {\n key: 'title',\n className: 'ui-editor-font-title',\n cssVar: '--fontfamily-title',\n label: 'Titre',\n },\n {\n key: 'monospace',\n className: 'ui-editor-font-monospace',\n cssVar: '--fontfamily-monospace',\n label: 'Monospace',\n },\n];\n\n/**\n * First face named by a font token — what the family dropdown displays.\n *\n * `--fontfamily-base` holds a whole stack (`Inter, system-ui, …`); only the head\n * of it is a name a person recognises.\n */\nexport function resolveFontLabel(cssVar: string, fallback: string): string {\n if (typeof document === 'undefined') return fallback;\n const raw = getComputedStyle(document.documentElement).getPropertyValue(cssVar).trim();\n const first = raw\n .split(',')[0]\n ?.trim()\n .replace(/^[\"']|[\"']$/g, '');\n return first || fallback;\n}\n\n/** Text sizes the editor can apply, as a step on the typography scale. */\nexport type EditorSize = 'sm' | 'default' | 'lg' | 'xl';\n\n/** Size key → class written into the value + French label for the dropdown. */\nexport const EDITOR_SIZES: readonly { key: EditorSize; className: string; label: string }[] = [\n { key: 'sm', className: 'ui-editor-size-sm', label: 'Petit' },\n { key: 'default', className: 'ui-editor-size-default', label: 'Normal' },\n { key: 'lg', className: 'ui-editor-size-lg', label: 'Grand' },\n { key: 'xl', className: 'ui-editor-size-xl', label: 'Très grand' },\n];\n\nconst SIZE_CLASSES = new Set(EDITOR_SIZES.map((s) => s.className));\n\nconst FONT_CLASSES = new Set(EDITOR_FONTS.map((f) => f.className));\n\n/**\n * The tools enabled when the consumer does not provide a `tools` list.\n *\n * There is no block-level dropdown (no `blockFormat`, no headings): the editor\n * only ever produces `<p>`. `fontFamily`/`fontSize` are both first-class,\n * always-on tools rather than one gated behind the other.\n *\n * `clearFormat` is deliberately absent for now: `clearFormatMarkers()` does not\n * reliably clear every marker class yet. It stays available for a project that\n * explicitly adds it to `tools`, but shipping it by default would be shipping\n * a broken button.\n */\nexport const DEFAULT_EDITOR_TOOLS: readonly EditorTool[] = [\n 'fontFamily',\n 'fontSize',\n 'separator',\n 'bold',\n 'italic',\n 'underline',\n 'separator',\n 'bulletList',\n 'orderedList',\n 'separator',\n 'alignLeft',\n 'alignCenter',\n 'alignRight',\n 'alignJustify',\n 'separator',\n 'link',\n 'codeBlock',\n];\n\n/** Toolbar metadata per button tool: icon (FontAwesome) + French accessible name. */\nexport const EDITOR_TOOL_META: Record<EditorButtonTool, { icon: string; label: string }> = {\n bold: { icon: 'bold', label: 'Gras' },\n italic: { icon: 'italic', label: 'Italique' },\n underline: { icon: 'underline', label: 'Souligné' },\n bulletList: { icon: 'list-ul', label: 'Liste à puces' },\n orderedList: { icon: 'list-ol', label: 'Liste numérotée' },\n codeBlock: { icon: 'code', label: 'Bloc de code' },\n indent: { icon: 'indent', label: 'Augmenter le retrait' },\n outdent: { icon: 'outdent', label: 'Diminuer le retrait' },\n alignLeft: { icon: 'align-left', label: 'Aligner à gauche' },\n alignCenter: { icon: 'align-center', label: 'Centrer' },\n alignRight: { icon: 'align-right', label: 'Aligner à droite' },\n alignJustify: { icon: 'align-justify', label: 'Justifier' },\n textColor: { icon: 'font', label: 'Couleur du texte' },\n highlightColor: { icon: 'highlighter', label: 'Couleur de surlignage' },\n link: { icon: 'link', label: 'Lien' },\n clearFormat: { icon: 'text-slash', label: 'Effacer le formatage' },\n};\n\n/** Tool → legacy command name. */\nconst NATIVE_COMMAND: Record<\n Exclude<EditorButtonTool, 'link' | 'codeBlock' | 'textColor' | 'highlightColor'>,\n string\n> = {\n bold: 'bold',\n italic: 'italic',\n underline: 'underline',\n bulletList: 'insertUnorderedList',\n orderedList: 'insertOrderedList',\n indent: 'indent',\n outdent: 'outdent',\n alignLeft: 'justifyLeft',\n alignCenter: 'justifyCenter',\n alignRight: 'justifyRight',\n alignJustify: 'justifyFull',\n clearFormat: 'removeFormat',\n};\n\nconst TOGGLE_TOOLS: readonly Exclude<EditorToggleTool, 'codeBlock'>[] = [\n 'bold',\n 'italic',\n 'underline',\n 'bulletList',\n 'orderedList',\n 'alignLeft',\n 'alignCenter',\n 'alignRight',\n 'alignJustify',\n];\n\n/** Every state off — the value used before the first render and on SSR. */\nexport function emptyEditorState(): EditorState {\n return {\n bold: false,\n italic: false,\n underline: false,\n bulletList: false,\n orderedList: false,\n codeBlock: false,\n alignLeft: false,\n alignCenter: false,\n alignRight: false,\n alignJustify: false,\n };\n}\n\n/** Applies a formatting command to the current selection. */\nexport function applyCommand(\n tool: Exclude<EditorButtonTool, 'link' | 'codeBlock' | 'textColor' | 'highlightColor'>,\n): void {\n document.execCommand(NATIVE_COMMAND[tool], false);\n}\n\n// --- Code block ---------------------------------------------------------\n\n/** Toggles the block under the caret between `<pre>` and a plain paragraph. */\nexport function toggleCodeBlock(): void {\n document.execCommand('formatBlock', false, isInCodeBlock() ? 'p' : 'pre');\n}\n\n/** The caret sits in a code block. */\nexport function isInCodeBlock(): boolean {\n try {\n return (document.queryCommandValue('formatBlock') || '').toLowerCase() === 'pre';\n } catch {\n return false;\n }\n}\n\n// --- Font family --------------------------------------------------------\n\n/**\n * Marker handed to `fontName`, immediately rewritten into a class.\n *\n * `fontName` is the only command that can apply a family to an arbitrary\n * selection, but it emits `<font face=\"…\">` — an obsolete tag carrying a raw\n * family name. We let it run, then convert its output so the value only ever\n * holds a class bound to a `--fontfamily-*` token.\n */\nconst FONT_MARKER = '__ui-editor-font__';\n\n/** Applies a type family to the selection (see {@link convertFontMarkers}). */\nexport function applyFontFamily(): void {\n document.execCommand('fontName', false, FONT_MARKER);\n}\n\n/** Rewrites the `<font>` elements `fontName` just produced into `<span class>`. */\nexport function convertFontMarkers(root: ParentNode, className: string): void {\n convertMarkers(root, `font[face=\"${FONT_MARKER}\"]`, className, FONT_CLASSES);\n}\n\n/** @internal Replaces the matched legacy `<font>` elements with a classed span. */\nfunction convertMarkers(\n root: ParentNode,\n selector: string,\n className: string,\n family: ReadonlySet<string>,\n): void {\n const spans: HTMLElement[] = [];\n for (const el of Array.from(root.querySelectorAll(selector))) {\n const span = document.createElement('span');\n span.className = className;\n span.append(...Array.from(el.childNodes));\n el.replaceWith(span);\n spans.push(span);\n }\n\n // A same-family class left inside would win over the new one.\n for (const span of spans) {\n for (const inner of Array.from(span.querySelectorAll<HTMLElement>('[class]'))) {\n for (const cls of Array.from(inner.classList))\n if (family.has(cls)) inner.classList.remove(cls);\n if (inner.classList.length > 0) continue;\n inner.removeAttribute('class');\n if (inner.tagName === 'SPAN' && inner.attributes.length === 0) {\n inner.replaceWith(...Array.from(inner.childNodes));\n }\n }\n }\n\n // Replacing the nodes collapsed the selection: put it back.\n const live = spans.filter((span) => span.isConnected);\n const selection = document.getSelection();\n if (!live.length || !selection) return;\n const last = live[live.length - 1];\n const range = document.createRange();\n range.setStart(live[0], 0);\n range.setEnd(last, last.childNodes.length);\n selection.removeAllRanges();\n selection.addRange(range);\n}\n\n/**\n * Type family in force at the caret.\n *\n * Falls back to the family the text is actually rendered with when no class was\n * applied: a heading carries `--fontfamily-title` from its own styling, and\n * reporting the base family there would name a font the reader does not see.\n * `null` only when the computed face matches none of the system families.\n */\nexport function readFontFamily(node: Node | null): EditorFont | null {\n const tagged = findClassKey(node, EDITOR_FONTS);\n if (tagged) return tagged;\n\n const el: HTMLElement | null =\n node?.nodeType === Node.ELEMENT_NODE ? (node as HTMLElement) : (node?.parentElement ?? null);\n if (!el || typeof getComputedStyle !== 'function') return null;\n\n const rendered = firstFace(getComputedStyle(el).fontFamily);\n return (\n EDITOR_FONTS.find((f) => firstFace(resolveFontLabel(f.cssVar, '')) === rendered)?.key ?? null\n );\n}\n\n/** @internal Head of a font stack, unquoted and lowercased for comparison. */\nfunction firstFace(stack: string): string {\n return (stack.split(',')[0] ?? '')\n .trim()\n .replace(/^[\"']|[\"']$/g, '')\n .toLowerCase();\n}\n\n// --- Font size ----------------------------------------------------------\n\n/**\n * Marker handed to `fontSize`, immediately rewritten into a class.\n *\n * Same trick as the family: `fontSize` is the only command that can size an\n * arbitrary selection, but it emits `<font size=\"7\">` — a legacy 1-7 scale with\n * no relation to the typography tokens.\n */\nconst SIZE_MARKER = '7';\n\n/** Applies a text size to the selection (see {@link convertSizeMarkers}). */\nexport function applyFontSize(): void {\n document.execCommand('fontSize', false, SIZE_MARKER);\n}\n\n/** Rewrites the `<font>` elements `fontSize` just produced into `<span class>`. */\nexport function convertSizeMarkers(root: ParentNode, className: string): void {\n convertMarkers(root, `font[size=\"${SIZE_MARKER}\"]`, className, SIZE_CLASSES);\n}\n\n/** Text size active at the caret, or `null` when the text uses the default. */\nexport function readFontSize(node: Node | null): EditorSize | null {\n return findClassKey(node, EDITOR_SIZES);\n}\n\n// --- Text color / highlight color ---------------------------------------\n\n/**\n * Color key → class written into the value, token holding the swatch, and\n * label, derived from `ui-swatch-picker`'s default palette rather than\n * hand-duplicated: the editor's color tools and the nuancier it opens must\n * always offer the same token set.\n */\nexport const EDITOR_COLORS: readonly {\n key: string;\n className: string;\n cssVar: string;\n label: string;\n}[] = DEFAULT_SWATCH_PALETTE.flatMap((group) =>\n group.swatches.map((swatch) => ({\n key: swatch.key,\n className: `ui-editor-color-${swatch.key}`,\n cssVar: swatch.cssVar,\n label: swatch.label,\n })),\n);\n\n/** Same key set as {@link EDITOR_COLORS}, classed separately for the highlight tool. */\nexport const EDITOR_HIGHLIGHTS: readonly {\n key: string;\n className: string;\n cssVar: string;\n label: string;\n}[] = DEFAULT_SWATCH_PALETTE.flatMap((group) =>\n group.swatches.map((swatch) => ({\n key: swatch.key,\n className: `ui-editor-highlight-${swatch.key}`,\n cssVar: swatch.cssVar,\n label: swatch.label,\n })),\n);\n\nconst COLOR_CLASSES = new Set(EDITOR_COLORS.map((c) => c.className));\nconst HIGHLIGHT_CLASSES = new Set(EDITOR_HIGHLIGHTS.map((c) => c.className));\n\n/**\n * Marker handed to `foreColor`, immediately rewritten into a class.\n *\n * `foreColor` is the only command that can color an arbitrary selection, but\n * it emits `<font color=\"…\">` — same trick as the family/size markers. Must\n * be a value the browser accepts as a real color (unlike `fontName`'s marker,\n * which is free text): an unparseable string is silently dropped instead of\n * being written to the `color` attribute. A hex triplet unlikely to collide\n * with a real token value is used, and Chromium/Firefox both echo it back\n * verbatim on the `<font color>` attribute (verified empirically).\n */\nconst COLOR_MARKER = '#010203';\n\n/** Applies a text color to the selection (see {@link convertColorMarkers}). */\nexport function applyTextColor(): void {\n document.execCommand('foreColor', false, COLOR_MARKER);\n}\n\n/** Rewrites the `<font>` elements `foreColor` just produced into `<span class>`. */\nexport function convertColorMarkers(root: ParentNode, className: string): void {\n convertMarkers(root, `font[color=\"${COLOR_MARKER}\"]`, className, COLOR_CLASSES);\n}\n\n/** Text color active at the caret, or `null` when the text uses the default. */\nexport function readTextColor(node: Node | null): string | null {\n return findClassKey(node, EDITOR_COLORS);\n}\n\n/**\n * Marker handed to `hiliteColor`, immediately rewritten into a class.\n *\n * Unlike `fontName`/`fontSize`/`foreColor`, `hiliteColor` does **not** emit a\n * `<font>` element: verified empirically (Playwright, Chromium + Firefox)\n * that it always produces `<span style=\"background-color: rgb(r, g, b);\">`,\n * converting whatever color is handed to it — including a hex marker — to an\n * `rgb(...)` triplet in the `style` attribute. `HILITE_MARKER` is therefore\n * kept as the hex value passed to the command, and `HILITE_MARKER_RGB` as the\n * exact `rgb(...)` string both browsers echo back for it, used to build the\n * `[style*=\"…\"]` selector `convertHighlightMarkers` matches on.\n */\nconst HILITE_MARKER = '#040506';\n/** @internal `rgb(...)` form both Chromium and Firefox normalize `HILITE_MARKER` to. */\nconst HILITE_MARKER_RGB = 'rgb(4, 5, 6)';\n\n/** Applies a highlight color to the selection (see {@link convertHighlightMarkers}). */\nexport function applyHighlightColor(): void {\n document.execCommand('hiliteColor', false, HILITE_MARKER);\n}\n\n/** Rewrites the `<span style>` elements `hiliteColor` just produced into `<span class>`. */\nexport function convertHighlightMarkers(root: ParentNode, className: string): void {\n convertMarkers(\n root,\n `[style*=\"background-color: ${HILITE_MARKER_RGB}\"]`,\n className,\n HIGHLIGHT_CLASSES,\n );\n}\n\n/** Highlight color active at the caret, or `null` when the text carries none. */\nexport function readHighlightColor(node: Node | null): string | null {\n return findClassKey(node, EDITOR_HIGHLIGHTS);\n}\n\n/**\n * Strips a color/highlight class from every element carrying it inside\n * `range`, unwrapping the element when nothing else justifies it (a plain\n * `<span>` holding only that class).\n *\n * Used by the pickers' \"no color\" swatch: `foreColor`/`hiliteColor` can only\n * set a color, there is no native command to remove one, so this undoes what\n * {@link convertColorMarkers}/{@link convertHighlightMarkers} previously wrote.\n */\nexport function clearMarkerClass(root: ParentNode, range: Range, className: string): void {\n for (const el of Array.from(root.querySelectorAll(`.${className}`))) {\n if (!range.intersectsNode(el)) continue;\n el.classList.remove(className);\n if (el.classList.length > 0) continue;\n el.removeAttribute('class');\n if (el.tagName === 'SPAN' && el.attributes.length === 0) {\n el.replaceWith(...Array.from(el.childNodes));\n }\n }\n}\n\n/**\n * Strips every font/size/color/highlight class the editor writes, from\n * whatever intersects `range`.\n *\n * `removeFormat` (the `clearFormat` tool's native command) only knows inline\n * formatting the browser itself applies (bold, italic, underline…) — it never\n * touches the `<span class=\"ui-editor-*\">` wrappers `fontFamily`/`fontSize`/\n * `textColor`/`highlightColor` write, so \"Clear formatting\" needs this on top\n * of it to actually clear everything.\n */\nexport function clearFormatMarkers(root: ParentNode, range: Range): void {\n for (const className of [...FONT_CLASSES, ...SIZE_CLASSES, ...COLOR_CLASSES, ...HIGHLIGHT_CLASSES]) {\n clearMarkerClass(root, range, className);\n }\n}\n\n/** @internal Nearest ancestor carrying one of the given classes. */\nfunction findClassKey<T extends string>(\n node: Node | null,\n table: readonly { key: T; className: string }[],\n): T | null {\n let el: HTMLElement | null =\n node?.nodeType === Node.ELEMENT_NODE ? (node as HTMLElement) : (node?.parentElement ?? null);\n while (el) {\n const match = table.find((entry) => el!.classList?.contains(entry.className));\n if (match) return match.key;\n el = el.parentElement;\n }\n return null;\n}\n\n/** Wraps the current selection in a link (`removeFormat` alone cannot unlink). */\nexport function applyLink(href: string): void {\n document.execCommand('createLink', false, href);\n}\n\n/** Removes the link around the caret. */\nexport function removeLink(): void {\n document.execCommand('unlink', false);\n}\n\n/** Reads the formatting active at the caret. */\nexport function readEditorState(): EditorState {\n const state = emptyEditorState();\n for (const tool of TOGGLE_TOOLS) {\n try {\n state[tool] = document.queryCommandState(NATIVE_COMMAND[tool]);\n } catch {\n // queryCommandState throws when the document has no selection yet.\n state[tool] = false;\n }\n }\n state.codeBlock = isInCodeBlock();\n return state;\n}\n\n/** Inserts already-sanitised markup at the caret, replacing the selection. */\nexport function insertHtml(html: string): void {\n document.execCommand('insertHTML', false, html);\n}\n\n/** Inserts plain text at the caret, replacing the selection. */\nexport function insertText(text: string): void {\n document.execCommand('insertText', false, text);\n}\n\n// --- Value sanitisation --------------------------------------------------\n\nconst LENGTH = String.raw`(?:0|-?\\d+(?:\\.\\d+)?(?:px|em|rem|%))`;\nconst LENGTHS = new RegExp(`^${LENGTH}(?:\\\\s+${LENGTH}){0,3}$`);\n\n/** The only `style` a value keeps: alignment and indentation. Same list as the React kit. */\nconst STYLE_ALLOWLIST: Record<string, RegExp> = {\n 'text-align': /^(?:left|right|center|justify|start|end)$/,\n margin: LENGTHS,\n 'margin-left': LENGTHS,\n 'margin-right': LENGTHS,\n 'margin-inline-start': LENGTHS,\n padding: LENGTHS,\n border: /^none$/,\n};\n\n/** Keeps only the allowed declarations of a `style` attribute. */\nexport function sanitizeStyle(style: string): string {\n const kept: string[] = [];\n for (const declaration of style.split(';')) {\n const colon = declaration.indexOf(':');\n if (colon < 0) continue;\n const property = declaration.slice(0, colon).trim().toLowerCase();\n const value = declaration.slice(colon + 1).trim().toLowerCase();\n const pattern = STYLE_ALLOWLIST[property];\n if (pattern?.test(value)) kept.push(`${property}: ${value};`);\n }\n return kept.join(' ');\n}\n\nconst STYLE_RELAY = 'ui-editor-style-';\n\n/** Sanitises a value with `sanitize`, relaying the allowed `style` through a class it keeps. */\nexport function sanitizeEditorHtml(html: string, sanitize: (html: string) => string): string {\n if (typeof DOMParser === 'undefined' || !/\\sstyle\\s*=/i.test(html)) return sanitize(html);\n\n const styles: string[] = [];\n const source = parseInert(html);\n for (const el of Array.from(source.querySelectorAll('*'))) {\n const forged = Array.from(el.classList).filter((cls) => cls.startsWith(STYLE_RELAY));\n if (forged.length) {\n el.classList.remove(...forged);\n if (!el.classList.length) el.removeAttribute('class');\n }\n const style = el.getAttribute('style');\n if (style === null) continue;\n el.removeAttribute('style');\n const kept = sanitizeStyle(style);\n if (!kept) continue;\n el.classList.add(`${STYLE_RELAY}${styles.length}`);\n styles.push(kept);\n }\n\n const safe = sanitize(source.innerHTML);\n if (!styles.length) return safe;\n\n const out = parseInert(safe);\n for (const el of Array.from(out.querySelectorAll(`[class*=\"${STYLE_RELAY}\"]`))) {\n for (const cls of Array.from(el.classList)) {\n if (!cls.startsWith(STYLE_RELAY)) continue;\n el.classList.remove(cls);\n const kept = styles[Number(cls.slice(STYLE_RELAY.length))];\n if (kept) el.setAttribute('style', kept);\n }\n if (!el.classList.length) el.removeAttribute('class');\n }\n return out.innerHTML;\n}\n\n/** @internal Inert parse; the leading `<remove>` keeps head-only tags in the body. */\nfunction parseInert(html: string): HTMLElement {\n const body = new DOMParser().parseFromString(`<body><remove></remove>${html}`, 'text/html').body;\n body.firstChild?.remove();\n return body;\n}\n\n// --- Content normalisation ---------------------------------------------\n\n/** Inline + block tags the editor is allowed to produce or to accept on paste. */\nconst ALLOWED_TAGS = new Set([\n 'B',\n 'STRONG',\n 'I',\n 'EM',\n 'U',\n 'A',\n 'UL',\n 'OL',\n 'LI',\n 'P',\n 'BR',\n 'DIV',\n 'SPAN',\n 'PRE',\n 'CODE',\n 'H1',\n 'H2',\n 'H3',\n]);\n\n/**\n * Tags dropped WITH their content, instead of being unwrapped.\n *\n * Unwrapping keeps the text of a rejected element, which is what we want for a\n * heading or a table cell — but a script or stylesheet body would then land in\n * the document as visible text.\n */\nconst VOIDED_TAGS = 'script, style, noscript, iframe, object, embed, template, title, meta, link';\n\n/** Only `href` survives, and only on a link. */\nconst ALLOWED_HREF_PROTOCOLS = ['http:', 'https:', 'mailto:', 'tel:'];\n\n/**\n * Strips everything outside the whitelist, keeping the text of dropped elements.\n *\n * Runs on paste, on top of Angular's `DomSanitizer`: the sanitizer removes what is\n * dangerous, this removes what is merely foreign to the editor (Word spans, inline\n * styles, headings, tables) so the value stays a small, predictable HTML subset.\n */\nexport function normalizeHtml(html: string): string {\n if (typeof document === 'undefined') return html;\n const template = document.createElement('template');\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :\n `<template>` détaché, contenu inerte — étape de parsing du scrub, pas une\n injection dans le document. Registre : docs/SECURITY-PRACTICES.md. */\n template.innerHTML = html;\n scrubNode(template.content);\n return template.innerHTML;\n}\n\n/**\n * Applies the same scrubbing to a live element, in place.\n *\n * `insertHTML` re-decorates what it inserts (`style=\"background-color: transparent\"`\n * and friends) *after* our normalisation, so the markup has to be cleaned once more\n * once it is in the document. Attributes are removed node by node rather than by\n * rewriting `innerHTML`, which would drop the caret.\n */\nexport function scrubInPlace(root: ParentNode): void {\n scrubNode(root);\n}\n\n/** @internal Unwraps disallowed elements, voids the unsafe ones, drops attributes. */\nfunction scrubNode(root: ParentNode): void {\n for (const el of Array.from(root.querySelectorAll(VOIDED_TAGS))) el.remove();\n for (const el of Array.from(root.querySelectorAll('*'))) {\n if (!ALLOWED_TAGS.has(el.tagName)) {\n el.replaceWith(...Array.from(el.childNodes));\n continue;\n }\n for (const attr of Array.from(el.attributes)) {\n if (attr.name === 'class') {\n // Only the editor's own font/size/color classes survive — anything else\n // pasted in would style the value against a foreign stylesheet.\n const kept = attr.value\n .split(/\\s+/)\n .filter(\n (c) =>\n FONT_CLASSES.has(c) ||\n SIZE_CLASSES.has(c) ||\n COLOR_CLASSES.has(c) ||\n HIGHLIGHT_CLASSES.has(c),\n );\n if (kept.length) el.setAttribute('class', kept.join(' '));\n else el.removeAttribute('class');\n continue;\n }\n const keep = el.tagName === 'A' && attr.name === 'href' && isSafeHref(attr.value);\n if (!keep) el.removeAttribute(attr.name);\n }\n }\n}\n\n/** @internal Rejects `javascript:` and other non-navigational schemes. */\nfunction isSafeHref(href: string): boolean {\n try {\n return ALLOWED_HREF_PROTOCOLS.includes(new URL(href, document.baseURI).protocol);\n } catch {\n return false;\n }\n}\n\n/** Normalises a browser-produced empty document (`<br>`, empty block) to `''`. */\nexport function isEmptyHtml(html: string): boolean {\n return htmlToText(html).length === 0 && !/<(img|hr)\\b/i.test(html);\n}\n\n/** Plain-text projection of the value — what the character counter measures. */\nexport function htmlToText(html: string): string {\n if (!html) return '';\n if (typeof document === 'undefined') {\n // SSR fallback: good enough for a length, never rendered.\n return html.replace(/<[^>]*>/g, '').trim();\n }\n const template = document.createElement('template');\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :\n `<template>` détaché, contenu inerte, jamais rendu — on n'en lit que\n `textContent` pour compter les caractères. Registre :\n docs/SECURITY-PRACTICES.md. */\n template.innerHTML = html;\n return (template.content.textContent ?? '').trim();\n}\n","import {\n afterNextRender,\n booleanAttribute,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n output,\n SecurityContext,\n signal,\n viewChild,\n} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {FormsModule, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {BaseFormField} from '@4sh/ui-kit/forms';\nimport {UiField} from '@4sh/ui-kit/forms/ui-field';\nimport {UiButton} from '@4sh/ui-kit/actions/ui-button';\nimport {UiSelect} from '@4sh/ui-kit/forms/ui-select';\nimport {UiSwatch, UiSwatchPicker} from '@4sh/ui-kit/forms/ui-swatch-picker';\nimport {\n applyCommand,\n applyFontFamily,\n applyFontSize,\n applyHighlightColor,\n applyLink,\n applyTextColor,\n clearFormatMarkers,\n clearMarkerClass,\n convertColorMarkers,\n convertFontMarkers,\n convertHighlightMarkers,\n convertSizeMarkers,\n DEFAULT_EDITOR_TOOLS,\n EDITOR_COLORS,\n EDITOR_FONTS,\n EDITOR_HIGHLIGHTS,\n EDITOR_SELECT_TOOLS,\n EDITOR_SIZES,\n EDITOR_TOOL_META,\n EditorButtonTool,\n EditorFont,\n EditorSelectTool,\n EditorSize,\n EditorState,\n EditorTool,\n emptyEditorState,\n htmlToText,\n insertHtml,\n insertText,\n isEmptyHtml,\n normalizeHtml,\n readEditorState,\n readFontFamily,\n readFontSize,\n readHighlightColor,\n readTextColor,\n removeLink,\n resolveFontLabel,\n sanitizeEditorHtml,\n scrubInPlace,\n toggleCodeBlock,\n} from './ui-editor-commands';\n\n/** Where the toolbar sits relative to the editing area. */\nexport type EditorToolbarPosition = 'top' | 'bottom';\n\n/** Keyboard shortcut → tool (the browser applies these natively; we mirror the state). */\nconst SHORTCUTS: Record<string, EditorTool> = { b: 'bold', i: 'italic', u: 'underline' };\n\n/**\n * ui-editor — headless rich-text field, built on the `ui-field` shell (label +\n * box + helper) in **multiline** mode + a `contenteditable` area and its toolbar.\n *\n * Zero third-party engine: the formatting commands live in `ui-editor-commands`,\n * the single place that touches the legacy editing API. The value is an HTML\n * string, sanitised on the way in (`DomSanitizer`) and normalised to a small tag\n * whitelist on paste.\n *\n * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).\n */\n@Component({\n selector: 'ui-editor',\n imports: [UiField, UiButton, UiSwatchPicker, UiSelect, NgTemplateOutlet, FormsModule],\n templateUrl: './ui-editor.html',\n styleUrl: './ui-editor.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiEditor), multi: true }],\n})\nexport class UiEditor extends BaseFormField<string> {\n /**\n * Tools shown in the toolbar, in order (`separator` draws a divider).\n *\n * An empty or absent list falls back to the default set: a template binding an\n * optional variable (`[tools]=\"tools\"`) hands us `undefined`, which would\n * otherwise leave the editor without any formatting at all.\n */\n tools = input(DEFAULT_EDITOR_TOOLS, {\n transform: (value: readonly EditorTool[] | null | undefined) =>\n value?.length ? value : DEFAULT_EDITOR_TOOLS,\n });\n /** Hint shown while the editor is empty (no native placeholder on contenteditable). */\n placeholder = input<string>();\n /** Minimum height of the editing area, in lines of text. */\n minRows = input<number>(4);\n /** Maximum number of **text** characters (markup is not counted). */\n maxlength = input<number>();\n /** Shows a character counter under the field (`count` or `count / maxlength`). */\n showCount = input(false, { transform: booleanAttribute });\n /** Toolbar placement relative to the editing area. */\n toolbarPosition = input<EditorToolbarPosition>('top');\n\n /** Emitted on each edit with the new HTML value. */\n valueChange = output<string>();\n /** Emitted when the editing area receives focus. */\n editorFocus = output<FocusEvent>();\n /** Emitted when the editing area loses focus. */\n editorBlur = output<FocusEvent>();\n /** Emitted when the formatting under the caret changes. */\n selectionChange = output<EditorState>();\n\n /** @ignore */\n private readonly sanitizer = inject(DomSanitizer);\n /** @ignore */\n private readonly contentEl = viewChild<ElementRef<HTMLElement>>('contentEl');\n /** @ignore The rendered toolbar — holds the roving tabindex ring, in DOM order. */\n private readonly toolbarEl = viewChild<ElementRef<HTMLElement>>('toolbarEl');\n /** @ignore Text color popup (see {@link onColorToolClick}). */\n private readonly textColorPicker = viewChild<UiSwatchPicker>('textColorPicker');\n /** @ignore Highlight color popup (see {@link onColorToolClick}). */\n private readonly highlightColorPicker = viewChild<UiSwatchPicker>('highlightColorPicker');\n\n /**\n * @ignore Last HTML this component wrote out.\n *\n * The editing area owns its own DOM while the user types, so the value cannot be\n * bound with `[innerHTML]`: re-rendering it on every keystroke would collapse the\n * caret. Instead the DOM is only rewritten when the incoming value differs from\n * what we last emitted — i.e. when a form writes to us.\n */\n private lastEmitted = '';\n\n /** @ignore Formatting active at the caret. */\n protected readonly state = signal<EditorState>(emptyEditorState());\n /** @ignore Type family at the caret (`null` = the default family). */\n protected readonly currentFont = signal<EditorFont | null>(null);\n /** @ignore Text size at the caret (`null` = the default size). */\n protected readonly currentSize = signal<EditorSize | null>(null);\n /** @ignore Text color at the caret (`null` = the default color). */\n protected readonly currentTextColor = signal<string | null>(null);\n /** @ignore Highlight color at the caret (`null` = no highlight). */\n protected readonly currentHighlightColor = signal<string | null>(null);\n /** @ignore Index of the toolbar button reachable with Tab (roving tabindex). */\n protected readonly activeTool = signal(0);\n /** @ignore Open state of the `textColor` popup (drives its trigger's `aria-expanded`). */\n protected readonly textColorPickerOpen = signal(false);\n /** @ignore Open state of the `highlightColor` popup (drives its trigger's `aria-expanded`). */\n protected readonly highlightColorPickerOpen = signal(false);\n\n /**\n * @ignore Last selection seen inside the editing area.\n *\n * The buttons cancel their own mousedown and never take the focus, but opening\n * the font dropdown does — and a `contenteditable` loses its selection with it.\n * The range is therefore kept here and restored before the command runs.\n */\n private savedRange: Range | null = null;\n\n /** @ignore Sanitised value — never inject `modelValue` into the DOM raw. */\n private readonly safeValue = computed(() =>\n sanitizeEditorHtml(\n this.modelValue() ?? '',\n (html) => this.sanitizer.sanitize(SecurityContext.HTML, html) ?? '',\n ),\n );\n\n /** @ignore Plain-text length, what `maxlength` and the counter measure. */\n protected readonly charCount = computed(() => htmlToText(this.safeValue()).length);\n /** @ignore Keeps a floating label raised once focus leaves. */\n protected readonly isFilled = computed(() => this.charCount() > 0);\n /** @ignore Over the maxlength (only reachable programmatically). */\n protected readonly overLimit = computed(() => {\n const max = this.maxlength();\n return max != null && this.charCount() > max;\n });\n /** @ignore The placeholder only shows while there is nothing to read. */\n protected readonly showPlaceholder = computed(\n () => !!this.placeholder() && !this.hasFloatLabel() && this.charCount() === 0,\n );\n /** @ignore The area is editable (a read-only editor keeps its caret but not its edits). */\n protected readonly isEditable = computed(() => !this.isDisabled() && !this.readonly());\n\n /** @ignore Resolved toolbar entries (icon + accessible name + toggle state). */\n protected readonly toolbar = computed(() =>\n this.tools().map((tool, index) => ({\n tool,\n index,\n isSeparator: tool === 'separator',\n select: (EDITOR_SELECT_TOOLS.includes(tool as EditorSelectTool)\n ? tool\n : null) as EditorSelectTool | null,\n buttonTool: (tool === 'separator' || EDITOR_SELECT_TOOLS.includes(tool as EditorSelectTool)\n ? null\n : tool) as EditorButtonTool | null,\n meta:\n tool === 'separator' || EDITOR_SELECT_TOOLS.includes(tool as EditorSelectTool)\n ? null\n : EDITOR_TOOL_META[tool as EditorButtonTool],\n })),\n );\n /** @ignore Text sizes offered by the `fontSize` dropdown. */\n protected readonly sizes = EDITOR_SIZES;\n /**\n * @ignore Type families, labelled with the face each token actually resolves to.\n *\n * Read once the view exists, since the value comes from the computed style: a\n * hardcoded \"Inter\" would lie as soon as a project rebinds the token.\n */\n protected readonly fonts = signal(EDITOR_FONTS.map((f) => ({ ...f })));\n /** @ignore `fontFamily` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */\n protected readonly fontFamilyOptions = computed(() =>\n this.fonts().map((font) => ({ value: font.key, label: font.label })),\n );\n /** @ignore `fontSize` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */\n protected readonly fontSizeOptions = computed(() =>\n this.sizes.map((size) => ({ value: size.key, label: size.label })),\n );\n /** @ignore Swatch entry backing the `textColor` button's color indicator. */\n protected readonly currentTextColorSwatch = computed(() =>\n EDITOR_COLORS.find((c) => c.key === this.currentTextColor()),\n );\n /** @ignore Swatch entry backing the `highlightColor` button's color indicator. */\n protected readonly currentHighlightColorSwatch = computed(() =>\n EDITOR_HIGHLIGHTS.find((c) => c.key === this.currentHighlightColor()),\n );\n /** @ignore The toolbar has at least one actionable entry. */\n protected readonly hasToolbar = computed(() => this.tools().some((t) => t !== 'separator'));\n /**\n * @ignore Index carrying the toolbar's single tab stop.\n *\n * Falls back to the first actionable tool, so a `tools` list opening on a\n * separator still leaves the toolbar reachable with Tab.\n */\n protected readonly tabStop = computed(() => {\n const actionable = this.toolbar().filter((entry) => !entry.isSeparator);\n if (!actionable.length) return -1;\n const active = this.activeTool();\n return actionable.some((entry) => entry.index === active) ? active : actionable[0].index;\n });\n\n /** @ignore id of the character counter (for `aria-describedby`). */\n protected readonly countId = computed(() => `${this.resolvedId()}-count`);\n /** @ignore `aria-describedby` combines the message and the counter, whichever are shown. */\n protected readonly describedByIds = computed(() => {\n const ids = [\n this.displayMessage() ? this.messageId() : null,\n this.showCount() ? this.countId() : null,\n ].filter(Boolean);\n return ids.length ? ids.join(' ') : null;\n });\n\n constructor() {\n super();\n // Label each family with the face its token actually resolves to.\n afterNextRender(() => {\n this.fonts.set(\n EDITOR_FONTS.map((f) => ({ ...f, label: resolveFontLabel(f.cssVar, f.label) })),\n );\n });\n // Sync the DOM when the value comes from outside (form write, reset).\n effect(() => {\n const value = this.safeValue();\n const el = this.contentEl()?.nativeElement;\n if (!el) return;\n // Our own edit read back, or already on screen: rewriting would collapse the\n // caret. Raw value on purpose: sanitising re-encodes it (`é` → `é`).\n if (this.modelValue() === this.lastEmitted || el.innerHTML === value) return;\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :\n `value` vient de `safeValue()`, donc de\n `DomSanitizer.sanitize(SecurityContext.HTML, …)`, plus le seul `style`\n d'alignement et de retrait de `sanitizeStyle()`. L'écriture directe est\n imposée par le `contenteditable` : une liaison `[innerHTML]` réécrirait\n la zone à chaque frappe et effondrerait le caret. Registre :\n docs/SECURITY-PRACTICES.md. */\n el.innerHTML = value;\n this.lastEmitted = value;\n });\n }\n\n /** @ignore Auto-generated ids read as `ui-editor-*`. */\n protected override uidPrefix(): string {\n return 'ui-editor';\n }\n\n /** Focuses the editing area. */\n focus(options?: FocusOptions): void {\n this.contentEl()?.nativeElement.focus(options);\n }\n\n // --- Editing ----------------------------------------------------------\n\n /** @ignore Input: single source of the value (view → form). */\n protected onInput(): void {\n const el = this.contentEl()?.nativeElement;\n if (!el) return;\n const html = isEmptyHtml(el.innerHTML) ? '' : el.innerHTML;\n this.lastEmitted = html;\n this.modelValue.set(html);\n this.emitChange(html);\n this.valueChange.emit(html);\n this.refreshState();\n }\n\n /**\n * @ignore Enforces `maxlength` on the text, not the markup.\n *\n * Deletions and formatting must stay available once the limit is reached, so only\n * the insertion intents are cancelled.\n */\n protected onBeforeInput(event: InputEvent): void {\n const max = this.maxlength();\n if (max == null || !event.inputType.startsWith('insert')) return;\n const selection = document.getSelection();\n const replaced = selection && !selection.isCollapsed ? selection.toString().length : 0;\n const incoming = event.data?.length ?? 1;\n if (this.charCount() - replaced + incoming > max) event.preventDefault();\n }\n\n /** @ignore Paste is reduced to the editor's own tag whitelist. */\n protected onPaste(event: ClipboardEvent): void {\n if (!this.isEditable()) return;\n event.preventDefault();\n const clipboard = event.clipboardData;\n if (!clipboard) return;\n const html = clipboard.getData('text/html');\n if (html) {\n const safe = this.sanitizer.sanitize(SecurityContext.HTML, normalizeHtml(html)) ?? '';\n insertHtml(safe);\n // `insertHTML` re-decorates what it inserted; strip that back off in place.\n const el = this.contentEl()?.nativeElement;\n if (el) scrubInPlace(el);\n } else {\n insertText(clipboard.getData('text/plain'));\n }\n this.onInput();\n }\n\n /** @ignore The browser applies Ctrl/Cmd+B/I/U itself; we only mirror the state. */\n protected onContentKeydown(event: KeyboardEvent): void {\n if (!(event.metaKey || event.ctrlKey)) return;\n if (!SHORTCUTS[event.key.toLowerCase()]) return;\n // Let the native shortcut run, then read the resulting formatting back.\n queueMicrotask(() => this.refreshState());\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.editorBlur.emit(event);\n }\n\n /** @ignore Recomputes the active formatting and notifies the consumer. */\n protected refreshState(): void {\n this.rememberSelection();\n const anchor = document.getSelection()?.anchorNode ?? null;\n this.currentFont.set(readFontFamily(anchor));\n this.currentSize.set(readFontSize(anchor));\n this.currentTextColor.set(readTextColor(anchor));\n this.currentHighlightColor.set(readHighlightColor(anchor));\n\n const next = readEditorState();\n const prev = this.state();\n if ((Object.keys(next) as (keyof EditorState)[]).every((k) => next[k] === prev[k])) return;\n this.state.set(next);\n this.selectionChange.emit(next);\n }\n\n /** @ignore Keeps the caret position around for controls that steal the focus. */\n private rememberSelection(): void {\n const el = this.contentEl()?.nativeElement;\n const selection = document.getSelection();\n if (!el || !selection?.rangeCount) return;\n const range = selection.getRangeAt(0);\n if (el.contains(range.commonAncestorContainer)) this.savedRange = range.cloneRange();\n }\n\n /** @ignore Puts the remembered caret back before running a command. */\n private restoreSelection(): void {\n this.focus();\n const range = this.savedRange;\n if (!range) return;\n const selection = document.getSelection();\n selection?.removeAllRanges();\n selection?.addRange(range);\n }\n\n // --- Toolbar ----------------------------------------------------------\n\n /** @ignore Runs a button tool against the selection the mousedown handler preserved. */\n protected runTool(tool: EditorButtonTool, index: number, event?: MouseEvent): void {\n if (!this.isEditable()) return;\n this.activeTool.set(index);\n if (tool === 'textColor' || tool === 'highlightColor') {\n this.onColorToolClick(tool, event!);\n return;\n }\n this.focus();\n if (tool === 'link') this.promptForLink();\n else if (tool === 'codeBlock') toggleCodeBlock();\n else if (tool === 'clearFormat') this.clearFormat();\n else applyCommand(tool);\n this.onInput();\n }\n\n /**\n * @ignore `removeFormat` (the native command behind `clearFormat`) only\n * strips inline formatting the browser itself applies — bold, italic,\n * underline… — never the `<span class=\"ui-editor-*\">` wrappers `fontFamily`/\n * `fontSize`/`textColor`/`highlightColor` write, so those survived\n * \"Effacer le formatage\" untouched. Run the native command, then unwrap\n * those classes too, across whatever is currently selected.\n */\n private clearFormat(): void {\n applyCommand('clearFormat');\n const el = this.contentEl()?.nativeElement;\n const selection = document.getSelection();\n if (!el || !selection?.rangeCount) return;\n const range = selection.getRangeAt(0);\n if (!el.contains(range.commonAncestorContainer)) return;\n clearFormatMarkers(el, range);\n }\n\n /**\n * @ignore Trigger click for `textColor`/`highlightColor`: opens the matching\n * `ui-swatch-picker` instead of applying a command directly — same\n * \"picker takes the focus, the caret is restored before the real command\n * runs\" pattern as {@link onSelectMenuTrigger}, but these two are button\n * tools (a one-shot action button, not a value dropdown), so they run\n * through `runTool` rather than `onSelectChange`.\n */\n private onColorToolClick(tool: 'textColor' | 'highlightColor', event: MouseEvent): void {\n this.rememberSelection();\n const picker =\n tool === 'textColor' ? this.textColorPicker() : this.highlightColorPicker();\n picker?.toggle(event);\n }\n\n /**\n * @ignore Applies the text color chosen in the `textColor` picker.\n *\n * The popup took the focus, so the caret is put back first. `foreColor`\n * emits a legacy `<font>` element, immediately rewritten into a class.\n */\n protected onTextColorSelect(swatch: UiSwatch | null): void {\n if (!this.isEditable()) return;\n this.restoreSelection();\n const el = this.contentEl()?.nativeElement;\n if (swatch) {\n applyTextColor();\n if (el) convertColorMarkers(el, `ui-editor-color-${swatch.key}`);\n } else if (el && this.savedRange) {\n for (const color of EDITOR_COLORS) clearMarkerClass(el, this.savedRange, color.className);\n }\n this.onInput();\n }\n\n /**\n * @ignore Applies the highlight color chosen in the `highlightColor` picker.\n *\n * The popup took the focus, so the caret is put back first. `hiliteColor`\n * emits a `<span style=\"background-color:…\">`, immediately rewritten into a\n * class (see {@link convertHighlightMarkers}).\n */\n protected onHighlightColorSelect(swatch: UiSwatch | null): void {\n if (!this.isEditable()) return;\n this.restoreSelection();\n const el = this.contentEl()?.nativeElement;\n if (swatch) {\n applyHighlightColor();\n if (el) convertHighlightMarkers(el, `ui-editor-highlight-${swatch.key}`);\n } else if (el && this.savedRange) {\n for (const color of EDITOR_HIGHLIGHTS) {\n clearMarkerClass(el, this.savedRange, color.className);\n }\n }\n this.onInput();\n }\n\n /** @ignore Options for a `ui-select` dropdown ({@link UiSelect} `optionLabel`/`optionValue`). */\n protected selectOptions(tool: EditorSelectTool): { value: string; label: string }[] {\n return tool === 'fontFamily' ? this.fontFamilyOptions() : this.fontSizeOptions();\n }\n\n /**\n * @ignore Current value of a `ui-select` dropdown, so it reflects the caret.\n *\n * Falls back to the value actually in force when no class was applied: text\n * carrying no class really is rendered with `--fontfamily-base` at the\n * default size, so naming it states a fact rather than a placeholder.\n */\n protected selectValue(tool: EditorSelectTool): string {\n if (tool === 'fontFamily') return this.currentFont() ?? 'base';\n return this.currentSize() ?? 'default';\n }\n\n /** @ignore Accessible name of a dropdown — spelled out, it is never truncated. */\n protected selectLabel(tool: EditorSelectTool): string {\n if (tool === 'fontFamily') return 'Police';\n return 'Taille du texte';\n }\n\n /**\n * @ignore Applies the value chosen in a `ui-select` dropdown.\n *\n * `ui-select` opens its own overlay and takes the focus, so the caret is put\n * back first — same reasoning as the color pickers. `fontName`/`fontSize`\n * each emit a legacy `<font>` element, immediately rewritten into a class.\n */\n protected onSelectValueChange(tool: EditorSelectTool, value: unknown, index: number): void {\n this.activeTool.set(index);\n if (!this.isEditable() || value == null) return;\n this.restoreSelection();\n const el = this.contentEl()?.nativeElement;\n if (tool === 'fontFamily') {\n const choice = this.fonts().find((f) => f.key === value);\n if (!choice) return;\n applyFontFamily();\n if (el) convertFontMarkers(el, choice.className);\n } else {\n const choice = this.sizes.find((s) => s.key === value);\n if (!choice) return;\n applyFontSize();\n if (el) convertSizeMarkers(el, choice.className);\n }\n this.onInput();\n }\n\n /**\n * @ignore v1 link flow: the native prompt.\n *\n * Deliberately minimal — a popover with a `ui-input` is the planned replacement,\n * and it changes the component's overlay footprint, not this call site.\n */\n private promptForLink(): void {\n const href = window.prompt('Adresse du lien (laisser vide pour retirer le lien)');\n if (href === null) return;\n if (href.trim() === '') removeLink();\n else applyLink(href.trim());\n }\n\n /** @ignore Keeps the caret in the editing area when a tool is clicked. */\n protected onToolbarMousedown(event: MouseEvent): void {\n event.preventDefault();\n }\n\n /** @ignore Roving tabindex: the toolbar is one tab stop, arrows move within it. */\n protected onToolbarKeydown(event: KeyboardEvent): void {\n const indexes = this.toolbar()\n .filter((entry) => !entry.isSeparator)\n .map((entry) => entry.index);\n if (!indexes.length) return;\n const current = Math.max(0, indexes.indexOf(this.tabStop()));\n\n let next: number;\n switch (event.key) {\n case 'ArrowRight':\n next = indexes[(current + 1) % indexes.length];\n break;\n case 'ArrowLeft':\n next = indexes[(current - 1 + indexes.length) % indexes.length];\n break;\n case 'Home':\n next = indexes[0];\n break;\n case 'End':\n next = indexes[indexes.length - 1];\n break;\n case 'Escape':\n event.preventDefault();\n this.focus();\n return;\n default:\n return;\n }\n\n event.preventDefault();\n this.activeTool.set(next);\n this.focusTool(next);\n }\n\n /**\n * @ignore Moves the DOM focus onto the control now holding the tab stop.\n *\n * Queried from the live toolbar rather than from the `ui-button` children:\n * DOM order is the visual order, and every tool (buttons and select-menu\n * triggers alike) renders as a `<button>`.\n */\n private focusTool(index: number): void {\n const position = this.toolbar().filter((e) => !e.isSeparator && e.index <= index).length - 1;\n const controls = this.toolbarEl()?.nativeElement.querySelectorAll<HTMLElement>('button');\n controls?.[position]?.focus();\n }\n\n /**\n * @ignore `var(--primitives-…)` for the `textColor`/`highlightColor`\n * buttons' color indicator, or `null` for every other tool (no swatch\n * active, or a tool the indicator does not apply to).\n */\n protected colorIndicatorVar(tool: EditorButtonTool | null): string | null {\n const swatch =\n tool === 'textColor'\n ? this.currentTextColorSwatch()\n : tool === 'highlightColor'\n ? this.currentHighlightColorSwatch()\n : null;\n return swatch ? `var(${swatch.cssVar})` : null;\n }\n\n /**\n * @ignore Native attributes forwarded to a tool button.\n *\n * `aria-pressed` only on the toggles: `link` and `clearFormat` are one-shot\n * actions, and a permanently unpressed toggle would misreport them.\n * `textColor`/`highlightColor` forward `aria-haspopup`/`aria-expanded`\n * instead — they open a `ui-swatch-picker` popup, not a toggle.\n */\n protected toolProps(tool: EditorTool): Record<string, string> | undefined {\n if (tool === 'textColor' || tool === 'highlightColor') {\n const open =\n tool === 'textColor' ? this.textColorPickerOpen() : this.highlightColorPickerOpen();\n return { 'aria-haspopup': 'true', 'aria-expanded': open ? 'true' : 'false' };\n }\n const state = this.state();\n if (!(tool in state)) return undefined;\n return { 'aria-pressed': state[tool as keyof EditorState] ? 'true' : 'false' };\n }\n}\n","<ui-field\n multiline\n [label]=\"label()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n [hasFooter]=\"showCount()\"\n>\n <div class=\"ui-editor\" [class._small]=\"size() === 'small'\" [style.--_rows]=\"minRows()\">\n @if (toolbarPosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n\n <div class=\"ui-editor-area\">\n <div\n #contentEl\n class=\"ui-editor-content\"\n [class._small]=\"size() === 'small'\"\n [id]=\"resolvedId()\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"isEditable() ? 'true' : 'false'\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"describedByIds()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (beforeinput)=\"onBeforeInput($any($event))\"\n (paste)=\"onPaste($event)\"\n (keydown)=\"onContentKeydown($event)\"\n (keyup)=\"refreshState()\"\n (mouseup)=\"refreshState()\"\n (focus)=\"editorFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n\n @if (showPlaceholder()) {\n <span class=\"ui-editor-placeholder\" aria-hidden=\"true\">{{ placeholder() }}</span>\n }\n </div>\n\n @if (toolbarPosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n </div>\n\n @if (showCount()) {\n <span\n uiFieldFooter\n class=\"ui-editor-count\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n [class._over]=\"overLimit()\"\n [attr.id]=\"countId()\"\n >\n {{ charCount() }}\n @if (maxlength(); as max) {\n / {{ max }}\n }\n </span>\n }\n</ui-field>\n\n<ng-template #toolbarTpl>\n @if (hasToolbar()) {\n <!-- ARIA toolbar pattern: keyboard delegated to the role=\"toolbar\" container,\n focus lives on the items (roving tabindex), same as ui-menu. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n #toolbarEl\n class=\"ui-editor-toolbar\"\n [class._bottom]=\"toolbarPosition() === 'bottom'\"\n role=\"toolbar\"\n aria-label=\"Mise en forme\"\n aria-orientation=\"horizontal\"\n (mousedown)=\"onToolbarMousedown($event)\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (entry of toolbar(); track entry.index) {\n @if (entry.isSeparator) {\n <span class=\"ui-editor-toolbar-separator\" aria-hidden=\"true\"></span>\n } @else if (entry.select; as select) {\n <!-- The dropdown takes the focus, so the command restores the caret\n before it runs (see onSelectValueChange). -->\n <ui-select\n class=\"ui-editor-tool ui-editor-select\"\n size=\"small\"\n [options]=\"selectOptions(select)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"selectValue(select)\"\n [ariaLabel]=\"selectLabel(select)\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n (valueChange)=\"onSelectValueChange(select, $event, entry.index)\"\n />\n } @else {\n <ui-button\n class=\"ui-editor-tool\"\n [class._colorTool]=\"\n entry.buttonTool === 'textColor' || entry.buttonTool === 'highlightColor'\n \"\n variant=\"ghost\"\n level=\"low\"\n size=\"small\"\n iconOnly\n [icon]=\"entry.meta!.icon\"\n [ariaLabel]=\"entry.meta!.label\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n [buttonProps]=\"toolProps(entry.buttonTool!)\"\n [style.--ui-editor-swatch-indicator-color]=\"colorIndicatorVar(entry.buttonTool)\"\n (buttonClick)=\"runTool(entry.buttonTool!, entry.index, $event)\"\n />\n }\n }\n\n <!-- `textColor`/`highlightColor` popups: no trigger of their own (same\n composition contract as `ui-menu`), opened via `runTool` ->\n `onColorToolClick` -> `toggle(event)`. -->\n <ui-swatch-picker\n #textColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentTextColor()\"\n ariaLabel=\"Couleur du texte\"\n (swatchSelect)=\"onTextColorSelect($event)\"\n (opened)=\"textColorPickerOpen.set(true)\"\n (closed)=\"textColorPickerOpen.set(false)\"\n />\n <ui-swatch-picker\n #highlightColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentHighlightColor()\"\n ariaLabel=\"Couleur de surlignage\"\n (swatchSelect)=\"onHighlightColorSelect($event)\"\n (opened)=\"highlightColorPickerOpen.set(true)\"\n (closed)=\"highlightColorPickerOpen.set(false)\"\n />\n </div>\n }\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-editor\n */\n\nexport * from './lib/ui-editor';\nexport * from './lib/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","../../../projects/ui-kit/forms/ui-editor/src/lib/ui-editor.html","../../../projects/ui-kit/forms/ui-editor/src/public-api.ts","../../../projects/ui-kit/forms/ui-editor/src/4sh-ui-kit-forms-ui-editor.ts"],"sourcesContent":["import { DEFAULT_SWATCH_PALETTE } from '@4sh/ui-kit/forms/ui-swatch-picker';\n\n/**\n * Rich-text command layer — the only place that talks to the legacy editing API.\n *\n * `document.execCommand` is deprecated but remains the sole cross-browser way to\n * apply inline formatting to a `contenteditable` selection without pulling in an\n * editing engine (ProseMirror, Quill…). It is confined to this file so the kit\n * keeps a single third-party-free dependency surface, and so a future Selection/\n * Range implementation only has to replace these functions.\n */\n\n/**\n * A formatting action the toolbar can trigger.\n *\n * `separator` is purely visual; `fontFamily` renders a dropdown rather than a\n * button, since it picks among values instead of toggling one.\n */\nexport type EditorTool =\n | 'bold'\n | 'italic'\n | 'underline'\n | 'bulletList'\n | 'orderedList'\n | 'codeBlock'\n | 'fontFamily'\n | 'fontSize'\n | 'indent'\n | 'outdent'\n | 'alignLeft'\n | 'alignCenter'\n | 'alignRight'\n | 'alignJustify'\n | 'textColor'\n | 'highlightColor'\n | 'link'\n | 'clearFormat'\n | 'separator';\n\n/** Tools rendered as a dropdown: they pick among values instead of toggling one. */\nexport type EditorSelectTool = 'fontFamily' | 'fontSize';\n\n/** Tools rendered as an icon button. */\nexport type EditorButtonTool = Exclude<EditorTool, 'separator' | EditorSelectTool>;\n\nexport const EDITOR_SELECT_TOOLS: readonly EditorSelectTool[] = [\n 'fontFamily',\n 'fontSize',\n];\n\n/** Commands whose active/inactive state the toolbar reflects via `aria-pressed`. */\nexport type EditorToggleTool = Extract<\n EditorTool,\n | 'bold'\n | 'italic'\n | 'underline'\n | 'bulletList'\n | 'orderedList'\n | 'codeBlock'\n | 'alignLeft'\n | 'alignCenter'\n | 'alignRight'\n | 'alignJustify'\n>;\n\n/** Active formatting at the caret, recomputed after every interaction. */\nexport type EditorState = Record<EditorToggleTool, boolean>;\n\n/**\n * Type families the editor can apply.\n *\n * A closed list on purpose: a free font picker would write an arbitrary family\n * into the value and step outside the `--fontfamily-*` tokens. The system has no\n * serif face, so the list is the three families the tokens actually carry.\n */\nexport type EditorFont = 'base' | 'title' | 'monospace';\n\n/**\n * Font key → class written into the value, token holding the family, and the\n * fallback label used when the real name cannot be read (SSR, unset token).\n *\n * The dropdown shows the **actual** face name, resolved from the token at runtime\n * (see {@link resolveFontLabel}) rather than hardcoded: a project that rebinds\n * `--fontfamily-base` would otherwise see a menu naming a font it no longer uses.\n */\nexport const EDITOR_FONTS: readonly {\n key: EditorFont;\n className: string;\n cssVar: string;\n label: string;\n}[] = [\n { key: 'base', className: 'ui-editor-font-base', cssVar: '--fontfamily-base', label: 'Standard' },\n {\n key: 'title',\n className: 'ui-editor-font-title',\n cssVar: '--fontfamily-title',\n label: 'Titre',\n },\n {\n key: 'monospace',\n className: 'ui-editor-font-monospace',\n cssVar: '--fontfamily-monospace',\n label: 'Monospace',\n },\n];\n\n/**\n * First face named by a font token — what the family dropdown displays.\n *\n * `--fontfamily-base` holds a whole stack (`Inter, system-ui, …`); only the head\n * of it is a name a person recognises.\n */\nexport function resolveFontLabel(cssVar: string, fallback: string): string {\n if (typeof document === 'undefined') return fallback;\n const raw = getComputedStyle(document.documentElement).getPropertyValue(cssVar).trim();\n const first = raw\n .split(',')[0]\n ?.trim()\n .replace(/^[\"']|[\"']$/g, '');\n return first || fallback;\n}\n\n/** Text sizes the editor can apply, as a step on the typography scale. */\nexport type EditorSize = 'sm' | 'default' | 'lg' | 'xl';\n\n/** Size key → class written into the value + French label for the dropdown. */\nexport const EDITOR_SIZES: readonly { key: EditorSize; className: string; label: string }[] = [\n { key: 'sm', className: 'ui-editor-size-sm', label: 'Petit' },\n { key: 'default', className: 'ui-editor-size-default', label: 'Normal' },\n { key: 'lg', className: 'ui-editor-size-lg', label: 'Grand' },\n { key: 'xl', className: 'ui-editor-size-xl', label: 'Très grand' },\n];\n\nconst SIZE_CLASSES = new Set(EDITOR_SIZES.map((s) => s.className));\n\nconst FONT_CLASSES = new Set(EDITOR_FONTS.map((f) => f.className));\n\n/**\n * The tools enabled when the consumer does not provide a `tools` list.\n *\n * There is no block-level dropdown (no `blockFormat`, no headings): the editor\n * only ever produces `<p>`. `fontFamily`/`fontSize` are both first-class,\n * always-on tools rather than one gated behind the other.\n *\n * `clearFormat` is deliberately absent for now: `clearFormatMarkers()` does not\n * reliably clear every marker class yet. It stays available for a project that\n * explicitly adds it to `tools`, but shipping it by default would be shipping\n * a broken button.\n */\nexport const DEFAULT_EDITOR_TOOLS: readonly EditorTool[] = [\n 'fontFamily',\n 'fontSize',\n 'separator',\n 'bold',\n 'italic',\n 'underline',\n 'separator',\n 'bulletList',\n 'orderedList',\n 'separator',\n 'alignLeft',\n 'alignCenter',\n 'alignRight',\n 'alignJustify',\n 'separator',\n 'link',\n 'codeBlock',\n];\n\n/** Toolbar metadata per button tool: icon (FontAwesome) + French accessible name. */\nexport const EDITOR_TOOL_META: Record<EditorButtonTool, { icon: string; label: string }> = {\n bold: { icon: 'bold', label: 'Gras' },\n italic: { icon: 'italic', label: 'Italique' },\n underline: { icon: 'underline', label: 'Souligné' },\n bulletList: { icon: 'list-ul', label: 'Liste à puces' },\n orderedList: { icon: 'list-ol', label: 'Liste numérotée' },\n codeBlock: { icon: 'code', label: 'Bloc de code' },\n indent: { icon: 'indent', label: 'Augmenter le retrait' },\n outdent: { icon: 'outdent', label: 'Diminuer le retrait' },\n alignLeft: { icon: 'align-left', label: 'Aligner à gauche' },\n alignCenter: { icon: 'align-center', label: 'Centrer' },\n alignRight: { icon: 'align-right', label: 'Aligner à droite' },\n alignJustify: { icon: 'align-justify', label: 'Justifier' },\n textColor: { icon: 'font', label: 'Couleur du texte' },\n highlightColor: { icon: 'highlighter', label: 'Couleur de surlignage' },\n link: { icon: 'link', label: 'Lien' },\n clearFormat: { icon: 'text-slash', label: 'Effacer le formatage' },\n};\n\n/** Tool → legacy command name. */\nconst NATIVE_COMMAND: Record<\n Exclude<EditorButtonTool, 'link' | 'codeBlock' | 'textColor' | 'highlightColor'>,\n string\n> = {\n bold: 'bold',\n italic: 'italic',\n underline: 'underline',\n bulletList: 'insertUnorderedList',\n orderedList: 'insertOrderedList',\n indent: 'indent',\n outdent: 'outdent',\n alignLeft: 'justifyLeft',\n alignCenter: 'justifyCenter',\n alignRight: 'justifyRight',\n alignJustify: 'justifyFull',\n clearFormat: 'removeFormat',\n};\n\nconst TOGGLE_TOOLS: readonly Exclude<EditorToggleTool, 'codeBlock'>[] = [\n 'bold',\n 'italic',\n 'underline',\n 'bulletList',\n 'orderedList',\n 'alignLeft',\n 'alignCenter',\n 'alignRight',\n 'alignJustify',\n];\n\n/** Every state off — the value used before the first render and on SSR. */\nexport function emptyEditorState(): EditorState {\n return {\n bold: false,\n italic: false,\n underline: false,\n bulletList: false,\n orderedList: false,\n codeBlock: false,\n alignLeft: false,\n alignCenter: false,\n alignRight: false,\n alignJustify: false,\n };\n}\n\n/** Applies a formatting command to the current selection. */\nexport function applyCommand(\n tool: Exclude<EditorButtonTool, 'link' | 'codeBlock' | 'textColor' | 'highlightColor'>,\n): void {\n document.execCommand(NATIVE_COMMAND[tool], false);\n}\n\n// --- Code block ---------------------------------------------------------\n\n/** Toggles the block under the caret between `<pre>` and a plain paragraph. */\nexport function toggleCodeBlock(): void {\n document.execCommand('formatBlock', false, isInCodeBlock() ? 'p' : 'pre');\n}\n\n/** The caret sits in a code block. */\nexport function isInCodeBlock(): boolean {\n try {\n return (document.queryCommandValue('formatBlock') || '').toLowerCase() === 'pre';\n } catch {\n return false;\n }\n}\n\n// --- Font family --------------------------------------------------------\n\n/**\n * Marker handed to `fontName`, immediately rewritten into a class.\n *\n * `fontName` is the only command that can apply a family to an arbitrary\n * selection, but it emits `<font face=\"…\">` — an obsolete tag carrying a raw\n * family name. We let it run, then convert its output so the value only ever\n * holds a class bound to a `--fontfamily-*` token.\n */\nconst FONT_MARKER = '__ui-editor-font__';\n\n/** Applies a type family to the selection (see {@link convertFontMarkers}). */\nexport function applyFontFamily(): void {\n document.execCommand('fontName', false, FONT_MARKER);\n}\n\n/** Rewrites the `<font>` elements `fontName` just produced into `<span class>`. */\nexport function convertFontMarkers(root: ParentNode, className: string): void {\n convertMarkers(root, `font[face=\"${FONT_MARKER}\"]`, className, FONT_CLASSES);\n}\n\n/** @internal Replaces the matched legacy `<font>` elements with a classed span. */\nfunction convertMarkers(\n root: ParentNode,\n selector: string,\n className: string,\n family: ReadonlySet<string>,\n): void {\n const spans: HTMLElement[] = [];\n for (const el of Array.from(root.querySelectorAll(selector))) {\n const span = document.createElement('span');\n span.className = className;\n span.append(...Array.from(el.childNodes));\n el.replaceWith(span);\n spans.push(span);\n }\n\n // A same-family class left inside would win over the new one.\n for (const span of spans) {\n for (const inner of Array.from(span.querySelectorAll<HTMLElement>('[class]'))) {\n for (const cls of Array.from(inner.classList))\n if (family.has(cls)) inner.classList.remove(cls);\n if (inner.classList.length > 0) continue;\n inner.removeAttribute('class');\n if (inner.tagName === 'SPAN' && inner.attributes.length === 0) {\n inner.replaceWith(...Array.from(inner.childNodes));\n }\n }\n }\n\n // Replacing the nodes collapsed the selection: put it back.\n const live = spans.filter((span) => span.isConnected);\n const selection = document.getSelection();\n if (!live.length || !selection) return;\n const last = live[live.length - 1];\n const range = document.createRange();\n range.setStart(live[0], 0);\n range.setEnd(last, last.childNodes.length);\n selection.removeAllRanges();\n selection.addRange(range);\n}\n\n/**\n * Type family in force at the caret.\n *\n * Falls back to the family the text is actually rendered with when no class was\n * applied: a heading carries `--fontfamily-title` from its own styling, and\n * reporting the base family there would name a font the reader does not see.\n * `null` only when the computed face matches none of the system families.\n */\nexport function readFontFamily(node: Node | null): EditorFont | null {\n const tagged = findClassKey(node, EDITOR_FONTS);\n if (tagged) return tagged;\n\n const el: HTMLElement | null =\n node?.nodeType === Node.ELEMENT_NODE ? (node as HTMLElement) : (node?.parentElement ?? null);\n if (!el || typeof getComputedStyle !== 'function') return null;\n\n const rendered = firstFace(getComputedStyle(el).fontFamily);\n return (\n EDITOR_FONTS.find((f) => firstFace(resolveFontLabel(f.cssVar, '')) === rendered)?.key ?? null\n );\n}\n\n/** @internal Head of a font stack, unquoted and lowercased for comparison. */\nfunction firstFace(stack: string): string {\n return (stack.split(',')[0] ?? '')\n .trim()\n .replace(/^[\"']|[\"']$/g, '')\n .toLowerCase();\n}\n\n// --- Font size ----------------------------------------------------------\n\n/**\n * Marker handed to `fontSize`, immediately rewritten into a class.\n *\n * Same trick as the family: `fontSize` is the only command that can size an\n * arbitrary selection, but it emits `<font size=\"7\">` — a legacy 1-7 scale with\n * no relation to the typography tokens.\n */\nconst SIZE_MARKER = '7';\n\n/** Applies a text size to the selection (see {@link convertSizeMarkers}). */\nexport function applyFontSize(): void {\n document.execCommand('fontSize', false, SIZE_MARKER);\n}\n\n/** Rewrites the `<font>` elements `fontSize` just produced into `<span class>`. */\nexport function convertSizeMarkers(root: ParentNode, className: string): void {\n convertMarkers(root, `font[size=\"${SIZE_MARKER}\"]`, className, SIZE_CLASSES);\n}\n\n/** Text size active at the caret, or `null` when the text uses the default. */\nexport function readFontSize(node: Node | null): EditorSize | null {\n return findClassKey(node, EDITOR_SIZES);\n}\n\n// --- Text color / highlight color ---------------------------------------\n\n/**\n * Color key → class written into the value, token holding the swatch, and\n * label, derived from `ui-swatch-picker`'s default palette rather than\n * hand-duplicated: the editor's color tools and the nuancier it opens must\n * always offer the same token set.\n */\nexport const EDITOR_COLORS: readonly {\n key: string;\n className: string;\n cssVar: string;\n label: string;\n}[] = DEFAULT_SWATCH_PALETTE.flatMap((group) =>\n group.swatches.map((swatch) => ({\n key: swatch.key,\n className: `ui-editor-color-${swatch.key}`,\n cssVar: swatch.cssVar,\n label: swatch.label,\n })),\n);\n\n/** Same key set as {@link EDITOR_COLORS}, classed separately for the highlight tool. */\nexport const EDITOR_HIGHLIGHTS: readonly {\n key: string;\n className: string;\n cssVar: string;\n label: string;\n}[] = DEFAULT_SWATCH_PALETTE.flatMap((group) =>\n group.swatches.map((swatch) => ({\n key: swatch.key,\n className: `ui-editor-highlight-${swatch.key}`,\n cssVar: swatch.cssVar,\n label: swatch.label,\n })),\n);\n\nconst COLOR_CLASSES = new Set(EDITOR_COLORS.map((c) => c.className));\nconst HIGHLIGHT_CLASSES = new Set(EDITOR_HIGHLIGHTS.map((c) => c.className));\n\n/**\n * Marker handed to `foreColor`, immediately rewritten into a class.\n *\n * `foreColor` is the only command that can color an arbitrary selection, but\n * it emits `<font color=\"…\">` — same trick as the family/size markers. Must\n * be a value the browser accepts as a real color (unlike `fontName`'s marker,\n * which is free text): an unparseable string is silently dropped instead of\n * being written to the `color` attribute. A hex triplet unlikely to collide\n * with a real token value is used, and Chromium/Firefox both echo it back\n * verbatim on the `<font color>` attribute (verified empirically).\n */\nconst COLOR_MARKER = '#010203';\n\n/** Applies a text color to the selection (see {@link convertColorMarkers}). */\nexport function applyTextColor(): void {\n document.execCommand('foreColor', false, COLOR_MARKER);\n}\n\n/** Rewrites the `<font>` elements `foreColor` just produced into `<span class>`. */\nexport function convertColorMarkers(root: ParentNode, className: string): void {\n convertMarkers(root, `font[color=\"${COLOR_MARKER}\"]`, className, COLOR_CLASSES);\n}\n\n/** Text color active at the caret, or `null` when the text uses the default. */\nexport function readTextColor(node: Node | null): string | null {\n return findClassKey(node, EDITOR_COLORS);\n}\n\n/**\n * Marker handed to `hiliteColor`, immediately rewritten into a class.\n *\n * Unlike `fontName`/`fontSize`/`foreColor`, `hiliteColor` does **not** emit a\n * `<font>` element: verified empirically (Playwright, Chromium + Firefox)\n * that it always produces `<span style=\"background-color: rgb(r, g, b);\">`,\n * converting whatever color is handed to it — including a hex marker — to an\n * `rgb(...)` triplet in the `style` attribute. `HILITE_MARKER` is therefore\n * kept as the hex value passed to the command, and `HILITE_MARKER_RGB` as the\n * exact `rgb(...)` string both browsers echo back for it, used to build the\n * `[style*=\"…\"]` selector `convertHighlightMarkers` matches on.\n */\nconst HILITE_MARKER = '#040506';\n/** @internal `rgb(...)` form both Chromium and Firefox normalize `HILITE_MARKER` to. */\nconst HILITE_MARKER_RGB = 'rgb(4, 5, 6)';\n\n/** Applies a highlight color to the selection (see {@link convertHighlightMarkers}). */\nexport function applyHighlightColor(): void {\n document.execCommand('hiliteColor', false, HILITE_MARKER);\n}\n\n/** Rewrites the `<span style>` elements `hiliteColor` just produced into `<span class>`. */\nexport function convertHighlightMarkers(root: ParentNode, className: string): void {\n convertMarkers(\n root,\n `[style*=\"background-color: ${HILITE_MARKER_RGB}\"]`,\n className,\n HIGHLIGHT_CLASSES,\n );\n}\n\n/** Highlight color active at the caret, or `null` when the text carries none. */\nexport function readHighlightColor(node: Node | null): string | null {\n return findClassKey(node, EDITOR_HIGHLIGHTS);\n}\n\n/**\n * Strips a color/highlight class from every element carrying it inside\n * `range`, unwrapping the element when nothing else justifies it (a plain\n * `<span>` holding only that class).\n *\n * Used by the pickers' \"no color\" swatch: `foreColor`/`hiliteColor` can only\n * set a color, there is no native command to remove one, so this undoes what\n * {@link convertColorMarkers}/{@link convertHighlightMarkers} previously wrote.\n */\nexport function clearMarkerClass(root: ParentNode, range: Range, className: string): void {\n for (const el of Array.from(root.querySelectorAll(`.${className}`))) {\n if (!range.intersectsNode(el)) continue;\n el.classList.remove(className);\n if (el.classList.length > 0) continue;\n el.removeAttribute('class');\n if (el.tagName === 'SPAN' && el.attributes.length === 0) {\n el.replaceWith(...Array.from(el.childNodes));\n }\n }\n}\n\n/**\n * Strips every font/size/color/highlight class the editor writes, from\n * whatever intersects `range`.\n *\n * `removeFormat` (the `clearFormat` tool's native command) only knows inline\n * formatting the browser itself applies (bold, italic, underline…) — it never\n * touches the `<span class=\"ui-editor-*\">` wrappers `fontFamily`/`fontSize`/\n * `textColor`/`highlightColor` write, so \"Clear formatting\" needs this on top\n * of it to actually clear everything.\n */\nexport function clearFormatMarkers(root: ParentNode, range: Range): void {\n for (const className of [...FONT_CLASSES, ...SIZE_CLASSES, ...COLOR_CLASSES, ...HIGHLIGHT_CLASSES]) {\n clearMarkerClass(root, range, className);\n }\n}\n\n/** @internal Nearest ancestor carrying one of the given classes. */\nfunction findClassKey<T extends string>(\n node: Node | null,\n table: readonly { key: T; className: string }[],\n): T | null {\n let el: HTMLElement | null =\n node?.nodeType === Node.ELEMENT_NODE ? (node as HTMLElement) : (node?.parentElement ?? null);\n while (el) {\n const match = table.find((entry) => el!.classList?.contains(entry.className));\n if (match) return match.key;\n el = el.parentElement;\n }\n return null;\n}\n\n/** Wraps the current selection in a link (`removeFormat` alone cannot unlink). */\nexport function applyLink(href: string): void {\n document.execCommand('createLink', false, href);\n}\n\n/** Removes the link around the caret. */\nexport function removeLink(): void {\n document.execCommand('unlink', false);\n}\n\n/** Reads the formatting active at the caret. */\nexport function readEditorState(): EditorState {\n const state = emptyEditorState();\n for (const tool of TOGGLE_TOOLS) {\n try {\n state[tool] = document.queryCommandState(NATIVE_COMMAND[tool]);\n } catch {\n // queryCommandState throws when the document has no selection yet.\n state[tool] = false;\n }\n }\n state.codeBlock = isInCodeBlock();\n return state;\n}\n\n/** Inserts already-sanitised markup at the caret, replacing the selection. */\nexport function insertHtml(html: string): void {\n document.execCommand('insertHTML', false, html);\n}\n\n/** Inserts plain text at the caret, replacing the selection. */\nexport function insertText(text: string): void {\n document.execCommand('insertText', false, text);\n}\n\n// --- Value sanitisation --------------------------------------------------\n\nconst LENGTH = String.raw`(?:0|-?\\d+(?:\\.\\d+)?(?:px|em|rem|%))`;\nconst LENGTHS = new RegExp(`^${LENGTH}(?:\\\\s+${LENGTH}){0,3}$`);\n\n/** The only `style` a value keeps: alignment and indentation. Same list as the React kit. */\nconst STYLE_ALLOWLIST: Record<string, RegExp> = {\n 'text-align': /^(?:left|right|center|justify|start|end)$/,\n margin: LENGTHS,\n 'margin-left': LENGTHS,\n 'margin-right': LENGTHS,\n 'margin-inline-start': LENGTHS,\n padding: LENGTHS,\n border: /^none$/,\n};\n\n/** Keeps only the allowed declarations of a `style` attribute. */\nexport function sanitizeStyle(style: string): string {\n const kept: string[] = [];\n for (const declaration of style.split(';')) {\n const colon = declaration.indexOf(':');\n if (colon < 0) continue;\n const property = declaration.slice(0, colon).trim().toLowerCase();\n const value = declaration.slice(colon + 1).trim().toLowerCase();\n const pattern = STYLE_ALLOWLIST[property];\n if (pattern?.test(value)) kept.push(`${property}: ${value};`);\n }\n return kept.join(' ');\n}\n\nconst STYLE_RELAY = 'ui-editor-style-';\n\n/** Sanitises a value with `sanitize`, relaying the allowed `style` through a class it keeps. */\nexport function sanitizeEditorHtml(html: string, sanitize: (html: string) => string): string {\n if (typeof DOMParser === 'undefined' || !/\\sstyle\\s*=/i.test(html)) return sanitize(html);\n\n const styles: string[] = [];\n const source = parseInert(html);\n for (const el of Array.from(source.querySelectorAll('*'))) {\n const forged = Array.from(el.classList).filter((cls) => cls.startsWith(STYLE_RELAY));\n if (forged.length) {\n el.classList.remove(...forged);\n if (!el.classList.length) el.removeAttribute('class');\n }\n const style = el.getAttribute('style');\n if (style === null) continue;\n el.removeAttribute('style');\n const kept = sanitizeStyle(style);\n if (!kept) continue;\n el.classList.add(`${STYLE_RELAY}${styles.length}`);\n styles.push(kept);\n }\n\n const safe = sanitize(source.innerHTML);\n if (!styles.length) return safe;\n\n const out = parseInert(safe);\n for (const el of Array.from(out.querySelectorAll(`[class*=\"${STYLE_RELAY}\"]`))) {\n for (const cls of Array.from(el.classList)) {\n if (!cls.startsWith(STYLE_RELAY)) continue;\n el.classList.remove(cls);\n const kept = styles[Number(cls.slice(STYLE_RELAY.length))];\n if (kept) el.setAttribute('style', kept);\n }\n if (!el.classList.length) el.removeAttribute('class');\n }\n return out.innerHTML;\n}\n\n/** @internal Inert parse; the leading `<remove>` keeps head-only tags in the body. */\nfunction parseInert(html: string): HTMLElement {\n const body = new DOMParser().parseFromString(`<body><remove></remove>${html}`, 'text/html').body;\n body.firstChild?.remove();\n return body;\n}\n\n// --- Content normalisation ---------------------------------------------\n\n/** Inline + block tags the editor is allowed to produce or to accept on paste. */\nconst ALLOWED_TAGS = new Set([\n 'B',\n 'STRONG',\n 'I',\n 'EM',\n 'U',\n 'A',\n 'UL',\n 'OL',\n 'LI',\n 'P',\n 'BR',\n 'DIV',\n 'SPAN',\n 'PRE',\n 'CODE',\n 'H1',\n 'H2',\n 'H3',\n]);\n\n/**\n * Tags dropped WITH their content, instead of being unwrapped.\n *\n * Unwrapping keeps the text of a rejected element, which is what we want for a\n * heading or a table cell — but a script or stylesheet body would then land in\n * the document as visible text.\n */\nconst VOIDED_TAGS = 'script, style, noscript, iframe, object, embed, template, title, meta, link';\n\n/** Only `href` survives, and only on a link. */\nconst ALLOWED_HREF_PROTOCOLS = ['http:', 'https:', 'mailto:', 'tel:'];\n\n/**\n * Strips everything outside the whitelist, keeping the text of dropped elements.\n *\n * Runs on paste, on top of Angular's `DomSanitizer`: the sanitizer removes what is\n * dangerous, this removes what is merely foreign to the editor (Word spans, inline\n * styles, headings, tables) so the value stays a small, predictable HTML subset.\n */\nexport function normalizeHtml(html: string): string {\n if (typeof document === 'undefined') return html;\n const template = document.createElement('template');\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :\n `<template>` détaché, contenu inerte — étape de parsing du scrub, pas une\n injection dans le document. Registre : docs/SECURITY-PRACTICES.md. */\n template.innerHTML = html;\n scrubNode(template.content);\n return template.innerHTML;\n}\n\n/**\n * Applies the same scrubbing to a live element, in place.\n *\n * `insertHTML` re-decorates what it inserts (`style=\"background-color: transparent\"`\n * and friends) *after* our normalisation, so the markup has to be cleaned once more\n * once it is in the document. Attributes are removed node by node rather than by\n * rewriting `innerHTML`, which would drop the caret.\n */\nexport function scrubInPlace(root: ParentNode): void {\n scrubNode(root);\n}\n\n/** @internal Unwraps disallowed elements, voids the unsafe ones, drops attributes. */\nfunction scrubNode(root: ParentNode): void {\n for (const el of Array.from(root.querySelectorAll(VOIDED_TAGS))) el.remove();\n for (const el of Array.from(root.querySelectorAll('*'))) {\n if (!ALLOWED_TAGS.has(el.tagName)) {\n el.replaceWith(...Array.from(el.childNodes));\n continue;\n }\n for (const attr of Array.from(el.attributes)) {\n if (attr.name === 'class') {\n // Only the editor's own font/size/color classes survive — anything else\n // pasted in would style the value against a foreign stylesheet.\n const kept = attr.value\n .split(/\\s+/)\n .filter(\n (c) =>\n FONT_CLASSES.has(c) ||\n SIZE_CLASSES.has(c) ||\n COLOR_CLASSES.has(c) ||\n HIGHLIGHT_CLASSES.has(c),\n );\n if (kept.length) el.setAttribute('class', kept.join(' '));\n else el.removeAttribute('class');\n continue;\n }\n const keep = el.tagName === 'A' && attr.name === 'href' && isSafeHref(attr.value);\n if (!keep) el.removeAttribute(attr.name);\n }\n }\n}\n\n/** @internal Rejects `javascript:` and other non-navigational schemes. */\nfunction isSafeHref(href: string): boolean {\n try {\n return ALLOWED_HREF_PROTOCOLS.includes(new URL(href, document.baseURI).protocol);\n } catch {\n return false;\n }\n}\n\n/** Normalises a browser-produced empty document (`<br>`, empty block) to `''`. */\nexport function isEmptyHtml(html: string): boolean {\n return htmlToText(html).length === 0 && !/<(img|hr)\\b/i.test(html);\n}\n\n/** Plain-text projection of the value — what the character counter measures. */\nexport function htmlToText(html: string): string {\n if (!html) return '';\n if (typeof document === 'undefined') {\n // SSR fallback: good enough for a length, never rendered.\n return html.replace(/<[^>]*>/g, '').trim();\n }\n const template = document.createElement('template');\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :\n `<template>` détaché, contenu inerte, jamais rendu — on n'en lit que\n `textContent` pour compter les caractères. Registre :\n docs/SECURITY-PRACTICES.md. */\n template.innerHTML = html;\n return (template.content.textContent ?? '').trim();\n}\n","import {\n afterNextRender,\n booleanAttribute,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n output,\n SecurityContext,\n signal,\n viewChild,\n} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {FormsModule, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {BaseFormField} from '@4sh/ui-kit/forms';\nimport {UiField} from '@4sh/ui-kit/forms/ui-field';\nimport {UiButton} from '@4sh/ui-kit/actions/ui-button';\nimport {UiSelect} from '@4sh/ui-kit/forms/ui-select';\nimport {UiSwatch, UiSwatchPicker} from '@4sh/ui-kit/forms/ui-swatch-picker';\nimport {\n applyCommand,\n applyFontFamily,\n applyFontSize,\n applyHighlightColor,\n applyLink,\n applyTextColor,\n clearFormatMarkers,\n clearMarkerClass,\n convertColorMarkers,\n convertFontMarkers,\n convertHighlightMarkers,\n convertSizeMarkers,\n DEFAULT_EDITOR_TOOLS,\n EDITOR_COLORS,\n EDITOR_FONTS,\n EDITOR_HIGHLIGHTS,\n EDITOR_SELECT_TOOLS,\n EDITOR_SIZES,\n EDITOR_TOOL_META,\n EditorButtonTool,\n EditorFont,\n EditorSelectTool,\n EditorSize,\n EditorState,\n EditorTool,\n emptyEditorState,\n htmlToText,\n insertHtml,\n insertText,\n isEmptyHtml,\n normalizeHtml,\n readEditorState,\n readFontFamily,\n readFontSize,\n readHighlightColor,\n readTextColor,\n removeLink,\n resolveFontLabel,\n sanitizeEditorHtml,\n scrubInPlace,\n toggleCodeBlock,\n} from './ui-editor-commands';\n\n/** Where the toolbar sits relative to the editing area. */\nexport type EditorToolbarPosition = 'top' | 'bottom';\n\n/** Keyboard shortcut → tool (the browser applies these natively; we mirror the state). */\nconst SHORTCUTS: Record<string, EditorTool> = { b: 'bold', i: 'italic', u: 'underline' };\n\n/**\n * ui-editor — headless rich-text field, built on the `ui-field` shell (label +\n * box + helper) in **multiline** mode + a `contenteditable` area and its toolbar.\n *\n * Zero third-party engine: the formatting commands live in `ui-editor-commands`,\n * the single place that touches the legacy editing API. The value is an HTML\n * string, sanitised on the way in (`DomSanitizer`) and normalised to a small tag\n * whitelist on paste.\n *\n * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).\n */\n@Component({\n selector: 'ui-editor',\n imports: [UiField, UiButton, UiSwatchPicker, UiSelect, NgTemplateOutlet, FormsModule],\n templateUrl: './ui-editor.html',\n styleUrl: './ui-editor.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiEditor), multi: true }],\n})\nexport class UiEditor extends BaseFormField<string> {\n /**\n * Tools shown in the toolbar, in order (`separator` draws a divider).\n *\n * An empty or absent list falls back to the default set: a template binding an\n * optional variable (`[tools]=\"tools\"`) hands us `undefined`, which would\n * otherwise leave the editor without any formatting at all.\n */\n tools = input(DEFAULT_EDITOR_TOOLS, {\n transform: (value: readonly EditorTool[] | null | undefined) =>\n value?.length ? value : DEFAULT_EDITOR_TOOLS,\n });\n /** Hint shown while the editor is empty (no native placeholder on contenteditable). */\n placeholder = input<string>();\n /** Minimum height of the editing area, in lines of text. */\n minRows = input<number>(4);\n /** Maximum number of **text** characters (markup is not counted). */\n maxlength = input<number>();\n /** Shows a character counter under the field (`count` or `count / maxlength`). */\n showCount = input(false, { transform: booleanAttribute });\n /** Toolbar placement relative to the editing area. */\n toolbarPosition = input<EditorToolbarPosition>('top');\n\n /** Emitted on each edit with the new HTML value. */\n valueChange = output<string>();\n /** Emitted when the editing area receives focus. */\n editorFocus = output<FocusEvent>();\n /** Emitted when the editing area loses focus. */\n editorBlur = output<FocusEvent>();\n /** Emitted when the formatting under the caret changes. */\n selectionChange = output<EditorState>();\n\n /** @ignore */\n private readonly sanitizer = inject(DomSanitizer);\n /** @ignore */\n private readonly contentEl = viewChild<ElementRef<HTMLElement>>('contentEl');\n /** @ignore The rendered toolbar — holds the roving tabindex ring, in DOM order. */\n private readonly toolbarEl = viewChild<ElementRef<HTMLElement>>('toolbarEl');\n /** @ignore Text color popup (see {@link onColorToolClick}). */\n private readonly textColorPicker = viewChild<UiSwatchPicker>('textColorPicker');\n /** @ignore Highlight color popup (see {@link onColorToolClick}). */\n private readonly highlightColorPicker = viewChild<UiSwatchPicker>('highlightColorPicker');\n\n /**\n * @ignore Last HTML this component wrote out.\n *\n * The editing area owns its own DOM while the user types, so the value cannot be\n * bound with `[innerHTML]`: re-rendering it on every keystroke would collapse the\n * caret. Instead the DOM is only rewritten when the incoming value differs from\n * what we last emitted — i.e. when a form writes to us.\n */\n private lastEmitted = '';\n\n /** @ignore Formatting active at the caret. */\n protected readonly state = signal<EditorState>(emptyEditorState());\n /** @ignore Type family at the caret (`null` = the default family). */\n protected readonly currentFont = signal<EditorFont | null>(null);\n /** @ignore Text size at the caret (`null` = the default size). */\n protected readonly currentSize = signal<EditorSize | null>(null);\n /** @ignore Text color at the caret (`null` = the default color). */\n protected readonly currentTextColor = signal<string | null>(null);\n /** @ignore Highlight color at the caret (`null` = no highlight). */\n protected readonly currentHighlightColor = signal<string | null>(null);\n /** @ignore Index of the toolbar button reachable with Tab (roving tabindex). */\n protected readonly activeTool = signal(0);\n /** @ignore Open state of the `textColor` popup (drives its trigger's `aria-expanded`). */\n protected readonly textColorPickerOpen = signal(false);\n /** @ignore Open state of the `highlightColor` popup (drives its trigger's `aria-expanded`). */\n protected readonly highlightColorPickerOpen = signal(false);\n\n /**\n * @ignore Last selection seen inside the editing area.\n *\n * The buttons cancel their own mousedown and never take the focus, but opening\n * the font dropdown does — and a `contenteditable` loses its selection with it.\n * The range is therefore kept here and restored before the command runs.\n */\n private savedRange: Range | null = null;\n\n /** @ignore Sanitised value — never inject `modelValue` into the DOM raw. */\n private readonly safeValue = computed(() =>\n sanitizeEditorHtml(\n this.modelValue() ?? '',\n (html) => this.sanitizer.sanitize(SecurityContext.HTML, html) ?? '',\n ),\n );\n\n /** @ignore Plain-text length, what `maxlength` and the counter measure. */\n protected readonly charCount = computed(() => htmlToText(this.safeValue()).length);\n /** @ignore Keeps a floating label raised once focus leaves. */\n protected readonly isFilled = computed(() => this.charCount() > 0);\n /** @ignore Over the maxlength (only reachable programmatically). */\n protected readonly overLimit = computed(() => {\n const max = this.maxlength();\n return max != null && this.charCount() > max;\n });\n /** @ignore The placeholder only shows while there is nothing to read. */\n protected readonly showPlaceholder = computed(\n () => !!this.placeholder() && !this.hasFloatLabel() && this.charCount() === 0,\n );\n /** @ignore The area is editable (a read-only editor keeps its caret but not its edits). */\n protected readonly isEditable = computed(() => !this.isDisabled() && !this.readonly());\n\n /** @ignore Resolved toolbar entries (icon + accessible name + toggle state). */\n protected readonly toolbar = computed(() =>\n this.tools().map((tool, index) => ({\n tool,\n index,\n isSeparator: tool === 'separator',\n select: (EDITOR_SELECT_TOOLS.includes(tool as EditorSelectTool)\n ? tool\n : null) as EditorSelectTool | null,\n buttonTool: (tool === 'separator' || EDITOR_SELECT_TOOLS.includes(tool as EditorSelectTool)\n ? null\n : tool) as EditorButtonTool | null,\n meta:\n tool === 'separator' || EDITOR_SELECT_TOOLS.includes(tool as EditorSelectTool)\n ? null\n : EDITOR_TOOL_META[tool as EditorButtonTool],\n })),\n );\n /** @ignore Text sizes offered by the `fontSize` dropdown. */\n protected readonly sizes = EDITOR_SIZES;\n /**\n * @ignore Type families, labelled with the face each token actually resolves to.\n *\n * Read once the view exists, since the value comes from the computed style: a\n * hardcoded \"Inter\" would lie as soon as a project rebinds the token.\n */\n protected readonly fonts = signal(EDITOR_FONTS.map((f) => ({ ...f })));\n /** @ignore `fontFamily` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */\n protected readonly fontFamilyOptions = computed(() =>\n this.fonts().map((font) => ({ value: font.key, label: font.label })),\n );\n /** @ignore `fontSize` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */\n protected readonly fontSizeOptions = computed(() =>\n this.sizes.map((size) => ({ value: size.key, label: size.label })),\n );\n /** @ignore Swatch entry backing the `textColor` button's color indicator. */\n protected readonly currentTextColorSwatch = computed(() =>\n EDITOR_COLORS.find((c) => c.key === this.currentTextColor()),\n );\n /** @ignore Swatch entry backing the `highlightColor` button's color indicator. */\n protected readonly currentHighlightColorSwatch = computed(() =>\n EDITOR_HIGHLIGHTS.find((c) => c.key === this.currentHighlightColor()),\n );\n /** @ignore The toolbar has at least one actionable entry. */\n protected readonly hasToolbar = computed(() => this.tools().some((t) => t !== 'separator'));\n /**\n * @ignore Index carrying the toolbar's single tab stop.\n *\n * Falls back to the first actionable tool, so a `tools` list opening on a\n * separator still leaves the toolbar reachable with Tab.\n */\n protected readonly tabStop = computed(() => {\n const actionable = this.toolbar().filter((entry) => !entry.isSeparator);\n if (!actionable.length) return -1;\n const active = this.activeTool();\n return actionable.some((entry) => entry.index === active) ? active : actionable[0].index;\n });\n\n /** @ignore id of the character counter (for `aria-describedby`). */\n protected readonly countId = computed(() => `${this.resolvedId()}-count`);\n /** @ignore `aria-describedby` combines the message and the counter, whichever are shown. */\n protected readonly describedByIds = computed(() => {\n const ids = [\n this.displayMessage() ? this.messageId() : null,\n this.showCount() ? this.countId() : null,\n ].filter(Boolean);\n return ids.length ? ids.join(' ') : null;\n });\n\n constructor() {\n super();\n // Label each family with the face its token actually resolves to.\n afterNextRender(() => {\n this.fonts.set(\n EDITOR_FONTS.map((f) => ({ ...f, label: resolveFontLabel(f.cssVar, f.label) })),\n );\n });\n // Sync the DOM when the value comes from outside (form write, reset).\n effect(() => {\n const value = this.safeValue();\n const el = this.contentEl()?.nativeElement;\n if (!el) return;\n // Our own edit read back, or already on screen: rewriting would collapse the\n // caret. Raw value on purpose: sanitising re-encodes it (`é` → `é`).\n if (this.modelValue() === this.lastEmitted || el.innerHTML === value) return;\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :\n `value` vient de `safeValue()`, donc de\n `DomSanitizer.sanitize(SecurityContext.HTML, …)`, plus le seul `style`\n d'alignement et de retrait de `sanitizeStyle()`. L'écriture directe est\n imposée par le `contenteditable` : une liaison `[innerHTML]` réécrirait\n la zone à chaque frappe et effondrerait le caret. Registre :\n docs/SECURITY-PRACTICES.md. */\n el.innerHTML = value;\n this.lastEmitted = value;\n });\n }\n\n /** @ignore Auto-generated ids read as `ui-editor-*`. */\n protected override uidPrefix(): string {\n return 'ui-editor';\n }\n\n /** Focuses the editing area. */\n focus(options?: FocusOptions): void {\n this.contentEl()?.nativeElement.focus(options);\n }\n\n // --- Editing ----------------------------------------------------------\n\n /** @ignore Input: single source of the value (view → form). */\n protected onInput(): void {\n const el = this.contentEl()?.nativeElement;\n if (!el) return;\n const html = isEmptyHtml(el.innerHTML) ? '' : el.innerHTML;\n this.lastEmitted = html;\n this.modelValue.set(html);\n this.emitChange(html);\n this.valueChange.emit(html);\n this.refreshState();\n }\n\n /**\n * @ignore Enforces `maxlength` on the text, not the markup.\n *\n * Deletions and formatting must stay available once the limit is reached, so only\n * the insertion intents are cancelled.\n */\n protected onBeforeInput(event: InputEvent): void {\n const max = this.maxlength();\n if (max == null || !event.inputType.startsWith('insert')) return;\n const selection = document.getSelection();\n const replaced = selection && !selection.isCollapsed ? selection.toString().length : 0;\n const incoming = event.data?.length ?? 1;\n if (this.charCount() - replaced + incoming > max) event.preventDefault();\n }\n\n /** @ignore Paste is reduced to the editor's own tag whitelist. */\n protected onPaste(event: ClipboardEvent): void {\n if (!this.isEditable()) return;\n event.preventDefault();\n const clipboard = event.clipboardData;\n if (!clipboard) return;\n const html = clipboard.getData('text/html');\n if (html) {\n const safe = this.sanitizer.sanitize(SecurityContext.HTML, normalizeHtml(html)) ?? '';\n insertHtml(safe);\n // `insertHTML` re-decorates what it inserted; strip that back off in place.\n const el = this.contentEl()?.nativeElement;\n if (el) scrubInPlace(el);\n } else {\n insertText(clipboard.getData('text/plain'));\n }\n this.onInput();\n }\n\n /** @ignore The browser applies Ctrl/Cmd+B/I/U itself; we only mirror the state. */\n protected onContentKeydown(event: KeyboardEvent): void {\n if (!(event.metaKey || event.ctrlKey)) return;\n if (!SHORTCUTS[event.key.toLowerCase()]) return;\n // Let the native shortcut run, then read the resulting formatting back.\n queueMicrotask(() => this.refreshState());\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.editorBlur.emit(event);\n }\n\n /** @ignore Recomputes the active formatting and notifies the consumer. */\n protected refreshState(): void {\n this.rememberSelection();\n const anchor = document.getSelection()?.anchorNode ?? null;\n this.currentFont.set(readFontFamily(anchor));\n this.currentSize.set(readFontSize(anchor));\n this.currentTextColor.set(readTextColor(anchor));\n this.currentHighlightColor.set(readHighlightColor(anchor));\n\n const next = readEditorState();\n const prev = this.state();\n if ((Object.keys(next) as (keyof EditorState)[]).every((k) => next[k] === prev[k])) return;\n this.state.set(next);\n this.selectionChange.emit(next);\n }\n\n /** @ignore Keeps the caret position around for controls that steal the focus. */\n private rememberSelection(): void {\n const el = this.contentEl()?.nativeElement;\n const selection = document.getSelection();\n if (!el || !selection?.rangeCount) return;\n const range = selection.getRangeAt(0);\n if (el.contains(range.commonAncestorContainer)) this.savedRange = range.cloneRange();\n }\n\n /** @ignore Puts the remembered caret back before running a command. */\n private restoreSelection(): void {\n this.focus();\n const range = this.savedRange;\n if (!range) return;\n const selection = document.getSelection();\n selection?.removeAllRanges();\n selection?.addRange(range);\n }\n\n // --- Toolbar ----------------------------------------------------------\n\n /** @ignore Runs a button tool against the selection the mousedown handler preserved. */\n protected runTool(tool: EditorButtonTool, index: number, event?: MouseEvent): void {\n if (!this.isEditable()) return;\n this.activeTool.set(index);\n if (tool === 'textColor' || tool === 'highlightColor') {\n this.onColorToolClick(tool, event!);\n return;\n }\n this.focus();\n if (tool === 'link') this.promptForLink();\n else if (tool === 'codeBlock') toggleCodeBlock();\n else if (tool === 'clearFormat') this.clearFormat();\n else applyCommand(tool);\n this.onInput();\n }\n\n /**\n * @ignore `removeFormat` (the native command behind `clearFormat`) only\n * strips inline formatting the browser itself applies — bold, italic,\n * underline… — never the `<span class=\"ui-editor-*\">` wrappers `fontFamily`/\n * `fontSize`/`textColor`/`highlightColor` write, so those survived\n * \"Effacer le formatage\" untouched. Run the native command, then unwrap\n * those classes too, across whatever is currently selected.\n */\n private clearFormat(): void {\n applyCommand('clearFormat');\n const el = this.contentEl()?.nativeElement;\n const selection = document.getSelection();\n if (!el || !selection?.rangeCount) return;\n const range = selection.getRangeAt(0);\n if (!el.contains(range.commonAncestorContainer)) return;\n clearFormatMarkers(el, range);\n }\n\n /**\n * @ignore Trigger click for `textColor`/`highlightColor`: opens the matching\n * `ui-swatch-picker` instead of applying a command directly — same\n * \"picker takes the focus, the caret is restored before the real command\n * runs\" pattern as {@link onSelectMenuTrigger}, but these two are button\n * tools (a one-shot action button, not a value dropdown), so they run\n * through `runTool` rather than `onSelectChange`.\n */\n private onColorToolClick(tool: 'textColor' | 'highlightColor', event: MouseEvent): void {\n this.rememberSelection();\n const picker =\n tool === 'textColor' ? this.textColorPicker() : this.highlightColorPicker();\n picker?.toggle(event);\n }\n\n /**\n * @ignore Applies the text color chosen in the `textColor` picker.\n *\n * The popup took the focus, so the caret is put back first. `foreColor`\n * emits a legacy `<font>` element, immediately rewritten into a class.\n */\n protected onTextColorSelect(swatch: UiSwatch | null): void {\n if (!this.isEditable()) return;\n this.restoreSelection();\n const el = this.contentEl()?.nativeElement;\n if (swatch) {\n applyTextColor();\n if (el) convertColorMarkers(el, `ui-editor-color-${swatch.key}`);\n } else if (el && this.savedRange) {\n for (const color of EDITOR_COLORS) clearMarkerClass(el, this.savedRange, color.className);\n }\n this.onInput();\n }\n\n /**\n * @ignore Applies the highlight color chosen in the `highlightColor` picker.\n *\n * The popup took the focus, so the caret is put back first. `hiliteColor`\n * emits a `<span style=\"background-color:…\">`, immediately rewritten into a\n * class (see {@link convertHighlightMarkers}).\n */\n protected onHighlightColorSelect(swatch: UiSwatch | null): void {\n if (!this.isEditable()) return;\n this.restoreSelection();\n const el = this.contentEl()?.nativeElement;\n if (swatch) {\n applyHighlightColor();\n if (el) convertHighlightMarkers(el, `ui-editor-highlight-${swatch.key}`);\n } else if (el && this.savedRange) {\n for (const color of EDITOR_HIGHLIGHTS) {\n clearMarkerClass(el, this.savedRange, color.className);\n }\n }\n this.onInput();\n }\n\n /** @ignore Options for a `ui-select` dropdown ({@link UiSelect} `optionLabel`/`optionValue`). */\n protected selectOptions(tool: EditorSelectTool): { value: string; label: string }[] {\n return tool === 'fontFamily' ? this.fontFamilyOptions() : this.fontSizeOptions();\n }\n\n /**\n * @ignore Current value of a `ui-select` dropdown, so it reflects the caret.\n *\n * Falls back to the value actually in force when no class was applied: text\n * carrying no class really is rendered with `--fontfamily-base` at the\n * default size, so naming it states a fact rather than a placeholder.\n */\n protected selectValue(tool: EditorSelectTool): string {\n if (tool === 'fontFamily') return this.currentFont() ?? 'base';\n return this.currentSize() ?? 'default';\n }\n\n /** @ignore Accessible name of a dropdown — spelled out, it is never truncated. */\n protected selectLabel(tool: EditorSelectTool): string {\n if (tool === 'fontFamily') return 'Police';\n return 'Taille du texte';\n }\n\n /**\n * @ignore Applies the value chosen in a `ui-select` dropdown.\n *\n * `ui-select` opens its own overlay and takes the focus, so the caret is put\n * back first — same reasoning as the color pickers. `fontName`/`fontSize`\n * each emit a legacy `<font>` element, immediately rewritten into a class.\n */\n protected onSelectValueChange(tool: EditorSelectTool, value: unknown, index: number): void {\n this.activeTool.set(index);\n if (!this.isEditable() || value == null) return;\n this.restoreSelection();\n const el = this.contentEl()?.nativeElement;\n if (tool === 'fontFamily') {\n const choice = this.fonts().find((f) => f.key === value);\n if (!choice) return;\n applyFontFamily();\n if (el) convertFontMarkers(el, choice.className);\n } else {\n const choice = this.sizes.find((s) => s.key === value);\n if (!choice) return;\n applyFontSize();\n if (el) convertSizeMarkers(el, choice.className);\n }\n this.onInput();\n }\n\n /**\n * @ignore v1 link flow: the native prompt.\n *\n * Deliberately minimal — a popover with a `ui-input` is the planned replacement,\n * and it changes the component's overlay footprint, not this call site.\n */\n private promptForLink(): void {\n const href = window.prompt('Adresse du lien (laisser vide pour retirer le lien)');\n if (href === null) return;\n if (href.trim() === '') removeLink();\n else applyLink(href.trim());\n }\n\n /** @ignore Keeps the caret in the editing area when a tool is clicked. */\n protected onToolbarMousedown(event: MouseEvent): void {\n event.preventDefault();\n }\n\n /** @ignore Roving tabindex: the toolbar is one tab stop, arrows move within it. */\n protected onToolbarKeydown(event: KeyboardEvent): void {\n const indexes = this.toolbar()\n .filter((entry) => !entry.isSeparator)\n .map((entry) => entry.index);\n if (!indexes.length) return;\n const current = Math.max(0, indexes.indexOf(this.tabStop()));\n\n let next: number;\n switch (event.key) {\n case 'ArrowRight':\n next = indexes[(current + 1) % indexes.length];\n break;\n case 'ArrowLeft':\n next = indexes[(current - 1 + indexes.length) % indexes.length];\n break;\n case 'Home':\n next = indexes[0];\n break;\n case 'End':\n next = indexes[indexes.length - 1];\n break;\n case 'Escape':\n event.preventDefault();\n this.focus();\n return;\n default:\n return;\n }\n\n event.preventDefault();\n this.activeTool.set(next);\n this.focusTool(next);\n }\n\n /**\n * @ignore Moves the DOM focus onto the control now holding the tab stop.\n *\n * Queried from the live toolbar rather than from the `ui-button` children:\n * DOM order is the visual order, and every tool (buttons and select-menu\n * triggers alike) renders as a `<button>`.\n */\n private focusTool(index: number): void {\n const position = this.toolbar().filter((e) => !e.isSeparator && e.index <= index).length - 1;\n const controls = this.toolbarEl()?.nativeElement.querySelectorAll<HTMLElement>('button');\n controls?.[position]?.focus();\n }\n\n /**\n * @ignore `var(--primitives-…)` for the `textColor`/`highlightColor`\n * buttons' color indicator, or `null` for every other tool (no swatch\n * active, or a tool the indicator does not apply to).\n */\n protected colorIndicatorVar(tool: EditorButtonTool | null): string | null {\n const swatch =\n tool === 'textColor'\n ? this.currentTextColorSwatch()\n : tool === 'highlightColor'\n ? this.currentHighlightColorSwatch()\n : null;\n return swatch ? `var(${swatch.cssVar})` : null;\n }\n\n /**\n * @ignore Native attributes forwarded to a tool button.\n *\n * `aria-pressed` only on the toggles: `link` and `clearFormat` are one-shot\n * actions, and a permanently unpressed toggle would misreport them.\n * `textColor`/`highlightColor` forward `aria-haspopup`/`aria-expanded`\n * instead — they open a `ui-swatch-picker` popup, not a toggle.\n */\n protected toolProps(tool: EditorTool): Record<string, string> | undefined {\n if (tool === 'textColor' || tool === 'highlightColor') {\n const open =\n tool === 'textColor' ? this.textColorPickerOpen() : this.highlightColorPickerOpen();\n return { 'aria-haspopup': 'true', 'aria-expanded': open ? 'true' : 'false' };\n }\n const state = this.state();\n if (!(tool in state)) return undefined;\n return { 'aria-pressed': state[tool as keyof EditorState] ? 'true' : 'false' };\n }\n}\n","<ui-field\n multiline\n [label]=\"label()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n [hasFooter]=\"showCount()\"\n>\n <div class=\"ui-editor\" [class._small]=\"size() === 'small'\" [style.--_rows]=\"minRows()\">\n @if (toolbarPosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n\n <div class=\"ui-editor-area\">\n <div\n #contentEl\n class=\"ui-editor-content\"\n [class._small]=\"size() === 'small'\"\n [id]=\"resolvedId()\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"isEditable() ? 'true' : 'false'\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"describedByIds()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (beforeinput)=\"onBeforeInput($any($event))\"\n (paste)=\"onPaste($event)\"\n (keydown)=\"onContentKeydown($event)\"\n (keyup)=\"refreshState()\"\n (mouseup)=\"refreshState()\"\n (focus)=\"editorFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n\n @if (showPlaceholder()) {\n <span class=\"ui-editor-placeholder\" aria-hidden=\"true\">{{ placeholder() }}</span>\n }\n </div>\n\n @if (toolbarPosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n </div>\n\n @if (showCount()) {\n <span\n uiFieldFooter\n class=\"ui-editor-count\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n [class._over]=\"overLimit()\"\n [attr.id]=\"countId()\"\n >\n {{ charCount() }}\n @if (maxlength(); as max) {\n / {{ max }}\n }\n </span>\n }\n</ui-field>\n\n<ng-template #toolbarTpl>\n @if (hasToolbar()) {\n <!-- ARIA toolbar pattern: keyboard delegated to the role=\"toolbar\" container,\n focus lives on the items (roving tabindex), same as ui-menu. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n #toolbarEl\n class=\"ui-editor-toolbar\"\n [class._bottom]=\"toolbarPosition() === 'bottom'\"\n role=\"toolbar\"\n aria-label=\"Mise en forme\"\n aria-orientation=\"horizontal\"\n (mousedown)=\"onToolbarMousedown($event)\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (entry of toolbar(); track entry.index) {\n @if (entry.isSeparator) {\n <span class=\"ui-editor-toolbar-separator\" aria-hidden=\"true\"></span>\n } @else if (entry.select; as select) {\n <!-- The dropdown takes the focus, so the command restores the caret\n before it runs (see onSelectValueChange). -->\n <ui-select\n class=\"ui-editor-tool ui-editor-select\"\n size=\"small\"\n [options]=\"selectOptions(select)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"selectValue(select)\"\n [ariaLabel]=\"selectLabel(select)\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n (valueChange)=\"onSelectValueChange(select, $event, entry.index)\"\n />\n } @else {\n <ui-button\n class=\"ui-editor-tool\"\n [class._colorTool]=\"\n entry.buttonTool === 'textColor' || entry.buttonTool === 'highlightColor'\n \"\n variant=\"ghost\"\n level=\"low\"\n size=\"small\"\n iconOnly\n [icon]=\"entry.meta!.icon\"\n [ariaLabel]=\"entry.meta!.label\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n [buttonProps]=\"toolProps(entry.buttonTool!)\"\n [style.--ui-editor-swatch-indicator-color]=\"colorIndicatorVar(entry.buttonTool)\"\n (buttonClick)=\"runTool(entry.buttonTool!, entry.index, $event)\"\n />\n }\n }\n\n <!-- `textColor`/`highlightColor` popups: no trigger of their own (same\n composition contract as `ui-menu`), opened via `runTool` ->\n `onColorToolClick` -> `toggle(event)`. -->\n <ui-swatch-picker\n #textColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentTextColor()\"\n ariaLabel=\"Couleur du texte\"\n (swatchSelect)=\"onTextColorSelect($event)\"\n (opened)=\"textColorPickerOpen.set(true)\"\n (closed)=\"textColorPickerOpen.set(false)\"\n />\n <ui-swatch-picker\n #highlightColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentHighlightColor()\"\n ariaLabel=\"Couleur de surlignage\"\n (swatchSelect)=\"onHighlightColorSelect($event)\"\n (opened)=\"highlightColorPickerOpen.set(true)\"\n (closed)=\"highlightColorPickerOpen.set(false)\"\n />\n </div>\n }\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-editor\n */\n\nexport * from './lib/ui-editor';\nexport * from './lib/ui-editor-commands';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AA6CO,MAAM,mBAAmB,GAAgC;IAC9D,YAAY;IACZ,UAAU;;AA8BZ;;;;;;;AAOG;AACI,MAAM,YAAY,GAKnB;AACJ,IAAA,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,EAAE;AACjG,IAAA;AACE,QAAA,GAAG,EAAE,OAAO;AACZ,QAAA,SAAS,EAAE,sBAAsB;AACjC,QAAA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