@3kles/kles-richtext-editor 1.3.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 +523 -0
- package/fesm2022/3kles-kles-richtext-editor-material.mjs.map +1 -0
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-button.component-B0aePmqW.mjs +96 -0
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-button.component-B0aePmqW.mjs.map +1 -0
- 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-DkaxVVT8.mjs +224 -0
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-menu.component-DkaxVVT8.mjs.map +1 -0
- package/fesm2022/3kles-kles-richtext-editor.mjs +40 -22
- package/fesm2022/3kles-kles-richtext-editor.mjs.map +1 -1
- package/package.json +16 -4
- package/types/3kles-kles-richtext-editor-material.d.ts +5 -0
- package/types/3kles-kles-richtext-editor-material.d.ts.map +1 -0
- package/types/3kles-kles-richtext-editor.d.ts +82 -5
- package/types/3kles-kles-richtext-editor.d.ts.map +1 -1
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-menu.component-Dq2K0CY3.mjs +0 -183
- package/fesm2022/3kles-kles-richtext-editor-richtext-toolbar-menu.component-Dq2K0CY3.mjs.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { a as toolbarActionQueries, d as RICHTEXT_MESSAGES_FR, f as resolveRichTextMessages, i as sameToolbarActionQueries, l as RichTextAccessibilityIds, n as FULL_RICHTEXT_TOOLBAR_ITEMS, o as toolbarButtonContent, p as richTextLabel, r as resolveToolbarItems, s as toolbarItemLabel, t as DEFAULT_RICHTEXT_TOOLBAR_ITEMS, u as RICHTEXT_MESSAGES_EN } from "./3kles-kles-richtext-editor-toolbar-configuration-DsbPfSEO.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as RICHTEXT_TOOLBAR_APPEARANCE, r as provideRichTextToolbarAppearance, t as RichTextToolbarButtonComponent } from "./3kles-kles-richtext-editor-richtext-toolbar-button.component-B0aePmqW.mjs";
|
|
3
|
+
import { JsonPipe, isPlatformBrowser } from "@angular/common";
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, InjectionToken, PLATFORM_ID, ViewChild, booleanAttribute, computed, effect, forwardRef, inject, input, output, signal, untracked, viewChild } from "@angular/core";
|
|
5
6
|
import { NG_VALIDATORS, NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
@@ -1085,7 +1086,8 @@ var RichTextToolbarComponent = class RichTextToolbarComponent {
|
|
|
1085
1086
|
label,
|
|
1086
1087
|
disabled,
|
|
1087
1088
|
control: "color",
|
|
1088
|
-
|
|
1089
|
+
value,
|
|
1090
|
+
fallback: COLOR_DEFAULTS[item.id]
|
|
1089
1091
|
};
|
|
1090
1092
|
const options = STYLE_OPTIONS[item.id];
|
|
1091
1093
|
return {
|
|
@@ -1294,8 +1296,21 @@ var RichTextToolbarComponent = class RichTextToolbarComponent {
|
|
|
1294
1296
|
this.statusKey.set(key);
|
|
1295
1297
|
this.status.set(this.text()[key]);
|
|
1296
1298
|
}
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
+
actionControl(button) {
|
|
1300
|
+
const template = this.buttonTemplate();
|
|
1301
|
+
return {
|
|
1302
|
+
...button,
|
|
1303
|
+
actionId: button.id,
|
|
1304
|
+
tabStop: this.tabStop() === button.id ? 0 : -1,
|
|
1305
|
+
content: template ? {
|
|
1306
|
+
template,
|
|
1307
|
+
context: {
|
|
1308
|
+
$implicit: button,
|
|
1309
|
+
item: button
|
|
1310
|
+
}
|
|
1311
|
+
} : void 0,
|
|
1312
|
+
activate: () => this.execute(button)
|
|
1313
|
+
};
|
|
1299
1314
|
}
|
|
1300
1315
|
execute(button) {
|
|
1301
1316
|
if (button.disabled) return;
|
|
@@ -1310,7 +1325,10 @@ var RichTextToolbarComponent = class RichTextToolbarComponent {
|
|
|
1310
1325
|
}
|
|
1311
1326
|
changeHeadingLevel(event) {
|
|
1312
1327
|
if (!(event.target instanceof HTMLSelectElement)) return;
|
|
1313
|
-
|
|
1328
|
+
this.setHeadingLevel(event.target.value);
|
|
1329
|
+
}
|
|
1330
|
+
setHeadingLevel(value) {
|
|
1331
|
+
const level = Number(value);
|
|
1314
1332
|
if (isToolbarHeadingLevel(level)) this.headingLevel.set(level);
|
|
1315
1333
|
}
|
|
1316
1334
|
changeStyle(markType, rawValue) {
|
|
@@ -1455,20 +1473,16 @@ var RichTextToolbarComponent = class RichTextToolbarComponent {
|
|
|
1455
1473
|
isSignal: true
|
|
1456
1474
|
}],
|
|
1457
1475
|
ngImport: i0,
|
|
1458
|
-
template: "<div class=\"kles-richtext-toolbar\" (focusin)=\"rememberFocus($event)\">\n @if (hasItems()) {\n @if (buttons().length) {\n <div\n #commands\n class=\"kles-richtext-toolbar__commands\"\n role=\"toolbar\"\n [attr.aria-label]=\"label()\"\n [attr.aria-disabled]=\"blocked()\"\n [attr.aria-busy]=\"editor().composing()\"\n (keydown)=\"navigate($event)\"\n >\n @for (button of buttons(); track button.id) {\n @if (button.kind === 'menu') {\n @defer (on immediate) {\n <kles-richtext-toolbar-menu\n [button]=\"button\"\n [groups]=\"button.menu.groups\"\n [tabStop]=\"tabStop() === button.id ? 0 : -1\"\n [messages]=\"text()\"\n (command)=\"executeMenuCommand($event)\"\n />\n }\n } @else {\n <button\n type=\"button\"\n [attr.data-richtext-action]=\"button.id\"\n [class.kles-richtext-toolbar__button-with-icon]=\"!buttonTemplate() && !!button.icon\"\n [disabled]=\"button.disabled\"\n [attr.aria-label]=\"button.ariaLabel\"\n [attr.title]=\"button.label ? null : button.ariaLabel\"\n [attr.aria-pressed]=\"button.pressed ?? null\"\n [tabIndex]=\"tabStop() === button.id ? 0 : -1\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute(button)\"\n >\n @if (buttonTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: button, item: button }\"\n />\n } @else {\n @if (button.iconType === 'material') {\n <span\n class=\"kles-richtext-toolbar__material-icon\"\n [attr.data-material-icon]=\"button.icon\"\n aria-hidden=\"true\"\n ></span>\n } @else if (button.icon) {\n <span aria-hidden=\"true\">{{ button.icon }}</span>\n }\n {{ button.label }}\n }\n </button>\n }\n }\n </div>\n }\n @if (fields().length) {\n <div class=\"kles-richtext-toolbar__fields\" role=\"group\" [attr.aria-label]=\"fieldsLabel()\">\n @for (field of fields(); track field.id) {\n @if (field.id === 'headingLevel') {\n <label class=\"kles-richtext-toolbar__level\" data-richtext-field=\"headingLevel\">\n {{ field.label }}\n <select\n [attr.aria-label]=\"field.ariaLabel?.trim() || text().headingLevelLabel\"\n [disabled]=\"headingDisabled()\"\n (change)=\"changeHeadingLevel($event)\"\n >\n @for (level of headingLevels; track level) {\n <option [value]=\"level\" [selected]=\"level === headingLevel()\">{{ level }}</option>\n }\n </select>\n </label>\n } @else if (field.id === 'link') {\n <label class=\"kles-richtext-toolbar__link\" data-richtext-field=\"link\">\n {{ field.label }}\n <input\n #linkInput\n type=\"text\"\n inputmode=\"url\"\n [disabled]=\"linksDisabled()\"\n [value]=\"linkHref()\"\n [attr.aria-label]=\"field.ariaLabel?.trim() || field.label\"\n [attr.aria-invalid]=\"linkInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"linkInvalid() ? linkErrorId : null\"\n (input)=\"changeLink(linkInput.value)\"\n (keydown.enter)=\"applyLink($event)\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n </label>\n <button\n type=\"button\"\n data-richtext-field=\"link\"\n [class.kles-richtext-toolbar__button-with-icon]=\"iconOnly()\"\n [disabled]=\"applyLinkDisabled()\"\n [attr.aria-label]=\"iconOnly() ? text().applyLink : null\"\n [attr.title]=\"iconOnly() ? text().applyLink : null\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"applyLink()\"\n >\n @if (iconOnly()) {\n <span\n class=\"kles-richtext-toolbar__material-icon\"\n data-material-icon=\"link\"\n aria-hidden=\"true\"\n ></span>\n } @else {\n {{ text().applyLink }}\n }\n </button>\n <button\n type=\"button\"\n data-richtext-field=\"link\"\n [class.kles-richtext-toolbar__button-with-icon]=\"iconOnly()\"\n [disabled]=\"removeLinkDisabled()\"\n [attr.aria-label]=\"iconOnly() ? text().removeLink : null\"\n [attr.title]=\"iconOnly() ? text().removeLink : null\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"removeLink()\"\n >\n @if (iconOnly()) {\n <span\n class=\"kles-richtext-toolbar__material-icon\"\n data-material-icon=\"link_off\"\n aria-hidden=\"true\"\n ></span>\n } @else {\n {{ text().removeLink }}\n }\n </button>\n } @else if (field.control === 'color') {\n <div class=\"kles-richtext-toolbar__color\">\n <label class=\"kles-richtext-toolbar__level\" [attr.data-richtext-field]=\"field.id\">\n {{ field.label }}\n <input\n #colorInput\n type=\"color\"\n [value]=\"field.colorValue\"\n [disabled]=\"field.disabled\"\n [attr.aria-label]=\"field.ariaLabel?.trim() || field.label\"\n (change)=\"changeStyle(field.id, colorInput.value)\"\n />\n </label>\n <button\n type=\"button\"\n [disabled]=\"field.disabled\"\n [attr.aria-label]=\"\n field.id === 'color' ? text().resetColor : text().resetBackgroundColor\n \"\n [attr.title]=\"field.id === 'color' ? text().resetColor : text().resetBackgroundColor\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"changeStyle(field.id, '')\"\n >\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n } @else if (field.control === 'select') {\n <label class=\"kles-richtext-toolbar__level\" [attr.data-richtext-field]=\"field.id\">\n {{ field.label }}\n <select\n #styleSelect\n [disabled]=\"field.disabled\"\n [attr.aria-label]=\"field.ariaLabel?.trim() || field.label\"\n (change)=\"changeStyle(field.id, styleSelect.value)\"\n >\n @if (field.value === null) {\n <option disabled selected>{{ text().mixedStyles }}</option>\n }\n <option value=\"\" [selected]=\"field.value === undefined\">\n {{ text().defaultStyle }}\n </option>\n @for (value of field.options; track value) {\n <option [value]=\"value\" [selected]=\"field.value === value\">{{ value }}</option>\n }\n </select>\n </label>\n }\n }\n </div>\n }\n @if (linkInvalid()) {\n <p [id]=\"linkErrorId\" class=\"kles-richtext-toolbar__error\">{{ text().invalidLink }}</p>\n }\n <p class=\"kles-richtext-toolbar__status\" role=\"status\" aria-live=\"polite\">{{ status() }}</p>\n }\n</div>\n",
|
|
1459
|
-
styles: [":host{display:block;min-width:0;max-width:100%}.kles-richtext-toolbar{margin-block-end:1rem;color:inherit}.kles-richtext-toolbar__commands,.kles-richtext-
|
|
1476
|
+
template: "<div class=\"kles-richtext-toolbar\" (focusin)=\"rememberFocus($event)\">\n @if (hasItems()) {\n @if (buttons().length) {\n <div\n #commands\n class=\"kles-richtext-toolbar__commands\"\n role=\"toolbar\"\n [attr.aria-label]=\"label()\"\n [attr.aria-disabled]=\"blocked()\"\n [attr.aria-busy]=\"editor().composing()\"\n (keydown)=\"navigate($event)\"\n >\n @for (button of buttons(); track button.id) {\n @if (button.kind === 'menu') {\n @defer (on immediate) {\n <kles-richtext-toolbar-menu\n [button]=\"button\"\n [groups]=\"button.menu.groups\"\n [tabStop]=\"tabStop() === button.id ? 0 : -1\"\n [messages]=\"text()\"\n (command)=\"executeMenuCommand($event)\"\n />\n }\n } @else {\n <kles-richtext-toolbar-button [control]=\"actionControl(button)\" />\n }\n }\n </div>\n }\n @if (fields().length) {\n @defer (on immediate) {\n <kles-richtext-toolbar-fields [toolbar]=\"this\" />\n }\n }\n @if (linkInvalid()) {\n <p [id]=\"linkErrorId\" class=\"kles-richtext-toolbar__error\">{{ text().invalidLink }}</p>\n }\n <p class=\"kles-richtext-toolbar__status\" role=\"status\" aria-live=\"polite\">{{ status() }}</p>\n }\n</div>\n",
|
|
1477
|
+
styles: [":host{display:block;min-width:0;max-width:100%}.kles-richtext-toolbar{margin-block-end:1rem;color:inherit}.kles-richtext-toolbar__commands,.kles-richtext-toolbar__status{margin:.5rem 0 0;font-size:.9rem;line-height:1.5}.kles-richtext-toolbar__status:empty{margin:0}.kles-richtext-toolbar__error{color:var(--kles-richtext-toolbar-error, var(--error, #9e2020));margin:.5rem 0 0;line-height:1.5}\n"],
|
|
1460
1478
|
dependencies: [{
|
|
1461
|
-
kind: "
|
|
1462
|
-
type:
|
|
1463
|
-
selector: "
|
|
1464
|
-
inputs: [
|
|
1465
|
-
"ngTemplateOutletContext",
|
|
1466
|
-
"ngTemplateOutlet",
|
|
1467
|
-
"ngTemplateOutletInjector"
|
|
1468
|
-
]
|
|
1479
|
+
kind: "component",
|
|
1480
|
+
type: RichTextToolbarButtonComponent,
|
|
1481
|
+
selector: "kles-richtext-toolbar-button",
|
|
1482
|
+
inputs: ["control"]
|
|
1469
1483
|
}],
|
|
1470
1484
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1471
|
-
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)]]
|
|
1472
1486
|
});
|
|
1473
1487
|
};
|
|
1474
1488
|
i0.ɵɵngDeclareClassMetadataAsync({
|
|
@@ -1476,17 +1490,21 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
1476
1490
|
version: "22.2.6",
|
|
1477
1491
|
ngImport: i0,
|
|
1478
1492
|
type: RichTextToolbarComponent,
|
|
1479
|
-
resolveDeferredDeps: () => [import("./3kles-kles-richtext-editor-richtext-toolbar-menu.component-
|
|
1480
|
-
resolveMetadata: (RichTextToolbarMenuComponent) => ({
|
|
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)],
|
|
1494
|
+
resolveMetadata: (RichTextToolbarMenuComponent, RichTextToolbarFieldsComponent) => ({
|
|
1481
1495
|
decorators: [{
|
|
1482
1496
|
type: Component,
|
|
1483
1497
|
args: [{
|
|
1484
1498
|
selector: "kles-richtext-toolbar",
|
|
1485
1499
|
standalone: true,
|
|
1486
|
-
imports: [
|
|
1500
|
+
imports: [
|
|
1501
|
+
RichTextToolbarButtonComponent,
|
|
1502
|
+
RichTextToolbarFieldsComponent,
|
|
1503
|
+
RichTextToolbarMenuComponent
|
|
1504
|
+
],
|
|
1487
1505
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1488
|
-
template: "<div class=\"kles-richtext-toolbar\" (focusin)=\"rememberFocus($event)\">\n @if (hasItems()) {\n @if (buttons().length) {\n <div\n #commands\n class=\"kles-richtext-toolbar__commands\"\n role=\"toolbar\"\n [attr.aria-label]=\"label()\"\n [attr.aria-disabled]=\"blocked()\"\n [attr.aria-busy]=\"editor().composing()\"\n (keydown)=\"navigate($event)\"\n >\n @for (button of buttons(); track button.id) {\n @if (button.kind === 'menu') {\n @defer (on immediate) {\n <kles-richtext-toolbar-menu\n [button]=\"button\"\n [groups]=\"button.menu.groups\"\n [tabStop]=\"tabStop() === button.id ? 0 : -1\"\n [messages]=\"text()\"\n (command)=\"executeMenuCommand($event)\"\n />\n }\n } @else {\n <button\n type=\"button\"\n [attr.data-richtext-action]=\"button.id\"\n [class.kles-richtext-toolbar__button-with-icon]=\"!buttonTemplate() && !!button.icon\"\n [disabled]=\"button.disabled\"\n [attr.aria-label]=\"button.ariaLabel\"\n [attr.title]=\"button.label ? null : button.ariaLabel\"\n [attr.aria-pressed]=\"button.pressed ?? null\"\n [tabIndex]=\"tabStop() === button.id ? 0 : -1\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"execute(button)\"\n >\n @if (buttonTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: button, item: button }\"\n />\n } @else {\n @if (button.iconType === 'material') {\n <span\n class=\"kles-richtext-toolbar__material-icon\"\n [attr.data-material-icon]=\"button.icon\"\n aria-hidden=\"true\"\n ></span>\n } @else if (button.icon) {\n <span aria-hidden=\"true\">{{ button.icon }}</span>\n }\n {{ button.label }}\n }\n </button>\n }\n }\n </div>\n }\n @if (fields().length) {\n <div class=\"kles-richtext-toolbar__fields\" role=\"group\" [attr.aria-label]=\"fieldsLabel()\">\n @for (field of fields(); track field.id) {\n @if (field.id === 'headingLevel') {\n <label class=\"kles-richtext-toolbar__level\" data-richtext-field=\"headingLevel\">\n {{ field.label }}\n <select\n [attr.aria-label]=\"field.ariaLabel?.trim() || text().headingLevelLabel\"\n [disabled]=\"headingDisabled()\"\n (change)=\"changeHeadingLevel($event)\"\n >\n @for (level of headingLevels; track level) {\n <option [value]=\"level\" [selected]=\"level === headingLevel()\">{{ level }}</option>\n }\n </select>\n </label>\n } @else if (field.id === 'link') {\n <label class=\"kles-richtext-toolbar__link\" data-richtext-field=\"link\">\n {{ field.label }}\n <input\n #linkInput\n type=\"text\"\n inputmode=\"url\"\n [disabled]=\"linksDisabled()\"\n [value]=\"linkHref()\"\n [attr.aria-label]=\"field.ariaLabel?.trim() || field.label\"\n [attr.aria-invalid]=\"linkInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"linkInvalid() ? linkErrorId : null\"\n (input)=\"changeLink(linkInput.value)\"\n (keydown.enter)=\"applyLink($event)\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n </label>\n <button\n type=\"button\"\n data-richtext-field=\"link\"\n [class.kles-richtext-toolbar__button-with-icon]=\"iconOnly()\"\n [disabled]=\"applyLinkDisabled()\"\n [attr.aria-label]=\"iconOnly() ? text().applyLink : null\"\n [attr.title]=\"iconOnly() ? text().applyLink : null\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"applyLink()\"\n >\n @if (iconOnly()) {\n <span\n class=\"kles-richtext-toolbar__material-icon\"\n data-material-icon=\"link\"\n aria-hidden=\"true\"\n ></span>\n } @else {\n {{ text().applyLink }}\n }\n </button>\n <button\n type=\"button\"\n data-richtext-field=\"link\"\n [class.kles-richtext-toolbar__button-with-icon]=\"iconOnly()\"\n [disabled]=\"removeLinkDisabled()\"\n [attr.aria-label]=\"iconOnly() ? text().removeLink : null\"\n [attr.title]=\"iconOnly() ? text().removeLink : null\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"removeLink()\"\n >\n @if (iconOnly()) {\n <span\n class=\"kles-richtext-toolbar__material-icon\"\n data-material-icon=\"link_off\"\n aria-hidden=\"true\"\n ></span>\n } @else {\n {{ text().removeLink }}\n }\n </button>\n } @else if (field.control === 'color') {\n <div class=\"kles-richtext-toolbar__color\">\n <label class=\"kles-richtext-toolbar__level\" [attr.data-richtext-field]=\"field.id\">\n {{ field.label }}\n <input\n #colorInput\n type=\"color\"\n [value]=\"field.colorValue\"\n [disabled]=\"field.disabled\"\n [attr.aria-label]=\"field.ariaLabel?.trim() || field.label\"\n (change)=\"changeStyle(field.id, colorInput.value)\"\n />\n </label>\n <button\n type=\"button\"\n [disabled]=\"field.disabled\"\n [attr.aria-label]=\"\n field.id === 'color' ? text().resetColor : text().resetBackgroundColor\n \"\n [attr.title]=\"field.id === 'color' ? text().resetColor : text().resetBackgroundColor\"\n (mousedown)=\"preserveSelection($event)\"\n (click)=\"changeStyle(field.id, '')\"\n >\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n } @else if (field.control === 'select') {\n <label class=\"kles-richtext-toolbar__level\" [attr.data-richtext-field]=\"field.id\">\n {{ field.label }}\n <select\n #styleSelect\n [disabled]=\"field.disabled\"\n [attr.aria-label]=\"field.ariaLabel?.trim() || field.label\"\n (change)=\"changeStyle(field.id, styleSelect.value)\"\n >\n @if (field.value === null) {\n <option disabled selected>{{ text().mixedStyles }}</option>\n }\n <option value=\"\" [selected]=\"field.value === undefined\">\n {{ text().defaultStyle }}\n </option>\n @for (value of field.options; track value) {\n <option [value]=\"value\" [selected]=\"field.value === value\">{{ value }}</option>\n }\n </select>\n </label>\n }\n }\n </div>\n }\n @if (linkInvalid()) {\n <p [id]=\"linkErrorId\" class=\"kles-richtext-toolbar__error\">{{ text().invalidLink }}</p>\n }\n <p class=\"kles-richtext-toolbar__status\" role=\"status\" aria-live=\"polite\">{{ status() }}</p>\n }\n</div>\n",
|
|
1489
|
-
styles: [":host{display:block;min-width:0;max-width:100%}.kles-richtext-toolbar{margin-block-end:1rem;color:inherit}.kles-richtext-toolbar__commands,.kles-richtext-
|
|
1506
|
+
template: "<div class=\"kles-richtext-toolbar\" (focusin)=\"rememberFocus($event)\">\n @if (hasItems()) {\n @if (buttons().length) {\n <div\n #commands\n class=\"kles-richtext-toolbar__commands\"\n role=\"toolbar\"\n [attr.aria-label]=\"label()\"\n [attr.aria-disabled]=\"blocked()\"\n [attr.aria-busy]=\"editor().composing()\"\n (keydown)=\"navigate($event)\"\n >\n @for (button of buttons(); track button.id) {\n @if (button.kind === 'menu') {\n @defer (on immediate) {\n <kles-richtext-toolbar-menu\n [button]=\"button\"\n [groups]=\"button.menu.groups\"\n [tabStop]=\"tabStop() === button.id ? 0 : -1\"\n [messages]=\"text()\"\n (command)=\"executeMenuCommand($event)\"\n />\n }\n } @else {\n <kles-richtext-toolbar-button [control]=\"actionControl(button)\" />\n }\n }\n </div>\n }\n @if (fields().length) {\n @defer (on immediate) {\n <kles-richtext-toolbar-fields [toolbar]=\"this\" />\n }\n }\n @if (linkInvalid()) {\n <p [id]=\"linkErrorId\" class=\"kles-richtext-toolbar__error\">{{ text().invalidLink }}</p>\n }\n <p class=\"kles-richtext-toolbar__status\" role=\"status\" aria-live=\"polite\">{{ status() }}</p>\n }\n</div>\n",
|
|
1507
|
+
styles: [":host{display:block;min-width:0;max-width:100%}.kles-richtext-toolbar{margin-block-end:1rem;color:inherit}.kles-richtext-toolbar__commands,.kles-richtext-toolbar__status{margin:.5rem 0 0;font-size:.9rem;line-height:1.5}.kles-richtext-toolbar__status:empty{margin:0}.kles-richtext-toolbar__error{color:var(--kles-richtext-toolbar-error, var(--error, #9e2020));margin:.5rem 0 0;line-height:1.5}\n"]
|
|
1490
1508
|
}]
|
|
1491
1509
|
}],
|
|
1492
1510
|
ctorParameters: () => [],
|
|
@@ -1562,6 +1580,6 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
1562
1580
|
}
|
|
1563
1581
|
})
|
|
1564
1582
|
});
|
|
1565
|
-
export { DEFAULT_RICHTEXT_TOOLBAR_ITEMS, FULL_RICHTEXT_TOOLBAR_ITEMS, RICHTEXT_EDITOR_EXTENSIONS, RICHTEXT_I18N, RICHTEXT_MESSAGES_EN, RICHTEXT_MESSAGES_FR, RICHTEXT_TOOLBAR_CONFIG, RichTextDocumentPreviewComponent, RichTextEditorComponent, RichTextToolbarComponent, provideRichTextI18n, provideRichTextToolbar, richTextDocumentValidator, richTextHtmlRequiredValidator, richTextRequiredValidator, validateRichTextValue };
|
|
1583
|
+
export { DEFAULT_RICHTEXT_TOOLBAR_ITEMS, FULL_RICHTEXT_TOOLBAR_ITEMS, RICHTEXT_EDITOR_EXTENSIONS, RICHTEXT_I18N, RICHTEXT_MESSAGES_EN, RICHTEXT_MESSAGES_FR, RICHTEXT_TOOLBAR_APPEARANCE, RICHTEXT_TOOLBAR_CONFIG, RichTextDocumentPreviewComponent, RichTextEditorComponent, RichTextToolbarComponent, provideRichTextI18n, provideRichTextToolbar, provideRichTextToolbarAppearance, richTextDocumentValidator, richTextHtmlRequiredValidator, richTextRequiredValidator, validateRichTextValue };
|
|
1566
1584
|
|
|
1567
1585
|
//# sourceMappingURL=3kles-kles-richtext-editor.mjs.map
|