@lightspeed/crane 2.0.3 → 2.0.5

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/cli.mjs +37 -21
  3. package/package.json +3 -2
  4. package/template/headers/example-header/showcases/2.ts +0 -3
  5. package/template/page-templates/example-template/pages/custom.ts +6 -0
  6. package/template/preview/shared/api-routes.ts +337 -11
  7. package/template/preview/shared/preview.ts +86 -30
  8. package/template/preview/shared/utils.ts +0 -1
  9. package/template/preview/vite.config.js +5 -0
  10. package/template/reference/sections/about-us/component/Stats.vue +2 -2
  11. package/template/reference/sections/about-us/settings/content.ts +28 -21
  12. package/template/reference/sections/about-us/settings/design.ts +1 -1
  13. package/template/reference/sections/about-us/showcases/1.ts +1 -0
  14. package/template/reference/sections/about-us/showcases/2.ts +1 -0
  15. package/template/reference/sections/intro-slider/component/Slider.vue +1 -1
  16. package/template/reference/sections/intro-slider/component/Title.vue +2 -2
  17. package/template/reference/sections/intro-slider/settings/content.ts +22 -1
  18. package/template/reference/sections/intro-slider/settings/design.ts +1 -1
  19. package/template/reference/sections/intro-slider/showcases/1.ts +1 -0
  20. package/template/reference/sections/intro-slider/showcases/2.ts +1 -0
  21. package/template/reference/sections/tag-lines/component/HighlightedText.vue +1 -1
  22. package/template/reference/sections/tag-lines/component/Title.vue +1 -1
  23. package/template/reference/sections/tag-lines/settings/content.ts +34 -0
  24. package/template/reference/sections/trending-categories/component/Title.vue +1 -1
  25. package/template/sections/example-section/settings/content.ts +15 -13
  26. package/template/sections/example-section/showcases/1.ts +0 -1
  27. package/template/sections/example-section/showcases/2.ts +0 -1
  28. package/template/sections/example-section/showcases/3.ts +0 -1
@@ -1,4 +1,4 @@
1
- const content: ContentEditor = {
1
+ export default {
2
2
  title: {
3
3
  type: 'INPUTBOX',
4
4
  label: '$label.section_title.label',
@@ -17,15 +17,17 @@ const content: ContentEditor = {
17
17
  type: 'INPUTBOX',
18
18
  label: '$label.stat_value.label',
19
19
  placeholder: '$label.stat_value.placeholder',
20
- text: '$label.stat_value.default.text',
21
- title: '$label.stat_value.default.text',
20
+ defaults: {
21
+ text: '$label.stat_value.default.text',
22
+ },
22
23
  },
23
24
  stat_caption: {
24
25
  type: 'INPUTBOX',
25
26
  label: '$label.stat_caption.label',
26
27
  placeholder: '$label.stat_caption.placeholder',
27
- text: '$label.stat_caption.default.text',
28
- title: '$label.stat_caption.default.text',
28
+ defaults: {
29
+ text: '$label.stat_caption.default.text',
30
+ },
29
31
  },
30
32
  },
31
33
  },
@@ -34,28 +36,33 @@ const content: ContentEditor = {
34
36
  button: {
35
37
  type: 'BUTTON',
36
38
  label: '$label.button_content.label',
37
- title: '$label.button_content.title',
39
+ defaults: {
40
+ title: '$label.button_content.title',
41
+ buttonType: 'HYPER_LINK',
42
+ link: 'https://www.example.com',
43
+ },
38
44
  },
39
45
  image: {
40
46
  type: 'IMAGE',
41
47
  label: '$label.image_content.label',
42
48
  defaults: {
43
- set: {
44
- MOBILE_WEBP_LOW_RES: {
45
- url: 'our_company_in_numbers.jpg',
46
- },
47
- MOBILE_WEBP_HI_RES: {
48
- url: 'our_company_in_numbers.jpg',
49
- },
50
- WEBP_LOW_RES: {
51
- url: 'our_company_in_numbers.jpg',
52
- },
53
- WEBP_HI_2X_RES: {
54
- url: 'our_company_in_numbers.jpg',
49
+ imageData: {
50
+ set: {
51
+ MOBILE_WEBP_LOW_RES: {
52
+ url: 'our_company_in_numbers.jpg',
53
+ },
54
+ MOBILE_WEBP_HI_RES: {
55
+ url: 'our_company_in_numbers.jpg',
56
+ },
57
+ WEBP_LOW_RES: {
58
+ url: 'our_company_in_numbers.jpg',
59
+ },
60
+ WEBP_HI_2X_RES: {
61
+ url: 'our_company_in_numbers.jpg',
62
+ },
55
63
  },
64
+ borderInfo: {},
56
65
  },
57
- borderInfo: {},
58
66
  },
59
67
  },
60
- };
61
- export default content;
68
+ } as const;
@@ -66,7 +66,7 @@ export default {
66
66
  defaults: {
67
67
  appearance: 'SOLID',
68
68
  size: 'MEDIUM',
69
- style: 'pill',
69
+ shape: 'PILL',
70
70
  color: '#000000',
71
71
  visible: true,
72
72
  },
@@ -103,6 +103,7 @@ export default {
103
103
  type: 'BUTTON',
104
104
  title: '$label.showcase_1.button_content.title',
105
105
  buttonType: 'HYPER_LINK',
106
+ link: 'https://www.example.com',
106
107
  },
107
108
  },
108
109
  design: {
@@ -91,6 +91,7 @@ export default {
91
91
  type: 'BUTTON',
92
92
  title: '$label.showcase_2.button_content.title',
93
93
  buttonType: 'HYPER_LINK',
94
+ link: 'https://www.example.com',
94
95
  },
95
96
  },
96
97
  design: {
@@ -79,7 +79,7 @@ const slideImageStyles = computed<CSSProperties>(() => {
79
79
  const slideTextStyles = computed<CSSProperties>(() => ({
80
80
  fontSize: `${slideTextDesign.size}px`,
81
81
  fontFamily: slideTextDesign.font,
82
- color: (slideTextDesign.color as Color).hex,
82
+ color: (slideTextDesign.color as Color)?.hex,
83
83
  fontStyle: slideTextDesign.italic ? 'italic' : 'normal',
84
84
  fontWeight: slideTextDesign.bold ? 'bold' : 'normal',
85
85
  }));
@@ -37,7 +37,7 @@ const titleClass = computed(() => [
37
37
  const titleStyle = computed<CSSProperties>(() => ({
38
38
  fontSize: `${titleDesign.size}px`,
39
39
  fontFamily: titleDesign.font,
40
- color: (titleDesign.color as Color).hex,
40
+ color: (titleDesign.color as Color)?.hex,
41
41
  fontStyle: titleDesign.italic ? 'italic' : 'normal',
42
42
  fontWeight: titleDesign.bold ? 'bold' : 'normal',
43
43
  }));
@@ -45,7 +45,7 @@ const titleStyle = computed<CSSProperties>(() => ({
45
45
  const descriptionStyle = computed<CSSProperties>(() => ({
46
46
  fontSize: `${descriptionDesign.size}px`,
47
47
  fontFamily: descriptionDesign.font,
48
- color: (descriptionDesign.color as Color).hex,
48
+ color: (descriptionDesign.color as Color)?.hex,
49
49
  fontStyle: descriptionDesign.italic ? 'italic' : 'normal',
50
50
  fontWeight: descriptionDesign.bold ? 'bold' : 'normal',
51
51
  }));
@@ -17,7 +17,11 @@ export default {
17
17
  section_button: {
18
18
  type: 'BUTTON',
19
19
  label: '$label.section_button.label',
20
- title: '$label.section_button.title',
20
+ defaults: {
21
+ title: '$label.section_button.title',
22
+ buttonType: 'HYPER_LINK',
23
+ link: 'https://www.example.com',
24
+ },
21
25
  },
22
26
  slider: {
23
27
  type: 'DECK',
@@ -31,6 +35,23 @@ export default {
31
35
  image_content: {
32
36
  type: 'IMAGE',
33
37
  label: '$label.slide_content.label',
38
+ imageData: {
39
+ set: {
40
+ MOBILE_WEBP_LOW_RES: {
41
+ url: 'category_4.jpg',
42
+ },
43
+ MOBILE_WEBP_HI_RES: {
44
+ url: 'category_4@2x.jpg',
45
+ },
46
+ WEBP_LOW_RES: {
47
+ url: 'category_4@2x.jpg',
48
+ },
49
+ WEBP_HI_2X_RES: {
50
+ url: 'category_4@2x.jpg',
51
+ },
52
+ },
53
+ borderInfo: {},
54
+ },
34
55
  },
35
56
  image_text: {
36
57
  type: 'TEXTAREA',
@@ -48,7 +48,7 @@ export default {
48
48
  defaults: {
49
49
  appearance: 'SOLID',
50
50
  size: 'MEDIUM',
51
- style: 'pill',
51
+ shape: 'PILL',
52
52
  color: '#000000',
53
53
  visible: true,
54
54
  },
@@ -26,6 +26,7 @@ export default {
26
26
  type: 'BUTTON',
27
27
  title: '$label.showcase_1.section_button.title',
28
28
  buttonType: 'HYPER_LINK',
29
+ link: 'https://www.example.com',
29
30
  },
30
31
  slider: {
31
32
  type: 'DECK',
@@ -22,6 +22,7 @@ export default {
22
22
  type: 'BUTTON',
23
23
  title: '$label.showcase_2.section_button.title',
24
24
  buttonType: 'HYPER_LINK',
25
+ link: 'https://www.example.com',
25
26
  },
26
27
  slider: {
27
28
  type: 'DECK',
@@ -14,7 +14,7 @@ const props = defineProps<{
14
14
  const textStyle = computed<CSSProperties>(() => ({
15
15
  fontSize: props.design.size ? `${props.design.size}px` : undefined,
16
16
  fontFamily: props.design.font,
17
- color: props.design.color ? (props.design.color as Color).hex : undefined,
17
+ color: props.design.color ? (props.design.color as Color)?.hex : undefined,
18
18
  fontStyle: props.design.italic ? 'italic' : 'normal',
19
19
  fontWeight: props.design.bold ? 'bold' : 'normal',
20
20
  }));
@@ -18,7 +18,7 @@ const titleDesign = useTextElementDesign<Design>('section_title');
18
18
  const titleStyle = computed<CSSProperties>(() => ({
19
19
  fontSize: `${titleDesign.size}px`,
20
20
  fontFamily: titleDesign.font,
21
- color: (titleDesign.color as Color).hex,
21
+ color: (titleDesign.color as Color)?.hex,
22
22
  fontStyle: titleDesign.italic ? 'italic' : 'normal',
23
23
  fontWeigh: titleDesign.bold ? 'bold' : 'normal',
24
24
  }));
@@ -26,6 +26,23 @@ export default {
26
26
  image_content: {
27
27
  type: 'IMAGE',
28
28
  label: '$label.content.deck.highlighted_text_image_on_hover.label',
29
+ imageData: {
30
+ set: {
31
+ MOBILE_WEBP_LOW_RES: {
32
+ url: 'fall_is_here.jpg',
33
+ },
34
+ MOBILE_WEBP_HI_RES: {
35
+ url: 'fall_is_here_preview.jpg',
36
+ },
37
+ WEBP_LOW_RES: {
38
+ url: 'fall_is_here.jpg',
39
+ },
40
+ WEBP_HI_2X_RES: {
41
+ url: 'fall_is_here_preview.jpg',
42
+ },
43
+ },
44
+ borderInfo: {},
45
+ },
29
46
  },
30
47
  },
31
48
  },
@@ -34,5 +51,22 @@ export default {
34
51
  section_image: {
35
52
  type: 'IMAGE',
36
53
  label: '$label.content.image_title.label',
54
+ imageData: {
55
+ set: {
56
+ MOBILE_WEBP_LOW_RES: {
57
+ url: 'fall_is_here.jpg',
58
+ },
59
+ MOBILE_WEBP_HI_RES: {
60
+ url: 'fall_is_here.jpg',
61
+ },
62
+ WEBP_LOW_RES: {
63
+ url: 'fall_is_here.jpg',
64
+ },
65
+ WEBP_HI_2X_RES: {
66
+ url: 'fall_is_here.jpg',
67
+ },
68
+ },
69
+ borderInfo: {},
70
+ },
37
71
  },
38
72
  } as const;
@@ -18,7 +18,7 @@ const titleDesign = useTextElementDesign<Design>('section_title');
18
18
  const titleStyle = computed(() => ({
19
19
  fontSize: `${titleDesign.size}px`,
20
20
  fontFamily: titleDesign.font,
21
- color: (titleDesign.color as Color).hex,
21
+ color: (titleDesign.color as Color)?.hex,
22
22
  'font-style': titleDesign.italic ? 'italic' : 'normal',
23
23
  'font-weight': titleDesign.bold ? 'bold' : 'normal',
24
24
  }));
@@ -26,21 +26,23 @@ export default {
26
26
  type: 'IMAGE',
27
27
  label: '$label.image_content_1.label',
28
28
  defaults: {
29
- set: {
30
- MOBILE_WEBP_LOW_RES: {
31
- url: 'new_arrivals_mobile_low.jpeg',
32
- },
33
- MOBILE_WEBP_HI_RES: {
34
- url: 'new_arrivals_mobile_high.jpeg',
35
- },
36
- WEBP_LOW_RES: {
37
- url: 'new_arrivals_pc_low.jpeg',
38
- },
39
- WEBP_HI_2X_RES: {
40
- url: 'new_arrivals_pc_high.jpeg',
29
+ imageData: {
30
+ set: {
31
+ MOBILE_WEBP_LOW_RES: {
32
+ url: 'new_arrivals_mobile_low.jpeg',
33
+ },
34
+ MOBILE_WEBP_HI_RES: {
35
+ url: 'new_arrivals_mobile_high.jpeg',
36
+ },
37
+ WEBP_LOW_RES: {
38
+ url: 'new_arrivals_pc_low.jpeg',
39
+ },
40
+ WEBP_HI_2X_RES: {
41
+ url: 'new_arrivals_pc_high.jpeg',
42
+ },
41
43
  },
44
+ borderInfo: {},
42
45
  },
43
- borderInfo: {},
44
46
  },
45
47
  },
46
48
  image_text: {
@@ -172,7 +172,6 @@ export default {
172
172
  button: {
173
173
  title: '$label.showcase_1.info.button.title',
174
174
  link: 'https://example.com',
175
- buttonType: 'HYPER_LINK',
176
175
  },
177
176
  },
178
177
  button: {
@@ -151,7 +151,6 @@ export default {
151
151
  button: {
152
152
  title: '$label.showcase_1.info.button.title',
153
153
  link: 'https://example.com',
154
- buttonType: 'HYPER_LINK',
155
154
  },
156
155
  },
157
156
  button: {
@@ -168,7 +168,6 @@ export default {
168
168
  button: {
169
169
  title: '$label.showcase_3.info.button.title',
170
170
  link: 'https://example.com',
171
- buttonType: 'HYPER_LINK',
172
171
  },
173
172
  },
174
173
  button: {