@bluepic/embed 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,6 +48,8 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
48
48
  * field-level selects where the input-chrome is needed.
49
49
  */
50
50
  bordered?: boolean;
51
+ /** Extra classes for the popover (e.g. `flush-content-x` for an edge-to-edge `render-options` layout). */
52
+ popoverClasses?: string[];
51
53
  /** Accessible name for the default trigger. */
52
54
  ariaLabel?: string;
53
55
  /** Id of a visible label element; takes precedence over `ariaLabel`. */
@@ -66,6 +68,9 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
66
68
  suffix?: () => VNode[] | VNode;
67
69
  'render-options'?: (scope: {
68
70
  options: BxSelectOption<T>[];
71
+ isActive: (option: BxSelectOption<T>) => boolean;
72
+ select: (option: BxSelectOption<T>) => void;
73
+ close: () => void;
69
74
  }) => VNode[];
70
75
  'render-option-label'?: (scope: {
71
76
  option: BxSelectOption<T>;
@@ -7,6 +7,7 @@ import 'swiper/css';
7
7
  import 'swiper/css/navigation';
8
8
  import 'swiper/css/pagination';
9
9
  import 'swiper/css/scrollbar';
10
+ import type { EditorCanvas } from '../../util/canvases';
10
11
  import type { ExportAnalyticsSink } from '../../util/analytics';
11
12
  import { nextTick } from 'vue';
12
13
  type __VLS_Props = {
@@ -45,6 +46,15 @@ type __VLS_Props = {
45
46
  * byte-identical to before multi-canvas existed.
46
47
  */
47
48
  canvasId?: string;
49
+ /**
50
+ * True multi-format templates (canvases v2): EVERY canvas of the template,
51
+ * in position order, `canvasId` among them. With >= 2 the editor shows a
52
+ * format switcher next to Export (emitting `switch-canvas` — the host
53
+ * navigates and re-mounts with the same `data`) and the export popup offers
54
+ * the other formats for the same export. Omit for single-format templates
55
+ * and legacy name-collision groups (distinct templates — never switchable).
56
+ */
57
+ canvases?: EditorCanvas[];
48
58
  campaignId?: number;
49
59
  name: string;
50
60
  /**
@@ -3066,12 +3076,14 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
3066
3076
  }) => any;
3067
3077
  back: () => any;
3068
3078
  "update:batchRows": (args_0: BatchRow[]) => any;
3079
+ "switch-canvas": (canvasId: string, snapshotUrl: string | undefined) => any;
3069
3080
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
3070
3081
  "onUpdate:data"?: ((args_0: {
3071
3082
  [k: string]: unknown;
3072
3083
  }) => any) | undefined;
3073
3084
  onBack?: (() => any) | undefined;
3074
3085
  "onUpdate:batchRows"?: ((args_0: BatchRow[]) => any) | undefined;
3086
+ "onSwitch-canvas"?: ((canvasId: string, snapshotUrl: string | undefined) => any) | undefined;
3075
3087
  }>, {
3076
3088
  zoomAndPan: boolean;
3077
3089
  editMode: "single" | "batch" | "all";
@@ -0,0 +1,20 @@
1
+ import { type EditorCanvas } from '../../util/canvases';
2
+ type __VLS_Props = {
3
+ canvases: EditorCanvas[];
4
+ modelValue: string;
5
+ snapshots: Record<string, string>;
6
+ snapshotFailed?: Record<string, boolean>;
7
+ /** Long side of the preview box. */
8
+ boxSize?: number;
9
+ /** Move focus to the active option on mount (keyboard users land on it). */
10
+ autofocus?: boolean;
11
+ };
12
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ select: (canvasId: string) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onSelect?: ((canvasId: string) => any) | undefined;
16
+ }>, {
17
+ boxSize: number;
18
+ autofocus: boolean;
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
@@ -0,0 +1,52 @@
1
+ import type { Template } from '@bluepic/types';
2
+ import BxLiveTemplate from './BxLiveTemplate.vue';
3
+ import type { AssetProxyConfig } from '../../util/assetProxy';
4
+ import type { EditorCanvas } from '../../util/canvases';
5
+ type LiveTemplate = InstanceType<typeof BxLiveTemplate>;
6
+ type __VLS_Props = {
7
+ /** Scope of the page-wide snapshot cache (see util/canvasSnapshots). */
8
+ templateId: string;
9
+ canvases: EditorCanvas[];
10
+ activeCanvasId?: string;
11
+ data: {
12
+ [k: string]: unknown;
13
+ };
14
+ watermark: boolean;
15
+ /**
16
+ * The editor's own live template (the ACTIVE canvas). Snapshotted alongside
17
+ * the siblings so a picker shows every format with the same freshness.
18
+ */
19
+ activeLive?: LiveTemplate;
20
+ bxCoreVersion?: string;
21
+ cloudflarePagesHostname?: string;
22
+ assetProxy?: AssetProxyConfig;
23
+ };
24
+ /** Mount the sibling sandboxes (idempotent). */
25
+ declare function activate(): void;
26
+ /**
27
+ * The live renderer + serial of a sibling, once its sandbox is ready. Rejects
28
+ * on timeout / load error — the export pipeline then renders that canvas on
29
+ * the server instead (it addresses it by canvasId).
30
+ */
31
+ declare function renderer(id: string): Promise<{
32
+ live: LiveTemplate;
33
+ serial: Template.Serial;
34
+ }>;
35
+ /**
36
+ * Register a viewer of `snapshots` (switcher open, export popup open). Returns
37
+ * the release function. Snapshots only refresh while at least one is held.
38
+ */
39
+ declare function demand(): () => void;
40
+ /** The current snapshot of a format (the switch hands it to the host as stand-in). */
41
+ declare function snapshotUrl(id: string): string | undefined;
42
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {
43
+ activate: typeof activate;
44
+ demand: typeof demand;
45
+ renderer: typeof renderer;
46
+ snapshots: Record<string, string>;
47
+ snapshotFailed: Record<string, boolean>;
48
+ serials: import("vue").ShallowReactive<Record<string, Template.Serial>>;
49
+ serialErrors: Record<string, string>;
50
+ snapshotUrl: typeof snapshotUrl;
51
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { type EditorCanvas } from '../../util/canvases';
2
+ type __VLS_Props = {
3
+ canvases: EditorCanvas[];
4
+ modelValue: string;
5
+ /** canvasId → live snapshot URL (CanvasSiblings.snapshots). */
6
+ snapshots: Record<string, string>;
7
+ /** canvasId → the live snapshot failed; the stand-in is final (no shimmer). */
8
+ snapshotFailed?: Record<string, boolean>;
9
+ /** Called while the formats are shown; returns the release function. */
10
+ demand?: () => () => void;
11
+ /** Phone layout: icon button + bottom sheet instead of select + popover. */
12
+ mobile?: boolean;
13
+ /** Long side of the preview box. */
14
+ previewSize?: number;
15
+ };
16
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:modelValue": (canvasId: string) => any;
18
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
19
+ "onUpdate:modelValue"?: ((canvasId: string) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ export default _default;
@@ -1,6 +1,7 @@
1
1
  import { FieldsBridge, Studio } from '@bluepic/types';
2
2
  import { z } from '@hono/zod-openapi';
3
3
  import { ExportAnalytics } from '../../util/analytics';
4
+ import type { MultiCanvasExport } from '../../util/multiCanvasExport';
4
5
  type __VLS_Props = {
5
6
  templateId: string;
6
7
  campaignId: number;
@@ -29,6 +30,31 @@ type __VLS_Props = {
29
30
  * No-op when absent or when the export shouldn't bill.
30
31
  */
31
32
  consumeCredit?: () => Promise<void>;
33
+ /**
34
+ * The canvas `assets` were rendered from (its size drives the preview box;
35
+ * `segments` split it into several files). Absent = sized from the files.
36
+ */
37
+ primaryCanvas?: {
38
+ id: string;
39
+ width: number;
40
+ height: number;
41
+ segments?: {
42
+ x: number;
43
+ y: number;
44
+ };
45
+ };
46
+ /**
47
+ * True multi-format templates: every format of this export press, with the
48
+ * selection. When present, outputs deliver the ticked formats (and bill each)
49
+ * instead of just `assets`.
50
+ */
51
+ multiCanvas?: MultiCanvasExport;
52
+ /** canvasId → live snapshot of that format with the current data. */
53
+ snapshots?: Record<string, string>;
54
+ /** canvasId → its live snapshot failed; the server stand-in is final. */
55
+ snapshotFailed?: Record<string, boolean>;
56
+ /** Keeps `snapshots` fresh while the popup is open; returns the release. */
57
+ demandSnapshots?: () => () => void;
32
58
  };
33
59
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
34
60
  mediaType: "image" | "video";
@@ -0,0 +1,12 @@
1
+ declare var __VLS_5: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_5) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
@@ -32,6 +32,7 @@ export declare class BluepicEmbed extends EventTarget {
32
32
  readonly env: "prod" | "dev";
33
33
  readonly templateId: string;
34
34
  readonly canvasId?: string | undefined;
35
+ readonly canvases?: import("../main").EditorCanvas[] | undefined;
35
36
  readonly campaignId?: number | undefined;
36
37
  readonly name: string;
37
38
  readonly captions?: {
@@ -75,6 +76,7 @@ export declare class BluepicEmbed extends EventTarget {
75
76
  }) => any) | undefined;
76
77
  readonly onBack?: (() => any) | undefined;
77
78
  readonly "onUpdate:batchRows"?: ((args_0: import("../util/batch/useBatchRows").BatchRow[]) => any) | undefined;
79
+ readonly "onSwitch-canvas"?: ((canvasId: string, snapshotUrl: string | undefined) => any) | undefined;
78
80
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
79
81
  $attrs: {
80
82
  [x: string]: unknown;
@@ -90,7 +92,7 @@ export declare class BluepicEmbed extends EventTarget {
90
92
  $host: Element | null;
91
93
  $emit: ((event: "update:data", args_0: {
92
94
  [k: string]: unknown;
93
- }) => void) & ((event: "back") => void) & ((event: "update:batchRows", args_0: import("../util/batch/useBatchRows").BatchRow[]) => void);
95
+ }) => void) & ((event: "back") => void) & ((event: "update:batchRows", args_0: import("../util/batch/useBatchRows").BatchRow[]) => void) & ((event: "switch-canvas", canvasId: string, snapshotUrl: string | undefined) => void);
94
96
  $el: any;
95
97
  $options: import("vue").ComponentOptionsBase<Readonly<{
96
98
  bxCoreVersion?: string;
@@ -112,6 +114,7 @@ export declare class BluepicEmbed extends EventTarget {
112
114
  env: "prod" | "dev";
113
115
  templateId: string;
114
116
  canvasId?: string;
117
+ canvases?: import("../main").EditorCanvas[];
115
118
  campaignId?: number;
116
119
  name: string;
117
120
  captions?: {
@@ -156,6 +159,7 @@ export declare class BluepicEmbed extends EventTarget {
156
159
  }) => any) | undefined;
157
160
  onBack?: (() => any) | undefined;
158
161
  "onUpdate:batchRows"?: ((args_0: import("../util/batch/useBatchRows").BatchRow[]) => any) | undefined;
162
+ "onSwitch-canvas"?: ((canvasId: string, snapshotUrl: string | undefined) => any) | undefined;
159
163
  }>, {
160
164
  templateViewRef: Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
161
165
  bxCoreVersion?: string;
@@ -3082,6 +3086,7 @@ export declare class BluepicEmbed extends EventTarget {
3082
3086
  }) => any;
3083
3087
  back: () => any;
3084
3088
  "update:batchRows": (args_0: import("../util/batch/useBatchRows").BatchRow[]) => any;
3089
+ "switch-canvas": (canvasId: string, snapshotUrl: string | undefined) => any;
3085
3090
  }, string, {
3086
3091
  zoomAndPan: boolean;
3087
3092
  editMode: "single" | "batch" | "all";
@@ -3156,6 +3161,7 @@ export declare class BluepicEmbed extends EventTarget {
3156
3161
  env: "prod" | "dev";
3157
3162
  templateId: string;
3158
3163
  canvasId?: string;
3164
+ canvases?: import("../main").EditorCanvas[];
3159
3165
  campaignId?: number;
3160
3166
  name: string;
3161
3167
  captions?: {
@@ -3200,6 +3206,7 @@ export declare class BluepicEmbed extends EventTarget {
3200
3206
  }) => any) | undefined;
3201
3207
  onBack?: (() => any) | undefined;
3202
3208
  "onUpdate:batchRows"?: ((args_0: import("../util/batch/useBatchRows").BatchRow[]) => any) | undefined;
3209
+ "onSwitch-canvas"?: ((canvasId: string, snapshotUrl: string | undefined) => any) | undefined;
3203
3210
  }>, "templateViewRef" | ("zoomAndPan" | "editMode" | "videoBatchMaxSize" | "preCacheLocalRendering" | "liveViewOffsetDesktop" | "liveViewOffsetMobile")> & import("vue").ShallowUnwrapRef<{
3204
3211
  templateViewRef: Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
3205
3212
  bxCoreVersion?: string;
@@ -6150,6 +6157,7 @@ export declare class BluepicEmbed extends EventTarget {
6150
6157
  readonly env: "prod" | "dev";
6151
6158
  readonly templateId: string;
6152
6159
  readonly canvasId?: string | undefined;
6160
+ readonly canvases?: import("../main").EditorCanvas[] | undefined;
6153
6161
  readonly campaignId?: number | undefined;
6154
6162
  readonly name: string;
6155
6163
  readonly captions?: {
@@ -6193,6 +6201,7 @@ export declare class BluepicEmbed extends EventTarget {
6193
6201
  }) => any) | undefined;
6194
6202
  readonly onBack?: (() => any) | undefined;
6195
6203
  readonly "onUpdate:batchRows"?: ((args_0: import("../util/batch/useBatchRows").BatchRow[]) => any) | undefined;
6204
+ readonly "onSwitch-canvas"?: ((canvasId: string, snapshotUrl: string | undefined) => any) | undefined;
6196
6205
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
6197
6206
  $attrs: {
6198
6207
  [x: string]: unknown;
@@ -6208,7 +6217,7 @@ export declare class BluepicEmbed extends EventTarget {
6208
6217
  $host: Element | null;
6209
6218
  $emit: ((event: "update:data", args_0: {
6210
6219
  [k: string]: unknown;
6211
- }) => void) & ((event: "back") => void) & ((event: "update:batchRows", args_0: import("../util/batch/useBatchRows").BatchRow[]) => void);
6220
+ }) => void) & ((event: "back") => void) & ((event: "update:batchRows", args_0: import("../util/batch/useBatchRows").BatchRow[]) => void) & ((event: "switch-canvas", canvasId: string, snapshotUrl: string | undefined) => void);
6212
6221
  $el: any;
6213
6222
  $options: import("vue").ComponentOptionsBase<Readonly<{
6214
6223
  bxCoreVersion?: string;
@@ -6230,6 +6239,7 @@ export declare class BluepicEmbed extends EventTarget {
6230
6239
  env: "prod" | "dev";
6231
6240
  templateId: string;
6232
6241
  canvasId?: string;
6242
+ canvases?: import("../main").EditorCanvas[];
6233
6243
  campaignId?: number;
6234
6244
  name: string;
6235
6245
  captions?: {
@@ -6274,6 +6284,7 @@ export declare class BluepicEmbed extends EventTarget {
6274
6284
  }) => any) | undefined;
6275
6285
  onBack?: (() => any) | undefined;
6276
6286
  "onUpdate:batchRows"?: ((args_0: import("../util/batch/useBatchRows").BatchRow[]) => any) | undefined;
6287
+ "onSwitch-canvas"?: ((canvasId: string, snapshotUrl: string | undefined) => any) | undefined;
6277
6288
  }>, {
6278
6289
  templateViewRef: Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
6279
6290
  bxCoreVersion?: string;
@@ -9200,6 +9211,7 @@ export declare class BluepicEmbed extends EventTarget {
9200
9211
  }) => any;
9201
9212
  back: () => any;
9202
9213
  "update:batchRows": (args_0: import("../util/batch/useBatchRows").BatchRow[]) => any;
9214
+ "switch-canvas": (canvasId: string, snapshotUrl: string | undefined) => any;
9203
9215
  }, string, {
9204
9216
  zoomAndPan: boolean;
9205
9217
  editMode: "single" | "batch" | "all";
@@ -9274,6 +9286,7 @@ export declare class BluepicEmbed extends EventTarget {
9274
9286
  env: "prod" | "dev";
9275
9287
  templateId: string;
9276
9288
  canvasId?: string;
9289
+ canvases?: import("../main").EditorCanvas[];
9277
9290
  campaignId?: number;
9278
9291
  name: string;
9279
9292
  captions?: {
@@ -9318,6 +9331,7 @@ export declare class BluepicEmbed extends EventTarget {
9318
9331
  }) => any) | undefined;
9319
9332
  onBack?: (() => any) | undefined;
9320
9333
  "onUpdate:batchRows"?: ((args_0: import("../util/batch/useBatchRows").BatchRow[]) => any) | undefined;
9334
+ "onSwitch-canvas"?: ((canvasId: string, snapshotUrl: string | undefined) => any) | undefined;
9321
9335
  }>, "templateViewRef" | ("zoomAndPan" | "editMode" | "videoBatchMaxSize" | "preCacheLocalRendering" | "liveViewOffsetDesktop" | "liveViewOffsetMobile")> & import("vue").ShallowUnwrapRef<{
9322
9336
  templateViewRef: Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
9323
9337
  bxCoreVersion?: string;