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