@3kles/kles-richtext-editor 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/3kles-kles-richtext-editor-material.mjs +273 -0
- package/fesm2022/3kles-kles-richtext-editor-material.mjs.map +1 -1
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-button.component-B0aePmqW.mjs.map +1 -1
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-fields.component-DZrj7frn.mjs +163 -0
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-fields.component-DZrj7frn.mjs.map +1 -0
- package/fesm2022/{3kles-kles-richtext-editor-richtext-toolbar-menu.component-DzUmL7Je.mjs → 3kles-kles-richtext-editor-richtext-toolbar-menu.component-DkaxVVT8.mjs} +35 -8
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-menu.component-DkaxVVT8.mjs.map +1 -0
- package/fesm2022/3kles-kles-richtext-editor.mjs +6 -3
- package/fesm2022/3kles-kles-richtext-editor.mjs.map +1 -1
- package/package.json +4 -4
- package/types/3kles-kles-richtext-editor-material.d.ts.map +1 -1
- package/types/3kles-kles-richtext-editor.d.ts +38 -1
- package/types/3kles-kles-richtext-editor.d.ts.map +1 -1
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-fields.component-DVVzGrUm.mjs +0 -106
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-fields.component-DVVzGrUm.mjs.map +0 -1
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-menu.component-DzUmL7Je.mjs.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { c as toolbarPresentationLabel, l as RichTextAccessibilityIds } from "./3kles-kles-richtext-editor-toolbar-configuration-DsbPfSEO.mjs";
|
|
2
|
-
import { t as RichTextToolbarButtonComponent } from "./3kles-kles-richtext-editor-richtext-toolbar-button.component-B0aePmqW.mjs";
|
|
2
|
+
import { n as RICHTEXT_TOOLBAR_APPEARANCE, t as RichTextToolbarButtonComponent } from "./3kles-kles-richtext-editor-richtext-toolbar-button.component-B0aePmqW.mjs";
|
|
3
|
+
import { NgComponentOutlet } from "@angular/common";
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
import { ChangeDetectionStrategy, Component, computed, effect, inject, input, output, signal, viewChild } from "@angular/core";
|
|
5
6
|
var RichTextToolbarMenuComponent = class RichTextToolbarMenuComponent {
|
|
@@ -11,6 +12,7 @@ var RichTextToolbarMenuComponent = class RichTextToolbarMenuComponent {
|
|
|
11
12
|
panelId = inject(RichTextAccessibilityIds).next("menu");
|
|
12
13
|
search = signal("", ...ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []);
|
|
13
14
|
open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
15
|
+
menuRenderer = inject(RICHTEXT_TOOLBAR_APPEARANCE).menu;
|
|
14
16
|
trigger = computed(() => ({
|
|
15
17
|
...this.button(),
|
|
16
18
|
actionId: this.button().id,
|
|
@@ -53,8 +55,20 @@ var RichTextToolbarMenuComponent = class RichTextToolbarMenuComponent {
|
|
|
53
55
|
this.command.emit(item.command);
|
|
54
56
|
panel.hidePopover();
|
|
55
57
|
}
|
|
58
|
+
menuControl(panel) {
|
|
59
|
+
return {
|
|
60
|
+
label: this.button().ariaLabel,
|
|
61
|
+
searchLabel: this.messages().menuSearch,
|
|
62
|
+
noResults: this.messages().menuNoResults,
|
|
63
|
+
open: this.open(),
|
|
64
|
+
query: this.search(),
|
|
65
|
+
groups: this.open() ? this.results() : [],
|
|
66
|
+
search: (query) => this.search.set(query),
|
|
67
|
+
choose: (item) => this.choose(item, panel)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
56
70
|
navigate(event, panel) {
|
|
57
|
-
if (event.isComposing || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
71
|
+
if (this.menuRenderer || event.isComposing || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
58
72
|
const target = event.target;
|
|
59
73
|
const buttons = Array.from(panel.querySelectorAll("button[data-richtext-menu-command]:not(:disabled)"));
|
|
60
74
|
if (target instanceof HTMLInputElement && event.key === "Enter") {
|
|
@@ -121,9 +135,22 @@ var RichTextToolbarMenuComponent = class RichTextToolbarMenuComponent {
|
|
|
121
135
|
isSignal: true
|
|
122
136
|
}],
|
|
123
137
|
ngImport: i0,
|
|
124
|
-
template: "<kles-richtext-toolbar-button [control]=\"trigger()\" />\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
|
|
125
|
-
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-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"],
|
|
138
|
+
template: "<kles-richtext-toolbar-button [control]=\"trigger()\" />\n<div\n #panel\n class=\"menu-panel\"\n [class.menu-panel-with-renderer]=\"menuRenderer\"\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 @if (menuRenderer; as renderer) {\n <ng-container *ngComponentOutlet=\"renderer; inputs: { control: menuControl(panel) }\" />\n } @else {\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 }\n</div>\n",
|
|
139
|
+
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-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-panel-with-renderer{inline-size:min(22rem,100vw - 1.5rem);padding:0;border:0;background:transparent;overflow:visible}.menu-heading{margin:.5rem .7rem .25rem;font-weight:600}\n"],
|
|
126
140
|
dependencies: [{
|
|
141
|
+
kind: "directive",
|
|
142
|
+
type: NgComponentOutlet,
|
|
143
|
+
selector: "[ngComponentOutlet]",
|
|
144
|
+
inputs: [
|
|
145
|
+
"ngComponentOutlet",
|
|
146
|
+
"ngComponentOutletInputs",
|
|
147
|
+
"ngComponentOutletInjector",
|
|
148
|
+
"ngComponentOutletEnvironmentInjector",
|
|
149
|
+
"ngComponentOutletContent",
|
|
150
|
+
"ngComponentOutletNgModule"
|
|
151
|
+
],
|
|
152
|
+
exportAs: ["ngComponentOutlet"]
|
|
153
|
+
}, {
|
|
127
154
|
kind: "component",
|
|
128
155
|
type: RichTextToolbarButtonComponent,
|
|
129
156
|
selector: "kles-richtext-toolbar-button",
|
|
@@ -142,10 +169,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
142
169
|
args: [{
|
|
143
170
|
selector: "kles-richtext-toolbar-menu",
|
|
144
171
|
standalone: true,
|
|
145
|
-
imports: [RichTextToolbarButtonComponent],
|
|
172
|
+
imports: [NgComponentOutlet, RichTextToolbarButtonComponent],
|
|
146
173
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
147
|
-
template: "<kles-richtext-toolbar-button [control]=\"trigger()\" />\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
|
|
148
|
-
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-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"]
|
|
174
|
+
template: "<kles-richtext-toolbar-button [control]=\"trigger()\" />\n<div\n #panel\n class=\"menu-panel\"\n [class.menu-panel-with-renderer]=\"menuRenderer\"\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 @if (menuRenderer; as renderer) {\n <ng-container *ngComponentOutlet=\"renderer; inputs: { control: menuControl(panel) }\" />\n } @else {\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 }\n</div>\n",
|
|
175
|
+
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-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-panel-with-renderer{inline-size:min(22rem,100vw - 1.5rem);padding:0;border:0;background:transparent;overflow:visible}.menu-heading{margin:.5rem .7rem .25rem;font-weight:600}\n"]
|
|
149
176
|
}]
|
|
150
177
|
}],
|
|
151
178
|
ctorParameters: () => [],
|
|
@@ -194,4 +221,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
194
221
|
});
|
|
195
222
|
export { RichTextToolbarMenuComponent };
|
|
196
223
|
|
|
197
|
-
//# sourceMappingURL=3kles-kles-richtext-editor-richtext-toolbar-menu.component-
|
|
224
|
+
//# sourceMappingURL=3kles-kles-richtext-editor-richtext-toolbar-menu.component-DkaxVVT8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3kles-kles-richtext-editor-richtext-toolbar-menu.component-DkaxVVT8.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 { NgComponentOutlet } from '@angular/common';\nimport {\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 { RichTextToolbarButtonComponent } from './richtext-toolbar-button.component.js';\nimport { RICHTEXT_TOOLBAR_APPEARANCE } from './toolbar-appearance.js';\nimport type { RichTextToolbarMenuControl } from './toolbar-appearance.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 imports: [NgComponentOutlet, RichTextToolbarButtonComponent],\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 protected readonly menuRenderer = inject(RICHTEXT_TOOLBAR_APPEARANCE).menu;\n protected readonly trigger = computed(() => ({\n ...this.button(),\n actionId: this.button().id,\n tabStop: this.tabStop(),\n popoverTarget: this.panelId,\n }));\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 menuControl(panel: HTMLElement): RichTextToolbarMenuControl {\n return {\n label: this.button().ariaLabel,\n searchLabel: this.messages().menuSearch,\n noResults: this.messages().menuNoResults,\n open: this.open(),\n query: this.search(),\n groups: this.open() ? this.results() : [],\n search: (query) => this.search.set(query),\n choose: (item) => this.choose(item, panel),\n };\n }\n\n protected navigate(event: KeyboardEvent, panel: HTMLElement): void {\n if (this.menuRenderer || event.isComposing || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)\n 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","<kles-richtext-toolbar-button [control]=\"trigger()\" />\n<div\n #panel\n class=\"menu-panel\"\n [class.menu-panel-with-renderer]=\"menuRenderer\"\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 @if (menuRenderer; as renderer) {\n <ng-container *ngComponentOutlet=\"renderer; inputs: { control: menuControl(panel) }\" />\n } @else {\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 }\n</div>\n"],"mappings":";;;;;AAkCA,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,CAAA;CAClC,UAAU,OAAM;CACN,UAAU,OAAO,wBAAwB,CAAC,CAAC,KAAK,MAAM;CACtD,SAAS,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACnB,OAAO,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,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A,CAAA;CAAA,gBAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1325,7 +1325,10 @@ var RichTextToolbarComponent = class RichTextToolbarComponent {
|
|
|
1325
1325
|
}
|
|
1326
1326
|
changeHeadingLevel(event) {
|
|
1327
1327
|
if (!(event.target instanceof HTMLSelectElement)) return;
|
|
1328
|
-
|
|
1328
|
+
this.setHeadingLevel(event.target.value);
|
|
1329
|
+
}
|
|
1330
|
+
setHeadingLevel(value) {
|
|
1331
|
+
const level = Number(value);
|
|
1329
1332
|
if (isToolbarHeadingLevel(level)) this.headingLevel.set(level);
|
|
1330
1333
|
}
|
|
1331
1334
|
changeStyle(markType, rawValue) {
|
|
@@ -1479,7 +1482,7 @@ var RichTextToolbarComponent = class RichTextToolbarComponent {
|
|
|
1479
1482
|
inputs: ["control"]
|
|
1480
1483
|
}],
|
|
1481
1484
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1482
|
-
deferBlockDependencies: [() => [import("./3kles-kles-richtext-editor-richtext-toolbar-menu.component-
|
|
1485
|
+
deferBlockDependencies: [() => [import("./3kles-kles-richtext-editor-richtext-toolbar-menu.component-DkaxVVT8.mjs").then((m) => m.RichTextToolbarMenuComponent)], () => [import("./3kles-kles-richtext-editor-richtext-toolbar-fields.component-DZrj7frn.mjs").then((m) => m.RichTextToolbarFieldsComponent)]]
|
|
1483
1486
|
});
|
|
1484
1487
|
};
|
|
1485
1488
|
i0.ɵɵngDeclareClassMetadataAsync({
|
|
@@ -1487,7 +1490,7 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
1487
1490
|
version: "22.2.6",
|
|
1488
1491
|
ngImport: i0,
|
|
1489
1492
|
type: RichTextToolbarComponent,
|
|
1490
|
-
resolveDeferredDeps: () => [import("./3kles-kles-richtext-editor-richtext-toolbar-menu.component-
|
|
1493
|
+
resolveDeferredDeps: () => [import("./3kles-kles-richtext-editor-richtext-toolbar-menu.component-DkaxVVT8.mjs").then((m) => m.RichTextToolbarMenuComponent), import("./3kles-kles-richtext-editor-richtext-toolbar-fields.component-DZrj7frn.mjs").then((m) => m.RichTextToolbarFieldsComponent)],
|
|
1491
1494
|
resolveMetadata: (RichTextToolbarMenuComponent, RichTextToolbarFieldsComponent) => ({
|
|
1492
1495
|
decorators: [{
|
|
1493
1496
|
type: Component,
|