@lightspeed/crane-api 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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
+ lowResolutionMobileImage: string;
61
+ highResolutionMobileImage: string;
62
+ lowResolutionDesktopImage: string;
63
+ highResolutionDesktopImage: string;
64
+ } | {
65
+ title: string | undefined;
66
+ type: ActionLinkType | undefined;
67
+ link: string | undefined;
68
+ email: string | undefined;
69
+ phone: string | undefined;
70
+ tileDivId: string | null;
71
+ pageId: string | undefined;
72
+ pageUrl: string | undefined;
73
+ hasTitle: boolean;
74
+ hasLink: boolean;
75
+ performAction: (() => void) | undefined;
76
+ } | {
77
+ hasContent: boolean;
78
+ value: string | undefined;
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,19 @@ 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;
465
- }
466
-
467
- type DesignSettings = Record<string, DesignEditor>;
468
- type MandatoryDesignSettings = Record<'logo', LogoDesignEditor> | Record<string, never>;
511
+ interface ImageContentData {
512
+ readonly borderInfo?: ImageBorderInfoData;
513
+ readonly set: {
514
+ [key in ImageSet]?: ImageInfoData;
515
+ };
516
+ }
517
+
518
+ interface TemplateMetadata {
519
+ readonly name: string;
520
+ readonly description?: string;
521
+ readonly preview_url?: string;
522
+ readonly cover_image?: ImageContentData;
523
+ }
469
524
 
470
525
  interface InputboxContentEditor {
471
526
  readonly type: 'INPUTBOX';
@@ -582,52 +637,6 @@ interface ButtonContentData {
582
637
  readonly pageUrl?: string;
583
638
  }
584
639
 
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
640
  interface Card {
632
641
  title: string;
633
642
  settings: ContentSettings;
@@ -688,419 +697,346 @@ type MandatoryContentSettings = {
688
697
  logo: LogoContentEditor;
689
698
  } | Record<string, never>;
690
699
 
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';
700
+ interface TextDesignEditor {
701
+ readonly type: 'TEXT';
702
+ readonly label: string | Record<string, string>;
703
+ readonly colors: ReadonlyArray<string>;
704
+ readonly sizes: ReadonlyArray<number>;
705
+ defaults?: TextDesignEditorDefaults;
706
706
  }
707
- interface ShowcaseTextareaContentEditorDefaults extends TextareaContentEditorDefaults {
708
- readonly type: 'TEXTAREA';
707
+ interface ButtonDesignEditor {
708
+ readonly type: 'BUTTON';
709
+ readonly label: string | Record<string, string>;
710
+ defaults?: ButtonDesignEditorDefaults;
709
711
  }
710
- interface ShowcaseImageContentEditorDefaults {
712
+ interface ImageDesignEditor {
711
713
  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>;
714
+ readonly label: string | Record<string, string>;
715
+ readonly static?: boolean;
716
+ readonly colors: ReadonlyArray<string>;
717
+ defaults?: ImageDesignEditorDefaults;
729
718
  }
730
- interface ShowcaseNavigationMenuContentEditorDefaults {
731
- readonly type: 'NAVIGATION_MENU';
732
- readonly items?: ReadonlyArray<MenuItem>;
719
+ interface ToggleDesignEditor {
720
+ readonly type: 'TOGGLE';
721
+ readonly label: string | Record<string, string>;
722
+ defaults?: Record<string, never>;
733
723
  }
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;
724
+ interface SelectboxDesignEditor {
725
+ readonly type: 'SELECTBOX';
726
+ readonly label: string | Record<string, string>;
727
+ defaults?: Record<string, never>;
746
728
  }
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;
729
+ interface BackgroundDesignEditor {
730
+ readonly type: 'BACKGROUND';
731
+ readonly label: string | Record<string, string>;
732
+ readonly colors: ReadonlyArray<string>;
733
+ defaults?: BackgroundDesignEditorDefaults;
756
734
  }
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;
735
+ interface ColorPickerDesignEditor {
736
+ readonly type: 'COLOR_PICKER';
737
+ defaults?: ColorPickerDesignEditorDefaults;
764
738
  }
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';
739
+ interface LogoDesignEditor {
740
+ readonly type: 'LOGO';
741
+ readonly label?: string | Record<string, string>;
742
+ readonly colors?: ReadonlyArray<string>;
743
+ readonly sizes?: ReadonlyArray<number>;
744
+ defaults?: LogoDesignEditorDefaults;
769
745
  }
770
- type TemplateSection = TemplateDefaultSection | TemplateCustomSection | TemplateStorefrontSection;
771
-
772
- interface TemplatePage {
773
- id: string;
774
- type: TemplatePageEnum;
775
- readonly sections: TemplateSection[];
746
+ interface DividerDesignEditor {
747
+ readonly type: 'DIVIDER';
748
+ readonly label: string | Record<string, string>;
749
+ defaults?: DesignEditorDefaults;
776
750
  }
751
+ type DesignEditor = TextDesignEditor | ButtonDesignEditor | ImageDesignEditor | ToggleDesignEditor | SelectboxDesignEditor | ColorPickerDesignEditor | LogoDesignEditor | BackgroundDesignEditor | DividerDesignEditor;
777
752
 
778
- interface TemplateConfiguration {
779
- metadata: TemplateMetadata;
753
+ interface TextDesignEditorDefaults {
754
+ readonly font?: string;
755
+ readonly size?: number | string;
756
+ readonly bold?: boolean;
757
+ readonly italic?: boolean;
758
+ readonly color?: string;
759
+ readonly visible?: boolean;
780
760
  }
781
- interface TemplateSinglePageConfiguration extends TemplateConfiguration {
782
- readonly sections: TemplateSection[];
761
+ interface ButtonDesignEditorDefaults {
762
+ readonly appearance?: ButtonAppearanceEnum;
763
+ readonly size?: ButtonSizeEnum;
764
+ readonly shape?: ButtonShapeEnum | undefined;
765
+ readonly font?: string;
766
+ readonly color?: string;
767
+ readonly visible?: boolean;
783
768
  }
784
- interface TemplateMultiPageConfiguration extends TemplateConfiguration {
785
- readonly header: TemplateSection;
786
- readonly footer: TemplateSection;
787
- readonly pages: TemplatePage[];
769
+ interface ImageDesignEditorDefaults {
770
+ readonly overlay?: keyof typeof OverlayTypeEnum;
771
+ readonly color?: string | string[];
788
772
  }
789
- type TemplateConfigurationType = TemplateSinglePageConfiguration | TemplateMultiPageConfiguration | TemplatePage;
790
-
791
- interface StorePageConfiguration {
792
- readonly sections: [TemplateStorefrontSection];
773
+ interface ColorPickerDesignEditorDefaults {
774
+ readonly color?: string;
793
775
  }
794
-
795
- interface LayoutDesignOverride {
796
- readonly fieldName: string;
797
- readonly type: DesignEditor['type'];
798
- defaults?: DesignEditorDefaults & {
799
- type?: DesignEditor['type'];
800
- };
776
+ interface BackgroundDesignEditorDefaults {
777
+ readonly style?: keyof typeof BackgroundStyleEnum;
778
+ readonly color?: string | string[];
801
779
  }
802
- interface LayoutSettings {
803
- readonly layoutId: string;
804
- readonly layoutIcon: unknown;
805
- readonly selectedContentSettings: string[];
806
- readonly selectedDesignSettings: LayoutDesignOverride[];
780
+ interface LogoDesignEditorDefaults {
781
+ readonly font?: string;
782
+ readonly size?: number | string;
783
+ readonly bold?: boolean;
784
+ readonly italic?: boolean;
785
+ readonly color?: string;
786
+ readonly visible?: boolean;
787
+ readonly spacing?: number;
788
+ readonly frame?: Frame;
789
+ readonly capitalization?: CapitalizationType;
807
790
  }
791
+ type DesignEditorDefaults = TextDesignEditorDefaults | ButtonDesignEditorDefaults | ImageDesignEditorDefaults | ColorPickerDesignEditorDefaults | BackgroundDesignEditorDefaults | LogoDesignEditorDefaults | Record<string, never>;
808
792
 
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>>;
793
+ interface TextDesignEditorDefaultsTransformed {
794
+ readonly font?: Font;
795
+ readonly color?: Color$1 | string;
796
+ readonly size?: TextSize | string;
818
797
  }
819
- interface AppBaseData<C, D> {
820
- readonly content: C;
821
- readonly design: D;
822
- readonly defaults: Record<string, unknown>;
823
- readonly externalContent: ExternalContentData;
798
+ interface ImageDesignEditorDefaultsTransformed {
799
+ readonly overlay: Overlay$1;
824
800
  }
825
- interface AppBaseState<C, D> {
826
- readonly context: AppBaseContext;
827
- readonly data: AppBaseData<C, D>;
801
+ interface ColorPickerDesignEditorDefaultsTransformed {
802
+ readonly color?: Color$1;
828
803
  }
829
-
830
- interface GlobalColors {
831
- title?: Color;
832
- body?: Color;
833
- button?: Color;
834
- link?: Color;
835
- background?: Color;
804
+ interface ButtonDesignEditorDefaultsTransformed {
805
+ readonly appearance?: string;
806
+ readonly size?: string;
807
+ readonly style?: string;
808
+ readonly font?: Font;
809
+ readonly color?: Color$1 | string;
810
+ readonly visible?: boolean;
836
811
  }
837
- interface GlobalFonts {
838
- title: string;
839
- body: string;
812
+ interface BackgroundDesignEditorDefaultsTransformed {
813
+ readonly background: Background$1;
840
814
  }
841
- interface GlobalTextSize {
842
- title: number;
843
- subtitle: number;
844
- body: number;
815
+ interface LogoDesignEditorDefaultsTransformed {
816
+ readonly font?: Font;
817
+ readonly color?: Color$1 | string;
818
+ readonly size?: TextSize | string;
819
+ readonly frame?: TransformedFrame;
845
820
  }
846
- interface GlobalButtonSize {
847
- small: number;
848
- medium: number;
849
- large: number;
821
+ type DesignEditorDefaultsTransformed = TextDesignEditorDefaultsTransformed | ButtonDesignEditorDefaultsTransformed | ImageDesignEditorDefaultsTransformed | BackgroundDesignEditorDefaultsTransformed | ColorPickerDesignEditorDefaultsTransformed | LogoDesignEditorDefaultsTransformed;
822
+
823
+ type BackgroundType = 'solid' | 'gradient';
824
+ interface SolidColor {
825
+ color: Color$1 | undefined;
850
826
  }
851
- type AppearanceEffectType = 'none' | 'fade-in' | 'fade-in-up';
852
- interface GlobalLayout {
853
- maxWidth: number;
854
- tileMargin: number;
855
- appearanceEffect: AppearanceEffectType;
827
+ interface GradientColor {
828
+ fromColor: Color$1 | undefined;
829
+ toColor: Color$1 | undefined;
856
830
  }
857
- interface GlobalDesign {
858
- color?: GlobalColors;
859
- fontFamily?: GlobalFonts;
860
- textSize?: GlobalTextSize;
861
- buttonSize?: GlobalButtonSize;
862
- layout?: GlobalLayout;
863
- customCss?: string;
831
+ interface Background$1 {
832
+ type: BackgroundType | undefined;
833
+ solid: SolidColor | undefined;
834
+ gradient: GradientColor | undefined;
864
835
  }
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>;
836
+ interface BackgroundDesignData {
837
+ background: Background$1 | undefined;
877
838
  }
878
- declare function useVueBaseProps<CONTENT, DESIGN>(): VueBaseProps<CONTENT, DESIGN>;
879
839
 
880
- interface InputBoxContent {
881
- hasContent: boolean;
882
- value: string;
840
+ type ButtonAppearance$1 = 'solid-button' | 'outline-button' | 'text-link';
841
+ type ButtonSize$1 = 'small' | 'medium' | 'large';
842
+ type ButtonStyle$1 = 'round-corner' | 'rectangle' | 'pill';
843
+ interface ButtonDesignData {
844
+ appearance: ButtonAppearance$1 | undefined;
845
+ font: string | GlobalFontsString | undefined;
846
+ size: ButtonSize$1 | undefined;
847
+ style: ButtonStyle$1 | undefined;
848
+ color: Color$1 | GlobalColorsString$1 | undefined;
849
+ visible: boolean;
883
850
  }
884
- declare function useInputboxElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
885
- hasContent: boolean;
886
- value: string | undefined;
887
- };
888
851
 
889
- interface TextAreaContent {
890
- hasContent: boolean;
891
- value: string;
852
+ type OverlayType = 'solid' | 'gradient' | 'none';
853
+ interface Overlay$1 {
854
+ type: OverlayType | undefined;
855
+ solid: SolidColor | undefined;
856
+ gradient: GradientColor | undefined;
892
857
  }
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;
858
+ interface ImageDesignData {
859
+ overlay: Overlay$1 | undefined;
860
+ visible: boolean;
910
861
  }
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
862
 
925
- interface ImageContent {
926
- hasContent: boolean;
927
- lowResolutionMobileImage: string;
928
- highResolutionMobileImage: string;
929
- lowResolutionDesktopImage: string;
930
- highResolutionDesktopImage: string;
863
+ interface TextDesignData {
864
+ font: string | GlobalFontsString | undefined;
865
+ size: number | GlobalTextSizeString$1 | undefined;
866
+ bold: boolean | undefined;
867
+ italic: boolean | undefined;
868
+ color: Color$1 | undefined;
869
+ visible: boolean;
931
870
  }
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;
871
+ interface TextareaDesignData extends TextDesignData {
872
+ readonly whiteSpace: string;
943
873
  }
944
- declare function useToggleElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
945
- hasContent: boolean;
946
- value: boolean | undefined;
947
- };
948
874
 
949
- interface SelectBoxContent {
950
- hasContent: boolean;
951
- value: string;
875
+ interface ToggleDesignData {
876
+ enabled: boolean | undefined;
952
877
  }
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
878
 
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
- };
879
+ interface SelectboxDesignData {
880
+ value: string | undefined;
881
+ }
1039
882
 
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
- };
883
+ interface LayoutDesignData {
884
+ layout: string | undefined;
885
+ }
1048
886
 
1049
- declare function useTextareaElementDesign<DESIGN>(elementName: keyof DESIGN): {
887
+ interface LogoDesignData$1 {
1050
888
  font: string | undefined;
1051
- size: number | GlobalTextSizeString | undefined;
889
+ size: number | undefined;
1052
890
  bold: boolean | undefined;
1053
891
  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;
892
+ color: Color$1 | undefined;
1065
893
  visible: boolean | undefined;
1066
- };
894
+ spacing: number | undefined;
895
+ capitalization: CapitalizationType | undefined;
896
+ frame: TransformedFrame | undefined;
897
+ }
1067
898
 
1068
- declare function useImageElementDesign<DESIGN>(elementName: keyof DESIGN): {
1069
- overlay: Overlay | undefined;
1070
- visible: boolean | undefined;
1071
- };
899
+ type DesignSettings = Record<string, DesignEditor>;
900
+ type MandatoryDesignSettings = Record<'logo', LogoDesignEditor> | Record<string, never>;
1072
901
 
1073
- declare function useToggleElementDesign<DESIGN>(elementName: keyof DESIGN): {
1074
- enabled: boolean | undefined;
1075
- };
902
+ interface MenuItem {
903
+ readonly id: string;
904
+ readonly title?: string;
905
+ readonly type?: string;
906
+ readonly link?: string;
907
+ readonly email?: string;
908
+ readonly phone?: string;
909
+ readonly tileIdForScroll?: string;
910
+ readonly pageIdForNavigate?: string;
911
+ readonly showStoreCategories?: boolean;
912
+ readonly isSubmenuOpened?: boolean;
913
+ readonly categoryId?: number;
914
+ }
915
+ interface ShowcaseInputboxContentEditorDefaults extends InputboxContentEditorDefaults {
916
+ readonly type: 'INPUTBOX';
917
+ }
918
+ interface ShowcaseTextareaContentEditorDefaults extends TextareaContentEditorDefaults {
919
+ readonly type: 'TEXTAREA';
920
+ }
921
+ interface ShowcaseImageContentEditorDefaults {
922
+ readonly type: 'IMAGE';
923
+ readonly imageData?: ImageContentEditorDefaults;
924
+ }
925
+ interface ShowcaseDeckContentEditorDefaults {
926
+ readonly type: 'DECK';
927
+ readonly cards: ReadonlyArray<{
928
+ settings: Record<string, ShowcaseContentEditorsDefaults>;
929
+ }>;
930
+ }
931
+ interface ShowcaseLogoContentEditorDefaults {
932
+ readonly type: 'LOGO';
933
+ readonly logoType?: LogoType$1;
934
+ readonly text?: string;
935
+ readonly imageData?: ImageContentEditorDefaults;
936
+ }
937
+ interface ShowcaseMenuContentEditorDefaults {
938
+ readonly type: 'MENU';
939
+ readonly items?: ReadonlyArray<MenuItem>;
940
+ }
941
+ interface ShowcaseNavigationMenuContentEditorDefaults {
942
+ readonly type: 'NAVIGATION_MENU';
943
+ readonly items?: ReadonlyArray<MenuItem>;
944
+ }
1076
945
 
1077
- declare function useSelectboxElementDesign<DESIGN>(elementName: keyof DESIGN): {
1078
- value: string | undefined;
1079
- };
946
+ type ShowcaseContentEditorsDefaults = ShowcaseInputboxContentEditorDefaults | ShowcaseTextareaContentEditorDefaults | ShowcaseDeckContentEditorDefaults | ShowcaseImageContentEditorDefaults | ShowcaseLogoContentEditorDefaults | ShowcaseMenuContentEditorDefaults | ShowcaseNavigationMenuContentEditorDefaults | Record<string, never>;
1080
947
 
1081
- declare function useBackgroundElementDesign<DESIGN>(elementName: keyof DESIGN): {
1082
- background: Background | undefined;
1083
- };
948
+ interface Showcase {
949
+ readonly showcaseId: string;
950
+ readonly blockName?: string | Record<string, string>;
951
+ readonly previewImage?: unknown;
952
+ readonly content?: Record<string, ShowcaseContentEditorsDefaults>;
953
+ readonly design?: Record<string, DesignEditorDefaults & {
954
+ type: DesignEditor['type'];
955
+ }>;
956
+ readonly layoutId?: string;
957
+ }
958
+ type ShowcaseOverride = Omit<Showcase, 'showcaseId' | 'previewImage'>;
1084
959
 
1085
- declare function useLayoutElementDesign(): {
1086
- layout: string | undefined;
1087
- };
960
+ type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
961
+ type ThreeDigits = `${Digit}${Digit}${Digit}`;
962
+ 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';
963
+ type DefaultSectionId = DefaultSectionBase | `${DefaultSectionBase}_${ThreeDigits}`;
964
+ interface TemplateDefaultSection {
965
+ readonly type: 'default';
966
+ readonly id: DefaultSectionId;
967
+ }
968
+ interface TemplateCustomSection {
969
+ readonly type: 'custom';
970
+ readonly id: string;
971
+ readonly showcase_id?: string;
972
+ readonly showcase_overrides?: ShowcaseOverride;
973
+ readonly content?: ContentSettings;
974
+ readonly design?: DesignSettings;
975
+ }
976
+ interface TemplateStorefrontSection {
977
+ /** Section layout identifier. When not provided, the section will use the default layout. */
978
+ readonly id?: string;
979
+ readonly type: 'store';
980
+ }
981
+ type TemplateSection = TemplateDefaultSection | TemplateCustomSection | TemplateStorefrontSection;
1088
982
 
1089
- declare function useLogoElementDesign<DESIGN>(): vue.ComputedRef<LogoDesignData>;
983
+ interface TemplatePage {
984
+ id: string;
985
+ type: TemplatePageEnum;
986
+ readonly sections: TemplateSection[];
987
+ }
1090
988
 
1091
- interface VueServerAppExtensions {
1092
- init?: (app: App<Element>) => void;
1093
- render?: <C, D>(app: App<Element>, context: AppBaseContext, data: AppBaseData<C, D>) => void;
989
+ interface TemplateConfiguration {
990
+ metadata: TemplateMetadata;
1094
991
  }
1095
- interface VueRenderResult {
1096
- readonly html: string;
1097
- readonly state: unknown;
992
+ interface TemplateSinglePageConfiguration extends TemplateConfiguration {
993
+ readonly sections: TemplateSection[];
1098
994
  }
1099
- declare function createVueServerApp<C, D>(appComponent: Component, extensions?: VueServerAppExtensions): {
1100
- init: () => {
1101
- render: (context: AppBaseContext, data: AppBaseData<C, D>) => Promise<VueRenderResult>;
995
+ interface TemplateMultiPageConfiguration extends TemplateConfiguration {
996
+ readonly header: TemplateSection;
997
+ readonly footer: TemplateSection;
998
+ readonly pages: TemplatePage[];
999
+ }
1000
+ type TemplateConfigurationType = TemplateSinglePageConfiguration | TemplateMultiPageConfiguration | TemplatePage;
1001
+
1002
+ interface StorePageConfiguration {
1003
+ readonly sections: [TemplateStorefrontSection];
1004
+ }
1005
+
1006
+ interface LayoutDesignOverride {
1007
+ readonly fieldName: string;
1008
+ readonly type: DesignEditor['type'];
1009
+ defaults?: DesignEditorDefaults & {
1010
+ type?: DesignEditor['type'];
1102
1011
  };
1103
- };
1012
+ }
1013
+ interface LayoutSettings {
1014
+ readonly layoutId: string;
1015
+ readonly layoutIcon: unknown;
1016
+ readonly selectedContentSettings: string[];
1017
+ readonly selectedDesignSettings: LayoutDesignOverride[];
1018
+ }
1019
+
1020
+ type TranslationSettings = Record<string, Record<string, string>>;
1021
+
1022
+ interface AppBaseContext {
1023
+ readonly appName: string;
1024
+ readonly blockName: string;
1025
+ readonly version: string;
1026
+ readonly scriptUrl: string;
1027
+ readonly imageBuckets: Record<string, string>;
1028
+ readonly globalDesign: Record<string, Record<string, unknown>>;
1029
+ }
1030
+ interface AppBaseData<C, D> {
1031
+ readonly content: C;
1032
+ readonly design: D;
1033
+ readonly defaults: Record<string, unknown>;
1034
+ readonly externalContent: ExternalContentData;
1035
+ }
1036
+ interface AppBaseState<C, D> {
1037
+ readonly context: AppBaseContext;
1038
+ readonly data: AppBaseData<C, D>;
1039
+ }
1104
1040
 
1105
1041
  interface VueClientAppExtensions {
1106
1042
  init?: (app: App<Element>) => void;
@@ -1181,6 +1117,70 @@ interface InstantsiteJSAPI {
1181
1117
 
1182
1118
  declare function useInstantsiteJsApi(): InstantsiteJSAPI | undefined;
1183
1119
 
1120
+ interface GlobalColors {
1121
+ title?: Color;
1122
+ body?: Color;
1123
+ button?: Color;
1124
+ link?: Color;
1125
+ background?: Color;
1126
+ }
1127
+ interface GlobalFonts {
1128
+ title: string;
1129
+ body: string;
1130
+ }
1131
+ interface GlobalTextSize {
1132
+ title: number;
1133
+ subtitle: number;
1134
+ body: number;
1135
+ }
1136
+ interface GlobalButtonSize {
1137
+ small: number;
1138
+ medium: number;
1139
+ large: number;
1140
+ }
1141
+ type AppearanceEffectType = 'none' | 'fade-in' | 'fade-in-up';
1142
+ interface GlobalLayout {
1143
+ maxWidth: number;
1144
+ tileMargin: number;
1145
+ appearanceEffect: AppearanceEffectType;
1146
+ }
1147
+ interface GlobalDesign {
1148
+ color?: GlobalColors;
1149
+ fontFamily?: GlobalFonts;
1150
+ textSize?: GlobalTextSize;
1151
+ buttonSize?: GlobalButtonSize;
1152
+ layout?: GlobalLayout;
1153
+ customCss?: string;
1154
+ }
1155
+
1156
+ interface VueBaseProps<CONTENT, DESIGN> {
1157
+ init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
1158
+ update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
1159
+ readonly context: Ref<AppBaseContext>;
1160
+ readonly content: Ref<CONTENT>;
1161
+ readonly design: Ref<DESIGN>;
1162
+ readonly defaults: Ref<Record<string, unknown>>;
1163
+ readonly site: Ref<SiteContent>;
1164
+ readonly category?: Ref<Category | undefined>;
1165
+ readonly storeData?: Ref<StoreData | undefined>;
1166
+ readonly globalDesign: Ref<GlobalDesign>;
1167
+ }
1168
+ declare function useVueBaseProps<CONTENT, DESIGN>(): VueBaseProps<CONTENT, DESIGN>;
1169
+
1170
+ interface VueServerAppExtensions {
1171
+ init?: (app: App<Element>) => void;
1172
+ render?: <C, D>(app: App<Element>, context: AppBaseContext, data: AppBaseData<C, D>) => void;
1173
+ }
1174
+ interface VueRenderResult {
1175
+ readonly html: string;
1176
+ readonly state: unknown;
1177
+ }
1178
+ declare function createVueServerApp<C, D>(appComponent: Component, extensions?: VueServerAppExtensions): {
1179
+ init: () => {
1180
+ render: (context: AppBaseContext, data: AppBaseData<C, D>) => Promise<VueRenderResult>;
1181
+ };
1182
+ };
1183
+
1184
1184
  declare const CatalogLayoutSlot: {
1185
1185
  readonly PRODUCT_LIST: "CONTROLS";
1186
1186
  readonly BOTTOM_BAR: "FOOTER";