@lightspeed/crane 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types.d.ts CHANGED
@@ -1,55 +1,83 @@
1
1
  /// <reference types="vite/client" />
2
2
 
3
3
  declare module '*.vue' {
4
- import type { DefineComponent } from 'vue';
5
-
6
- const component: DefineComponent<{}, {}, any>;
7
- export default component;
4
+ import type { DefineComponent } from 'vue';
5
+ // eslint-disable-next-line
6
+ const component: DefineComponent<{}, {}, any>;
7
+ export default component;
8
8
  }
9
9
 
10
- type ButtonType =
11
- 'SCROLL_TO_TILE'
12
- | 'HYPER_LINK'
13
- | 'MAIL_LINK'
14
- | 'TEL_LINK'
15
- | 'GO_TO_STORE_LINK'
16
- | 'GO_TO_PAGE';
10
+ type ActionLinkType
11
+ = 'SCROLL_TO_TILE'
12
+ | 'HYPER_LINK'
13
+ | 'MAIL_LINK'
14
+ | 'TEL_LINK'
15
+ | 'GO_TO_STORE'
16
+ | 'GO_TO_STORE_LINK'
17
+ | 'GO_TO_PAGE';
17
18
 
18
19
  interface ButtonContentData {
19
- readonly title: string;
20
- readonly type: ButtonType;
21
- readonly link?: string;
22
- readonly email?: string;
23
- readonly phone?: string;
24
- readonly tileId?: string;
25
- readonly pageId?: string;
26
- readonly pageUrl?: string;
20
+ readonly title: string;
21
+ readonly type: ActionLinkType;
22
+ readonly link?: string;
23
+ readonly email?: string;
24
+ readonly phone?: string;
25
+ readonly tileId?: string;
26
+ readonly pageId?: string;
27
+ readonly pageUrl?: string;
27
28
  }
28
29
 
29
30
  interface ImageInfoData {
30
- readonly url: string;
31
- readonly width: number;
32
- readonly height: number;
31
+ readonly url: string;
32
+ readonly width: number;
33
+ readonly height: number;
33
34
  }
34
35
 
35
36
  interface ImageBorderInfoData {
36
- readonly homogeneity: boolean;
37
- readonly color: {
38
- readonly r: number;
39
- readonly g: number;
40
- readonly b: number;
41
- readonly a: number;
42
- };
37
+ readonly homogeneity: boolean;
38
+ readonly color: {
39
+ readonly r: number;
40
+ readonly g: number;
41
+ readonly b: number;
42
+ readonly a: number;
43
+ };
43
44
  }
44
45
 
45
46
  interface ImageContentData {
46
- readonly bucket: string;
47
- readonly borderInfo: ImageBorderInfoData;
48
- readonly set: Record<string, ImageInfoData>;
47
+ readonly bucket: string;
48
+ readonly borderInfo: ImageBorderInfoData;
49
+ readonly set: Record<string, ImageInfoData>;
49
50
  }
50
51
 
51
52
  interface ToggleContentData {
52
- readonly enabled: boolean;
53
+ readonly enabled: boolean;
54
+ }
55
+
56
+ interface ActionLink {
57
+ id: string;
58
+ title?: string;
59
+ type?: string;
60
+ link?: string;
61
+ email?: string;
62
+ phone?: string;
63
+ tileIdForScroll?: string;
64
+ pageIdForNavigate?: string;
65
+ showStoreCategories?: boolean;
66
+ isSubmenuOpened?: boolean;
67
+ categoryId?: number;
68
+ performAction?: () => void;
69
+ }
70
+
71
+ interface MenuContentData {
72
+ readonly items: ReadonlyArray<ActionLink>;
73
+ }
74
+
75
+ type LogoType = 'TEXT' | 'IMAGE';
76
+
77
+ interface LogoContentData {
78
+ readonly type: LogoType;
79
+ readonly text: string;
80
+ readonly image: ImageContentData
53
81
  }
54
82
 
55
83
  type GlobalColorsString =
@@ -69,242 +97,311 @@ type GlobalTextSizeString =
69
97
  'global.textSize.body';
70
98
 
71
99
  interface HSLColor {
72
- h: number;
73
- s: number;
74
- l: number;
75
- a: number;
100
+ h: number;
101
+ s: number;
102
+ l: number;
103
+ a: number;
76
104
  }
77
105
  interface RGBAColor {
78
- r: number;
79
- g: number;
80
- b: number;
81
- a: number;
106
+ r: number;
107
+ g: number;
108
+ b: number;
109
+ a: number;
82
110
  }
83
111
 
84
112
  interface Color {
85
- raw: string;
86
- hex: string;
87
- hsl: HSLColor;
88
- rgba: RGBAColor;
89
- auto?: boolean;
113
+ raw: string;
114
+ hex: string;
115
+ hsl: HSLColor;
116
+ rgba: RGBAColor;
117
+ auto?: boolean;
90
118
  }
91
119
 
92
120
  interface SolidColor {
93
- color: Color | GlobalColorsString | undefined;
121
+ color: Color | GlobalColorsString | undefined;
94
122
  }
95
123
 
96
124
  interface GradientColor {
97
- fromColor: Color | GlobalColorsString| undefined;
98
- toColor: Color | GlobalColorsString| undefined;
125
+ fromColor: Color | GlobalColorsString | undefined;
126
+ toColor: Color | GlobalColorsString | undefined;
99
127
  }
100
128
 
101
129
  interface TextDesignData {
102
- font: string | GlobalFontsString | undefined;
103
- size: number | GlobalTextSizeString | undefined;
104
- bold: boolean | undefined;
105
- italic: boolean | undefined;
106
- color: Color | GlobalColorsString | undefined;
107
- visible: boolean;
130
+ font: string | GlobalFontsString | undefined;
131
+ size: number | GlobalTextSizeString | undefined;
132
+ bold: boolean | undefined;
133
+ italic: boolean | undefined;
134
+ color: Color | GlobalColorsString | undefined;
135
+ visible: boolean;
108
136
  }
109
137
 
110
138
  interface TextareaDesignData extends TextDesignData {
111
- readonly whiteSpace: string;
139
+ readonly whiteSpace: string;
140
+ }
141
+
142
+ type CapitalizationType =
143
+ 'none'
144
+ | 'all'
145
+ | 'small';
146
+
147
+ interface Frame {
148
+ visible: boolean;
149
+ width: number | undefined;
150
+ color: Color | GlobalColorsString | undefined;
151
+ }
152
+
153
+ interface LogoDesignData {
154
+ font: string | GlobalFontsString | undefined;
155
+ size: number | GlobalTextSizeString | undefined;
156
+ bold: boolean | undefined;
157
+ italic: boolean | undefined;
158
+ color: Color | GlobalColorsString | undefined;
159
+ visible: boolean;
160
+ spacing: number | undefined;
161
+ capitalization: CapitalizationType | undefined;
162
+ frame: Frame | undefined;
112
163
  }
113
164
 
114
165
  type ButtonAppearance =
115
- 'solid-button'
116
- | 'outline-button'
117
- | 'text-link';
166
+ 'solid-button'
167
+ | 'outline-button'
168
+ | 'text-link';
118
169
 
119
170
  type ButtonSize =
120
- 'small'
121
- | 'medium'
122
- | 'large';
171
+ 'small'
172
+ | 'medium'
173
+ | 'large';
123
174
 
124
175
  type ButtonStyle =
125
- 'round-corner'
126
- | 'rectangle'
127
- | 'pill';
176
+ 'round-corner'
177
+ | 'rectangle'
178
+ | 'pill';
128
179
 
129
180
  interface ButtonDesignData {
130
- appearance: ButtonAppearance | undefined;
131
- font: string | GlobalFontsString | undefined;
132
- size: ButtonSize | undefined;
133
- style: ButtonStyle | undefined;
134
- color: Color | GlobalColorsString | undefined;
135
- visible: boolean;
181
+ appearance: ButtonAppearance | undefined;
182
+ font: string | GlobalFontsString | undefined;
183
+ size: ButtonSize | undefined;
184
+ style: ButtonStyle | undefined;
185
+ color: Color | GlobalColorsString | undefined;
186
+ visible: boolean;
136
187
  }
137
188
 
138
189
  type OverlayType =
139
- 'solid'
140
- | 'gradient'
141
- | 'none';
190
+ 'solid'
191
+ | 'gradient'
192
+ | 'none';
142
193
 
143
194
  interface Overlay {
144
- type: OverlayType | undefined;
145
- solid: SolidColor | undefined;
146
- gradient: GradientColor | undefined;
195
+ type: OverlayType | undefined;
196
+ solid: SolidColor | undefined;
197
+ gradient: GradientColor | undefined;
147
198
  }
148
199
 
149
200
  interface ImageDesignData {
150
- overlay: Overlay | undefined;
151
- visible: boolean;
201
+ overlay: Overlay | undefined;
202
+ visible: boolean;
152
203
  }
153
204
 
154
205
  interface SelectboxDesignData {
155
- value: string | undefined;
206
+ value: string | undefined;
156
207
  }
157
208
 
158
209
  interface ToggleDesignData {
159
- enabled: boolean | undefined;
210
+ enabled: boolean | undefined;
160
211
  }
161
212
 
162
213
  type BackgroundType =
163
- 'solid'
164
- | 'gradient';
214
+ 'solid'
215
+ | 'gradient';
165
216
 
166
217
  interface Background {
167
- type: BackgroundType | undefined;
168
- solid: SolidColor | undefined;
169
- gradient: GradientColor | undefined;
218
+ type: BackgroundType | undefined;
219
+ solid: SolidColor | undefined;
220
+ gradient: GradientColor | undefined;
170
221
  }
171
222
 
172
223
  interface BackgroundDesignData {
173
- background: Background | undefined;
224
+ background: Background | undefined;
174
225
  }
175
226
 
176
227
  type MapEditorContentTypes = {
177
- readonly INPUTBOX: string;
178
- readonly TEXTAREA: string;
179
- readonly BUTTON: ButtonContentData;
180
- readonly IMAGE: ImageContentData;
181
- readonly TOGGLE: ToggleContentData;
182
- readonly SELECTBOX: string;
228
+ readonly INPUTBOX: string;
229
+ readonly TEXTAREA: string;
230
+ readonly BUTTON: ButtonContentData;
231
+ readonly IMAGE: ImageContentData;
232
+ readonly TOGGLE: ToggleContentData;
233
+ readonly SELECTBOX: string;
234
+ readonly MENU: MenuContentData;
235
+ readonly LOGO: LogoContentData;
183
236
  };
184
237
 
185
238
  interface InputboxContentEditor {
186
- readonly type: 'INPUTBOX';
187
- readonly label: Record<string, string>;
188
- readonly placeholder: Record<string, string>;
239
+ readonly type: 'INPUTBOX';
240
+ readonly label: Record<string, string>;
241
+ readonly placeholder: Record<string, string>;
189
242
  }
190
243
 
191
244
  interface TextareaContentEditor {
192
- readonly type: 'TEXTAREA';
193
- readonly label: Record<string, string>;
194
- readonly placeholder: Record<string, string>;
245
+ readonly type: 'TEXTAREA';
246
+ readonly label: Record<string, string>;
247
+ readonly placeholder: Record<string, string>;
195
248
  }
196
249
 
197
- interface ExternalContentData {
198
- readonly reportAbuse?: ReportAbuse;
250
+ interface SimpleLink {
251
+ readonly url?: string,
252
+ readonly title?: string,
253
+ readonly target?: string,
199
254
  }
200
255
 
201
- interface ReportAbuse {
202
- readonly url: string,
203
- readonly title: string,
204
- readonly target: string,
256
+ interface SimpleLink {
257
+ readonly url?: string,
258
+ readonly title?: string,
259
+ readonly target?: string,
260
+ }
261
+
262
+ interface Language {
263
+ readonly code: string;
264
+ readonly description: string;
265
+ readonly main: boolean;
266
+ readonly selected: boolean;
267
+ readonly url?: string;
268
+ }
269
+
270
+ interface ExternalContentData {
271
+ readonly reportAbuse?: SimpleLink;
272
+ readonly account?: SimpleLink;
273
+ readonly languages?: Language[];
274
+ readonly legalLinks?: SimpleLink[];
275
+ readonly isPreviewMode?: boolean;
205
276
  }
206
277
 
207
278
  interface ButtonContentEditor {
208
- readonly type: 'BUTTON';
209
- readonly label: Record<string, string>;
279
+ readonly type: 'BUTTON';
280
+ readonly label: Record<string, string>;
210
281
  }
211
282
 
212
283
  interface ImageContentEditor {
213
- readonly type: 'IMAGE';
214
- readonly label: Record<string, string>;
284
+ readonly type: 'IMAGE';
285
+ readonly label: Record<string, string>;
215
286
  }
216
287
 
217
288
  interface ToggleContentEditor {
218
- readonly type: 'TOGGLE';
219
- readonly label: Record<string, string>;
220
- readonly description?: Record<string, string>;
289
+ readonly type: 'TOGGLE';
290
+ readonly label: Record<string, string>;
291
+ readonly description?: Record<string, string>;
221
292
  }
222
293
 
223
294
  interface SelectboxContentOption {
224
- readonly value: string;
225
- readonly label: Record<string, string>;
295
+ readonly value: string;
296
+ readonly label: Record<string, string>;
226
297
  }
227
298
 
228
299
  interface SelectboxContentEditor {
229
- readonly type: 'SELECTBOX';
230
- readonly label: Record<string, string>;
231
- readonly placeholder: Record<string, string>;
232
- readonly description?: Record<string, string>;
233
- readonly options: ReadonlyArray<SelectboxOption>;
300
+ readonly type: 'SELECTBOX';
301
+ readonly label: Record<string, string>;
302
+ readonly placeholder: Record<string, string>;
303
+ readonly description?: Record<string, string>;
304
+ readonly options: ReadonlyArray<SelectboxOption>;
305
+ }
306
+
307
+ interface MenuContentEditor {
308
+ readonly type: 'MENU';
309
+ readonly label: Record<string, string>;
310
+ readonly items: ReadonlyArray<ActionLink>;
311
+ }
312
+
313
+ interface NavigationMenuContentEditor {
314
+ readonly type: 'NAVIGATION_MENU';
315
+ }
316
+
317
+ interface LogoContentEditor {
318
+ readonly type: 'LOGO';
319
+ readonly label: Record<string, string>;
234
320
  }
235
321
 
236
322
  type ContentEditor =
237
- TextContentEditor
238
- | MultilineTextContentEditor
239
- | ButtonContentEditor
240
- | ImageContentEditor
241
- | ToggleContentEditor
242
- | SelectboxContentEditor;
323
+ TextContentEditor
324
+ | MultilineTextContentEditor
325
+ | ButtonContentEditor
326
+ | ImageContentEditor
327
+ | ToggleContentEditor
328
+ | SelectboxContentEditor
329
+ | MenuContentEditor
330
+ | NavigationMenuContentEditor
331
+ | LogoContentEditor;
243
332
 
244
333
  type InferContentType<T extends Record<string, ContentEditor>> = {
245
- readonly [P in keyof T]: MapEditorContentTypes[T[P]['type']]
334
+ readonly [P in keyof T]: MapEditorContentTypes[T[P]['type']]
246
335
  }
247
336
 
248
337
  type MapEditorDesignTypes = {
249
- readonly TEXT: string;
250
- readonly BUTTON: string;
251
- readonly IMAGE: string;
252
- readonly TOGGLE: string;
253
- readonly SELECTBOX: string;
254
- readonly BACKGROUND: string;
255
- readonly COLOR_PICKER: string;
338
+ readonly TEXT: string;
339
+ readonly BUTTON: string;
340
+ readonly IMAGE: string;
341
+ readonly TOGGLE: string;
342
+ readonly SELECTBOX: string;
343
+ readonly BACKGROUND: string;
344
+ readonly COLOR_PICKER: string;
345
+ readonly LOGO: string;
256
346
  };
257
347
 
258
348
  interface TextDesignEditor {
259
- readonly type: 'TEXT';
260
- readonly label: string | Record<string, string>;
261
- defaults: Record<string, unknown>;
349
+ readonly type: 'TEXT';
350
+ readonly label: string | Record<string, string>;
351
+ defaults: Record<string, unknown>;
262
352
  }
263
353
 
264
354
  interface ButtonDesignEditor {
265
- readonly type: 'BUTTON';
266
- readonly label: string | Record<string, string>;
267
- defaults: Record<string, unknown>;
355
+ readonly type: 'BUTTON';
356
+ readonly label: string | Record<string, string>;
357
+ defaults: Record<string, unknown>;
268
358
  }
269
359
 
270
360
  interface ImageDesignEditor {
271
- readonly type: 'IMAGE';
272
- readonly label: string | Record<string, string>;
273
- defaults: Record<string, unknown>;
361
+ readonly type: 'IMAGE';
362
+ readonly label: string | Record<string, string>;
363
+ defaults: Record<string, unknown>;
274
364
  }
275
365
 
276
366
  interface ToggleDesignEditor {
277
- readonly type: 'TOGGLE';
278
- readonly label: string | Record<string, string>;
279
- defaults: Record<string, unknown>;
367
+ readonly type: 'TOGGLE';
368
+ readonly label: string | Record<string, string>;
369
+ defaults: Record<string, unknown>;
280
370
  }
281
371
 
282
372
  interface SelectboxDesignEditor {
283
- readonly type: 'SELECTBOX';
284
- readonly label: string | Record<string, string>;
285
- defaults: Record<string, unknown>;
373
+ readonly type: 'SELECTBOX';
374
+ readonly label: string | Record<string, string>;
375
+ defaults: Record<string, unknown>;
286
376
  }
287
377
 
288
378
  interface BackgroundDesignEditor {
289
- readonly type: 'BACKGROUND';
290
- readonly label: string | Record<string, string>;
291
- defaults: Record<string, unknown>;
379
+ readonly type: 'BACKGROUND';
380
+ readonly label: string | Record<string, string>;
381
+ defaults: Record<string, unknown>;
292
382
  }
293
383
 
294
384
  interface ColorPickerDesignEditor {
295
- readonly type: 'COLOR_PICKER';
296
- defaults: Record<string, unknown>;
385
+ readonly type: 'COLOR_PICKER';
386
+ defaults: Record<string, unknown>;
387
+ }
388
+
389
+ interface LogoDesignEditor {
390
+ readonly type: 'LOGO';
391
+ readonly label: string | Record<string, string>;
392
+ defaults: Record<string, unknown>;
297
393
  }
298
394
 
299
395
  type DesignEditor =
300
- TextDesignEditor
301
- | ButtonDesignEditor
302
- | ImageDesignEditor
303
- | ToggleDesignEditor
304
- | SelectboxDesignEditor
305
- | BackgroundDesignEditor
306
- | ColorPickerDesignEditor;
396
+ TextDesignEditor
397
+ | ButtonDesignEditor
398
+ | ImageDesignEditor
399
+ | ToggleDesignEditor
400
+ | SelectboxDesignEditor
401
+ | BackgroundDesignEditor
402
+ | ColorPickerDesignEditor
403
+ | LogoDesignEditor;
307
404
 
308
405
  type InferDesignType<T extends Record<string, DesignEditor>> = {
309
- readonly [P in keyof T]: MapEditorDesignTypes[T[P]['type']]
406
+ readonly [P in keyof T]: MapEditorDesignTypes[T[P]['type']]
310
407
  }
@@ -1,11 +0,0 @@
1
- <script setup lang="ts">
2
-
3
- </script>
4
-
5
- <template>
6
-
7
- </template>
8
-
9
- <style scoped lang="scss">
10
-
11
- </style>