@lightspeed/crane-api 1.0.2 → 1.1.0
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/CHANGELOG.md +7 -0
- package/README.md +113 -6
- package/dist/index.d.mts +1725 -478
- package/dist/index.d.ts +1725 -478
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,262 +1,41 @@
|
|
|
1
1
|
import * as vue 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
|
-
};
|
|
2
|
+
import { Reactive, ComputedRef, Component, App, Ref } from 'vue';
|
|
189
3
|
|
|
190
4
|
/**
|
|
191
|
-
*
|
|
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
|
|
5
|
+
* Menu item with action link.
|
|
196
6
|
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* import { useTranslation } from '@lightspeed/crane';
|
|
7
|
+
* Used in buttons and navigation menus. The `performAction` method triggers
|
|
8
|
+
* the appropriate navigation based on the link type.
|
|
200
9
|
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
* ```
|
|
10
|
+
* @see {@link MenuContent}
|
|
11
|
+
* @see {@link useButtonElementContent}
|
|
204
12
|
*/
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
};
|
|
13
|
+
interface ActionLink {
|
|
14
|
+
/** Unique identifier */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Menu item text displayed to the user */
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Action type (e.g., 'HYPER_LINK', 'SCROLL_TO_TILE', 'GO_TO_PAGE') */
|
|
19
|
+
type?: string;
|
|
20
|
+
/** URL for hyperlinks */
|
|
21
|
+
link?: string;
|
|
22
|
+
/** Email address for mailto links */
|
|
23
|
+
email?: string;
|
|
24
|
+
/** Phone number for tel links */
|
|
25
|
+
phone?: string;
|
|
26
|
+
/** Section ID for scroll-to-section links */
|
|
27
|
+
tileIdForScroll?: string;
|
|
28
|
+
/** Page ID for page navigation */
|
|
29
|
+
pageIdForNavigate?: string;
|
|
30
|
+
/** Whether to show store categories submenu */
|
|
31
|
+
showStoreCategories?: boolean;
|
|
32
|
+
/** Whether submenu is currently open */
|
|
33
|
+
isSubmenuOpened?: boolean;
|
|
34
|
+
/** Category ID for category links */
|
|
35
|
+
categoryId?: number;
|
|
36
|
+
/** Triggers the navigation action */
|
|
37
|
+
performAction?: () => void;
|
|
38
|
+
}
|
|
260
39
|
|
|
261
40
|
declare enum ButtonTypeEnum {
|
|
262
41
|
SCROLL_TO_TILE = "SCROLL_TO_TILE",
|
|
@@ -357,6 +136,12 @@ declare enum TemplatePageEnum {
|
|
|
357
136
|
HOME = "HOME",
|
|
358
137
|
CUSTOM = "CUSTOM"
|
|
359
138
|
}
|
|
139
|
+
declare enum ReservedTemplatePageNameEnum {
|
|
140
|
+
HOME = "home",
|
|
141
|
+
CATALOG = "catalog",
|
|
142
|
+
CATEGORY = "category",
|
|
143
|
+
PRODUCT = "product"
|
|
144
|
+
}
|
|
360
145
|
|
|
361
146
|
declare enum ValidationTypeEnum {
|
|
362
147
|
CONTENT = "Content",
|
|
@@ -366,78 +151,406 @@ declare enum ValidationTypeEnum {
|
|
|
366
151
|
type StorefrontSectionId = 'catalog' | 'category' | 'product';
|
|
367
152
|
type VuegaPageId = 'products' | 'category' | 'product';
|
|
368
153
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Return type for `useButtonElementContent` composable.
|
|
156
|
+
*
|
|
157
|
+
* Represents a button with action link from the editor.
|
|
158
|
+
* The `type` field determines which action fields are used.
|
|
159
|
+
*
|
|
160
|
+
* @see {@link useButtonElementContent}
|
|
161
|
+
* @see {@link ButtonTypeEnum}
|
|
162
|
+
*/
|
|
163
|
+
interface ButtonContentData {
|
|
164
|
+
/** Button text displayed to the user */
|
|
165
|
+
title: string;
|
|
166
|
+
/** Action type determining button behavior */
|
|
167
|
+
type: ButtonTypeEnum;
|
|
168
|
+
/** URL for HYPER_LINK type */
|
|
169
|
+
link?: string;
|
|
170
|
+
/** Email address for MAIL_LINK type */
|
|
171
|
+
email?: string;
|
|
172
|
+
/** Phone number for TEL_LINK type */
|
|
173
|
+
phone?: string;
|
|
174
|
+
/** Section ID for SCROLL_TO_TILE type */
|
|
175
|
+
tileId?: string;
|
|
176
|
+
/** Page ID for GO_TO_PAGE type */
|
|
177
|
+
pageId?: string;
|
|
178
|
+
/** Page URL for GO_TO_PAGE type */
|
|
179
|
+
pageUrl?: string;
|
|
180
|
+
hasTitle?: boolean;
|
|
181
|
+
hasLink?: boolean;
|
|
182
|
+
performAction?: () => void;
|
|
380
183
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Raw category selector data from the editor.
|
|
187
|
+
*
|
|
188
|
+
* @see {@link CategorySelector}
|
|
189
|
+
*/
|
|
190
|
+
interface CategorySelectorData {
|
|
191
|
+
readonly categories: {
|
|
192
|
+
/** Array of selected category IDs */
|
|
193
|
+
readonly categoryIds: Array<number>;
|
|
194
|
+
/** Array of category items with custom settings */
|
|
195
|
+
readonly items: Array<CategoryItemData>;
|
|
196
|
+
/** Selection mode: 'ROOT' for all root categories, 'MANUAL' for user-selected */
|
|
197
|
+
readonly selectionType: CategorySelectionType;
|
|
388
198
|
};
|
|
389
199
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Return type for `useCategorySelectorElementContent` composable.
|
|
202
|
+
*
|
|
203
|
+
* Represents store categories selected by the user in the editor.
|
|
204
|
+
*
|
|
205
|
+
* @see {@link useCategorySelectorElementContent}
|
|
206
|
+
* @see {@link CategorySelectorData}
|
|
207
|
+
*/
|
|
208
|
+
interface CategorySelector {
|
|
209
|
+
/** Array of selected category objects with id, name, imageUrl, etc. */
|
|
210
|
+
categories: CategoryListComponentItem[];
|
|
211
|
+
/** `true` if at least one category is selected */
|
|
212
|
+
hasCategories: boolean;
|
|
213
|
+
/** Array of selected category IDs */
|
|
214
|
+
categoryIds: Array<number>;
|
|
215
|
+
/** `true` if selector data exists */
|
|
216
|
+
hasContent: boolean;
|
|
394
217
|
}
|
|
395
|
-
|
|
396
|
-
|
|
218
|
+
|
|
219
|
+
declare enum EditorTypes {
|
|
220
|
+
INPUTBOX = "INPUTBOX",
|
|
221
|
+
TEXTAREA = "TEXTAREA",
|
|
222
|
+
BUTTON = "BUTTON",
|
|
223
|
+
IMAGE = "IMAGE",
|
|
224
|
+
TOGGLE = "TOGGLE",
|
|
225
|
+
SELECTBOX = "SELECTBOX"
|
|
226
|
+
}
|
|
227
|
+
/** Gets a reactive reference to a field within a DECK card. */
|
|
228
|
+
declare function getReactiveRef(card: Card | undefined, editorType: EditorTypes, contentElementName: string): {
|
|
229
|
+
readonly hasContent: boolean;
|
|
230
|
+
readonly value: string | undefined;
|
|
231
|
+
} | {
|
|
232
|
+
readonly hasContent: boolean;
|
|
233
|
+
readonly lowResolutionMobileImage: string | undefined;
|
|
234
|
+
readonly highResolutionMobileImage: string | undefined;
|
|
235
|
+
readonly lowResolutionDesktopImage: string | undefined;
|
|
236
|
+
readonly highResolutionDesktopImage: string | undefined;
|
|
237
|
+
} | {
|
|
238
|
+
readonly hasContent: boolean;
|
|
239
|
+
readonly value: boolean | undefined;
|
|
240
|
+
} | {
|
|
241
|
+
title?: string | undefined;
|
|
242
|
+
type?: ButtonTypeEnum | undefined;
|
|
243
|
+
link?: string | undefined;
|
|
244
|
+
email?: string | undefined;
|
|
245
|
+
phone?: string | undefined;
|
|
246
|
+
tileId?: string | undefined;
|
|
247
|
+
pageId?: string | undefined;
|
|
248
|
+
pageUrl?: string | undefined;
|
|
249
|
+
hasTitle?: boolean | undefined;
|
|
250
|
+
hasLink?: boolean | undefined;
|
|
251
|
+
performAction?: (() => void) | undefined;
|
|
252
|
+
} | undefined;
|
|
253
|
+
/**
|
|
254
|
+
* Composable for accessing DECK content (card collection, up to 10 items).
|
|
255
|
+
*
|
|
256
|
+
* Used for sliders, carousels, feature lists, and repeatable content blocks.
|
|
257
|
+
* Each card in the deck has its own settings that can be accessed via `getReactiveRef`.
|
|
258
|
+
*
|
|
259
|
+
* @template CONTENT - The content type from `type.ts`
|
|
260
|
+
* @param elementName - The name of the DECK element in content settings
|
|
261
|
+
*
|
|
262
|
+
* @returns `Reactive<DeckContent>` — reactive object with:
|
|
263
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if deck has at least one card
|
|
264
|
+
* - `cards: ComputedRef<ReadonlyArray<Card> | undefined>` — array of Card objects
|
|
265
|
+
* - `getReactiveRef: (card, editorType, fieldName) => Reactive<...>` — get reactive content from a card field
|
|
266
|
+
*
|
|
267
|
+
* Card interface:
|
|
268
|
+
* - `title: string` — card title
|
|
269
|
+
* - `settings: ContentSettings` — card content settings
|
|
270
|
+
*
|
|
271
|
+
* @see {@link DeckContent}
|
|
272
|
+
* @see {@link Card}
|
|
273
|
+
* @see {@link Deck}
|
|
274
|
+
* @see {@link EditorTypes} — enum for accessing card fields
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```typescript
|
|
278
|
+
* // settings/content.ts
|
|
279
|
+
* const content = {
|
|
280
|
+
* slides: {
|
|
281
|
+
* type: 'DECK',
|
|
282
|
+
* label: '$label.slides',
|
|
283
|
+
* max: 5,
|
|
284
|
+
* item: {
|
|
285
|
+
* title: { type: 'INPUTBOX', label: '$label.slide_title' },
|
|
286
|
+
* image: { type: 'IMAGE', label: '$label.slide_image' },
|
|
287
|
+
* button: { type: 'BUTTON', label: '$label.slide_button' },
|
|
288
|
+
* },
|
|
289
|
+
* },
|
|
290
|
+
* };
|
|
291
|
+
*
|
|
292
|
+
* // Section.vue
|
|
293
|
+
* import { useDeckElementContent, EditorTypes } from '@lightspeed/crane-api';
|
|
294
|
+
*
|
|
295
|
+
* const slides = useDeckElementContent<ContentType>('slides');
|
|
296
|
+
*
|
|
297
|
+
* // Template
|
|
298
|
+
* <div v-if="slides.hasContent" class="slider">
|
|
299
|
+
* <div v-for="card in slides.cards" :key="card.title" class="slide">
|
|
300
|
+
* <template v-if="slides.getReactiveRef(card, EditorTypes.INPUTBOX, 'title')?.hasContent">
|
|
301
|
+
* {{ slides.getReactiveRef(card, EditorTypes.INPUTBOX, 'title').value }}
|
|
302
|
+
* </template>
|
|
303
|
+
* </div>
|
|
304
|
+
* </div>
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
declare function useDeckElementContent<CONTENT>(elementName: keyof CONTENT): Reactive<DeckContent>;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* A single card within a DECK collection.
|
|
311
|
+
*
|
|
312
|
+
* Each card has its own content settings that can be accessed
|
|
313
|
+
* via `getReactiveRef` method.
|
|
314
|
+
*
|
|
315
|
+
* @see {@link DeckContent}
|
|
316
|
+
*/
|
|
317
|
+
interface Card {
|
|
318
|
+
/** Card title (used as identifier in the editor) */
|
|
319
|
+
title: string;
|
|
320
|
+
/** Card content settings containing all field values */
|
|
321
|
+
settings: ContentSettings;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Raw DECK data from the editor.
|
|
325
|
+
*
|
|
326
|
+
* @see {@link Card}
|
|
327
|
+
*/
|
|
328
|
+
interface Deck {
|
|
329
|
+
/** Array of cards in the deck (up to 10) */
|
|
330
|
+
readonly cards: ReadonlyArray<Card>;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Return type for `useDeckElementContent` composable.
|
|
334
|
+
*
|
|
335
|
+
* Represents a collection of cards (up to 10 items).
|
|
336
|
+
* Use `getReactiveRef` to access individual card fields.
|
|
337
|
+
*
|
|
338
|
+
* @see {@link useDeckElementContent}
|
|
339
|
+
* @see {@link Card}
|
|
340
|
+
*/
|
|
341
|
+
interface DeckContent {
|
|
342
|
+
/** `true` if deck has at least one card */
|
|
343
|
+
readonly hasContent: ComputedRef<boolean>;
|
|
344
|
+
/** Array of Card objects */
|
|
345
|
+
readonly cards: ComputedRef<ReadonlyArray<Card> | undefined>;
|
|
346
|
+
/** Get reactive content from a card field */
|
|
347
|
+
readonly getReactiveRef: typeof getReactiveRef;
|
|
397
348
|
}
|
|
398
349
|
|
|
350
|
+
/**
|
|
351
|
+
* HSL color representation with alpha channel.
|
|
352
|
+
*
|
|
353
|
+
* @see {@link Color}
|
|
354
|
+
*/
|
|
399
355
|
interface HSLColor {
|
|
356
|
+
/** Hue (0-360) */
|
|
400
357
|
h: number;
|
|
358
|
+
/** Saturation (0-100) */
|
|
401
359
|
s: number;
|
|
360
|
+
/** Lightness (0-100) */
|
|
402
361
|
l: number;
|
|
362
|
+
/** Alpha/opacity (0-1) */
|
|
403
363
|
a: number;
|
|
404
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* RGBA color representation.
|
|
367
|
+
*
|
|
368
|
+
* @see {@link Color}
|
|
369
|
+
*/
|
|
405
370
|
interface RGBAColor {
|
|
371
|
+
/** Red (0-255) */
|
|
406
372
|
r: number;
|
|
373
|
+
/** Green (0-255) */
|
|
407
374
|
g: number;
|
|
375
|
+
/** Blue (0-255) */
|
|
408
376
|
b: number;
|
|
377
|
+
/** Alpha/opacity (0-1) */
|
|
409
378
|
a: number;
|
|
410
379
|
}
|
|
411
|
-
|
|
380
|
+
/**
|
|
381
|
+
* Color value from the editor.
|
|
382
|
+
*
|
|
383
|
+
* Can be a global color reference or a structured color with multiple formats.
|
|
384
|
+
*
|
|
385
|
+
* @see {@link HSLColor}
|
|
386
|
+
* @see {@link RGBAColor}
|
|
387
|
+
*/
|
|
388
|
+
interface Color$1 {
|
|
389
|
+
/** Color type: 'GLOBAL_COLOR' for theme colors, 'STRUCTURED_COLOR' for custom */
|
|
412
390
|
type: 'GLOBAL_COLOR' | 'STRUCTURED_COLOR';
|
|
391
|
+
/** Raw color string (e.g., '#ffffff', 'rgba(0,0,0,0.5)') */
|
|
413
392
|
raw?: string;
|
|
393
|
+
/** Hex color value (e.g., '#ffffff') */
|
|
414
394
|
hex?: string;
|
|
395
|
+
/** HSL representation */
|
|
415
396
|
hsl?: HSLColor;
|
|
397
|
+
/** RGBA representation */
|
|
416
398
|
rgba?: RGBAColor;
|
|
399
|
+
/** Whether color was auto-calculated */
|
|
417
400
|
auto?: boolean;
|
|
418
401
|
}
|
|
419
402
|
|
|
420
|
-
|
|
403
|
+
/**
|
|
404
|
+
* Global color reference strings.
|
|
405
|
+
*
|
|
406
|
+
* Use these to reference theme colors that update automatically
|
|
407
|
+
* when the site theme changes.
|
|
408
|
+
*/
|
|
409
|
+
type GlobalColorsString = 'global.color.title' | 'global.color.body' | 'global.color.button' | 'global.color.link' | 'global.color.background';
|
|
410
|
+
/**
|
|
411
|
+
* Global font reference strings.
|
|
412
|
+
*
|
|
413
|
+
* Use these to reference theme fonts that update automatically
|
|
414
|
+
* when the site theme changes.
|
|
415
|
+
*/
|
|
421
416
|
type GlobalFontsString = 'global.fontFamily.title' | 'global.fontFamily.body';
|
|
422
|
-
|
|
417
|
+
/**
|
|
418
|
+
* Global text size reference strings.
|
|
419
|
+
*
|
|
420
|
+
* Use these to reference theme text sizes that update automatically
|
|
421
|
+
* when the site theme changes.
|
|
422
|
+
*/
|
|
423
|
+
type GlobalTextSizeString = 'global.textSize.title' | 'global.textSize.subtitle' | 'global.textSize.body';
|
|
424
|
+
/**
|
|
425
|
+
* Font configuration.
|
|
426
|
+
*
|
|
427
|
+
* @see {@link GlobalFontsString}
|
|
428
|
+
*/
|
|
423
429
|
interface Font {
|
|
430
|
+
/** Font type: 'GLOBAL_FONT' for theme fonts, 'PRESET_FONT' for custom */
|
|
424
431
|
type: 'GLOBAL_FONT' | 'PRESET_FONT';
|
|
432
|
+
/** Font family name */
|
|
425
433
|
font: string;
|
|
426
434
|
}
|
|
435
|
+
/**
|
|
436
|
+
* Text size configuration.
|
|
437
|
+
*
|
|
438
|
+
* @see {@link GlobalTextSizeString}
|
|
439
|
+
*/
|
|
427
440
|
interface TextSize {
|
|
441
|
+
/** Size type: 'GLOBAL_TEXT_SIZE' for theme sizes, 'NUMERIC_TEXT_SIZE' for custom */
|
|
428
442
|
type: 'GLOBAL_TEXT_SIZE' | 'NUMERIC_TEXT_SIZE';
|
|
443
|
+
/** Size value (string for global, number for custom) */
|
|
429
444
|
size: string | number;
|
|
430
445
|
}
|
|
446
|
+
/**
|
|
447
|
+
* Text capitalization/transform type.
|
|
448
|
+
*
|
|
449
|
+
* - 'none' — no transformation
|
|
450
|
+
* - 'all' — UPPERCASE
|
|
451
|
+
* - 'small' — Capitalize First Letter
|
|
452
|
+
*/
|
|
431
453
|
type CapitalizationType = 'none' | 'all' | 'small';
|
|
432
454
|
|
|
455
|
+
/**
|
|
456
|
+
* Global design settings from the site theme.
|
|
457
|
+
*
|
|
458
|
+
* Contains font families, text sizes, and colors that can be
|
|
459
|
+
* referenced using global strings (e.g., 'global.fontFamily.title').
|
|
460
|
+
*
|
|
461
|
+
* @see {@link GlobalFontsString}
|
|
462
|
+
* @see {@link GlobalTextSizeString}
|
|
463
|
+
* @see {@link GlobalColorsString}
|
|
464
|
+
*/
|
|
433
465
|
interface GlobalDesign$1 {
|
|
466
|
+
/** Font family mappings (e.g., { title: 'Roboto', body: 'Open Sans' }) */
|
|
434
467
|
readonly fontFamily: Record<string, string>;
|
|
468
|
+
/** Text size mappings in pixels (e.g., { title: 48, subtitle: 32, body: 16 }) */
|
|
435
469
|
readonly textSize: Record<string, number>;
|
|
470
|
+
/** Color mappings (e.g., { title: Color, body: Color, background: Color }) */
|
|
436
471
|
readonly color: Record<string, Color$1>;
|
|
437
472
|
}
|
|
438
473
|
|
|
474
|
+
/**
|
|
475
|
+
* Image resolution variants.
|
|
476
|
+
*
|
|
477
|
+
* Used to access different image sizes from `ImageContentData.set`.
|
|
478
|
+
*
|
|
479
|
+
* @see {@link ImageContentData}
|
|
480
|
+
*/
|
|
481
|
+
declare enum ImageSet {
|
|
482
|
+
/** Original uploaded image */
|
|
483
|
+
ORIGINAL = "original",
|
|
484
|
+
/** Low resolution WebP (200x200) for placeholders */
|
|
485
|
+
WEBP_LOW_RES = "webp-200x200",
|
|
486
|
+
/** High resolution WebP (2000x2000) for desktop */
|
|
487
|
+
WEBP_HI_2X_RES = "webp-2000x2000",
|
|
488
|
+
/** Low resolution mobile WebP (100x200) for placeholders */
|
|
489
|
+
MOBILE_WEBP_LOW_RES = "cropped-webp-100x200",
|
|
490
|
+
/** High resolution mobile WebP (1000x2000) */
|
|
491
|
+
MOBILE_WEBP_HI_RES = "cropped-webp-1000x2000"
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Image information for a specific resolution.
|
|
495
|
+
*
|
|
496
|
+
* @see {@link ImageSet}
|
|
497
|
+
*/
|
|
498
|
+
interface ImageInfoData {
|
|
499
|
+
/** Image URL */
|
|
500
|
+
readonly url?: string;
|
|
501
|
+
/** Image width in pixels */
|
|
502
|
+
readonly width?: number;
|
|
503
|
+
/** Image height in pixels */
|
|
504
|
+
readonly height?: number;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Image border/edge detection information.
|
|
508
|
+
*
|
|
509
|
+
* Used for determining if image has uniform edges.
|
|
510
|
+
*/
|
|
511
|
+
interface ImageBorderInfoData {
|
|
512
|
+
/** Whether the image border is homogeneous */
|
|
513
|
+
readonly homogeneity?: boolean;
|
|
514
|
+
/** Border color (if homogeneous) */
|
|
515
|
+
readonly color?: {
|
|
516
|
+
readonly r: number;
|
|
517
|
+
readonly g: number;
|
|
518
|
+
readonly b: number;
|
|
519
|
+
readonly a: number;
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Logo frame/border configuration.
|
|
524
|
+
*
|
|
525
|
+
* @see {@link LogoDesignData}
|
|
526
|
+
*/
|
|
527
|
+
interface Frame {
|
|
528
|
+
/** Whether frame is visible */
|
|
529
|
+
visible: boolean;
|
|
530
|
+
/** Frame width in pixels */
|
|
531
|
+
width: number | undefined;
|
|
532
|
+
/** Frame color */
|
|
533
|
+
color: string | GlobalColorsString | undefined;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Transformed frame with resolved color.
|
|
537
|
+
*
|
|
538
|
+
* @see {@link Frame}
|
|
539
|
+
*/
|
|
540
|
+
interface TransformedFrame extends Omit<Frame, 'color'> {
|
|
541
|
+
/** Resolved color value */
|
|
542
|
+
color?: Color$1 | undefined;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Instantsite JavaScript API events.
|
|
547
|
+
*
|
|
548
|
+
* Used with `useInstantsiteJsApi` composable for lifecycle events.
|
|
549
|
+
*/
|
|
439
550
|
declare enum InstantsiteJsEvent {
|
|
551
|
+
/** Fired when a section (tile) is loaded and visible */
|
|
440
552
|
TILE_LOADED = "tile-loaded",
|
|
553
|
+
/** Fired when a section (tile) is unloaded/hidden */
|
|
441
554
|
TILE_UNLOADED = "tile-unloaded"
|
|
442
555
|
}
|
|
443
556
|
interface InstantsiteTilePromise$1 {
|
|
@@ -503,39 +616,241 @@ interface InstantsiteJSAPI$1 {
|
|
|
503
616
|
openSearchPage: (keyword: string | undefined) => void;
|
|
504
617
|
}
|
|
505
618
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
619
|
+
/**
|
|
620
|
+
* Return type for `useImageElementContent` composable.
|
|
621
|
+
*
|
|
622
|
+
* Provides responsive image URLs for different resolutions and devices.
|
|
623
|
+
* Use low-resolution images as placeholders while high-resolution loads.
|
|
624
|
+
*
|
|
625
|
+
* @see {@link useImageElementContent}
|
|
626
|
+
*/
|
|
627
|
+
interface ImageContent {
|
|
628
|
+
/** `true` if an image has been uploaded */
|
|
629
|
+
readonly hasContent: ComputedRef<boolean>;
|
|
630
|
+
/** Mobile placeholder image URL (low resolution) */
|
|
631
|
+
readonly lowResolutionMobileImage: ComputedRef<string | undefined>;
|
|
632
|
+
/** Mobile full quality image URL */
|
|
633
|
+
readonly highResolutionMobileImage: ComputedRef<string | undefined>;
|
|
634
|
+
/** Desktop placeholder image URL (low resolution) */
|
|
635
|
+
readonly lowResolutionDesktopImage: ComputedRef<string | undefined>;
|
|
636
|
+
/** Desktop full quality image URL */
|
|
637
|
+
readonly highResolutionDesktopImage: ComputedRef<string | undefined>;
|
|
509
638
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
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
|
-
|
|
639
|
+
/**
|
|
640
|
+
* Raw image data from the editor.
|
|
641
|
+
*
|
|
642
|
+
* Contains image set with different resolutions and border info.
|
|
643
|
+
*
|
|
644
|
+
* @see {@link ImageSet}
|
|
645
|
+
* @see {@link ImageInfoData}
|
|
646
|
+
*/
|
|
526
647
|
interface ImageContentData {
|
|
648
|
+
/** Border/edge detection info for the image */
|
|
527
649
|
readonly borderInfo?: ImageBorderInfoData;
|
|
650
|
+
/** Image URLs for different resolutions */
|
|
528
651
|
readonly set: {
|
|
529
652
|
[key in ImageSet]?: ImageInfoData;
|
|
530
653
|
};
|
|
531
654
|
}
|
|
532
655
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
656
|
+
/**
|
|
657
|
+
* Return type for `useInputboxElementContent` composable.
|
|
658
|
+
*
|
|
659
|
+
* Represents a single-line text input field from the editor.
|
|
660
|
+
*
|
|
661
|
+
* @see {@link useInputboxElementContent}
|
|
662
|
+
*/
|
|
663
|
+
interface InputBoxContent {
|
|
664
|
+
/** `true` if the field has non-empty text */
|
|
665
|
+
readonly hasContent: ComputedRef<boolean>;
|
|
666
|
+
/** The text string entered by the user */
|
|
667
|
+
readonly value: ComputedRef<string | undefined>;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/** Logo display type: text-based or image-based */
|
|
671
|
+
type LogoType = 'TEXT' | 'IMAGE';
|
|
672
|
+
/**
|
|
673
|
+
* Return type for `useLogoElementContent` composable.
|
|
674
|
+
*
|
|
675
|
+
* Represents site logo in headers/footers.
|
|
676
|
+
* Can be either text-based or image-based depending on `type`.
|
|
677
|
+
*
|
|
678
|
+
* @see {@link useLogoElementContent}
|
|
679
|
+
* @see {@link LogoType}
|
|
680
|
+
*/
|
|
681
|
+
interface LogoContent {
|
|
682
|
+
/** Logo type: 'TEXT' or 'IMAGE' */
|
|
683
|
+
readonly type: ComputedRef<LogoType | undefined>;
|
|
684
|
+
/** Text content (when type is 'TEXT') */
|
|
685
|
+
readonly text: ComputedRef<string | undefined>;
|
|
686
|
+
/** Image URLs (when type is 'IMAGE') */
|
|
687
|
+
readonly image: ComputedRef<{
|
|
688
|
+
lowResolutionMobileImage: string | undefined;
|
|
689
|
+
highResolutionMobileImage: string | undefined;
|
|
690
|
+
lowResolutionDesktopImage: string | undefined;
|
|
691
|
+
highResolutionDesktopImage: string | undefined;
|
|
692
|
+
} | undefined>;
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Raw logo data from the editor.
|
|
696
|
+
*
|
|
697
|
+
* @see {@link LogoContent}
|
|
698
|
+
*/
|
|
699
|
+
interface LogoContentData {
|
|
700
|
+
/** Logo type: 'TEXT' or 'IMAGE' */
|
|
701
|
+
readonly type: LogoType;
|
|
702
|
+
/** Text content for text logo */
|
|
703
|
+
readonly text: string;
|
|
704
|
+
/** Image data for image logo */
|
|
705
|
+
readonly image: ImageContentData;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Return type for `useMenuElementContent` and `useNavigationMenuElementContent` composables.
|
|
710
|
+
*
|
|
711
|
+
* Represents a navigation menu with action links.
|
|
712
|
+
*
|
|
713
|
+
* @see {@link useMenuElementContent}
|
|
714
|
+
* @see {@link useNavigationMenuElementContent}
|
|
715
|
+
* @see {@link ActionLink}
|
|
716
|
+
*/
|
|
717
|
+
interface MenuContent {
|
|
718
|
+
/** `true` if menu has at least one item */
|
|
719
|
+
readonly hasContent: ComputedRef<boolean>;
|
|
720
|
+
/** Array of menu items with title, type, link, and performAction */
|
|
721
|
+
readonly items: ComputedRef<ActionLink[]>;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Raw menu data from the editor.
|
|
725
|
+
*
|
|
726
|
+
* @see {@link MenuContent}
|
|
727
|
+
* @see {@link ActionLink}
|
|
728
|
+
*/
|
|
729
|
+
interface MenuContentData {
|
|
730
|
+
/** Array of menu items */
|
|
731
|
+
readonly items: ReadonlyArray<ActionLink>;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Raw product selector data from the editor.
|
|
736
|
+
*
|
|
737
|
+
* @see {@link ProductSelector}
|
|
738
|
+
*/
|
|
739
|
+
interface ProductSelectorData {
|
|
740
|
+
/** Single product selection (legacy) */
|
|
741
|
+
readonly product?: {
|
|
742
|
+
readonly id: number;
|
|
743
|
+
};
|
|
744
|
+
/** Multiple products selection */
|
|
745
|
+
readonly products?: {
|
|
746
|
+
/** Array of selected product IDs */
|
|
747
|
+
readonly productIds: Array<number>;
|
|
748
|
+
/** Selection mode */
|
|
749
|
+
readonly selectionType: keyof typeof ProductSelectionType;
|
|
750
|
+
};
|
|
751
|
+
/** Category ID for category-based selection */
|
|
752
|
+
readonly categoryId?: string;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Return type for `useProductSelectorElementContent` composable.
|
|
756
|
+
*
|
|
757
|
+
* Represents store products selected by the user in the editor.
|
|
758
|
+
*
|
|
759
|
+
* @see {@link useProductSelectorElementContent}
|
|
760
|
+
* @see {@link ProductSelectorData}
|
|
761
|
+
*/
|
|
762
|
+
interface ProductSelector {
|
|
763
|
+
/** Array of selected product objects with id, name, price, imageUrl, etc. */
|
|
764
|
+
products: ProductListComponentItem[];
|
|
765
|
+
/** `true` if at least one product is selected */
|
|
766
|
+
hasProducts: boolean;
|
|
767
|
+
/** Array of categories (when using category selection) */
|
|
768
|
+
categories: CategoryListComponentItem[];
|
|
769
|
+
/** Selected category ID (when using category selection) */
|
|
770
|
+
categoryId?: number;
|
|
771
|
+
/** `true` if selector data exists */
|
|
772
|
+
hasContent: boolean;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Return type for `useSelectboxElementContent` composable.
|
|
777
|
+
*
|
|
778
|
+
* Represents a dropdown selection from the editor.
|
|
779
|
+
*
|
|
780
|
+
* @see {@link useSelectboxElementContent}
|
|
781
|
+
*/
|
|
782
|
+
interface SelectBoxContent {
|
|
783
|
+
/** `true` if a selection has been made */
|
|
784
|
+
readonly hasContent: ComputedRef<boolean>;
|
|
785
|
+
/** The selected option value */
|
|
786
|
+
readonly value: ComputedRef<string | undefined>;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Return type for `useTextareaElementContent` composable.
|
|
791
|
+
*
|
|
792
|
+
* Represents a multi-line text input field from the editor.
|
|
793
|
+
* Preserves line breaks entered by the user.
|
|
794
|
+
*
|
|
795
|
+
* @see {@link useTextareaElementContent}
|
|
796
|
+
*/
|
|
797
|
+
interface TextAreaContent {
|
|
798
|
+
/** `true` if the field has non-empty text */
|
|
799
|
+
readonly hasContent: ComputedRef<boolean>;
|
|
800
|
+
/** The multi-line text string entered by the user */
|
|
801
|
+
readonly value: ComputedRef<string | undefined>;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Return type for `useToggleElementContent` composable.
|
|
806
|
+
*
|
|
807
|
+
* Represents a boolean toggle switch from the editor.
|
|
808
|
+
*
|
|
809
|
+
* @see {@link useToggleElementContent}
|
|
810
|
+
*/
|
|
811
|
+
interface ToggleContent {
|
|
812
|
+
/** `true` if toggle data exists */
|
|
813
|
+
readonly hasContent: ComputedRef<boolean>;
|
|
814
|
+
/** The toggle state: `true` if enabled, `false` if disabled */
|
|
815
|
+
readonly value: ComputedRef<boolean | undefined>;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Raw toggle data from the editor.
|
|
819
|
+
*/
|
|
820
|
+
interface ToggleContentData {
|
|
821
|
+
/** Whether the toggle is enabled */
|
|
822
|
+
readonly enabled: boolean;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
interface InputboxContentEditorDefaults {
|
|
826
|
+
readonly text: string;
|
|
827
|
+
}
|
|
828
|
+
interface TextareaContentEditorDefaults {
|
|
829
|
+
readonly text: string;
|
|
830
|
+
}
|
|
831
|
+
interface ImageContentEditorDefaults {
|
|
832
|
+
readonly borderInfo?: Record<string, never> | {
|
|
833
|
+
homogeneity: boolean;
|
|
834
|
+
color: {
|
|
835
|
+
r: number;
|
|
836
|
+
g: number;
|
|
837
|
+
b: number;
|
|
838
|
+
a: number;
|
|
839
|
+
};
|
|
840
|
+
};
|
|
841
|
+
readonly set: {
|
|
842
|
+
[key in keyof typeof ImageSet]?: ImageInfoData;
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
interface LogoContentEditorDefaults {
|
|
846
|
+
readonly type: LogoType;
|
|
847
|
+
readonly text?: string;
|
|
848
|
+
}
|
|
849
|
+
interface ProductSelectorContentEditorDefaults {
|
|
850
|
+
readonly maxProducts: number;
|
|
851
|
+
}
|
|
852
|
+
interface CategorySelectorContentEditorDefaults {
|
|
853
|
+
readonly maxCategories: number;
|
|
539
854
|
}
|
|
540
855
|
|
|
541
856
|
interface InputboxContentEditor {
|
|
@@ -611,119 +926,23 @@ interface CategorySelectorContentEditor {
|
|
|
611
926
|
}
|
|
612
927
|
type ContentEditor = TextareaContentEditor | InputboxContentEditor | ButtonContentEditor | ImageContentEditor | ToggleContentEditor | SelectboxContentEditor | DeckContentEditor | MenuContentEditor | NavigationMenuContentEditor | LogoContentEditor | ProductSelectorContentEditor | CategorySelectorContentEditor;
|
|
613
928
|
|
|
614
|
-
|
|
615
|
-
|
|
929
|
+
type ContentSettings = Record<string, ContentEditor>;
|
|
930
|
+
type MandatoryContentSettings = {
|
|
931
|
+
menu: NavigationMenuContentEditor;
|
|
932
|
+
logo: LogoContentEditor;
|
|
933
|
+
} | Record<string, never>;
|
|
934
|
+
|
|
935
|
+
interface TextDesignEditor {
|
|
936
|
+
readonly type: 'TEXT';
|
|
937
|
+
readonly label: string | Record<string, string>;
|
|
938
|
+
readonly colors: ReadonlyArray<string>;
|
|
939
|
+
readonly sizes: ReadonlyArray<number>;
|
|
940
|
+
defaults?: TextDesignEditorDefaults;
|
|
616
941
|
}
|
|
617
|
-
interface
|
|
618
|
-
readonly
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
readonly borderInfo?: Record<string, never> | {
|
|
622
|
-
homogeneity: boolean;
|
|
623
|
-
color: {
|
|
624
|
-
r: number;
|
|
625
|
-
g: number;
|
|
626
|
-
b: number;
|
|
627
|
-
a: number;
|
|
628
|
-
};
|
|
629
|
-
};
|
|
630
|
-
readonly set: {
|
|
631
|
-
[key in keyof typeof ImageSet]?: ImageInfoData;
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
interface LogoContentEditorDefaults {
|
|
635
|
-
readonly type: LogoType$1;
|
|
636
|
-
readonly text?: string;
|
|
637
|
-
}
|
|
638
|
-
interface ProductSelectorContentEditorDefaults {
|
|
639
|
-
readonly maxProducts: number;
|
|
640
|
-
}
|
|
641
|
-
interface CategorySelectorContentEditorDefaults {
|
|
642
|
-
readonly maxCategories: number;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
interface ButtonContentData {
|
|
646
|
-
readonly title: string;
|
|
647
|
-
readonly type: ButtonTypeEnum;
|
|
648
|
-
readonly link?: string;
|
|
649
|
-
readonly email?: string;
|
|
650
|
-
readonly phone?: string;
|
|
651
|
-
readonly tileId?: string;
|
|
652
|
-
readonly pageId?: string;
|
|
653
|
-
readonly pageUrl?: string;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
interface Card {
|
|
657
|
-
title: string;
|
|
658
|
-
settings: ContentSettings;
|
|
659
|
-
}
|
|
660
|
-
interface DeckContent {
|
|
661
|
-
readonly hasContent: ComputedRef<boolean>;
|
|
662
|
-
readonly cards: ComputedRef<ReadonlyArray<Card> | undefined>;
|
|
663
|
-
readonly getReactiveRef: typeof getReactiveRef;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
interface ToggleContentData {
|
|
667
|
-
readonly enabled: boolean;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
interface ActionLink {
|
|
671
|
-
id: string;
|
|
672
|
-
title?: string;
|
|
673
|
-
type?: string;
|
|
674
|
-
link?: string;
|
|
675
|
-
email?: string;
|
|
676
|
-
phone?: string;
|
|
677
|
-
tileIdForScroll?: string;
|
|
678
|
-
pageIdForNavigate?: string;
|
|
679
|
-
showStoreCategories?: boolean;
|
|
680
|
-
isSubmenuOpened?: boolean;
|
|
681
|
-
categoryId?: number;
|
|
682
|
-
performAction?: () => void;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
interface MenuContent {
|
|
686
|
-
readonly hasContent: ComputedRef<boolean>;
|
|
687
|
-
readonly items: ComputedRef<ActionLink[]>;
|
|
688
|
-
}
|
|
689
|
-
interface MenuContentData {
|
|
690
|
-
readonly items: ReadonlyArray<ActionLink>;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
type LogoType$1 = 'TEXT' | 'IMAGE';
|
|
694
|
-
interface LogoContent {
|
|
695
|
-
readonly type: ComputedRef<LogoType$1 | undefined>;
|
|
696
|
-
readonly text: ComputedRef<string | undefined>;
|
|
697
|
-
readonly image: ComputedRef<{
|
|
698
|
-
lowResolutionMobileImage: string | undefined;
|
|
699
|
-
highResolutionMobileImage: string | undefined;
|
|
700
|
-
lowResolutionDesktopImage: string | undefined;
|
|
701
|
-
highResolutionDesktopImage: string | undefined;
|
|
702
|
-
} | undefined>;
|
|
703
|
-
}
|
|
704
|
-
interface LogoContentData {
|
|
705
|
-
readonly type: LogoType$1;
|
|
706
|
-
readonly text: string;
|
|
707
|
-
readonly image: ImageContentData;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
type ContentSettings = Record<string, ContentEditor>;
|
|
711
|
-
type MandatoryContentSettings = {
|
|
712
|
-
menu: NavigationMenuContentEditor;
|
|
713
|
-
logo: LogoContentEditor;
|
|
714
|
-
} | Record<string, never>;
|
|
715
|
-
|
|
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;
|
|
722
|
-
}
|
|
723
|
-
interface ButtonDesignEditor {
|
|
724
|
-
readonly type: 'BUTTON';
|
|
725
|
-
readonly label: string | Record<string, string>;
|
|
726
|
-
defaults?: ButtonDesignEditorDefaults;
|
|
942
|
+
interface ButtonDesignEditor {
|
|
943
|
+
readonly type: 'BUTTON';
|
|
944
|
+
readonly label: string | Record<string, string>;
|
|
945
|
+
defaults?: ButtonDesignEditorDefaults;
|
|
727
946
|
}
|
|
728
947
|
interface ImageDesignEditor {
|
|
729
948
|
readonly type: 'IMAGE';
|
|
@@ -812,7 +1031,7 @@ interface TextDesignEditorDefaultsTransformed {
|
|
|
812
1031
|
readonly size?: TextSize | string;
|
|
813
1032
|
}
|
|
814
1033
|
interface ImageDesignEditorDefaultsTransformed {
|
|
815
|
-
readonly overlay: Overlay
|
|
1034
|
+
readonly overlay: Overlay;
|
|
816
1035
|
}
|
|
817
1036
|
interface ColorPickerDesignEditorDefaultsTransformed {
|
|
818
1037
|
readonly color?: Color$1;
|
|
@@ -826,7 +1045,7 @@ interface ButtonDesignEditorDefaultsTransformed {
|
|
|
826
1045
|
readonly visible?: boolean;
|
|
827
1046
|
}
|
|
828
1047
|
interface BackgroundDesignEditorDefaultsTransformed {
|
|
829
|
-
readonly background: Background
|
|
1048
|
+
readonly background: Background;
|
|
830
1049
|
}
|
|
831
1050
|
interface LogoDesignEditorDefaultsTransformed {
|
|
832
1051
|
readonly font?: Font;
|
|
@@ -836,85 +1055,245 @@ interface LogoDesignEditorDefaultsTransformed {
|
|
|
836
1055
|
}
|
|
837
1056
|
type DesignEditorDefaultsTransformed = TextDesignEditorDefaultsTransformed | ButtonDesignEditorDefaultsTransformed | ImageDesignEditorDefaultsTransformed | BackgroundDesignEditorDefaultsTransformed | ColorPickerDesignEditorDefaultsTransformed | LogoDesignEditorDefaultsTransformed;
|
|
838
1057
|
|
|
1058
|
+
/** Background type: solid color or gradient */
|
|
839
1059
|
type BackgroundType = 'solid' | 'gradient';
|
|
1060
|
+
/**
|
|
1061
|
+
* Solid color configuration.
|
|
1062
|
+
*
|
|
1063
|
+
* @see {@link Background}
|
|
1064
|
+
*/
|
|
840
1065
|
interface SolidColor {
|
|
1066
|
+
/** The solid color value */
|
|
841
1067
|
color: Color$1 | undefined;
|
|
842
1068
|
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Gradient color configuration.
|
|
1071
|
+
*
|
|
1072
|
+
* @see {@link Background}
|
|
1073
|
+
*/
|
|
843
1074
|
interface GradientColor {
|
|
1075
|
+
/** Gradient start color */
|
|
844
1076
|
fromColor: Color$1 | undefined;
|
|
1077
|
+
/** Gradient end color */
|
|
845
1078
|
toColor: Color$1 | undefined;
|
|
846
1079
|
}
|
|
847
|
-
|
|
1080
|
+
/**
|
|
1081
|
+
* Background configuration with solid or gradient options.
|
|
1082
|
+
*
|
|
1083
|
+
* @see {@link BackgroundDesignData}
|
|
1084
|
+
* @see {@link BackgroundType}
|
|
1085
|
+
*/
|
|
1086
|
+
interface Background {
|
|
1087
|
+
/** Background type: 'solid' or 'gradient' */
|
|
848
1088
|
type: BackgroundType | undefined;
|
|
1089
|
+
/** Solid color configuration */
|
|
849
1090
|
solid: SolidColor | undefined;
|
|
1091
|
+
/** Gradient color configuration */
|
|
850
1092
|
gradient: GradientColor | undefined;
|
|
851
1093
|
}
|
|
852
|
-
|
|
853
|
-
|
|
1094
|
+
/**
|
|
1095
|
+
* Return type for `useBackgroundElementDesign` composable.
|
|
1096
|
+
*
|
|
1097
|
+
* Provides background styling options from the design settings.
|
|
1098
|
+
*
|
|
1099
|
+
* @see {@link useBackgroundElementDesign}
|
|
1100
|
+
* @see {@link Background}
|
|
1101
|
+
*/
|
|
1102
|
+
interface BackgroundDesignData$1 {
|
|
1103
|
+
/** Background configuration */
|
|
1104
|
+
background: Background | undefined;
|
|
854
1105
|
}
|
|
855
1106
|
|
|
856
|
-
|
|
857
|
-
type
|
|
858
|
-
|
|
1107
|
+
/** Button fill style */
|
|
1108
|
+
type ButtonAppearance = 'solid-button' | 'outline-button' | 'text-link';
|
|
1109
|
+
/** Button size */
|
|
1110
|
+
type ButtonSize = 'small' | 'medium' | 'large';
|
|
1111
|
+
/** Button shape/corner style */
|
|
1112
|
+
type ButtonStyle = 'round-corner' | 'rectangle' | 'pill';
|
|
1113
|
+
/**
|
|
1114
|
+
* Return type for `useButtonElementDesign` composable.
|
|
1115
|
+
*
|
|
1116
|
+
* Provides button styling options from the design settings.
|
|
1117
|
+
*
|
|
1118
|
+
* @see {@link useButtonElementDesign}
|
|
1119
|
+
* @see {@link ButtonAppearance}
|
|
1120
|
+
* @see {@link ButtonSize}
|
|
1121
|
+
* @see {@link ButtonStyle}
|
|
1122
|
+
*/
|
|
859
1123
|
interface ButtonDesignData {
|
|
860
|
-
|
|
1124
|
+
/** Button fill style: 'solid-button', 'outline-button', or 'text-link' */
|
|
1125
|
+
appearance: ButtonAppearance | undefined;
|
|
1126
|
+
/** Font family name */
|
|
861
1127
|
font: string | GlobalFontsString | undefined;
|
|
862
|
-
size:
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1128
|
+
/** Button size: 'small', 'medium', or 'large' */
|
|
1129
|
+
size: ButtonSize | undefined;
|
|
1130
|
+
/** Button shape: 'round-corner', 'rectangle', or 'pill' */
|
|
1131
|
+
style: ButtonStyle | undefined;
|
|
1132
|
+
/** Button color */
|
|
1133
|
+
color: Color | GlobalColorsString | undefined;
|
|
1134
|
+
/** `true` if button should be displayed */
|
|
1135
|
+
visible?: boolean;
|
|
866
1136
|
}
|
|
867
1137
|
|
|
1138
|
+
/** Overlay type: solid color, gradient, or none */
|
|
868
1139
|
type OverlayType = 'solid' | 'gradient' | 'none';
|
|
869
|
-
|
|
1140
|
+
/**
|
|
1141
|
+
* Image overlay configuration.
|
|
1142
|
+
*
|
|
1143
|
+
* Used to add color or gradient overlay on top of images.
|
|
1144
|
+
*
|
|
1145
|
+
* @see {@link ImageDesignData}
|
|
1146
|
+
* @see {@link OverlayType}
|
|
1147
|
+
*/
|
|
1148
|
+
interface Overlay {
|
|
1149
|
+
/** Overlay type: 'solid', 'gradient', or 'none' */
|
|
870
1150
|
type: OverlayType | undefined;
|
|
1151
|
+
/** Solid color overlay (with alpha for transparency) */
|
|
871
1152
|
solid: SolidColor | undefined;
|
|
1153
|
+
/** Gradient overlay */
|
|
872
1154
|
gradient: GradientColor | undefined;
|
|
873
1155
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
1156
|
+
/**
|
|
1157
|
+
* Return type for `useImageElementDesign` composable.
|
|
1158
|
+
*
|
|
1159
|
+
* Provides image overlay styling options from the design settings.
|
|
1160
|
+
*
|
|
1161
|
+
* @see {@link useImageElementDesign}
|
|
1162
|
+
* @see {@link Overlay}
|
|
1163
|
+
*/
|
|
1164
|
+
interface ImageDesignData$1 {
|
|
1165
|
+
/** Overlay configuration */
|
|
1166
|
+
overlay: Overlay | undefined;
|
|
1167
|
+
/** `true` if image should be displayed */
|
|
1168
|
+
visible?: boolean;
|
|
877
1169
|
}
|
|
878
1170
|
|
|
879
|
-
|
|
1171
|
+
/**
|
|
1172
|
+
* Return type for `useTextElementDesign` composable.
|
|
1173
|
+
*
|
|
1174
|
+
* Provides text styling options from the design settings.
|
|
1175
|
+
* Supports global design references (e.g., 'global.fontFamily.title').
|
|
1176
|
+
*
|
|
1177
|
+
* @see {@link useTextElementDesign}
|
|
1178
|
+
* @see {@link GlobalFontsString}
|
|
1179
|
+
* @see {@link GlobalTextSizeString}
|
|
1180
|
+
*/
|
|
1181
|
+
interface TextDesignData$1 {
|
|
1182
|
+
/** Font family name (can be global reference) */
|
|
880
1183
|
font: string | GlobalFontsString | undefined;
|
|
881
|
-
size
|
|
1184
|
+
/** Font size in pixels (can be global reference) */
|
|
1185
|
+
size: number | GlobalTextSizeString | undefined;
|
|
1186
|
+
/** `true` if text should be bold */
|
|
882
1187
|
bold: boolean | undefined;
|
|
1188
|
+
/** `true` if text should be italic */
|
|
883
1189
|
italic: boolean | undefined;
|
|
1190
|
+
/** Text color */
|
|
884
1191
|
color: Color$1 | undefined;
|
|
885
|
-
|
|
1192
|
+
/** `true` if element should be displayed */
|
|
1193
|
+
visible?: boolean;
|
|
886
1194
|
}
|
|
887
|
-
|
|
1195
|
+
/**
|
|
1196
|
+
* Return type for `useTextareaElementDesign` composable.
|
|
1197
|
+
*
|
|
1198
|
+
* Extends TextDesignData with whiteSpace for preserving line breaks.
|
|
1199
|
+
*
|
|
1200
|
+
* @see {@link useTextareaElementDesign}
|
|
1201
|
+
* @see {@link TextDesignData}
|
|
1202
|
+
*/
|
|
1203
|
+
interface TextareaDesignData$1 extends TextDesignData$1 {
|
|
1204
|
+
/** Always 'pre-wrap' to preserve line breaks */
|
|
888
1205
|
readonly whiteSpace: string;
|
|
889
1206
|
}
|
|
890
1207
|
|
|
1208
|
+
/**
|
|
1209
|
+
* Return type for `useToggleElementDesign` composable.
|
|
1210
|
+
*
|
|
1211
|
+
* Provides toggle state from the design settings.
|
|
1212
|
+
*
|
|
1213
|
+
* @see {@link useToggleElementDesign}
|
|
1214
|
+
*/
|
|
891
1215
|
interface ToggleDesignData {
|
|
1216
|
+
/** `true` if the toggle is enabled */
|
|
892
1217
|
enabled: boolean | undefined;
|
|
893
1218
|
}
|
|
894
1219
|
|
|
1220
|
+
/**
|
|
1221
|
+
* Return type for `useSelectboxElementDesign` composable.
|
|
1222
|
+
*
|
|
1223
|
+
* Provides selected value from the design settings.
|
|
1224
|
+
*
|
|
1225
|
+
* @see {@link useSelectboxElementDesign}
|
|
1226
|
+
*/
|
|
895
1227
|
interface SelectboxDesignData {
|
|
1228
|
+
/** The selected option value */
|
|
896
1229
|
value: string | undefined;
|
|
897
1230
|
}
|
|
898
1231
|
|
|
1232
|
+
/**
|
|
1233
|
+
* Return type for `useLayoutElementDesign` composable.
|
|
1234
|
+
*
|
|
1235
|
+
* Provides layout identifier from the design settings.
|
|
1236
|
+
* Used for sections with multiple layout variants.
|
|
1237
|
+
*
|
|
1238
|
+
* @see {@link useLayoutElementDesign}
|
|
1239
|
+
*/
|
|
899
1240
|
interface LayoutDesignData {
|
|
1241
|
+
/** Layout identifier string (e.g., 'default', 'compact', 'wide') */
|
|
900
1242
|
layout: string | undefined;
|
|
901
1243
|
}
|
|
902
1244
|
|
|
1245
|
+
/**
|
|
1246
|
+
* Return type for `useLogoElementDesign` composable.
|
|
1247
|
+
*
|
|
1248
|
+
* Provides logo styling options from the design settings.
|
|
1249
|
+
* Includes text styling and logo-specific options like spacing and capitalization.
|
|
1250
|
+
*
|
|
1251
|
+
* @see {@link useLogoElementDesign}
|
|
1252
|
+
* @see {@link CapitalizationType}
|
|
1253
|
+
* @see {@link TransformedFrame}
|
|
1254
|
+
*/
|
|
903
1255
|
interface LogoDesignData$1 {
|
|
1256
|
+
/** Font family name */
|
|
904
1257
|
font: string | undefined;
|
|
1258
|
+
/** Font size in pixels */
|
|
905
1259
|
size: number | undefined;
|
|
1260
|
+
/** `true` if text should be bold */
|
|
906
1261
|
bold: boolean | undefined;
|
|
1262
|
+
/** `true` if text should be italic */
|
|
907
1263
|
italic: boolean | undefined;
|
|
1264
|
+
/** Text/logo color */
|
|
908
1265
|
color: Color$1 | undefined;
|
|
1266
|
+
/** `true` if logo should be displayed */
|
|
909
1267
|
visible: boolean | undefined;
|
|
1268
|
+
/** Letter spacing value */
|
|
910
1269
|
spacing: number | undefined;
|
|
1270
|
+
/** Text transform: 'none', 'all' (uppercase), or 'small' (capitalize) */
|
|
911
1271
|
capitalization: CapitalizationType | undefined;
|
|
1272
|
+
/** Logo frame/border style */
|
|
912
1273
|
frame: TransformedFrame | undefined;
|
|
913
1274
|
}
|
|
914
1275
|
|
|
915
1276
|
type DesignSettings = Record<string, DesignEditor>;
|
|
916
1277
|
type MandatoryDesignSettings = Record<'logo', LogoDesignEditor> | Record<string, never>;
|
|
917
1278
|
|
|
1279
|
+
interface LayoutDesignOverride {
|
|
1280
|
+
readonly fieldName: string;
|
|
1281
|
+
readonly type: DesignEditor['type'];
|
|
1282
|
+
defaults?: DesignEditorDefaults & {
|
|
1283
|
+
type?: DesignEditor['type'];
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
interface LayoutSettings {
|
|
1287
|
+
readonly layoutId: string;
|
|
1288
|
+
readonly layoutIcon: unknown;
|
|
1289
|
+
readonly selectedContentSettings: string[];
|
|
1290
|
+
readonly selectedDesignSettings: LayoutDesignOverride[];
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
interface StorePageConfiguration {
|
|
1294
|
+
readonly sections: [TemplateStorefrontSection];
|
|
1295
|
+
}
|
|
1296
|
+
|
|
918
1297
|
interface MenuItem {
|
|
919
1298
|
readonly id: string;
|
|
920
1299
|
readonly title?: string;
|
|
@@ -946,7 +1325,7 @@ interface ShowcaseDeckContentEditorDefaults {
|
|
|
946
1325
|
}
|
|
947
1326
|
interface ShowcaseLogoContentEditorDefaults {
|
|
948
1327
|
readonly type: 'LOGO';
|
|
949
|
-
readonly logoType?: LogoType
|
|
1328
|
+
readonly logoType?: LogoType;
|
|
950
1329
|
readonly text?: string;
|
|
951
1330
|
readonly imageData?: ImageContentEditorDefaults;
|
|
952
1331
|
}
|
|
@@ -973,6 +1352,34 @@ interface Showcase {
|
|
|
973
1352
|
}
|
|
974
1353
|
type ShowcaseOverride = Omit<Showcase, 'showcaseId' | 'previewImage'>;
|
|
975
1354
|
|
|
1355
|
+
interface TemplateSettings {
|
|
1356
|
+
readonly metadata: TemplateMetadata;
|
|
1357
|
+
readonly sections: TemplateSection[];
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
declare const TemplateCategoriesList: {
|
|
1361
|
+
readonly apparel_footwear: "apparel_footwear";
|
|
1362
|
+
readonly vape_smoke: "vape_smoke";
|
|
1363
|
+
readonly home_garden: "home_garden";
|
|
1364
|
+
readonly sport_outdoor: "sport_outdoor";
|
|
1365
|
+
readonly jewelry_accessories: "jewelry_accessories";
|
|
1366
|
+
readonly pet_animals: "pet_animals";
|
|
1367
|
+
readonly bikes: "bikes";
|
|
1368
|
+
readonly health_beauty: "health_beauty";
|
|
1369
|
+
readonly gift_shop: "gift_shop";
|
|
1370
|
+
readonly electronics: "electronics";
|
|
1371
|
+
readonly other: "other";
|
|
1372
|
+
};
|
|
1373
|
+
type TemplateCategory = typeof TemplateCategoriesList[keyof typeof TemplateCategoriesList];
|
|
1374
|
+
|
|
1375
|
+
interface TemplateMetadata {
|
|
1376
|
+
readonly name: string;
|
|
1377
|
+
readonly description?: string;
|
|
1378
|
+
readonly preview_url?: string;
|
|
1379
|
+
readonly cover_image?: ImageContentData;
|
|
1380
|
+
readonly categories?: TemplateCategory[];
|
|
1381
|
+
}
|
|
1382
|
+
|
|
976
1383
|
type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
977
1384
|
type ThreeDigits = `${Digit}${Digit}${Digit}`;
|
|
978
1385
|
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';
|
|
@@ -999,8 +1406,12 @@ type TemplateSection = TemplateDefaultSection | TemplateCustomSection | Template
|
|
|
999
1406
|
interface TemplatePage {
|
|
1000
1407
|
id: string;
|
|
1001
1408
|
type: TemplatePageEnum;
|
|
1409
|
+
readonly metadata?: CustomPageMetadata;
|
|
1002
1410
|
readonly sections: TemplateSection[];
|
|
1003
1411
|
}
|
|
1412
|
+
interface CustomPageMetadata {
|
|
1413
|
+
title: string;
|
|
1414
|
+
}
|
|
1004
1415
|
|
|
1005
1416
|
interface TemplateConfiguration {
|
|
1006
1417
|
metadata: TemplateMetadata;
|
|
@@ -1015,26 +1426,30 @@ interface TemplateMultiPageConfiguration extends TemplateConfiguration {
|
|
|
1015
1426
|
}
|
|
1016
1427
|
type TemplateConfigurationType = TemplateSinglePageConfiguration | TemplateMultiPageConfiguration | TemplatePage;
|
|
1017
1428
|
|
|
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'];
|
|
1027
|
-
};
|
|
1028
|
-
}
|
|
1029
|
-
interface LayoutSettings {
|
|
1030
|
-
readonly layoutId: string;
|
|
1031
|
-
readonly layoutIcon: unknown;
|
|
1032
|
-
readonly selectedContentSettings: string[];
|
|
1033
|
-
readonly selectedDesignSettings: LayoutDesignOverride[];
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
1429
|
type TranslationSettings = Record<string, Record<string, string>>;
|
|
1037
1430
|
|
|
1431
|
+
declare const CatalogLayoutSlot: {
|
|
1432
|
+
readonly PRODUCT_LIST: "CONTROLS";
|
|
1433
|
+
readonly BOTTOM_BAR: "FOOTER";
|
|
1434
|
+
readonly CUSTOM_SLOT: "CUSTOM_SLOT";
|
|
1435
|
+
};
|
|
1436
|
+
declare const CategoryLayoutSlot: {
|
|
1437
|
+
readonly CATEGORY_TITLE: "MAIN_TITLE";
|
|
1438
|
+
readonly PRODUCT_LIST: "CONTROLS";
|
|
1439
|
+
readonly BOTTOM_BAR: "FOOTER";
|
|
1440
|
+
readonly CUSTOM_SLOT: "CUSTOM_SLOT";
|
|
1441
|
+
};
|
|
1442
|
+
declare const ProductLayoutSlot: {
|
|
1443
|
+
readonly TOP_BAR: "TOP_BAR";
|
|
1444
|
+
readonly GALLERY: "GALLERY";
|
|
1445
|
+
readonly SIDEBAR: "SIDEBAR";
|
|
1446
|
+
readonly DESCRIPTION: "DESCRIPTION";
|
|
1447
|
+
readonly REVIEW_LIST: "REVIEW_LIST";
|
|
1448
|
+
readonly RELATED_PRODUCTS: "RELATED_PRODUCTS";
|
|
1449
|
+
readonly BOTTOM_BAR: "FOOTER";
|
|
1450
|
+
readonly CUSTOM_SLOT: "CUSTOM_SLOT";
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1038
1453
|
interface AppBaseContext {
|
|
1039
1454
|
readonly appName: string;
|
|
1040
1455
|
readonly blockName: string;
|
|
@@ -1131,6 +1546,7 @@ interface InstantsiteJSAPI {
|
|
|
1131
1546
|
openSearchPage: (keyword: string | undefined) => void;
|
|
1132
1547
|
}
|
|
1133
1548
|
|
|
1549
|
+
/** Composable for Instantsite JS API. Returns `window.instantsite` for platform interaction. */
|
|
1134
1550
|
declare function useInstantsiteJsApi(): InstantsiteJSAPI | undefined;
|
|
1135
1551
|
|
|
1136
1552
|
interface GlobalColors {
|
|
@@ -1160,6 +1576,7 @@ interface GlobalLayout {
|
|
|
1160
1576
|
tileMargin: number;
|
|
1161
1577
|
appearanceEffect: AppearanceEffectType;
|
|
1162
1578
|
}
|
|
1579
|
+
/** Global design settings from site theme. Referenced via 'global.xxx' syntax. */
|
|
1163
1580
|
interface GlobalDesign {
|
|
1164
1581
|
color?: GlobalColors;
|
|
1165
1582
|
fontFamily?: GlobalFonts;
|
|
@@ -1197,27 +1614,857 @@ declare function createVueServerApp<C, D>(appComponent: Component, extensions?:
|
|
|
1197
1614
|
};
|
|
1198
1615
|
};
|
|
1199
1616
|
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1617
|
+
/**
|
|
1618
|
+
* Composable for accessing BUTTON content with action link.
|
|
1619
|
+
*
|
|
1620
|
+
* Used for CTA buttons, links, and navigation elements defined in `settings/content.ts`.
|
|
1621
|
+
* Supports various action types: hyperlinks, email, phone, scroll to section, page navigation.
|
|
1622
|
+
*
|
|
1623
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1624
|
+
* @param elementName - The name of the element in content settings
|
|
1625
|
+
* @param externalContent - Optional external content (used internally for DECK cards)
|
|
1626
|
+
*
|
|
1627
|
+
* @returns `Reactive<ButtonContentData>` — reactive object with:
|
|
1628
|
+
* - `title: ComputedRef<string>` — button text label
|
|
1629
|
+
* - `type: ComputedRef<ButtonTypeEnum>` — action type
|
|
1630
|
+
* - `link: ComputedRef<string | undefined>` — URL for hyperlinks
|
|
1631
|
+
* - `email: ComputedRef<string | undefined>` — email address for mail links
|
|
1632
|
+
* - `phone: ComputedRef<string | undefined>` — phone number for tel links
|
|
1633
|
+
* - `tileDivId: ComputedRef<string | null>` — tile div ID for scroll-to-tile action
|
|
1634
|
+
* - `pageId: ComputedRef<string | undefined>` — page ID for navigation
|
|
1635
|
+
* - `pageUrl: ComputedRef<string | undefined>` — page URL for navigation
|
|
1636
|
+
* - `hasTitle: ComputedRef<boolean>` — `true` if button has text
|
|
1637
|
+
* - `hasLink: ComputedRef<boolean>` — `true` if button has a link
|
|
1638
|
+
* - `performAction: () => void` — triggers the button action (navigation, scroll, etc.)
|
|
1639
|
+
*
|
|
1640
|
+
* @see {@link ButtonContentData}
|
|
1641
|
+
* @see {@link ButtonTypeEnum}
|
|
1642
|
+
*
|
|
1643
|
+
* @example
|
|
1644
|
+
* ```typescript
|
|
1645
|
+
* // settings/content.ts
|
|
1646
|
+
* const content = {
|
|
1647
|
+
* cta_button: { type: 'BUTTON', label: '$label.cta_button' },
|
|
1648
|
+
* };
|
|
1649
|
+
*
|
|
1650
|
+
* // Section.vue
|
|
1651
|
+
* const ctaButton = useButtonElementContent<ContentType>('cta_button');
|
|
1652
|
+
*
|
|
1653
|
+
* // Template
|
|
1654
|
+
* <button v-if="ctaButton.hasTitle" @click="ctaButton.performAction">
|
|
1655
|
+
* {{ ctaButton.title }}
|
|
1656
|
+
* </button>
|
|
1657
|
+
* ```
|
|
1658
|
+
*/
|
|
1659
|
+
declare function useButtonElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): Reactive<Partial<ButtonContentData>>;
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* Composable for accessing CATEGORY_SELECTOR content.
|
|
1663
|
+
*
|
|
1664
|
+
* Used for displaying store categories selected by the user in the editor.
|
|
1665
|
+
* Supports both manual selection and root category selection modes.
|
|
1666
|
+
*
|
|
1667
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1668
|
+
* @param elementName - The name of the element in content settings
|
|
1669
|
+
*
|
|
1670
|
+
* @returns `Reactive<CategorySelector>` — reactive object with:
|
|
1671
|
+
* - `categories: ComputedRef<CategoryListComponentItem[]>` — array of category objects with `id`, `name`, `url`, `imageUrl`, etc.
|
|
1672
|
+
* - `categoryIds: ComputedRef<Array<number>>` — array of selected category IDs
|
|
1673
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if selector data exists
|
|
1674
|
+
* - `hasCategories: ComputedRef<boolean>` — `true` if at least one category is selected
|
|
1675
|
+
*
|
|
1676
|
+
* @see {@link CategorySelector}
|
|
1677
|
+
* @see {@link CategorySelectorData} — raw data type from editor
|
|
1678
|
+
*
|
|
1679
|
+
* @example
|
|
1680
|
+
* ```typescript
|
|
1681
|
+
* // settings/content.ts
|
|
1682
|
+
* const content = {
|
|
1683
|
+
* shop_categories: {
|
|
1684
|
+
* type: 'CATEGORY_SELECTOR',
|
|
1685
|
+
* label: '$label.categories',
|
|
1686
|
+
* defaults: { maxCategories: 6 },
|
|
1687
|
+
* },
|
|
1688
|
+
* };
|
|
1689
|
+
*
|
|
1690
|
+
* // Section.vue
|
|
1691
|
+
* const categories = useCategorySelectorElementContent<ContentType>('shop_categories');
|
|
1692
|
+
*
|
|
1693
|
+
* // Template
|
|
1694
|
+
* <div v-if="categories.hasCategories" class="category-grid">
|
|
1695
|
+
* <a v-for="cat in categories.categories" :key="cat.id" :href="cat.url">
|
|
1696
|
+
* <img :src="cat.imageUrl" :alt="cat.name" />
|
|
1697
|
+
* <span>{{ cat.name }}</span>
|
|
1698
|
+
* </a>
|
|
1699
|
+
* </div>
|
|
1700
|
+
* ```
|
|
1701
|
+
*/
|
|
1702
|
+
declare function useCategorySelectorElementContent<CONTENT>(elementName: string): Reactive<CategorySelector>;
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* Composable for accessing IMAGE content with multiple resolutions.
|
|
1706
|
+
*
|
|
1707
|
+
* Used for background images, hero images, and media defined in `settings/content.ts`.
|
|
1708
|
+
* Provides URLs for different screen sizes and resolutions (mobile/desktop, low/high res).
|
|
1709
|
+
*
|
|
1710
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1711
|
+
* @param elementName - The name of the element in content settings
|
|
1712
|
+
* @param externalContent - Optional external content (used internally for DECK cards)
|
|
1713
|
+
*
|
|
1714
|
+
* @returns `Reactive<ImageContent>` — reactive object with:
|
|
1715
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if an image is uploaded
|
|
1716
|
+
* - `lowResolutionMobileImage: ComputedRef<string | undefined>` — URL for mobile placeholder (100x200)
|
|
1717
|
+
* - `highResolutionMobileImage: ComputedRef<string | undefined>` — URL for mobile full quality (1000x2000)
|
|
1718
|
+
* - `lowResolutionDesktopImage: ComputedRef<string | undefined>` — URL for desktop placeholder (200x200)
|
|
1719
|
+
* - `highResolutionDesktopImage: ComputedRef<string | undefined>` — URL for desktop full quality (2000x2000)
|
|
1720
|
+
*
|
|
1721
|
+
* @see {@link ImageContent}
|
|
1722
|
+
* @see {@link ImageContentData} — raw data type from editor
|
|
1723
|
+
* @see {@link ImageBorderInfoData} — border info data
|
|
1724
|
+
* @see {@link ImageInfoData} — image info data
|
|
1725
|
+
*
|
|
1726
|
+
* @example
|
|
1727
|
+
* ```typescript
|
|
1728
|
+
* // settings/content.ts
|
|
1729
|
+
* const content = {
|
|
1730
|
+
* background_image: { type: 'IMAGE', label: '$label.background_image' },
|
|
1731
|
+
* };
|
|
1732
|
+
*
|
|
1733
|
+
* // Section.vue
|
|
1734
|
+
* const bgImage = useImageElementContent<ContentType>('background_image');
|
|
1735
|
+
*
|
|
1736
|
+
* // Template with responsive images
|
|
1737
|
+
* <picture v-if="bgImage.hasContent">
|
|
1738
|
+
* <source media="(max-width: 700px)" :srcset="bgImage.highResolutionMobileImage" />
|
|
1739
|
+
* <img :src="bgImage.highResolutionDesktopImage" alt="Background" />
|
|
1740
|
+
* </picture>
|
|
1741
|
+
* ```
|
|
1742
|
+
*/
|
|
1743
|
+
declare function useImageElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): Reactive<ImageContent>;
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Composable for accessing INPUTBOX content (single-line text).
|
|
1747
|
+
*
|
|
1748
|
+
* Used for titles, labels, and short text fields defined in `settings/content.ts`.
|
|
1749
|
+
*
|
|
1750
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1751
|
+
* @param elementName - The name of the element in content settings
|
|
1752
|
+
* @param externalContent - Optional external content (used internally for DECK cards)
|
|
1753
|
+
*
|
|
1754
|
+
* @returns `Reactive<InputBoxContent>` — reactive object with:
|
|
1755
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if the field has non-empty text
|
|
1756
|
+
* - `value: ComputedRef<string | undefined>` — the text string
|
|
1757
|
+
*
|
|
1758
|
+
* @see {@link InputBoxContent}
|
|
1759
|
+
*
|
|
1760
|
+
* @example
|
|
1761
|
+
* ```typescript
|
|
1762
|
+
* // settings/content.ts
|
|
1763
|
+
* const content = {
|
|
1764
|
+
* title: { type: 'INPUTBOX', label: '$label.title', placeholder: '$label.placeholder' },
|
|
1765
|
+
* };
|
|
1766
|
+
*
|
|
1767
|
+
* // Section.vue
|
|
1768
|
+
* const title = useInputboxElementContent<ContentType>('title');
|
|
1769
|
+
*
|
|
1770
|
+
* // Template
|
|
1771
|
+
* <h1 v-if="title.hasContent">{{ title.value }}</h1>
|
|
1772
|
+
* ```
|
|
1773
|
+
*/
|
|
1774
|
+
declare function useInputboxElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): Reactive<InputBoxContent>;
|
|
1775
|
+
|
|
1776
|
+
/**
|
|
1777
|
+
* Composable for accessing LOGO content in headers/footers.
|
|
1778
|
+
*
|
|
1779
|
+
* Used for site logo display. The logo can be either text-based or image-based,
|
|
1780
|
+
* determined by the `type` field.
|
|
1781
|
+
*
|
|
1782
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1783
|
+
*
|
|
1784
|
+
* @returns `Reactive<LogoContent>` — reactive object with:
|
|
1785
|
+
* - `type: ComputedRef<LogoType | undefined>` — logo type: 'TEXT' or 'IMAGE'
|
|
1786
|
+
* - `text: ComputedRef<string | undefined>` — text content (when type is 'TEXT')
|
|
1787
|
+
* - `image: ComputedRef<{...} | undefined>` — image URLs object (when type is 'IMAGE'):
|
|
1788
|
+
* - `lowResolutionMobileImage: string | undefined` — mobile placeholder URL
|
|
1789
|
+
* - `highResolutionMobileImage: string | undefined` — mobile full quality URL
|
|
1790
|
+
* - `lowResolutionDesktopImage: string | undefined` — desktop placeholder URL
|
|
1791
|
+
* - `highResolutionDesktopImage: string | undefined` — desktop full quality URL
|
|
1792
|
+
*
|
|
1793
|
+
* @see {@link LogoContent}
|
|
1794
|
+
* @see {@link LogoContentData} — raw data type from editor
|
|
1795
|
+
* @see {@link LogoType} — 'TEXT' | 'IMAGE'
|
|
1796
|
+
*
|
|
1797
|
+
* @example
|
|
1798
|
+
* ```typescript
|
|
1799
|
+
* // Header.vue
|
|
1800
|
+
* const logo = useLogoElementContent<ContentType>();
|
|
1801
|
+
*
|
|
1802
|
+
* // Template
|
|
1803
|
+
* <div class="logo">
|
|
1804
|
+
* <template v-if="logo.type === 'TEXT'">
|
|
1805
|
+
* <span>{{ logo.text }}</span>
|
|
1806
|
+
* </template>
|
|
1807
|
+
* <template v-else>
|
|
1808
|
+
* <img :src="logo.image.highResolutionDesktopImage" alt="Logo" />
|
|
1809
|
+
* </template>
|
|
1810
|
+
* </div>
|
|
1811
|
+
* ```
|
|
1812
|
+
*/
|
|
1813
|
+
declare function useLogoElementContent<CONTENT>(): Reactive<LogoContent>;
|
|
1814
|
+
|
|
1815
|
+
/**
|
|
1816
|
+
* Composable for accessing MENU content.
|
|
1817
|
+
*
|
|
1818
|
+
* Used for navigation menus with action links. Each menu item has a `performAction`
|
|
1819
|
+
* method that triggers navigation.
|
|
1820
|
+
*
|
|
1821
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1822
|
+
* @param elementName - The name of the menu element in content settings
|
|
1823
|
+
*
|
|
1824
|
+
* @returns `Reactive<MenuContent>` — reactive object with:
|
|
1825
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if menu data exists
|
|
1826
|
+
* - `items: ComputedRef<ActionLink[]>` — array of menu items, each with:
|
|
1827
|
+
* - `title: string` — menu item text
|
|
1828
|
+
* - `type: string` — action type
|
|
1829
|
+
* - `link: string` — URL (for hyperlinks)
|
|
1830
|
+
* - `performAction: () => void` — triggers navigation
|
|
1831
|
+
*
|
|
1832
|
+
* @see {@link MenuContent}
|
|
1833
|
+
* @see {@link MenuContentData} — raw data type from editor
|
|
1834
|
+
* @see {@link ActionLink} — menu item type
|
|
1835
|
+
*
|
|
1836
|
+
* @example
|
|
1837
|
+
* ```typescript
|
|
1838
|
+
* // Section.vue
|
|
1839
|
+
* const menu = useMenuElementContent<ContentType>('navigation');
|
|
1840
|
+
*
|
|
1841
|
+
* // Template
|
|
1842
|
+
* <nav v-if="menu.hasContent">
|
|
1843
|
+
* <a v-for="item in menu.items" :key="item.title" @click="item.performAction">
|
|
1844
|
+
* {{ item.title }}
|
|
1845
|
+
* </a>
|
|
1846
|
+
* </nav>
|
|
1847
|
+
* ```
|
|
1848
|
+
*/
|
|
1849
|
+
declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): Reactive<MenuContent>;
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* Composable for accessing NAVIGATION_MENU content in headers/footers.
|
|
1853
|
+
*
|
|
1854
|
+
* A convenience wrapper around `useMenuElementContent` that uses the default 'menu' property.
|
|
1855
|
+
* Used for the main site navigation in headers and footers.
|
|
1856
|
+
*
|
|
1857
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1858
|
+
*
|
|
1859
|
+
* @returns `Reactive<MenuContent>` — reactive object with:
|
|
1860
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if menu data exists
|
|
1861
|
+
* - `items: ComputedRef<ActionLink[]>` — array of menu items with `title`, `type`, `link`, `performAction()`
|
|
1862
|
+
*
|
|
1863
|
+
* @see {@link MenuContent}
|
|
1864
|
+
* @see {@link useMenuElementContent} — underlying composable
|
|
1865
|
+
*
|
|
1866
|
+
* @example
|
|
1867
|
+
* ```typescript
|
|
1868
|
+
* // Header.vue
|
|
1869
|
+
* const menu = useNavigationMenuElementContent<ContentType>();
|
|
1870
|
+
*
|
|
1871
|
+
* // Template
|
|
1872
|
+
* <nav v-if="menu.hasContent" class="main-nav">
|
|
1873
|
+
* <a v-for="item in menu.items" :key="item.title" @click="item.performAction">
|
|
1874
|
+
* {{ item.title }}
|
|
1875
|
+
* </a>
|
|
1876
|
+
* </nav>
|
|
1877
|
+
* ```
|
|
1878
|
+
*/
|
|
1879
|
+
declare function useNavigationMenuElementContent<CONTENT>(): {
|
|
1880
|
+
readonly hasContent: boolean;
|
|
1881
|
+
readonly items: ActionLink[];
|
|
1210
1882
|
};
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* Composable for accessing PRODUCT_SELECTOR content.
|
|
1886
|
+
*
|
|
1887
|
+
* Used for displaying store products selected by the user in the editor.
|
|
1888
|
+
* Supports both manual selection and category-based selection modes.
|
|
1889
|
+
*
|
|
1890
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1891
|
+
* @param elementName - The name of the element in content settings
|
|
1892
|
+
*
|
|
1893
|
+
* @returns `Reactive<ProductSelector>` — reactive object with:
|
|
1894
|
+
* - `products: ComputedRef<ProductListComponentItem[]>` — array of product objects with `id`, `name`, `price`, `imageUrl`, etc.
|
|
1895
|
+
* - `categories: ComputedRef<CategoryListComponentItem[]>` — array of categories (when using category selection)
|
|
1896
|
+
* - `categoryId: ComputedRef<number>` — selected category ID (when using category selection)
|
|
1897
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if selector data exists
|
|
1898
|
+
* - `hasProducts: ComputedRef<boolean>` — `true` if at least one product is selected
|
|
1899
|
+
*
|
|
1900
|
+
* @see {@link ProductSelector}
|
|
1901
|
+
* @see {@link ProductSelectorData} — raw data type from editor
|
|
1902
|
+
*
|
|
1903
|
+
* @example
|
|
1904
|
+
* ```typescript
|
|
1905
|
+
* // settings/content.ts
|
|
1906
|
+
* const content = {
|
|
1907
|
+
* featured_products: {
|
|
1908
|
+
* type: 'PRODUCT_SELECTOR',
|
|
1909
|
+
* label: '$label.products',
|
|
1910
|
+
* defaults: { maxProducts: 8 },
|
|
1911
|
+
* },
|
|
1912
|
+
* };
|
|
1913
|
+
*
|
|
1914
|
+
* // Section.vue
|
|
1915
|
+
* const products = useProductSelectorElementContent<ContentType>('featured_products');
|
|
1916
|
+
*
|
|
1917
|
+
* // Template
|
|
1918
|
+
* <div v-if="products.hasProducts" class="product-grid">
|
|
1919
|
+
* <div v-for="product in products.products" :key="product.id">
|
|
1920
|
+
* <img :src="product.imageUrl" :alt="product.name" />
|
|
1921
|
+
* <h3>{{ product.name }}</h3>
|
|
1922
|
+
* <span>{{ product.price }}</span>
|
|
1923
|
+
* </div>
|
|
1924
|
+
* </div>
|
|
1925
|
+
* ```
|
|
1926
|
+
*/
|
|
1927
|
+
declare function useProductSelectorElementContent<CONTENT>(elementName: string): Reactive<ProductSelector>;
|
|
1928
|
+
|
|
1929
|
+
/**
|
|
1930
|
+
* Composable for accessing SELECTBOX content (dropdown).
|
|
1931
|
+
*
|
|
1932
|
+
* Used for dropdown menus and option selectors defined in `settings/content.ts`.
|
|
1933
|
+
*
|
|
1934
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1935
|
+
* @param elementName - The name of the element in content settings
|
|
1936
|
+
* @param externalContent - Optional external content (used internally for DECK cards)
|
|
1937
|
+
*
|
|
1938
|
+
* @returns `Reactive<SelectBoxContent>` — reactive object with:
|
|
1939
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if a value is selected
|
|
1940
|
+
* - `value: ComputedRef<string | undefined>` — the selected option value
|
|
1941
|
+
*
|
|
1942
|
+
* @see {@link SelectBoxContent}
|
|
1943
|
+
*
|
|
1944
|
+
* @example
|
|
1945
|
+
* ```typescript
|
|
1946
|
+
* // settings/content.ts
|
|
1947
|
+
* const content = {
|
|
1948
|
+
* layout_type: {
|
|
1949
|
+
* type: 'SELECTBOX',
|
|
1950
|
+
* label: '$label.layout_type',
|
|
1951
|
+
* options: [
|
|
1952
|
+
* { value: 'grid', label: 'Grid' },
|
|
1953
|
+
* { value: 'list', label: 'List' },
|
|
1954
|
+
* ],
|
|
1955
|
+
* defaults: { value: 'grid' },
|
|
1956
|
+
* },
|
|
1957
|
+
* };
|
|
1958
|
+
*
|
|
1959
|
+
* // Section.vue
|
|
1960
|
+
* const layoutType = useSelectboxElementContent<ContentType>('layout_type');
|
|
1961
|
+
*
|
|
1962
|
+
* // Template
|
|
1963
|
+
* <div :class="layoutType.value">...</div>
|
|
1964
|
+
* ```
|
|
1965
|
+
*/
|
|
1966
|
+
declare function useSelectboxElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): Reactive<SelectBoxContent>;
|
|
1967
|
+
|
|
1968
|
+
/**
|
|
1969
|
+
* Composable for accessing TEXTAREA content (multi-line text).
|
|
1970
|
+
*
|
|
1971
|
+
* Used for descriptions, paragraphs, and long text fields defined in `settings/content.ts`.
|
|
1972
|
+
*
|
|
1973
|
+
* @template CONTENT - The content type from `type.ts`
|
|
1974
|
+
* @param elementName - The name of the element in content settings
|
|
1975
|
+
* @param externalContent - Optional external content (used internally for DECK cards)
|
|
1976
|
+
*
|
|
1977
|
+
* @returns `Reactive<TextAreaContent>` — reactive object with:
|
|
1978
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if the field has text
|
|
1979
|
+
* - `value: ComputedRef<string | undefined>` — the text string (may contain newlines)
|
|
1980
|
+
*
|
|
1981
|
+
* @see {@link TextAreaContent}
|
|
1982
|
+
*
|
|
1983
|
+
* @example
|
|
1984
|
+
* ```typescript
|
|
1985
|
+
* // settings/content.ts
|
|
1986
|
+
* const content = {
|
|
1987
|
+
* description: { type: 'TEXTAREA', label: '$label.description', placeholder: '' },
|
|
1988
|
+
* };
|
|
1989
|
+
*
|
|
1990
|
+
* // Section.vue
|
|
1991
|
+
* const description = useTextareaElementContent<ContentType>('description');
|
|
1992
|
+
*
|
|
1993
|
+
* // Template
|
|
1994
|
+
* <p v-if="description.hasContent" style="white-space: pre-wrap">
|
|
1995
|
+
* {{ description.value }}
|
|
1996
|
+
* </p>
|
|
1997
|
+
* ```
|
|
1998
|
+
*/
|
|
1999
|
+
declare function useTextareaElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): Reactive<TextAreaContent>;
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* Composable for accessing TOGGLE content (boolean switch).
|
|
2003
|
+
*
|
|
2004
|
+
* Used for on/off switches, visibility toggles, and feature flags defined in `settings/content.ts`.
|
|
2005
|
+
*
|
|
2006
|
+
* @template CONTENT - The content type from `type.ts`
|
|
2007
|
+
* @param elementName - The name of the element in content settings
|
|
2008
|
+
* @param externalContent - Optional external content (used internally for DECK cards)
|
|
2009
|
+
*
|
|
2010
|
+
* @returns `Reactive<ToggleContent>` — reactive object with:
|
|
2011
|
+
* - `hasContent: ComputedRef<boolean>` — `true` if toggle data exists
|
|
2012
|
+
* - `value: ComputedRef<boolean | undefined>` — `true` when enabled, `false` when disabled
|
|
2013
|
+
*
|
|
2014
|
+
* @see {@link ToggleContent}
|
|
2015
|
+
* @see {@link ToggleContentData} — raw data type from editor
|
|
2016
|
+
*
|
|
2017
|
+
* @example
|
|
2018
|
+
* ```typescript
|
|
2019
|
+
* // settings/content.ts
|
|
2020
|
+
* const content = {
|
|
2021
|
+
* show_price: { type: 'TOGGLE', label: '$label.show_price', defaults: { enabled: true } },
|
|
2022
|
+
* };
|
|
2023
|
+
*
|
|
2024
|
+
* // Section.vue
|
|
2025
|
+
* const showPrice = useToggleElementContent<ContentType>('show_price');
|
|
2026
|
+
*
|
|
2027
|
+
* // Template
|
|
2028
|
+
* <span v-if="showPrice.value" class="price">{{ product.price }}</span>
|
|
2029
|
+
* ```
|
|
2030
|
+
*/
|
|
2031
|
+
declare function useToggleElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): Reactive<ToggleContent>;
|
|
2032
|
+
|
|
2033
|
+
/**
|
|
2034
|
+
* Composable that provides translation functionality.
|
|
2035
|
+
* Translations are loaded from globalThis.craneSharedTranslation injected during build.
|
|
2036
|
+
* Works in both browser (client) and Node.js (server/SSR) environments.
|
|
2037
|
+
*
|
|
2038
|
+
* @returns An object with a `t` function that takes a translation key and returns the translated string
|
|
2039
|
+
*
|
|
2040
|
+
* @example
|
|
2041
|
+
* ```ts
|
|
2042
|
+
* import { useTranslation } from '@lightspeed/crane';
|
|
2043
|
+
*
|
|
2044
|
+
* const { t } = useTranslation();
|
|
2045
|
+
* const title = t('$label.shared.title');
|
|
2046
|
+
* ```
|
|
2047
|
+
*/
|
|
2048
|
+
declare function useTranslation(): {
|
|
2049
|
+
t: (key: string) => string;
|
|
2050
|
+
currentLanguageCode: vue.ComputedRef<string>;
|
|
1220
2051
|
};
|
|
1221
2052
|
|
|
1222
|
-
|
|
1223
|
-
|
|
2053
|
+
/**
|
|
2054
|
+
* Composable for accessing BACKGROUND design settings.
|
|
2055
|
+
*
|
|
2056
|
+
* Used for section backgrounds with solid color or gradient options.
|
|
2057
|
+
* Supports global color references (e.g., 'global.primary', 'global.secondary').
|
|
2058
|
+
*
|
|
2059
|
+
* @template DESIGN - The design type from `type.ts`
|
|
2060
|
+
* @param elementName - The name of the element in design settings
|
|
2061
|
+
*
|
|
2062
|
+
* @returns `Reactive<BackgroundDesignData>` — reactive object with:
|
|
2063
|
+
* - `background: Background | undefined` — background configuration object:
|
|
2064
|
+
* - `type: BackgroundType | undefined` — 'solid' or 'gradient'
|
|
2065
|
+
* - `solid: SolidColor | undefined` — solid background color object
|
|
2066
|
+
* - `color: Color | undefined` — the color value
|
|
2067
|
+
* - `gradient: GradientColor | undefined` — gradient color object
|
|
2068
|
+
* - `fromColor: Color | undefined` — gradient start color
|
|
2069
|
+
* - `toColor: Color | undefined` — gradient end color
|
|
2070
|
+
*
|
|
2071
|
+
* @see {@link BackgroundDesignData}
|
|
2072
|
+
* @see {@link Background}
|
|
2073
|
+
* @see {@link BackgroundType} — 'solid' | 'gradient'
|
|
2074
|
+
* @see {@link SolidColor}
|
|
2075
|
+
* @see {@link GradientColor}
|
|
2076
|
+
*
|
|
2077
|
+
* @example
|
|
2078
|
+
* ```typescript
|
|
2079
|
+
* // settings/design.ts
|
|
2080
|
+
* const design = {
|
|
2081
|
+
* section_background: {
|
|
2082
|
+
* type: 'BACKGROUND',
|
|
2083
|
+
* label: '$label.background',
|
|
2084
|
+
* colors: ['#ffffff', '#f5f5f5', 'global.primary', 'global.secondary'],
|
|
2085
|
+
* defaults: { background: { type: 'COLOR', solid: { color: '#ffffff' } } },
|
|
2086
|
+
* },
|
|
2087
|
+
* };
|
|
2088
|
+
*
|
|
2089
|
+
* // Section.vue
|
|
2090
|
+
* const bg = useBackgroundElementDesign<DesignType>('section_background');
|
|
2091
|
+
*
|
|
2092
|
+
* const backgroundStyle = computed(() => {
|
|
2093
|
+
* if (bg.background?.type === 'gradient') {
|
|
2094
|
+
* return `linear-gradient(${bg.background.gradient?.fromColor}, ${bg.background.gradient?.toColor})`;
|
|
2095
|
+
* }
|
|
2096
|
+
* return bg.background?.solid?.color;
|
|
2097
|
+
* });
|
|
2098
|
+
*
|
|
2099
|
+
* // Template
|
|
2100
|
+
* <section :style="{ background: backgroundStyle }">...</section>
|
|
2101
|
+
* ```
|
|
2102
|
+
*/
|
|
2103
|
+
declare function useBackgroundElementDesign<DESIGN>(elementName: keyof DESIGN): Reactive<BackgroundDesignData>;
|
|
2104
|
+
|
|
2105
|
+
/**
|
|
2106
|
+
* Composable for accessing BUTTON design settings.
|
|
2107
|
+
*
|
|
2108
|
+
* Used for styling button elements with appearance, size, shape, and color options.
|
|
2109
|
+
*
|
|
2110
|
+
* @template DESIGN - The design type from `type.ts`
|
|
2111
|
+
* @param elementName - The name of the element in design settings
|
|
2112
|
+
*
|
|
2113
|
+
* @returns `Reactive<ButtonDesignData>` — reactive object with:
|
|
2114
|
+
* - `appearance: ButtonAppearance | undefined` — button fill style: 'solid-button', 'outline-button', or 'text-link'
|
|
2115
|
+
* - `font: string | GlobalFontsString | undefined` — font family name
|
|
2116
|
+
* - `size: ButtonSize | undefined` — button size: 'small', 'medium', or 'large'
|
|
2117
|
+
* - `style: ButtonStyle | undefined` — button shape: 'pill', 'rectangle', or 'round-corner'
|
|
2118
|
+
* - `color: Color | GlobalColorsString | undefined` — button color
|
|
2119
|
+
* - `visible: boolean` — `true` if button should be displayed
|
|
2120
|
+
*
|
|
2121
|
+
* @see {@link ButtonDesignData}
|
|
2122
|
+
* @see {@link ButtonAppearance} — 'solid-button' | 'outline-button' | 'text-link'
|
|
2123
|
+
* @see {@link ButtonSize} — 'small' | 'medium' | 'large'
|
|
2124
|
+
* @see {@link ButtonStyle} — 'round-corner' | 'rectangle' | 'pill'
|
|
2125
|
+
*
|
|
2126
|
+
* @example
|
|
2127
|
+
* ```typescript
|
|
2128
|
+
* // settings/design.ts
|
|
2129
|
+
* const design = {
|
|
2130
|
+
* button_style: {
|
|
2131
|
+
* type: 'BUTTON',
|
|
2132
|
+
* label: '$label.button_style',
|
|
2133
|
+
* defaults: { appearance: 'SOLID', size: 'MEDIUM', shape: 'PILL', color: '#000000', visible: true },
|
|
2134
|
+
* },
|
|
2135
|
+
* };
|
|
2136
|
+
*
|
|
2137
|
+
* // Section.vue
|
|
2138
|
+
* const buttonStyle = useButtonElementDesign<DesignType>('button_style');
|
|
2139
|
+
*
|
|
2140
|
+
* // Template
|
|
2141
|
+
* <button
|
|
2142
|
+
* v-if="buttonStyle.visible"
|
|
2143
|
+
* :class="[
|
|
2144
|
+
* `btn-${buttonStyle.appearance?.toLowerCase()}`,
|
|
2145
|
+
* `btn-${buttonStyle.size?.toLowerCase()}`,
|
|
2146
|
+
* `btn-${buttonStyle.style?.toLowerCase()}`,
|
|
2147
|
+
* ]"
|
|
2148
|
+
* :style="{ backgroundColor: buttonStyle.color }"
|
|
2149
|
+
* >
|
|
2150
|
+
* {{ button.title }}
|
|
2151
|
+
* </button>
|
|
2152
|
+
* ```
|
|
2153
|
+
*/
|
|
2154
|
+
declare function useButtonElementDesign<DESIGN>(elementName: keyof DESIGN): Reactive<ButtonDesignData>;
|
|
2155
|
+
|
|
2156
|
+
/**
|
|
2157
|
+
* Composable for accessing IMAGE design settings.
|
|
2158
|
+
*
|
|
2159
|
+
* Used for image overlay styling (color or gradient overlay on top of images).
|
|
2160
|
+
*
|
|
2161
|
+
* @template DESIGN - The design type from `type.ts`
|
|
2162
|
+
* @param elementName - The name of the element in design settings
|
|
2163
|
+
*
|
|
2164
|
+
* @returns `Reactive<ImageDesignData>` — reactive object with:
|
|
2165
|
+
* - `overlay: Overlay | undefined` — overlay configuration object:
|
|
2166
|
+
* - `type: OverlayType | undefined` — 'solid', 'gradient', or 'none'
|
|
2167
|
+
* - `solid: SolidColor | undefined` — solid overlay color object
|
|
2168
|
+
* - `color: Color | undefined` — the color value (with alpha for transparency)
|
|
2169
|
+
* - `gradient: GradientColor | undefined` — gradient color object
|
|
2170
|
+
* - `fromColor: Color | undefined` — gradient start color
|
|
2171
|
+
* - `toColor: Color | undefined` — gradient end color
|
|
2172
|
+
* - `visible: boolean` — `true` if image should be displayed
|
|
2173
|
+
*
|
|
2174
|
+
* @see {@link ImageDesignData}
|
|
2175
|
+
* @see {@link Overlay}
|
|
2176
|
+
* @see {@link OverlayType} — 'solid' | 'gradient' | 'none'
|
|
2177
|
+
*
|
|
2178
|
+
* @example
|
|
2179
|
+
* ```typescript
|
|
2180
|
+
* // settings/design.ts
|
|
2181
|
+
* const design = {
|
|
2182
|
+
* image_style: {
|
|
2183
|
+
* type: 'IMAGE',
|
|
2184
|
+
* label: '$label.image_style',
|
|
2185
|
+
* colors: ['#000000', '#1a1a1a', '#2d2d2d', '#666666', '#999999'],
|
|
2186
|
+
* defaults: { overlay: { type: 'COLOR', solid: { color: '#000000' } }, visible: true },
|
|
2187
|
+
* },
|
|
2188
|
+
* };
|
|
2189
|
+
*
|
|
2190
|
+
* // Section.vue
|
|
2191
|
+
* const imageStyle = useImageElementDesign<DesignType>('image_style');
|
|
2192
|
+
*
|
|
2193
|
+
* // Template with overlay
|
|
2194
|
+
* <div v-if="imageStyle.visible" class="image-container">
|
|
2195
|
+
* <img :src="image.highResolutionDesktopImage" />
|
|
2196
|
+
* <div
|
|
2197
|
+
* v-if="imageStyle.overlay?.type !== 'none'"
|
|
2198
|
+
* class="overlay"
|
|
2199
|
+
* :style="{ backgroundColor: imageStyle.overlay?.solid?.color }"
|
|
2200
|
+
* />
|
|
2201
|
+
* </div>
|
|
2202
|
+
* ```
|
|
2203
|
+
*/
|
|
2204
|
+
declare function useImageElementDesign<DESIGN>(elementName: keyof DESIGN): Reactive<ImageDesignData>;
|
|
2205
|
+
|
|
2206
|
+
/**
|
|
2207
|
+
* Composable for accessing layout design settings.
|
|
2208
|
+
*
|
|
2209
|
+
* Used for layout selection in sections that support multiple layout variants.
|
|
2210
|
+
* The layout value is a string identifier that can be used to conditionally render
|
|
2211
|
+
* different layouts.
|
|
2212
|
+
*
|
|
2213
|
+
* @returns `Reactive<LayoutDesignData>` — reactive object with:
|
|
2214
|
+
* - `layout: string | undefined` — layout identifier string (e.g., 'default', 'compact', 'wide')
|
|
2215
|
+
*
|
|
2216
|
+
* @see {@link LayoutDesignData}
|
|
2217
|
+
*
|
|
2218
|
+
* @example
|
|
2219
|
+
* ```typescript
|
|
2220
|
+
* // settings/layout.ts
|
|
2221
|
+
* const layout = [
|
|
2222
|
+
* {
|
|
2223
|
+
* layoutId: 'layout_1',
|
|
2224
|
+
* selectedContentSettings: [], <-- default setting from content.ts
|
|
2225
|
+
* selectedDesignSettings: [], <-- default setting from design.ts
|
|
2226
|
+
* },
|
|
2227
|
+
* {
|
|
2228
|
+
* layoutId: 'layout_2',
|
|
2229
|
+
* selectedContentSettings: [
|
|
2230
|
+
* { ... }, <-- custom setting for layout 2
|
|
2231
|
+
* ],
|
|
2232
|
+
* selectedDesignSettings: [
|
|
2233
|
+
* { ... }, <-- custom setting for layout 2
|
|
2234
|
+
* ],
|
|
2235
|
+
* },
|
|
2236
|
+
* ];
|
|
2237
|
+
*
|
|
2238
|
+
* // Section.vue
|
|
2239
|
+
* const layoutDesign = useLayoutElementDesign();
|
|
2240
|
+
*
|
|
2241
|
+
* // Template
|
|
2242
|
+
* <div :class="`layout-${layoutDesign.layout}`">
|
|
2243
|
+
* <template v-if="layoutDesign.layout === 'compact'">
|
|
2244
|
+
* <!-- Compact layout -->
|
|
2245
|
+
* </template>
|
|
2246
|
+
* <template v-else>
|
|
2247
|
+
* <!-- Default layout -->
|
|
2248
|
+
* </template>
|
|
2249
|
+
* </div>
|
|
2250
|
+
* ```
|
|
2251
|
+
*/
|
|
2252
|
+
declare function useLayoutElementDesign(): Reactive<LayoutDesignData>;
|
|
2253
|
+
|
|
2254
|
+
/**
|
|
2255
|
+
* Composable for accessing LOGO design settings in headers/footers.
|
|
2256
|
+
*
|
|
2257
|
+
* Used for styling the site logo (text or image). Provides text styling options
|
|
2258
|
+
* and additional logo-specific settings like spacing and capitalization.
|
|
2259
|
+
*
|
|
2260
|
+
* @template DESIGN - The design type from `type.ts`
|
|
2261
|
+
*
|
|
2262
|
+
* @returns `ComputedRef<LogoDesignData>` — computed ref with:
|
|
2263
|
+
* - `font: string | undefined` — font family name
|
|
2264
|
+
* - `size: number | undefined` — font size in pixels
|
|
2265
|
+
* - `bold: boolean | undefined` — `true` if text is bold
|
|
2266
|
+
* - `italic: boolean | undefined` — `true` if text is italic
|
|
2267
|
+
* - `color: Color | undefined` — text/logo color
|
|
2268
|
+
* - `visible: boolean | undefined` — `true` if logo should be displayed
|
|
2269
|
+
* - `spacing: number | undefined` — letter spacing value
|
|
2270
|
+
* - `capitalization: CapitalizationType | undefined` — text transform: 'NONE', 'UPPERCASE', 'LOWERCASE', 'CAPITALIZE'
|
|
2271
|
+
* - `frame: Frame | TransformedFrame | undefined` — logo frame style (if applicable)
|
|
2272
|
+
*
|
|
2273
|
+
* @see {@link LogoDesignData}
|
|
2274
|
+
* @see {@link CapitalizationType}
|
|
2275
|
+
* @see {@link Frame}
|
|
2276
|
+
* @see {@link TransformedFrame}
|
|
2277
|
+
*
|
|
2278
|
+
* @example
|
|
2279
|
+
* ```typescript
|
|
2280
|
+
* // Header.vue
|
|
2281
|
+
* const logoDesign = useLogoElementDesign<DesignType>();
|
|
2282
|
+
*
|
|
2283
|
+
* // Template
|
|
2284
|
+
* <div
|
|
2285
|
+
* v-if="logoDesign.visible"
|
|
2286
|
+
* class="logo"
|
|
2287
|
+
* :style="{
|
|
2288
|
+
* fontFamily: logoDesign.font,
|
|
2289
|
+
* fontSize: logoDesign.size + 'px',
|
|
2290
|
+
* color: logoDesign.color,
|
|
2291
|
+
* letterSpacing: logoDesign.spacing + 'px',
|
|
2292
|
+
* textTransform: logoDesign.capitalization?.toLowerCase(),
|
|
2293
|
+
* }"
|
|
2294
|
+
* >
|
|
2295
|
+
* {{ logo.text }}
|
|
2296
|
+
* </div>
|
|
2297
|
+
* ```
|
|
2298
|
+
*/
|
|
2299
|
+
declare function useLogoElementDesign<DESIGN>(): ComputedRef<LogoDesignData>;
|
|
2300
|
+
|
|
2301
|
+
/**
|
|
2302
|
+
* Composable for accessing SELECTBOX design settings.
|
|
2303
|
+
*
|
|
2304
|
+
* Used for design-level dropdown selections (e.g., layout variants, alignment options).
|
|
2305
|
+
*
|
|
2306
|
+
* @template DESIGN - The design type from `type.ts`
|
|
2307
|
+
* @param elementName - The name of the element in design settings
|
|
2308
|
+
*
|
|
2309
|
+
* @returns `Reactive<SelectboxDesignData>` — reactive object with:
|
|
2310
|
+
* - `value: string | undefined` — the selected option value
|
|
2311
|
+
*
|
|
2312
|
+
* @see {@link SelectboxDesignData}
|
|
2313
|
+
*
|
|
2314
|
+
* @example
|
|
2315
|
+
* ```typescript
|
|
2316
|
+
* // settings/design.ts
|
|
2317
|
+
* const design = {
|
|
2318
|
+
* text_alignment: {
|
|
2319
|
+
* type: 'SELECTBOX',
|
|
2320
|
+
* label: '$label.alignment',
|
|
2321
|
+
* options: [
|
|
2322
|
+
* { value: 'left', label: 'Left' },
|
|
2323
|
+
* { value: 'center', label: 'Center' },
|
|
2324
|
+
* { value: 'right', label: 'Right' },
|
|
2325
|
+
* ],
|
|
2326
|
+
* defaults: { value: 'center' },
|
|
2327
|
+
* },
|
|
2328
|
+
* };
|
|
2329
|
+
*
|
|
2330
|
+
* // Section.vue
|
|
2331
|
+
* const alignment = useSelectboxElementDesign<DesignType>('text_alignment');
|
|
2332
|
+
*
|
|
2333
|
+
* // Template
|
|
2334
|
+
* <div :style="{ textAlign: alignment.value }">...</div>
|
|
2335
|
+
* ```
|
|
2336
|
+
*/
|
|
2337
|
+
declare function useSelectboxElementDesign<DESIGN>(elementName: keyof DESIGN): Reactive<SelectboxDesignData>;
|
|
2338
|
+
|
|
2339
|
+
/**
|
|
2340
|
+
* Composable for accessing TEXT design settings.
|
|
2341
|
+
*
|
|
2342
|
+
* Used for styling text elements (titles, descriptions, labels).
|
|
2343
|
+
* Supports global design references (e.g., 'global.heading', 'global.primary').
|
|
2344
|
+
*
|
|
2345
|
+
* @template DESIGN - The design type from `type.ts`
|
|
2346
|
+
* @param elementName - The name of the element in design settings
|
|
2347
|
+
*
|
|
2348
|
+
* @returns `Reactive<TextDesignData>` — reactive object with:
|
|
2349
|
+
* - `font: string | GlobalFontsString | undefined` — font family name (resolved from global if prefixed with 'global.')
|
|
2350
|
+
* - `size: number | GlobalTextSizeString | undefined` — font size in pixels (resolved from global if prefixed with 'global.')
|
|
2351
|
+
* - `bold: boolean | undefined` — `true` if text is bold
|
|
2352
|
+
* - `italic: boolean | undefined` — `true` if text is italic
|
|
2353
|
+
* - `color: Color | undefined` — text color (resolved from global if prefixed with 'global.')
|
|
2354
|
+
* - `visible: boolean` — `true` if element should be displayed
|
|
2355
|
+
*
|
|
2356
|
+
* @see {@link TextDesignData}
|
|
2357
|
+
* @see {@link Color}
|
|
2358
|
+
* @see {@link GlobalFontsString}
|
|
2359
|
+
* @see {@link GlobalTextSizeString}
|
|
2360
|
+
*
|
|
2361
|
+
* @example
|
|
2362
|
+
* ```typescript
|
|
2363
|
+
* // settings/design.ts
|
|
2364
|
+
* const design = {
|
|
2365
|
+
* title_style: {
|
|
2366
|
+
* type: 'TEXT',
|
|
2367
|
+
* label: '$label.title_style',
|
|
2368
|
+
* colors: ['#000000', '#333333', 'global.primary'],
|
|
2369
|
+
* sizes: [24, 32, 48, 'global.heading'],
|
|
2370
|
+
* defaults: { font: 'global.heading', size: 32, bold: true, color: '#000000', visible: true },
|
|
2371
|
+
* },
|
|
2372
|
+
* };
|
|
2373
|
+
*
|
|
2374
|
+
* // Section.vue
|
|
2375
|
+
* const titleStyle = useTextElementDesign<DesignType>('title_style');
|
|
2376
|
+
*
|
|
2377
|
+
* // Template
|
|
2378
|
+
* <h1
|
|
2379
|
+
* v-if="titleStyle.visible"
|
|
2380
|
+
* :style="{
|
|
2381
|
+
* fontFamily: titleStyle.font,
|
|
2382
|
+
* fontSize: titleStyle.size + 'px',
|
|
2383
|
+
* fontWeight: titleStyle.bold ? 'bold' : 'normal',
|
|
2384
|
+
* fontStyle: titleStyle.italic ? 'italic' : 'normal',
|
|
2385
|
+
* color: titleStyle.color,
|
|
2386
|
+
* }"
|
|
2387
|
+
* >
|
|
2388
|
+
* {{ title.value }}
|
|
2389
|
+
* </h1>
|
|
2390
|
+
* ```
|
|
2391
|
+
*/
|
|
2392
|
+
declare function useTextElementDesign<DESIGN>(elementName: keyof DESIGN): Reactive<TextDesignData>;
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* Composable for accessing TEXTAREA design settings.
|
|
2396
|
+
*
|
|
2397
|
+
* Similar to TEXT design but includes `whiteSpace: 'pre-wrap'` for preserving line breaks.
|
|
2398
|
+
* Used for styling multi-line text elements (descriptions, paragraphs).
|
|
2399
|
+
*
|
|
2400
|
+
* @template DESIGN - The design type from `type.ts`
|
|
2401
|
+
* @param elementName - The name of the element in design settings
|
|
2402
|
+
*
|
|
2403
|
+
* @returns `Reactive<TextareaDesignData>` — reactive object with:
|
|
2404
|
+
* - `font: string | GlobalFontsString | undefined` — font family name
|
|
2405
|
+
* - `size: number | GlobalTextSizeString | undefined` — font size in pixels
|
|
2406
|
+
* - `bold: boolean | undefined` — `true` if text is bold
|
|
2407
|
+
* - `italic: boolean | undefined` — `true` if text is italic
|
|
2408
|
+
* - `color: Color | undefined` — text color
|
|
2409
|
+
* - `visible: boolean` — `true` if element should be displayed
|
|
2410
|
+
* - `whiteSpace: string` — always 'pre-wrap' (preserves line breaks)
|
|
2411
|
+
*
|
|
2412
|
+
* @see {@link TextareaDesignData}
|
|
2413
|
+
* @see {@link TextDesignData} — base type
|
|
2414
|
+
*
|
|
2415
|
+
* @example
|
|
2416
|
+
* ```typescript
|
|
2417
|
+
* // Section.vue
|
|
2418
|
+
* const descStyle = useTextareaElementDesign<DesignType>('description_style');
|
|
2419
|
+
*
|
|
2420
|
+
* // Template
|
|
2421
|
+
* <p
|
|
2422
|
+
* v-if="descStyle.visible"
|
|
2423
|
+
* :style="{
|
|
2424
|
+
* fontFamily: descStyle.font,
|
|
2425
|
+
* fontSize: descStyle.size + 'px',
|
|
2426
|
+
* color: descStyle.color,
|
|
2427
|
+
* whiteSpace: descStyle.whiteSpace,
|
|
2428
|
+
* }"
|
|
2429
|
+
* >
|
|
2430
|
+
* {{ description.value }}
|
|
2431
|
+
* </p>
|
|
2432
|
+
* ```
|
|
2433
|
+
*/
|
|
2434
|
+
declare function useTextareaElementDesign<DESIGN>(elementName: keyof DESIGN): Reactive<TextareaDesignData>;
|
|
2435
|
+
|
|
2436
|
+
/**
|
|
2437
|
+
* Composable for accessing TOGGLE design settings.
|
|
2438
|
+
*
|
|
2439
|
+
* Used for design-level toggle switches (e.g., enable/disable a design feature).
|
|
2440
|
+
*
|
|
2441
|
+
* @template DESIGN - The design type from `type.ts`
|
|
2442
|
+
* @param elementName - The name of the element in design settings
|
|
2443
|
+
*
|
|
2444
|
+
* @returns `Reactive<ToggleDesignData>` — reactive object with:
|
|
2445
|
+
* - `enabled: boolean | undefined` — `true` if the toggle is enabled
|
|
2446
|
+
*
|
|
2447
|
+
* @see {@link ToggleDesignData}
|
|
2448
|
+
*
|
|
2449
|
+
* @example
|
|
2450
|
+
* ```typescript
|
|
2451
|
+
* // settings/design.ts
|
|
2452
|
+
* const design = {
|
|
2453
|
+
* show_shadow: {
|
|
2454
|
+
* type: 'TOGGLE',
|
|
2455
|
+
* label: '$label.show_shadow',
|
|
2456
|
+
* defaults: { enabled: true },
|
|
2457
|
+
* },
|
|
2458
|
+
* };
|
|
2459
|
+
*
|
|
2460
|
+
* // Section.vue
|
|
2461
|
+
* const showShadow = useToggleElementDesign<DesignType>('show_shadow');
|
|
2462
|
+
*
|
|
2463
|
+
* // Template
|
|
2464
|
+
* <div :class="{ 'with-shadow': showShadow.enabled }">...</div>
|
|
2465
|
+
* ```
|
|
2466
|
+
*/
|
|
2467
|
+
declare function useToggleElementDesign<DESIGN>(elementName: keyof DESIGN): Reactive<ToggleDesignData>;
|
|
2468
|
+
|
|
2469
|
+
export { ActionLinkTypeEnum, BackgroundStyleEnum, ButtonAppearanceEnum, ButtonShapeEnum, ButtonSizeEnum, ButtonTypeEnum, CatalogLayoutSlot, CategoryLayoutSlot, ConfigTypeEnum, DesignEditorType, EditorTypes, ImageSet, InstantsiteJsEvent, OverlayTypeEnum, PluginTypeEnum, ProductLayoutSlot, ReservedTemplatePageNameEnum, 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 };
|
|
2470
|
+
export type { ActionLink, AppBaseContext, AppBaseData, AppBaseState, Background, BackgroundDesignData$1 as BackgroundDesignData, BackgroundDesignEditor, BackgroundDesignEditorDefaults, BackgroundDesignEditorDefaultsTransformed, BackgroundType, ButtonAppearance, ButtonContentData, ButtonContentEditor, ButtonDesignData, ButtonDesignEditor, ButtonDesignEditorDefaults, ButtonDesignEditorDefaultsTransformed, ButtonSize, ButtonStyle, CapitalizationType, Card, CategorySelector, CategorySelectorContentEditor, CategorySelectorContentEditorDefaults, CategorySelectorData, Color$1 as Color, ColorPickerDesignEditor, ColorPickerDesignEditorDefaults, ColorPickerDesignEditorDefaultsTransformed, ContentEditor, ContentSettings, CustomPageMetadata, Deck, DeckContent, DeckContentEditor, DefaultSectionId, DesignEditor, DesignEditorDefaults, DesignEditorDefaultsTransformed, DesignSettings, DividerDesignEditor, Font, Frame, GlobalColorsString, GlobalDesign$1 as GlobalDesign, GlobalFontsString, GlobalTextSizeString, GradientColor, HSLColor, ImageBorderInfoData, ImageContent, ImageContentData, ImageContentEditor, ImageContentEditorDefaults, ImageDesignData$1 as 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, MandatoryContentSettings, MandatoryDesignSettings, MenuContent, MenuContentData, MenuContentEditor, NavigationMenuContentEditor, Overlay, OverlayType, ProductSelector, ProductSelectorContentEditor, ProductSelectorContentEditorDefaults, ProductSelectorData, 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$1 as TextDesignData, TextDesignEditor, TextDesignEditorDefaults, TextDesignEditorDefaultsTransformed, TextSize, TextareaContentEditor, TextareaContentEditorDefaults, TextareaDesignData$1 as TextareaDesignData, ToggleContent, ToggleContentData, ToggleContentEditor, ToggleDesignData, ToggleDesignEditor, TransformedFrame, TranslationSettings, VuegaPageId };
|