@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/dist/app.d.mts +57 -7
- package/dist/app.d.ts +57 -7
- package/dist/app.mjs +1 -1
- package/dist/cli.mjs +15 -15
- package/package.json +1 -1
- package/template/footers/example-footer/ExampleFooter.vue +7 -2
- package/template/footers/example-footer/component/LegalLinks.vue +20 -0
- package/template/footers/example-footer/component/ReportAbuse.vue +1 -1
- package/template/headers/example-header/ExampleHeader.vue +22 -3
- package/template/headers/example-header/assets/account_icon.svg +11 -0
- package/template/headers/example-header/assets/lightspeed_logo.png +0 -0
- package/template/headers/example-header/component/Account.vue +20 -0
- package/template/headers/example-header/component/Logo.vue +95 -0
- package/template/headers/example-header/component/NavigationMenu.vue +53 -0
- package/template/headers/example-header/settings/content.ts +9 -1
- package/template/headers/example-header/settings/design.ts +23 -1
- package/template/headers/example-header/settings/translations.ts +6 -2
- package/template/headers/example-header/showcases/1.ts +32 -3
- package/template/headers/example-header/showcases/2.ts +42 -0
- package/template/headers/example-header/showcases/translations.ts +14 -2
- package/template/package.json +1 -1
- package/template/shared/LanguageSelector.vue +75 -0
- package/template/templates/template.ts +26 -42
- package/types.d.ts +258 -161
- package/template/headers/example-header/component/SampleComponent.vue +0 -11
package/types.d.ts
CHANGED
|
@@ -1,55 +1,83 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
|
|
3
3
|
declare module '*.vue' {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
readonly url: string;
|
|
32
|
+
readonly width: number;
|
|
33
|
+
readonly height: number;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
interface ImageBorderInfoData {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
readonly bucket: string;
|
|
48
|
+
readonly borderInfo: ImageBorderInfoData;
|
|
49
|
+
readonly set: Record<string, ImageInfoData>;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
interface ToggleContentData {
|
|
52
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
100
|
+
h: number;
|
|
101
|
+
s: number;
|
|
102
|
+
l: number;
|
|
103
|
+
a: number;
|
|
76
104
|
}
|
|
77
105
|
interface RGBAColor {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
106
|
+
r: number;
|
|
107
|
+
g: number;
|
|
108
|
+
b: number;
|
|
109
|
+
a: number;
|
|
82
110
|
}
|
|
83
111
|
|
|
84
112
|
interface Color {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
113
|
+
raw: string;
|
|
114
|
+
hex: string;
|
|
115
|
+
hsl: HSLColor;
|
|
116
|
+
rgba: RGBAColor;
|
|
117
|
+
auto?: boolean;
|
|
90
118
|
}
|
|
91
119
|
|
|
92
120
|
interface SolidColor {
|
|
93
|
-
|
|
121
|
+
color: Color | GlobalColorsString | undefined;
|
|
94
122
|
}
|
|
95
123
|
|
|
96
124
|
interface GradientColor {
|
|
97
|
-
|
|
98
|
-
|
|
125
|
+
fromColor: Color | GlobalColorsString | undefined;
|
|
126
|
+
toColor: Color | GlobalColorsString | undefined;
|
|
99
127
|
}
|
|
100
128
|
|
|
101
129
|
interface TextDesignData {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
166
|
+
'solid-button'
|
|
167
|
+
| 'outline-button'
|
|
168
|
+
| 'text-link';
|
|
118
169
|
|
|
119
170
|
type ButtonSize =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
171
|
+
'small'
|
|
172
|
+
| 'medium'
|
|
173
|
+
| 'large';
|
|
123
174
|
|
|
124
175
|
type ButtonStyle =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
176
|
+
'round-corner'
|
|
177
|
+
| 'rectangle'
|
|
178
|
+
| 'pill';
|
|
128
179
|
|
|
129
180
|
interface ButtonDesignData {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
190
|
+
'solid'
|
|
191
|
+
| 'gradient'
|
|
192
|
+
| 'none';
|
|
142
193
|
|
|
143
194
|
interface Overlay {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
195
|
+
type: OverlayType | undefined;
|
|
196
|
+
solid: SolidColor | undefined;
|
|
197
|
+
gradient: GradientColor | undefined;
|
|
147
198
|
}
|
|
148
199
|
|
|
149
200
|
interface ImageDesignData {
|
|
150
|
-
|
|
151
|
-
|
|
201
|
+
overlay: Overlay | undefined;
|
|
202
|
+
visible: boolean;
|
|
152
203
|
}
|
|
153
204
|
|
|
154
205
|
interface SelectboxDesignData {
|
|
155
|
-
|
|
206
|
+
value: string | undefined;
|
|
156
207
|
}
|
|
157
208
|
|
|
158
209
|
interface ToggleDesignData {
|
|
159
|
-
|
|
210
|
+
enabled: boolean | undefined;
|
|
160
211
|
}
|
|
161
212
|
|
|
162
213
|
type BackgroundType =
|
|
163
|
-
|
|
164
|
-
|
|
214
|
+
'solid'
|
|
215
|
+
| 'gradient';
|
|
165
216
|
|
|
166
217
|
interface Background {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
218
|
+
type: BackgroundType | undefined;
|
|
219
|
+
solid: SolidColor | undefined;
|
|
220
|
+
gradient: GradientColor | undefined;
|
|
170
221
|
}
|
|
171
222
|
|
|
172
223
|
interface BackgroundDesignData {
|
|
173
|
-
|
|
224
|
+
background: Background | undefined;
|
|
174
225
|
}
|
|
175
226
|
|
|
176
227
|
type MapEditorContentTypes = {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
245
|
+
readonly type: 'TEXTAREA';
|
|
246
|
+
readonly label: Record<string, string>;
|
|
247
|
+
readonly placeholder: Record<string, string>;
|
|
195
248
|
}
|
|
196
249
|
|
|
197
|
-
interface
|
|
198
|
-
readonly
|
|
250
|
+
interface SimpleLink {
|
|
251
|
+
readonly url?: string,
|
|
252
|
+
readonly title?: string,
|
|
253
|
+
readonly target?: string,
|
|
199
254
|
}
|
|
200
255
|
|
|
201
|
-
interface
|
|
202
|
-
readonly url
|
|
203
|
-
readonly title
|
|
204
|
-
readonly target
|
|
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
|
-
|
|
209
|
-
|
|
279
|
+
readonly type: 'BUTTON';
|
|
280
|
+
readonly label: Record<string, string>;
|
|
210
281
|
}
|
|
211
282
|
|
|
212
283
|
interface ImageContentEditor {
|
|
213
|
-
|
|
214
|
-
|
|
284
|
+
readonly type: 'IMAGE';
|
|
285
|
+
readonly label: Record<string, string>;
|
|
215
286
|
}
|
|
216
287
|
|
|
217
288
|
interface ToggleContentEditor {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
|
|
225
|
-
|
|
295
|
+
readonly value: string;
|
|
296
|
+
readonly label: Record<string, string>;
|
|
226
297
|
}
|
|
227
298
|
|
|
228
299
|
interface SelectboxContentEditor {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
|
|
334
|
+
readonly [P in keyof T]: MapEditorContentTypes[T[P]['type']]
|
|
246
335
|
}
|
|
247
336
|
|
|
248
337
|
type MapEditorDesignTypes = {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
-
|
|
296
|
-
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
-
|
|
406
|
+
readonly [P in keyof T]: MapEditorDesignTypes[T[P]['type']]
|
|
310
407
|
}
|