@ngstarter-ui/components 22.2.3 → 22.2.4

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.
Files changed (55) hide show
  1. package/ai/component-registry.json +22 -0
  2. package/content-editor/BLOCK_FORMAT.md +144 -0
  3. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-rzZKJ2JH.mjs +35 -0
  4. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-rzZKJ2JH.mjs.map +1 -0
  5. package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-Jbf8h2yz.mjs → ngstarter-ui-components-content-editor-callout-block-DTdApN0r.mjs} +2 -3
  6. package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-Jbf8h2yz.mjs.map → ngstarter-ui-components-content-editor-callout-block-DTdApN0r.mjs.map} +1 -1
  7. package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BizHRPdC.mjs → ngstarter-ui-components-content-editor-code-block.component-DpONkTMU.mjs} +2 -2
  8. package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BizHRPdC.mjs.map → ngstarter-ui-components-content-editor-code-block.component-DpONkTMU.mjs.map} +1 -1
  9. package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BzoaJvai.mjs → ngstarter-ui-components-content-editor-embed-block-CmhzpaRk.mjs} +2 -2
  10. package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BzoaJvai.mjs.map → ngstarter-ui-components-content-editor-embed-block-CmhzpaRk.mjs.map} +1 -1
  11. package/fesm2022/{ngstarter-ui-components-content-editor-gallery-block-C4p-S0Do.mjs → ngstarter-ui-components-content-editor-gallery-block-gtH7yWd5.mjs} +16 -39
  12. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-gtH7yWd5.mjs.map +1 -0
  13. package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Cdq_Dcv2.mjs → ngstarter-ui-components-content-editor-grid-block-Pb-xV7Pw.mjs} +3 -4
  14. package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Cdq_Dcv2.mjs.map → ngstarter-ui-components-content-editor-grid-block-Pb-xV7Pw.mjs.map} +1 -1
  15. package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-CDSt4rXe.mjs → ngstarter-ui-components-content-editor-heading-block.component-BKe9Zy_x.mjs} +2 -2
  16. package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-CDSt4rXe.mjs.map → ngstarter-ui-components-content-editor-heading-block.component-BKe9Zy_x.mjs.map} +1 -1
  17. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs +113 -0
  18. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs.map +1 -0
  19. package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-CdQ30RjA.mjs → ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs} +2 -2
  20. package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-CdQ30RjA.mjs.map → ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs.map} +1 -1
  21. package/fesm2022/{ngstarter-ui-components-content-editor-nested-blocks-CbZY0keH.mjs → ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs} +4 -4
  22. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs.map +1 -0
  23. package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs} +2021 -1505
  24. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs.map +1 -0
  25. package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-Dd0pQquG.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.mjs} +2 -2
  26. package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-Dd0pQquG.mjs.map → ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.mjs.map} +1 -1
  27. package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CUxKoeb_.mjs → ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.mjs} +2 -2
  28. package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CUxKoeb_.mjs.map → ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.mjs.map} +1 -1
  29. package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-BTExrXy8.mjs → ngstarter-ui-components-content-editor-table-block.component-DQgs_kyN.mjs} +2 -2
  30. package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-BTExrXy8.mjs.map → ngstarter-ui-components-content-editor-table-block.component-DQgs_kyN.mjs.map} +1 -1
  31. package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-B46YeMGQ.mjs → ngstarter-ui-components-content-editor-toggle-block-Cb67ChE8.mjs} +3 -4
  32. package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-B46YeMGQ.mjs.map → ngstarter-ui-components-content-editor-toggle-block-Cb67ChE8.mjs.map} +1 -1
  33. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +19 -0
  34. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +1 -0
  35. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-CRa0g9Ez.mjs +134 -0
  36. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-CRa0g9Ez.mjs.map +1 -0
  37. package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
  38. package/fesm2022/ngstarter-ui-components-headless-editor.mjs +57 -0
  39. package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/types/ngstarter-ui-components-content-editor.d.ts +205 -10
  42. package/types/ngstarter-ui-components-headless-editor.d.ts +6 -1
  43. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs +0 -54
  44. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs.map +0 -1
  45. package/fesm2022/ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs +0 -47
  46. package/fesm2022/ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs.map +0 -1
  47. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-C4p-S0Do.mjs.map +0 -1
  48. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-LfKZapgv.mjs +0 -169
  49. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-LfKZapgv.mjs.map +0 -1
  50. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-CbZY0keH.mjs.map +0 -1
  51. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs.map +0 -1
  52. package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-DKqojf--.mjs +0 -29
  53. package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-DKqojf--.mjs.map +0 -1
  54. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-hBR5AauH.mjs +0 -201
  55. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-hBR5AauH.mjs.map +0 -1
@@ -0,0 +1,113 @@
1
+ import { f as ContentEditorUploadBlockBase, e as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs';
2
+ import { C as ContentEditorUploadStatus } from './ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs';
3
+ import * as i0 from '@angular/core';
4
+ import { signal, model, effect, untracked, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
5
+ import { UploadArea, UploadTriggerDirective } from '@ngstarter-ui/components/upload';
6
+ import { ImageResizer, ImageResizerImageDirective } from '@ngstarter-ui/components/image-resizer';
7
+ import { FormField, Label } from '@ngstarter-ui/components/form-field';
8
+ import { Input } from '@ngstarter-ui/components/input';
9
+ import * as i1 from '@angular/forms';
10
+ import { FormsModule } from '@angular/forms';
11
+
12
+ class ImageBlockComponent extends ContentEditorUploadBlockBase {
13
+ _src = signal('', /* @ts-ignore */
14
+ ...(ngDevMode ? [{ debugName: "_src" }] : /* istanbul ignore next */ []));
15
+ _alt = model('', /* @ts-ignore */
16
+ ...(ngDevMode ? [{ debugName: "_alt" }] : /* istanbul ignore next */ []));
17
+ _settings = model({}, /* @ts-ignore */
18
+ ...(ngDevMode ? [{ debugName: "_settings" }] : /* istanbul ignore next */ []));
19
+ constructor() {
20
+ super();
21
+ effect(() => {
22
+ const content = this.content();
23
+ const settings = this.settings();
24
+ untracked(() => {
25
+ this._src.set(content.src);
26
+ this._alt.set(content.alt);
27
+ this._settings.set({ ...settings });
28
+ });
29
+ });
30
+ }
31
+ ngOnInit() {
32
+ this._src.set(this.content().src);
33
+ this._alt.set(this.content().alt);
34
+ this._settings.set(this.settings() || {});
35
+ }
36
+ focus() {
37
+ if (this._src()) {
38
+ this.builder.focusBlock(this.id());
39
+ }
40
+ }
41
+ getData() {
42
+ return {
43
+ content: {
44
+ src: this._src(),
45
+ alt: this._alt()
46
+ },
47
+ settings: {
48
+ ...this._settings(),
49
+ }
50
+ };
51
+ }
52
+ isEmpty() {
53
+ const src = this.getData().content.src;
54
+ return typeof src === 'string' ? src.trim().length === 0 : !src;
55
+ }
56
+ onFileSelected(event) {
57
+ return this.uploadFiles('image', { files: event.files.slice(0, 1), accept: file => file.type.startsWith('image/'), apply: results => {
58
+ this._src.set(results[0].url);
59
+ this.update();
60
+ } });
61
+ }
62
+ _onAltChange() {
63
+ this.update();
64
+ }
65
+ _onImageResized(options) {
66
+ this._settings.set(options);
67
+ this.update();
68
+ }
69
+ handleKeyPress(event) {
70
+ if (event.key === 'Enter') {
71
+ event.preventDefault();
72
+ event.stopPropagation();
73
+ this.builder.insertEmptyBlock(this.index());
74
+ }
75
+ }
76
+ update() {
77
+ this.store.updateBlock(this.id(), { ...this.getData(), isEmpty: this.isEmpty() });
78
+ this.builder.emitContentChangeEvent();
79
+ }
80
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ImageBlockComponent, isStandalone: true, selector: "ngs-image-block", inputs: { _alt: { classPropertyName: "_alt", publicName: "_alt", isSignal: true, isRequired: false, transformFunction: null }, _settings: { classPropertyName: "_settings", publicName: "_settings", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { _alt: "_altChange", _settings: "_settingsChange" }, host: { listeners: { "keypress": "handleKeyPress($event)" } }, providers: [
82
+ {
83
+ provide: CONTENT_EDITOR_BLOCK,
84
+ useExisting: forwardRef(() => ImageBlockComponent),
85
+ multi: true
86
+ }
87
+ ], usesInheritance: true, ngImport: i0, template: "<ngs-content-editor-upload-status [task]=\"uploadTask\"/>\n@if (_src()) {\n <div class=\"uploaded-image\">\n <ngs-image-resizer (imageResized)=\"_onImageResized($event)\" [imageMaxWidth]=\"704\">\n <img [src]=\"_src()\" [alt]=\"_alt()\" ngsImageResizerImage [style.width.px]=\"_settings().width || null\">\n </ngs-image-resizer>\n </div>\n <ngs-form-field class=\"w-full mt-5\">\n <ngs-label>Alt text</ngs-label>\n <input ngsInput [(ngModel)]=\"_alt\" (ngModelChange)=\"_onAltChange()\">\n </ngs-form-field>\n} @else if (!uploading()) {\n <ngs-upload-area #uploadArea=\"ngsUploadArea\"\n ngsUploadTrigger accept=\"image/*\"\n (fileSelected)=\"onFileSelected($event)\"\n multiple=\"false\" class=\"upload-area\">\n @if (!uploadArea.api.isDropActive) {\n Drag & drop image here or click to upload\n } @else {\n <div class=\"font-medium\">Drop image here</div>\n }\n </ngs-upload-area>\n}\n", styles: ["@layer properties;:host{display:block;min-width:0}:host ngs-upload-area{--ngs-upload-area-padding: calc(var(--spacing, .25rem) * 6) calc(var(--spacing, .25rem) * 10)}:host img{max-width:100%}:host .upload-container{position:relative}:host .upload-overlay{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;background:#fffc}:host .progress-bar{position:absolute;inset-inline-start:calc(var(--spacing, .25rem) * 0);inset-inline-end:calc(var(--spacing, .25rem) * 0);top:0}:host .uploaded-image{display:flex;width:100%;max-width:704px;align-items:center;justify-content:center}:host .upload-overlay-text{background:#fff;border-radius:var(--radius-lg, .5rem);padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 1.5);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}:host .remove-button{position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * 2);top:calc(var(--spacing, .25rem) * 4);z-index:1;width:max-content}:host .upload-area{cursor:pointer}:host .upload-area:hover{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--ngs-color-primary)}@property --tw-outline-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-outline-style: solid}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: ContentEditorUploadStatus, selector: "ngs-content-editor-upload-status", inputs: ["task"] }, { kind: "component", type: UploadArea, selector: "ngs-upload-area", inputs: ["accept", "allowHover", "multiple"], outputs: ["fileSelected"], exportAs: ["ngsUploadArea"] }, { kind: "directive", type: UploadTriggerDirective, selector: "[ngsUploadTrigger]", inputs: ["accept", "multiple"], outputs: ["fileSelected"], exportAs: ["ngsUploadTrigger"] }, { kind: "component", type: ImageResizer, selector: "ngs-image-resizer", inputs: ["imageMaxWidth", "imageMinWidth"], outputs: ["imageResized"], exportAs: ["ngsImageResizer"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ImageResizerImageDirective, selector: "[ngsImageResizerImage]", exportAs: ["ngsImageResizerImage"] }, { kind: "component", type: Label, selector: "ngs-label" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
88
+ }
89
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageBlockComponent, decorators: [{
90
+ type: Component,
91
+ args: [{ selector: 'ngs-image-block', imports: [
92
+ ContentEditorUploadStatus,
93
+ UploadArea,
94
+ UploadTriggerDirective,
95
+ ImageResizer,
96
+ FormField,
97
+ Input,
98
+ FormsModule,
99
+ ImageResizerImageDirective,
100
+ Label
101
+ ], providers: [
102
+ {
103
+ provide: CONTENT_EDITOR_BLOCK,
104
+ useExisting: forwardRef(() => ImageBlockComponent),
105
+ multi: true
106
+ }
107
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
108
+ '(keypress)': 'handleKeyPress($event)',
109
+ }, template: "<ngs-content-editor-upload-status [task]=\"uploadTask\"/>\n@if (_src()) {\n <div class=\"uploaded-image\">\n <ngs-image-resizer (imageResized)=\"_onImageResized($event)\" [imageMaxWidth]=\"704\">\n <img [src]=\"_src()\" [alt]=\"_alt()\" ngsImageResizerImage [style.width.px]=\"_settings().width || null\">\n </ngs-image-resizer>\n </div>\n <ngs-form-field class=\"w-full mt-5\">\n <ngs-label>Alt text</ngs-label>\n <input ngsInput [(ngModel)]=\"_alt\" (ngModelChange)=\"_onAltChange()\">\n </ngs-form-field>\n} @else if (!uploading()) {\n <ngs-upload-area #uploadArea=\"ngsUploadArea\"\n ngsUploadTrigger accept=\"image/*\"\n (fileSelected)=\"onFileSelected($event)\"\n multiple=\"false\" class=\"upload-area\">\n @if (!uploadArea.api.isDropActive) {\n Drag & drop image here or click to upload\n } @else {\n <div class=\"font-medium\">Drop image here</div>\n }\n </ngs-upload-area>\n}\n", styles: ["@layer properties;:host{display:block;min-width:0}:host ngs-upload-area{--ngs-upload-area-padding: calc(var(--spacing, .25rem) * 6) calc(var(--spacing, .25rem) * 10)}:host img{max-width:100%}:host .upload-container{position:relative}:host .upload-overlay{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;background:#fffc}:host .progress-bar{position:absolute;inset-inline-start:calc(var(--spacing, .25rem) * 0);inset-inline-end:calc(var(--spacing, .25rem) * 0);top:0}:host .uploaded-image{display:flex;width:100%;max-width:704px;align-items:center;justify-content:center}:host .upload-overlay-text{background:#fff;border-radius:var(--radius-lg, .5rem);padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 1.5);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}:host .remove-button{position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * 2);top:calc(var(--spacing, .25rem) * 4);z-index:1;width:max-content}:host .upload-area{cursor:pointer}:host .upload-area:hover{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--ngs-color-primary)}@property --tw-outline-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-outline-style: solid}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
110
+ }], ctorParameters: () => [], propDecorators: { _alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "_alt", required: false }] }, { type: i0.Output, args: ["_altChange"] }], _settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "_settings", required: false }] }, { type: i0.Output, args: ["_settingsChange"] }] } });
111
+
112
+ export { ImageBlockComponent };
113
+ //# sourceMappingURL=ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs","sources":["../../../projects/components/content-editor/src/_builder/image-block/image-block.component.ts","../../../projects/components/content-editor/src/_builder/image-block/image-block.component.html"],"sourcesContent":["import { ContentEditorUploadBlockBase } from '../upload-block-base';\nimport { ContentEditorUploadStatus } from '../upload-status/upload-status';\nimport { ChangeDetectionStrategy, Component, effect, untracked, forwardRef, model, OnInit, signal } from '@angular/core';\nimport { UploadArea, UploadFileSelectedEvent, UploadTriggerDirective } from '@ngstarter-ui/components/upload';\nimport {\n CONTENT_EDITOR_BLOCK,\n ContentEditorImageBlockSettings,\n ContentEditorImageContent\n} from '../../types';\nimport { ImageResizer, ImageResizerImageDirective } from '@ngstarter-ui/components/image-resizer';\nimport { FormField, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { FormsModule } from '@angular/forms';\n\n@Component({\n selector: 'ngs-image-block',\n imports: [\n ContentEditorUploadStatus,\n UploadArea,\n UploadTriggerDirective,\n ImageResizer,\n FormField,\n Input,\n FormsModule,\n ImageResizerImageDirective,\n Label\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: forwardRef(() => ImageBlockComponent),\n multi: true\n }\n ],\n templateUrl: './image-block.component.html',\n styleUrl: './image-block.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(keypress)': 'handleKeyPress($event)',\n }\n})\nexport class ImageBlockComponent extends ContentEditorUploadBlockBase<ContentEditorImageContent, ContentEditorImageBlockSettings> implements OnInit {\n\n protected _src = signal<string>('');\n protected _alt = model<string>('');\n protected _settings = model<ContentEditorImageBlockSettings>({});\n\n constructor() {\n super();\n effect(() => {\n const content = this.content();\n const settings = this.settings();\n untracked(() => {\n this._src.set(content.src);\n this._alt.set(content.alt);\n this._settings.set({ ...settings });\n });\n });\n }\n\n ngOnInit() {\n this._src.set(this.content().src);\n this._alt.set(this.content().alt);\n this._settings.set(this.settings() || {});\n }\n\n override focus() {\n if (this._src()) {\n this.builder.focusBlock(this.id());\n }\n }\n\n override getData(): any {\n return {\n content: {\n src: this._src(),\n alt: this._alt()\n },\n settings: {\n ...this._settings(),\n }\n };\n }\n\n override isEmpty(): boolean {\n const src = this.getData().content.src;\n return typeof src === 'string' ? src.trim().length === 0 : !src;\n }\n\n protected onFileSelected(event: UploadFileSelectedEvent): Promise<void> {\n return this.uploadFiles('image', { files: event.files.slice(0, 1), accept: file => file.type.startsWith('image/'), apply: results => {\n this._src.set(results[0].url);\n this.update();\n } });\n }\n\n protected _onAltChange() {\n this.update();\n }\n\n protected _onImageResized(options: any) {\n this._settings.set(options);\n this.update();\n }\n\n protected handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n this.builder.insertEmptyBlock(this.index());\n }\n }\n\n private update() {\n this.store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this.builder.emitContentChangeEvent();\n }\n}\n","<ngs-content-editor-upload-status [task]=\"uploadTask\"/>\n@if (_src()) {\n <div class=\"uploaded-image\">\n <ngs-image-resizer (imageResized)=\"_onImageResized($event)\" [imageMaxWidth]=\"704\">\n <img [src]=\"_src()\" [alt]=\"_alt()\" ngsImageResizerImage [style.width.px]=\"_settings().width || null\">\n </ngs-image-resizer>\n </div>\n <ngs-form-field class=\"w-full mt-5\">\n <ngs-label>Alt text</ngs-label>\n <input ngsInput [(ngModel)]=\"_alt\" (ngModelChange)=\"_onAltChange()\">\n </ngs-form-field>\n} @else if (!uploading()) {\n <ngs-upload-area #uploadArea=\"ngsUploadArea\"\n ngsUploadTrigger accept=\"image/*\"\n (fileSelected)=\"onFileSelected($event)\"\n multiple=\"false\" class=\"upload-area\">\n @if (!uploadArea.api.isDropActive) {\n Drag & drop image here or click to upload\n } @else {\n <div class=\"font-medium\">Drop image here</div>\n }\n </ngs-upload-area>\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAyCM,MAAO,mBAAoB,SAAQ,4BAAwF,CAAA;IAErH,IAAI,GAAG,MAAM,CAAS,EAAE;6EAAC;IACzB,IAAI,GAAG,KAAK,CAAS,EAAE;6EAAC;IACxB,SAAS,GAAG,KAAK,CAAkC,EAAE;kFAAC;AAEhE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QACP,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAC9B,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE;YAChC,SAAS,CAAC,MAAK;gBACb,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;gBAC1B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;gBAC1B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC;AACrC,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC,CAAC;IACJ;IAEA,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC;AACjC,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,E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EAAA,CAAA,oiDAAA,CAAA,EAAA;;;;;"}
@@ -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-CK4ssnlk.mjs';
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-CR-NrarE.mjs';
2
2
  import * as i0 from '@angular/core';
3
3
  import { inject, PLATFORM_ID, ElementRef, input, output, Directive, signal, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
4
4
  import { isPlatformServer, NgTemplateOutlet } from '@angular/common';
@@ -232,4 +232,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
232
232
  }], ctorParameters: () => [], propDecorators: { 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 }] }] } });
233
233
 
234
234
  export { ListBlockComponent };
235
- //# sourceMappingURL=ngstarter-ui-components-content-editor-list-block.component-CdQ30RjA.mjs.map
235
+ //# sourceMappingURL=ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngstarter-ui-components-content-editor-list-block.component-CdQ30RjA.mjs","sources":["../../../projects/components/content-editor/src/content-observer.directive.ts","../../../projects/components/content-editor/src/_builder/list-block/list-block.component.ts","../../../projects/components/content-editor/src/_builder/list-block/list-block.component.html"],"sourcesContent":["import { Directive, ElementRef, inject, input, OnDestroy, OnInit, output, PLATFORM_ID } from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\n\n@Directive({\n selector: '[ngsContentObserver]'\n})\nexport class ContentObserverDirective implements OnInit, OnDestroy {\n private _platformId = inject(PLATFORM_ID);\n private _elementRef = inject(ElementRef);\n private _observer!: MutationObserver;\n\n detectAddedNode = input.required();\n\n readonly nodeAdded = output<HTMLElement>();\n\n ngOnInit() {\n if (isPlatformServer(this._platformId)) {\n return;\n }\n\n const config = { attributes: false, childList: true, subtree: false };\n const callback = (mutationList: any, observer: any) => {\n for (const mutation of mutationList) {\n if (mutation.type === 'childList') {\n const addedNode = mutation.addedNodes[0];\n\n if (addedNode && addedNode.tagName && addedNode.classList.contains(this.detectAddedNode())) {\n this.nodeAdded.emit(addedNode);\n }\n }\n }\n };\n this._observer = new MutationObserver(callback);\n this._observer.observe(this._elementRef.nativeElement, config);\n }\n\n ngOnDestroy() {\n this._observer?.disconnect();\n }\n}\n","import { NgsHeadlessEditorText } from '@ngstarter-ui/components/headless-editor';\nimport { contentEditorText, cloneContentEditorValue } from '../../document';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component, effect, untracked,\n DestroyRef,\n ElementRef,\n inject,\n input,\n OnInit,\n signal\n} from '@angular/core';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport {\n CONTENT_BUILDER, CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorItemProperty,\n ContentEditorListItem,\n ContentEditorListSettings\n} from '../../types';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ContentObserverDirective } from '../../content-observer.directive';\nimport { CursorController } from '../../utils/cursor-controller';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\n\n@Component({\n selector: 'ngs-list-block',\n exportAs: 'ngsListBlock',\n imports: [\n ContentEditorContentEditableDirective,\n NgTemplateOutlet,\n ContentObserverDirective\n ],\n templateUrl: './list-block.component.html',\n styleUrl: './list-block.component.scss',\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: ListBlockComponent,\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.list-bullet]': \"_listStyle() === 'bullet'\",\n '[class.list-ordered]': \"_listStyle() === 'ordered'\",\n }\n})\nexport class ListBlockComponent implements OnInit, ContentEditorDataBlock, AfterViewInit {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n\n id = input.required<string>();\n content = input.required<ContentEditorListItem[]>();\n settings = input.required<ContentEditorListSettings>();\n index = input.required<number>();\n props = input<ContentEditorItemProperty[]>([]);\n\n protected _placeholder = signal<string>('List item');\n protected _content = signal<ContentEditorListItem[]>([\n {\n content: [],\n props: [],\n children: []\n }\n ]);\n protected _listStyle = signal('');\n readonly initialized = signal(false);\n\n constructor() {\n effect(() => {\n const content = this.content();\n const settings = this.settings();\n untracked(() => {\n this._content.set(cloneContentEditorValue(content.length ? content : [{ content: [], props: [], children: [] }]));\n this._listStyle.set(settings.listStyle);\n });\n });\n }\n\n ngOnInit() {\n this._listStyle.set(this.settings().listStyle);\n\n if (this.content().length !== 0) {\n this._content.set(cloneContentEditorValue(this.content()));\n }\n }\n\n ngAfterViewInit() {\n this.initialized.set(true);\n }\n\n focus() {\n }\n\n protected onContentChanged(content: readonly NgsHeadlessEditorText[], list: ContentEditorListItem[], index: number) {\n if (!list[index]) {\n return;\n }\n\n list[index].content = content;\n this.update();\n }\n\n protected onPressedEnter(\n event: KeyboardEvent,\n contentEditable: ContentEditorContentEditableDirective,\n list: ContentEditorListItem[],\n index: number,\n level: number,\n parentItem: ContentEditorListItem | null,\n parentList: ContentEditorListItem[]\n ) {\n event.preventDefault();\n event.stopPropagation();\n\n if (level === 0) {\n const content = contentEditable.getContent();\n\n if (contentEditorText(content)) {\n list.splice(index + 1, 0, {\n content: [],\n props: [],\n styles: {},\n children: []\n });\n } else {\n list.splice(index, 1);\n\n if (list.length === 0) {\n this._contentBuilder.deleteBlock(this.id());\n }\n\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n } else {\n if (list[index] && !contentEditorText(list[index].content)) {\n list.splice(index, 1);\n const parentIndex = parentList.findIndex(item => item === parentItem);\n parentList.splice(parentIndex + 1, 0, {\n content: [],\n props: [],\n children: []\n });\n } else {\n list.splice(index + 1, 0, {\n content: [],\n props: [],\n styles: {},\n children: []\n });\n }\n }\n\n this.update();\n }\n\n getId(level: number, index: number): string {\n return 'item-level-' + (level + index + 2).toString();\n }\n\n getData(): any {\n return {\n content: this._content(),\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return !this._content().some(item => contentEditorText(item.content).trim() || item.children.length > 0);\n }\n\n protected _onNodeAdded(node: HTMLElement) {\n this._focusItem(node.querySelector('.list-item-content') as HTMLElement);\n }\n\n protected _focusItem(element: HTMLElement) {\n const cursorController = new CursorController(element);\n cursorController.setToEnd();\n }\n\n protected _onKeyDown(\n event: KeyboardEvent,\n contentEditable: ContentEditorContentEditableDirective,\n list: ContentEditorListItem[],\n index: number,\n level: number,\n parentItem: ContentEditorListItem | null,\n parentList: ContentEditorListItem[],\n listItem: HTMLElement\n ) {\n if (event.key === 'Backspace' && !contentEditorText(contentEditable.getContent())) {\n const latestElementInParentList = (listItem.closest('.list') as HTMLElement)?.parentNode;\n list.splice(index, 1);\n const prevElement = listItem.previousSibling as HTMLElement;\n\n if (prevElement) {\n this._focusItem(prevElement.querySelector('.list-item-content') as HTMLElement);\n } else {\n if (latestElementInParentList) {\n this._focusItem(latestElementInParentList.querySelector('.list-item-content') as HTMLElement);\n }\n }\n } else if (event.key === 'Tab') {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.shiftKey && parentItem) {\n const cached = JSON.parse(JSON.stringify(list[index]));\n list.splice(index, 1);\n const parentIndex = parentList.findIndex(item => item === parentItem);\n parentList.splice(parentIndex + 1, 0, cached);\n } else {\n if (list[index - 1]) {\n const cached = JSON.parse(JSON.stringify(list[index]));\n list.splice(index, 1);\n list[index - 1].children.push(cached);\n }\n }\n }\n\n if (level === 0 && list.length === 0) {\n this._contentBuilder.deleteBlock(this.id());\n }\n\n this.update();\n }\n\n onPropsChanged(props: ContentEditorItemProperty[], item: any) {\n item.props = props;\n this.update();\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<ul class=\"list\"\n ngsContentObserver\n detectAddedNode=\"list-item\"\n (nodeAdded)=\"_onNodeAdded($event)\">\n <ng-container [ngTemplateOutlet]=\"listTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: _content(), level: 0, parentItem: null, parentList: [] }\"/>\n</ul>\n\n<ng-template #listTpl let-list let-level=\"level\" let-parentItem=\"parentItem\" let-parentList=\"parentList\">\n @for (item of list; track $index; let index = $index) {\n <li #listItem class=\"list-item\" [attr.id]=\"getId(level, index)\">\n <div [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"item.content\"\n [props]=\"item.props\"\n (propsChanged)=\"onPropsChanged($event, item)\"\n #contentEditable=\"ngsContentEditorContentEditable\"\n class=\"list-item-content\"\n (contentChanged)=\"onContentChanged($event, list, index)\"\n (pressedEnter)=\"onPressedEnter($event, contentEditable, list, index, level, parentItem, parentList)\"\n (keydown)=\"_onKeyDown($event, contentEditable, list, index, level, parentItem, parentList, listItem)\"\n [attr.data-empty-placeholder]=\"_placeholder()\"></div>\n @if (item.children.length > 0) {\n <ol class=\"list\"\n ngsContentObserver\n detectAddedNode=\"list-item\"\n (nodeAdded)=\"_onNodeAdded($event)\">\n <ng-container [ngTemplateOutlet]=\"listTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: item.children, level: level + 1, parentItem: item, parentList: list }\"/>\n </ol>\n }\n </li>\n }\n</ng-template>\n"],"names":[],"mappings":";;;;;;MAMa,wBAAwB,CAAA;AAC3B,I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rC,gBAAgB;wBAChB;qBACD,EAAA,SAAA,EAGU;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,oBAAoB;AAC7B,4BAAA,WAAW,EAAA,kBAAoB;AAC/B,4BAAA,KAAK,EAAE;AACR;qBACF,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,qBAAqB,EAAE,2BAA2B;AAClD,wBAAA,sBAAsB,EAAE,4BAA4B;AACrD,qBAAA,EAAA,QAAA,EAAA,2nDAAA,EAAA,MAAA,EAAA,CAAA,koBAAA,CAAA,EAAA;;;;;"}
1
+ {"version":3,"file":"ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs","sources":["../../../projects/components/content-editor/src/content-observer.directive.ts","../../../projects/components/content-editor/src/_builder/list-block/list-block.component.ts","../../../projects/components/content-editor/src/_builder/list-block/list-block.component.html"],"sourcesContent":["import { Directive, ElementRef, inject, input, OnDestroy, OnInit, output, PLATFORM_ID } from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\n\n@Directive({\n selector: '[ngsContentObserver]'\n})\nexport class ContentObserverDirective implements OnInit, OnDestroy {\n private _platformId = inject(PLATFORM_ID);\n private _elementRef = inject(ElementRef);\n private _observer!: MutationObserver;\n\n detectAddedNode = input.required();\n\n readonly nodeAdded = output<HTMLElement>();\n\n ngOnInit() {\n if (isPlatformServer(this._platformId)) {\n return;\n }\n\n const config = { attributes: false, childList: true, subtree: false };\n const callback = (mutationList: any, observer: any) => {\n for (const mutation of mutationList) {\n if (mutation.type === 'childList') {\n const addedNode = mutation.addedNodes[0];\n\n if (addedNode && addedNode.tagName && addedNode.classList.contains(this.detectAddedNode())) {\n this.nodeAdded.emit(addedNode);\n }\n }\n }\n };\n this._observer = new MutationObserver(callback);\n this._observer.observe(this._elementRef.nativeElement, config);\n }\n\n ngOnDestroy() {\n this._observer?.disconnect();\n }\n}\n","import { NgsHeadlessEditorText } from '@ngstarter-ui/components/headless-editor';\nimport { contentEditorText, cloneContentEditorValue } from '../../document';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component, effect, untracked,\n DestroyRef,\n ElementRef,\n inject,\n input,\n OnInit,\n signal\n} from '@angular/core';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport {\n CONTENT_BUILDER, CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorItemProperty,\n ContentEditorListItem,\n ContentEditorListSettings\n} from '../../types';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ContentObserverDirective } from '../../content-observer.directive';\nimport { CursorController } from '../../utils/cursor-controller';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\n\n@Component({\n selector: 'ngs-list-block',\n exportAs: 'ngsListBlock',\n imports: [\n ContentEditorContentEditableDirective,\n NgTemplateOutlet,\n ContentObserverDirective\n ],\n templateUrl: './list-block.component.html',\n styleUrl: './list-block.component.scss',\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: ListBlockComponent,\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.list-bullet]': \"_listStyle() === 'bullet'\",\n '[class.list-ordered]': \"_listStyle() === 'ordered'\",\n }\n})\nexport class ListBlockComponent implements OnInit, ContentEditorDataBlock, AfterViewInit {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n\n id = input.required<string>();\n content = input.required<ContentEditorListItem[]>();\n settings = input.required<ContentEditorListSettings>();\n index = input.required<number>();\n props = input<ContentEditorItemProperty[]>([]);\n\n protected _placeholder = signal<string>('List item');\n protected _content = signal<ContentEditorListItem[]>([\n {\n content: [],\n props: [],\n children: []\n }\n ]);\n protected _listStyle = signal('');\n readonly initialized = signal(false);\n\n constructor() {\n effect(() => {\n const content = this.content();\n const settings = this.settings();\n untracked(() => {\n this._content.set(cloneContentEditorValue(content.length ? content : [{ content: [], props: [], children: [] }]));\n this._listStyle.set(settings.listStyle);\n });\n });\n }\n\n ngOnInit() {\n this._listStyle.set(this.settings().listStyle);\n\n if (this.content().length !== 0) {\n this._content.set(cloneContentEditorValue(this.content()));\n }\n }\n\n ngAfterViewInit() {\n this.initialized.set(true);\n }\n\n focus() {\n }\n\n protected onContentChanged(content: readonly NgsHeadlessEditorText[], list: ContentEditorListItem[], index: number) {\n if (!list[index]) {\n return;\n }\n\n list[index].content = content;\n this.update();\n }\n\n protected onPressedEnter(\n event: KeyboardEvent,\n contentEditable: ContentEditorContentEditableDirective,\n list: ContentEditorListItem[],\n index: number,\n level: number,\n parentItem: ContentEditorListItem | null,\n parentList: ContentEditorListItem[]\n ) {\n event.preventDefault();\n event.stopPropagation();\n\n if (level === 0) {\n const content = contentEditable.getContent();\n\n if (contentEditorText(content)) {\n list.splice(index + 1, 0, {\n content: [],\n props: [],\n styles: {},\n children: []\n });\n } else {\n list.splice(index, 1);\n\n if (list.length === 0) {\n this._contentBuilder.deleteBlock(this.id());\n }\n\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n } else {\n if (list[index] && !contentEditorText(list[index].content)) {\n list.splice(index, 1);\n const parentIndex = parentList.findIndex(item => item === parentItem);\n parentList.splice(parentIndex + 1, 0, {\n content: [],\n props: [],\n children: []\n });\n } else {\n list.splice(index + 1, 0, {\n content: [],\n props: [],\n styles: {},\n children: []\n });\n }\n }\n\n this.update();\n }\n\n getId(level: number, index: number): string {\n return 'item-level-' + (level + index + 2).toString();\n }\n\n getData(): any {\n return {\n content: this._content(),\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return !this._content().some(item => contentEditorText(item.content).trim() || item.children.length > 0);\n }\n\n protected _onNodeAdded(node: HTMLElement) {\n this._focusItem(node.querySelector('.list-item-content') as HTMLElement);\n }\n\n protected _focusItem(element: HTMLElement) {\n const cursorController = new CursorController(element);\n cursorController.setToEnd();\n }\n\n protected _onKeyDown(\n event: KeyboardEvent,\n contentEditable: ContentEditorContentEditableDirective,\n list: ContentEditorListItem[],\n index: number,\n level: number,\n parentItem: ContentEditorListItem | null,\n parentList: ContentEditorListItem[],\n listItem: HTMLElement\n ) {\n if (event.key === 'Backspace' && !contentEditorText(contentEditable.getContent())) {\n const latestElementInParentList = (listItem.closest('.list') as HTMLElement)?.parentNode;\n list.splice(index, 1);\n const prevElement = listItem.previousSibling as HTMLElement;\n\n if (prevElement) {\n this._focusItem(prevElement.querySelector('.list-item-content') as HTMLElement);\n } else {\n if (latestElementInParentList) {\n this._focusItem(latestElementInParentList.querySelector('.list-item-content') as HTMLElement);\n }\n }\n } else if (event.key === 'Tab') {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.shiftKey && parentItem) {\n const cached = JSON.parse(JSON.stringify(list[index]));\n list.splice(index, 1);\n const parentIndex = parentList.findIndex(item => item === parentItem);\n parentList.splice(parentIndex + 1, 0, cached);\n } else {\n if (list[index - 1]) {\n const cached = JSON.parse(JSON.stringify(list[index]));\n list.splice(index, 1);\n list[index - 1].children.push(cached);\n }\n }\n }\n\n if (level === 0 && list.length === 0) {\n this._contentBuilder.deleteBlock(this.id());\n }\n\n this.update();\n }\n\n onPropsChanged(props: ContentEditorItemProperty[], item: any) {\n item.props = props;\n this.update();\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<ul class=\"list\"\n ngsContentObserver\n detectAddedNode=\"list-item\"\n (nodeAdded)=\"_onNodeAdded($event)\">\n <ng-container [ngTemplateOutlet]=\"listTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: _content(), level: 0, parentItem: null, parentList: [] }\"/>\n</ul>\n\n<ng-template #listTpl let-list let-level=\"level\" let-parentItem=\"parentItem\" let-parentList=\"parentList\">\n @for (item of list; track $index; let index = $index) {\n <li #listItem class=\"list-item\" [attr.id]=\"getId(level, index)\">\n <div [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"item.content\"\n [props]=\"item.props\"\n (propsChanged)=\"onPropsChanged($event, item)\"\n #contentEditable=\"ngsContentEditorContentEditable\"\n class=\"list-item-content\"\n (contentChanged)=\"onContentChanged($event, list, index)\"\n (pressedEnter)=\"onPressedEnter($event, contentEditable, list, index, level, parentItem, parentList)\"\n (keydown)=\"_onKeyDown($event, contentEditable, list, index, level, parentItem, parentList, listItem)\"\n [attr.data-empty-placeholder]=\"_placeholder()\"></div>\n @if (item.children.length > 0) {\n <ol class=\"list\"\n ngsContentObserver\n detectAddedNode=\"list-item\"\n (nodeAdded)=\"_onNodeAdded($event)\">\n <ng-container [ngTemplateOutlet]=\"listTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: item.children, level: level + 1, parentItem: item, parentList: list }\"/>\n </ol>\n }\n </li>\n }\n</ng-template>\n"],"names":[],"mappings":";;;;;;MAMa,wBAAwB,CAAA;AAC3B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,SAAS;IAEjB,eAAe,GAAG,KAAK,CAAC,QAAQ;wFAAE;IAEzB,SAAS,GAAG,MAAM,EAAe;IAE1C,QAAQ,GAAA;AACN,QAAA,IAAI,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;YACtC;QACF;AAEA,QAAA,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;AACrE,QAAA,MAAM,QAAQ,GAAG,CAAC,YAAiB,EAAE,QAAa,KAAI;AACpD,YAAA,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;AACnC,gBAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,EAAE;oBACjC,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;AAExC,oBAAA,IAAI,SAAS,IAAI,SAAS,CAAC,OAAO,IA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AAA,MAAA,EAAA,CAAA,iCAAA,EAAA,UAAA,EAAA,OAAA,EAAA,YAAA,CAAA,EAAA,OAAA,EAAA,CAAA,gBAAA,EAAA,cAAA,EAAA,cAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,iCAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACrC,gBAAgB,oJAChB,wBAAwB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAiBf,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAvB9B,SAAS;+BACE,gBAAgB,EAAA,QAAA,EAChB,cAAc,EAAA,OAAA,EACf;wBACP,qCAAqC;wBACrC,gBAAgB;wBAChB;qBACD,EAAA,SAAA,EAGU;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,oBAAoB;AAC7B,4BAAA,WAAW,EAAA,kBAAoB;AAC/B,4BAAA,KAAK,EAAE;AACR;qBACF,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,qBAAqB,EAAE,2BAA2B;AAClD,wBAAA,sBAAsB,EAAE,4BAA4B;AACrD,qBAAA,EAAA,QAAA,EAAA,2nDAAA,EAAA,MAAA,EAAA,CAAA,koBAAA,CAAA,EAAA;;;;;"}
@@ -5,7 +5,7 @@ import { CdkDropList, CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';
5
5
  import { Button } from '@ngstarter-ui/components/button';
6
6
  import { Icon } from '@ngstarter-ui/components/icon';
7
7
  import { Menu, MenuItem, MenuTrigger } from '@ngstarter-ui/components/menu';
8
- import { a as CONTENT_BUILDER, C as ContentBuilderStore, k as contentEditorCollection, l as contentEditorBlockView, c as cloneContentEditorValue, m as contentEditorChildCollections, h as findContentEditorBlock } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs';
8
+ import { a as CONTENT_BUILDER, C as ContentBuilderStore, m as contentEditorCollection, n as contentEditorBlockView, c as cloneContentEditorValue, o as contentEditorChildCollections, k as findContentEditorBlock } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs';
9
9
  import { createNgsHeadlessEditorId } from '@ngstarter-ui/components/headless-editor';
10
10
 
11
11
  class ContentEditorNestedBlocks {
@@ -106,12 +106,12 @@ class ContentEditorNestedBlocks {
106
106
  }
107
107
  }
108
108
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorNestedBlocks, deps: [], target: i0.ɵɵFactoryTarget.Component });
109
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ContentEditorNestedBlocks, isStandalone: true, selector: "ngs-content-editor-nested-blocks", inputs: { scope: { classPropertyName: "scope", publicName: "scope", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown": "onKeyDown($event)" } }, providers: [{ provide: CONTENT_BUILDER, useExisting: forwardRef(() => ContentEditorNestedBlocks) }], viewQueries: [{ propertyName: "dropList", first: true, predicate: CdkDropList, descendants: true, isSignal: true }], ngImport: i0, template: "<div cdkDropList [cdkDropListData]=\"scope()\" [cdkDropListConnectedTo]=\"connectedDropLists()\" [cdkDropListEnterPredicate]=\"canEnter\" (cdkDropListDropped)=\"drop($event)\" class=\"min-h-12\">\n @for (block of renderedBlocks(); track block.id) {\n <div cdkDrag [cdkDragData]=\"block.id\" (cdkDragStarted)=\"onDragStarted()\" (cdkDragEnded)=\"onDragEnded()\" class=\"nested-block relative min-w-0 py-2\" [attr.data-block-id]=\"block.id\">\n <div class=\"nested-controls block-controls absolute top-1/2 z-10 flex -translate-y-1/2 items-center\"\n [class.is-menu-open]=\"addTrigger.menuOpen() || actionsTrigger.menuOpen()\">\n <button ngsIconButton aria-label=\"Add block\" #addTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"rootBuilder.blockMenu()\" [ngsMenuTriggerRestoreFocus]=\"false\"\n [ngsMenuTriggerData]=\"{target: {scope: scope(), afterId: block.id}}\">\n <ngs-icon name=\"fluent:add-24-regular\"/>\n </button>\n <button ngsIconButton cdkDragHandle [ngsMenuTriggerFor]=\"blockMenu\"\n #actionsTrigger=\"ngsMenuTrigger\" aria-label=\"Move block\"><ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/></button>\n <ngs-menu #blockMenu>\n <button ngs-menu-item (click)=\"duplicateBlock(block.id)\">Duplicate</button>\n <button ngs-menu-item (click)=\"deleteBlock(block.id)\">Delete</button>\n </ngs-menu>\n </div>\n <div class=\"min-w-0\">\n <ng-container [ngComponentOutlet]=\"getBlockComponent(block.type) | async\"\n [ngComponentOutletInputs]=\"{id: block.id, content: block.content, settings: block.settings, props: block.props, index: $index}\"/>\n </div>\n </div>\n }\n</div>\n", styles: [":host{--ngs-content-editor-nested-controls-offset: 0px;display:block;min-width:0}:host .nested-controls{--ngs-button-height: calc(var(--spacing, .25rem) * 7);right:100%;width:calc(calc(var(--spacing, .25rem) * 18) + var(--ngs-content-editor-nested-controls-offset));padding-left:calc(var(--spacing, .25rem) * 2);padding-right:calc(calc(var(--spacing, .25rem) * 2) + var(--ngs-content-editor-nested-controls-offset));opacity:0;pointer-events:none}:host .nested-controls.is-menu-open{opacity:1;pointer-events:auto}:host .nested-block:hover .nested-controls,:host .nested-block:focus-within .nested-controls{opacity:1;pointer-events:auto}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: Menu, selector: "ngs-menu", inputs: ["role", "classList", "xPosition", "yPosition", "pushIntoViewport"], outputs: ["closed"], exportAs: ["ngsMenu"] }, { kind: "component", type: MenuItem, selector: "ngs-menu-item, [ngs-menu-item]", inputs: ["disabled", "role", "selected"], outputs: ["_triggered"], exportAs: ["ngsMenuItem"] }, { kind: "directive", type: MenuTrigger, selector: "[ngsMenuTriggerFor]", inputs: ["ngsMenuTriggerFor", "ngsMenuTriggerData", "ngsMenuDisabled", "xPosition", "yPosition", "ngsMenuTriggerRestoreFocus"], outputs: ["menuOpened", "menuClosed"], exportAs: ["ngsMenuTrigger"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
109
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ContentEditorNestedBlocks, isStandalone: true, selector: "ngs-content-editor-nested-blocks", inputs: { scope: { classPropertyName: "scope", publicName: "scope", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown": "onKeyDown($event)" } }, providers: [{ provide: CONTENT_BUILDER, useExisting: forwardRef(() => ContentEditorNestedBlocks) }], viewQueries: [{ propertyName: "dropList", first: true, predicate: CdkDropList, descendants: true, isSignal: true }], ngImport: i0, template: "<div cdkDropList [cdkDropListData]=\"scope()\" [cdkDropListConnectedTo]=\"connectedDropLists()\" [cdkDropListEnterPredicate]=\"canEnter\" (cdkDropListDropped)=\"drop($event)\" class=\"min-h-12\">\n @for (block of renderedBlocks(); track block.id) {\n <div cdkDrag [cdkDragData]=\"block.id\" (cdkDragStarted)=\"onDragStarted()\" (cdkDragEnded)=\"onDragEnded()\" class=\"nested-block relative min-w-0 py-2\" [attr.data-block-id]=\"block.id\">\n <div class=\"nested-controls block-controls absolute top-1/2 z-10 flex -translate-y-1/2 items-center\"\n [class.is-menu-open]=\"addTrigger.menuOpen() || actionsTrigger.menuOpen()\">\n <button ngsIconButton aria-label=\"Add block\" #addTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"rootBuilder.blockMenu()\" [ngsMenuTriggerRestoreFocus]=\"false\"\n [ngsMenuTriggerData]=\"{target: {scope: scope(), afterId: block.id}}\">\n <ngs-icon name=\"fluent:add-24-regular\"/>\n </button>\n <button ngsIconButton cdkDragHandle [ngsMenuTriggerFor]=\"blockMenu\"\n #actionsTrigger=\"ngsMenuTrigger\" aria-label=\"Move block\"><ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/></button>\n <ngs-menu #blockMenu>\n @if (rootBuilder.canConvertBlock(block.id)) {\n <button ngs-menu-item [ngsMenuTriggerFor]=\"rootBuilder.conversionMenu()\" [ngsMenuTriggerData]=\"{blockId: block.id}\" [ngsMenuTriggerRestoreFocus]=\"false\">Turn into</button>\n }\n <button ngs-menu-item (click)=\"duplicateBlock(block.id)\">Duplicate</button>\n <button ngs-menu-item (click)=\"deleteBlock(block.id)\">Delete</button>\n </ngs-menu>\n </div>\n <div class=\"min-w-0\">\n <ng-container [ngComponentOutlet]=\"getBlockComponent(block.type) | async\"\n [ngComponentOutletInputs]=\"{id: block.id, content: block.content, settings: block.settings, props: block.props, index: $index}\"/>\n </div>\n </div>\n }\n</div>\n", styles: [":host{--ngs-content-editor-nested-controls-offset: 0px;display:block;min-width:0}:host .nested-controls{--ngs-button-height: calc(var(--spacing, .25rem) * 7);right:100%;width:calc(calc(var(--spacing, .25rem) * 18) + var(--ngs-content-editor-nested-controls-offset));padding-left:calc(var(--spacing, .25rem) * 2);padding-right:calc(calc(var(--spacing, .25rem) * 2) + var(--ngs-content-editor-nested-controls-offset));opacity:0;pointer-events:none}:host .nested-controls.is-menu-open{opacity:1;pointer-events:auto}:host .nested-block:hover .nested-controls,:host .nested-block:focus-within .nested-controls{opacity:1;pointer-events:auto}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: Menu, selector: "ngs-menu", inputs: ["role", "classList", "xPosition", "yPosition", "pushIntoViewport"], outputs: ["closed"], exportAs: ["ngsMenu"] }, { kind: "component", type: MenuItem, selector: "ngs-menu-item, [ngs-menu-item]", inputs: ["disabled", "role", "selected"], outputs: ["_triggered"], exportAs: ["ngsMenuItem"] }, { kind: "directive", type: MenuTrigger, selector: "[ngsMenuTriggerFor]", inputs: ["ngsMenuTriggerFor", "ngsMenuTriggerData", "ngsMenuDisabled", "xPosition", "yPosition", "ngsMenuTriggerRestoreFocus"], outputs: ["menuOpened", "menuClosed"], exportAs: ["ngsMenuTrigger"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
110
110
  }
111
111
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorNestedBlocks, decorators: [{
112
112
  type: Component,
113
- args: [{ selector: 'ngs-content-editor-nested-blocks', imports: [AsyncPipe, NgComponentOutlet, CdkDrag, CdkDragHandle, CdkDropList, Button, Icon, Menu, MenuItem, MenuTrigger], providers: [{ provide: CONTENT_BUILDER, useExisting: forwardRef(() => ContentEditorNestedBlocks) }], changeDetection: ChangeDetectionStrategy.OnPush, host: { '(keydown)': 'onKeyDown($event)' }, template: "<div cdkDropList [cdkDropListData]=\"scope()\" [cdkDropListConnectedTo]=\"connectedDropLists()\" [cdkDropListEnterPredicate]=\"canEnter\" (cdkDropListDropped)=\"drop($event)\" class=\"min-h-12\">\n @for (block of renderedBlocks(); track block.id) {\n <div cdkDrag [cdkDragData]=\"block.id\" (cdkDragStarted)=\"onDragStarted()\" (cdkDragEnded)=\"onDragEnded()\" class=\"nested-block relative min-w-0 py-2\" [attr.data-block-id]=\"block.id\">\n <div class=\"nested-controls block-controls absolute top-1/2 z-10 flex -translate-y-1/2 items-center\"\n [class.is-menu-open]=\"addTrigger.menuOpen() || actionsTrigger.menuOpen()\">\n <button ngsIconButton aria-label=\"Add block\" #addTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"rootBuilder.blockMenu()\" [ngsMenuTriggerRestoreFocus]=\"false\"\n [ngsMenuTriggerData]=\"{target: {scope: scope(), afterId: block.id}}\">\n <ngs-icon name=\"fluent:add-24-regular\"/>\n </button>\n <button ngsIconButton cdkDragHandle [ngsMenuTriggerFor]=\"blockMenu\"\n #actionsTrigger=\"ngsMenuTrigger\" aria-label=\"Move block\"><ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/></button>\n <ngs-menu #blockMenu>\n <button ngs-menu-item (click)=\"duplicateBlock(block.id)\">Duplicate</button>\n <button ngs-menu-item (click)=\"deleteBlock(block.id)\">Delete</button>\n </ngs-menu>\n </div>\n <div class=\"min-w-0\">\n <ng-container [ngComponentOutlet]=\"getBlockComponent(block.type) | async\"\n [ngComponentOutletInputs]=\"{id: block.id, content: block.content, settings: block.settings, props: block.props, index: $index}\"/>\n </div>\n </div>\n }\n</div>\n", styles: [":host{--ngs-content-editor-nested-controls-offset: 0px;display:block;min-width:0}:host .nested-controls{--ngs-button-height: calc(var(--spacing, .25rem) * 7);right:100%;width:calc(calc(var(--spacing, .25rem) * 18) + var(--ngs-content-editor-nested-controls-offset));padding-left:calc(var(--spacing, .25rem) * 2);padding-right:calc(calc(var(--spacing, .25rem) * 2) + var(--ngs-content-editor-nested-controls-offset));opacity:0;pointer-events:none}:host .nested-controls.is-menu-open{opacity:1;pointer-events:auto}:host .nested-block:hover .nested-controls,:host .nested-block:focus-within .nested-controls{opacity:1;pointer-events:auto}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
113
+ args: [{ selector: 'ngs-content-editor-nested-blocks', imports: [AsyncPipe, NgComponentOutlet, CdkDrag, CdkDragHandle, CdkDropList, Button, Icon, Menu, MenuItem, MenuTrigger], providers: [{ provide: CONTENT_BUILDER, useExisting: forwardRef(() => ContentEditorNestedBlocks) }], changeDetection: ChangeDetectionStrategy.OnPush, host: { '(keydown)': 'onKeyDown($event)' }, template: "<div cdkDropList [cdkDropListData]=\"scope()\" [cdkDropListConnectedTo]=\"connectedDropLists()\" [cdkDropListEnterPredicate]=\"canEnter\" (cdkDropListDropped)=\"drop($event)\" class=\"min-h-12\">\n @for (block of renderedBlocks(); track block.id) {\n <div cdkDrag [cdkDragData]=\"block.id\" (cdkDragStarted)=\"onDragStarted()\" (cdkDragEnded)=\"onDragEnded()\" class=\"nested-block relative min-w-0 py-2\" [attr.data-block-id]=\"block.id\">\n <div class=\"nested-controls block-controls absolute top-1/2 z-10 flex -translate-y-1/2 items-center\"\n [class.is-menu-open]=\"addTrigger.menuOpen() || actionsTrigger.menuOpen()\">\n <button ngsIconButton aria-label=\"Add block\" #addTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"rootBuilder.blockMenu()\" [ngsMenuTriggerRestoreFocus]=\"false\"\n [ngsMenuTriggerData]=\"{target: {scope: scope(), afterId: block.id}}\">\n <ngs-icon name=\"fluent:add-24-regular\"/>\n </button>\n <button ngsIconButton cdkDragHandle [ngsMenuTriggerFor]=\"blockMenu\"\n #actionsTrigger=\"ngsMenuTrigger\" aria-label=\"Move block\"><ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/></button>\n <ngs-menu #blockMenu>\n @if (rootBuilder.canConvertBlock(block.id)) {\n <button ngs-menu-item [ngsMenuTriggerFor]=\"rootBuilder.conversionMenu()\" [ngsMenuTriggerData]=\"{blockId: block.id}\" [ngsMenuTriggerRestoreFocus]=\"false\">Turn into</button>\n }\n <button ngs-menu-item (click)=\"duplicateBlock(block.id)\">Duplicate</button>\n <button ngs-menu-item (click)=\"deleteBlock(block.id)\">Delete</button>\n </ngs-menu>\n </div>\n <div class=\"min-w-0\">\n <ng-container [ngComponentOutlet]=\"getBlockComponent(block.type) | async\"\n [ngComponentOutletInputs]=\"{id: block.id, content: block.content, settings: block.settings, props: block.props, index: $index}\"/>\n </div>\n </div>\n }\n</div>\n", styles: [":host{--ngs-content-editor-nested-controls-offset: 0px;display:block;min-width:0}:host .nested-controls{--ngs-button-height: calc(var(--spacing, .25rem) * 7);right:100%;width:calc(calc(var(--spacing, .25rem) * 18) + var(--ngs-content-editor-nested-controls-offset));padding-left:calc(var(--spacing, .25rem) * 2);padding-right:calc(calc(var(--spacing, .25rem) * 2) + var(--ngs-content-editor-nested-controls-offset));opacity:0;pointer-events:none}:host .nested-controls.is-menu-open{opacity:1;pointer-events:auto}:host .nested-block:hover .nested-controls,:host .nested-block:focus-within .nested-controls{opacity:1;pointer-events:auto}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
114
114
  }], ctorParameters: () => [], propDecorators: { dropList: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkDropList), { isSignal: true }] }], scope: [{ type: i0.Input, args: [{ isSignal: true, alias: "scope", required: true }] }] } });
115
115
 
116
116
  export { ContentEditorNestedBlocks as C };
117
- //# sourceMappingURL=ngstarter-ui-components-content-editor-nested-blocks-CbZY0keH.mjs.map
117
+ //# sourceMappingURL=ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs","sources":["../../../projects/components/content-editor/src/_builder/nested-blocks/nested-blocks.ts","../../../projects/components/content-editor/src/_builder/nested-blocks/nested-blocks.html"],"sourcesContent":["import { AsyncPipe, DOCUMENT, NgComponentOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, EventEmitter, afterNextRender, computed, effect, forwardRef, inject, input, signal, viewChild } from '@angular/core';\nimport { CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList } from '@angular/cdk/drag-drop';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport { Menu, MenuItem, MenuTrigger } from '@ngstarter-ui/components/menu';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport { CONTENT_BUILDER, ContentEditorBlockScope, ContentEditorBlockView } from '../../types';\nimport { cloneContentEditorValue, contentEditorBlockView, contentEditorCollection, contentEditorChildCollections, findContentEditorBlock } from '../../document';\nimport { createNgsHeadlessEditorId } from '@ngstarter-ui/components/headless-editor';\n\n@Component({\n selector: 'ngs-content-editor-nested-blocks',\n imports: [AsyncPipe, NgComponentOutlet, CdkDrag, CdkDragHandle, CdkDropList, Button, Icon, Menu, MenuItem, MenuTrigger],\n providers: [{ provide: CONTENT_BUILDER, useExisting: forwardRef(() => ContentEditorNestedBlocks) }],\n templateUrl: './nested-blocks.html', styleUrl: './nested-blocks.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '(keydown)': 'onKeyDown($event)' }\n})\nexport class ContentEditorNestedBlocks {\n private readonly parent = inject<ContentBuilderComponent>(CONTENT_BUILDER, { skipSelf: true });\n private readonly store = inject(ContentBuilderStore);\n private readonly document = inject(DOCUMENT);\n private readonly dropList = viewChild.required(CdkDropList);\n readonly connectedDropLists = this.store.dropLists;\n readonly scope = input.required<ContentEditorBlockScope>();\n readonly emptyBlock = signal(this.rootBuilder.createBlockView('paragraph'));\n readonly focusChanged = new EventEmitter<void>();\n constructor() {\n effect(() => {\n if (this.blocks().some(block => block.id === this.emptyBlock().id)) this.emptyBlock.set(this.rootBuilder.createBlockView('paragraph'));\n });\n let registered: CdkDropList<ContentEditorBlockScope> | null = null;\n afterNextRender(() => { registered = this.dropList(); this.store.registerDropList(registered); });\n inject(DestroyRef).onDestroy(() => { if (registered) this.store.unregisterDropList(registered); });\n }\n get rootBuilder(): ContentBuilderComponent { return this.parent.rootBuilder; }\n readonly blocks = computed(() => contentEditorCollection(this.store.editor.document().blocks, this.scope()).map(contentEditorBlockView));\n readonly renderedBlocks = computed(() => {\n const blocks = this.blocks();\n return blocks.length ? blocks : [this.emptyBlock()];\n });\n getBlockComponent(type: string): any { return this.rootBuilder.getBlockComponent(type); }\n getBlockDefOption(type: string, key: string): any { return this.rootBuilder.getBlockDefOption(type, key); }\n emitContentChangeEvent(): void {}\n focusBlock(id: string | null): void { this.store.setFocusedBlockId(id); this.focusChanged.emit(); }\n insertEmptyBlock(index: number): void { this.addBlock('paragraph', {}, index + 1); }\n updateParagraph(id: string, data: Partial<ContentEditorBlockView>): void {\n if (this.blocks().some(block => block.id === id)) this.store.updateBlock(id, data);\n else if (id === this.emptyBlock().id) this.store.addBlock({ ...this.emptyBlock(), ...data }, this.blocks().length, this.scope());\n }\n addBlock(type: string, settings = {}, index = this.blocks().length): void {\n const block = this.rootBuilder.createBlockView(type, settings);\n this.store.addBlock(block, index, this.scope());\n this.focusBlock(block.id);\n }\n deleteBlock(id: string): void {\n const index = this.blocks().findIndex(block => block.id === id);\n if (index < 0) return;\n this.store.deleteBlock(id, index);\n this.focusBlock(this.blocks()[Math.max(0, index - 1)]?.id ?? null);\n }\n duplicateBlock(id: string): void {\n const index = this.blocks().findIndex(block => block.id === id);\n if (index < 0) return;\n const block = cloneContentEditorValue(this.blocks()[index]);\n const reidentify = (item: any) => {\n item.id = createNgsHeadlessEditorId(item.type);\n for (const children of contentEditorChildCollections(item)) for (const child of children) reidentify(child);\n if (item.type === 'grid') for (const cell of item.content.cells) cell.id = createNgsHeadlessEditorId('cell');\n if (item.type === 'gallery') for (const image of item.content.images) image.id = createNgsHeadlessEditorId('image');\n };\n reidentify(block);\n this.store.addBlock(block, index + 1, this.scope());\n }\n drop(event: CdkDragDrop<ContentEditorBlockScope>): void {\n this.store.moveBetweenCollections(event.previousIndex, event.currentIndex, event.previousContainer.data, event.container.data);\n }\n onDragStarted(): void { this.store.setDragging(true); }\n onDragEnded(): void { this.store.setDragging(false); }\n readonly canEnter = (drag: CdkDrag<string>, drop: CdkDropList<ContentEditorBlockScope>): boolean => {\n const pointer = this.store.dragPointer();\n const nearest = pointer ? this.document.elementFromPoint(pointer.x, pointer.y)?.closest('.cdk-drop-list') : null;\n if (nearest && nearest.id !== drop.id) return false;\n const parentId = drop.data.parentId;\n const block = findContentEditorBlock(this.store.editor.document().blocks, drag.data);\n return !parentId || !block || !findContentEditorBlock([block], parentId);\n };\n onKeyDown(event: KeyboardEvent): void {\n if (event.defaultPrevented) return;\n if ((event.ctrlKey || event.metaKey) && ['z', 'y'].includes(event.key.toLowerCase())) {\n const redo = event.key.toLowerCase() === 'y' || event.shiftKey;\n if (redo ? this.store.editor.redo() : this.store.editor.undo()) event.preventDefault();\n event.stopPropagation();\n }\n }\n}\n","<div cdkDropList [cdkDropListData]=\"scope()\" [cdkDropListConnectedTo]=\"connectedDropLists()\" [cdkDropListEnterPredicate]=\"canEnter\" (cdkDropListDropped)=\"drop($event)\" class=\"min-h-12\">\n @for (block of renderedBlocks(); track block.id) {\n <div cdkDrag [cdkDragData]=\"block.id\" (cdkDragStarted)=\"onDragStarted()\" (cdkDragEnded)=\"onDragEnded()\" class=\"nested-block relative min-w-0 py-2\" [attr.data-block-id]=\"block.id\">\n <div class=\"nested-controls block-controls absolute top-1/2 z-10 flex -translate-y-1/2 items-center\"\n [class.is-menu-open]=\"addTrigger.menuOpen() || actionsTrigger.menuOpen()\">\n <button ngsIconButton aria-label=\"Add block\" #addTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"rootBuilder.blockMenu()\" [ngsMenuTriggerRestoreFocus]=\"false\"\n [ngsMenuTriggerData]=\"{target: {scope: scope(), afterId: block.id}}\">\n <ngs-icon name=\"fluent:add-24-regular\"/>\n </button>\n <button ngsIconButton cdkDragHandle [ngsMenuTriggerFor]=\"blockMenu\"\n #actionsTrigger=\"ngsMenuTrigger\" aria-label=\"Move block\"><ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/></button>\n <ngs-menu #blockMenu>\n @if (rootBuilder.canConvertBlock(block.id)) {\n <button ngs-menu-item [ngsMenuTriggerFor]=\"rootBuilder.conversionMenu()\" [ngsMenuTriggerData]=\"{blockId: block.id}\" [ngsMenuTriggerRestoreFocus]=\"false\">Turn into</button>\n }\n <button ngs-menu-item (click)=\"duplicateBlock(block.id)\">Duplicate</button>\n <button ngs-menu-item (click)=\"deleteBlock(block.id)\">Delete</button>\n </ngs-menu>\n </div>\n <div class=\"min-w-0\">\n <ng-container [ngComponentOutlet]=\"getBlockComponent(block.type) | async\"\n [ngComponentOutletInputs]=\"{id: block.id, content: block.content, settings: block.settings, props: block.props, index: $index}\"/>\n </div>\n </div>\n }\n</div>\n"],"names":[],"mappings":";;;;;;;;;;MAoBa,yBAAyB,CAAA;IACnB,MAAM,GAAG,MAAM,CAA0B,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC7E,IAAA,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACnC,IAAA,QAAQ,GAAG,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