diff --git a/core-web/libs/block-editor/src/lib/block-editor.module.ts b/core-web/libs/block-editor/src/lib/block-editor.module.ts index 90c2e692c6b4..a5060b91aa49 100644 --- a/core-web/libs/block-editor/src/lib/block-editor.module.ts +++ b/core-web/libs/block-editor/src/lib/block-editor.module.ts @@ -68,7 +68,7 @@ const initTranslations = (dotMessageService: DotMessageService) => { DialogModule, InputTextareaModule, PaginatorModule, - DotSpinnerModule, + DotSpinnerModule ], declarations: [ EditorDirective, diff --git a/core-web/libs/block-editor/src/lib/components/dot-block-editor/dot-block-editor.component.ts b/core-web/libs/block-editor/src/lib/components/dot-block-editor/dot-block-editor.component.ts index 6416b93d7e51..9bf78e8716b7 100644 --- a/core-web/libs/block-editor/src/lib/components/dot-block-editor/dot-block-editor.component.ts +++ b/core-web/libs/block-editor/src/lib/components/dot-block-editor/dot-block-editor.component.ts @@ -82,7 +82,7 @@ import { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DotBlockEditorComponent), multi: true - }, + } ] }) export class DotBlockEditorComponent implements OnInit, OnDestroy, ControlValueAccessor { diff --git a/core-web/libs/block-editor/src/lib/extensions/ai-image-prompt/ai-image-prompt.plugin.ts b/core-web/libs/block-editor/src/lib/extensions/ai-image-prompt/ai-image-prompt.plugin.ts index fb994b86a8bd..89f3977c3c20 100644 --- a/core-web/libs/block-editor/src/lib/extensions/ai-image-prompt/ai-image-prompt.plugin.ts +++ b/core-web/libs/block-editor/src/lib/extensions/ai-image-prompt/ai-image-prompt.plugin.ts @@ -52,7 +52,6 @@ export class AIImagePromptView { * @param {AIImagePromptViewProps} props - The properties for the component. */ constructor(props: AIImagePromptViewProps) { - const { editor, view, pluginKey, dialogService } = props; this.editor = editor; @@ -83,16 +82,16 @@ export class AIImagePromptView { style: { 'max-width': '1040px' }, data: { context } }); - - this.#dialogRef.onClose - .pipe(takeUntil(this.destroy$)) - .subscribe((selectedImage: DotGeneratedAIImage) => { - if (selectedImage) { - this.editor.chain().insertImage(selectedImage.response.contentlet).run(); - } - this.editor.commands.closeImagePrompt(); - }) + this.#dialogRef.onClose + .pipe(takeUntil(this.destroy$)) + .subscribe((selectedImage: DotGeneratedAIImage) => { + if (selectedImage) { + this.editor.chain().insertImage(selectedImage.response.contentlet).run(); + } + + this.editor.commands.closeImagePrompt(); + }); } } diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.ts index af43757d8b51..3ffe6dffd020 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.ts @@ -93,7 +93,7 @@ type SystemOptionsType = { DotBinaryFieldUrlModeComponent, DotBinaryFieldPreviewComponent, DotAIImagePromptComponent, - TooltipModule, + TooltipModule ], providers: [ DialogService, @@ -106,7 +106,7 @@ type SystemOptionsType = { multi: true, provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DotEditContentBinaryFieldComponent) - }, + } ], templateUrl: './dot-edit-content-binary-field.component.html', styleUrls: ['./dot-edit-content-binary-field.component.scss'], @@ -282,18 +282,18 @@ export class DotEditContentBinaryFieldComponent resizable: false, modal: true, width: '90%', - style: { 'max-width': '1040px' }, + style: { 'max-width': '1040px' } }); - + this.#dialogRef.onClose - .pipe( - filter((selectedImage: DotGeneratedAIImage) => !!selectedImage), - takeUntilDestroyed(this.#destroyRef) - ) - .subscribe((selectedImage: DotGeneratedAIImage) => { - const tempFile = this.parseToTempFile(selectedImage); - this.#dotBinaryFieldStore.setTempFile(tempFile); - }); + .pipe( + filter((selectedImage: DotGeneratedAIImage) => !!selectedImage), + takeUntilDestroyed(this.#destroyRef) + ) + .subscribe((selectedImage: DotGeneratedAIImage) => { + const tempFile = this.parseToTempFile(selectedImage); + this.#dotBinaryFieldStore.setTempFile(tempFile); + }); } /** diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts index d2bca691800d..6f75dabcf898 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts @@ -258,25 +258,25 @@ export class DotEditContentFileFieldComponent implements ControlValueAccessor, O resizable: false, modal: true, width: '90%', - style: { 'max-width': '1040px' }, + style: { 'max-width': '1040px' } }); - + this.#dialogRef.onClose - .pipe( - filter((selectedImage: DotGeneratedAIImage) => !!selectedImage), - map((selectedImage) => { - const previewFile: UploadedFile = { - source: 'contentlet', - file: selectedImage.response.contentlet, - }; - - return previewFile; - }), - takeUntilDestroyed(this.#destroyRef) - ) - .subscribe((file) => { - this.store.setPreviewFile(file); - }); + .pipe( + filter((selectedImage: DotGeneratedAIImage) => !!selectedImage), + map((selectedImage) => { + const previewFile: UploadedFile = { + source: 'contentlet', + file: selectedImage.response.contentlet + }; + + return previewFile; + }), + takeUntilDestroyed(this.#destroyRef) + ) + .subscribe((file) => { + this.store.setPreviewFile(file); + }); } /** diff --git a/core-web/libs/ui/src/lib/components/dot-ai-image-prompt/ai-image-prompt.component.html b/core-web/libs/ui/src/lib/components/dot-ai-image-prompt/ai-image-prompt.component.html index 1feb05a179a9..440eaff88cc9 100644 --- a/core-web/libs/ui/src/lib/components/dot-ai-image-prompt/ai-image-prompt.component.html +++ b/core-web/libs/ui/src/lib/components/dot-ai-image-prompt/ai-image-prompt.component.html @@ -1,47 +1,46 @@ @if (vm$ | async; as vm) { - -