@lightspeed/crane-api 1.0.0 → 1.0.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/dist/index.d.mts CHANGED
@@ -1,5 +1,262 @@
1
1
  import * as vue from 'vue';
2
- import { ComputedRef, App, Ref, Component } from 'vue';
2
+ import { ComputedRef, Component, App, Ref } from 'vue';
3
+
4
+ interface ButtonContent {
5
+ title: string;
6
+ type: ActionLinkType;
7
+ link?: string;
8
+ email?: string;
9
+ phone?: string;
10
+ tileDivId?: string;
11
+ pageId?: string;
12
+ pageUrl?: string;
13
+ hasTitle: boolean;
14
+ hasLink: boolean;
15
+ performAction: () => void;
16
+ }
17
+ declare function useButtonElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
18
+ title: string | undefined;
19
+ type: ActionLinkType | undefined;
20
+ link: string | undefined;
21
+ email: string | undefined;
22
+ phone: string | undefined;
23
+ tileDivId: string | null;
24
+ pageId: string | undefined;
25
+ pageUrl: string | undefined;
26
+ hasTitle: boolean;
27
+ hasLink: boolean;
28
+ performAction: (() => void) | undefined;
29
+ };
30
+
31
+ declare function useCategorySelectorElementContent<CONTENT>(elementName: string): {
32
+ categories: CategoryCollectionItemElement[];
33
+ categoryIds: number[];
34
+ hasContent: boolean;
35
+ hasCategories: boolean;
36
+ };
37
+
38
+ interface Card$1 {
39
+ title: string;
40
+ settings: Record<string, unknown>;
41
+ }
42
+ interface Deck {
43
+ cards: Card$1[];
44
+ }
45
+ declare enum EditorTypes {
46
+ INPUTBOX = "INPUTBOX",
47
+ TEXTAREA = "TEXTAREA",
48
+ BUTTON = "BUTTON",
49
+ IMAGE = "IMAGE",
50
+ TOGGLE = "TOGGLE",
51
+ SELECTBOX = "SELECTBOX"
52
+ }
53
+ declare function useDeckElementContent<CONTENT>(elementName: keyof CONTENT): {
54
+ hasContent: boolean;
55
+ cards: Card$1[] | undefined;
56
+ getReactiveRef: typeof getReactiveRef;
57
+ };
58
+ declare function getReactiveRef(card: Card$1 | undefined, editorType: EditorTypes, contentElementName: string): {
59
+ hasContent: boolean;
60
+ value: string | undefined;
61
+ } | {
62
+ title: string | undefined;
63
+ type: ActionLinkType | undefined;
64
+ link: string | undefined;
65
+ email: string | undefined;
66
+ phone: string | undefined;
67
+ tileDivId: string | null;
68
+ pageId: string | undefined;
69
+ pageUrl: string | undefined;
70
+ hasTitle: boolean;
71
+ hasLink: boolean;
72
+ performAction: (() => void) | undefined;
73
+ } | {
74
+ hasContent: boolean;
75
+ lowResolutionMobileImage: string;
76
+ highResolutionMobileImage: string;
77
+ lowResolutionDesktopImage: string;
78
+ highResolutionDesktopImage: string;
79
+ } | {
80
+ hasContent: boolean;
81
+ value: boolean | undefined;
82
+ } | undefined;
83
+
84
+ interface ImageContent {
85
+ hasContent: boolean;
86
+ lowResolutionMobileImage: string;
87
+ highResolutionMobileImage: string;
88
+ lowResolutionDesktopImage: string;
89
+ highResolutionDesktopImage: string;
90
+ }
91
+ declare function useImageElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
92
+ hasContent: boolean;
93
+ lowResolutionMobileImage: string;
94
+ highResolutionMobileImage: string;
95
+ lowResolutionDesktopImage: string;
96
+ highResolutionDesktopImage: string;
97
+ };
98
+
99
+ interface InputBoxContent {
100
+ hasContent: boolean;
101
+ value: string;
102
+ }
103
+ declare function useInputboxElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
104
+ hasContent: boolean;
105
+ value: string | undefined;
106
+ };
107
+
108
+ declare function useLogoElementContent<CONTENT>(): {
109
+ type: LogoType | undefined;
110
+ text: string | undefined;
111
+ image: {
112
+ lowResolutionMobileImage: string;
113
+ highResolutionMobileImage: string;
114
+ lowResolutionDesktopImage: string;
115
+ highResolutionDesktopImage: string;
116
+ };
117
+ };
118
+
119
+ declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): {
120
+ hasContent: boolean;
121
+ items: {
122
+ performAction: (() => void) | undefined;
123
+ id: string;
124
+ title?: string;
125
+ type?: ActionLinkType;
126
+ link?: string;
127
+ email?: string;
128
+ phone?: string;
129
+ tileIdForScroll?: string;
130
+ pageIdForNavigate?: string;
131
+ showStoreCategories?: boolean;
132
+ isSubmenuOpened?: boolean;
133
+ categoryId?: number;
134
+ }[];
135
+ };
136
+
137
+ declare function useNavigationMenuElementContent<CONTENT>(): {
138
+ hasContent: boolean;
139
+ items: {
140
+ performAction: (() => void) | undefined;
141
+ id: string;
142
+ title?: string;
143
+ type?: ActionLinkType;
144
+ link?: string;
145
+ email?: string;
146
+ phone?: string;
147
+ tileIdForScroll?: string;
148
+ pageIdForNavigate?: string;
149
+ showStoreCategories?: boolean;
150
+ isSubmenuOpened?: boolean;
151
+ categoryId?: number;
152
+ }[];
153
+ };
154
+
155
+ declare function useProductSelectorElementContent<CONTENT>(elementName: string): {
156
+ products: ProductListComponentItem[];
157
+ categories: CategoryListComponentItem[];
158
+ categoryId: number | undefined;
159
+ hasContent: boolean;
160
+ hasProducts: boolean;
161
+ };
162
+
163
+ interface SelectBoxContent {
164
+ hasContent: boolean;
165
+ value: string;
166
+ }
167
+ declare function useSelectboxElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
168
+ hasContent: boolean;
169
+ value: string | undefined;
170
+ };
171
+
172
+ interface TextAreaContent {
173
+ hasContent: boolean;
174
+ value: string;
175
+ }
176
+ declare function useTextareaElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
177
+ hasContent: boolean;
178
+ value: string | undefined;
179
+ };
180
+
181
+ interface ToggleContent {
182
+ hasContent: boolean;
183
+ value: boolean;
184
+ }
185
+ declare function useToggleElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
186
+ hasContent: boolean;
187
+ value: boolean | undefined;
188
+ };
189
+
190
+ /**
191
+ * Composable that provides translation functionality.
192
+ * Translations are loaded from globalThis.craneSharedTranslation injected during build.
193
+ * Works in both browser (client) and Node.js (server/SSR) environments.
194
+ *
195
+ * @returns An object with a `t` function that takes a translation key and returns the translated string
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * import { useTranslation } from '@lightspeed/crane';
200
+ *
201
+ * const { t } = useTranslation();
202
+ * const title = t('$label.shared.title');
203
+ * ```
204
+ */
205
+ declare function useTranslation(): {
206
+ t: (key: string) => string;
207
+ currentLanguageCode: vue.ComputedRef<string>;
208
+ };
209
+
210
+ declare function useBackgroundElementDesign<DESIGN>(elementName: keyof DESIGN): {
211
+ background: Background | undefined;
212
+ };
213
+
214
+ declare function useButtonElementDesign<DESIGN>(elementName: keyof DESIGN): {
215
+ appearance: ButtonAppearance | undefined;
216
+ font: string | undefined;
217
+ size: ButtonSize | undefined;
218
+ style: ButtonStyle | undefined;
219
+ color: Color | GlobalColorsString | undefined;
220
+ visible: boolean | undefined;
221
+ };
222
+
223
+ declare function useImageElementDesign<DESIGN>(elementName: keyof DESIGN): {
224
+ overlay: Overlay | undefined;
225
+ visible: boolean | undefined;
226
+ };
227
+
228
+ declare function useLayoutElementDesign(): {
229
+ layout: string | undefined;
230
+ };
231
+
232
+ declare function useLogoElementDesign<DESIGN>(): vue.ComputedRef<LogoDesignData>;
233
+
234
+ declare function useSelectboxElementDesign<DESIGN>(elementName: keyof DESIGN): {
235
+ value: string | undefined;
236
+ };
237
+
238
+ declare function useTextElementDesign<DESIGN>(elementName: keyof DESIGN): {
239
+ font: string | undefined;
240
+ size: number | GlobalTextSizeString | undefined;
241
+ bold: boolean | undefined;
242
+ italic: boolean | undefined;
243
+ color: Color | GlobalColorsString | undefined;
244
+ visible: boolean | undefined;
245
+ };
246
+
247
+ declare function useTextareaElementDesign<DESIGN>(elementName: keyof DESIGN): {
248
+ font: string | undefined;
249
+ size: number | GlobalTextSizeString | undefined;
250
+ bold: boolean | undefined;
251
+ italic: boolean | undefined;
252
+ color: Color | GlobalColorsString | undefined;
253
+ visible: boolean;
254
+ whiteSpace: string;
255
+ };
256
+
257
+ declare function useToggleElementDesign<DESIGN>(elementName: keyof DESIGN): {
258
+ enabled: boolean | undefined;
259
+ };
3
260
 
4
261
  declare enum ButtonTypeEnum {
5
262
  SCROLL_TO_TILE = "SCROLL_TO_TILE",
@@ -251,221 +508,35 @@ interface TemplateSettings {
251
508
  readonly sections: TemplateSection[];
252
509
  }
253
510
 
254
- interface ImageContentData {
255
- readonly borderInfo?: ImageBorderInfoData;
256
- readonly set: {
257
- [key in ImageSet]?: ImageInfoData;
258
- };
259
- }
260
-
261
- interface TemplateMetadata {
262
- readonly name: string;
263
- readonly description?: string;
264
- readonly preview_url?: string;
265
- readonly cover_image?: ImageContentData;
266
- }
267
-
268
- interface TextDesignEditor {
269
- readonly type: 'TEXT';
270
- readonly label: string | Record<string, string>;
271
- readonly colors: ReadonlyArray<string>;
272
- readonly sizes: ReadonlyArray<number>;
273
- defaults?: TextDesignEditorDefaults;
274
- }
275
- interface ButtonDesignEditor {
276
- readonly type: 'BUTTON';
277
- readonly label: string | Record<string, string>;
278
- defaults?: ButtonDesignEditorDefaults;
279
- }
280
- interface ImageDesignEditor {
281
- readonly type: 'IMAGE';
282
- readonly label: string | Record<string, string>;
283
- readonly static?: boolean;
284
- readonly colors: ReadonlyArray<string>;
285
- defaults?: ImageDesignEditorDefaults;
286
- }
287
- interface ToggleDesignEditor {
288
- readonly type: 'TOGGLE';
289
- readonly label: string | Record<string, string>;
290
- defaults?: Record<string, never>;
291
- }
292
- interface SelectboxDesignEditor {
293
- readonly type: 'SELECTBOX';
294
- readonly label: string | Record<string, string>;
295
- defaults?: Record<string, never>;
296
- }
297
- interface BackgroundDesignEditor {
298
- readonly type: 'BACKGROUND';
299
- readonly label: string | Record<string, string>;
300
- readonly colors: ReadonlyArray<string>;
301
- defaults?: BackgroundDesignEditorDefaults;
302
- }
303
- interface ColorPickerDesignEditor {
304
- readonly type: 'COLOR_PICKER';
305
- defaults?: ColorPickerDesignEditorDefaults;
306
- }
307
- interface LogoDesignEditor {
308
- readonly type: 'LOGO';
309
- readonly label?: string | Record<string, string>;
310
- readonly colors?: ReadonlyArray<string>;
311
- readonly sizes?: ReadonlyArray<number>;
312
- defaults?: LogoDesignEditorDefaults;
313
- }
314
- interface DividerDesignEditor {
315
- readonly type: 'DIVIDER';
316
- readonly label: string | Record<string, string>;
317
- defaults?: DesignEditorDefaults;
318
- }
319
- type DesignEditor = TextDesignEditor | ButtonDesignEditor | ImageDesignEditor | ToggleDesignEditor | SelectboxDesignEditor | ColorPickerDesignEditor | LogoDesignEditor | BackgroundDesignEditor | DividerDesignEditor;
320
-
321
- interface TextDesignEditorDefaults {
322
- readonly font?: string;
323
- readonly size?: number | string;
324
- readonly bold?: boolean;
325
- readonly italic?: boolean;
326
- readonly color?: string;
327
- readonly visible?: boolean;
328
- }
329
- interface ButtonDesignEditorDefaults {
330
- readonly appearance?: ButtonAppearanceEnum;
331
- readonly size?: ButtonSizeEnum;
332
- readonly shape?: ButtonShapeEnum | undefined;
333
- readonly font?: string;
334
- readonly color?: string;
335
- readonly visible?: boolean;
336
- }
337
- interface ImageDesignEditorDefaults {
338
- readonly overlay?: keyof typeof OverlayTypeEnum;
339
- readonly color?: string | string[];
340
- }
341
- interface ColorPickerDesignEditorDefaults {
342
- readonly color?: string;
343
- }
344
- interface BackgroundDesignEditorDefaults {
345
- readonly style?: keyof typeof BackgroundStyleEnum;
346
- readonly color?: string | string[];
347
- }
348
- interface LogoDesignEditorDefaults {
349
- readonly font?: string;
350
- readonly size?: number | string;
351
- readonly bold?: boolean;
352
- readonly italic?: boolean;
353
- readonly color?: string;
354
- readonly visible?: boolean;
355
- readonly spacing?: number;
356
- readonly frame?: Frame;
357
- readonly capitalization?: CapitalizationType;
358
- }
359
- type DesignEditorDefaults = TextDesignEditorDefaults | ButtonDesignEditorDefaults | ImageDesignEditorDefaults | ColorPickerDesignEditorDefaults | BackgroundDesignEditorDefaults | LogoDesignEditorDefaults | Record<string, never>;
360
-
361
- interface TextDesignEditorDefaultsTransformed {
362
- readonly font?: Font;
363
- readonly color?: Color$1 | string;
364
- readonly size?: TextSize | string;
365
- }
366
- interface ImageDesignEditorDefaultsTransformed {
367
- readonly overlay: Overlay$1;
368
- }
369
- interface ColorPickerDesignEditorDefaultsTransformed {
370
- readonly color?: Color$1;
371
- }
372
- interface ButtonDesignEditorDefaultsTransformed {
373
- readonly appearance?: string;
374
- readonly size?: string;
375
- readonly style?: string;
376
- readonly font?: Font;
377
- readonly color?: Color$1 | string;
378
- readonly visible?: boolean;
379
- }
380
- interface BackgroundDesignEditorDefaultsTransformed {
381
- readonly background: Background$1;
382
- }
383
- interface LogoDesignEditorDefaultsTransformed {
384
- readonly font?: Font;
385
- readonly color?: Color$1 | string;
386
- readonly size?: TextSize | string;
387
- readonly frame?: TransformedFrame;
388
- }
389
- type DesignEditorDefaultsTransformed = TextDesignEditorDefaultsTransformed | ButtonDesignEditorDefaultsTransformed | ImageDesignEditorDefaultsTransformed | BackgroundDesignEditorDefaultsTransformed | ColorPickerDesignEditorDefaultsTransformed | LogoDesignEditorDefaultsTransformed;
390
-
391
- type BackgroundType = 'solid' | 'gradient';
392
- interface SolidColor {
393
- color: Color$1 | undefined;
394
- }
395
- interface GradientColor {
396
- fromColor: Color$1 | undefined;
397
- toColor: Color$1 | undefined;
398
- }
399
- interface Background$1 {
400
- type: BackgroundType | undefined;
401
- solid: SolidColor | undefined;
402
- gradient: GradientColor | undefined;
403
- }
404
- interface BackgroundDesignData {
405
- background: Background$1 | undefined;
406
- }
407
-
408
- type ButtonAppearance$1 = 'solid-button' | 'outline-button' | 'text-link';
409
- type ButtonSize$1 = 'small' | 'medium' | 'large';
410
- type ButtonStyle$1 = 'round-corner' | 'rectangle' | 'pill';
411
- interface ButtonDesignData {
412
- appearance: ButtonAppearance$1 | undefined;
413
- font: string | GlobalFontsString | undefined;
414
- size: ButtonSize$1 | undefined;
415
- style: ButtonStyle$1 | undefined;
416
- color: Color$1 | GlobalColorsString$1 | undefined;
417
- visible: boolean;
418
- }
419
-
420
- type OverlayType = 'solid' | 'gradient' | 'none';
421
- interface Overlay$1 {
422
- type: OverlayType | undefined;
423
- solid: SolidColor | undefined;
424
- gradient: GradientColor | undefined;
425
- }
426
- interface ImageDesignData {
427
- overlay: Overlay$1 | undefined;
428
- visible: boolean;
429
- }
430
-
431
- interface TextDesignData {
432
- font: string | GlobalFontsString | undefined;
433
- size: number | GlobalTextSizeString$1 | undefined;
434
- bold: boolean | undefined;
435
- italic: boolean | undefined;
436
- color: Color$1 | undefined;
437
- visible: boolean;
438
- }
439
- interface TextareaDesignData extends TextDesignData {
440
- readonly whiteSpace: string;
441
- }
442
-
443
- interface ToggleDesignData {
444
- enabled: boolean | undefined;
445
- }
446
-
447
- interface SelectboxDesignData {
448
- value: string | undefined;
449
- }
450
-
451
- interface LayoutDesignData {
452
- layout: string | undefined;
453
- }
454
-
455
- interface LogoDesignData$1 {
456
- font: string | undefined;
457
- size: number | undefined;
458
- bold: boolean | undefined;
459
- italic: boolean | undefined;
460
- color: Color$1 | undefined;
461
- visible: boolean | undefined;
462
- spacing: number | undefined;
463
- capitalization: CapitalizationType | undefined;
464
- frame: TransformedFrame | undefined;
511
+ declare const TemplateCategoriesList: {
512
+ readonly apparel_footwear: "apparel_footwear";
513
+ readonly vape_smoke: "vape_smoke";
514
+ readonly home_garden: "home_garden";
515
+ readonly sport_outdoor: "sport_outdoor";
516
+ readonly jewelry_accessories: "jewelry_accessories";
517
+ readonly pet_animals: "pet_animals";
518
+ readonly bikes: "bikes";
519
+ readonly health_beauty: "health_beauty";
520
+ readonly gift_shop: "gift_shop";
521
+ readonly electronics: "electronics";
522
+ readonly other: "other";
523
+ };
524
+ type TemplateCategory = typeof TemplateCategoriesList[keyof typeof TemplateCategoriesList];
525
+
526
+ interface ImageContentData {
527
+ readonly borderInfo?: ImageBorderInfoData;
528
+ readonly set: {
529
+ [key in ImageSet]?: ImageInfoData;
530
+ };
465
531
  }
466
532
 
467
- type DesignSettings = Record<string, DesignEditor>;
468
- type MandatoryDesignSettings = Record<'logo', LogoDesignEditor> | Record<string, never>;
533
+ interface TemplateMetadata {
534
+ readonly name: string;
535
+ readonly description?: string;
536
+ readonly preview_url?: string;
537
+ readonly cover_image?: ImageContentData;
538
+ readonly categories?: TemplateCategory[];
539
+ }
469
540
 
470
541
  interface InputboxContentEditor {
471
542
  readonly type: 'INPUTBOX';
@@ -582,52 +653,6 @@ interface ButtonContentData {
582
653
  readonly pageUrl?: string;
583
654
  }
584
655
 
585
- interface Card$1 {
586
- title: string;
587
- settings: Record<string, unknown>;
588
- }
589
- interface Deck {
590
- cards: Card$1[];
591
- }
592
- declare enum EditorTypes {
593
- INPUTBOX = "INPUTBOX",
594
- TEXTAREA = "TEXTAREA",
595
- BUTTON = "BUTTON",
596
- IMAGE = "IMAGE",
597
- TOGGLE = "TOGGLE",
598
- SELECTBOX = "SELECTBOX"
599
- }
600
- declare function useDeckElementContent<CONTENT>(elementName: keyof CONTENT): {
601
- hasContent: boolean;
602
- cards: Card$1[] | undefined;
603
- getReactiveRef: typeof getReactiveRef;
604
- };
605
- declare function getReactiveRef(card: Card$1 | undefined, editorType: EditorTypes, contentElementName: string): {
606
- hasContent: boolean;
607
- value: string | undefined;
608
- } | {
609
- hasContent: boolean;
610
- lowResolutionMobileImage: string;
611
- highResolutionMobileImage: string;
612
- lowResolutionDesktopImage: string;
613
- highResolutionDesktopImage: string;
614
- } | {
615
- hasContent: boolean;
616
- value: boolean | undefined;
617
- } | {
618
- title: string | undefined;
619
- type: ActionLinkType | undefined;
620
- link: string | undefined;
621
- email: string | undefined;
622
- phone: string | undefined;
623
- tileDivId: string | null;
624
- pageId: string | undefined;
625
- pageUrl: string | undefined;
626
- hasTitle: boolean;
627
- hasLink: boolean;
628
- performAction: (() => void) | undefined;
629
- } | undefined;
630
-
631
656
  interface Card {
632
657
  title: string;
633
658
  settings: ContentSettings;
@@ -688,419 +713,346 @@ type MandatoryContentSettings = {
688
713
  logo: LogoContentEditor;
689
714
  } | Record<string, never>;
690
715
 
691
- interface MenuItem {
692
- readonly id: string;
693
- readonly title?: string;
694
- readonly type?: string;
695
- readonly link?: string;
696
- readonly email?: string;
697
- readonly phone?: string;
698
- readonly tileIdForScroll?: string;
699
- readonly pageIdForNavigate?: string;
700
- readonly showStoreCategories?: boolean;
701
- readonly isSubmenuOpened?: boolean;
702
- readonly categoryId?: number;
703
- }
704
- interface ShowcaseInputboxContentEditorDefaults extends InputboxContentEditorDefaults {
705
- readonly type: 'INPUTBOX';
716
+ interface TextDesignEditor {
717
+ readonly type: 'TEXT';
718
+ readonly label: string | Record<string, string>;
719
+ readonly colors: ReadonlyArray<string>;
720
+ readonly sizes: ReadonlyArray<number>;
721
+ defaults?: TextDesignEditorDefaults;
706
722
  }
707
- interface ShowcaseTextareaContentEditorDefaults extends TextareaContentEditorDefaults {
708
- readonly type: 'TEXTAREA';
723
+ interface ButtonDesignEditor {
724
+ readonly type: 'BUTTON';
725
+ readonly label: string | Record<string, string>;
726
+ defaults?: ButtonDesignEditorDefaults;
709
727
  }
710
- interface ShowcaseImageContentEditorDefaults {
728
+ interface ImageDesignEditor {
711
729
  readonly type: 'IMAGE';
712
- readonly imageData?: ImageContentEditorDefaults;
713
- }
714
- interface ShowcaseDeckContentEditorDefaults {
715
- readonly type: 'DECK';
716
- readonly cards: ReadonlyArray<{
717
- settings: Record<string, ShowcaseContentEditorsDefaults>;
718
- }>;
719
- }
720
- interface ShowcaseLogoContentEditorDefaults {
721
- readonly type: 'LOGO';
722
- readonly logoType?: LogoType$1;
723
- readonly text?: string;
724
- readonly imageData?: ImageContentEditorDefaults;
725
- }
726
- interface ShowcaseMenuContentEditorDefaults {
727
- readonly type: 'MENU';
728
- readonly items?: ReadonlyArray<MenuItem>;
730
+ readonly label: string | Record<string, string>;
731
+ readonly static?: boolean;
732
+ readonly colors: ReadonlyArray<string>;
733
+ defaults?: ImageDesignEditorDefaults;
729
734
  }
730
- interface ShowcaseNavigationMenuContentEditorDefaults {
731
- readonly type: 'NAVIGATION_MENU';
732
- readonly items?: ReadonlyArray<MenuItem>;
735
+ interface ToggleDesignEditor {
736
+ readonly type: 'TOGGLE';
737
+ readonly label: string | Record<string, string>;
738
+ defaults?: Record<string, never>;
733
739
  }
734
-
735
- type ShowcaseContentEditorsDefaults = ShowcaseInputboxContentEditorDefaults | ShowcaseTextareaContentEditorDefaults | ShowcaseDeckContentEditorDefaults | ShowcaseImageContentEditorDefaults | ShowcaseLogoContentEditorDefaults | ShowcaseMenuContentEditorDefaults | ShowcaseNavigationMenuContentEditorDefaults | Record<string, never>;
736
-
737
- interface Showcase {
738
- readonly showcaseId: string;
739
- readonly blockName?: string | Record<string, string>;
740
- readonly previewImage?: unknown;
741
- readonly content?: Record<string, ShowcaseContentEditorsDefaults>;
742
- readonly design?: Record<string, DesignEditorDefaults & {
743
- type: DesignEditor['type'];
744
- }>;
745
- readonly layoutId?: string;
740
+ interface SelectboxDesignEditor {
741
+ readonly type: 'SELECTBOX';
742
+ readonly label: string | Record<string, string>;
743
+ defaults?: Record<string, never>;
746
744
  }
747
- type ShowcaseOverride = Omit<Showcase, 'showcaseId' | 'previewImage'>;
748
-
749
- type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
750
- type ThreeDigits = `${Digit}${Digit}${Digit}`;
751
- type DefaultSectionBase = 'header' | 'cover' | 'announcement_bar' | 'slider' | 'special_offer' | 'customer_review' | 'company_info' | 'shipping_payment' | 'location' | 'store' | 'footer' | 'video' | 'image_gallery' | 'contact_info' | 'contacts_widget_whatsapp' | 'contacts_widget_instagram' | 'contacts_widget_facebook' | 'contacts_widget_phone';
752
- type DefaultSectionId = DefaultSectionBase | `${DefaultSectionBase}_${ThreeDigits}`;
753
- interface TemplateDefaultSection {
754
- readonly type: 'default';
755
- readonly id: DefaultSectionId;
745
+ interface BackgroundDesignEditor {
746
+ readonly type: 'BACKGROUND';
747
+ readonly label: string | Record<string, string>;
748
+ readonly colors: ReadonlyArray<string>;
749
+ defaults?: BackgroundDesignEditorDefaults;
756
750
  }
757
- interface TemplateCustomSection {
758
- readonly type: 'custom';
759
- readonly id: string;
760
- readonly showcase_id?: string;
761
- readonly showcase_overrides?: ShowcaseOverride;
762
- readonly content?: ContentSettings;
763
- readonly design?: DesignSettings;
751
+ interface ColorPickerDesignEditor {
752
+ readonly type: 'COLOR_PICKER';
753
+ defaults?: ColorPickerDesignEditorDefaults;
764
754
  }
765
- interface TemplateStorefrontSection {
766
- /** Section layout identifier. When not provided, the section will use the default layout. */
767
- readonly id?: string;
768
- readonly type: 'store';
755
+ interface LogoDesignEditor {
756
+ readonly type: 'LOGO';
757
+ readonly label?: string | Record<string, string>;
758
+ readonly colors?: ReadonlyArray<string>;
759
+ readonly sizes?: ReadonlyArray<number>;
760
+ defaults?: LogoDesignEditorDefaults;
769
761
  }
770
- type TemplateSection = TemplateDefaultSection | TemplateCustomSection | TemplateStorefrontSection;
771
-
772
- interface TemplatePage {
773
- id: string;
774
- type: TemplatePageEnum;
775
- readonly sections: TemplateSection[];
762
+ interface DividerDesignEditor {
763
+ readonly type: 'DIVIDER';
764
+ readonly label: string | Record<string, string>;
765
+ defaults?: DesignEditorDefaults;
776
766
  }
767
+ type DesignEditor = TextDesignEditor | ButtonDesignEditor | ImageDesignEditor | ToggleDesignEditor | SelectboxDesignEditor | ColorPickerDesignEditor | LogoDesignEditor | BackgroundDesignEditor | DividerDesignEditor;
777
768
 
778
- interface TemplateConfiguration {
779
- metadata: TemplateMetadata;
769
+ interface TextDesignEditorDefaults {
770
+ readonly font?: string;
771
+ readonly size?: number | string;
772
+ readonly bold?: boolean;
773
+ readonly italic?: boolean;
774
+ readonly color?: string;
775
+ readonly visible?: boolean;
780
776
  }
781
- interface TemplateSinglePageConfiguration extends TemplateConfiguration {
782
- readonly sections: TemplateSection[];
777
+ interface ButtonDesignEditorDefaults {
778
+ readonly appearance?: ButtonAppearanceEnum;
779
+ readonly size?: ButtonSizeEnum;
780
+ readonly shape?: ButtonShapeEnum | undefined;
781
+ readonly font?: string;
782
+ readonly color?: string;
783
+ readonly visible?: boolean;
783
784
  }
784
- interface TemplateMultiPageConfiguration extends TemplateConfiguration {
785
- readonly header: TemplateSection;
786
- readonly footer: TemplateSection;
787
- readonly pages: TemplatePage[];
785
+ interface ImageDesignEditorDefaults {
786
+ readonly overlay?: keyof typeof OverlayTypeEnum;
787
+ readonly color?: string | string[];
788
788
  }
789
- type TemplateConfigurationType = TemplateSinglePageConfiguration | TemplateMultiPageConfiguration | TemplatePage;
790
-
791
- interface StorePageConfiguration {
792
- readonly sections: [TemplateStorefrontSection];
789
+ interface ColorPickerDesignEditorDefaults {
790
+ readonly color?: string;
793
791
  }
794
-
795
- interface LayoutDesignOverride {
796
- readonly fieldName: string;
797
- readonly type: DesignEditor['type'];
798
- defaults?: DesignEditorDefaults & {
799
- type?: DesignEditor['type'];
800
- };
792
+ interface BackgroundDesignEditorDefaults {
793
+ readonly style?: keyof typeof BackgroundStyleEnum;
794
+ readonly color?: string | string[];
801
795
  }
802
- interface LayoutSettings {
803
- readonly layoutId: string;
804
- readonly layoutIcon: unknown;
805
- readonly selectedContentSettings: string[];
806
- readonly selectedDesignSettings: LayoutDesignOverride[];
796
+ interface LogoDesignEditorDefaults {
797
+ readonly font?: string;
798
+ readonly size?: number | string;
799
+ readonly bold?: boolean;
800
+ readonly italic?: boolean;
801
+ readonly color?: string;
802
+ readonly visible?: boolean;
803
+ readonly spacing?: number;
804
+ readonly frame?: Frame;
805
+ readonly capitalization?: CapitalizationType;
807
806
  }
807
+ type DesignEditorDefaults = TextDesignEditorDefaults | ButtonDesignEditorDefaults | ImageDesignEditorDefaults | ColorPickerDesignEditorDefaults | BackgroundDesignEditorDefaults | LogoDesignEditorDefaults | Record<string, never>;
808
808
 
809
- type TranslationSettings = Record<string, Record<string, string>>;
810
-
811
- interface AppBaseContext {
812
- readonly appName: string;
813
- readonly blockName: string;
814
- readonly version: string;
815
- readonly scriptUrl: string;
816
- readonly imageBuckets: Record<string, string>;
817
- readonly globalDesign: Record<string, Record<string, unknown>>;
809
+ interface TextDesignEditorDefaultsTransformed {
810
+ readonly font?: Font;
811
+ readonly color?: Color$1 | string;
812
+ readonly size?: TextSize | string;
818
813
  }
819
- interface AppBaseData<C, D> {
820
- readonly content: C;
821
- readonly design: D;
822
- readonly defaults: Record<string, unknown>;
823
- readonly externalContent: ExternalContentData;
814
+ interface ImageDesignEditorDefaultsTransformed {
815
+ readonly overlay: Overlay$1;
824
816
  }
825
- interface AppBaseState<C, D> {
826
- readonly context: AppBaseContext;
827
- readonly data: AppBaseData<C, D>;
817
+ interface ColorPickerDesignEditorDefaultsTransformed {
818
+ readonly color?: Color$1;
828
819
  }
829
-
830
- interface GlobalColors {
831
- title?: Color;
832
- body?: Color;
833
- button?: Color;
834
- link?: Color;
835
- background?: Color;
820
+ interface ButtonDesignEditorDefaultsTransformed {
821
+ readonly appearance?: string;
822
+ readonly size?: string;
823
+ readonly style?: string;
824
+ readonly font?: Font;
825
+ readonly color?: Color$1 | string;
826
+ readonly visible?: boolean;
836
827
  }
837
- interface GlobalFonts {
838
- title: string;
839
- body: string;
828
+ interface BackgroundDesignEditorDefaultsTransformed {
829
+ readonly background: Background$1;
840
830
  }
841
- interface GlobalTextSize {
842
- title: number;
843
- subtitle: number;
844
- body: number;
831
+ interface LogoDesignEditorDefaultsTransformed {
832
+ readonly font?: Font;
833
+ readonly color?: Color$1 | string;
834
+ readonly size?: TextSize | string;
835
+ readonly frame?: TransformedFrame;
845
836
  }
846
- interface GlobalButtonSize {
847
- small: number;
848
- medium: number;
849
- large: number;
837
+ type DesignEditorDefaultsTransformed = TextDesignEditorDefaultsTransformed | ButtonDesignEditorDefaultsTransformed | ImageDesignEditorDefaultsTransformed | BackgroundDesignEditorDefaultsTransformed | ColorPickerDesignEditorDefaultsTransformed | LogoDesignEditorDefaultsTransformed;
838
+
839
+ type BackgroundType = 'solid' | 'gradient';
840
+ interface SolidColor {
841
+ color: Color$1 | undefined;
850
842
  }
851
- type AppearanceEffectType = 'none' | 'fade-in' | 'fade-in-up';
852
- interface GlobalLayout {
853
- maxWidth: number;
854
- tileMargin: number;
855
- appearanceEffect: AppearanceEffectType;
843
+ interface GradientColor {
844
+ fromColor: Color$1 | undefined;
845
+ toColor: Color$1 | undefined;
856
846
  }
857
- interface GlobalDesign {
858
- color?: GlobalColors;
859
- fontFamily?: GlobalFonts;
860
- textSize?: GlobalTextSize;
861
- buttonSize?: GlobalButtonSize;
862
- layout?: GlobalLayout;
863
- customCss?: string;
847
+ interface Background$1 {
848
+ type: BackgroundType | undefined;
849
+ solid: SolidColor | undefined;
850
+ gradient: GradientColor | undefined;
864
851
  }
865
-
866
- interface VueBaseProps<CONTENT, DESIGN> {
867
- init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
868
- update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
869
- readonly context: Ref<AppBaseContext>;
870
- readonly content: Ref<CONTENT>;
871
- readonly design: Ref<DESIGN>;
872
- readonly defaults: Ref<Record<string, unknown>>;
873
- readonly site: Ref<SiteContent>;
874
- readonly category?: Ref<Category | undefined>;
875
- readonly storeData?: Ref<StoreData | undefined>;
876
- readonly globalDesign: Ref<GlobalDesign>;
852
+ interface BackgroundDesignData {
853
+ background: Background$1 | undefined;
877
854
  }
878
- declare function useVueBaseProps<CONTENT, DESIGN>(): VueBaseProps<CONTENT, DESIGN>;
879
855
 
880
- interface InputBoxContent {
881
- hasContent: boolean;
882
- value: string;
856
+ type ButtonAppearance$1 = 'solid-button' | 'outline-button' | 'text-link';
857
+ type ButtonSize$1 = 'small' | 'medium' | 'large';
858
+ type ButtonStyle$1 = 'round-corner' | 'rectangle' | 'pill';
859
+ interface ButtonDesignData {
860
+ appearance: ButtonAppearance$1 | undefined;
861
+ font: string | GlobalFontsString | undefined;
862
+ size: ButtonSize$1 | undefined;
863
+ style: ButtonStyle$1 | undefined;
864
+ color: Color$1 | GlobalColorsString$1 | undefined;
865
+ visible: boolean;
883
866
  }
884
- declare function useInputboxElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
885
- hasContent: boolean;
886
- value: string | undefined;
887
- };
888
867
 
889
- interface TextAreaContent {
890
- hasContent: boolean;
891
- value: string;
868
+ type OverlayType = 'solid' | 'gradient' | 'none';
869
+ interface Overlay$1 {
870
+ type: OverlayType | undefined;
871
+ solid: SolidColor | undefined;
872
+ gradient: GradientColor | undefined;
892
873
  }
893
- declare function useTextareaElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
894
- hasContent: boolean;
895
- value: string | undefined;
896
- };
897
-
898
- interface ButtonContent {
899
- title: string;
900
- type: ActionLinkType;
901
- link?: string;
902
- email?: string;
903
- phone?: string;
904
- tileDivId?: string;
905
- pageId?: string;
906
- pageUrl?: string;
907
- hasTitle: boolean;
908
- hasLink: boolean;
909
- performAction: () => void;
874
+ interface ImageDesignData {
875
+ overlay: Overlay$1 | undefined;
876
+ visible: boolean;
910
877
  }
911
- declare function useButtonElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
912
- title: string | undefined;
913
- type: ActionLinkType | undefined;
914
- link: string | undefined;
915
- email: string | undefined;
916
- phone: string | undefined;
917
- tileDivId: string | null;
918
- pageId: string | undefined;
919
- pageUrl: string | undefined;
920
- hasTitle: boolean;
921
- hasLink: boolean;
922
- performAction: (() => void) | undefined;
923
- };
924
878
 
925
- interface ImageContent {
926
- hasContent: boolean;
927
- lowResolutionMobileImage: string;
928
- highResolutionMobileImage: string;
929
- lowResolutionDesktopImage: string;
930
- highResolutionDesktopImage: string;
879
+ interface TextDesignData {
880
+ font: string | GlobalFontsString | undefined;
881
+ size: number | GlobalTextSizeString$1 | undefined;
882
+ bold: boolean | undefined;
883
+ italic: boolean | undefined;
884
+ color: Color$1 | undefined;
885
+ visible: boolean;
931
886
  }
932
- declare function useImageElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
933
- hasContent: boolean;
934
- lowResolutionMobileImage: string;
935
- highResolutionMobileImage: string;
936
- lowResolutionDesktopImage: string;
937
- highResolutionDesktopImage: string;
938
- };
939
-
940
- interface ToggleContent {
941
- hasContent: boolean;
942
- value: boolean;
887
+ interface TextareaDesignData extends TextDesignData {
888
+ readonly whiteSpace: string;
943
889
  }
944
- declare function useToggleElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
945
- hasContent: boolean;
946
- value: boolean | undefined;
947
- };
948
890
 
949
- interface SelectBoxContent {
950
- hasContent: boolean;
951
- value: string;
891
+ interface ToggleDesignData {
892
+ enabled: boolean | undefined;
952
893
  }
953
- declare function useSelectboxElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
954
- hasContent: boolean;
955
- value: string | undefined;
956
- };
957
-
958
- declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): {
959
- hasContent: boolean;
960
- items: {
961
- performAction: (() => void) | undefined;
962
- id: string;
963
- title?: string;
964
- type?: ActionLinkType;
965
- link?: string;
966
- email?: string;
967
- phone?: string;
968
- tileIdForScroll?: string;
969
- pageIdForNavigate?: string;
970
- showStoreCategories?: boolean;
971
- isSubmenuOpened?: boolean;
972
- categoryId?: number;
973
- }[];
974
- };
975
-
976
- declare function useNavigationMenuElementContent<CONTENT>(): {
977
- hasContent: boolean;
978
- items: {
979
- performAction: (() => void) | undefined;
980
- id: string;
981
- title?: string;
982
- type?: ActionLinkType;
983
- link?: string;
984
- email?: string;
985
- phone?: string;
986
- tileIdForScroll?: string;
987
- pageIdForNavigate?: string;
988
- showStoreCategories?: boolean;
989
- isSubmenuOpened?: boolean;
990
- categoryId?: number;
991
- }[];
992
- };
993
-
994
- declare function useLogoElementContent<CONTENT>(): {
995
- type: LogoType | undefined;
996
- text: string | undefined;
997
- image: {
998
- lowResolutionMobileImage: string;
999
- highResolutionMobileImage: string;
1000
- lowResolutionDesktopImage: string;
1001
- highResolutionDesktopImage: string;
1002
- };
1003
- };
1004
-
1005
- declare function useCategorySelectorElementContent<CONTENT>(elementName: string): {
1006
- categories: CategoryCollectionItemElement[];
1007
- categoryIds: number[];
1008
- hasContent: boolean;
1009
- hasCategories: boolean;
1010
- };
1011
-
1012
- declare function useProductSelectorElementContent<CONTENT>(elementName: string): {
1013
- products: ProductListComponentItem[];
1014
- categories: CategoryListComponentItem[];
1015
- categoryId: number | undefined;
1016
- hasContent: boolean;
1017
- hasProducts: boolean;
1018
- };
1019
894
 
1020
- /**
1021
- * Composable that provides translation functionality.
1022
- * Translations are loaded from globalThis.craneSharedTranslation injected during build.
1023
- * Works in both browser (client) and Node.js (server/SSR) environments.
1024
- *
1025
- * @returns An object with a `t` function that takes a translation key and returns the translated string
1026
- *
1027
- * @example
1028
- * ```ts
1029
- * import { useTranslation } from '@lightspeed/crane';
1030
- *
1031
- * const { t } = useTranslation();
1032
- * const title = t('$label.shared.title');
1033
- * ```
1034
- */
1035
- declare function useTranslation(): {
1036
- t: (key: string) => string;
1037
- currentLanguageCode: vue.ComputedRef<string>;
1038
- };
895
+ interface SelectboxDesignData {
896
+ value: string | undefined;
897
+ }
1039
898
 
1040
- declare function useTextElementDesign<DESIGN>(elementName: keyof DESIGN): {
1041
- font: string | undefined;
1042
- size: number | GlobalTextSizeString | undefined;
1043
- bold: boolean | undefined;
1044
- italic: boolean | undefined;
1045
- color: Color | GlobalColorsString | undefined;
1046
- visible: boolean | undefined;
1047
- };
899
+ interface LayoutDesignData {
900
+ layout: string | undefined;
901
+ }
1048
902
 
1049
- declare function useTextareaElementDesign<DESIGN>(elementName: keyof DESIGN): {
903
+ interface LogoDesignData$1 {
1050
904
  font: string | undefined;
1051
- size: number | GlobalTextSizeString | undefined;
905
+ size: number | undefined;
1052
906
  bold: boolean | undefined;
1053
907
  italic: boolean | undefined;
1054
- color: Color | GlobalColorsString | undefined;
1055
- visible: boolean;
1056
- whiteSpace: string;
1057
- };
1058
-
1059
- declare function useButtonElementDesign<DESIGN>(elementName: keyof DESIGN): {
1060
- appearance: ButtonAppearance | undefined;
1061
- font: string | undefined;
1062
- size: ButtonSize | undefined;
1063
- style: ButtonStyle | undefined;
1064
- color: Color | GlobalColorsString | undefined;
908
+ color: Color$1 | undefined;
1065
909
  visible: boolean | undefined;
1066
- };
910
+ spacing: number | undefined;
911
+ capitalization: CapitalizationType | undefined;
912
+ frame: TransformedFrame | undefined;
913
+ }
1067
914
 
1068
- declare function useImageElementDesign<DESIGN>(elementName: keyof DESIGN): {
1069
- overlay: Overlay | undefined;
1070
- visible: boolean | undefined;
1071
- };
915
+ type DesignSettings = Record<string, DesignEditor>;
916
+ type MandatoryDesignSettings = Record<'logo', LogoDesignEditor> | Record<string, never>;
1072
917
 
1073
- declare function useToggleElementDesign<DESIGN>(elementName: keyof DESIGN): {
1074
- enabled: boolean | undefined;
1075
- };
918
+ interface MenuItem {
919
+ readonly id: string;
920
+ readonly title?: string;
921
+ readonly type?: string;
922
+ readonly link?: string;
923
+ readonly email?: string;
924
+ readonly phone?: string;
925
+ readonly tileIdForScroll?: string;
926
+ readonly pageIdForNavigate?: string;
927
+ readonly showStoreCategories?: boolean;
928
+ readonly isSubmenuOpened?: boolean;
929
+ readonly categoryId?: number;
930
+ }
931
+ interface ShowcaseInputboxContentEditorDefaults extends InputboxContentEditorDefaults {
932
+ readonly type: 'INPUTBOX';
933
+ }
934
+ interface ShowcaseTextareaContentEditorDefaults extends TextareaContentEditorDefaults {
935
+ readonly type: 'TEXTAREA';
936
+ }
937
+ interface ShowcaseImageContentEditorDefaults {
938
+ readonly type: 'IMAGE';
939
+ readonly imageData?: ImageContentEditorDefaults;
940
+ }
941
+ interface ShowcaseDeckContentEditorDefaults {
942
+ readonly type: 'DECK';
943
+ readonly cards: ReadonlyArray<{
944
+ settings: Record<string, ShowcaseContentEditorsDefaults>;
945
+ }>;
946
+ }
947
+ interface ShowcaseLogoContentEditorDefaults {
948
+ readonly type: 'LOGO';
949
+ readonly logoType?: LogoType$1;
950
+ readonly text?: string;
951
+ readonly imageData?: ImageContentEditorDefaults;
952
+ }
953
+ interface ShowcaseMenuContentEditorDefaults {
954
+ readonly type: 'MENU';
955
+ readonly items?: ReadonlyArray<MenuItem>;
956
+ }
957
+ interface ShowcaseNavigationMenuContentEditorDefaults {
958
+ readonly type: 'NAVIGATION_MENU';
959
+ readonly items?: ReadonlyArray<MenuItem>;
960
+ }
1076
961
 
1077
- declare function useSelectboxElementDesign<DESIGN>(elementName: keyof DESIGN): {
1078
- value: string | undefined;
1079
- };
962
+ type ShowcaseContentEditorsDefaults = ShowcaseInputboxContentEditorDefaults | ShowcaseTextareaContentEditorDefaults | ShowcaseDeckContentEditorDefaults | ShowcaseImageContentEditorDefaults | ShowcaseLogoContentEditorDefaults | ShowcaseMenuContentEditorDefaults | ShowcaseNavigationMenuContentEditorDefaults | Record<string, never>;
1080
963
 
1081
- declare function useBackgroundElementDesign<DESIGN>(elementName: keyof DESIGN): {
1082
- background: Background | undefined;
1083
- };
964
+ interface Showcase {
965
+ readonly showcaseId: string;
966
+ readonly blockName?: string | Record<string, string>;
967
+ readonly previewImage?: unknown;
968
+ readonly content?: Record<string, ShowcaseContentEditorsDefaults>;
969
+ readonly design?: Record<string, DesignEditorDefaults & {
970
+ type: DesignEditor['type'];
971
+ }>;
972
+ readonly layoutId?: string;
973
+ }
974
+ type ShowcaseOverride = Omit<Showcase, 'showcaseId' | 'previewImage'>;
1084
975
 
1085
- declare function useLayoutElementDesign(): {
1086
- layout: string | undefined;
1087
- };
976
+ type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
977
+ type ThreeDigits = `${Digit}${Digit}${Digit}`;
978
+ type DefaultSectionBase = 'header' | 'cover' | 'announcement_bar' | 'slider' | 'special_offer' | 'customer_review' | 'company_info' | 'shipping_payment' | 'location' | 'store' | 'footer' | 'video' | 'image_gallery' | 'contact_info' | 'contacts_widget_whatsapp' | 'contacts_widget_instagram' | 'contacts_widget_facebook' | 'contacts_widget_phone';
979
+ type DefaultSectionId = DefaultSectionBase | `${DefaultSectionBase}_${ThreeDigits}`;
980
+ interface TemplateDefaultSection {
981
+ readonly type: 'default';
982
+ readonly id: DefaultSectionId;
983
+ }
984
+ interface TemplateCustomSection {
985
+ readonly type: 'custom';
986
+ readonly id: string;
987
+ readonly showcase_id?: string;
988
+ readonly showcase_overrides?: ShowcaseOverride;
989
+ readonly content?: ContentSettings;
990
+ readonly design?: DesignSettings;
991
+ }
992
+ interface TemplateStorefrontSection {
993
+ /** Section layout identifier. When not provided, the section will use the default layout. */
994
+ readonly id?: string;
995
+ readonly type: 'store';
996
+ }
997
+ type TemplateSection = TemplateDefaultSection | TemplateCustomSection | TemplateStorefrontSection;
1088
998
 
1089
- declare function useLogoElementDesign<DESIGN>(): vue.ComputedRef<LogoDesignData>;
999
+ interface TemplatePage {
1000
+ id: string;
1001
+ type: TemplatePageEnum;
1002
+ readonly sections: TemplateSection[];
1003
+ }
1090
1004
 
1091
- interface VueServerAppExtensions {
1092
- init?: (app: App<Element>) => void;
1093
- render?: <C, D>(app: App<Element>, context: AppBaseContext, data: AppBaseData<C, D>) => void;
1005
+ interface TemplateConfiguration {
1006
+ metadata: TemplateMetadata;
1094
1007
  }
1095
- interface VueRenderResult {
1096
- readonly html: string;
1097
- readonly state: unknown;
1008
+ interface TemplateSinglePageConfiguration extends TemplateConfiguration {
1009
+ readonly sections: TemplateSection[];
1098
1010
  }
1099
- declare function createVueServerApp<C, D>(appComponent: Component, extensions?: VueServerAppExtensions): {
1100
- init: () => {
1101
- render: (context: AppBaseContext, data: AppBaseData<C, D>) => Promise<VueRenderResult>;
1011
+ interface TemplateMultiPageConfiguration extends TemplateConfiguration {
1012
+ readonly header: TemplateSection;
1013
+ readonly footer: TemplateSection;
1014
+ readonly pages: TemplatePage[];
1015
+ }
1016
+ type TemplateConfigurationType = TemplateSinglePageConfiguration | TemplateMultiPageConfiguration | TemplatePage;
1017
+
1018
+ interface StorePageConfiguration {
1019
+ readonly sections: [TemplateStorefrontSection];
1020
+ }
1021
+
1022
+ interface LayoutDesignOverride {
1023
+ readonly fieldName: string;
1024
+ readonly type: DesignEditor['type'];
1025
+ defaults?: DesignEditorDefaults & {
1026
+ type?: DesignEditor['type'];
1102
1027
  };
1103
- };
1028
+ }
1029
+ interface LayoutSettings {
1030
+ readonly layoutId: string;
1031
+ readonly layoutIcon: unknown;
1032
+ readonly selectedContentSettings: string[];
1033
+ readonly selectedDesignSettings: LayoutDesignOverride[];
1034
+ }
1035
+
1036
+ type TranslationSettings = Record<string, Record<string, string>>;
1037
+
1038
+ interface AppBaseContext {
1039
+ readonly appName: string;
1040
+ readonly blockName: string;
1041
+ readonly version: string;
1042
+ readonly scriptUrl: string;
1043
+ readonly imageBuckets: Record<string, string>;
1044
+ readonly globalDesign: Record<string, Record<string, unknown>>;
1045
+ }
1046
+ interface AppBaseData<C, D> {
1047
+ readonly content: C;
1048
+ readonly design: D;
1049
+ readonly defaults: Record<string, unknown>;
1050
+ readonly externalContent: ExternalContentData;
1051
+ }
1052
+ interface AppBaseState<C, D> {
1053
+ readonly context: AppBaseContext;
1054
+ readonly data: AppBaseData<C, D>;
1055
+ }
1104
1056
 
1105
1057
  interface VueClientAppExtensions {
1106
1058
  init?: (app: App<Element>) => void;
@@ -1181,6 +1133,70 @@ interface InstantsiteJSAPI {
1181
1133
 
1182
1134
  declare function useInstantsiteJsApi(): InstantsiteJSAPI | undefined;
1183
1135
 
1136
+ interface GlobalColors {
1137
+ title?: Color;
1138
+ body?: Color;
1139
+ button?: Color;
1140
+ link?: Color;
1141
+ background?: Color;
1142
+ }
1143
+ interface GlobalFonts {
1144
+ title: string;
1145
+ body: string;
1146
+ }
1147
+ interface GlobalTextSize {
1148
+ title: number;
1149
+ subtitle: number;
1150
+ body: number;
1151
+ }
1152
+ interface GlobalButtonSize {
1153
+ small: number;
1154
+ medium: number;
1155
+ large: number;
1156
+ }
1157
+ type AppearanceEffectType = 'none' | 'fade-in' | 'fade-in-up';
1158
+ interface GlobalLayout {
1159
+ maxWidth: number;
1160
+ tileMargin: number;
1161
+ appearanceEffect: AppearanceEffectType;
1162
+ }
1163
+ interface GlobalDesign {
1164
+ color?: GlobalColors;
1165
+ fontFamily?: GlobalFonts;
1166
+ textSize?: GlobalTextSize;
1167
+ buttonSize?: GlobalButtonSize;
1168
+ layout?: GlobalLayout;
1169
+ customCss?: string;
1170
+ }
1171
+
1172
+ interface VueBaseProps<CONTENT, DESIGN> {
1173
+ init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
1174
+ update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
1175
+ readonly context: Ref<AppBaseContext>;
1176
+ readonly content: Ref<CONTENT>;
1177
+ readonly design: Ref<DESIGN>;
1178
+ readonly defaults: Ref<Record<string, unknown>>;
1179
+ readonly site: Ref<SiteContent>;
1180
+ readonly category?: Ref<Category | undefined>;
1181
+ readonly storeData?: Ref<StoreData | undefined>;
1182
+ readonly globalDesign: Ref<GlobalDesign>;
1183
+ }
1184
+ declare function useVueBaseProps<CONTENT, DESIGN>(): VueBaseProps<CONTENT, DESIGN>;
1185
+
1186
+ interface VueServerAppExtensions {
1187
+ init?: (app: App<Element>) => void;
1188
+ render?: <C, D>(app: App<Element>, context: AppBaseContext, data: AppBaseData<C, D>) => void;
1189
+ }
1190
+ interface VueRenderResult {
1191
+ readonly html: string;
1192
+ readonly state: unknown;
1193
+ }
1194
+ declare function createVueServerApp<C, D>(appComponent: Component, extensions?: VueServerAppExtensions): {
1195
+ init: () => {
1196
+ render: (context: AppBaseContext, data: AppBaseData<C, D>) => Promise<VueRenderResult>;
1197
+ };
1198
+ };
1199
+
1184
1200
  declare const CatalogLayoutSlot: {
1185
1201
  readonly PRODUCT_LIST: "CONTROLS";
1186
1202
  readonly BOTTOM_BAR: "FOOTER";
@@ -1203,5 +1219,5 @@ declare const ProductLayoutSlot: {
1203
1219
  readonly CUSTOM_SLOT: "CUSTOM_SLOT";
1204
1220
  };
1205
1221
 
1206
- export { ActionLinkTypeEnum, BackgroundStyleEnum, ButtonAppearanceEnum, ButtonShapeEnum, ButtonSizeEnum, ButtonTypeEnum, CatalogLayoutSlot, CategoryLayoutSlot, ConfigTypeEnum, DesignEditorType, EditorTypes, ImageSet, InstantsiteJsEvent, OverlayTypeEnum, PluginTypeEnum, ProductLayoutSlot, SectionTypeEnum, TemplatePageEnum, ValidationTypeEnum, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useCategorySelectorElementContent, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useLogoElementContent, useLogoElementDesign, useMenuElementContent, useNavigationMenuElementContent, useProductSelectorElementContent, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useTranslation, useVueBaseProps };
1207
- export type { ActionLink, AppBaseContext, AppBaseData, AppBaseState, Background$1 as Background, BackgroundDesignData, BackgroundDesignEditor, BackgroundDesignEditorDefaults, BackgroundDesignEditorDefaultsTransformed, BackgroundType, ButtonAppearance$1 as ButtonAppearance, ButtonContent, ButtonContentData, ButtonContentEditor, ButtonDesignData, ButtonDesignEditor, ButtonDesignEditorDefaults, ButtonDesignEditorDefaultsTransformed, ButtonSize$1 as ButtonSize, ButtonStyle$1 as ButtonStyle, CapitalizationType, Card$1 as Card, CategorySelectorContentEditor, CategorySelectorContentEditorDefaults, Color$1 as Color, ColorPickerDesignEditor, ColorPickerDesignEditorDefaults, ColorPickerDesignEditorDefaultsTransformed, ContentEditor, ContentSettings, Deck, DeckContent, DeckContentEditor, DefaultSectionId, DesignEditor, DesignEditorDefaults, DesignEditorDefaultsTransformed, DesignSettings, DividerDesignEditor, Font, Frame, GlobalColorsString$1 as GlobalColorsString, GlobalDesign$1 as GlobalDesign, GlobalFontsString, GlobalTextSizeString$1 as GlobalTextSizeString, GradientColor, HSLColor, ImageBorderInfoData, ImageContent, ImageContentData, ImageContentEditor, ImageContentEditorDefaults, ImageDesignData, ImageDesignEditor, ImageDesignEditorDefaults, ImageDesignEditorDefaultsTransformed, ImageInfoData, InputBoxContent, InputboxContentEditor, InputboxContentEditorDefaults, InstantsiteJSAPI$1 as InstantsiteJSAPI, InstantsiteTilePromise$1 as InstantsiteTilePromise, LayoutDesignData, LayoutDesignOverride, LayoutSettings, LogoContent, LogoContentData, LogoContentEditor, LogoContentEditorDefaults, LogoDesignData$1 as LogoDesignData, LogoDesignEditor, LogoDesignEditorDefaults, LogoDesignEditorDefaultsTransformed, LogoType$1 as LogoType, MandatoryContentSettings, MandatoryDesignSettings, MenuContent, MenuContentData, MenuContentEditor, NavigationMenuContentEditor, Overlay$1 as Overlay, OverlayType, ProductSelectorContentEditor, ProductSelectorContentEditorDefaults, RGBAColor, SelectBoxContent, SelectboxContentEditor, SelectboxContentOption, SelectboxDesignData, SelectboxDesignEditor, Showcase, ShowcaseOverride, SolidColor, StorePageConfiguration, StorefrontSectionId, TemplateConfiguration, TemplateConfigurationType, TemplateCustomSection, TemplateDefaultSection, TemplateMetadata, TemplateMultiPageConfiguration, TemplatePage, TemplateSection, TemplateSettings, TemplateSinglePageConfiguration, TemplateStorefrontSection, TextAreaContent, TextDesignData, TextDesignEditor, TextDesignEditorDefaults, TextDesignEditorDefaultsTransformed, TextSize, TextareaContentEditor, TextareaContentEditorDefaults, TextareaDesignData, ToggleContent, ToggleContentData, ToggleContentEditor, ToggleDesignData, ToggleDesignEditor, TransformedFrame, TranslationSettings, VuegaPageId };
1222
+ export { ActionLinkTypeEnum, BackgroundStyleEnum, ButtonAppearanceEnum, ButtonShapeEnum, ButtonSizeEnum, ButtonTypeEnum, CatalogLayoutSlot, CategoryLayoutSlot, ConfigTypeEnum, DesignEditorType, EditorTypes, ImageSet, InstantsiteJsEvent, OverlayTypeEnum, PluginTypeEnum, ProductLayoutSlot, SectionTypeEnum, TemplateCategoriesList, TemplatePageEnum, ValidationTypeEnum, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useCategorySelectorElementContent, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useLogoElementContent, useLogoElementDesign, useMenuElementContent, useNavigationMenuElementContent, useProductSelectorElementContent, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useTranslation, useVueBaseProps };
1223
+ export type { ActionLink, AppBaseContext, AppBaseData, AppBaseState, Background$1 as Background, BackgroundDesignData, BackgroundDesignEditor, BackgroundDesignEditorDefaults, BackgroundDesignEditorDefaultsTransformed, BackgroundType, ButtonAppearance$1 as ButtonAppearance, ButtonContent, ButtonContentData, ButtonContentEditor, ButtonDesignData, ButtonDesignEditor, ButtonDesignEditorDefaults, ButtonDesignEditorDefaultsTransformed, ButtonSize$1 as ButtonSize, ButtonStyle$1 as ButtonStyle, CapitalizationType, Card$1 as Card, CategorySelectorContentEditor, CategorySelectorContentEditorDefaults, Color$1 as Color, ColorPickerDesignEditor, ColorPickerDesignEditorDefaults, ColorPickerDesignEditorDefaultsTransformed, ContentEditor, ContentSettings, Deck, DeckContent, DeckContentEditor, DefaultSectionId, DesignEditor, DesignEditorDefaults, DesignEditorDefaultsTransformed, DesignSettings, DividerDesignEditor, Font, Frame, GlobalColorsString$1 as GlobalColorsString, GlobalDesign$1 as GlobalDesign, GlobalFontsString, GlobalTextSizeString$1 as GlobalTextSizeString, GradientColor, HSLColor, ImageBorderInfoData, ImageContent, ImageContentData, ImageContentEditor, ImageContentEditorDefaults, ImageDesignData, ImageDesignEditor, ImageDesignEditorDefaults, ImageDesignEditorDefaultsTransformed, ImageInfoData, InputBoxContent, InputboxContentEditor, InputboxContentEditorDefaults, InstantsiteJSAPI$1 as InstantsiteJSAPI, InstantsiteTilePromise$1 as InstantsiteTilePromise, LayoutDesignData, LayoutDesignOverride, LayoutSettings, LogoContent, LogoContentData, LogoContentEditor, LogoContentEditorDefaults, LogoDesignData$1 as LogoDesignData, LogoDesignEditor, LogoDesignEditorDefaults, LogoDesignEditorDefaultsTransformed, LogoType$1 as LogoType, MandatoryContentSettings, MandatoryDesignSettings, MenuContent, MenuContentData, MenuContentEditor, NavigationMenuContentEditor, Overlay$1 as Overlay, OverlayType, ProductSelectorContentEditor, ProductSelectorContentEditorDefaults, RGBAColor, SelectBoxContent, SelectboxContentEditor, SelectboxContentOption, SelectboxDesignData, SelectboxDesignEditor, Showcase, ShowcaseOverride, SolidColor, StorePageConfiguration, StorefrontSectionId, TemplateCategory, TemplateConfiguration, TemplateConfigurationType, TemplateCustomSection, TemplateDefaultSection, TemplateMetadata, TemplateMultiPageConfiguration, TemplatePage, TemplateSection, TemplateSettings, TemplateSinglePageConfiguration, TemplateStorefrontSection, TextAreaContent, TextDesignData, TextDesignEditor, TextDesignEditorDefaults, TextDesignEditorDefaultsTransformed, TextSize, TextareaContentEditor, TextareaContentEditorDefaults, TextareaDesignData, ToggleContent, ToggleContentData, ToggleContentEditor, ToggleDesignData, ToggleDesignEditor, TransformedFrame, TranslationSettings, VuegaPageId };