@momentumcms/admin 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{momentumcms-admin-array-field.component-CLV4Ny9t.mjs → momentumcms-admin-array-field.component-DH6vaHO-.mjs} +5 -5
- package/fesm2022/{momentumcms-admin-array-field.component-CLV4Ny9t.mjs.map → momentumcms-admin-array-field.component-DH6vaHO-.mjs.map} +1 -1
- package/fesm2022/{momentumcms-admin-blocks-field.component-hHiTfUf9.mjs → momentumcms-admin-blocks-field.component-BxJRfiV3.mjs} +5 -5
- package/fesm2022/{momentumcms-admin-blocks-field.component-hHiTfUf9.mjs.map → momentumcms-admin-blocks-field.component-BxJRfiV3.mjs.map} +1 -1
- package/fesm2022/{momentumcms-admin-collapsible-field.component-BeskwGvi.mjs → momentumcms-admin-collapsible-field.component-CsjYCkGw.mjs} +5 -5
- package/fesm2022/{momentumcms-admin-collapsible-field.component-BeskwGvi.mjs.map → momentumcms-admin-collapsible-field.component-CsjYCkGw.mjs.map} +1 -1
- package/fesm2022/{momentumcms-admin-global-edit.page-D_ebIITz.mjs → momentumcms-admin-global-edit.page-CmLAM17O.mjs} +5 -5
- package/fesm2022/{momentumcms-admin-global-edit.page-D_ebIITz.mjs.map → momentumcms-admin-global-edit.page-CmLAM17O.mjs.map} +1 -1
- package/fesm2022/{momentumcms-admin-group-field.component-ffsgbC6o.mjs → momentumcms-admin-group-field.component-CMKcqfjy.mjs} +5 -5
- package/fesm2022/{momentumcms-admin-group-field.component-ffsgbC6o.mjs.map → momentumcms-admin-group-field.component-CMKcqfjy.mjs.map} +1 -1
- package/fesm2022/{momentumcms-admin-momentumcms-admin-De5FLr2L.mjs → momentumcms-admin-momentumcms-admin-BTZEdMNj.mjs} +1034 -198
- package/fesm2022/momentumcms-admin-momentumcms-admin-BTZEdMNj.mjs.map +1 -0
- package/fesm2022/{momentumcms-admin-relationship-field.component-DO0kyAkE.mjs → momentumcms-admin-relationship-field.component-DNZUCENa.mjs} +11 -6
- package/fesm2022/{momentumcms-admin-relationship-field.component-DO0kyAkE.mjs.map → momentumcms-admin-relationship-field.component-DNZUCENa.mjs.map} +1 -1
- package/fesm2022/{momentumcms-admin-rich-text-field.component-BvpufJs3.mjs → momentumcms-admin-rich-text-field.component-BVAQkX3O.mjs} +5 -5
- package/fesm2022/{momentumcms-admin-rich-text-field.component-BvpufJs3.mjs.map → momentumcms-admin-rich-text-field.component-BVAQkX3O.mjs.map} +1 -1
- package/fesm2022/{momentumcms-admin-row-field.component-C8ZsdA2w.mjs → momentumcms-admin-row-field.component-0F6cnUK_.mjs} +5 -5
- package/fesm2022/{momentumcms-admin-row-field.component-C8ZsdA2w.mjs.map → momentumcms-admin-row-field.component-0F6cnUK_.mjs.map} +1 -1
- package/fesm2022/{momentumcms-admin-tabs-field.component-Uatoyjg8.mjs → momentumcms-admin-tabs-field.component-qYlbl8Ud.mjs} +5 -5
- package/fesm2022/{momentumcms-admin-tabs-field.component-Uatoyjg8.mjs.map → momentumcms-admin-tabs-field.component-qYlbl8Ud.mjs.map} +1 -1
- package/fesm2022/momentumcms-admin.mjs +1 -1
- package/package.json +1 -1
- package/types/momentumcms-admin.d.ts +134 -64
- package/fesm2022/momentumcms-admin-momentumcms-admin-De5FLr2L.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Routes, CanActivateFn, CanDeactivateFn } from '@angular/router';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import { Type, InjectionToken, Signal, Provider, OnInit, WritableSignal, makeEnvironmentProviders } from '@angular/core';
|
|
4
|
-
import { CollectionConfig, GlobalConfig, PluginAdminRouteDescriptor, MomentumPlugin, MomentumConfig, MomentumAdminConfig, MediaDocument, AdminConfig, Field, DocumentStatus as DocumentStatus$1, BlockConfig, UploadField } from '@momentumcms/core';
|
|
4
|
+
import { CollectionConfig, GlobalConfig, PluginAdminRouteDescriptor, MomentumPlugin, MomentumConfig, MomentumAdminConfig, MediaDocument, AdminConfig, ImageSizeConfig, Field, DocumentStatus as DocumentStatus$1, BlockConfig, UploadField } from '@momentumcms/core';
|
|
5
5
|
import { HttpContextToken, HttpInterceptorFn } from '@angular/common/http';
|
|
6
6
|
import { Observable } from 'rxjs';
|
|
7
7
|
import * as _momentumcms_admin from '@momentumcms/admin';
|
|
@@ -2203,6 +2203,10 @@ interface MediaItem$1 {
|
|
|
2203
2203
|
alt?: string;
|
|
2204
2204
|
width?: number;
|
|
2205
2205
|
height?: number;
|
|
2206
|
+
focalPoint?: {
|
|
2207
|
+
x: number;
|
|
2208
|
+
y: number;
|
|
2209
|
+
};
|
|
2206
2210
|
}
|
|
2207
2211
|
/**
|
|
2208
2212
|
* Media Library Page
|
|
@@ -2211,6 +2215,7 @@ interface MediaItem$1 {
|
|
|
2211
2215
|
*/
|
|
2212
2216
|
declare class MediaLibraryPage {
|
|
2213
2217
|
private readonly document;
|
|
2218
|
+
private readonly route;
|
|
2214
2219
|
private readonly api;
|
|
2215
2220
|
private readonly uploadService;
|
|
2216
2221
|
private readonly feedback;
|
|
@@ -2218,6 +2223,8 @@ declare class MediaLibraryPage {
|
|
|
2218
2223
|
private readonly dialog;
|
|
2219
2224
|
private readonly destroyRef;
|
|
2220
2225
|
private readonly uploadSubscriptions;
|
|
2226
|
+
/** Image sizes config from the media collection (for crop previews in edit dialog) */
|
|
2227
|
+
readonly mediaImageSizes: ImageSizeConfig[];
|
|
2221
2228
|
/** Internal state */
|
|
2222
2229
|
readonly isLoading: _angular_core.WritableSignal<boolean>;
|
|
2223
2230
|
readonly mediaItems: _angular_core.WritableSignal<MediaItem$1[]>;
|
|
@@ -2523,8 +2530,35 @@ declare class EntityFormWidget<T extends Entity = Entity> {
|
|
|
2523
2530
|
readonly isUploadingFile: _angular_core.WritableSignal<boolean>;
|
|
2524
2531
|
readonly uploadFileProgress: _angular_core.WritableSignal<number>;
|
|
2525
2532
|
readonly uploadFileError: _angular_core.WritableSignal<string | null>;
|
|
2533
|
+
/** Preview URL for the pending image file (focal point picker) */
|
|
2534
|
+
readonly pendingFileUrl: _angular_core.WritableSignal<string | null>;
|
|
2535
|
+
/** Detected dimensions of the pending image */
|
|
2536
|
+
readonly pendingImageDimensions: _angular_core.WritableSignal<{
|
|
2537
|
+
width: number;
|
|
2538
|
+
height: number;
|
|
2539
|
+
}>;
|
|
2526
2540
|
/** Whether the collection is an upload collection */
|
|
2527
2541
|
readonly isUploadCol: _angular_core.Signal<boolean>;
|
|
2542
|
+
/** Whether the current file (pending or existing) is an image */
|
|
2543
|
+
readonly isImageFile: _angular_core.Signal<boolean>;
|
|
2544
|
+
/** Image sizes from collection upload config */
|
|
2545
|
+
readonly uploadImageSizes: _angular_core.Signal<ImageSizeConfig[]>;
|
|
2546
|
+
/** Image URL for the focal point picker */
|
|
2547
|
+
readonly focalPointImageUrl: _angular_core.Signal<string>;
|
|
2548
|
+
/** Current focal point value */
|
|
2549
|
+
readonly currentFocalPoint: _angular_core.Signal<{
|
|
2550
|
+
x: number;
|
|
2551
|
+
y: number;
|
|
2552
|
+
}>;
|
|
2553
|
+
/** Natural image dimensions (pending file detection or existing media) */
|
|
2554
|
+
readonly imageNaturalDimensions: _angular_core.Signal<{
|
|
2555
|
+
width: number;
|
|
2556
|
+
height: number;
|
|
2557
|
+
}>;
|
|
2558
|
+
/** Alt text for the focal point picker */
|
|
2559
|
+
readonly focalPointAlt: _angular_core.Signal<string>;
|
|
2560
|
+
/** Generated image sizes from the form model */
|
|
2561
|
+
readonly formModelSizes: _angular_core.Signal<Record<string, unknown> | null>;
|
|
2528
2562
|
/** Whether the form has been set up */
|
|
2529
2563
|
private formCreated;
|
|
2530
2564
|
/** Whether the form has unsaved changes (from signal forms dirty tracking) */
|
|
@@ -2565,6 +2599,13 @@ declare class EntityFormWidget<T extends Entity = Entity> {
|
|
|
2565
2599
|
* Auto-populates metadata fields in the form model.
|
|
2566
2600
|
*/
|
|
2567
2601
|
onFileSelected(file: File): void;
|
|
2602
|
+
/**
|
|
2603
|
+
* Handle focal point change from the picker.
|
|
2604
|
+
*/
|
|
2605
|
+
onFocalPointChange(fp: {
|
|
2606
|
+
x: number;
|
|
2607
|
+
y: number;
|
|
2608
|
+
}): void;
|
|
2568
2609
|
/**
|
|
2569
2610
|
* Handle file removed from the upload zone.
|
|
2570
2611
|
*/
|
|
@@ -2636,6 +2677,63 @@ interface EntityViewActionEvent {
|
|
|
2636
2677
|
entity: Entity;
|
|
2637
2678
|
}
|
|
2638
2679
|
|
|
2680
|
+
/**
|
|
2681
|
+
* Media document data for preview.
|
|
2682
|
+
*/
|
|
2683
|
+
interface MediaPreviewData {
|
|
2684
|
+
url?: string;
|
|
2685
|
+
path?: string;
|
|
2686
|
+
mimeType?: string;
|
|
2687
|
+
filename?: string;
|
|
2688
|
+
alt?: string;
|
|
2689
|
+
}
|
|
2690
|
+
/**
|
|
2691
|
+
* Media Preview Component
|
|
2692
|
+
*
|
|
2693
|
+
* Displays a preview of media based on its type:
|
|
2694
|
+
* - Images: Thumbnail preview
|
|
2695
|
+
* - Videos: Video icon with optional poster
|
|
2696
|
+
* - Audio: Audio icon
|
|
2697
|
+
* - Documents: Document icon
|
|
2698
|
+
* - Other: Generic file icon
|
|
2699
|
+
*
|
|
2700
|
+
* @example
|
|
2701
|
+
* ```html
|
|
2702
|
+
* <mcms-media-preview
|
|
2703
|
+
* [media]="mediaDocument"
|
|
2704
|
+
* [size]="'md'"
|
|
2705
|
+
* />
|
|
2706
|
+
* ```
|
|
2707
|
+
*/
|
|
2708
|
+
declare class MediaPreviewComponent {
|
|
2709
|
+
/** Media data to preview */
|
|
2710
|
+
readonly media: _angular_core.InputSignal<MediaPreviewData | null>;
|
|
2711
|
+
/** Size of the preview */
|
|
2712
|
+
readonly size: _angular_core.InputSignal<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
2713
|
+
/** Custom class override */
|
|
2714
|
+
readonly class: _angular_core.InputSignal<string>;
|
|
2715
|
+
/** Whether to show rounded corners */
|
|
2716
|
+
readonly rounded: _angular_core.InputSignal<boolean>;
|
|
2717
|
+
/** Host classes */
|
|
2718
|
+
readonly hostClasses: _angular_core.Signal<string>;
|
|
2719
|
+
/** Size classes map */
|
|
2720
|
+
private readonly sizeClasses;
|
|
2721
|
+
/** Icon size classes */
|
|
2722
|
+
readonly iconClasses: _angular_core.Signal<string>;
|
|
2723
|
+
/** Whether the media is an image */
|
|
2724
|
+
readonly isImage: _angular_core.Signal<boolean>;
|
|
2725
|
+
/** Whether the media is a video */
|
|
2726
|
+
readonly isVideo: _angular_core.Signal<boolean>;
|
|
2727
|
+
/** Whether the media is audio */
|
|
2728
|
+
readonly isAudio: _angular_core.Signal<boolean>;
|
|
2729
|
+
/** Image URL for preview */
|
|
2730
|
+
readonly imageUrl: _angular_core.Signal<string>;
|
|
2731
|
+
/** Icon name based on media type */
|
|
2732
|
+
readonly iconName: _angular_core.Signal<"<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h1.5C5.496 19.5 6 18.996 6 18.375m-3.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-1.5A1.125 1.125 0 0 1 18 18.375M20.625 4.5H3.375m17.25 0c.621 0 1.125.504 1.125 1.125M20.625 4.5h-1.5C18.504 4.5 18 5.004 18 5.625m3.75 0v1.5c0 .621-.504 1.125-1.125 1.125M3.375 4.5c-.621 0-1.125.504-1.125 1.125M3.375 4.5h1.5C5.496 4.5 6 5.004 6 5.625m-3.75 0v1.5c0 .621.504 1.125 1.125 1.125m0 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m1.5-3.75C5.496 8.25 6 7.746 6 7.125v-1.5M4.875 8.25C5.496 8.25 6 8.754 6 9.375v1.5m0-5.25v5.25m0-5.25C6 5.004 6.504 4.5 7.125 4.5h9.75c.621 0 1.125.504 1.125 1.125m1.125 2.625h1.5m-1.5 0A1.125 1.125 0 0 1 18 7.125v-1.5m1.125 2.625c-.621 0-1.125.504-1.125 1.125v1.5m2.625-2.625c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125M18 5.625v5.25M7.125 12h9.75m-9.75 0A1.125 1.125 0 0 1 6 10.875M7.125 12C6.504 12 6 12.504 6 13.125m0-2.25C6 11.496 5.496 12 4.875 12M18 10.875c0 .621-.504 1.125-1.125 1.125M18 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m-12 5.25v-5.25m0 5.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125m-12 0v-1.5c0-.621-.504-1.125-1.125-1.125M18 18.375v-5.25m0 5.25v-1.5c0-.621.504-1.125 1.125-1.125M18 13.125v1.5c0 .621.504 1.125 1.125 1.125M18 13.125c0-.621.504-1.125 1.125-1.125M6 13.125v1.5c0 .621-.504 1.125-1.125 1.125M6 13.125C6 12.504 5.496 12 4.875 12m-1.5 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M19.125 12h1.5m0 0c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h1.5m14.25 0h1.5\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m9 9 10.5-3m0 6.553v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 1 1-.99-3.467l2.31-.66a2.25 2.25 0 0 0 1.632-2.163Zm0 0V2.25L9 5.25v10.303m0 0v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 0 1-.99-3.467l2.31-.66A2.25 2.25 0 0 0 9 15.553Z\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\"></path></svg>">;
|
|
2733
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MediaPreviewComponent, never>;
|
|
2734
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MediaPreviewComponent, "mcms-media-preview", never, { "media": { "alias": "media"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2639
2737
|
/**
|
|
2640
2738
|
* Entity View Widget
|
|
2641
2739
|
*
|
|
@@ -2703,6 +2801,28 @@ declare class EntityViewWidget<T extends Entity = Entity> {
|
|
|
2703
2801
|
readonly canEdit: _angular_core.Signal<boolean>;
|
|
2704
2802
|
/** Whether user can delete */
|
|
2705
2803
|
readonly canDelete: _angular_core.Signal<boolean>;
|
|
2804
|
+
/** Whether this collection is an upload collection */
|
|
2805
|
+
readonly isUploadCol: _angular_core.Signal<boolean>;
|
|
2806
|
+
/** Whether the entity is an image */
|
|
2807
|
+
readonly isEntityImage: _angular_core.Signal<boolean>;
|
|
2808
|
+
/** Media URL for preview */
|
|
2809
|
+
readonly entityMediaUrl: _angular_core.Signal<string>;
|
|
2810
|
+
/** Focal point from entity data */
|
|
2811
|
+
readonly entityFocalPoint: _angular_core.Signal<{
|
|
2812
|
+
x: number;
|
|
2813
|
+
y: number;
|
|
2814
|
+
}>;
|
|
2815
|
+
/** Image dimensions from entity data */
|
|
2816
|
+
readonly entityDimensions: _angular_core.Signal<{
|
|
2817
|
+
width: number;
|
|
2818
|
+
height: number;
|
|
2819
|
+
}>;
|
|
2820
|
+
/** Image sizes from collection upload config */
|
|
2821
|
+
readonly viewImageSizes: _angular_core.Signal<ImageSizeConfig[]>;
|
|
2822
|
+
/** Generated image sizes from entity data */
|
|
2823
|
+
readonly entitySizes: _angular_core.Signal<Record<string, unknown> | null>;
|
|
2824
|
+
/** Media preview data for non-image files */
|
|
2825
|
+
readonly entityMediaPreview: _angular_core.Signal<MediaPreviewData | null>;
|
|
2706
2826
|
/** Whether collection has soft delete enabled */
|
|
2707
2827
|
readonly hasSoftDelete: _angular_core.Signal<boolean>;
|
|
2708
2828
|
/** Whether the current entity is soft-deleted */
|
|
@@ -3026,63 +3146,6 @@ declare class PublishControlsWidget {
|
|
|
3026
3146
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PublishControlsWidget, "mcms-publish-controls", never, { "collection": { "alias": "collection"; "required": true; "isSignal": true; }; "documentId": { "alias": "documentId"; "required": true; "isSignal": true; }; "documentLabel": { "alias": "documentLabel"; "required": false; "isSignal": true; }; "initialStatus": { "alias": "initialStatus"; "required": false; "isSignal": true; }; }, { "statusChanged": "statusChanged"; }, never, never, true, never>;
|
|
3027
3147
|
}
|
|
3028
3148
|
|
|
3029
|
-
/**
|
|
3030
|
-
* Media document data for preview.
|
|
3031
|
-
*/
|
|
3032
|
-
interface MediaPreviewData {
|
|
3033
|
-
url?: string;
|
|
3034
|
-
path?: string;
|
|
3035
|
-
mimeType?: string;
|
|
3036
|
-
filename?: string;
|
|
3037
|
-
alt?: string;
|
|
3038
|
-
}
|
|
3039
|
-
/**
|
|
3040
|
-
* Media Preview Component
|
|
3041
|
-
*
|
|
3042
|
-
* Displays a preview of media based on its type:
|
|
3043
|
-
* - Images: Thumbnail preview
|
|
3044
|
-
* - Videos: Video icon with optional poster
|
|
3045
|
-
* - Audio: Audio icon
|
|
3046
|
-
* - Documents: Document icon
|
|
3047
|
-
* - Other: Generic file icon
|
|
3048
|
-
*
|
|
3049
|
-
* @example
|
|
3050
|
-
* ```html
|
|
3051
|
-
* <mcms-media-preview
|
|
3052
|
-
* [media]="mediaDocument"
|
|
3053
|
-
* [size]="'md'"
|
|
3054
|
-
* />
|
|
3055
|
-
* ```
|
|
3056
|
-
*/
|
|
3057
|
-
declare class MediaPreviewComponent {
|
|
3058
|
-
/** Media data to preview */
|
|
3059
|
-
readonly media: _angular_core.InputSignal<MediaPreviewData | null>;
|
|
3060
|
-
/** Size of the preview */
|
|
3061
|
-
readonly size: _angular_core.InputSignal<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
3062
|
-
/** Custom class override */
|
|
3063
|
-
readonly class: _angular_core.InputSignal<string>;
|
|
3064
|
-
/** Whether to show rounded corners */
|
|
3065
|
-
readonly rounded: _angular_core.InputSignal<boolean>;
|
|
3066
|
-
/** Host classes */
|
|
3067
|
-
readonly hostClasses: _angular_core.Signal<string>;
|
|
3068
|
-
/** Size classes map */
|
|
3069
|
-
private readonly sizeClasses;
|
|
3070
|
-
/** Icon size classes */
|
|
3071
|
-
readonly iconClasses: _angular_core.Signal<string>;
|
|
3072
|
-
/** Whether the media is an image */
|
|
3073
|
-
readonly isImage: _angular_core.Signal<boolean>;
|
|
3074
|
-
/** Whether the media is a video */
|
|
3075
|
-
readonly isVideo: _angular_core.Signal<boolean>;
|
|
3076
|
-
/** Whether the media is audio */
|
|
3077
|
-
readonly isAudio: _angular_core.Signal<boolean>;
|
|
3078
|
-
/** Image URL for preview */
|
|
3079
|
-
readonly imageUrl: _angular_core.Signal<string>;
|
|
3080
|
-
/** Icon name based on media type */
|
|
3081
|
-
readonly iconName: _angular_core.Signal<"<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h1.5C5.496 19.5 6 18.996 6 18.375m-3.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-1.5A1.125 1.125 0 0 1 18 18.375M20.625 4.5H3.375m17.25 0c.621 0 1.125.504 1.125 1.125M20.625 4.5h-1.5C18.504 4.5 18 5.004 18 5.625m3.75 0v1.5c0 .621-.504 1.125-1.125 1.125M3.375 4.5c-.621 0-1.125.504-1.125 1.125M3.375 4.5h1.5C5.496 4.5 6 5.004 6 5.625m-3.75 0v1.5c0 .621.504 1.125 1.125 1.125m0 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m1.5-3.75C5.496 8.25 6 7.746 6 7.125v-1.5M4.875 8.25C5.496 8.25 6 8.754 6 9.375v1.5m0-5.25v5.25m0-5.25C6 5.004 6.504 4.5 7.125 4.5h9.75c.621 0 1.125.504 1.125 1.125m1.125 2.625h1.5m-1.5 0A1.125 1.125 0 0 1 18 7.125v-1.5m1.125 2.625c-.621 0-1.125.504-1.125 1.125v1.5m2.625-2.625c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125M18 5.625v5.25M7.125 12h9.75m-9.75 0A1.125 1.125 0 0 1 6 10.875M7.125 12C6.504 12 6 12.504 6 13.125m0-2.25C6 11.496 5.496 12 4.875 12M18 10.875c0 .621-.504 1.125-1.125 1.125M18 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m-12 5.25v-5.25m0 5.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125m-12 0v-1.5c0-.621-.504-1.125-1.125-1.125M18 18.375v-5.25m0 5.25v-1.5c0-.621.504-1.125 1.125-1.125M18 13.125v1.5c0 .621.504 1.125 1.125 1.125M18 13.125c0-.621.504-1.125 1.125-1.125M6 13.125v1.5c0 .621-.504 1.125-1.125 1.125M6 13.125C6 12.504 5.496 12 4.875 12m-1.5 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M19.125 12h1.5m0 0c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h1.5m14.25 0h1.5\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m9 9 10.5-3m0 6.553v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 1 1-.99-3.467l2.31-.66a2.25 2.25 0 0 0 1.632-2.163Zm0 0V2.25L9 5.25v10.303m0 0v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 0 1-.99-3.467l2.31-.66A2.25 2.25 0 0 0 9 15.553Z\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z\"></path></svg>" | "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\"></path></svg>">;
|
|
3082
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MediaPreviewComponent, never>;
|
|
3083
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MediaPreviewComponent, "mcms-media-preview", never, { "media": { "alias": "media"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
3084
|
-
}
|
|
3085
|
-
|
|
3086
3149
|
/** Device size preset for the preview iframe. */
|
|
3087
3150
|
type DeviceSize = 'desktop' | 'tablet' | 'mobile';
|
|
3088
3151
|
/**
|
|
@@ -3091,8 +3154,9 @@ type DeviceSize = 'desktop' | 'tablet' | 'mobile';
|
|
|
3091
3154
|
* Displays an iframe that shows a live preview of the document being edited.
|
|
3092
3155
|
*
|
|
3093
3156
|
* Two modes based on preview config type:
|
|
3094
|
-
* - `preview: true` (server-rendered HTML):
|
|
3095
|
-
*
|
|
3157
|
+
* - `preview: true` (server-rendered HTML): initial GET loads from database, then
|
|
3158
|
+
* subsequent form changes are POSTed to the same endpoint with the current form data
|
|
3159
|
+
* for realtime preview updates (no page reload needed).
|
|
3096
3160
|
* - `preview: string/function` (URL-based): iframe loads the page URL with scripts DISABLED.
|
|
3097
3161
|
* This prevents loading a second Angular app instance (with Vite HMR, SSR hydration, etc.)
|
|
3098
3162
|
* which causes tab crashes in dev mode. The SSR-rendered HTML displays correctly without JS.
|
|
@@ -3120,17 +3184,23 @@ declare class LivePreviewComponent {
|
|
|
3120
3184
|
private readonly refreshCounter;
|
|
3121
3185
|
/** Reference to the static iframe element (available when previewUrl is non-null) */
|
|
3122
3186
|
private readonly previewIframe;
|
|
3187
|
+
/** Whether the initial iframe load from GET is complete */
|
|
3188
|
+
private initialLoadDone;
|
|
3123
3189
|
/** Compute the raw preview URL */
|
|
3124
3190
|
readonly previewUrl: _angular_core.Signal<string | null>;
|
|
3125
3191
|
/** Computed iframe width based on device size */
|
|
3126
3192
|
readonly iframeWidth: _angular_core.Signal<string>;
|
|
3127
3193
|
/** Sandbox attribute value based on preview mode */
|
|
3128
3194
|
private readonly sandboxValue;
|
|
3129
|
-
/** Debounce timer for
|
|
3195
|
+
/** Debounce timer for live preview updates */
|
|
3130
3196
|
private debounceTimer;
|
|
3197
|
+
/** AbortController for in-flight POST requests */
|
|
3198
|
+
private fetchAbort;
|
|
3131
3199
|
constructor();
|
|
3132
|
-
/** Force iframe to reload */
|
|
3200
|
+
/** Force iframe to reload from server (GET) */
|
|
3133
3201
|
refreshPreview(): void;
|
|
3202
|
+
/** POST form data to the preview endpoint and write the HTML response to the iframe. */
|
|
3203
|
+
private fetchPreviewHtml;
|
|
3134
3204
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LivePreviewComponent, never>;
|
|
3135
3205
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LivePreviewComponent, "mcms-live-preview", never, { "preview": { "alias": "preview"; "required": true; "isSignal": true; }; "documentData": { "alias": "documentData"; "required": true; "isSignal": true; }; "collectionSlug": { "alias": "collectionSlug"; "required": true; "isSignal": true; }; "entityId": { "alias": "entityId"; "required": false; "isSignal": true; }; }, { "editBlockRequest": "editBlockRequest"; }, never, never, true, never>;
|
|
3136
3206
|
}
|
|
@@ -3391,8 +3461,8 @@ declare class FieldRenderer {
|
|
|
3391
3461
|
readonly resolvedComponent: _angular_core.WritableSignal<Type<unknown> | null>;
|
|
3392
3462
|
/** Error from lazy loading failure */
|
|
3393
3463
|
readonly loadError: _angular_core.WritableSignal<Error | null>;
|
|
3394
|
-
/** Registry key:
|
|
3395
|
-
readonly registryKey: _angular_core.Signal<"number" | "slug" | "email" | "json" | "text" | "textarea" | "richText" | "date" | "checkbox" | "select" | "radio" | "password" | "upload" | "relationship" | "array" | "group" | "blocks" | "point" | "tabs" | "collapsible" | "row" | "blocks-visual">;
|
|
3464
|
+
/** Registry key: maps field type + editor config to renderer registry keys */
|
|
3465
|
+
readonly registryKey: _angular_core.Signal<"number" | "slug" | "email" | "json" | "text" | "textarea" | "richText" | "date" | "checkbox" | "select" | "radio" | "password" | "upload" | "relationship" | "array" | "group" | "blocks" | "point" | "tabs" | "collapsible" | "row" | "blocks-visual" | "json-email-builder" | "json-form-builder">;
|
|
3396
3466
|
/** Inputs to pass to the dynamically loaded component via NgComponentOutlet */
|
|
3397
3467
|
readonly rendererInputs: _angular_core.Signal<{
|
|
3398
3468
|
field: Field;
|