@ngstarter-ui/components 22.1.3 → 22.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -13
- package/ai/component-registry.json +140 -9
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-B2GUlWO2.mjs +54 -0
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-B2GUlWO2.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs +47 -0
- package/fesm2022/ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Cnga7Z-6.mjs +27 -0
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Cnga7Z-6.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BbK5fCoE.mjs → ngstarter-ui-components-content-editor-code-block.component-DSdVOJtH.mjs} +49 -15
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-DSdVOJtH.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-divider-block.component-B5wyMHjr.mjs → ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs} +5 -3
- package/fesm2022/{ngstarter-ui-components-content-editor-divider-block.component-B5wyMHjr.mjs.map → ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-DGqupBLe.mjs → ngstarter-ui-components-content-editor-embed-block-DhFxtMQS.mjs} +16 -4
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DhFxtMQS.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-cEy-dCMa.mjs +103 -0
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-cEy-dCMa.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-DFLGRFiO.mjs +66 -0
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-DFLGRFiO.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-D1s2yalT.mjs → ngstarter-ui-components-content-editor-heading-block.component-BYpctSPe.mjs} +23 -14
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-BYpctSPe.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-D75DrPNq.mjs → ngstarter-ui-components-content-editor-image-block.component-B3MnANpi.mjs} +20 -7
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-B3MnANpi.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-B7pDlrQ_.mjs → ngstarter-ui-components-content-editor-list-block.component-6SMBxIl4.mjs} +28 -17
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-6SMBxIl4.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DSY7xfzf.mjs +117 -0
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DSY7xfzf.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs +3310 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-CVV2f-ON.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs} +25 -14
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CVb-bkJw.mjs → ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs} +29 -16
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DSpLBC4V.mjs → ngstarter-ui-components-content-editor-table-block.component-CJS-IBHw.mjs} +28 -13
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-CJS-IBHw.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-B01lhY_V.mjs +21 -0
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-B01lhY_V.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-D9ELpJr-.mjs +29 -0
- package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-D9ELpJr-.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-D3U8uXIy.mjs → ngstarter-ui-components-content-editor-video-block.component-DQUPVDwV.mjs} +19 -5
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-DQUPVDwV.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +90 -12
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +9 -5
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-upload.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngstarter-ui-components-content-editor.d.ts +303 -83
- package/types/ngstarter-ui-components-headless-editor.d.ts +17 -2
- package/types/ngstarter-ui-components-menu.d.ts +3 -1
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbK5fCoE.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs +0 -127
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGqupBLe.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-D1s2yalT.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-D75DrPNq.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-B7pDlrQ_.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs +0 -3102
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CVV2f-ON.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-CVb-bkJw.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-DSpLBC4V.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-D3U8uXIy.mjs.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { UploadArea, UploadTriggerDirective } from '@ngstarter-ui/components/upload';
|
|
4
|
+
import { ProgressBar } from '@ngstarter-ui/components/progress-bar';
|
|
5
|
+
import { Alert } from '@ngstarter-ui/components/alert';
|
|
6
|
+
import { Button } from '@ngstarter-ui/components/button';
|
|
7
|
+
import { Icon } from '@ngstarter-ui/components/icon';
|
|
8
|
+
import { FormField, Label } from '@ngstarter-ui/components/form-field';
|
|
9
|
+
import { Input } from '@ngstarter-ui/components/input';
|
|
10
|
+
import { C as ContentEditorUploadBlockBase } from './ngstarter-ui-components-content-editor-upload-block-base-D9ELpJr-.mjs';
|
|
11
|
+
import { f as contentEditorFileSize, g as contentEditorResourceUrl, r as readContentEditorFile } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs';
|
|
12
|
+
|
|
13
|
+
class ContentEditorAttachmentBlock extends ContentEditorUploadBlockBase {
|
|
14
|
+
sizeLabel = computed(() => contentEditorFileSize(this.content().size), /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "sizeLabel" }] : /* istanbul ignore next */ []));
|
|
16
|
+
href = computed(() => contentEditorResourceUrl(this.content().url), /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
|
|
18
|
+
changeName(event) { this.save({ ...this.latestContent(), name: event.target.value }); }
|
|
19
|
+
async upload(event) {
|
|
20
|
+
const file = event.files[0];
|
|
21
|
+
if (!file)
|
|
22
|
+
return;
|
|
23
|
+
const request = this.beginUpload();
|
|
24
|
+
try {
|
|
25
|
+
const dataUrl = await readContentEditorFile(file);
|
|
26
|
+
if (!this.isCurrentUpload(request))
|
|
27
|
+
return;
|
|
28
|
+
const uploadFn = this.builder.getBlockDefOption('attachment', 'uploadFn');
|
|
29
|
+
const url = await uploadFn(file, dataUrl);
|
|
30
|
+
if (!this.isCurrentUpload(request))
|
|
31
|
+
return;
|
|
32
|
+
if (typeof url !== 'string' || !contentEditorResourceUrl(url))
|
|
33
|
+
throw new Error('Invalid file URL');
|
|
34
|
+
this.save({ url, name: file.name, size: file.size, mimeType: file.type });
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
if (this.isCurrentUpload(request))
|
|
38
|
+
this.error.set('Could not upload the file. Please try again.');
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
if (this.isCurrentUpload(request))
|
|
42
|
+
this.uploading.set(false);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorAttachmentBlock, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
46
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ContentEditorAttachmentBlock, isStandalone: true, selector: "ngs-content-editor-attachment-block", usesInheritance: true, ngImport: i0, template: "<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} \u00B7 {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs-upload-area>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n", dependencies: [{ 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: ProgressBar, selector: "ngs-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["ngsProgressBar"] }, { kind: "component", type: Alert, selector: "ngs-alert", inputs: ["autoClose", "bordered", "variant"], outputs: ["closed"], exportAs: ["ngsAlert"] }, { 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: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Label, selector: "ngs-label" }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorAttachmentBlock, decorators: [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{ selector: 'ngs-content-editor-attachment-block', imports: [UploadArea, UploadTriggerDirective, ProgressBar, Alert, Button, Icon, FormField, Label, Input], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} \u00B7 {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs-upload-area>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n" }]
|
|
51
|
+
}] });
|
|
52
|
+
|
|
53
|
+
export { ContentEditorAttachmentBlock };
|
|
54
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-attachment-block-B2GUlWO2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-attachment-block-B2GUlWO2.mjs","sources":["../../../projects/components/content-editor/src/_builder/attachment-block/attachment-block.ts","../../../projects/components/content-editor/src/_builder/attachment-block/attachment-block.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed } from '@angular/core';\nimport { UploadArea, UploadTriggerDirective, UploadFileSelectedEvent } from '@ngstarter-ui/components/upload';\nimport { ProgressBar } from '@ngstarter-ui/components/progress-bar';\nimport { Alert } from '@ngstarter-ui/components/alert';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport { FormField, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { ContentEditorUploadBlockBase } from '../upload-block-base';\nimport { ContentEditorAttachmentContent, ContentEditorUploadFn } from '../../types';\nimport { contentEditorFileSize, contentEditorResourceUrl, readContentEditorFile } from '../../upload';\n\n@Component({\n selector: 'ngs-content-editor-attachment-block',\n imports: [UploadArea, UploadTriggerDirective, ProgressBar, Alert, Button, Icon, FormField, Label, Input],\n templateUrl: './attachment-block.html', changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ContentEditorAttachmentBlock extends ContentEditorUploadBlockBase<ContentEditorAttachmentContent> {\n readonly sizeLabel = computed(() => contentEditorFileSize(this.content().size));\n readonly href = computed(() => contentEditorResourceUrl(this.content().url));\n changeName(event: Event): void { this.save({ ...this.latestContent(), name: (event.target as HTMLInputElement).value }); }\n async upload(event: UploadFileSelectedEvent): Promise<void> {\n const file = event.files[0];\n if (!file) return;\n const request = this.beginUpload();\n try {\n const dataUrl = await readContentEditorFile(file);\n if (!this.isCurrentUpload(request)) return;\n const uploadFn: ContentEditorUploadFn = this.builder.getBlockDefOption('attachment', 'uploadFn');\n const url = await uploadFn(file, dataUrl);\n if (!this.isCurrentUpload(request)) return;\n if (typeof url !== 'string' || !contentEditorResourceUrl(url)) throw new Error('Invalid file URL');\n this.save({ url, name: file.name, size: file.size, mimeType: file.type });\n } catch {\n if (this.isCurrentUpload(request)) this.error.set('Could not upload the file. Please try again.');\n } finally {\n if (this.isCurrentUpload(request)) this.uploading.set(false);\n }\n }\n}\n","<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} · {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs-upload-area>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n"],"names":[],"mappings":";;;;;;;;;;;;AAiBM,MAAO,4BAA6B,SAAQ,4BAA4D,CAAA;AACnG,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,qBAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;kFAAC;AACtE,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,wBAAwB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC;6EAAC;IAC5E,UAAU,CAAC,KAAY,EAAA,EAAU,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAG,KAAK,CAAC,MAA2B,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACzH,MAAM,MAAM,CAAC,KAA8B,EAAA;QACzC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3B,QAAA,IAAI,CAAC,IAAI;YAAE;AACX,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE;AAClC,QAAA,IAAI;AACF,YAAA,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,IAAI,CAAC;AACjD,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;gBAAE;AACpC,YAAA,MAAM,QAAQ,GAA0B,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,EAAE,UAAU,CAAC;YAChG,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,O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eAAA,EAC/C,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,sjCAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, input, signal, effect, untracked, Directive } from '@angular/core';
|
|
3
|
+
import { C as ContentBuilderStore, a as CONTENT_BUILDER, h as findContentEditorBlock, n as isContentEditorBlockEmpty, l as contentEditorBlockView } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs';
|
|
4
|
+
|
|
5
|
+
/** Shared native inputs and root history for the built-in block editors. */
|
|
6
|
+
class ContentEditorBlockBase {
|
|
7
|
+
store = inject(ContentBuilderStore);
|
|
8
|
+
builder = inject(CONTENT_BUILDER);
|
|
9
|
+
element = inject(ElementRef).nativeElement;
|
|
10
|
+
id = input.required(/* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
12
|
+
content = input.required(/* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
14
|
+
settings = input.required(/* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
16
|
+
index = input(0, /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
18
|
+
props = input([], /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
|
|
20
|
+
initialized = signal(true, /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
22
|
+
constructor() {
|
|
23
|
+
effect(() => {
|
|
24
|
+
if (this.store.focusedBlockId() === this.id())
|
|
25
|
+
untracked(() => this.focus());
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
focus() { this.element.querySelector('[contenteditable="true"], input, button')?.focus(); }
|
|
29
|
+
getData() { return { content: this.content(), settings: this.settings(), props: this.props() }; }
|
|
30
|
+
isEmpty() {
|
|
31
|
+
const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());
|
|
32
|
+
return !block || isContentEditorBlockEmpty(block);
|
|
33
|
+
}
|
|
34
|
+
save(content, settings = this.settings()) { this.store.updateBlock(this.id(), { content, settings }); }
|
|
35
|
+
latestContent() {
|
|
36
|
+
const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());
|
|
37
|
+
return block ? contentEditorBlockView(block).content : this.content();
|
|
38
|
+
}
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorBlockBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
40
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: ContentEditorBlockBase, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
41
|
+
}
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorBlockBase, decorators: [{
|
|
43
|
+
type: Directive
|
|
44
|
+
}], 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: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
45
|
+
|
|
46
|
+
export { ContentEditorBlockBase as C };
|
|
47
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs","sources":["../../../projects/components/content-editor/src/_builder/block-base.ts"],"sourcesContent":["import { Directive, ElementRef, effect, inject, input, signal, untracked } from '@angular/core';\nimport { ContentBuilderStore } from '../content-builder.store';\nimport { ContentBuilderComponent } from '../content-builder/content-builder.component';\nimport { CONTENT_BUILDER, ContentEditorDataBlock, ContentEditorItemProperty } from '../types';\nimport { contentEditorBlockView, findContentEditorBlock, isContentEditorBlockEmpty } from '../document';\n\n/** Shared native inputs and root history for the built-in block editors. */\n@Directive()\nexport abstract class ContentEditorBlockBase<T, S extends object = Record<string, unknown>> implements ContentEditorDataBlock {\n protected readonly store = inject(ContentBuilderStore);\n protected readonly builder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n protected readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n readonly id = input.required<string>();\n readonly content = input.required<T>();\n readonly settings = input.required<S>();\n readonly index = input(0);\n readonly props = input<ContentEditorItemProperty[]>([]);\n readonly initialized = signal(true);\n\n constructor() {\n effect(() => {\n if (this.store.focusedBlockId() === this.id()) untracked(() => this.focus());\n });\n }\n focus(): void { this.element.querySelector<HTMLElement>('[contenteditable=\"true\"], input, button')?.focus(); }\n getData() { return { content: this.content(), settings: this.settings(), props: this.props() }; }\n isEmpty(): boolean {\n const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());\n return !block || isContentEditorBlockEmpty(block);\n }\n protected save(content: T, settings: S = this.settings()): void { this.store.updateBlock(this.id(), { content, settings }); }\n protected latestContent(): T {\n const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());\n return block ? contentEditorBlockView(block).content : this.content();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AA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAD3C;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { Alert, AlertIconDirective, AlertActionDirective } from '@ngstarter-ui/components/alert';
|
|
4
|
+
import { Icon } from '@ngstarter-ui/components/icon';
|
|
5
|
+
import { Button } from '@ngstarter-ui/components/button';
|
|
6
|
+
import { Menu, MenuItem, MenuTrigger } from '@ngstarter-ui/components/menu';
|
|
7
|
+
import { C as ContentEditorBlockBase } from './ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs';
|
|
8
|
+
import { d as ContentEditorContentEditableDirective } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs';
|
|
9
|
+
|
|
10
|
+
class ContentEditorCalloutBlock extends ContentEditorBlockBase {
|
|
11
|
+
variants = ['note', 'tip', 'warning', 'danger'];
|
|
12
|
+
appearance = computed(() => ({ note: 'informative', tip: 'positive', warning: 'notice', danger: 'negative' })[this.settings().variant] ?? 'informative', /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
14
|
+
icon = computed(() => ({ note: 'fluent:info-24-regular', tip: 'fluent:lightbulb-24-regular', warning: 'fluent:warning-24-regular', danger: 'fluent:error-circle-24-regular' })[this.settings().variant] ?? 'fluent:info-24-regular', /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
16
|
+
changeVariant(variant) { this.save(this.content(), { ...this.settings(), variant }); }
|
|
17
|
+
changeText(content) { this.save(content); }
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorCalloutBlock, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ContentEditorCalloutBlock, isStandalone: true, selector: "ngs-content-editor-callout-block", usesInheritance: true, ngImport: i0, template: "<ngs-alert [variant]=\"appearance()\" [class.settings-open]=\"settingsTrigger.menuOpen()\">\n <ng-template ngsAlertIcon><ngs-icon [name]=\"icon()\"/></ng-template>\n <div class=\"min-w-0 break-words outline-none\" [ngsContentEditorContentEditable]=\"content()\" [props]=\"props()\"\n (propsChanged)=\"store.updateBlock(id(), {props: $event})\" (contentChanged)=\"changeText($event)\" data-empty-placeholder=\"Write a note\u2026\"></div>\n <button ngsIconButton ngsAlertAction [ngsMenuTriggerFor]=\"variantMenu\" #settingsTrigger=\"ngsMenuTrigger\"\n aria-label=\"Callout style\"><ngs-icon name=\"fluent:more-horizontal-24-regular\"/></button>\n</ngs-alert>\n<ngs-menu #variantMenu>\n @for (variant of variants; track variant) { <button ngs-menu-item (click)=\"changeVariant(variant)\">{{variant}}</button> }\n</ngs-menu>\n", styles: [":host{display:block;min-width:0}:host ngs-alert ::ng-deep>.content{flex:1;min-width:0}:host ngs-alert button[ngsAlertAction]{--ngs-button-height: calc(var(--spacing, .25rem) * 8);--ngs-button-color: inherit;opacity:0;pointer-events:none}:host ngs-alert:hover button[ngsAlertAction],:host ngs-alert:focus-within button[ngsAlertAction],:host ngs-alert.settings-open button[ngsAlertAction]{opacity:1;pointer-events:auto}@media(hover:none){:host ngs-alert button[ngsAlertAction]{opacity:1;pointer-events:auto}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Alert, selector: "ngs-alert", inputs: ["autoClose", "bordered", "variant"], outputs: ["closed"], exportAs: ["ngsAlert"] }, { kind: "directive", type: AlertIconDirective, selector: "[ngsAlertIcon]", exportAs: ["ngsAlertIcon"] }, { kind: "directive", type: AlertActionDirective, selector: "[ngsAlertAction]", exportAs: ["ngsAlertAction"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { 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: 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: "directive", type: ContentEditorContentEditableDirective, selector: "[ngsContentEditorContentEditable]", inputs: ["ngsContentEditorContentEditable", "settings", "props", "singleLine"], outputs: ["contentChanged", "propsChanged", "pressedEnter", "initialized"], exportAs: ["ngsContentEditorContentEditable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
20
|
+
}
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorCalloutBlock, decorators: [{
|
|
22
|
+
type: Component,
|
|
23
|
+
args: [{ selector: 'ngs-content-editor-callout-block', imports: [Alert, AlertIconDirective, AlertActionDirective, Icon, Button, Menu, MenuItem, MenuTrigger, ContentEditorContentEditableDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ngs-alert [variant]=\"appearance()\" [class.settings-open]=\"settingsTrigger.menuOpen()\">\n <ng-template ngsAlertIcon><ngs-icon [name]=\"icon()\"/></ng-template>\n <div class=\"min-w-0 break-words outline-none\" [ngsContentEditorContentEditable]=\"content()\" [props]=\"props()\"\n (propsChanged)=\"store.updateBlock(id(), {props: $event})\" (contentChanged)=\"changeText($event)\" data-empty-placeholder=\"Write a note\u2026\"></div>\n <button ngsIconButton ngsAlertAction [ngsMenuTriggerFor]=\"variantMenu\" #settingsTrigger=\"ngsMenuTrigger\"\n aria-label=\"Callout style\"><ngs-icon name=\"fluent:more-horizontal-24-regular\"/></button>\n</ngs-alert>\n<ngs-menu #variantMenu>\n @for (variant of variants; track variant) { <button ngs-menu-item (click)=\"changeVariant(variant)\">{{variant}}</button> }\n</ngs-menu>\n", styles: [":host{display:block;min-width:0}:host ngs-alert ::ng-deep>.content{flex:1;min-width:0}:host ngs-alert button[ngsAlertAction]{--ngs-button-height: calc(var(--spacing, .25rem) * 8);--ngs-button-color: inherit;opacity:0;pointer-events:none}:host ngs-alert:hover button[ngsAlertAction],:host ngs-alert:focus-within button[ngsAlertAction],:host ngs-alert.settings-open button[ngsAlertAction]{opacity:1;pointer-events:auto}@media(hover:none){:host ngs-alert button[ngsAlertAction]{opacity:1;pointer-events:auto}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
24
|
+
}] });
|
|
25
|
+
|
|
26
|
+
export { ContentEditorCalloutBlock };
|
|
27
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-callout-block-Cnga7Z-6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-callout-block-Cnga7Z-6.mjs","sources":["../../../projects/components/content-editor/src/_builder/callout-block/callout-block.ts","../../../projects/components/content-editor/src/_builder/callout-block/callout-block.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed } from '@angular/core';\nimport { Alert, AlertIconDirective, AlertActionDirective } from '@ngstarter-ui/components/alert';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Menu, MenuItem, MenuTrigger } from '@ngstarter-ui/components/menu';\nimport { ContentEditorBlockBase } from '../block-base';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { ContentEditorCalloutSettings, ContentEditorCalloutVariant, ContentEditorText } from '../../types';\n\n@Component({\n selector: 'ngs-content-editor-callout-block',\n imports: [Alert, AlertIconDirective, AlertActionDirective, Icon, Button, Menu, MenuItem, MenuTrigger, ContentEditorContentEditableDirective],\n templateUrl: './callout-block.html', styleUrl: './callout-block.scss', changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ContentEditorCalloutBlock extends ContentEditorBlockBase<ContentEditorText, ContentEditorCalloutSettings> {\n readonly variants: ContentEditorCalloutVariant[] = ['note', 'tip', 'warning', 'danger'];\n readonly appearance = computed(() => ({ note: 'informative', tip: 'positive', warning: 'notice', danger: 'negative' })[this.settings().variant] ?? 'informative');\n readonly icon = computed(() => ({ note: 'fluent:info-24-regular', tip: 'fluent:lightbulb-24-regular', warning: 'fluent:warning-24-regular', danger: 'fluent:error-circle-24-regular' })[this.settings().variant] ?? 'fluent:info-24-regular');\n changeVariant(variant: ContentEditorCalloutVariant): void { this.save(this.content(), { ...this.settings(), variant }); }\n changeText(content: ContentEditorText): void { this.save(content); }\n}\n","<ngs-alert [variant]=\"appearance()\" [class.settings-open]=\"settingsTrigger.menuOpen()\">\n <ng-template ngsAlertIcon><ngs-icon [name]=\"icon()\"/></ng-template>\n <div class=\"min-w-0 break-words outline-none\" [ngsContentEditorContentEditable]=\"content()\" [props]=\"props()\"\n (propsChanged)=\"store.updateBlock(id(), {props: $event})\" (contentChanged)=\"changeText($event)\" data-empty-placeholder=\"Write a note…\"></div>\n <button ngsIconButton ngsAlertAction [ngsMenuTriggerFor]=\"variantMenu\" #settingsTrigger=\"ngsMenuTrigger\"\n aria-label=\"Callout style\"><ngs-icon name=\"fluent:more-horizontal-24-regular\"/></button>\n</ngs-alert>\n<ngs-menu #variantMenu>\n @for (variant of variants; track variant) { <button ngs-menu-item (click)=\"changeVariant(variant)\">{{variant}}</button> }\n</ngs-menu>\n"],"names":[],"mappings":";;;;;;;;;AAcM,MAAO,yBAA0B,SAAQ,sBAAuE,CAAA;IAC3G,QAAQ,GAAkC,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC;AAC9E,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,aAAa;mFAAC;AACxJ,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,6BAA6B,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,EAAE,gCAAgC,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,wBAAwB;6EAAC;IAC7O,aAAa,CAAC,OAAoC,EAAA,EAAU,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACxH,UAAU,CAAC,OAA0B,EAAA,EAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;uGALxD,yBAAyB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAy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EAAA,OAAA,EAAA,CAAA,gBAAA,EAAA,cAAA,EAAA,cAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,iCAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAGhI,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBALrC,SAAS;+BACE,kCAAkC,EAAA,OAAA,EACnC,CAAC,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,CAAC,EAAA,eAAA,EACpD,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,k0BAAA,EAAA,MAAA,EAAA,CAAA,ikBAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { createNgsHeadlessEditorText } from '@ngstarter-ui/components/headless-editor';
|
|
2
|
+
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as contentEditorText, e as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs';
|
|
1
3
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DestroyRef, viewChild, input, signal, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs';
|
|
4
|
+
import { inject, DestroyRef, viewChild, input, signal, effect, untracked, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
6
|
import { EditorView, keymap } from '@codemirror/view';
|
|
6
7
|
import { basicSetup } from 'codemirror';
|
|
7
|
-
import { Compartment } from '@codemirror/state';
|
|
8
|
+
import { Compartment, Prec } from '@codemirror/state';
|
|
8
9
|
import { Menu, MenuItem, MenuTrigger } from '@ngstarter-ui/components/menu';
|
|
9
10
|
import { Button } from '@ngstarter-ui/components/button';
|
|
10
11
|
import { githubLight } from '@uiw/codemirror-theme-github';
|
|
@@ -26,6 +27,8 @@ class CodeBlockComponent {
|
|
|
26
27
|
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
27
28
|
index = input.required(/* @ts-ignore */
|
|
28
29
|
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
30
|
+
props = input([], /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
|
|
29
32
|
placeholder = input('Write your code here', /* @ts-ignore */
|
|
30
33
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
31
34
|
_languageList = signal([
|
|
@@ -81,12 +84,37 @@ class CodeBlockComponent {
|
|
|
81
84
|
_editorLanguage = new Compartment();
|
|
82
85
|
initialized = signal(false, /* @ts-ignore */
|
|
83
86
|
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
87
|
+
restoring = false;
|
|
88
|
+
constructor() {
|
|
89
|
+
effect(() => {
|
|
90
|
+
const content = this.content();
|
|
91
|
+
const settings = this.settings();
|
|
92
|
+
untracked(() => {
|
|
93
|
+
if (!this._editorView)
|
|
94
|
+
return;
|
|
95
|
+
const code = contentEditorText(content);
|
|
96
|
+
this.restoring = true;
|
|
97
|
+
try {
|
|
98
|
+
if (this._editorView.state.doc.toString() !== code) {
|
|
99
|
+
this._editorView.dispatch({ changes: { from: 0, to: this._editorView.state.doc.length, insert: code } });
|
|
100
|
+
}
|
|
101
|
+
const language = this._languageList().find(item => item.language === settings.language);
|
|
102
|
+
if (language && this._language().language !== language.language) {
|
|
103
|
+
void this.selectLanguage(language, false);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
this.restoring = false;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
84
112
|
async ngOnInit() {
|
|
85
113
|
const codeLanguage = this._languageList().find(codeLanguage => codeLanguage.language === this.settings().language);
|
|
86
114
|
if (codeLanguage) {
|
|
87
115
|
this._language.set(codeLanguage);
|
|
88
116
|
}
|
|
89
|
-
this._code.set(this.content()
|
|
117
|
+
this._code.set(contentEditorText(this.content()));
|
|
90
118
|
this._isEmpty.set(this._code().trim().length === 0);
|
|
91
119
|
this._contentBuilder
|
|
92
120
|
.focusChanged
|
|
@@ -102,16 +130,21 @@ class CodeBlockComponent {
|
|
|
102
130
|
extensions: [
|
|
103
131
|
basicSetup,
|
|
104
132
|
githubLight,
|
|
105
|
-
keymap.of([
|
|
133
|
+
Prec.highest(keymap.of([
|
|
134
|
+
{ key: 'Mod-z', run: () => this._store.editor.undo() },
|
|
135
|
+
{ key: 'Mod-Shift-z', run: () => this._store.editor.redo() },
|
|
136
|
+
{ key: 'Mod-y', run: () => this._store.editor.redo() },
|
|
137
|
+
indentWithTab
|
|
138
|
+
])),
|
|
106
139
|
this._editorLanguage.of([]),
|
|
107
140
|
EditorView.updateListener.of((v) => {
|
|
108
|
-
if (v.docChanged) {
|
|
109
|
-
this.update();
|
|
141
|
+
if (v.docChanged && !this.restoring) {
|
|
142
|
+
this._store.withTextEdit('keyboard', `code:${this.id()}`, () => this.update());
|
|
110
143
|
}
|
|
111
144
|
})
|
|
112
145
|
],
|
|
113
146
|
});
|
|
114
|
-
await this.selectLanguage(this._language());
|
|
147
|
+
await this.selectLanguage(this._language(), false);
|
|
115
148
|
this._editorView.contentDOM.style.width = '0';
|
|
116
149
|
this._editorView.focus();
|
|
117
150
|
this.initialized.set(true);
|
|
@@ -124,7 +157,7 @@ class CodeBlockComponent {
|
|
|
124
157
|
}
|
|
125
158
|
getData() {
|
|
126
159
|
return {
|
|
127
|
-
content: this._editorView.state.doc.toString(),
|
|
160
|
+
content: [createNgsHeadlessEditorText(this._editorView.state.doc.toString())],
|
|
128
161
|
settings: {
|
|
129
162
|
...this.settings(),
|
|
130
163
|
language: this._language().language
|
|
@@ -134,7 +167,7 @@ class CodeBlockComponent {
|
|
|
134
167
|
isEmpty() {
|
|
135
168
|
return this._editorView.state.doc.toString().trim().length === 0;
|
|
136
169
|
}
|
|
137
|
-
async selectLanguage(codeLanguage) {
|
|
170
|
+
async selectLanguage(codeLanguage, persist = true) {
|
|
138
171
|
this._language.set(codeLanguage);
|
|
139
172
|
if (codeLanguage.language === 'none') {
|
|
140
173
|
this._editorView.dispatch({
|
|
@@ -147,20 +180,21 @@ class CodeBlockComponent {
|
|
|
147
180
|
effects: this._editorLanguage.reconfigure(language)
|
|
148
181
|
});
|
|
149
182
|
}
|
|
150
|
-
|
|
183
|
+
if (persist)
|
|
184
|
+
this.update();
|
|
151
185
|
}
|
|
152
186
|
update() {
|
|
153
187
|
this._store.updateBlock(this.id(), { ...this.getData(), isEmpty: this.isEmpty() });
|
|
154
188
|
this._contentBuilder.emitContentChangeEvent();
|
|
155
189
|
}
|
|
156
190
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CodeBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
157
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CodeBlockComponent, isStandalone: true, selector: "ngs-code-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ngs-code-block" }, providers: [
|
|
191
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CodeBlockComponent, isStandalone: true, selector: "ngs-code-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ngs-code-block" }, providers: [
|
|
158
192
|
{
|
|
159
193
|
provide: CONTENT_EDITOR_BLOCK,
|
|
160
194
|
useExisting: forwardRef(() => CodeBlockComponent),
|
|
161
195
|
multi: true
|
|
162
196
|
}
|
|
163
|
-
], viewQueries: [{ propertyName: "_contentRef", first: true, predicate: ["contentRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"bg-surface-container rounded-xl\">\n <div class=\"border-b border-b-default h-12 header\">\n <button ngsButton [ngsMenuTriggerFor]=\"languageListMenu\" class=\"-ms-2\">{{ _language().name }}</button>\n </div>\n <div class=\"content\">\n <div class=\"content-code\" #contentRef></div>\n </div>\n</div>\n\n<ngs-menu #languageListMenu=\"ngsMenu\">\n @for (languageItem of _languageList(); track $index) {\n <button ngs-menu-item (click)=\"selectLanguage(languageItem)\"\n class=\"[&.is-active]:!bg-secondary-fixed\"\n [class.is-active]=\"languageItem.language === _language().language\">{{ languageItem.name }}</button>\n }\n</ngs-menu>\n", styles: [":host{display:block;margin:calc(var(--spacing, .25rem) * 3) 0}:host .header{display:flex;align-items:center;padding:0 calc(var(--spacing, .25rem) * 4)}:host .language-trigger{font-size:var(--text-sm);cursor:pointer}:host .content{outline:none;font-size:var(--text-sm);padding:calc(var(--spacing, .25rem) * 2);min-width:0}:host .content .content-code{min-width:0}:host .content .content-code ::ng-deep .cm-editor{border-radius:var(--ngs-radius-lg)}:host .content .content-code ::ng-deep .cm-scroller{border-radius:var(--ngs-radius-lg);overflow-x:auto}:host .content .content-code ::ng-deep .cm-content,:host .content .content-code ::ng-deep .cm-gutter{min-height:160px}:host-context(.block.is-active) .content:empty:before,:host-context(.block.is-focused) .content:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Menu, selector: "ngs-menu", inputs: ["role", "classList", "xPosition", "yPosition"], 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: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
197
|
+
], viewQueries: [{ propertyName: "_contentRef", first: true, predicate: ["contentRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"bg-surface-container rounded-xl\">\n <div class=\"border-b border-b-default h-12 header\">\n <button ngsButton [ngsMenuTriggerFor]=\"languageListMenu\" class=\"-ms-2\">{{ _language().name }}</button>\n </div>\n <div class=\"content\">\n <div class=\"content-code\" #contentRef></div>\n </div>\n</div>\n\n<ngs-menu #languageListMenu=\"ngsMenu\">\n @for (languageItem of _languageList(); track $index) {\n <button ngs-menu-item (click)=\"selectLanguage(languageItem)\"\n class=\"[&.is-active]:!bg-secondary-fixed\"\n [class.is-active]=\"languageItem.language === _language().language\">{{ languageItem.name }}</button>\n }\n</ngs-menu>\n", styles: [":host{display:block;margin:calc(var(--spacing, .25rem) * 3) 0}:host .header{display:flex;align-items:center;padding:0 calc(var(--spacing, .25rem) * 4)}:host .language-trigger{font-size:var(--text-sm);cursor:pointer}:host .content{outline:none;font-size:var(--text-sm);padding:calc(var(--spacing, .25rem) * 2);min-width:0}:host .content .content-code{min-width:0}:host .content .content-code ::ng-deep .cm-editor{border-radius:var(--ngs-radius-lg)}:host .content .content-code ::ng-deep .cm-scroller{border-radius:var(--ngs-radius-lg);overflow-x:auto}:host .content .content-code ::ng-deep .cm-content,:host .content .content-code ::ng-deep .cm-gutter{min-height:160px}:host-context(.block.is-active) .content:empty:before,:host-context(.block.is-focused) .content:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "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: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
164
198
|
}
|
|
165
199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CodeBlockComponent, decorators: [{
|
|
166
200
|
type: Component,
|
|
@@ -178,7 +212,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
178
212
|
], host: {
|
|
179
213
|
'class': 'ngs-code-block',
|
|
180
214
|
}, template: "<div class=\"bg-surface-container rounded-xl\">\n <div class=\"border-b border-b-default h-12 header\">\n <button ngsButton [ngsMenuTriggerFor]=\"languageListMenu\" class=\"-ms-2\">{{ _language().name }}</button>\n </div>\n <div class=\"content\">\n <div class=\"content-code\" #contentRef></div>\n </div>\n</div>\n\n<ngs-menu #languageListMenu=\"ngsMenu\">\n @for (languageItem of _languageList(); track $index) {\n <button ngs-menu-item (click)=\"selectLanguage(languageItem)\"\n class=\"[&.is-active]:!bg-secondary-fixed\"\n [class.is-active]=\"languageItem.language === _language().language\">{{ languageItem.name }}</button>\n }\n</ngs-menu>\n", styles: [":host{display:block;margin:calc(var(--spacing, .25rem) * 3) 0}:host .header{display:flex;align-items:center;padding:0 calc(var(--spacing, .25rem) * 4)}:host .language-trigger{font-size:var(--text-sm);cursor:pointer}:host .content{outline:none;font-size:var(--text-sm);padding:calc(var(--spacing, .25rem) * 2);min-width:0}:host .content .content-code{min-width:0}:host .content .content-code ::ng-deep .cm-editor{border-radius:var(--ngs-radius-lg)}:host .content .content-code ::ng-deep .cm-scroller{border-radius:var(--ngs-radius-lg);overflow-x:auto}:host .content .content-code ::ng-deep .cm-content,:host .content .content-code ::ng-deep .cm-gutter{min-height:160px}:host-context(.block.is-active) .content:empty:before,:host-context(.block.is-focused) .content:empty:before{content:attr(data-empty-placeholder);color:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
181
|
-
}], propDecorators: { _contentRef: [{ type: i0.ViewChild, args: ['contentRef', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
215
|
+
}], 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 }] }] } });
|
|
182
216
|
|
|
183
217
|
export { CodeBlockComponent };
|
|
184
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-code-block.component-
|
|
218
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-code-block.component-DSdVOJtH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-code-block.component-DSdVOJtH.mjs","sources":["../../../projects/components/content-editor/src/_builder/code-block/code-block.component.ts","../../../projects/components/content-editor/src/_builder/code-block/code-block.component.html"],"sourcesContent":["import { NgsHeadlessEditorText, createNgsHeadlessEditorText } from '@ngstarter-ui/components/headless-editor';\nimport { contentEditorText } from '../../document';\nimport {\n ChangeDetectionStrategy,\n Component, effect, untracked,\n DestroyRef,\n ElementRef, forwardRef,\n inject,\n input, OnDestroy,\n OnInit,\n signal,\n viewChild\n} from '@angular/core';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock\n} from '../../types';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { EditorView, keymap, ViewUpdate } from '@codemirror/view';\nimport { basicSetup } from 'codemirror';\nimport { Compartment, Prec } from '@codemirror/state';\nimport { Menu, MenuItem, MenuTrigger } from '@ngstarter-ui/components/menu';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { githubLight } from '@uiw/codemirror-theme-github';\nimport { indentWithTab } from \"@codemirror/commands\"\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\nimport { DOCUMENT } from '@angular/common';\n\nexport interface ContentEditorCodeBlockSettings {\n language: string;\n}\n\nexport interface ContentEditorCodeLanguage {\n language: string;\n name: string;\n library: () => Promise<any>;\n}\n\n@Component({\n selector: 'ngs-code-block',\n imports: [\n Menu,\n MenuItem,\n MenuTrigger,\n Button\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './code-block.component.html',\n styleUrl: './code-block.component.scss',\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: forwardRef(() => CodeBlockComponent),\n multi: true\n }\n ],\n host: {\n 'class': 'ngs-code-block',\n }\n})\nexport class CodeBlockComponent implements OnInit, OnDestroy, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private _destroyRef = inject(DestroyRef);\n private document = inject(DOCUMENT);\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<ContentEditorCodeBlockSettings>();\n index = input.required<number>();\n props = input<unknown[]>([]);\n placeholder = input('Write your code here');\n\n protected _languageList = signal<ContentEditorCodeLanguage[]>([\n {\n language: 'none',\n name: 'None',\n library: () => new Promise(() => {})\n },\n {\n language: 'angular',\n name: 'Angular',\n library: () => import('@codemirror/lang-angular').then(lang => lang.angular())\n },\n {\n language: 'javascript',\n name: 'JavaScript',\n library: () => import('@codemirror/lang-javascript').then(lang => lang.javascript())\n },\n {\n language: 'typescript',\n name: 'TypeScript',\n library: () => import('@codemirror/lang-javascript').then(lang => lang.javascript({ typescript: true }))\n },\n {\n language: 'html',\n name: 'HTML',\n library: () => import('@codemirror/lang-html').then(lang => lang.html())\n },\n {\n language: 'css',\n name: 'CSS',\n library: () => import('@codemirror/lang-css').then(lang => lang.css())\n },\n {\n language: 'sass',\n name: 'Sass',\n library: () => import('@codemirror/lang-sass').then(lang => lang.sass())\n },\n {\n language: 'json',\n name: 'JSON',\n library: () => import('@codemirror/lang-json').then(lang => lang.json())\n }\n ]);\n protected _code = signal<string>('');\n protected _language = signal<ContentEditorCodeLanguage>(this._languageList()[0]);\n protected _isEmpty = signal<boolean>(true);\n\n private _editorView!: EditorView;\n private _editorLanguage = new Compartment();\n readonly initialized = signal(false);\n\n private restoring = false;\n\n constructor() {\n effect(() => {\n const content = this.content();\n const settings = this.settings();\n untracked(() => {\n if (!this._editorView) return;\n const code = contentEditorText(content);\n this.restoring = true;\n try {\n if (this._editorView.state.doc.toString() !== code) {\n this._editorView.dispatch({ changes: { from: 0, to: this._editorView.state.doc.length, insert: code } });\n }\n const language = this._languageList().find(item => item.language === settings.language);\n if (language && this._language().language !== language.language) {\n void this.selectLanguage(language, false);\n }\n } finally { this.restoring = false; }\n });\n });\n }\n\n async ngOnInit() {\n const codeLanguage = this._languageList().find(\n codeLanguage => codeLanguage.language === this.settings().language\n );\n\n if (codeLanguage) {\n this._language.set(codeLanguage);\n }\n\n this._code.set(contentEditorText(this.content()));\n this._isEmpty.set(this._code().trim().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 this._editorView = new EditorView({\n doc: this._code(),\n parent: this._contentRef().nativeElement,\n extensions: [\n basicSetup,\n githubLight,\n Prec.highest(keymap.of([\n { key: 'Mod-z', run: () => this._store.editor.undo() },\n { key: 'Mod-Shift-z', run: () => this._store.editor.redo() },\n { key: 'Mod-y', run: () => this._store.editor.redo() },\n indentWithTab\n ])),\n this._editorLanguage.of([]),\n EditorView.updateListener.of((v: ViewUpdate) => {\n if (v.docChanged && !this.restoring) {\n this._store.withTextEdit('keyboard', `code:${this.id()}`, () => this.update());\n }\n })\n ],\n });\n await this.selectLanguage(this._language(), false);\n this._editorView.contentDOM.style.width = '0';\n this._editorView.focus();\n this.initialized.set(true);\n }\n\n ngOnDestroy() {\n this._editorView.destroy();\n }\n\n focus() {\n this._editorView.focus();\n }\n\n getData(): any {\n return {\n content: [createNgsHeadlessEditorText(this._editorView.state.doc.toString())],\n settings: {\n ...this.settings(),\n language: this._language().language\n }\n };\n }\n\n isEmpty(): boolean {\n return this._editorView.state.doc.toString().trim().length === 0;\n }\n\n protected async selectLanguage(codeLanguage: ContentEditorCodeLanguage, persist = true) {\n this._language.set(codeLanguage);\n\n if (codeLanguage.language === 'none') {\n this._editorView.dispatch({\n effects: this._editorLanguage.reconfigure([])\n });\n } else {\n const language = await this._language().library();\n this._editorView.dispatch({\n effects: this._editorLanguage.reconfigure(language)\n });\n }\n\n if (persist) 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","<div class=\"bg-surface-container rounded-xl\">\n <div class=\"border-b border-b-default h-12 header\">\n <button ngsButton [ngsMenuTriggerFor]=\"languageListMenu\" class=\"-ms-2\">{{ _language().name }}</button>\n </div>\n <div class=\"content\">\n <div class=\"content-code\" #contentRef></div>\n </div>\n</div>\n\n<ngs-menu #languageListMenu=\"ngsMenu\">\n @for (languageItem of _languageList(); track $index) {\n <button ngs-menu-item (click)=\"selectLanguage(languageItem)\"\n class=\"[&.is-active]:!bg-secondary-fixed\"\n [class.is-active]=\"languageItem.language === _language().language\">{{ languageItem.name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ockComponent {
|
|
|
11
11
|
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
12
12
|
index = input.required(/* @ts-ignore */
|
|
13
13
|
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
14
|
+
props = input([], /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
|
|
14
16
|
initialized = signal(true, /* @ts-ignore */
|
|
15
17
|
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
16
18
|
getData() {
|
|
@@ -25,14 +27,14 @@ class DividerBlockComponent {
|
|
|
25
27
|
focus() {
|
|
26
28
|
}
|
|
27
29
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DividerBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: DividerBlockComponent, isStandalone: true, selector: "ngs-divider-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<ngs-divider/>\n", styles: [""], dependencies: [{ kind: "component", type: Divider, selector: "ngs-divider", inputs: ["vertical", "inset", "fixedHeight"], exportAs: ["ngsDivider"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: DividerBlockComponent, isStandalone: true, selector: "ngs-divider-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ngs-divider/>\n", styles: [""], dependencies: [{ kind: "component", type: Divider, selector: "ngs-divider", inputs: ["vertical", "inset", "fixedHeight"], exportAs: ["ngsDivider"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
29
31
|
}
|
|
30
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DividerBlockComponent, decorators: [{
|
|
31
33
|
type: Component,
|
|
32
34
|
args: [{ selector: 'ngs-divider-block', imports: [
|
|
33
35
|
Divider
|
|
34
36
|
], changeDetection: ChangeDetectionStrategy.Eager, template: "<ngs-divider/>\n" }]
|
|
35
|
-
}], 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 }] }] } });
|
|
37
|
+
}], 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 }] }] } });
|
|
36
38
|
|
|
37
39
|
export { DividerBlockComponent };
|
|
38
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-divider-block.component-
|
|
40
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-editor-divider-block.component-
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs","sources":["../../../projects/components/content-editor/src/_builder/divider-block/divider-block.component.ts","../../../projects/components/content-editor/src/_builder/divider-block/divider-block.component.html"],"sourcesContent":["import { Component, input, signal, ChangeDetectionStrategy } from '@angular/core';\nimport { Divider } from '@ngstarter-ui/components/divider';\nimport { ContentEditorDataBlock } from '../../types';\nimport { ContentEditorCodeBlockSettings } from '../code-block/code-block.component';\n\n@Component({\n selector: 'ngs-divider-block',\n imports: [\n Divider\n ],\n templateUrl: './divider-block.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrl: './divider-block.component.scss'\n})\nexport class DividerBlockComponent implements ContentEditorDataBlock {\n id = input.required<string>();\n content = input.required<string>();\n settings = input.required<ContentEditorCodeBlockSettings>();\n index = input.required<number>();\n props = input<unknown[]>([]);\n\n readonly initialized = signal(true);\n\n getData(): any {\n return {\n content: null,\n settings: this.settings()\n };\n }\n\n isEmpty(): boolean {\n return true;\n }\n\n focus() {\n }\n}\n","<ngs-divider/>\n"],"names":[],"mappings":";;;;MAca,qBAAqB,CAAA;IAChC,EAAE,GAAG,KAAK,CAAC,QAAQ;2EAAU;IAC7B,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAU;IAClC,QAAQ,GAAG,KAAK,CAAC,QAAQ;iFAAkC;IAC3D,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;IAChC,KAAK,GAAG,KAAK,CAAY,EAAE;8EAAC;IAEnB,WAAW,GAAG,MAAM,CAAC,IAAI;oFAAC;IAEnC,OAAO,GAAA;QACL,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;IACH;IAEA,OAAO,GAAA;AACL,QAAA,OAAO,IAAI;IACb;IAEA,KAAK,GAAA;IACL;uGArB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CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA;;2FAME,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBATjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,OAAA,EACpB;wBACP;qBACD,EAAA,eAAA,EAEgB,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,kBAAA,EAAA;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, DestroyRef, input, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { C as ContentBuilderStore, a as CONTENT_BUILDER } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-
|
|
2
|
+
import { Injectable, inject, DestroyRef, input, signal, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { C as ContentBuilderStore, a as CONTENT_BUILDER } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { Icon } from '@ngstarter-ui/components/icon';
|
|
6
6
|
import { Popover, PopoverTriggerForDirective } from '@ngstarter-ui/components/popover';
|
|
@@ -307,6 +307,18 @@ class EmbedBlock {
|
|
|
307
307
|
...(ngDevMode ? [{ debugName: "_props" }] : /* istanbul ignore next */ []));
|
|
308
308
|
initialized = signal(false, /* @ts-ignore */
|
|
309
309
|
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
310
|
+
constructor() {
|
|
311
|
+
effect(() => {
|
|
312
|
+
const content = this.content();
|
|
313
|
+
const settings = this.settings();
|
|
314
|
+
const props = this.props();
|
|
315
|
+
untracked(() => {
|
|
316
|
+
this._content.set({ ...content });
|
|
317
|
+
this._settings.set({ ...settings });
|
|
318
|
+
this._props.set([...props]);
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
}
|
|
310
322
|
ngOnInit() {
|
|
311
323
|
this._content.set(this.content());
|
|
312
324
|
this._settings.set(this.settings());
|
|
@@ -357,7 +369,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
357
369
|
'class': 'ngs-embed-block',
|
|
358
370
|
'[class.is-empty]': 'isEmpty()'
|
|
359
371
|
}, template: "@if (isEmpty()) {\n <div class=\"bg-surface-container-low cursor-pointer hover:bg-surface-container p-4 rounded-2xl flex items-center gap-3\"\n #trigger=\"ngsPopoverTriggerFor\"\n [ngsPopoverTriggerFor]=\"addPopover\" position=\"below-center\" trigger=\"click\" hasBackdrop>\n <ngs-icon name=\"fluent:globe-24-regular\"/>\n <div class=\"text-sm\">Embed anything (PDFs, Google Docs, Google Maps, Spotify\u2026)</div>\n </div>\n <ngs-popover #addPopover>\n <div class=\"w-[400px] overflow-hidden\">\n <ngs-tab-group>\n <ngs-tab label=\"Embed\">\n <div class=\"p-4\">\n <ngs-form-field class=\"w-full\">\n <input ngsInput [formControl]=\"form.controls.url\" placeholder=\"Paste in https://...\">\n <div ngsSuffix class=\"pe-2\">\n <button ngsButton=\"filled\" type=\"button\" [disabled]=\"form.invalid\" (click)=\"embed(trigger)\">Embed</button>\n </div>\n </ngs-form-field>\n <p class=\"text-xs text-center\">Works with links of PDFs, Google Drive, Google Maps, CodePen\u2026</p>\n </div>\n </ngs-tab>\n <ngs-tab label=\"Upload\">\n <div class=\"p-4\">\n <div>\n <button ngsButton=\"filled\" class=\"w-full\">Upload</button>\n </div>\n <p class=\"text-xs text-center mt-4\">Upload a file from your computer.</p>\n </div>\n </ngs-tab>\n </ngs-tab-group>\n </div>\n </ngs-popover>\n} @else {\n <div class=\"w-full bg-surface-container-low w-[700px] h-[400px]\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"_content().url | safeResourceUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </div>\n}\n" }]
|
|
360
|
-
}], 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 }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }] } });
|
|
372
|
+
}], 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 }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }] } });
|
|
361
373
|
|
|
362
374
|
export { EmbedBlock };
|
|
363
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-embed-block-
|
|
375
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-embed-block-DhFxtMQS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-embed-block-DhFxtMQS.mjs","sources":["../../../projects/components/content-editor/src/_builder/embed-block/embed-service.ts","../../../projects/components/content-editor/src/_builder/embed-block/embed-block.ts","../../../projects/components/content-editor/src/_builder/embed-block/embed-block.html"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable()\nexport class EmbedService {\n parse(rawUrl: string): { url: string; type: string } {\n const cleaned = (rawUrl || '').trim();\n if (!cleaned) {\n return { url: '', type: '' };\n }\n\n const withScheme = /^(https?:)?\\/\\//i.test(cleaned) ? cleaned : `https://${cleaned}`;\n\n let u: URL | null = null;\n try {\n u = new URL(withScheme);\n } catch {\n return { url: cleaned, type: '' };\n }\n\n const host = u.hostname.toLowerCase();\n const path = u.pathname.toLowerCase();\n const href = u.toString();\n\n if (path.endsWith('.pdf')) {\n return { url: href, type: 'pdf' };\n } else if (host.includes('youtu.be') || host.includes('youtube.com')) {\n return { url: this.toYoutubeEmbed(u), type: 'youtube' };\n } else if (host.includes('vimeo.com')) {\n return { url: this.toVimeoEmbed(u), type: 'vimeo' };\n } else if (host.includes('spotify.com')) {\n return { url: this.toSpotifyEmbed(u), type: 'spotify' };\n } else if (host.includes('maps.google.') || (host.includes('google.') && path.startsWith('/maps'))) {\n return { url: this.toGoogleMapsEmbed(u), type: 'google-maps' };\n } else if (host.includes('docs.google.')) {\n return { url: this.toGoogleDocsEmbed(u), type: 'google-docs' };\n } else if (host.includes('drive.google.')) {\n return { url: this.toGoogleDriveEmbed(u), type: 'google-drive' };\n } else if (host.includes('codepen.io')) {\n return { url: this.toCodepenEmbed(u), type: 'codepen' };\n } else if (host.includes('figma.com')) {\n return { url: this.toFigmaEmbed(u), type: 'figma' };\n } else if (host.includes('loom.com')) {\n return { url: this.toLoomEmbed(u), type: 'loom' };\n } else if (host.includes('twitter.com') || host === 'x.com' || host.endsWith('.x.com')) {\n return { url: this.toTwitterEmbed(u), type: 'twitter' };\n } else if (host.includes('instagram.com')) {\n return { url: this.toInstagramEmbed(u), type: 'instagram' };\n } else if (host.includes('tiktok.com')) {\n return { url: this.toTiktokEmbed(u), type: 'tiktok' };\n } else if (host.includes('soundcloud.com')) {\n return { url: this.toSoundcloudEmbed(u), type: 'soundcloud' };\n } else if (host.includes('stackblitz.com')) {\n return { url: this.toStackblitzEmbed(u), type: 'stackblitz' };\n } else if (host.includes('gist.github.com')) {\n return { url: href, type: 'gist' };\n } else {\n return { url: href, type: 'website' };\n }\n }\n\n // ==== Provider transformers ====\n private toYoutubeEmbed(u: URL): string {\n // Already embed\n if (/^\\/embed\\//.test(u.pathname)) {\n return `https://www.youtube.com${u.pathname}${u.search}`;\n }\n\n const host = u.hostname.toLowerCase();\n let id = '';\n let start = '';\n\n if (host.includes('youtu.be')) {\n id = u.pathname.split('/').filter(Boolean)[0] || '';\n // t or start\n start = this.extractYouTubeStart(u.searchParams);\n } else {\n // youtube.com variants\n if (u.searchParams.get('v')) {\n id = u.searchParams.get('v') || '';\n start = this.extractYouTubeStart(u.searchParams);\n } else if (u.pathname.startsWith('/shorts/')) {\n id = u.pathname.split('/')[2] || '';\n } else if (u.pathname.startsWith('/live/')) {\n id = u.pathname.split('/')[2] || '';\n }\n }\n\n const qs = start ? `?start=${start}` : '';\n return id ? `https://www.youtube.com/embed/${id}${qs}` : u.toString();\n }\n\n private extractYouTubeStart(params: URLSearchParams): string {\n const t = params.get('t') || params.get('start') || '';\n if (!t) return '';\n // t can be in format 1h2m3s or 90 or 1m30s\n const total = this.parseTimeToSeconds(t);\n return total ? String(total) : '';\n }\n\n private parseTimeToSeconds(t: string): number {\n if (/^\\d+$/.test(t)) return parseInt(t, 10);\n const re = /(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?/i;\n const m = t.match(re);\n if (!m) return 0;\n const h = parseInt(m[1] || '0', 10);\n const mnt = parseInt(m[2] || '0', 10);\n const s = parseInt(m[3] || '0', 10);\n return h * 3600 + mnt * 60 + s;\n }\n\n private toVimeoEmbed(u: URL): string {\n // extract last numeric id\n const parts = u.pathname.split('/').filter(Boolean);\n const last = parts[parts.length - 1] || '';\n const id = /^(\\d+)$/.test(last) ? last : (parts.includes('videos') ? parts[parts.indexOf('videos') + 1] : '');\n return id ? `https://player.vimeo.com/video/${id}` : u.toString();\n }\n\n private toSpotifyEmbed(u: URL): string {\n const parts = u.pathname.split('/').filter(Boolean);\n if (parts[0] === 'embed') return u.toString();\n // /{type}/{id}\n if (parts.length >= 2) {\n const type = parts[0];\n const id = parts[1];\n return `https://open.spotify.com/embed/${type}/${id}`;\n }\n return u.toString();\n }\n\n private toGoogleMapsEmbed(u: URL): string {\n const p = u.pathname;\n if (p.includes('/maps/embed') || u.searchParams.get('output') === 'embed') {\n return u.toString();\n }\n // Best-effort wrap original URL as query for embed\n return `https://www.google.com/maps?output=embed&q=${encodeURIComponent(u.toString())}`;\n }\n\n private toGoogleDocsEmbed(u: URL): string {\n // document, presentation, spreadsheets, forms\n const parts = u.pathname.split('/').filter(Boolean);\n if (parts.length >= 3) {\n const product = parts[0]; // document|presentation|spreadsheets|forms\n const kind = parts[1]; // usually 'd'\n const id = parts[2];\n if (product === 'document') {\n return `https://docs.google.com/document/d/${id}/preview`;\n }\n if (product === 'presentation') {\n return `https://docs.google.com/presentation/d/${id}/embed`;\n }\n if (product === 'spreadsheets') {\n return `https://docs.google.com/spreadsheets/d/${id}/preview`;\n }\n if (product === 'forms') {\n return `https://docs.google.com/forms/d/${id}/viewform?embedded=true`;\n }\n }\n return u.toString();\n }\n\n private toGoogleDriveEmbed(u: URL): string {\n // /file/d/{id}/view -> /file/d/{id}/preview\n const parts = u.pathname.split('/').filter(Boolean);\n const idx = parts.indexOf('d');\n if (parts[0] === 'file' && idx >= 0 && parts[idx + 1]) {\n const id = parts[idx + 1];\n return `https://drive.google.com/file/d/${id}/preview`;\n }\n // open?id=... -> uc?export=preview&id=...\n const openId = u.searchParams.get('id');\n if (openId) {\n return `https://drive.google.com/uc?export=preview&id=${encodeURIComponent(openId)}`;\n }\n return u.toString();\n }\n\n private toCodepenEmbed(u: URL): string {\n const parts = u.pathname.split('/').filter(Boolean);\n const user = parts[0];\n const mode = parts[1]; // pen|full|details|embed\n const id = parts[2];\n if (mode === 'embed') return u.toString();\n if (user && id) {\n return `https://codepen.io/${user}/embed/${id}`;\n }\n return u.toString();\n }\n\n private toFigmaEmbed(u: URL): string {\n return `https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(u.toString())}`;\n }\n\n private toLoomEmbed(u: URL): string {\n const parts = u.pathname.split('/').filter(Boolean);\n if (parts[0] === 'embed') return u.toString();\n // /share/{id}\n if (parts[0] === 'share' && parts[1]) {\n return `https://www.loom.com/embed/${parts[1]}`;\n }\n return u.toString();\n }\n\n private toTwitterEmbed(u: URL): string {\n // Use twitframe to get an embeddable iframe\n return `https://twitframe.com/show?url=${encodeURIComponent(u.toString())}`;\n }\n\n private toInstagramEmbed(u: URL): string {\n // Append /embed to post/reel URLs\n let p = u.pathname;\n if (!p.endsWith('/')) p += '/';\n if (!p.endsWith('embed/')) {\n p += 'embed/';\n }\n return `${u.protocol}//${u.host}${p}`;\n }\n\n private toTiktokEmbed(u: URL): string {\n // Expect /@user/video/{id}\n const parts = u.pathname.split('/').filter(Boolean);\n const idx = parts.indexOf('video');\n if (idx >= 0 && parts[idx + 1]) {\n const id = parts[idx + 1];\n return `https://www.tiktok.com/embed/v2/${id}`;\n }\n return u.toString();\n }\n\n private toSoundcloudEmbed(u: URL): string {\n return `https://w.soundcloud.com/player/?url=${encodeURIComponent(u.toString())}`;\n }\n\n private toStackblitzEmbed(u: URL): string {\n // Ensure we have the embed parameter for StackBlitz iframe\n const url = new URL(u.toString());\n if (url.searchParams.get('embed') !== '1') {\n url.searchParams.set('embed', '1');\n }\n // Keep other parameters like file, terminal, ctl, hideExplorer if provided by user\n return url.toString();\n }\n}\n","import { Component, effect, untracked, DestroyRef, inject, input, signal, ChangeDetectionStrategy } from '@angular/core';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport { Popover, PopoverTriggerForDirective } from '@ngstarter-ui/components/popover';\nimport { Tab, TabGroup } from '@ngstarter-ui/components/tabs';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { FormField, Suffix } from '@ngstarter-ui/components/form-field';\nimport { AbstractControl, FormBuilder, FormsModule, ReactiveFormsModule, ValidationErrors, ValidatorFn, Validators } from '@angular/forms';\nimport { EmbedService } from './embed-service';\nimport { SafeResourceUrlPipe } from '@ngstarter-ui/components/core';\nimport {\n CONTENT_BUILDER,\n ContentEditorEmbedBlockSettings,\n ContentEditorEmbedContent,\n ContentEditorItemProperty\n} from '../../types';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\n\n@Component({\n selector: 'app-embed-block',\n imports: [\n Icon,\n Popover,\n PopoverTriggerForDirective,\n TabGroup,\n Tab,\n Button,\n FormField,\n Input,\n Suffix,\n FormsModule,\n ReactiveFormsModule,\n SafeResourceUrlPipe\n ],\n providers: [EmbedService],\n templateUrl: './embed-block.html',\n styleUrl: './embed-block.scss',\n changeDetection: ChangeDetectionStrategy.Eager,\n host: {\n 'class': 'ngs-embed-block',\n '[class.is-empty]': 'isEmpty()'\n }\n})\nexport class EmbedBlock {\n private store = inject(ContentBuilderStore);\n private contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private destroyRef = inject(DestroyRef);\n private formBuilder = inject(FormBuilder);\n private embedService = inject(EmbedService);\n\n id = input.required<string>();\n content = input.required<ContentEditorEmbedContent>();\n settings = input.required<ContentEditorEmbedBlockSettings>();\n props = input<ContentEditorItemProperty[]>([]);\n index = input.required<number>();\n\n private readonly embedUrlValidator: ValidatorFn = (control: AbstractControl): ValidationErrors | null => {\n const value = (control.value ?? '').toString();\n\n if (!value.trim()) {\n return null;\n }\n\n const { type } = this.embedService.parse(value);\n\n if (!type || type === 'website') {\n return { embedUrl: true };\n }\n\n return null;\n };\n\n protected form = this.formBuilder.nonNullable.group({\n url: ['', [Validators.required, this.embedUrlValidator]],\n });\n\n protected _content = signal<ContentEditorEmbedContent>({\n url: '',\n type: ''\n });\n protected _settings = signal<ContentEditorEmbedBlockSettings>({\n width: null,\n height: null\n });\n protected _props = signal<ContentEditorItemProperty[]>([]);\n readonly initialized = signal(false);\n\n constructor() {\n effect(() => {\n const content = this.content();\n const settings = this.settings();\n const props = this.props();\n untracked(() => {\n this._content.set({ ...content });\n this._settings.set({ ...settings });\n this._props.set([...props]);\n });\n });\n }\n\n ngOnInit() {\n this._content.set(this.content());\n this._settings.set(this.settings());\n this._props.set(this.props());\n this.contentBuilder\n .focusChanged\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (this.store.focusedBlockId() === this.id()) {\n\n }\n });\n }\n\n getData(): any {\n return {\n content: this._content(),\n props: this._props(),\n settings: this._settings()\n };\n }\n\n isEmpty() {\n return this.getData().content.url === '' && this.getData().content.type === '';\n }\n\n embed(trigger: PopoverTriggerForDirective) {\n this._content.set(this.embedService.parse(this.form.value.url || ''));\n trigger.api.close();\n this.store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this.contentBuilder.emitContentChangeEvent();\n }\n}\n","@if (isEmpty()) {\n <div class=\"bg-surface-container-low cursor-pointer hover:bg-surface-container p-4 rounded-2xl flex items-center gap-3\"\n #trigger=\"ngsPopoverTriggerFor\"\n [ngsPopoverTriggerFor]=\"addPopover\" position=\"below-center\" trigger=\"click\" hasBackdrop>\n <ngs-icon name=\"fluent:globe-24-regular\"/>\n <div class=\"text-sm\">Embed anything (PDFs, Google Docs, Google Maps, Spotify…)</div>\n </div>\n <ngs-popover #addPopover>\n <div class=\"w-[400px] overflow-hidden\">\n <ngs-tab-group>\n <ngs-tab label=\"Embed\">\n <div class=\"p-4\">\n <ngs-form-field class=\"w-full\">\n <input ngsInput [formControl]=\"form.controls.url\" placeholder=\"Paste in https://...\">\n <div ngsSuffix class=\"pe-2\">\n <button ngsButton=\"filled\" type=\"button\" [disabled]=\"form.invalid\" (click)=\"embed(trigger)\">Embed</button>\n </div>\n </ngs-form-field>\n <p class=\"text-xs text-center\">Works with links of PDFs, Google Drive, Google Maps, CodePen…</p>\n </div>\n </ngs-tab>\n <ngs-tab label=\"Upload\">\n <div class=\"p-4\">\n <div>\n <button ngsButton=\"filled\" class=\"w-full\">Upload</button>\n </div>\n <p class=\"text-xs text-center mt-4\">Upload a file from your computer.</p>\n </div>\n </ngs-tab>\n </ngs-tab-group>\n </div>\n </ngs-popover>\n} @else {\n <div class=\"w-full bg-surface-container-low w-[700px] h-[400px]\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"_content().url | safeResourceUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </div>\n}\n"],"names":[],"mappings":";;;;;;;;;;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