@ngstarter-ui/components 22.1.4 → 22.2.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/ai/component-registry.json +140 -9
- package/fesm2022/ngstarter-ui-components-color-picker.mjs +147 -272
- package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-B2GUlWO2.mjs +54 -0
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-B2GUlWO2.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs +47 -0
- package/fesm2022/ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Cnga7Z-6.mjs +27 -0
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Cnga7Z-6.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BbK5fCoE.mjs → ngstarter-ui-components-content-editor-code-block.component-DSdVOJtH.mjs} +49 -15
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-DSdVOJtH.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-divider-block.component-B5wyMHjr.mjs → ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs} +5 -3
- package/fesm2022/{ngstarter-ui-components-content-editor-divider-block.component-B5wyMHjr.mjs.map → ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-DGqupBLe.mjs → ngstarter-ui-components-content-editor-embed-block-DhFxtMQS.mjs} +16 -4
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DhFxtMQS.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-cEy-dCMa.mjs +103 -0
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-cEy-dCMa.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-DFLGRFiO.mjs +66 -0
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-DFLGRFiO.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-D1s2yalT.mjs → ngstarter-ui-components-content-editor-heading-block.component-BYpctSPe.mjs} +23 -14
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-BYpctSPe.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-D75DrPNq.mjs → ngstarter-ui-components-content-editor-image-block.component-B3MnANpi.mjs} +20 -7
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-B3MnANpi.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-B7pDlrQ_.mjs → ngstarter-ui-components-content-editor-list-block.component-6SMBxIl4.mjs} +28 -17
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-6SMBxIl4.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DSY7xfzf.mjs +117 -0
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DSY7xfzf.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs +3310 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-CVV2f-ON.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs} +25 -14
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CVb-bkJw.mjs → ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs} +29 -16
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DSpLBC4V.mjs → ngstarter-ui-components-content-editor-table-block.component-CJS-IBHw.mjs} +28 -13
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-CJS-IBHw.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-B01lhY_V.mjs +21 -0
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-B01lhY_V.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-D9ELpJr-.mjs +29 -0
- package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-D9ELpJr-.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-D3U8uXIy.mjs → ngstarter-ui-components-content-editor-video-block.component-DQUPVDwV.mjs} +19 -5
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-DQUPVDwV.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +90 -12
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +9 -5
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-upload.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngstarter-ui-components-color-picker.d.ts +2 -2
- package/types/ngstarter-ui-components-content-editor.d.ts +303 -83
- package/types/ngstarter-ui-components-headless-editor.d.ts +17 -2
- package/types/ngstarter-ui-components-menu.d.ts +3 -1
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbK5fCoE.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs +0 -127
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGqupBLe.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-D1s2yalT.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-D75DrPNq.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-B7pDlrQ_.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs +0 -3102
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CVV2f-ON.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-CVb-bkJw.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-DSpLBC4V.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-D3U8uXIy.mjs.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { C as ContentBuilderStore, a as CONTENT_BUILDER, c as cloneContentEditorValue, b as contentEditorText, d as ContentEditorContentEditableDirective, e as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DestroyRef, viewChild, input, signal, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { C as ContentEditorContentEditableDirective } from './ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs';
|
|
4
|
-
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs';
|
|
3
|
+
import { inject, DestroyRef, viewChild, input, signal, effect, untracked, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
5
|
import { C as CursorController } from './ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs';
|
|
7
6
|
|
|
@@ -23,7 +22,7 @@ class ParagraphBlockComponent {
|
|
|
23
22
|
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
24
23
|
placeholder = input('Enter text here', /* @ts-ignore */
|
|
25
24
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
26
|
-
_content = signal(
|
|
25
|
+
_content = signal([], /* @ts-ignore */
|
|
27
26
|
...(ngDevMode ? [{ debugName: "_content" }] : /* istanbul ignore next */ []));
|
|
28
27
|
_props = signal([], /* @ts-ignore */
|
|
29
28
|
...(ngDevMode ? [{ debugName: "_props" }] : /* istanbul ignore next */ []));
|
|
@@ -31,10 +30,21 @@ class ParagraphBlockComponent {
|
|
|
31
30
|
...(ngDevMode ? [{ debugName: "_isEmpty" }] : /* istanbul ignore next */ []));
|
|
32
31
|
initialized = signal(false, /* @ts-ignore */
|
|
33
32
|
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
33
|
+
constructor() {
|
|
34
|
+
effect(() => {
|
|
35
|
+
const content = this.content();
|
|
36
|
+
const props = this.props();
|
|
37
|
+
untracked(() => {
|
|
38
|
+
this._content.set(content);
|
|
39
|
+
this._props.set(cloneContentEditorValue(props));
|
|
40
|
+
this._isEmpty.set(!contentEditorText(content).trim());
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
34
44
|
ngOnInit() {
|
|
35
45
|
this._content.set(this.content());
|
|
36
46
|
this._props.set(this.props());
|
|
37
|
-
this._isEmpty.set(this.content().
|
|
47
|
+
this._isEmpty.set(!contentEditorText(this.content()).trim());
|
|
38
48
|
this._contentBuilder
|
|
39
49
|
.focusChanged
|
|
40
50
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
@@ -59,18 +69,19 @@ class ParagraphBlockComponent {
|
|
|
59
69
|
};
|
|
60
70
|
}
|
|
61
71
|
isEmpty() {
|
|
62
|
-
return this.
|
|
72
|
+
return !contentEditorText(this._content()).trim();
|
|
63
73
|
}
|
|
64
74
|
onContentChanged(content) {
|
|
65
75
|
if (!this.initialized()) {
|
|
66
76
|
return;
|
|
67
77
|
}
|
|
68
78
|
this._content.set(content);
|
|
69
|
-
this._isEmpty.set(content.trim()
|
|
79
|
+
this._isEmpty.set(!contentEditorText(content).trim());
|
|
70
80
|
this.update();
|
|
71
81
|
}
|
|
72
82
|
onPropsChanged(props) {
|
|
73
|
-
this.
|
|
83
|
+
this._props.set(props);
|
|
84
|
+
this.update();
|
|
74
85
|
}
|
|
75
86
|
onPressedEnter(event) {
|
|
76
87
|
event.preventDefault();
|
|
@@ -84,12 +95,12 @@ class ParagraphBlockComponent {
|
|
|
84
95
|
this.initialized.set(true);
|
|
85
96
|
}
|
|
86
97
|
_onKeyDown(event) {
|
|
87
|
-
if (event.key === 'Backspace' && !this._content()) {
|
|
98
|
+
if (event.key === 'Backspace' && !contentEditorText(this._content())) {
|
|
88
99
|
this._contentBuilder.deleteBlock(this.id());
|
|
89
100
|
}
|
|
90
101
|
}
|
|
91
102
|
update() {
|
|
92
|
-
this.
|
|
103
|
+
this._contentBuilder.updateParagraph(this.id(), { ...this.getData(), isEmpty: this.isEmpty() });
|
|
93
104
|
this._contentBuilder.emitContentChangeEvent();
|
|
94
105
|
}
|
|
95
106
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ParagraphBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -99,7 +110,7 @@ class ParagraphBlockComponent {
|
|
|
99
110
|
useExisting: forwardRef(() => ParagraphBlockComponent),
|
|
100
111
|
multi: true
|
|
101
112
|
}
|
|
102
|
-
], viewQueries: [{ propertyName: "_contentRef", first: true, predicate: ["contentRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<
|
|
113
|
+
], viewQueries: [{ propertyName: "_contentRef", first: true, predicate: ["contentRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #contentRef\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"_content()\"\n [settings]=\"settings()\"\n [props]=\"props()\"\n (propsChanged)=\"onPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (keydown)=\"_onKeyDown($event)\"\n (initialized)=\"onContentEditableInitialized()\"></div>\n", styles: [":host{display:block;position:relative}:host p{line-height:var(--leading-normal)}:host .content{outline:none}:host-context(.block.is-active) .content:empty:before,:host-context(.block.cdk-focused) .content:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: ContentEditorContentEditableDirective, selector: "[ngsContentEditorContentEditable]", inputs: ["ngsContentEditorContentEditable", "settings", "props", "singleLine"], outputs: ["contentChanged", "propsChanged", "pressedEnter", "initialized"], exportAs: ["ngsContentEditorContentEditable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
103
114
|
}
|
|
104
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ParagraphBlockComponent, decorators: [{
|
|
105
116
|
type: Component,
|
|
@@ -114,8 +125,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
114
125
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
115
126
|
'class': 'ngs-paragraph-block',
|
|
116
127
|
'[class.is-empty]': '_isEmpty()'
|
|
117
|
-
}, template: "<
|
|
118
|
-
}], propDecorators: { _contentRef: [{ type: i0.ViewChild, args: ['contentRef', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
128
|
+
}, template: "<div #contentRef\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"_content()\"\n [settings]=\"settings()\"\n [props]=\"props()\"\n (propsChanged)=\"onPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (keydown)=\"_onKeyDown($event)\"\n (initialized)=\"onContentEditableInitialized()\"></div>\n", styles: [":host{display:block;position:relative}:host p{line-height:var(--leading-normal)}:host .content{outline:none}:host-context(.block.is-active) .content:empty:before,:host-context(.block.cdk-focused) .content:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
129
|
+
}], ctorParameters: () => [], propDecorators: { _contentRef: [{ type: i0.ViewChild, args: ['contentRef', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
119
130
|
|
|
120
131
|
export { ParagraphBlockComponent };
|
|
121
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-paragraph-block.component-
|
|
132
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs.map
|
package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs","sources":["../../../projects/components/content-editor/src/_builder/paragraph-block/paragraph-block.component.ts","../../../projects/components/content-editor/src/_builder/paragraph-block/paragraph-block.component.html"],"sourcesContent":["import { NgsHeadlessEditorText } from '@ngstarter-ui/components/headless-editor';\nimport { contentEditorText, cloneContentEditorValue } from '../../document';\nimport {\n ChangeDetectionStrategy,\n Component, effect, untracked, DestroyRef,\n ElementRef, forwardRef,\n inject,\n input,\n OnInit, signal,\n viewChild\n} from '@angular/core';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorItemProperty\n} from '../../types';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { CursorController } from '../../utils/cursor-controller';\n\n@Component({\n selector: 'ngs-paragraph-block',\n imports: [\n ContentEditorContentEditableDirective\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: forwardRef(() => ParagraphBlockComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './paragraph-block.component.html',\n styleUrl: './paragraph-block.component.scss',\n host: {\n 'class': 'ngs-paragraph-block',\n '[class.is-empty]': '_isEmpty()'\n }\n})\nexport class ParagraphBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private _destroyRef = inject(DestroyRef);\n\n private _contentRef = viewChild.required<ElementRef<HTMLParagraphElement>>('contentRef');\n\n id = input.required<string>();\n content = input.required<readonly NgsHeadlessEditorText[]>();\n settings = input.required<any>();\n props = input<ContentEditorItemProperty[]>([]);\n index = input.required<number>();\n placeholder = input('Enter text here');\n\n protected _content = signal<readonly NgsHeadlessEditorText[]>([]);\n protected _props = signal<ContentEditorItemProperty[]>([]);\n protected _isEmpty = signal<boolean>(true);\n readonly initialized = signal(false);\n\n constructor() {\n effect(() => {\n const content = this.content();\n const props = this.props();\n untracked(() => {\n this._content.set(content);\n this._props.set(cloneContentEditorValue(props));\n this._isEmpty.set(!contentEditorText(content).trim());\n });\n });\n }\n\n ngOnInit() {\n this._content.set(this.content());\n this._props.set(this.props());\n this._isEmpty.set(!contentEditorText(this.content()).trim());\n this._contentBuilder\n .focusChanged\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n });\n }\n\n focus() {\n const element = this._contentRef().nativeElement;\n const cursorController = new CursorController(element);\n cursorController.setToEnd();\n }\n\n getData(): any {\n return {\n content: this._content(),\n props: this._props(),\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return !contentEditorText(this._content()).trim();\n }\n\n protected onContentChanged(content: readonly NgsHeadlessEditorText[]) {\n if (!this.initialized()) {\n return;\n }\n\n this._content.set(content);\n this._isEmpty.set(!contentEditorText(content).trim());\n\n this.update();\n }\n\n protected onPropsChanged(props: ContentEditorItemProperty[]) {\n this._props.set(props);\n this.update();\n }\n\n protected onPressedEnter(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n\n protected onContentEditableInitialized() {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n\n this.initialized.set(true);\n }\n\n protected _onKeyDown(event: KeyboardEvent) {\n if (event.key === 'Backspace' && !contentEditorText(this._content())) {\n this._contentBuilder.deleteBlock(this.id());\n }\n }\n\n private update() {\n this._contentBuilder.updateParagraph(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<div #contentRef\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"_content()\"\n [settings]=\"settings()\"\n [props]=\"props()\"\n (propsChanged)=\"onPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (keydown)=\"_onKeyDown($event)\"\n (initialized)=\"onContentEditableInitialized()\"></div>\n"],"names":[],"mappings":";;;;;;MA2Ca,uBAAuB,CAAA;AAC1B,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,eAAe,GAAG,MAAM,CAA0B,eAAe,CAAC;AAClE,IAAA,WAAW,GAAG,MAAM,CA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EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { C as ContentBuilderStore, a as CONTENT_BUILDER, c as cloneContentEditorValue, b as contentEditorText, d as ContentEditorContentEditableDirective, e as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DestroyRef, viewChild, input, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs';
|
|
3
|
+
import { inject, DestroyRef, viewChild, input, signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import { C as ContentEditorContentEditableDirective } from './ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs';
|
|
6
5
|
|
|
7
6
|
class QuoteBlockComponent {
|
|
8
7
|
_store = inject(ContentBuilderStore);
|
|
@@ -18,15 +17,17 @@ class QuoteBlockComponent {
|
|
|
18
17
|
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
19
18
|
index = input.required(/* @ts-ignore */
|
|
20
19
|
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
20
|
+
props = input([], /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
|
|
21
22
|
placeholder = input('Enter quote here', /* @ts-ignore */
|
|
22
23
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
23
24
|
captionPlaceholder = input('Enter caption here', /* @ts-ignore */
|
|
24
25
|
...(ngDevMode ? [{ debugName: "captionPlaceholder" }] : /* istanbul ignore next */ []));
|
|
25
|
-
_citeContent = signal(
|
|
26
|
+
_citeContent = signal([], /* @ts-ignore */
|
|
26
27
|
...(ngDevMode ? [{ debugName: "_citeContent" }] : /* istanbul ignore next */ []));
|
|
27
28
|
_citeProps = signal([], /* @ts-ignore */
|
|
28
29
|
...(ngDevMode ? [{ debugName: "_citeProps" }] : /* istanbul ignore next */ []));
|
|
29
|
-
_captionContent = signal(
|
|
30
|
+
_captionContent = signal([], /* @ts-ignore */
|
|
30
31
|
...(ngDevMode ? [{ debugName: "_captionContent" }] : /* istanbul ignore next */ []));
|
|
31
32
|
_captionProps = signal([], /* @ts-ignore */
|
|
32
33
|
...(ngDevMode ? [{ debugName: "_captionProps" }] : /* istanbul ignore next */ []));
|
|
@@ -35,7 +36,7 @@ class QuoteBlockComponent {
|
|
|
35
36
|
initialized = signal(false, /* @ts-ignore */
|
|
36
37
|
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
37
38
|
citeOriginalContent = computed(() => {
|
|
38
|
-
return this.content().cite.content ||
|
|
39
|
+
return this.content().cite.content || [];
|
|
39
40
|
}, /* @ts-ignore */
|
|
40
41
|
...(ngDevMode ? [{ debugName: "citeOriginalContent" }] : /* istanbul ignore next */ []));
|
|
41
42
|
citeOriginalProps = computed(() => {
|
|
@@ -43,13 +44,25 @@ class QuoteBlockComponent {
|
|
|
43
44
|
}, /* @ts-ignore */
|
|
44
45
|
...(ngDevMode ? [{ debugName: "citeOriginalProps" }] : /* istanbul ignore next */ []));
|
|
45
46
|
captionOriginalContent = computed(() => {
|
|
46
|
-
return this.content().caption?.content ||
|
|
47
|
+
return this.content().caption?.content || [];
|
|
47
48
|
}, /* @ts-ignore */
|
|
48
49
|
...(ngDevMode ? [{ debugName: "captionOriginalContent" }] : /* istanbul ignore next */ []));
|
|
49
50
|
captionOriginalProps = computed(() => {
|
|
50
51
|
return this.content().caption?.props || [];
|
|
51
52
|
}, /* @ts-ignore */
|
|
52
53
|
...(ngDevMode ? [{ debugName: "captionOriginalProps" }] : /* istanbul ignore next */ []));
|
|
54
|
+
constructor() {
|
|
55
|
+
effect(() => {
|
|
56
|
+
const content = this.content();
|
|
57
|
+
untracked(() => {
|
|
58
|
+
this._citeContent.set(content.cite.content);
|
|
59
|
+
this._citeProps.set(cloneContentEditorValue(content.cite.props));
|
|
60
|
+
this._captionContent.set(content.caption?.content ?? []);
|
|
61
|
+
this._captionProps.set(cloneContentEditorValue(content.caption?.props ?? []));
|
|
62
|
+
this._isEmpty.set(!contentEditorText(content.cite.content).trim());
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
53
66
|
ngOnInit() {
|
|
54
67
|
this._citeContent.set(this.citeOriginalContent());
|
|
55
68
|
this._citeProps.set(this.citeOriginalProps());
|
|
@@ -92,21 +105,21 @@ class QuoteBlockComponent {
|
|
|
92
105
|
};
|
|
93
106
|
}
|
|
94
107
|
isEmpty() {
|
|
95
|
-
return this.
|
|
108
|
+
return !contentEditorText(this._citeContent()).trim();
|
|
96
109
|
}
|
|
97
110
|
onCiteContentChanged(content) {
|
|
98
111
|
if (!this.initialized()) {
|
|
99
112
|
return;
|
|
100
113
|
}
|
|
101
|
-
this._isEmpty.set(content.trim()
|
|
102
|
-
this._citeContent.set(content
|
|
114
|
+
this._isEmpty.set(!contentEditorText(content).trim());
|
|
115
|
+
this._citeContent.set(content);
|
|
103
116
|
this.update();
|
|
104
117
|
}
|
|
105
118
|
onCaptionContentChanged(content) {
|
|
106
119
|
if (!this.initialized()) {
|
|
107
120
|
return;
|
|
108
121
|
}
|
|
109
|
-
this._captionContent.set(content
|
|
122
|
+
this._captionContent.set(content);
|
|
110
123
|
this.update();
|
|
111
124
|
}
|
|
112
125
|
onCitePropsChanged(props) {
|
|
@@ -133,13 +146,13 @@ class QuoteBlockComponent {
|
|
|
133
146
|
this._contentBuilder.emitContentChangeEvent();
|
|
134
147
|
}
|
|
135
148
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: QuoteBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
136
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: QuoteBlockComponent, isStandalone: true, selector: "ngs-quote-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, captionPlaceholder: { classPropertyName: "captionPlaceholder", publicName: "captionPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
149
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: QuoteBlockComponent, isStandalone: true, selector: "ngs-quote-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, captionPlaceholder: { classPropertyName: "captionPlaceholder", publicName: "captionPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
137
150
|
{
|
|
138
151
|
provide: CONTENT_EDITOR_BLOCK,
|
|
139
152
|
useExisting: QuoteBlockComponent,
|
|
140
153
|
multi: true
|
|
141
154
|
}
|
|
142
|
-
], viewQueries: [{ propertyName: "_contentRef", first: true, predicate: ["contentRef"], descendants: true, isSignal: true }], exportAs: ["ngsQuoteBlock"], ngImport: i0, template: "<blockquote #contentRef\n #contentEditableRef=\"ngsContentEditorContentEditable\"\n class=\"content\"\n [ngsContentEditorContentEditable]=\"citeOriginalContent()\"\n [props]=\"citeOriginalProps()\"\n (propsChanged)=\"onCitePropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCiteContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (initialized)=\"onContentEditableInitialized()\"></blockquote>\n<div class=\"caption\"\n #captionRef\n #captionEditableRef=\"ngsContentEditorContentEditable\"\n [ngsContentEditorContentEditable]=\"captionOriginalContent()\"\n [props]=\"captionOriginalProps()\"\n (propsChanged)=\"onCaptionPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCaptionContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"></div>\n", styles: [":host{display:block;margin:calc(var(--spacing, .25rem) * 2) 0}:host .content{outline:none;border-inline-start:var(--spacing, .25rem) solid var(--ngs-color-border);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);margin-bottom:calc(var(--spacing, .25rem) * 2)}:host .caption{outline:none;font-size:var(--ngs-font-size-sm);color:var(--ngs-color-neutral-600)}:host-context .content:empty:before,:host-context .caption:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: ContentEditorContentEditableDirective, selector: "[ngsContentEditorContentEditable]", inputs: ["ngsContentEditorContentEditable", "settings", "props"], outputs: ["contentChanged", "
|
|
155
|
+
], viewQueries: [{ propertyName: "_contentRef", first: true, predicate: ["contentRef"], descendants: true, isSignal: true }], exportAs: ["ngsQuoteBlock"], ngImport: i0, template: "<blockquote #contentRef\n #contentEditableRef=\"ngsContentEditorContentEditable\"\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"citeOriginalContent()\"\n [props]=\"citeOriginalProps()\"\n (propsChanged)=\"onCitePropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCiteContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (initialized)=\"onContentEditableInitialized()\"></blockquote>\n<div class=\"caption\"\n #captionRef\n #captionEditableRef=\"ngsContentEditorContentEditable\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"captionOriginalContent()\"\n [props]=\"captionOriginalProps()\"\n (propsChanged)=\"onCaptionPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCaptionContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"></div>\n", styles: [":host{display:block;margin:calc(var(--spacing, .25rem) * 2) 0}:host .content{outline:none;border-inline-start:var(--spacing, .25rem) solid var(--ngs-color-border);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);margin-bottom:calc(var(--spacing, .25rem) * 2)}:host .caption{outline:none;font-size:var(--ngs-font-size-sm);color:var(--ngs-color-neutral-600)}:host-context .content:empty:before,:host-context .caption:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: ContentEditorContentEditableDirective, selector: "[ngsContentEditorContentEditable]", inputs: ["ngsContentEditorContentEditable", "settings", "props", "singleLine"], outputs: ["contentChanged", "propsChanged", "pressedEnter", "initialized"], exportAs: ["ngsContentEditorContentEditable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
143
156
|
}
|
|
144
157
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: QuoteBlockComponent, decorators: [{
|
|
145
158
|
type: Component,
|
|
@@ -151,8 +164,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
151
164
|
useExisting: QuoteBlockComponent,
|
|
152
165
|
multi: true
|
|
153
166
|
}
|
|
154
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<blockquote #contentRef\n #contentEditableRef=\"ngsContentEditorContentEditable\"\n class=\"content\"\n [ngsContentEditorContentEditable]=\"citeOriginalContent()\"\n [props]=\"citeOriginalProps()\"\n (propsChanged)=\"onCitePropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCiteContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (initialized)=\"onContentEditableInitialized()\"></blockquote>\n<div class=\"caption\"\n #captionRef\n #captionEditableRef=\"ngsContentEditorContentEditable\"\n [ngsContentEditorContentEditable]=\"captionOriginalContent()\"\n [props]=\"captionOriginalProps()\"\n (propsChanged)=\"onCaptionPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCaptionContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"></div>\n", styles: [":host{display:block;margin:calc(var(--spacing, .25rem) * 2) 0}:host .content{outline:none;border-inline-start:var(--spacing, .25rem) solid var(--ngs-color-border);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);margin-bottom:calc(var(--spacing, .25rem) * 2)}:host .caption{outline:none;font-size:var(--ngs-font-size-sm);color:var(--ngs-color-neutral-600)}:host-context .content:empty:before,:host-context .caption:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
155
|
-
}], propDecorators: { _contentRef: [{ type: i0.ViewChild, args: ['contentRef', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], captionPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionPlaceholder", required: false }] }] } });
|
|
167
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<blockquote #contentRef\n #contentEditableRef=\"ngsContentEditorContentEditable\"\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"citeOriginalContent()\"\n [props]=\"citeOriginalProps()\"\n (propsChanged)=\"onCitePropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCiteContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (initialized)=\"onContentEditableInitialized()\"></blockquote>\n<div class=\"caption\"\n #captionRef\n #captionEditableRef=\"ngsContentEditorContentEditable\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"captionOriginalContent()\"\n [props]=\"captionOriginalProps()\"\n (propsChanged)=\"onCaptionPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCaptionContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"></div>\n", styles: [":host{display:block;margin:calc(var(--spacing, .25rem) * 2) 0}:host .content{outline:none;border-inline-start:var(--spacing, .25rem) solid var(--ngs-color-border);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);margin-bottom:calc(var(--spacing, .25rem) * 2)}:host .caption{outline:none;font-size:var(--ngs-font-size-sm);color:var(--ngs-color-neutral-600)}:host-context .content:empty:before,:host-context .caption:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
168
|
+
}], ctorParameters: () => [], propDecorators: { _contentRef: [{ type: i0.ViewChild, args: ['contentRef', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], captionPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionPlaceholder", required: false }] }] } });
|
|
156
169
|
|
|
157
170
|
export { QuoteBlockComponent };
|
|
158
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-quote-block.component-
|
|
171
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs.map
|
package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs","sources":["../../../projects/components/content-editor/src/_builder/quote-block/quote-block.component.ts","../../../projects/components/content-editor/src/_builder/quote-block/quote-block.component.html"],"sourcesContent":["import { NgsHeadlessEditorText } from '@ngstarter-ui/components/headless-editor';\nimport { ContentEditorText } from '../../types';\nimport { contentEditorText, cloneContentEditorValue } from '../../document';\nimport {\n ChangeDetectionStrategy,\n Component, computed, effect, untracked,\n DestroyRef,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n viewChild\n} from '@angular/core';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorItemProperty\n} from '../../types';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\n\nexport interface ContentEditorQuoteBlockContent {\n cite: {\n content: ContentEditorText;\n props: ContentEditorItemProperty[];\n };\n caption?: {\n content: ContentEditorText;\n props: ContentEditorItemProperty[];\n }\n}\n\nexport interface ContentEditorQuoteBlock {\n content: ContentEditorQuoteBlockContent,\n settings: any\n}\n\n@Component({\n selector: 'ngs-quote-block',\n exportAs: 'ngsQuoteBlock',\n imports: [\n ContentEditorContentEditableDirective,\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: QuoteBlockComponent,\n multi: true\n }\n ],\n templateUrl: './quote-block.component.html',\n styleUrl: './quote-block.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class QuoteBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private _destroyRef = inject(DestroyRef);\n\n private _contentRef = viewChild.required<ElementRef<HTMLParagraphElement>>('contentRef');\n\n id = input.required<string>();\n content = input.required<ContentEditorQuoteBlockContent>();\n settings = input.required<any>();\n index = input.required<number>();\n props = input<ContentEditorItemProperty[]>([]);\n placeholder = input('Enter quote here');\n captionPlaceholder = input('Enter caption here');\n\n protected _citeContent = signal<ContentEditorText>([]);\n protected _citeProps = signal<ContentEditorItemProperty[]>([]);\n protected _captionContent = signal<ContentEditorText>([]);\n protected _captionProps = signal<ContentEditorItemProperty[]>([]);\n protected _isEmpty = signal<boolean>(true);\n readonly initialized = signal(false);\n\n citeOriginalContent = computed(() => {\n return this.content().cite.content || [];\n });\n citeOriginalProps = computed(() => {\n return this.content().cite.props || [];\n });\n captionOriginalContent = computed(() => {\n return this.content().caption?.content || [];\n });\n captionOriginalProps = computed(() => {\n return this.content().caption?.props || [];\n });\n\n constructor() {\n effect(() => {\n const content = this.content();\n untracked(() => {\n this._citeContent.set(content.cite.content);\n this._citeProps.set(cloneContentEditorValue(content.cite.props));\n this._captionContent.set(content.caption?.content ?? []);\n this._captionProps.set(cloneContentEditorValue(content.caption?.props ?? []));\n this._isEmpty.set(!contentEditorText(content.cite.content).trim());\n });\n });\n }\n\n ngOnInit() {\n this._citeContent.set(this.citeOriginalContent());\n this._citeProps.set(this.citeOriginalProps());\n this._captionContent.set(this.captionOriginalContent());\n this._captionProps.set(this.captionOriginalProps());\n this._isEmpty.set(this._citeContent().length === 0);\n this._contentBuilder\n .focusChanged\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n });\n }\n\n focus() {\n const element = this._contentRef().nativeElement;\n const range = window.document.createRange();\n range.setStart(element, 0);\n range.setEnd(element, 0);\n const selection = window.getSelection() as Selection;\n selection.removeAllRanges();\n selection.addRange(range);\n }\n\n getData(): any {\n return {\n content: {\n cite: {\n content: this._citeContent(),\n props: this._citeProps(),\n },\n caption: {\n content: this._captionContent(),\n props: this._captionProps(),\n }\n },\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return !contentEditorText(this._citeContent()).trim();\n }\n\n protected onCiteContentChanged(content: readonly NgsHeadlessEditorText[]) {\n if (!this.initialized()) {\n return;\n }\n\n this._isEmpty.set(!contentEditorText(content).trim());\n this._citeContent.set(content);\n this.update();\n }\n\n protected onCaptionContentChanged(content: readonly NgsHeadlessEditorText[]) {\n if (!this.initialized()) {\n return;\n }\n\n this._captionContent.set(content);\n this.update();\n }\n\n protected onCitePropsChanged(props: ContentEditorItemProperty[]) {\n this._citeProps.set(props);\n this.update();\n }\n\n protected onCaptionPropsChanged(props: ContentEditorItemProperty[]) {\n this._captionProps.set(props);\n this.update();\n }\n\n protected onPressedEnter(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n\n protected onContentEditableInitialized() {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n\n this.initialized.set(true);\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<blockquote #contentRef\n #contentEditableRef=\"ngsContentEditorContentEditable\"\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"citeOriginalContent()\"\n [props]=\"citeOriginalProps()\"\n (propsChanged)=\"onCitePropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCiteContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (initialized)=\"onContentEditableInitialized()\"></blockquote>\n<div class=\"caption\"\n #captionRef\n #captionEditableRef=\"ngsContentEditorContentEditable\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"captionOriginalContent()\"\n [props]=\"captionOriginalProps()\"\n (propsChanged)=\"onCaptionPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onCaptionContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"></div>\n"],"names":[],"mappings":";;;;;MA0Da,mBAAmB,CAAA;AACtB,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,eAAe,GAAG,MAAM,CAA0B,eAAe,CAAC;AAClE,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhC,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAmC,YAAY;oFAAC;IAExF,EAAE,GAAG,KAAK,CAAC,QAAQ;2EAAU;IAC7B,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAkC;IAC1D,QAAQ,GAAG,KAAK,CAAC,QAAQ;iFAAO;IAChC,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;IAChC,KAAK,GAAG,KAAK,CAA8B,EAAE;8EAAC;IAC9C,WAAW,GAAG,KAAK,CAAC,kBAAkB;oFAAC;IACvC,kBAAkB,GAAG,KAAK,CAAC,oBAAoB;2FAAC;IAEtC,YAAY,GAAG,MAAM,CAAoB,EAAE;qFAAC;IAC5C,UAAU,GAAG,MAAM,CAA8B,EAAE;mFAAC;IACpD,eAAe,GAAG,MAAM,CAAoB,EAAE;wFAAC;IAC/C,aAAa,GAAG,MAAM,CAA8B,EAAE;sFAAC;IACvD,QAAQ,GAAG,MAAM,CAAU,IAAI;iFAAC;IACjC,WAAW,GAAG,MAAM,CAAC,KAAK;oFAAC;AAEpC,IAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAK;QAClC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE;IAC1C,CAAC;4FAAC;AACF,IAAA,iBAAiB,GAAG,QAAQ,CAAC,MAAK;QAChC,OAAO,IAAI,CAAC,OAAO,EAAE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,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { a as CONTENT_BUILDER, C as ContentBuilderStore, c as cloneContentEditorValue, b as contentEditorText, d as ContentEditorContentEditableDirective, e as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, DestroyRef, output, afterNextRender, Directive, PLATFORM_ID, Input, Renderer2, NgZone, input, booleanAttribute, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal } from '@angular/core';
|
|
3
|
+
import { inject, ElementRef, DestroyRef, output, afterNextRender, Directive, PLATFORM_ID, Input, Renderer2, NgZone, input, booleanAttribute, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal, effect, untracked } from '@angular/core';
|
|
3
4
|
import { DOCUMENT, isPlatformServer, isPlatformBrowser } from '@angular/common';
|
|
4
|
-
import { a as CONTENT_BUILDER, C as ContentBuilderStore, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs';
|
|
5
|
-
import { C as ContentEditorContentEditableDirective } from './ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs';
|
|
6
5
|
import SelectionArea from '@viselect/vanilla';
|
|
7
6
|
import { Icon } from '@ngstarter-ui/components/icon';
|
|
8
7
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -1374,6 +1373,8 @@ class TableBlockComponent {
|
|
|
1374
1373
|
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
1375
1374
|
index = input.required(/* @ts-ignore */
|
|
1376
1375
|
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
1376
|
+
props = input([], /* @ts-ignore */
|
|
1377
|
+
...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
|
|
1377
1378
|
_content = signal([], /* @ts-ignore */
|
|
1378
1379
|
...(ngDevMode ? [{ debugName: "_content" }] : /* istanbul ignore next */ []));
|
|
1379
1380
|
_columnManaging = signal(false, /* @ts-ignore */
|
|
@@ -1386,8 +1387,22 @@ class TableBlockComponent {
|
|
|
1386
1387
|
...(ngDevMode ? [{ debugName: "_resizeManging" }] : /* istanbul ignore next */ []));
|
|
1387
1388
|
initialized = signal(false, /* @ts-ignore */
|
|
1388
1389
|
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
1390
|
+
constructor() {
|
|
1391
|
+
effect(() => {
|
|
1392
|
+
const content = this.content();
|
|
1393
|
+
untracked(() => this._content.set(cloneContentEditorValue(content)));
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1396
|
+
onCellContentChanged(cell, content) {
|
|
1397
|
+
cell.content = content;
|
|
1398
|
+
this.update();
|
|
1399
|
+
}
|
|
1400
|
+
onCellPropsChanged(cell, props) {
|
|
1401
|
+
cell.props = props;
|
|
1402
|
+
this.update();
|
|
1403
|
+
}
|
|
1389
1404
|
ngOnInit() {
|
|
1390
|
-
this._content.set(this.content());
|
|
1405
|
+
this._content.set(cloneContentEditorValue(this.content()));
|
|
1391
1406
|
}
|
|
1392
1407
|
ngAfterViewInit() {
|
|
1393
1408
|
if (isPlatformBrowser(this._platformId)) {
|
|
@@ -1435,7 +1450,7 @@ class TableBlockComponent {
|
|
|
1435
1450
|
this._content.update((content) => {
|
|
1436
1451
|
content.forEach((row) => {
|
|
1437
1452
|
row.push({
|
|
1438
|
-
content:
|
|
1453
|
+
content: [],
|
|
1439
1454
|
props: [],
|
|
1440
1455
|
styles: {},
|
|
1441
1456
|
options: {
|
|
@@ -1455,7 +1470,7 @@ class TableBlockComponent {
|
|
|
1455
1470
|
}
|
|
1456
1471
|
let isLastColEmpty = false;
|
|
1457
1472
|
this._content().forEach((row) => {
|
|
1458
|
-
if (row[row.length - 1].content) {
|
|
1473
|
+
if (contentEditorText(row[row.length - 1].content)) {
|
|
1459
1474
|
isLastColEmpty = true;
|
|
1460
1475
|
}
|
|
1461
1476
|
});
|
|
@@ -1476,7 +1491,7 @@ class TableBlockComponent {
|
|
|
1476
1491
|
const row = [];
|
|
1477
1492
|
for (let i = 0; i < content[0].length; i++) {
|
|
1478
1493
|
row.push({
|
|
1479
|
-
content:
|
|
1494
|
+
content: [],
|
|
1480
1495
|
props: [],
|
|
1481
1496
|
styles: {},
|
|
1482
1497
|
options: {
|
|
@@ -1497,7 +1512,7 @@ class TableBlockComponent {
|
|
|
1497
1512
|
}
|
|
1498
1513
|
let isLastRowEmpty = false;
|
|
1499
1514
|
this._content()[this._content().length - 1].forEach((cell) => {
|
|
1500
|
-
if (cell.content) {
|
|
1515
|
+
if (contentEditorText(cell.content)) {
|
|
1501
1516
|
isLastRowEmpty = true;
|
|
1502
1517
|
}
|
|
1503
1518
|
});
|
|
@@ -1581,13 +1596,13 @@ class TableBlockComponent {
|
|
|
1581
1596
|
this._contentBuilder.emitContentChangeEvent();
|
|
1582
1597
|
}
|
|
1583
1598
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1584
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: TableBlockComponent, isStandalone: true, selector: "ngs-table-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.is-column-managing": "_columnManaging()", "class.is-row-managing": "_rowManaging()" } }, providers: [
|
|
1599
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: TableBlockComponent, isStandalone: true, selector: "ngs-table-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.is-column-managing": "_columnManaging()", "class.is-row-managing": "_rowManaging()" } }, providers: [
|
|
1585
1600
|
{
|
|
1586
1601
|
provide: CONTENT_EDITOR_BLOCK,
|
|
1587
1602
|
useExisting: TableBlockComponent,
|
|
1588
1603
|
multi: true
|
|
1589
1604
|
}
|
|
1590
|
-
], viewQueries: [{ propertyName: "_tableRef", first: true, predicate: ["table"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td
|
|
1605
|
+
], viewQueries: [{ propertyName: "_tableRef", first: true, predicate: ["table"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"onCellContentChanged(cell, $event)\"\n (propsChanged)=\"onCellPropsChanged(cell, $event)\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n", styles: [":host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;width:var(--ngs-content-editor-builder-content-width)}:host .table-container{position:relative;width:max-content}:host table{width:auto!important;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-color-neutral-200)}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: ContentEditorContentEditableDirective, selector: "[ngsContentEditorContentEditable]", inputs: ["ngsContentEditorContentEditable", "settings", "props", "singleLine"], outputs: ["contentChanged", "propsChanged", "pressedEnter", "initialized"], exportAs: ["ngsContentEditorContentEditable"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "directive", type: TableColumnsManagerDirective, selector: "[ngsTableColumnsManager]", outputs: ["columnAdded", "columnDeleted", "columnManagingStart", "columnManagingEnd"] }, { kind: "directive", type: TableRowsManagerDirective, selector: "[ngsTableRowsManager]", outputs: ["rowManagingStart", "rowManagingEnd", "rowAdded", "rowDeleted"] }, { kind: "directive", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: ResizableTableDirective, selector: "table[ngsResizableTable]", inputs: ["minColumnWidth", "resizeHandleWidth", "mutationObserverDebounceTime"], outputs: ["columnWidthChange", "columnWidthChangeStart", "columnWidthChangeEnd"] }, { kind: "component", type: DraggableTableComponent, selector: "ngs-draggable-table", inputs: ["disabled"], outputs: ["columnMoved", "rowMoved", "moveStart", "moveEnd"], exportAs: ["ngsDraggableTable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1591
1606
|
}
|
|
1592
1607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableBlockComponent, decorators: [{
|
|
1593
1608
|
type: Component,
|
|
@@ -1608,8 +1623,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
1608
1623
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1609
1624
|
'[class.is-column-managing]': '_columnManaging()',
|
|
1610
1625
|
'[class.is-row-managing]': '_rowManaging()',
|
|
1611
|
-
}, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td
|
|
1612
|
-
}], propDecorators: { _tableRef: [{ type: i0.ViewChild, args: ['table', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }] } });
|
|
1626
|
+
}, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"onCellContentChanged(cell, $event)\"\n (propsChanged)=\"onCellPropsChanged(cell, $event)\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n", styles: [":host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;width:var(--ngs-content-editor-builder-content-width)}:host .table-container{position:relative;width:max-content}:host table{width:auto!important;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-color-neutral-200)}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
1627
|
+
}], ctorParameters: () => [], propDecorators: { _tableRef: [{ type: i0.ViewChild, args: ['table', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1613
1628
|
|
|
1614
1629
|
export { TableBlockComponent };
|
|
1615
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-table-block.component-
|
|
1630
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-table-block.component-CJS-IBHw.mjs.map
|