@solidev/data 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"solidev-data-richedit.mjs","sources":["../../../projects/data/richedit/richedit.component.ts","../../../projects/data/richedit/richedit.component.html","../../../projects/data/richedit/solidev-data-richedit.ts"],"sourcesContent":["import {\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ChangeDetectionStrategy,\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { Editor, NgxEditorModule, Toolbar } from \"ngx-editor\";\nimport { FormControl, ReactiveFormsModule } from \"@angular/forms\";\nimport { BaseFieldManager, DataModel } from \"@solidev/data\";\nimport { firstValueFrom } from \"rxjs\";\n\n/**\n * Named toolbar presets for {@link RicheditComponent}, selectable through its\n * `toolbar` input.\n *\n * - `default`: the full set — marks, code and quote, lists, headings, links,\n * colours and alignment.\n * - `light`: a reduced set — basic marks, lists, text colour and alignment.\n * - `none`: empty; the component hides the menu bar entirely for this value.\n *\n * A `Toolbar` can also be passed directly to the component when neither preset\n * fits.\n */\nexport const RichEditToolbars: { [index: string]: Toolbar } = {\n default: [\n [\"bold\", \"italic\"],\n [\"underline\", \"strike\"],\n [\"code\", \"blockquote\"],\n [\"ordered_list\", \"bullet_list\"],\n [{ heading: [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"] }],\n [\"link\"],\n [\"text_color\", \"background_color\"],\n [\"align_left\", \"align_center\", \"align_right\", \"align_justify\"],\n ],\n light: [\n [\"bold\", \"italic\", \"underline\"],\n [\"ordered_list\", \"bullet_list\"],\n [\"text_color\"],\n [\"align_left\", \"align_center\", \"align_right\", \"align_justify\"],\n ],\n none: [],\n};\n\n@Component({\n selector: \"data-richedit\",\n imports: [CommonModule, NgxEditorModule, ReactiveFormsModule],\n templateUrl: \"./richedit.component.html\",\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrls: [\"./richedit.component.sass\"],\n})\n/**\n * Rich text editor for a model field, built on `ngx-editor`.\n *\n * Shipped as a separate entry point (`@solidev/data/richedit`) so that the\n * `ngx-editor` dependency stays optional for consumers who do not need it. It\n * follows the same `dd` / `inline` / `form` layout convention as\n * `<data-dispedit>`, and can also stand in as the `quill` editor slot.\n *\n * Unlike `<data-dispedit>`, saving is explicit: the value is written back and\n * persisted only when {@link save} runs, from the built-in save button — and\n * only in `dd` mode. In the other modes {@link save} updates the model in memory\n * but issues no request, leaving persistence to the surrounding form. Callers\n * that supply their own `[fc]` can instead track {@link changed}.\n *\n * @example\n * ```html\n * <data-richedit [model]=\"thing\" field=\"description\">Description</data-richedit>\n * ```\n */\nexport class RicheditComponent<FT, T extends DataModel>\n implements OnInit, OnDestroy\n{\n /** Model instance holding the field. */\n @Input() public model?: T;\n /** Name of the rich text field to edit. */\n @Input() public field?: string;\n /** Whether {@link toggleEdit} is allowed to enable editing. */\n @Input() public editable: boolean = true;\n /** Whether the editor is currently enabled. Defaults to true. */\n @Input() public edit: boolean = true;\n /**\n * Layout, and whether {@link save} persists.\n *\n * `dd` renders a `<dt>`/`<dd>` block and is the only mode that saves to the\n * API; `inline` and `form` render a label plus the editor and leave saving to\n * the caller.\n */\n @Input() public mode: \"dd\" | \"inline\" | \"form\" = \"dd\";\n /** Hide label (for inline forms) */\n @Input() public hideLabel: boolean = false;\n /**\n * Hide the built-in save button, for callers driving persistence themselves\n * from the {@link changed} output.\n */\n @Input() public hideButton: boolean = false;\n /**\n * Form control backing the editor.\n *\n * When supplied, the component uses it as-is and skips its own setup — no\n * field manager lookup, no seeding from the model, and no {@link changed}\n * emissions. When absent, one is created and wired up from `[model]` and\n * `[field]`.\n */\n @Input() public fc!: FormControl<string | null>;\n /** Toolbar preset name from {@link RichEditToolbars}, or an explicit toolbar. */\n @Input() public toolbar: \"none\" | \"default\" | \"light\" | Toolbar = \"default\";\n /** Emits the editor's HTML on every change. Only wired for an internal `fc`. */\n @Output() public changed = new EventEmitter<string | null>();\n /** Field manager for {@link field}; only resolved when `fc` is created here. */\n public manager?: BaseFieldManager<FT>;\n /** Whether the manager declares the field required. */\n public required!: boolean;\n /** Underlying ngx-editor instance; destroyed with the component. */\n public editor!: Editor;\n /** Unused; kept for backwards compatibility. */\n public html = \"\";\n /** Toolbar actually rendered, resolved from {@link toolbar}. */\n public realToolbar!: Toolbar;\n\n /**\n * Create the editor, resolve the toolbar, and — unless a `[fc]` was given —\n * build a control seeded from the model field, enabled per `[edit]`, and\n * relaying changes to {@link changed}.\n */\n ngOnInit(): void {\n this.editor = new Editor();\n if (this.toolbar === \"light\" || this.toolbar === \"default\") {\n this.realToolbar = RichEditToolbars[this.toolbar];\n } else if (this.toolbar === \"none\") {\n } else {\n this.realToolbar = this.toolbar as Toolbar;\n }\n if (!this.fc) {\n this.fc = new FormControl<string>(\"\");\n if (this.model && this.field) {\n this.manager = this.model.FM(this.field);\n this.required = this.manager?.required || false;\n this.fc.setValue((this.model as any)[this.field] || \"\", {\n emitEvent: false,\n });\n }\n if (this.edit) {\n this.fc.enable();\n } else {\n this.fc.disable();\n }\n this.fc.valueChanges.subscribe((v) => this.changed.emit(v));\n }\n }\n\n /** Destroy the ngx-editor instance to release its resources. */\n // make sure to destory the editor\n ngOnDestroy(): void {\n this.editor.destroy();\n }\n\n /**\n * Switch between read-only and editing by enabling or disabling the control.\n * Forces read-only when `[editable]` is false.\n */\n toggleEdit() {\n if (this.editable) {\n if (this.edit) {\n this.fc.disable();\n this.edit = false;\n } else {\n this.fc.enable();\n this.edit = true;\n }\n } else {\n this.fc.disable();\n this.edit = false;\n }\n }\n\n /**\n * Write the editor content back to the model field, and persist it in `dd`\n * mode only.\n *\n * In `inline` / `form` modes the model is updated in memory but no request is\n * sent, leaving the save to the surrounding form. Does nothing without both a\n * `[model]` and a `[field]`.\n */\n public async save() {\n if (this.model && this.field) {\n this.model.setFV(this.field, this.fc.value);\n if (this.mode === \"dd\") {\n await firstValueFrom(\n this.model.update([this.field], { updateModel: true }),\n );\n }\n }\n }\n}\n","\n<ng-template #editorTemplate>\n <div class=\"NgxEditor__Wrapper\">\n @if (edit && toolbar!=='none') {\n <ngx-editor-menu [editor]=\"editor\" [toolbar]=\"realToolbar\"></ngx-editor-menu>\n }\n <ngx-editor [editor]=\"editor\" [formControl]=\"fc\" [placeholder]=\"''\"></ngx-editor>\n </div>\n @if (edit && !hideButton) {\n <button class=\"btn btn-primary btn-sm w-100 mt-1\" (click)=\"save()\"><i class=\"bi bi-save me-2\"></i>Enregistrer</button>\n }\n</ng-template>\n<ng-template #titleTpl>\n <ng-content></ng-content>\n</ng-template>\n<!-- Dd display-->\n@if (mode==='dd') {\n @if (!hideLabel) {\n <dt [class.required]=\"required\"><span class=\"editable\" (click)=\"toggleEdit()\" role=\"button\">\n <ng-container *ngTemplateOutlet=\"titleTpl\"></ng-container></span></dt>\n }\n <dd [class.mb-0]=\"hideLabel\">\n <ng-container *ngTemplateOutlet=\"editorTemplate\"></ng-container>\n </dd>\n }\n <!-- Inline display-->\n @if (mode==='inline') {\n @if (!hideLabel) {\n <label [class.required]=\"required\">\n <ng-container *ngTemplateOutlet=\"titleTpl\"></ng-container>\n </label>\n }\n <ng-container *ngTemplateOutlet=\"editorTemplate\"></ng-container>\n }\n <!-- Form display-->\n @if (mode==='form') {\n @if (!hideLabel) {\n <label [class.required]=\"required\">\n <ng-container *ngTemplateOutlet=\"titleTpl\"></ng-container>\n </label>\n }\n <ng-container *ngTemplateOutlet=\"editorTemplate\"></ng-container>\n }","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAeA;;;;;;;;;;;AAWG;AACI,MAAM,gBAAgB,GAAiC;AAC5D,IAAA,OAAO,EAAE;QACP,CAAC,MAAM,EAAE,QAAQ,CAAC;QAClB,CAAC,WAAW,EAAE,QAAQ,CAAC;QACvB,CAAC,MAAM,EAAE,YAAY,CAAC;QACtB,CAAC,cAAc,EAAE,aA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Ae,qXAAE,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA;;2FAwBjD,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBA1B7B,SAAS;+BACE,eAAe,EAAA,OAAA,EAChB,CAAC,YAAY,EAAE,eAAe,EAAE,mBAAmB,CAAC,EAAA,eAAA,EAE5C,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,m/CAAA,EAAA;;sBA0B7C;;sBAEA;;sBAEA;;sBAEA;;sBAQA;;sBAEA;;sBAKA;;sBASA;;sBAEA;;sBAEA;;;AE/GH;;AAEG;;;;"}
1
+ {"version":3,"file":"solidev-data-richedit.mjs","sources":["../../../projects/data/richedit/prose/schema.ts","../../../projects/data/richedit/prose/html.ts","../../../projects/data/richedit/prose/editor.ts","../../../projects/data/richedit/richedit-editor.component.ts","../../../projects/data/richedit/prose/commands.ts","../../../projects/data/richedit/richedit-menubar.component.ts","../../../projects/data/richedit/richedit-menubar.component.html","../../../projects/data/richedit/richedit.component.ts","../../../projects/data/richedit/richedit.component.html","../../../projects/data/richedit/toolbar.ts","../../../projects/data/richedit/solidev-data-richedit.ts"],"sourcesContent":["import { Attrs, DOMOutputSpec, MarkSpec, NodeSpec, Schema } from 'prosemirror-model';\nimport { bulletList, listItem, orderedList } from 'prosemirror-schema-list';\n\n/**\n * The document schema `richedit` stores and edits.\n *\n * It is a deliberate copy of the schema `ngx-editor` used, because the field\n * values already in consumers' databases were produced by that serializer:\n * `<p style=\"text-align:center\">`, `<span style=\"color:red;\">`, `<u>`, `<s>`,\n * `data-indent` attributes. Anything this schema fails to parse would be\n * silently dropped the next time a user saves, so parse rules are kept wider\n * than the toolbar — `sup`, `sub` and `image` have no button but survive a\n * round trip, and so does `indent`.\n *\n * The one intentional difference is `rel=\"noopener\"` on serialized links, which\n * `ngx-editor` did not emit. It is not parsed back into an attribute, so it\n * stays stable across round trips.\n */\n\n/** Style declarations from a camelCased object, skipping empty values. */\nfunction toStyleString(styles: Record<string, string | null>): string | null {\n const declarations = Object.entries(styles)\n .filter(([, value]) => typeof value === 'string' && value !== '')\n .map(([property, value]) => `${property.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)}:${String(value)}`);\n return declarations.length ? declarations.join(';') : null;\n}\n\n/** `align` and `indent`, read the way ngx-editor read them. */\nfunction blockAttrs(dom: HTMLElement): { align: string | null; indent: number | null } {\n const indent = dom.getAttribute('data-indent');\n return {\n align: dom.getAttribute('align') ?? dom.style.textAlign ?? null,\n indent: Number.parseInt(indent ?? '', 10) || null,\n };\n}\n\n/** DOM attributes for a block carrying `align` / `indent`. */\nfunction blockDomAttrs(attrs: Attrs): Record<string, string | null> {\n const align = attrs['align'] as string | null;\n const indent = attrs['indent'] as number | null;\n return {\n style: toStyleString({\n // ngx-editor left `left` implicit; keeping that keeps stored values byte\n // identical when nothing changed.\n textAlign: align !== 'left' ? align : null,\n marginLeft: indent !== null ? `${indent * 40}px` : null,\n }),\n 'data-indent': indent !== null ? String(indent) : null,\n };\n}\n\nconst ALIGNABLE = {\n align: { default: null },\n indent: { default: null },\n};\n\nconst nodes: Record<string, NodeSpec> = {\n doc: { content: 'block+' },\n\n text: { group: 'inline' },\n\n paragraph: {\n content: 'inline*',\n group: 'block',\n attrs: ALIGNABLE,\n parseDOM: [{ tag: 'p', getAttrs: (dom: HTMLElement) => blockAttrs(dom) }],\n toDOM: (node): DOMOutputSpec => ['p', blockDomAttrs(node.attrs), 0],\n },\n\n blockquote: {\n content: 'block+',\n group: 'block',\n defining: true,\n attrs: { indent: { default: null } },\n parseDOM: [\n {\n tag: 'blockquote',\n getAttrs: (dom: HTMLElement) => ({\n indent: Number.parseInt(dom.getAttribute('data-indent') ?? '', 10) || null,\n }),\n },\n ],\n toDOM: (node): DOMOutputSpec => {\n const indent = node.attrs['indent'] as number | null;\n return [\n 'blockquote',\n {\n style: toStyleString({ marginLeft: indent !== null ? `${indent * 40}px` : null }),\n 'data-indent': indent !== null ? String(indent) : null,\n },\n 0,\n ];\n },\n },\n\n horizontal_rule: {\n group: 'block',\n parseDOM: [{ tag: 'hr' }],\n toDOM: (): DOMOutputSpec => ['hr'],\n },\n\n heading: {\n attrs: { level: { default: 1 }, ...ALIGNABLE },\n content: 'inline*',\n group: 'block',\n defining: true,\n parseDOM: [1, 2, 3, 4, 5, 6].map((level) => ({\n tag: `h${level}`,\n getAttrs: (dom: HTMLElement) => ({ level, ...blockAttrs(dom) }),\n })),\n toDOM: (node): DOMOutputSpec => [`h${String(node.attrs['level'])}`, blockDomAttrs(node.attrs), 0],\n },\n\n code_block: {\n content: 'text*',\n marks: '',\n group: 'block',\n code: true,\n defining: true,\n parseDOM: [{ tag: 'pre', preserveWhitespace: 'full' }],\n toDOM: (): DOMOutputSpec => ['pre', ['code', 0]],\n },\n\n hard_break: {\n inline: true,\n group: 'inline',\n selectable: false,\n parseDOM: [{ tag: 'br' }],\n toDOM: (): DOMOutputSpec => ['br'],\n },\n\n // No toolbar button inserts one, but stored content may contain images and\n // dropping them on the next save would lose user data.\n image: {\n inline: true,\n group: 'inline',\n draggable: true,\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null },\n width: { default: null },\n },\n parseDOM: [\n {\n tag: 'img[src]',\n getAttrs: (dom: HTMLElement) => ({\n src: dom.getAttribute('src'),\n alt: dom.getAttribute('alt'),\n title: dom.getAttribute('title'),\n width: dom.getAttribute('width'),\n }),\n },\n ],\n toDOM: (node): DOMOutputSpec => [\n 'img',\n {\n src: node.attrs['src'] as string,\n alt: node.attrs['alt'] as string | null,\n title: node.attrs['title'] as string | null,\n width: node.attrs['width'] as string | null,\n },\n ],\n },\n\n list_item: { ...listItem, content: 'paragraph block*' },\n ordered_list: { ...orderedList, content: 'list_item+', group: 'block' },\n bullet_list: { ...bulletList, content: 'list_item+', group: 'block' },\n};\n\nconst marks: Record<string, MarkSpec> = {\n link: {\n attrs: { href: {}, title: { default: null }, target: { default: '_blank' } },\n inclusive: false,\n parseDOM: [\n {\n tag: 'a[href]',\n getAttrs: (dom: HTMLElement) => ({\n href: dom.getAttribute('href'),\n title: dom.getAttribute('title'),\n target: dom.getAttribute('target'),\n }),\n },\n ],\n toDOM: (mark): DOMOutputSpec => [\n 'a',\n {\n href: mark.attrs['href'] as string,\n title: mark.attrs['title'] as string | null,\n target: mark.attrs['target'] as string | null,\n // Not parsed back, so it does not accumulate; opening a link in a new\n // tab without it hands the target window a reference to ours.\n rel: 'noopener',\n },\n 0,\n ],\n },\n\n em: {\n parseDOM: [{ tag: 'i' }, { tag: 'em' }, { style: 'font-style=italic' }],\n toDOM: (): DOMOutputSpec => ['em', 0],\n },\n\n strong: {\n parseDOM: [\n { tag: 'strong' },\n // Google Docs wraps pasted content in <b style=\"font-weight:normal\">.\n { tag: 'b', getAttrs: (dom: HTMLElement) => dom.style.fontWeight !== 'normal' && null },\n { style: 'font-weight', getAttrs: (value: string) => /^(?:bold(?:er)?|[5-9]\\d{2,})$/.test(value) && null },\n ],\n toDOM: (): DOMOutputSpec => ['strong', 0],\n },\n\n code: {\n parseDOM: [{ tag: 'code' }],\n toDOM: (): DOMOutputSpec => ['code', 0],\n },\n\n u: {\n parseDOM: [{ tag: 'u' }, { style: 'text-decoration=underline', consuming: false }],\n toDOM: (): DOMOutputSpec => ['u', 0],\n },\n\n s: {\n parseDOM: [{ tag: 's' }, { tag: 'strike' }, { style: 'text-decoration=line-through' }],\n toDOM: (): DOMOutputSpec => ['s', 0],\n },\n\n text_color: {\n attrs: { color: { default: null } },\n parseDOM: [{ style: 'color', getAttrs: (value: string) => ({ color: value }) }],\n toDOM: (mark): DOMOutputSpec => ['span', { style: `color:${String(mark.attrs['color'])};` }, 0],\n },\n\n text_background_color: {\n attrs: { backgroundColor: { default: null } },\n parseDOM: [{ style: 'background-color', getAttrs: (value: string) => ({ backgroundColor: value }) }],\n toDOM: (mark): DOMOutputSpec => [\n 'span',\n { style: `background-color:${String(mark.attrs['backgroundColor'])};` },\n 0,\n ],\n },\n\n // Parse-only in practice: no toolbar button toggles them, but content saved\n // by ngx-editor's superscript/subscript commands still round-trips.\n sup: {\n parseDOM: [{ tag: 'sup' }, { style: 'vertical-align=super' }],\n toDOM: (): DOMOutputSpec => ['sup', 0],\n },\n\n sub: {\n parseDOM: [{ tag: 'sub' }, { style: 'vertical-align=sub' }],\n toDOM: (): DOMOutputSpec => ['sub', 0],\n },\n};\n\n/** The schema itself — one instance, shared by every editor. */\nexport const schema = new Schema({ nodes, marks });\n\n/**\n * Node types, resolved once and by name.\n *\n * `Schema.nodes` is an index signature, and this project turns on\n * `noPropertyAccessFromIndexSignature`, so every lookup would otherwise need\n * brackets at the call site.\n */\nexport const nodeTypes = {\n doc: schema.nodes['doc'],\n paragraph: schema.nodes['paragraph'],\n heading: schema.nodes['heading'],\n blockquote: schema.nodes['blockquote'],\n codeBlock: schema.nodes['code_block'],\n bulletList: schema.nodes['bullet_list'],\n orderedList: schema.nodes['ordered_list'],\n listItem: schema.nodes['list_item'],\n hardBreak: schema.nodes['hard_break'],\n horizontalRule: schema.nodes['horizontal_rule'],\n image: schema.nodes['image'],\n};\n\n/** Mark types, resolved once and by name. See {@link nodeTypes}. */\nexport const markTypes = {\n strong: schema.marks['strong'],\n em: schema.marks['em'],\n underline: schema.marks['u'],\n strike: schema.marks['s'],\n code: schema.marks['code'],\n link: schema.marks['link'],\n textColor: schema.marks['text_color'],\n backgroundColor: schema.marks['text_background_color'],\n};\n\n/** Text alignments an alignable block accepts. */\nexport type Alignment = 'left' | 'center' | 'right' | 'justify';\n","import { DOMParser, DOMSerializer, Node as ProseNode, Schema } from 'prosemirror-model';\nimport { schema as defaultSchema } from './schema';\n\n/**\n * HTML in, HTML out. `richedit` stores its field values as HTML strings, so\n * every document crosses this boundary twice per edit.\n *\n * Both directions go through a detached element, never through the live\n * document, which keeps them usable under SSR shims and in jsdom specs.\n */\n\n/** A detached container to parse into or serialize out of. */\nfunction container(): HTMLElement {\n return document.createElement('div');\n}\n\n/**\n * Parse an HTML string into a document node.\n *\n * Anything the schema has no rule for is dropped, which is why the schema keeps\n * parse rules for constructs the toolbar cannot produce.\n */\nexport function fromHTML(html: string, schema: Schema = defaultSchema): ProseNode {\n const element = container();\n element.innerHTML = html;\n return DOMParser.fromSchema(schema).parse(element);\n}\n\n/**\n * Serialize a document node back to an HTML string.\n *\n * An empty document serializes to `''`, not to the `<p></p>` `ngx-editor`\n * wrote. A field the user cleared should read as empty for the consumer — a\n * paragraph containing nothing is truthy, and every `if (model.description)`\n * built on it was quietly wrong.\n */\nexport function toHTML(doc: ProseNode, schema: Schema = defaultSchema): string {\n if (isEmpty(doc)) return '';\n const element = container();\n element.appendChild(DOMSerializer.fromSchema(schema).serializeFragment(doc.content));\n return element.innerHTML;\n}\n\n/**\n * Whether a document holds nothing but one empty textblock.\n *\n * Drives both the placeholder decoration and {@link toHTML}'s empty case. Note\n * that an empty *heading* counts: the user typed `# ` and nothing else, so\n * there is still no content to store.\n */\nexport function isEmpty(doc: ProseNode): boolean {\n if (doc.childCount === 0) return true;\n const first = doc.firstChild;\n return doc.childCount === 1 && !!first && first.isTextblock && first.content.size === 0;\n}\n","import { baseKeymap, chainCommands, exitCode, toggleMark } from 'prosemirror-commands';\nimport { history, redo, undo } from 'prosemirror-history';\nimport { inputRules, textblockTypeInputRule, wrappingInputRule } from 'prosemirror-inputrules';\nimport { keymap } from 'prosemirror-keymap';\nimport { Node as ProseNode } from 'prosemirror-model';\nimport { liftListItem, sinkListItem, splitListItem } from 'prosemirror-schema-list';\nimport { Command, EditorState, Plugin, PluginKey } from 'prosemirror-state';\nimport { Decoration, DecorationSet, EditorView } from 'prosemirror-view';\nimport { fromHTML, isEmpty, toHTML } from './html';\nimport { markTypes, nodeTypes, schema } from './schema';\n\n/** Marks a transaction as coming from {@link Editor.setContent}. */\nconst SET_CONTENT = new PluginKey<boolean>('richeditSetContent');\n\n/** Options accepted by the {@link Editor} constructor. */\nexport interface EditorOptions {\n /** Initial content, as an HTML string. */\n content?: string;\n /** Whether the document starts editable. */\n editable?: boolean;\n /** Text shown while the document is empty. */\n placeholder?: string;\n /** Id of the element labelling the editor, wired as `aria-labelledby`. */\n labelledBy?: string;\n}\n\n/** Shows `placeholder` over an otherwise empty document. */\nfunction placeholderPlugin(placeholder: string): Plugin {\n return new Plugin({\n props: {\n decorations: (state) => {\n const first = state.doc.firstChild;\n if (!first || !isEmpty(state.doc)) return null;\n return DecorationSet.create(state.doc, [\n Decoration.node(0, first.nodeSize, { class: 'is-empty', 'data-placeholder': placeholder }),\n ]);\n },\n },\n });\n}\n\n/** The typing shortcuts: `# `, `> `, `- `, `1. ` and ``` ``` ```. */\nfunction editorInputRules(): Plugin {\n return inputRules({\n rules: [\n wrappingInputRule(/^\\s*>\\s$/, nodeTypes.blockquote),\n wrappingInputRule(/^\\s*([-+*])\\s$/, nodeTypes.bulletList),\n wrappingInputRule(\n /^(\\d+)\\.\\s$/,\n nodeTypes.orderedList,\n (match) => ({ order: Number(match[1]) }),\n (match, node) => node.childCount + (node.attrs['order'] as number) === Number(match[1]),\n ),\n textblockTypeInputRule(/^```$/, nodeTypes.codeBlock),\n textblockTypeInputRule(/^(#{1,6})\\s$/, nodeTypes.heading, (match) => ({ level: match[1].length })),\n ],\n });\n}\n\n/** Keys the editor binds on top of ProseMirror's base map. */\nfunction editorKeymap(): Plugin {\n const hardBreak = chainCommands(exitCode, (state, dispatch) => {\n if (dispatch) {\n dispatch(state.tr.replaceSelectionWith(nodeTypes.hardBreak.create()).scrollIntoView());\n }\n return true;\n });\n return keymap({\n 'Mod-z': undo,\n 'Mod-y': redo,\n 'Mod-Shift-z': redo,\n 'Mod-b': toggleMark(markTypes.strong),\n 'Mod-i': toggleMark(markTypes.em),\n 'Mod-u': toggleMark(markTypes.underline),\n Enter: splitListItem(nodeTypes.listItem),\n Tab: sinkListItem(nodeTypes.listItem),\n 'Shift-Tab': liftListItem(nodeTypes.listItem),\n 'Mod-Enter': hardBreak,\n 'Shift-Enter': hardBreak,\n });\n}\n\n/**\n * The rich text engine behind `<data-richedit>`.\n *\n * Owns a ProseMirror `EditorView` and everything plugged into it, and speaks\n * HTML at its edges — which is what the field values are. It replaces\n * `ngx-editor`'s class of the same name and keeps the same shape of\n * responsibility, so the Angular components around it stayed thin.\n *\n * The view is created detached: the menu bar and the editor component both\n * receive the `Editor` before there is anywhere to put its DOM, and the editor\n * component adopts {@link dom} when it renders.\n *\n * @example\n * ```ts\n * const editor = new Editor({ content: '<p>hello</p>' });\n * editor.onChange((html) => console.log(html));\n * document.body.appendChild(editor.dom);\n * ```\n */\nexport class Editor {\n /** The underlying ProseMirror view. */\n public readonly view: EditorView;\n\n private readonly changeListeners = new Set<(html: string) => void>();\n private readonly stateListeners = new Set<(state: EditorState) => void>();\n /** Serialization of the current document — what {@link html} reports. */\n private _html: string;\n /**\n * The last string handed in from outside.\n *\n * Parsing normalises (`<b>` becomes `<strong>`, `text-align:center` gains a\n * space), so the loaded string and the serialized one often differ while\n * meaning the same document. Keeping both is what lets {@link setContent}\n * recognise \"you are giving me back what you already gave me\".\n */\n private _loaded: string;\n private _editable: boolean;\n\n constructor(options: EditorOptions = {}) {\n this._loaded = options.content ?? '';\n this._editable = options.editable ?? true;\n const plugins: Plugin[] = [history(), editorKeymap(), keymap(baseKeymap), editorInputRules()];\n if (options.placeholder) {\n plugins.push(placeholderPlugin(options.placeholder));\n }\n const doc = fromHTML(this._loaded);\n this._html = toHTML(doc);\n this.view = new EditorView(null, {\n state: EditorState.create({ doc, schema, plugins }),\n editable: () => this._editable,\n attributes: options.labelledBy ? { 'aria-labelledby': options.labelledBy } : {},\n dispatchTransaction: (transaction) => {\n this.view.updateState(this.view.state.apply(transaction));\n if (transaction.docChanged) {\n this._html = toHTML(this.view.state.doc);\n // Content pushed in from outside must not be reported back as a user\n // edit; that is what would mark a pristine form dirty on load.\n if (!transaction.getMeta(SET_CONTENT)) {\n for (const listener of this.changeListeners) listener(this._html);\n }\n }\n for (const listener of this.stateListeners) listener(this.view.state);\n },\n });\n }\n\n /** The editor's DOM node, ready to be placed in the document. */\n public get dom(): HTMLElement {\n return this.view.dom;\n }\n\n /** Current editor state, for menu bar queries. */\n public get state(): EditorState {\n return this.view.state;\n }\n\n /** Current content, as an HTML string. */\n public get html(): string {\n return this._html;\n }\n\n /** Whether the document accepts edits. */\n public get editable(): boolean {\n return this._editable;\n }\n\n /**\n * Replace the content.\n *\n * A no-op when the HTML is the one already loaded, which is what keeps a\n * form control writing its own value back from resetting the cursor on every\n * keystroke. The replacement is kept out of the undo history — undoing back\n * past a programmatic load is not something a user ever means.\n */\n public setContent(html: string): void {\n if (html === this._html || html === this._loaded) return;\n this._loaded = html;\n const doc: ProseNode = fromHTML(html);\n const transaction = this.view.state.tr\n .replaceWith(0, this.view.state.doc.content.size, doc.content)\n .setMeta(SET_CONTENT, true)\n .setMeta('addToHistory', false);\n this.view.dispatch(transaction);\n }\n\n /** Enable or disable editing. */\n public setEditable(editable: boolean): void {\n if (this._editable === editable) return;\n this._editable = editable;\n // Re-runs the `editable` prop and updates contenteditable on the DOM node.\n this.view.setProps({});\n }\n\n /** Run a command against the current state. Returns whether it applied. */\n public exec(command: Command): boolean {\n const applied = command(this.view.state, this.view.dispatch.bind(this.view));\n this.view.focus();\n return applied;\n }\n\n /** Put the caret back in the document. */\n public focus(): void {\n this.view.focus();\n }\n\n /** Listen to content changes. Returns a function that stops listening. */\n public onChange(listener: (html: string) => void): () => void {\n this.changeListeners.add(listener);\n return () => this.changeListeners.delete(listener);\n }\n\n /** Listen to state changes, including selection. Returns an unsubscribe. */\n public onStateChange(listener: (state: EditorState) => void): () => void {\n this.stateListeners.add(listener);\n return () => this.stateListeners.delete(listener);\n }\n\n /** Tear the view down and drop every listener. */\n public destroy(): void {\n this.changeListeners.clear();\n this.stateListeners.clear();\n this.view.destroy();\n }\n}\n","import { afterNextRender, Component, DestroyRef, ElementRef, inject, input, OnInit, viewChild } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Editor } from './prose/editor';\n\n@Component({\n selector: 'data-richedit-editor',\n template: '<div #host class=\"data-richedit__content\" [attr.id]=\"inputId()\"></div>',\n styleUrls: ['./richedit-editor.component.sass'],\n providers: [{ provide: NG_VALUE_ACCESSOR, multi: true, useExisting: RicheditEditorComponent }],\n})\n/**\n * The editable region of `<data-richedit>`: a `ControlValueAccessor` wrapped\n * around a vendored {@link Editor}.\n *\n * Internal to the entry point — it replaces `<ngx-editor>` and keeps its\n * contract, so `richedit`'s template still binds a `[formControl]` to it and\n * the form machinery is none the wiser.\n *\n * The editor's DOM is built detached by the {@link Editor} itself and adopted\n * here once there is a host element, which keeps construction free of layout\n * and safe under SSR.\n */\nexport class RicheditEditorComponent implements ControlValueAccessor, OnInit {\n /** The engine to display. Owned by the parent, which also destroys it. */\n public editor = input.required<Editor>();\n /** Id put on the wrapper, so a label can point at it. */\n public inputId = input<string>();\n\n private readonly host = viewChild.required<ElementRef<HTMLElement>>('host');\n private readonly destroyRef = inject(DestroyRef);\n private onChange: (html: string) => void = () => {\n // Replaced by registerOnChange when used inside a form.\n };\n private onTouched: () => void = () => {\n // Replaced by registerOnTouched when used inside a form.\n };\n\n constructor() {\n afterNextRender(() => {\n this.host().nativeElement.appendChild(this.editor().dom);\n });\n }\n\n public ngOnInit(): void {\n const stop = this.editor().onChange((html) => {\n this.onTouched();\n this.onChange(html);\n });\n this.destroyRef.onDestroy(stop);\n }\n\n /** Load a value coming from the form into the editor. */\n public writeValue(html: string | null): void {\n this.editor().setContent(html ?? '');\n }\n\n /** @param onChange callback the form supplies to hear about edits */\n public registerOnChange(onChange: (html: string) => void): void {\n this.onChange = onChange;\n }\n\n /** @param onTouched callback the form supplies to hear about first contact */\n public registerOnTouched(onTouched: () => void): void {\n this.onTouched = onTouched;\n }\n\n /** Disabling the control makes the document read-only. */\n public setDisabledState(disabled: boolean): void {\n this.editor().setEditable(!disabled);\n }\n}\n","import { Attrs, MarkType, NodeType } from 'prosemirror-model';\nimport { Command, EditorState } from 'prosemirror-state';\nimport { lift, setBlockType, toggleMark, wrapIn } from 'prosemirror-commands';\nimport { liftListItem, wrapInList } from 'prosemirror-schema-list';\nimport { Alignment, markTypes, nodeTypes, schema } from './schema';\n\n/**\n * Editing commands for the `richedit` schema, plus the state queries the menu\n * bar needs to render a button pressed or not.\n *\n * Everything here is a plain ProseMirror `Command` — `(state, dispatch?) =>\n * boolean` — so it can be bound to a key, called from a button, or asserted on\n * in a spec by dispatching into a bare `EditorState`.\n */\n\n/** Whether every attribute in `expected` matches the node's. */\nfunction attrsMatch(actual: Attrs, expected: Attrs): boolean {\n return Object.keys(expected).every((key) => actual[key] === expected[key]);\n}\n\n/**\n * Whether the mark is on the whole selection — or, with the cursor collapsed,\n * whether the next character typed would carry it.\n */\nexport function isMarkActive(state: EditorState, type: MarkType): boolean {\n const { from, to, empty, $from } = state.selection;\n if (empty) {\n return !!type.isInSet(state.storedMarks ?? $from.marks());\n }\n return state.doc.rangeHasMark(from, to, type);\n}\n\n/**\n * Whether a node of that type (with those attributes, if given) contains or\n * intersects the selection.\n *\n * `nodesBetween` walks down from the document, so this reports ancestors too —\n * which is what makes it work for blockquotes and lists, where the cursor sits\n * in a paragraph nested inside the node being asked about.\n */\nexport function isNodeActive(state: EditorState, type: NodeType, attrs: Attrs = {}): boolean {\n const { from, to } = state.selection;\n let active = false;\n state.doc.nodesBetween(from, to, (node) => {\n if (node.type === type && attrsMatch(node.attrs, attrs)) {\n active = true;\n }\n });\n return active;\n}\n\n/** Toggle a mark over the selection. */\nexport function toggleMarkCommand(type: MarkType): Command {\n return toggleMark(type);\n}\n\n/** Toggle `<strong>` over the selection. */\nexport const toggleBold = toggleMark(markTypes.strong);\n/** Toggle `<em>` over the selection. */\nexport const toggleItalic = toggleMark(markTypes.em);\n/** Toggle `<u>` over the selection. */\nexport const toggleUnderline = toggleMark(markTypes.underline);\n/** Toggle `<s>` over the selection. */\nexport const toggleStrike = toggleMark(markTypes.strike);\n/** Toggle `<code>` over the selection. */\nexport const toggleCode = toggleMark(markTypes.code);\n\n/**\n * Make the selected blocks headings of that level.\n *\n * This is what the menu bar's dropdown uses: picking a level in a list should\n * put you at that level, not toggle you out of it.\n */\nexport function setHeading(level: number): Command {\n return setBlockType(nodeTypes.heading, { level });\n}\n\n/**\n * Switch the selected blocks between a heading of that level and a paragraph.\n *\n * Unlike {@link setHeading}, picking the level already in force turns it back\n * into a paragraph — the behaviour a toggle button wants.\n */\nexport function toggleHeading(level: number): Command {\n return (state, dispatch) =>\n isNodeActive(state, nodeTypes.heading, { level })\n ? setBlockType(nodeTypes.paragraph)(state, dispatch)\n : setHeading(level)(state, dispatch);\n}\n\n/** Turn the selected blocks into paragraphs. */\nexport const setParagraph = setBlockType(nodeTypes.paragraph);\n\n/** Toggle a code block over the selected blocks. */\nexport const toggleCodeBlock: Command = (state, dispatch) =>\n isNodeActive(state, nodeTypes.codeBlock)\n ? setBlockType(nodeTypes.paragraph)(state, dispatch)\n : setBlockType(nodeTypes.codeBlock)(state, dispatch);\n\n/** Wrap the selection in a blockquote, or lift it back out. */\nexport const toggleBlockquote: Command = (state, dispatch) =>\n isNodeActive(state, nodeTypes.blockquote) ? lift(state, dispatch) : wrapIn(nodeTypes.blockquote)(state, dispatch);\n\n/** Wrap the selection in a list of that type, or lift it back out. */\nexport function toggleList(type: NodeType): Command {\n return (state, dispatch) =>\n isNodeActive(state, type) ? liftListItem(nodeTypes.listItem)(state, dispatch) : wrapInList(type)(state, dispatch);\n}\n\n/** Toggle a bullet list around the selection. */\nexport const toggleBulletList = toggleList(nodeTypes.bulletList);\n/** Toggle an ordered list around the selection. */\nexport const toggleOrderedList = toggleList(nodeTypes.orderedList);\n\n/**\n * Set the text alignment of every paragraph and heading in the selection.\n *\n * Alignment lives on the block as an attribute and serializes to\n * `style=\"text-align:…\"`, the way `ngx-editor` stored it. `null` clears it.\n */\nexport function setAlign(align: Alignment | null): Command {\n return (state, dispatch) => {\n const { from, to } = state.selection;\n const transaction = state.tr;\n let applicable = false;\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (node.type !== nodeTypes.paragraph && node.type !== nodeTypes.heading) return;\n applicable = true;\n // setNodeMarkup keeps the node's size, so positions collected during the\n // walk stay valid as the transaction grows.\n transaction.setNodeMarkup(pos, undefined, { ...node.attrs, align });\n });\n if (!applicable) return false;\n if (dispatch) dispatch(transaction.scrollIntoView());\n return true;\n };\n}\n\n/** The alignment in force on the block holding the cursor, if any. */\nexport function activeAlignment(state: EditorState): Alignment | null {\n const parent = state.selection.$from.parent;\n if (parent.type !== nodeTypes.paragraph && parent.type !== nodeTypes.heading) return null;\n return (parent.attrs['align'] as Alignment | null) ?? null;\n}\n\n/** The heading level in force, or 0 outside a heading. */\nexport function activeHeading(state: EditorState): number {\n for (let level = 1; level <= 6; level++) {\n if (isNodeActive(state, nodeTypes.heading, { level })) return level;\n }\n return 0;\n}\n\n/**\n * Apply a colour mark to the selection, replacing any colour already there.\n *\n * With the cursor collapsed the mark is stored instead, so it applies to what\n * the user types next — the same behaviour as bold on an empty selection.\n */\nexport function setColor(type: MarkType, attrs: Attrs): Command {\n return (state, dispatch) => {\n const { from, to, empty } = state.selection;\n if (empty) {\n if (dispatch) dispatch(state.tr.addStoredMark(type.create(attrs)));\n return true;\n }\n if (dispatch) {\n dispatch(state.tr.removeMark(from, to, type).addMark(from, to, type.create(attrs)).scrollIntoView());\n }\n return true;\n };\n}\n\n/** Drop a colour mark from the selection. */\nexport function removeColor(type: MarkType): Command {\n return (state, dispatch) => {\n const { from, to, empty } = state.selection;\n if (empty) {\n if (dispatch) dispatch(state.tr.removeStoredMark(type));\n return true;\n }\n if (dispatch) dispatch(state.tr.removeMark(from, to, type).scrollIntoView());\n return true;\n };\n}\n\n/** The colour currently carried by the selection, for the colour pickers. */\nexport function activeColor(state: EditorState, type: MarkType, attr: string): string | null {\n const { $from, empty } = state.selection;\n const marks = empty ? (state.storedMarks ?? $from.marks()) : ($from.nodeAfter?.marks ?? $from.marks());\n const mark = marks.find((candidate) => candidate.type === type);\n return mark ? ((mark.attrs[attr] as string | null) ?? null) : null;\n}\n\n/**\n * The span of the link under the cursor, or the selection when it is not\n * collapsed.\n *\n * Walks outwards from the cursor over the sibling text nodes that carry the\n * mark, so \"remove link\" works with the caret merely inside the link rather\n * than with the whole thing selected.\n */\nexport function linkRange(state: EditorState): { from: number; to: number } | null {\n const { $from, from, to, empty } = state.selection;\n if (!empty) return { from, to };\n const type = markTypes.link;\n if (!type.isInSet($from.marks())) return null;\n const parent = $from.parent;\n const start = parent.childAfter($from.parentOffset);\n if (!start.node) return null;\n\n let index = start.index;\n let startPos = $from.start() + start.offset;\n while (index > 0 && type.isInSet(parent.child(index - 1).marks)) {\n index--;\n startPos -= parent.child(index).nodeSize;\n }\n\n index = start.index;\n let endPos = $from.start() + start.offset + start.node.nodeSize;\n while (index + 1 < parent.childCount && type.isInSet(parent.child(index + 1).marks)) {\n index++;\n endPos += parent.child(index).nodeSize;\n }\n\n return { from: startPos, to: endPos };\n}\n\n/** The href of the link under the cursor, for prefilling the link form. */\nexport function activeLink(state: EditorState): string | null {\n const mark = state.selection.$from.marks().find((candidate) => candidate.type === markTypes.link);\n return mark ? ((mark.attrs['href'] as string | null) ?? null) : null;\n}\n\n/**\n * Link the selection.\n *\n * Takes the href as an argument rather than prompting, so the command stays\n * free of DOM and the menu bar owns the form. With the caret inside an existing\n * link and nothing selected, that link's whole span is re-linked.\n */\nexport function addLink(href: string, title: string | null = null): Command {\n return (state, dispatch) => {\n const range = linkRange(state);\n if (!range || range.from === range.to) return false;\n if (dispatch) {\n const mark = markTypes.link.create({ href, title, target: '_blank' });\n dispatch(\n state.tr.removeMark(range.from, range.to, markTypes.link).addMark(range.from, range.to, mark).scrollIntoView(),\n );\n }\n return true;\n };\n}\n\n/** Unlink the link under the cursor, or the selection. */\nexport const removeLink: Command = (state, dispatch) => {\n const range = linkRange(state);\n if (!range || range.from === range.to) return false;\n if (dispatch) dispatch(state.tr.removeMark(range.from, range.to, markTypes.link).scrollIntoView());\n return true;\n};\n\n/** Insert a horizontal rule at the selection. */\nexport const insertHorizontalRule: Command = (state, dispatch) => {\n if (dispatch) dispatch(state.tr.replaceSelectionWith(nodeTypes.horizontalRule.create()).scrollIntoView());\n return true;\n};\n\n/** Drop every mark from the selection and put its blocks back to paragraphs. */\nexport const clearFormat: Command = (state, dispatch) => {\n const { from, to, empty } = state.selection;\n if (empty) return false;\n if (dispatch) {\n const transaction = state.tr;\n for (const type of Object.values(schema.marks)) {\n transaction.removeMark(from, to, type);\n }\n dispatch(transaction.scrollIntoView());\n }\n return true;\n};\n","import { Component, computed, DestroyRef, inject, input, OnInit, signal } from '@angular/core';\nimport { MarkType } from 'prosemirror-model';\nimport { Command, EditorState } from 'prosemirror-state';\nimport { redo, undo } from 'prosemirror-history';\nimport { Editor } from './prose/editor';\nimport {\n activeAlignment,\n activeColor,\n activeHeading,\n activeLink,\n addLink,\n clearFormat,\n insertHorizontalRule,\n isMarkActive,\n isNodeActive,\n removeColor,\n removeLink,\n setAlign,\n setColor,\n setHeading,\n setParagraph,\n toggleBlockquote,\n toggleBold,\n toggleBulletList,\n toggleCode,\n toggleItalic,\n toggleOrderedList,\n toggleStrike,\n toggleUnderline,\n} from './prose/commands';\nimport { Alignment, markTypes, nodeTypes } from './prose/schema';\nimport { TBHeadingItems, Toolbar, ToolbarItem } from './toolbar';\n\n/** A plain toggle button. */\ninterface MenuButtonEntry {\n kind: 'button';\n key: string;\n icon: string;\n label: string;\n command: Command;\n active: (state: EditorState) => boolean;\n}\n\n/** The heading dropdown. */\ninterface MenuHeadingEntry {\n kind: 'heading';\n key: string;\n label: string;\n levels: number[];\n}\n\n/** A colour picker, backed by a native `<input type=\"color\">`. */\ninterface MenuColorEntry {\n kind: 'color';\n key: string;\n icon: string;\n label: string;\n mark: MarkType;\n attr: string;\n}\n\n/** The link button, which opens the inline link form. */\ninterface MenuLinkEntry {\n kind: 'link';\n key: string;\n icon: string;\n label: string;\n}\n\n/** Anything the menu bar knows how to render. */\nexport type MenuEntry = MenuButtonEntry | MenuHeadingEntry | MenuColorEntry | MenuLinkEntry;\n\n/** Button definitions, by toolbar item name. */\nconst BUTTONS: Record<string, Omit<MenuButtonEntry, 'kind' | 'key'>> = {\n bold: { icon: 'bi-type-bold', label: 'Gras', command: toggleBold, active: (s) => isMarkActive(s, markTypes.strong) },\n italic: {\n icon: 'bi-type-italic',\n label: 'Italique',\n command: toggleItalic,\n active: (s) => isMarkActive(s, markTypes.em),\n },\n underline: {\n icon: 'bi-type-underline',\n label: 'Souligné',\n command: toggleUnderline,\n active: (s) => isMarkActive(s, markTypes.underline),\n },\n strike: {\n icon: 'bi-type-strikethrough',\n label: 'Barré',\n command: toggleStrike,\n active: (s) => isMarkActive(s, markTypes.strike),\n },\n code: { icon: 'bi-code', label: 'Code', command: toggleCode, active: (s) => isMarkActive(s, markTypes.code) },\n blockquote: {\n icon: 'bi-blockquote-left',\n label: 'Citation',\n command: toggleBlockquote,\n active: (s) => isNodeActive(s, nodeTypes.blockquote),\n },\n bullet_list: {\n icon: 'bi-list-ul',\n label: 'Liste à puces',\n command: toggleBulletList,\n active: (s) => isNodeActive(s, nodeTypes.bulletList),\n },\n ordered_list: {\n icon: 'bi-list-ol',\n label: 'Liste numérotée',\n command: toggleOrderedList,\n active: (s) => isNodeActive(s, nodeTypes.orderedList),\n },\n align_left: { icon: 'bi-text-left', label: 'Aligner à gauche', ...alignEntry('left') },\n align_center: { icon: 'bi-text-center', label: 'Centrer', ...alignEntry('center') },\n align_right: { icon: 'bi-text-right', label: 'Aligner à droite', ...alignEntry('right') },\n align_justify: { icon: 'bi-justify', label: 'Justifier', ...alignEntry('justify') },\n horizontal_rule: {\n icon: 'bi-hr',\n label: 'Ligne horizontale',\n command: insertHorizontalRule,\n active: () => false,\n },\n format_clear: { icon: 'bi-eraser', label: 'Effacer la mise en forme', command: clearFormat, active: () => false },\n undo: { icon: 'bi-arrow-counterclockwise', label: 'Annuler', command: undo, active: () => false },\n redo: { icon: 'bi-arrow-clockwise', label: 'Rétablir', command: redo, active: () => false },\n};\n\n/** The command and active check for an alignment button. */\nfunction alignEntry(align: Alignment) {\n return {\n command: setAlign(align),\n active: (state: EditorState) => activeAlignment(state) === align,\n };\n}\n\n/**\n * Colour pickers, by toolbar item name.\n *\n * Each renders as an icon over a swatch rather than as a bare `<input\n * type=\"color\">`: on its own that input is an opaque coloured square, and two\n * of them side by side say nothing about which is text and which is\n * background.\n */\nconst COLORS: Record<string, Omit<MenuColorEntry, 'kind' | 'key'>> = {\n text_color: { icon: 'bi-fonts', label: 'Couleur du texte', mark: markTypes.textColor, attr: 'color' },\n background_color: {\n icon: 'bi-highlighter',\n label: 'Couleur de fond',\n mark: markTypes.backgroundColor,\n attr: 'backgroundColor',\n },\n};\n\n/** Items accepted by the configuration but not implemented here. */\nconst UNSUPPORTED = new Set(['image', 'indent', 'outdent', 'superscript', 'subscript']);\n\n/** `rgb(255, 0, 0)` or `#f00` as the `#rrggbb` an `<input type=\"color\">` wants. */\nexport function toHexColor(value: string | null): string {\n if (!value) return '#000000';\n const rgb = /^rgba?\\((\\d+)[,\\s]+(\\d+)[,\\s]+(\\d+)/.exec(value);\n if (rgb) {\n return `#${[1, 2, 3].map((i) => Number(rgb[i]).toString(16).padStart(2, '0')).join('')}`;\n }\n const short = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(value);\n if (short) {\n return `#${short[1]}${short[1]}${short[2]}${short[2]}${short[3]}${short[3]}`.toLowerCase();\n }\n return /^#[0-9a-f]{6}$/i.test(value) ? value.toLowerCase() : '#000000';\n}\n\n@Component({\n selector: 'data-richedit-menubar',\n templateUrl: './richedit-menubar.component.html',\n styleUrls: ['./richedit-menubar.component.sass'],\n})\n/**\n * The menu bar of `<data-richedit>`.\n *\n * Internal to the entry point — it replaces `<ngx-editor-menu>` and reads the\n * same `Toolbar` configuration, so presets and hand-written toolbars carry\n * over. Rendering is Bootstrap button groups with `bootstrap-icons`; colours\n * use a native `<input type=\"color\">` and links a small inline form, which is\n * what lets this drop the floating-ui dependency the old menu needed.\n */\nexport class RicheditMenubarComponent implements OnInit {\n /** The engine the buttons act on. */\n public editor = input.required<Editor>();\n /** Toolbar configuration; unknown items are skipped with a warning. */\n public toolbar = input<Toolbar>([]);\n\n /** Latest editor state, so buttons can render themselves pressed. */\n public readonly editorState = signal<EditorState | undefined>(undefined);\n /** Whether the inline link form is open. */\n public readonly linkOpen = signal(false);\n\n private readonly destroyRef = inject(DestroyRef);\n\n /** The toolbar resolved into entries the template can render. */\n public readonly groups = computed<MenuEntry[][]>(() => {\n const skipped: string[] = [];\n const groups = this.toolbar().map((group) =>\n group.map((item) => this.resolve(item, skipped)).filter((entry): entry is MenuEntry => entry !== null),\n );\n if (skipped.length) {\n console.warn(`richedit: unsupported toolbar item(s) ignored: ${skipped.join(', ')}`);\n }\n return groups.filter((group) => group.length > 0);\n });\n\n /** Href of the link under the cursor, prefilled into the link form. */\n public readonly linkHref = computed(() => {\n const state = this.editorState();\n return state ? (activeLink(state) ?? '') : '';\n });\n\n public ngOnInit(): void {\n this.editorState.set(this.editor().state);\n const stop = this.editor().onStateChange((state) => this.editorState.set(state));\n this.destroyRef.onDestroy(stop);\n }\n\n /** Whether a toggle button should render pressed. */\n public isActive(entry: MenuButtonEntry): boolean {\n const state = this.editorState();\n return state ? entry.active(state) : false;\n }\n\n /** Run a button's command. */\n public run(entry: MenuButtonEntry): void {\n this.editor().exec(entry.command);\n }\n\n /** Heading level in force, as the string the dropdown binds to. */\n public currentHeading(): number {\n const state = this.editorState();\n return state ? activeHeading(state) : 0;\n }\n\n /** Apply the level picked in the heading dropdown. */\n public applyHeading(value: string): void {\n const level = Number(value);\n this.editor().exec(level === 0 ? setParagraph : setHeading(level));\n }\n\n /**\n * The colour actually in force, or null when the selection carries none.\n *\n * Distinct from {@link currentColor} on purpose: the swatch has to be able to\n * show \"no colour\", while the native picker insists on a real value.\n */\n public swatchColor(entry: MenuColorEntry): string | null {\n const state = this.editorState();\n return state ? activeColor(state, entry.mark, entry.attr) : null;\n }\n\n /** Current value of a colour picker, as the `#rrggbb` the input requires. */\n public currentColor(entry: MenuColorEntry): string {\n return toHexColor(this.swatchColor(entry));\n }\n\n /** Apply a colour picked in one of the pickers. */\n public applyColor(entry: MenuColorEntry, value: string): void {\n this.editor().exec(setColor(entry.mark, { [entry.attr]: value }));\n }\n\n /** Drop the colour a picker controls. */\n public clearColor(entry: MenuColorEntry): void {\n this.editor().exec(removeColor(entry.mark));\n }\n\n /** Open or close the inline link form. */\n public toggleLinkForm(): void {\n this.linkOpen.update((open) => !open);\n }\n\n /** Link the selection to `href`, then close the form. */\n public applyLink(href: string): void {\n if (href) {\n this.editor().exec(addLink(href));\n }\n this.linkOpen.set(false);\n }\n\n /** Unlink, then close the form. */\n public clearLink(): void {\n this.editor().exec(removeLink);\n this.linkOpen.set(false);\n }\n\n /** Whether the cursor sits in a link, for the button's pressed state. */\n public linkActive(): boolean {\n const state = this.editorState();\n return state ? isMarkActive(state, markTypes.link) : false;\n }\n\n /** Turn one configuration item into a renderable entry, or skip it. */\n private resolve(item: ToolbarItem, skipped: string[]): MenuEntry | null {\n if (typeof item !== 'string') {\n const levels = item.heading;\n if (!levels?.length) return null;\n return {\n kind: 'heading',\n key: 'heading',\n label: 'Niveau de titre',\n levels: levels.map((level: TBHeadingItems) => Number(level.slice(1))),\n };\n }\n if (item === 'link') {\n return { kind: 'link', key: 'link', icon: 'bi-link-45deg', label: 'Lien' };\n }\n const color = COLORS[item];\n if (color) {\n return { kind: 'color', key: item, ...color };\n }\n const button = BUTTONS[item];\n if (button) {\n return { kind: 'button', key: item, ...button };\n }\n if (UNSUPPORTED.has(item)) {\n skipped.push(item);\n }\n return null;\n }\n}\n","<div class=\"btn-toolbar data-richedit__menubar\" role=\"toolbar\" aria-label=\"Mise en forme du texte\">\n @for (group of groups(); track $index) {\n <div class=\"btn-group btn-group-sm me-1\">\n @for (entry of group; track entry.key) {\n @if (entry.kind === \"button\") {\n <button\n type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n [class.active]=\"isActive(entry)\"\n [attr.aria-pressed]=\"isActive(entry)\"\n [attr.aria-label]=\"entry.label\"\n [title]=\"entry.label\"\n (click)=\"run(entry)\"\n >\n <i class=\"bi {{ entry.icon }}\" aria-hidden=\"true\"></i>\n </button>\n } @else if (entry.kind === \"link\") {\n <button\n type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n [class.active]=\"linkActive()\"\n [attr.aria-pressed]=\"linkOpen()\"\n [attr.aria-expanded]=\"linkOpen()\"\n [attr.aria-label]=\"entry.label\"\n [title]=\"entry.label\"\n (click)=\"toggleLinkForm()\"\n >\n <i class=\"bi {{ entry.icon }}\" aria-hidden=\"true\"></i>\n </button>\n } @else if (entry.kind === \"heading\") {\n <select\n #headingSelect\n class=\"form-select form-select-sm data-richedit__headings\"\n [attr.aria-label]=\"entry.label\"\n [title]=\"entry.label\"\n [value]=\"currentHeading()\"\n (change)=\"applyHeading(headingSelect.value)\"\n >\n <option [value]=\"0\">Paragraphe</option>\n @for (level of entry.levels; track level) {\n <option [value]=\"level\">Titre {{ level }}</option>\n }\n </select>\n } @else {\n <!--\n The native picker is the real control -- it keeps the keyboard and\n the OS colour dialog -- but it sits invisible over the label, which\n carries the icon, the swatch and (through :focus-within) the focus\n ring.\n -->\n <label class=\"btn btn-sm btn-outline-secondary data-richedit__color\" [title]=\"entry.label\">\n <i class=\"bi {{ entry.icon }}\" aria-hidden=\"true\"></i>\n <span\n class=\"data-richedit__swatch\"\n [style.background-color]=\"swatchColor(entry) ?? 'transparent'\"\n aria-hidden=\"true\"\n ></span>\n <input\n #colorInput\n type=\"color\"\n [attr.aria-label]=\"entry.label\"\n [value]=\"currentColor(entry)\"\n (change)=\"applyColor(entry, colorInput.value)\"\n />\n </label>\n <button\n type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n [attr.aria-label]=\"entry.label + ' : effacer'\"\n [title]=\"entry.label + ' : effacer'\"\n (click)=\"clearColor(entry)\"\n >\n <i class=\"bi bi-x-lg\" aria-hidden=\"true\"></i>\n </button>\n }\n }\n </div>\n }\n</div>\n@if (linkOpen()) {\n <div class=\"input-group input-group-sm mt-1 data-richedit__linkform\">\n <input\n #linkInput\n type=\"url\"\n class=\"form-control\"\n placeholder=\"https://…\"\n aria-label=\"Adresse du lien\"\n [value]=\"linkHref()\"\n (keydown.enter)=\"applyLink(linkInput.value)\"\n />\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"applyLink(linkInput.value)\">Appliquer</button>\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearLink()\">Supprimer</button>\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"toggleLinkForm()\">Annuler</button>\n </div>\n}\n","import { Component, DestroyRef, inject, input, OnInit } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DataModel, FieldEditorBase, SafeHtmlPipe } from '@solidev/data';\nimport { Editor } from './prose/editor';\nimport { Toolbar } from './toolbar';\nimport { RicheditEditorComponent } from './richedit-editor.component';\nimport { RicheditMenubarComponent } from './richedit-menubar.component';\n\n/**\n * Named toolbar presets for {@link RicheditComponent}, selectable through its\n * `toolbar` input.\n *\n * - `default`: the full set — marks, code and quote, lists, headings, links,\n * colours and alignment.\n * - `light`: a reduced set — basic marks, lists, text colour and alignment.\n * - `none`: empty; the component hides the menu bar entirely for this value.\n *\n * A `Toolbar` can also be passed directly to the component when neither preset\n * fits.\n */\nexport const RichEditToolbars: Record<string, Toolbar> = {\n default: [\n ['bold', 'italic'],\n ['underline', 'strike'],\n ['code', 'blockquote'],\n ['ordered_list', 'bullet_list'],\n [{ heading: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] }],\n ['link'],\n ['text_color', 'background_color'],\n ['align_left', 'align_center', 'align_right', 'align_justify'],\n ],\n light: [\n ['bold', 'italic', 'underline'],\n ['ordered_list', 'bullet_list'],\n ['text_color'],\n ['align_left', 'align_center', 'align_right', 'align_justify'],\n ],\n none: [],\n};\n\n@Component({\n selector: 'data-richedit',\n imports: [NgTemplateOutlet, ReactiveFormsModule, RicheditEditorComponent, RicheditMenubarComponent, SafeHtmlPipe],\n templateUrl: './richedit.component.html',\n styleUrls: ['./richedit.component.sass'],\n})\n/**\n * Rich text editor for a model field, built on a vendored ProseMirror engine.\n *\n * Shipped as a separate entry point (`@solidev/data/richedit`) so that the\n * `prosemirror-*` dependencies stay optional for consumers who do not need\n * them. It follows the same `dd` / `inline` / `form` layout convention as\n * `<data-dispedit>`, but is used directly rather than through it: `dispedit`\n * lives in the primary entry point and cannot import a secondary one.\n *\n * The engine used to be `ngx-editor`, which stopped at Angular 19. The\n * replacement lives in `./prose` and speaks the same schema, so stored values\n * are unaffected — and so is this component's API.\n *\n * Unlike `<data-dispedit>`, saving is explicit: the value is written back and\n * persisted only when {@link save} runs, from the built-in save button — and\n * only in `dd` mode. In the other modes {@link save} updates the model in memory\n * but issues no request, leaving persistence to the surrounding form. Callers\n * that supply their own `[fc]` can instead track {@link changed}.\n *\n * @example\n * ```html\n * <data-richedit [model]=\"thing\" field=\"description\">Description</data-richedit>\n * ```\n */\nexport class RicheditComponent<FT, T extends DataModel> extends FieldEditorBase<FT, T> implements OnInit {\n /** Toolbar preset name from {@link RichEditToolbars}, or an explicit toolbar. */\n public toolbar = input<'none' | 'default' | 'light' | Toolbar>('default');\n\n /** Underlying editor instance; destroyed with the component. */\n public editor!: Editor;\n /** Unused; kept for backwards compatibility. */\n public html = '';\n /** Toolbar actually rendered, resolved from {@link toolbar}. */\n public realToolbar: Toolbar = [];\n\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Build the engine and resolve the toolbar, then let the base resolve the\n * control and relay its changes.\n */\n public override ngOnInit(): void {\n this.editor = new Editor();\n this.destroyRef.onDestroy(() => this.editor.destroy());\n const toolbar = this.toolbar();\n if (toolbar === 'none') {\n this.realToolbar = [];\n } else if (typeof toolbar === 'string') {\n this.realToolbar = RichEditToolbars[toolbar] ?? [];\n } else {\n this.realToolbar = toolbar;\n }\n super.ngOnInit();\n if (!this.fc()) {\n this.control.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => this.changed.emit(value));\n }\n }\n}\n","<ng-template #editorTemplate>\n @if (!showEditor()) {\n <!--\n Read-only: the stored HTML, injected as trusted markup. See\n SafeHtmlPipe for why it is not sanitized.\n -->\n <div\n class=\"editable data-richedit__view\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleEdit()\"\n (keydown.enter)=\"toggleEdit()\"\n (keydown.space)=\"$event.preventDefault(); toggleEdit()\"\n [innerHTML]=\"displayValue() | safeHtml\"\n ></div>\n } @else {\n <div class=\"data-richedit__wrapper\">\n @if (realToolbar.length) {\n <data-richedit-menubar [editor]=\"editor\" [toolbar]=\"realToolbar\"></data-richedit-menubar>\n }\n <data-richedit-editor [editor]=\"editor\" [inputId]=\"inputId\" [formControl]=\"control\"></data-richedit-editor>\n </div>\n @if (!hideButton()) {\n <button class=\"btn btn-primary btn-sm w-100 mt-1\" (click)=\"save()\">\n <i class=\"bi bi-save me-2\"></i>\n Enregistrer\n </button>\n }\n }\n</ng-template>\n<ng-template #titleTpl>\n <ng-content></ng-content>\n</ng-template>\n<!-- Dd display-->\n@if (mode() === \"dd\") {\n @if (!hideLabel()) {\n <dt [class.required]=\"required()\">\n <span\n class=\"editable\"\n [attr.id]=\"labelId\"\n (click)=\"toggleEdit()\"\n role=\"button\"\n tabindex=\"0\"\n (keydown.enter)=\"toggleEdit()\"\n (keydown.space)=\"$event.preventDefault(); toggleEdit()\"\n >\n <ng-container [ngTemplateOutlet]=\"titleTpl\"></ng-container>\n </span>\n </dt>\n }\n <dd [class.mb-0]=\"hideLabel()\">\n <ng-container [ngTemplateOutlet]=\"editorTemplate\"></ng-container>\n </dd>\n}\n<!-- Inline display-->\n@if (mode() === \"inline\") {\n @if (!hideLabel()) {\n <label [class.required]=\"required()\" [attr.id]=\"labelId\" [attr.for]=\"inputId\">\n <ng-container [ngTemplateOutlet]=\"titleTpl\"></ng-container>\n </label>\n }\n <ng-container [ngTemplateOutlet]=\"editorTemplate\"></ng-container>\n}\n<!-- Form display-->\n@if (mode() === \"form\") {\n @if (!hideLabel()) {\n <label [class.required]=\"required()\" [attr.id]=\"labelId\" [attr.for]=\"inputId\">\n <ng-container [ngTemplateOutlet]=\"titleTpl\"></ng-container>\n </label>\n }\n <ng-container [ngTemplateOutlet]=\"editorTemplate\"></ng-container>\n}\n","/**\n * Toolbar configuration for `<data-richedit>`.\n *\n * The shape is the one `ngx-editor` used — an array of groups, each group an\n * array of items, an item either a name or a `{heading: [...]}` dropdown — so\n * toolbars written against the old editor keep compiling and keep working.\n */\n\n/** Heading levels a heading dropdown can offer. */\nexport type TBHeadingItems = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\n/**\n * Every item name the configuration accepts.\n *\n * The whole `ngx-editor` vocabulary is listed so existing configurations still\n * type-check. Three of them — `image`, `indent` and `outdent` — have no\n * implementation here and are skipped at render time with a warning naming\n * them, rather than silently disappearing.\n */\nexport type TBItems =\n | 'bold'\n | 'italic'\n | 'code'\n | 'blockquote'\n | 'underline'\n | 'strike'\n | 'ordered_list'\n | 'bullet_list'\n | 'link'\n | 'image'\n | 'text_color'\n | 'background_color'\n | 'align_left'\n | 'align_center'\n | 'align_right'\n | 'align_justify'\n | 'horizontal_rule'\n | 'format_clear'\n | 'indent'\n | 'outdent'\n | 'superscript'\n | 'subscript'\n | 'undo'\n | 'redo';\n\n/** A heading dropdown, listing the levels it offers. */\nexport interface ToolbarDropdown {\n heading?: TBHeadingItems[];\n}\n\n/** One entry in a toolbar group. */\nexport type ToolbarItem = TBItems | ToolbarDropdown;\n\n/** Groups of items, rendered as Bootstrap button groups. */\nexport type Toolbar = ToolbarItem[][];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["schema","defaultSchema"],"mappings":";;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;;;AAcG;AAEH;AACA,SAAS,aAAa,CAAC,MAAqC,EAAA;AAC1D,IAAA,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM;AACvC,SAAA,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE;AAC/D,SAAA,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAA,CAAA,EAAI,CAAC,CAAC,WAAW,EAAE,CAAA,CAAE,CAAC,CAAA,CAAA,EAAI,MAAM,CAAC,KAAK,CAAC,CAAA,CAAE,CAAC;AAC7G,IAAA,OAAO,YAAY,CAAC,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI;AAC5D;AAEA;AACA,SAAS,UAAU,CAAC,GAAgB,EAAA;IAClC,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;IAC9C,OAAO;AACL,QAAA,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,IAAI;AAC/D,QAAA,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,EAAE,EAAE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