ng-blatui 1.32.0 → 1.32.2
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/ng-blatui.mjs +11 -4
- package/fesm2022/ng-blatui.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/ng-blatui.mjs
CHANGED
|
@@ -19463,9 +19463,16 @@ class BuiRichTextEditor {
|
|
|
19463
19463
|
}
|
|
19464
19464
|
sync() {
|
|
19465
19465
|
const element = this.editor()?.nativeElement;
|
|
19466
|
-
if (element) {
|
|
19467
|
-
|
|
19466
|
+
if (!element) {
|
|
19467
|
+
return;
|
|
19468
|
+
}
|
|
19469
|
+
// Browsers leave residual markup (e.g. `<p><br></p>`) after the user clears
|
|
19470
|
+
// all text, which keeps `:empty` from matching so the placeholder never
|
|
19471
|
+
// reappears. Normalise truly-empty content so the placeholder can show again.
|
|
19472
|
+
if (element.textContent === '' && !element.querySelector('img, hr')) {
|
|
19473
|
+
element.innerHTML = '';
|
|
19468
19474
|
}
|
|
19475
|
+
this.value.set(element.innerHTML);
|
|
19469
19476
|
}
|
|
19470
19477
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRichTextEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19471
19478
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiRichTextEditor, isStandalone: true, selector: "bui-rich-text-editor", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, formattingLabel: { classPropertyName: "formattingLabel", publicName: "formattingLabel", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "data-slot": "rich-text-editor" }, properties: { "class": "computedClass()" } }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
@@ -19494,7 +19501,7 @@ class BuiRichTextEditor {
|
|
|
19494
19501
|
[attr.aria-label]="ariaLabel()"
|
|
19495
19502
|
[attr.data-placeholder]="placeholder()"
|
|
19496
19503
|
contenteditable="true"
|
|
19497
|
-
class="min-h-32 p-3 text-sm text-foreground text-muted-foreground/60
|
|
19504
|
+
class="min-h-32 p-3 text-sm text-foreground outline-none empty:before:text-muted-foreground/60 empty:before:content-[attr(data-placeholder)] [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-6 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-6"
|
|
19498
19505
|
(input)="sync()"
|
|
19499
19506
|
></div>
|
|
19500
19507
|
`, isInline: true });
|
|
@@ -19530,7 +19537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
19530
19537
|
[attr.aria-label]="ariaLabel()"
|
|
19531
19538
|
[attr.data-placeholder]="placeholder()"
|
|
19532
19539
|
contenteditable="true"
|
|
19533
|
-
class="min-h-32 p-3 text-sm text-foreground text-muted-foreground/60
|
|
19540
|
+
class="min-h-32 p-3 text-sm text-foreground outline-none empty:before:text-muted-foreground/60 empty:before:content-[attr(data-placeholder)] [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-6 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-6"
|
|
19534
19541
|
(input)="sync()"
|
|
19535
19542
|
></div>
|
|
19536
19543
|
`,
|