@3kles/kles-richtext-editor 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,7 +44,7 @@ export class DocumentFormComponent {
44
44
  }
45
45
  ```
46
46
 
47
- The form value is the native `DocumentNode` AST. Passing `null`, including through `reset()`, displays a canonical empty document. The core validates and copies external values. If a value is invalid, the editor keeps displaying the previous document and reports `richtextDocument` with schema diagnostics. Convert HTML or serialized JSON explicitly before writing it to a form control.
47
+ The default form value is the native `DocumentNode` AST. Passing `null`, including through `reset()`, displays a canonical empty document. The core validates and copies external values. If a value is invalid, the editor keeps displaying the previous document and reports `richtextDocument` with schema diagnostics. Select `formValueFormat="html"` when binding a control containing HTML strings.
48
48
 
49
49
  An external write received during a native notification takes precedence over the remaining events from that edit. If the write is invalid, the editor preserves its error and the control value until notification completes. The earlier `documentChange` cannot overwrite it through `onChange`. A newer valid write supersedes the rejected write, and a subsequent edit can correct the invalid value.
50
50
 
@@ -117,4 +117,26 @@ The peer dependencies are `@angular/common`, `@angular/core`, and `@angular/form
117
117
 
118
118
  The workspace Angular and browser suites verify Forms, the toolbar, and consumption from an external package. The phase reports document limits for cross-platform composition, Firefox and WebKit, screen readers, and performance.
119
119
 
120
- The Dynamic Forms example shows how to pass toolbar and translation providers to one `RichTextDynamicFieldComponent` through its field configuration. [Dynamic Forms integration example](../../src/app/dynamicforms-demo/README.md)
120
+ ## Dynamic Forms
121
+
122
+ Import `RichTextDynamicFieldComponent` and `RichTextDynamicFieldConfig` from `@3kles/kles-richtext-editor/dynamicforms`. This entry point requires the optional peer `@3kles/kles-material-dynamicforms` at `^22.11.0`. The primary entry point works independently of that peer.
123
+
124
+ ```ts
125
+ import { provideRichTextToolbar, richTextHtmlRequiredValidator } from '@3kles/kles-richtext-editor';
126
+ import { RichTextDynamicFieldComponent } from '@3kles/kles-richtext-editor/dynamicforms';
127
+ import type { RichTextDynamicFieldConfig } from '@3kles/kles-richtext-editor/dynamicforms';
128
+
129
+ const body: RichTextDynamicFieldConfig = {
130
+ name: 'body',
131
+ component: RichTextDynamicFieldComponent,
132
+ label: 'Message',
133
+ richTextValueFormat: 'html',
134
+ value: '<p><a href="${process.url}">Open the process</a></p>',
135
+ providers: [provideRichTextToolbar({ items: ['bold', 'italic', 'link', 'undo', 'redo'] })],
136
+ validations: [{ name: 'required', message: 'Enter a message.', validator: richTextHtmlRequiredValidator }],
137
+ };
138
+ ```
139
+
140
+ Omit `richTextValueFormat` for the default `DocumentNode | null` control. HTML mode uses `string | null`. An external HTML value is imported into the editor without rewriting the control. Edits write sanitized HTML with the original template destinations in `href`. The empty paragraph exports as `''` after an edit, and `reset(null)` retains `null`. Template destinations remain inert in the editing DOM. The host resolves them when generating the final document.
141
+
142
+ For Angular Forms outside Dynamic Forms, use `formValueFormat="html"` on `kles-richtext-editor` with a `FormControl<string | null>`. The `document` input, `documentChange` output and native editor APIs still use the AST. Configure the value format when creating the control. [Dynamic Forms demo](../../src/app/dynamicforms-demo/README.md)
@@ -0,0 +1,179 @@
1
+ import { __decorate } from "tslib";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, computed, inject } from "@angular/core";
4
+ import { toSignal } from "@angular/core/rxjs-interop";
5
+ import * as i1 from "@angular/forms";
6
+ import { FormControl, ReactiveFormsModule } from "@angular/forms";
7
+ import { FIELD, FIELD_CONTEXT, FieldMapper, GROUP } from "@3kles/kles-material-dynamicforms";
8
+ import { RICHTEXT_I18N, RichTextEditorComponent, RichTextToolbarComponent, validateRichTextValue } from "@3kles/kles-richtext-editor";
9
+ function createRichTextControl(field) {
10
+ const source = field.value;
11
+ const value = initialValue(source ?? null, field.richTextValueFormat ?? "document");
12
+ return new FormControl({
13
+ value,
14
+ disabled: field.disabled === true
15
+ }, {
16
+ validators: (field.validations ?? []).map((validation) => validation.validator),
17
+ asyncValidators: (field.asyncValidations ?? []).map((validation) => validation.validator),
18
+ updateOn: field.updateOn ?? "change"
19
+ });
20
+ }
21
+ function initialValue(source, format) {
22
+ if (source === null) return null;
23
+ if (format === "html") {
24
+ if (typeof source === "string") return source;
25
+ throw new TypeError("An HTML rich-text field requires a string or null.");
26
+ }
27
+ const result = validateRichTextValue(source);
28
+ if (!result.ok) throw new TypeError("A document rich-text field requires a valid native document or null.");
29
+ return result.value;
30
+ }
31
+ let RichTextDynamicFieldComponent = class RichTextDynamicFieldComponent {
32
+ field = inject(FIELD);
33
+ group = inject(GROUP);
34
+ toolbarLanguage = inject(RICHTEXT_I18N).locale;
35
+ valueFormat = this.field.richTextValueFormat ?? "document";
36
+ context = inject(FIELD_CONTEXT, { optional: true });
37
+ control = this.fieldControl();
38
+ controlEvents = toSignal(this.control.events);
39
+ required = (this.field.validations ?? []).some((validation) => "name" in validation && validation.name === "required");
40
+ invalid = computed(() => {
41
+ this.controlEvents();
42
+ return this.control.invalid && this.control.touched;
43
+ }, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
44
+ readOnly = computed(() => {
45
+ const context = this.context?.();
46
+ return typeof context === "object" && context !== null && "readOnly" in context && context.readOnly === true;
47
+ }, ...ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []);
48
+ fieldControl() {
49
+ const control = this.group.get([this.field.name]);
50
+ if (!control) throw new Error("Dynamic Forms did not create the registered rich-text control.");
51
+ return control;
52
+ }
53
+ static ɵfac = i0.ɵɵngDeclareFactory({
54
+ minVersion: "12.0.0",
55
+ version: "22.2.6",
56
+ ngImport: i0,
57
+ type: RichTextDynamicFieldComponent,
58
+ deps: [],
59
+ target: i0.ɵɵFactoryTarget.Component
60
+ });
61
+ static ɵcmp = i0.ɵɵngDeclareComponent({
62
+ minVersion: "17.0.0",
63
+ version: "22.2.6",
64
+ type: RichTextDynamicFieldComponent,
65
+ isStandalone: true,
66
+ selector: "app-kles-richtext-dynamic-field",
67
+ ngImport: i0,
68
+ template: "<section class=\"dynamic-richtext-field\" [formGroup]=\"group\" [attr.aria-label]=\"field.label ?? 'Document 3KLES'\">\n <h3>\n {{ field.label ?? 'Document 3KLES' }}\n @if (required) {\n <span aria-hidden=\"true\">*</span>\n }\n </h3>\n <kles-richtext-toolbar [editor]=\"editor\" [attr.lang]=\"toolbarLanguage\" />\n <kles-richtext-editor\n #editor\n [formControlName]=\"field.name\"\n [formValueFormat]=\"valueFormat\"\n [required]=\"required\"\n [readOnly]=\"readOnly()\"\n [invalid]=\"invalid()\"\n [label]=\"field.label ?? 'Document 3KLES'\"\n />\n @if (field.hint) {\n <p class=\"field-hint\">{{ field.hint }}</p>\n }\n</section>\n",
69
+ styles: [":host{display:block;min-width:0}.dynamic-richtext-field{min-width:0;margin-block:1.25rem}h3{font-size:1.1rem;margin:0 0 .75rem}.field-hint{color:var(--muted, inherit);font-size:.9rem;line-height:1.5}\n"],
70
+ dependencies: [
71
+ {
72
+ kind: "ngmodule",
73
+ type: ReactiveFormsModule
74
+ },
75
+ {
76
+ kind: "directive",
77
+ type: i1.NgControlStatus,
78
+ selector: "[formControlName],[ngModel],[formControl]"
79
+ },
80
+ {
81
+ kind: "directive",
82
+ type: i1.NgControlStatusGroup,
83
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
84
+ },
85
+ {
86
+ kind: "directive",
87
+ type: i1.RequiredValidator,
88
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
89
+ inputs: ["required"]
90
+ },
91
+ {
92
+ kind: "directive",
93
+ type: i1.FormGroupDirective,
94
+ selector: "[formGroup]",
95
+ inputs: ["formGroup"],
96
+ outputs: ["ngSubmit"],
97
+ exportAs: ["ngForm"]
98
+ },
99
+ {
100
+ kind: "directive",
101
+ type: i1.FormControlName,
102
+ selector: "[formControlName]",
103
+ inputs: [
104
+ "formControlName",
105
+ "disabled",
106
+ "ngModel"
107
+ ],
108
+ outputs: ["ngModelChange"]
109
+ },
110
+ {
111
+ kind: "component",
112
+ type: RichTextEditorComponent,
113
+ selector: "kles-richtext-editor",
114
+ inputs: [
115
+ "document",
116
+ "formValueFormat",
117
+ "readOnly",
118
+ "disabled",
119
+ "required",
120
+ "invalid",
121
+ "label",
122
+ "locale",
123
+ "messages",
124
+ "describedBy"
125
+ ],
126
+ outputs: [
127
+ "documentChange",
128
+ "stateChange",
129
+ "editorEvent",
130
+ "validationChange"
131
+ ]
132
+ },
133
+ {
134
+ kind: "component",
135
+ type: RichTextToolbarComponent,
136
+ selector: "kles-richtext-toolbar",
137
+ inputs: [
138
+ "editor",
139
+ "label",
140
+ "locale",
141
+ "messages",
142
+ "config",
143
+ "items",
144
+ "buttonTemplate",
145
+ "refreshKey"
146
+ ]
147
+ }
148
+ ],
149
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
150
+ });
151
+ };
152
+ RichTextDynamicFieldComponent = __decorate([FieldMapper({
153
+ type: "3kles-richtext",
154
+ factory: createRichTextControl
155
+ })], RichTextDynamicFieldComponent);
156
+ i0.ɵɵngDeclareClassMetadata({
157
+ minVersion: "12.0.0",
158
+ version: "22.2.6",
159
+ ngImport: i0,
160
+ type: RichTextDynamicFieldComponent,
161
+ decorators: [{
162
+ type: Component,
163
+ args: [{
164
+ selector: "app-kles-richtext-dynamic-field",
165
+ standalone: true,
166
+ imports: [
167
+ ReactiveFormsModule,
168
+ RichTextEditorComponent,
169
+ RichTextToolbarComponent
170
+ ],
171
+ changeDetection: ChangeDetectionStrategy.OnPush,
172
+ template: "<section class=\"dynamic-richtext-field\" [formGroup]=\"group\" [attr.aria-label]=\"field.label ?? 'Document 3KLES'\">\n <h3>\n {{ field.label ?? 'Document 3KLES' }}\n @if (required) {\n <span aria-hidden=\"true\">*</span>\n }\n </h3>\n <kles-richtext-toolbar [editor]=\"editor\" [attr.lang]=\"toolbarLanguage\" />\n <kles-richtext-editor\n #editor\n [formControlName]=\"field.name\"\n [formValueFormat]=\"valueFormat\"\n [required]=\"required\"\n [readOnly]=\"readOnly()\"\n [invalid]=\"invalid()\"\n [label]=\"field.label ?? 'Document 3KLES'\"\n />\n @if (field.hint) {\n <p class=\"field-hint\">{{ field.hint }}</p>\n }\n</section>\n",
173
+ styles: [":host{display:block;min-width:0}.dynamic-richtext-field{min-width:0;margin-block:1.25rem}h3{font-size:1.1rem;margin:0 0 .75rem}.field-hint{color:var(--muted, inherit);font-size:.9rem;line-height:1.5}\n"]
174
+ }]
175
+ }]
176
+ });
177
+ export { RichTextDynamicFieldComponent };
178
+
179
+ //# sourceMappingURL=3kles-kles-richtext-editor-dynamicforms.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3kles-kles-richtext-editor-dynamicforms.mjs","names":[],"sources":["../../../projects/kles-richtext-editor/dynamicforms/src/richtext-dynamic-field.component.ts","../../../projects/kles-richtext-editor/dynamicforms/src/richtext-dynamic-field.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport type { AbstractControl } from '@angular/forms';\nimport { FIELD, FIELD_CONTEXT, FieldMapper, GROUP } from '@3kles/kles-material-dynamicforms';\nimport type { IKlesFieldConfig } from '@3kles/kles-material-dynamicforms';\nimport {\n RICHTEXT_I18N,\n RichTextEditorComponent,\n RichTextToolbarComponent,\n validateRichTextValue,\n} from '@3kles/kles-richtext-editor';\nimport type { RichTextFormValueFormat } from '@3kles/kles-richtext-editor';\nimport type { DocumentNode } from '@3kles/richtext-core';\n\nexport interface RichTextDynamicFieldConfig extends IKlesFieldConfig {\n readonly richTextValueFormat?: RichTextFormValueFormat;\n}\n\n/** Dynamic Forms invokes this factory for the registered component itself. */\nfunction createRichTextControl(field: RichTextDynamicFieldConfig): FormControl<DocumentNode | string | null> {\n const source: unknown = field.value;\n const value = initialValue(source ?? null, field.richTextValueFormat ?? 'document');\n return new FormControl<DocumentNode | string | null>(\n { value, disabled: field.disabled === true },\n {\n validators: (field.validations ?? []).map((validation) => validation.validator),\n asyncValidators: (field.asyncValidations ?? []).map((validation) => validation.validator),\n updateOn: field.updateOn ?? 'change',\n },\n );\n}\n\nfunction initialValue(source: unknown, format: RichTextFormValueFormat): DocumentNode | string | null {\n if (source === null) return null;\n if (format === 'html') {\n if (typeof source === 'string') return source;\n throw new TypeError('An HTML rich-text field requires a string or null.');\n }\n const result = validateRichTextValue(source);\n if (!result.ok) throw new TypeError('A document rich-text field requires a valid native document or null.');\n return result.value;\n}\n\n@FieldMapper({ type: '3kles-richtext', factory: createRichTextControl })\n@Component({\n selector: 'app-kles-richtext-dynamic-field',\n standalone: true,\n imports: [ReactiveFormsModule, RichTextEditorComponent, RichTextToolbarComponent],\n templateUrl: './richtext-dynamic-field.component.html',\n styleUrl: './richtext-dynamic-field.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RichTextDynamicFieldComponent {\n readonly field: RichTextDynamicFieldConfig = inject(FIELD);\n readonly group = inject(GROUP);\n readonly toolbarLanguage = inject(RICHTEXT_I18N).locale;\n readonly valueFormat = this.field.richTextValueFormat ?? 'document';\n private readonly context = inject(FIELD_CONTEXT, { optional: true });\n readonly control = this.fieldControl();\n private readonly controlEvents = toSignal(this.control.events);\n readonly required = (this.field.validations ?? []).some(\n (validation) => 'name' in validation && validation.name === 'required',\n );\n readonly invalid = computed(() => {\n this.controlEvents();\n return this.control.invalid && this.control.touched;\n });\n readonly readOnly = computed(() => {\n const context: unknown = this.context?.();\n return typeof context === 'object' && context !== null && 'readOnly' in context && context.readOnly === true;\n });\n\n private fieldControl(): AbstractControl<unknown> {\n const control: AbstractControl<unknown> | null = this.group.get([this.field.name]);\n if (!control) throw new Error('Dynamic Forms did not create the registered rich-text control.');\n return control;\n }\n}\n","<section class=\"dynamic-richtext-field\" [formGroup]=\"group\" [attr.aria-label]=\"field.label ?? 'Document 3KLES'\">\n <h3>\n {{ field.label ?? 'Document 3KLES' }}\n @if (required) {\n <span aria-hidden=\"true\">*</span>\n }\n </h3>\n <kles-richtext-toolbar [editor]=\"editor\" [attr.lang]=\"toolbarLanguage\" />\n <kles-richtext-editor\n #editor\n [formControlName]=\"field.name\"\n [formValueFormat]=\"valueFormat\"\n [required]=\"required\"\n [readOnly]=\"readOnly()\"\n [invalid]=\"invalid()\"\n [label]=\"field.label ?? 'Document 3KLES'\"\n />\n @if (field.hint) {\n <p class=\"field-hint\">{{ field.hint }}</p>\n }\n</section>\n"],"mappings":";;;;;;;;AAoBA,SAAS,sBAAsB,OAAiC;CAC5D,MAAM,SAAkB,MAAM;CAC9B,MAAM,QAAQ,aAAa,UAAU,MAAM,MAAM,uBAAuB,UAAU;CAClF,OAAO,IAAI,YACP;EAAE;EAAO,UAAU,MAAM,aAAa;CAAI,GAC1C;EACI,aAAa,MAAM,eAAe,CAAA,EAAA,CAAI,KAAK,eAAe,WAAW,SAAS;EAC9E,kBAAkB,MAAM,oBAAoB,CAAA,EAAA,CAAI,KAAK,eAAe,WAAW,SAAS;EACxF,UAAU,MAAM,YAAY;CAC/B,CAAA;AAET;AAEA,SAAS,aAAa,QAAiB,QAA+B;CAClE,IAAI,WAAW,MAAM,OAAO;CAC5B,IAAI,WAAW,QAAQ;EACnB,IAAI,OAAO,WAAW,UAAU,OAAO;EACvC,MAAM,IAAI,UAAU,oDAAoD;CAC5E;CACA,MAAM,SAAS,sBAAsB,MAAM;CAC3C,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,UAAU,sEAAsE;CAC1G,OAAO,OAAO;AAClB;AAWO,IAAM,gCAAN,MAAM,8BAA6B;CAC7B,QAAoC,OAAO,KAAK;CAChD,QAAQ,OAAO,KAAK;CACpB,kBAAkB,OAAO,aAAa,CAAC,CAAC;CACxC,cAAc,KAAK,MAAM,uBAAuB;CACxC,UAAU,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CAC1D,UAAU,KAAK,aAAY;CACnB,gBAAgB,SAAS,KAAK,QAAQ,MAAM;CACpD,YA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A;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,eAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAuB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAwB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAKvE,gCAA6B,WAAA,CATzC,YAAY;CAAE,MAAM;CAAkB,SAAS;AAAqB,CAAE,CAS1D,GAAA,6BAA6B;AAA7B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA6B,YAAA,CAAA;EARzC,MAAA;EACa,MAAA,CAAA;GAAA,UAAA;GAAiC,YAC/B;GAAI,SACP;IAAC;IAAqB;IAAyB;GAAwB;GAAC,iBAGhE,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,2MAAA;EAAA,CAAA"}
@@ -0,0 +1,183 @@
1
+ import { c as toolbarPresentationLabel, l as RichTextAccessibilityIds } from "./3kles-kles-richtext-editor-toolbar-configuration-DsbPfSEO.mjs";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, computed, effect, inject, input, output, signal, viewChild } from "@angular/core";
4
+ var RichTextToolbarMenuComponent = class RichTextToolbarMenuComponent {
5
+ button = input.required(...ngDevMode ? [{ debugName: "button" }] : /* istanbul ignore next */ []);
6
+ groups = input.required(...ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []);
7
+ messages = input.required(...ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []);
8
+ tabStop = input.required(...ngDevMode ? [{ debugName: "tabStop" }] : /* istanbul ignore next */ []);
9
+ command = output();
10
+ panelId = inject(RichTextAccessibilityIds).next("menu");
11
+ search = signal("", ...ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []);
12
+ open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
13
+ panel = viewChild("panel", ...ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []);
14
+ results = computed(() => {
15
+ const messages = this.messages();
16
+ const search = this.search().trim().toLocaleLowerCase();
17
+ return this.groups().flatMap((group) => {
18
+ const label = toolbarPresentationLabel(group, messages, "");
19
+ const items = group.items.map((item) => ({
20
+ ...item,
21
+ label: toolbarPresentationLabel(item, messages, item.label)
22
+ })).filter((item) => [
23
+ label,
24
+ item.label,
25
+ ...item.searchTerms ?? []
26
+ ].some((term) => term.toLocaleLowerCase().includes(search)));
27
+ return items.length ? [{
28
+ id: group.id,
29
+ label,
30
+ items
31
+ }] : [];
32
+ });
33
+ }, ...ngDevMode ? [{ debugName: "results" }] : /* istanbul ignore next */ []);
34
+ constructor() {
35
+ effect(() => {
36
+ if (this.button().disabled && this.open()) this.panel()?.nativeElement.hidePopover();
37
+ });
38
+ }
39
+ syncPopover(panel) {
40
+ const open = panel.matches(":popover-open");
41
+ this.open.set(open);
42
+ if (!open) this.search.set("");
43
+ }
44
+ choose(item, panel) {
45
+ if (item.disabled || this.button().disabled || !panel.matches(":popover-open")) return;
46
+ this.command.emit(item.command);
47
+ panel.hidePopover();
48
+ }
49
+ navigate(event, panel) {
50
+ if (event.isComposing || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
51
+ const target = event.target;
52
+ const buttons = Array.from(panel.querySelectorAll("button[data-richtext-menu-command]:not(:disabled)"));
53
+ if (target instanceof HTMLInputElement && event.key === "Enter") {
54
+ event.preventDefault();
55
+ buttons[0]?.click();
56
+ } else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
57
+ const index = buttons.findIndex((button) => button === target);
58
+ const next = event.key === "ArrowDown" ? buttons[index + 1] : buttons[index - 1];
59
+ event.preventDefault();
60
+ if (next) next.focus();
61
+ else if (index === 0 && event.key === "ArrowUp") panel.querySelector("input")?.focus();
62
+ }
63
+ }
64
+ static ɵfac = i0.ɵɵngDeclareFactory({
65
+ minVersion: "12.0.0",
66
+ version: "22.2.6",
67
+ ngImport: i0,
68
+ type: RichTextToolbarMenuComponent,
69
+ deps: [],
70
+ target: i0.ɵɵFactoryTarget.Component
71
+ });
72
+ static ɵcmp = i0.ɵɵngDeclareComponent({
73
+ minVersion: "17.0.0",
74
+ version: "22.2.6",
75
+ type: RichTextToolbarMenuComponent,
76
+ isStandalone: true,
77
+ selector: "kles-richtext-toolbar-menu",
78
+ inputs: {
79
+ button: {
80
+ classPropertyName: "button",
81
+ publicName: "button",
82
+ isSignal: true,
83
+ isRequired: true,
84
+ transformFunction: null
85
+ },
86
+ groups: {
87
+ classPropertyName: "groups",
88
+ publicName: "groups",
89
+ isSignal: true,
90
+ isRequired: true,
91
+ transformFunction: null
92
+ },
93
+ messages: {
94
+ classPropertyName: "messages",
95
+ publicName: "messages",
96
+ isSignal: true,
97
+ isRequired: true,
98
+ transformFunction: null
99
+ },
100
+ tabStop: {
101
+ classPropertyName: "tabStop",
102
+ publicName: "tabStop",
103
+ isSignal: true,
104
+ isRequired: true,
105
+ transformFunction: null
106
+ }
107
+ },
108
+ outputs: { command: "command" },
109
+ viewQueries: [{
110
+ propertyName: "panel",
111
+ first: true,
112
+ predicate: ["panel"],
113
+ descendants: true,
114
+ isSignal: true
115
+ }],
116
+ ngImport: i0,
117
+ template: "<button\n type=\"button\"\n class=\"menu-trigger\"\n [class.with-icon]=\"!!button().icon\"\n [attr.data-richtext-action]=\"button().id\"\n [attr.aria-label]=\"button().ariaLabel\"\n [attr.title]=\"button().label ? null : button().ariaLabel\"\n [attr.popovertarget]=\"panelId\"\n aria-haspopup=\"dialog\"\n [disabled]=\"button().disabled\"\n [tabIndex]=\"tabStop()\"\n (mousedown)=\"$event.button === 0 && $event.preventDefault()\"\n>\n @if (button().iconType === 'material') {\n <span class=\"material-icon\" [attr.data-material-icon]=\"button().icon\" aria-hidden=\"true\"></span>\n } @else if (button().icon) {\n <span aria-hidden=\"true\">{{ button().icon }}</span>\n }\n {{ button().label }}\n</button>\n<div\n #panel\n class=\"menu-panel\"\n [id]=\"panelId\"\n role=\"dialog\"\n [attr.aria-label]=\"button().ariaLabel\"\n popover=\"auto\"\n (toggle)=\"syncPopover(panel)\"\n (keydown)=\"navigate($event, panel)\"\n (keydown.escape)=\"$event.preventDefault(); $event.stopPropagation(); panel.hidePopover()\"\n>\n <input\n #query\n type=\"search\"\n autofocus\n [value]=\"search()\"\n [attr.aria-label]=\"messages().menuSearch\"\n [placeholder]=\"messages().menuSearch\"\n (input)=\"search.set(query.value)\"\n />\n @if (open()) {\n <div class=\"menu-items\">\n @for (group of results(); track group.id) {\n <div [attr.role]=\"group.label ? 'group' : null\" [attr.aria-label]=\"group.label || null\">\n @if (group.label) {\n <p class=\"menu-heading\" aria-hidden=\"true\">{{ group.label }}</p>\n }\n @for (item of group.items; track item.id) {\n <button\n type=\"button\"\n [attr.data-richtext-menu-command]=\"item.id\"\n [disabled]=\"item.disabled\"\n (click)=\"choose(item, panel)\"\n >\n {{ item.label }}\n </button>\n }\n </div>\n } @empty {\n <p role=\"status\">{{ messages().menuNoResults }}</p>\n }\n </div>\n }\n</div>\n",
118
+ styles: [":host{display:contents}button,input{box-sizing:border-box;font:inherit;min-height:2.75rem;max-width:100%;padding:.5rem .7rem;border:1px solid var(--kles-richtext-toolbar-accent, var(--accent, #174f89));border-radius:var(--kles-richtext-toolbar-radius, .5rem);background:var(--kles-richtext-toolbar-background, var(--surface, #fff));color:var(--kles-richtext-toolbar-accent, var(--accent, #174f89))}button:enabled{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}:is(button,input):focus-visible{outline:3px solid var(--kles-richtext-toolbar-focus, var(--accent, #174f89));outline-offset:3px}.menu-trigger.with-icon{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;min-inline-size:2.75rem}.material-icon{font-family:var(--kles-richtext-toolbar-material-icon-font, \"Material Icons\");font-feature-settings:\"liga\";font-style:normal;font-weight:400;font-size:1.5rem;line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;direction:ltr}.material-icon:before{content:attr(data-material-icon)}.menu-panel{box-sizing:border-box;inline-size:min(20rem,100vw - 1.5rem);padding:.5rem;border:1px solid var(--kles-richtext-toolbar-accent, var(--accent, #174f89));border-radius:var(--kles-richtext-toolbar-radius, .5rem);background:var(--kles-richtext-toolbar-background, var(--surface, #fff));color:inherit}.menu-panel input{width:100%;color:inherit}@supports (position-area: block-end span-inline-end){.menu-panel{inset:auto;margin:.25rem 0;position-area:block-end span-inline-end;position-try-fallbacks:flip-inline,flip-block,flip-block flip-inline}}.menu-items{margin-block-start:.25rem;max-block-size:min(22rem,48dvh);overflow-y:auto}.menu-items button{display:block;inline-size:100%;text-align:start;border:0}.menu-items button:hover:enabled{text-decoration:underline}.menu-items button:focus-visible{outline-offset:-3px}.menu-heading{margin:.5rem .7rem .25rem;font-weight:600}\n"],
119
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
120
+ });
121
+ };
122
+ i0.ɵɵngDeclareClassMetadata({
123
+ minVersion: "12.0.0",
124
+ version: "22.2.6",
125
+ ngImport: i0,
126
+ type: RichTextToolbarMenuComponent,
127
+ decorators: [{
128
+ type: Component,
129
+ args: [{
130
+ selector: "kles-richtext-toolbar-menu",
131
+ standalone: true,
132
+ changeDetection: ChangeDetectionStrategy.OnPush,
133
+ template: "<button\n type=\"button\"\n class=\"menu-trigger\"\n [class.with-icon]=\"!!button().icon\"\n [attr.data-richtext-action]=\"button().id\"\n [attr.aria-label]=\"button().ariaLabel\"\n [attr.title]=\"button().label ? null : button().ariaLabel\"\n [attr.popovertarget]=\"panelId\"\n aria-haspopup=\"dialog\"\n [disabled]=\"button().disabled\"\n [tabIndex]=\"tabStop()\"\n (mousedown)=\"$event.button === 0 && $event.preventDefault()\"\n>\n @if (button().iconType === 'material') {\n <span class=\"material-icon\" [attr.data-material-icon]=\"button().icon\" aria-hidden=\"true\"></span>\n } @else if (button().icon) {\n <span aria-hidden=\"true\">{{ button().icon }}</span>\n }\n {{ button().label }}\n</button>\n<div\n #panel\n class=\"menu-panel\"\n [id]=\"panelId\"\n role=\"dialog\"\n [attr.aria-label]=\"button().ariaLabel\"\n popover=\"auto\"\n (toggle)=\"syncPopover(panel)\"\n (keydown)=\"navigate($event, panel)\"\n (keydown.escape)=\"$event.preventDefault(); $event.stopPropagation(); panel.hidePopover()\"\n>\n <input\n #query\n type=\"search\"\n autofocus\n [value]=\"search()\"\n [attr.aria-label]=\"messages().menuSearch\"\n [placeholder]=\"messages().menuSearch\"\n (input)=\"search.set(query.value)\"\n />\n @if (open()) {\n <div class=\"menu-items\">\n @for (group of results(); track group.id) {\n <div [attr.role]=\"group.label ? 'group' : null\" [attr.aria-label]=\"group.label || null\">\n @if (group.label) {\n <p class=\"menu-heading\" aria-hidden=\"true\">{{ group.label }}</p>\n }\n @for (item of group.items; track item.id) {\n <button\n type=\"button\"\n [attr.data-richtext-menu-command]=\"item.id\"\n [disabled]=\"item.disabled\"\n (click)=\"choose(item, panel)\"\n >\n {{ item.label }}\n </button>\n }\n </div>\n } @empty {\n <p role=\"status\">{{ messages().menuNoResults }}</p>\n }\n </div>\n }\n</div>\n",
134
+ styles: [":host{display:contents}button,input{box-sizing:border-box;font:inherit;min-height:2.75rem;max-width:100%;padding:.5rem .7rem;border:1px solid var(--kles-richtext-toolbar-accent, var(--accent, #174f89));border-radius:var(--kles-richtext-toolbar-radius, .5rem);background:var(--kles-richtext-toolbar-background, var(--surface, #fff));color:var(--kles-richtext-toolbar-accent, var(--accent, #174f89))}button:enabled{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}:is(button,input):focus-visible{outline:3px solid var(--kles-richtext-toolbar-focus, var(--accent, #174f89));outline-offset:3px}.menu-trigger.with-icon{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;min-inline-size:2.75rem}.material-icon{font-family:var(--kles-richtext-toolbar-material-icon-font, \"Material Icons\");font-feature-settings:\"liga\";font-style:normal;font-weight:400;font-size:1.5rem;line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;direction:ltr}.material-icon:before{content:attr(data-material-icon)}.menu-panel{box-sizing:border-box;inline-size:min(20rem,100vw - 1.5rem);padding:.5rem;border:1px solid var(--kles-richtext-toolbar-accent, var(--accent, #174f89));border-radius:var(--kles-richtext-toolbar-radius, .5rem);background:var(--kles-richtext-toolbar-background, var(--surface, #fff));color:inherit}.menu-panel input{width:100%;color:inherit}@supports (position-area: block-end span-inline-end){.menu-panel{inset:auto;margin:.25rem 0;position-area:block-end span-inline-end;position-try-fallbacks:flip-inline,flip-block,flip-block flip-inline}}.menu-items{margin-block-start:.25rem;max-block-size:min(22rem,48dvh);overflow-y:auto}.menu-items button{display:block;inline-size:100%;text-align:start;border:0}.menu-items button:hover:enabled{text-decoration:underline}.menu-items button:focus-visible{outline-offset:-3px}.menu-heading{margin:.5rem .7rem .25rem;font-weight:600}\n"]
135
+ }]
136
+ }],
137
+ ctorParameters: () => [],
138
+ propDecorators: {
139
+ button: [{
140
+ type: i0.Input,
141
+ args: [{
142
+ isSignal: true,
143
+ alias: "button",
144
+ required: true
145
+ }]
146
+ }],
147
+ groups: [{
148
+ type: i0.Input,
149
+ args: [{
150
+ isSignal: true,
151
+ alias: "groups",
152
+ required: true
153
+ }]
154
+ }],
155
+ messages: [{
156
+ type: i0.Input,
157
+ args: [{
158
+ isSignal: true,
159
+ alias: "messages",
160
+ required: true
161
+ }]
162
+ }],
163
+ tabStop: [{
164
+ type: i0.Input,
165
+ args: [{
166
+ isSignal: true,
167
+ alias: "tabStop",
168
+ required: true
169
+ }]
170
+ }],
171
+ command: [{
172
+ type: i0.Output,
173
+ args: ["command"]
174
+ }],
175
+ panel: [{
176
+ type: i0.ViewChild,
177
+ args: ["panel", { isSignal: true }]
178
+ }]
179
+ }
180
+ });
181
+ export { RichTextToolbarMenuComponent };
182
+
183
+ //# sourceMappingURL=3kles-kles-richtext-editor-richtext-toolbar-menu.component-Dq2K0CY3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3kles-kles-richtext-editor-richtext-toolbar-menu.component-Dq2K0CY3.mjs","names":[],"sources":["../../../projects/kles-richtext-editor/src/lib/toolbar/richtext-toolbar-menu.component.ts","../../../projects/kles-richtext-editor/src/lib/toolbar/richtext-toolbar-menu.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n input,\n output,\n signal,\n viewChild,\n inject,\n} from '@angular/core';\nimport type { ElementRef } from '@angular/core';\nimport type { EditorCommand } from '@3kles/richtext-dom';\nimport { RichTextAccessibilityIds } from '../editor/accessibility-ids.js';\nimport type { ResolvedRichTextMessages } from '../i18n/messages.js';\nimport { toolbarPresentationLabel } from './toolbar-configuration.js';\nimport type {\n RichTextToolbarButton,\n RichTextToolbarMenuCommand,\n RichTextToolbarMenuGroup,\n} from './toolbar-configuration.js';\n\n@Component({\n selector: 'kles-richtext-toolbar-menu',\n standalone: true,\n templateUrl: './richtext-toolbar-menu.component.html',\n styleUrl: './richtext-toolbar-menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RichTextToolbarMenuComponent {\n readonly button =\n input.required<Pick<RichTextToolbarButton, 'id' | 'label' | 'ariaLabel' | 'icon' | 'iconType' | 'disabled'>>();\n readonly groups = input.required<readonly RichTextToolbarMenuGroup[]>();\n readonly messages = input.required<ResolvedRichTextMessages>();\n readonly tabStop = input.required<number>();\n readonly command = output<EditorCommand>();\n protected readonly panelId = inject(RichTextAccessibilityIds).next('menu');\n protected readonly search = signal('');\n protected readonly open = signal(false);\n private readonly panel = viewChild<ElementRef<HTMLElement>>('panel');\n\n protected readonly results = computed(() => {\n const messages = this.messages();\n const search = this.search().trim().toLocaleLowerCase();\n return this.groups().flatMap((group) => {\n const label = toolbarPresentationLabel(group, messages, '');\n const items = group.items\n .map((item) => ({ ...item, label: toolbarPresentationLabel(item, messages, item.label) }))\n .filter((item) =>\n [label, item.label, ...(item.searchTerms ?? [])].some((term) =>\n term.toLocaleLowerCase().includes(search),\n ),\n );\n return items.length ? [{ id: group.id, label, items }] : [];\n });\n });\n\n constructor() {\n effect(() => {\n if (this.button().disabled && this.open()) this.panel()?.nativeElement.hidePopover();\n });\n }\n\n protected syncPopover(panel: HTMLElement): void {\n const open = panel.matches(':popover-open');\n this.open.set(open);\n if (!open) this.search.set('');\n }\n\n protected choose(item: RichTextToolbarMenuCommand, panel: HTMLElement): void {\n if (item.disabled || this.button().disabled || !panel.matches(':popover-open')) return;\n // Run the command while focus is in the toolbar so the editor uses its saved selection.\n this.command.emit(item.command);\n panel.hidePopover();\n }\n\n protected navigate(event: KeyboardEvent, panel: HTMLElement): void {\n if (event.isComposing || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const target = event.target;\n const buttons = Array.from(\n panel.querySelectorAll<HTMLButtonElement>('button[data-richtext-menu-command]:not(:disabled)'),\n );\n if (target instanceof HTMLInputElement && event.key === 'Enter') {\n event.preventDefault();\n buttons[0]?.click();\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n const index = buttons.findIndex((button) => button === target);\n const next = event.key === 'ArrowDown' ? buttons[index + 1] : buttons[index - 1];\n event.preventDefault();\n if (next) next.focus();\n else if (index === 0 && event.key === 'ArrowUp') panel.querySelector('input')?.focus();\n }\n }\n}\n","<button\n type=\"button\"\n class=\"menu-trigger\"\n [class.with-icon]=\"!!button().icon\"\n [attr.data-richtext-action]=\"button().id\"\n [attr.aria-label]=\"button().ariaLabel\"\n [attr.title]=\"button().label ? null : button().ariaLabel\"\n [attr.popovertarget]=\"panelId\"\n aria-haspopup=\"dialog\"\n [disabled]=\"button().disabled\"\n [tabIndex]=\"tabStop()\"\n (mousedown)=\"$event.button === 0 && $event.preventDefault()\"\n>\n @if (button().iconType === 'material') {\n <span class=\"material-icon\" [attr.data-material-icon]=\"button().icon\" aria-hidden=\"true\"></span>\n } @else if (button().icon) {\n <span aria-hidden=\"true\">{{ button().icon }}</span>\n }\n {{ button().label }}\n</button>\n<div\n #panel\n class=\"menu-panel\"\n [id]=\"panelId\"\n role=\"dialog\"\n [attr.aria-label]=\"button().ariaLabel\"\n popover=\"auto\"\n (toggle)=\"syncPopover(panel)\"\n (keydown)=\"navigate($event, panel)\"\n (keydown.escape)=\"$event.preventDefault(); $event.stopPropagation(); panel.hidePopover()\"\n>\n <input\n #query\n type=\"search\"\n autofocus\n [value]=\"search()\"\n [attr.aria-label]=\"messages().menuSearch\"\n [placeholder]=\"messages().menuSearch\"\n (input)=\"search.set(query.value)\"\n />\n @if (open()) {\n <div class=\"menu-items\">\n @for (group of results(); track group.id) {\n <div [attr.role]=\"group.label ? 'group' : null\" [attr.aria-label]=\"group.label || null\">\n @if (group.label) {\n <p class=\"menu-heading\" aria-hidden=\"true\">{{ group.label }}</p>\n }\n @for (item of group.items; track item.id) {\n <button\n type=\"button\"\n [attr.data-richtext-menu-command]=\"item.id\"\n [disabled]=\"item.disabled\"\n (click)=\"choose(item, panel)\"\n >\n {{ item.label }}\n </button>\n }\n </div>\n } @empty {\n <p role=\"status\">{{ messages().menuNoResults }}</p>\n }\n </div>\n }\n</div>\n"],"mappings":";;;AA6BA,IAAa,+BAAb,MAAa,6BAA4B;CAC5B,SACL,MAAM,SAAwG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACzG,SAAS,MAAM,SAA+C,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC9D,WAAW,MAAM,SAAoC,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CACrD,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,C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