@ngstarter-ui/components 22.2.4 → 22.2.6
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 +89 -13
- package/content-editor/BLOCK_FORMAT.md +38 -0
- package/data-view/API.md +262 -0
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +67 -44
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-attachment-block-rzZKJ2JH.mjs → ngstarter-ui-components-content-editor-attachment-block-Dvrxn-PJ.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-attachment-block-rzZKJ2JH.mjs.map → ngstarter-ui-components-content-editor-attachment-block-Dvrxn-PJ.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-DTdApN0r.mjs → ngstarter-ui-components-content-editor-callout-block-hBA6Xogj.mjs} +3 -3
- package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-DTdApN0r.mjs.map → ngstarter-ui-components-content-editor-callout-block-hBA6Xogj.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-DpONkTMU.mjs → ngstarter-ui-components-content-editor-code-block.component-BaaymubZ.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-DpONkTMU.mjs.map → ngstarter-ui-components-content-editor-code-block.component-BaaymubZ.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-CmhzpaRk.mjs → ngstarter-ui-components-content-editor-embed-block-BWAtix_P.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-CmhzpaRk.mjs.map → ngstarter-ui-components-content-editor-embed-block-BWAtix_P.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-gallery-block-gtH7yWd5.mjs → ngstarter-ui-components-content-editor-gallery-block-C8mgrc2q.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-gallery-block-gtH7yWd5.mjs.map → ngstarter-ui-components-content-editor-gallery-block-C8mgrc2q.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Pb-xV7Pw.mjs → ngstarter-ui-components-content-editor-grid-block-B0AfTFLQ.mjs} +6 -6
- package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Pb-xV7Pw.mjs.map → ngstarter-ui-components-content-editor-grid-block-B0AfTFLQ.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-BKe9Zy_x.mjs → ngstarter-ui-components-content-editor-heading-block.component-B0ZuUcQn.mjs} +8 -5
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-B0ZuUcQn.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs → ngstarter-ui-components-content-editor-image-block.component-ZCS4hvUg.mjs} +4 -4
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-ZCS4hvUg.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs → ngstarter-ui-components-content-editor-list-block.component-Ct-ARQ12.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs.map → ngstarter-ui-components-content-editor-list-block.component-Ct-ARQ12.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs → ngstarter-ui-components-content-editor-nested-blocks-B22kRf9a.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs.map → ngstarter-ui-components-content-editor-nested-blocks-B22kRf9a.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-B_6Olt0R.mjs} +93 -41
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-B_6Olt0R.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-BiBe4KAy.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.mjs.map → ngstarter-ui-components-content-editor-paragraph-block.component-BiBe4KAy.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.mjs → ngstarter-ui-components-content-editor-quote-block.component-BuCyqiE2.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.mjs.map → ngstarter-ui-components-content-editor-quote-block.component-BuCyqiE2.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DQgs_kyN.mjs → ngstarter-ui-components-content-editor-table-block.component-Ck5GsDJM.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DQgs_kyN.mjs.map → ngstarter-ui-components-content-editor-table-block.component-Ck5GsDJM.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-Cb67ChE8.mjs → ngstarter-ui-components-content-editor-toggle-block-_hXAyzUb.mjs} +3 -3
- package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-Cb67ChE8.mjs.map → ngstarter-ui-components-content-editor-toggle-block-_hXAyzUb.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-CRa0g9Ez.mjs → ngstarter-ui-components-content-editor-video-block.component-bDo8XvID.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-CRa0g9Ez.mjs.map → ngstarter-ui-components-content-editor-video-block.component-bDo8XvID.mjs.map} +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-core.mjs +114 -3
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-country-select.mjs +5 -17
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +6 -18
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +1011 -90
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs +3 -4
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +45 -19
- package/fesm2022/ngstarter-ui-components-datepicker.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-form-builder.mjs +5 -5
- package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +2 -2
- 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 +244 -29
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-option.mjs +36 -31
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.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 +2 -2
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-select.mjs +157 -105
- package/fesm2022/ngstarter-ui-components-select.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-sort.mjs +9 -2
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-table.mjs +10 -0
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs +6 -13
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_common.scss +2 -1
- package/styles/_tokens.scss +32 -1
- package/styles/themes/default.scss +1 -1
- package/types/ngstarter-ui-components-autocomplete.d.ts +6 -1
- package/types/ngstarter-ui-components-content-editor.d.ts +6 -1
- package/types/ngstarter-ui-components-core.d.ts +24 -3
- package/types/ngstarter-ui-components-country-select.d.ts +0 -2
- package/types/ngstarter-ui-components-currency-select.d.ts +0 -2
- package/types/ngstarter-ui-components-data-view.d.ts +204 -11
- package/types/ngstarter-ui-components-datepicker.d.ts +3 -1
- package/types/ngstarter-ui-components-menu.d.ts +44 -5
- package/types/ngstarter-ui-components-option.d.ts +11 -3
- package/types/ngstarter-ui-components-select.d.ts +12 -7
- package/types/ngstarter-ui-components-sort.d.ts +1 -0
- package/types/ngstarter-ui-components-table.d.ts +2 -0
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-BKe9Zy_x.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-B_6Olt0R.mjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, DestroyRef, viewChild, input, signal, effect, untracked, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -110,7 +110,7 @@ class ParagraphBlockComponent {
|
|
|
110
110
|
useExisting: forwardRef(() => ParagraphBlockComponent),
|
|
111
111
|
multi: true
|
|
112
112
|
}
|
|
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(--
|
|
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(--ngs-content-editor-line-height, 1.6)}: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-content-editor-placeholder-color, var(--ngs-color-on-surface-variant))}\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 });
|
|
114
114
|
}
|
|
115
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ParagraphBlockComponent, decorators: [{
|
|
116
116
|
type: Component,
|
|
@@ -125,8 +125,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
125
125
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
126
126
|
'class': 'ngs-paragraph-block',
|
|
127
127
|
'[class.is-empty]': '_isEmpty()'
|
|
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(--
|
|
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(--ngs-content-editor-line-height, 1.6)}: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-content-editor-placeholder-color, var(--ngs-color-on-surface-variant))}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
129
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 }] }] } });
|
|
130
130
|
|
|
131
131
|
export { ParagraphBlockComponent };
|
|
132
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-paragraph-block.component-
|
|
132
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-paragraph-block.component-BiBe4KAy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.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,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;gFAAoC;IAC5D,QAAQ,GAAG,KAAK,CAAC,QAAQ;iFAAO;IAChC,KAAK,GAAG,KAAK,CAA8B,EAAE;8EAAC;IAC9C,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;IAChC,WAAW,GAAG,KAAK,CAAC,iBAAiB;oFAAC;IAE5B,QAAQ,GAAG,MAAM,CAAmC,EAAE;iFAAC;IACvD,MAAM,GAAG,MAAM,CAA8B,EAAE;+EAAC;IAChD,QAAQ,GAAG,MAAM,CAAU,IAAI;iFAAC;IACjC,WAAW,GAAG,MAAM,CAAC,KAAK;oFAAC;AAEpC,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAC9B,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;YAC1B,SAAS,CAAC,MAAK;AACb,gBAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,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AAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-paragraph-block.component-BiBe4KAy.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,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;gFAAoC;IAC5D,QAAQ,GAAG,KAAK,CAAC,QAAQ;iFAAO;IAChC,KAAK,GAAG,KAAK,CAA8B,EAAE;8EAAC;IAC9C,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;IAChC,WAAW,GAAG,KAAK,CAAC,iBAAiB;oFAAC;IAE5B,QAAQ,GAAG,MAAM,CAAmC,EAAE;iFAAC;IACvD,MAAM,GAAG,MAAM,CAA8B,EAAE;+EAAC;IAChD,QAAQ,GAAG,MAAM,CAAU,IAAI;iFAAC;IACjC,WAAW,GAAG,MAAM,CAAC,KAAK;oFAAC;AAEpC,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAC9B,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;YAC1B,SAAS,CAAC,MAAK;AACb,gBAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAA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,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-B_6Olt0R.mjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, DestroyRef, viewChild, input, signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -152,7 +152,7 @@ class QuoteBlockComponent {
|
|
|
152
152
|
useExisting: QuoteBlockComponent,
|
|
153
153
|
multi: true
|
|
154
154
|
}
|
|
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-
|
|
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-content-editor-muted-color, var(--ngs-color-on-surface-variant))}:host-context .content:empty:before,:host-context .caption:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-content-editor-placeholder-color, var(--ngs-color-on-surface-variant))}\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 });
|
|
156
156
|
}
|
|
157
157
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: QuoteBlockComponent, decorators: [{
|
|
158
158
|
type: Component,
|
|
@@ -164,8 +164,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
164
164
|
useExisting: QuoteBlockComponent,
|
|
165
165
|
multi: true
|
|
166
166
|
}
|
|
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-
|
|
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-content-editor-muted-color, var(--ngs-color-on-surface-variant))}:host-context .content:empty:before,:host-context .caption:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-content-editor-placeholder-color, var(--ngs-color-on-surface-variant))}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
168
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 }] }] } });
|
|
169
169
|
|
|
170
170
|
export { QuoteBlockComponent };
|
|
171
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-quote-block.component-
|
|
171
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-quote-block.component-BuCyqiE2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.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,G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AAA,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,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,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
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-quote-block.component-BuCyqiE2.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,C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+1,4 @@
|
|
|
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-
|
|
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-B_6Olt0R.mjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
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';
|
|
4
4
|
import { DOCUMENT, isPlatformServer, isPlatformBrowser } from '@angular/common';
|
|
@@ -1602,7 +1602,7 @@ class TableBlockComponent {
|
|
|
1602
1602
|
useExisting: TableBlockComponent,
|
|
1603
1603
|
multi: true
|
|
1604
1604
|
}
|
|
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-
|
|
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;max-width:100%;width:var(--ngs-content-editor-builder-content-width, 704px)}: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-content-editor-selected-bg, var(--ngs-color-primary-container))}: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 });
|
|
1606
1606
|
}
|
|
1607
1607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableBlockComponent, decorators: [{
|
|
1608
1608
|
type: Component,
|
|
@@ -1623,8 +1623,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
1623
1623
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1624
1624
|
'[class.is-column-managing]': '_columnManaging()',
|
|
1625
1625
|
'[class.is-row-managing]': '_rowManaging()',
|
|
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-
|
|
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;max-width:100%;width:var(--ngs-content-editor-builder-content-width, 704px)}: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-content-editor-selected-bg, var(--ngs-color-primary-container))}: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
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 }] }] } });
|
|
1628
1628
|
|
|
1629
1629
|
export { TableBlockComponent };
|
|
1630
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-table-block.component-
|
|
1630
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-table-block.component-Ck5GsDJM.mjs.map
|