@lightspeed/crane 2.0.5 → 3.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/UPGRADE.md +96 -0
  3. package/dist/cli.mjs +44 -25
  4. package/package.json +6 -3
  5. package/template/blank/sections/blank-section/BlankSection.vue +9 -0
  6. package/template/blank/sections/blank-section/assets/blank_section_showcase_1_preview.jpg +0 -0
  7. package/template/blank/sections/blank-section/client.ts +6 -0
  8. package/template/blank/sections/blank-section/server.ts +6 -0
  9. package/template/blank/sections/blank-section/settings/content.ts +2 -0
  10. package/template/blank/sections/blank-section/settings/design.ts +2 -0
  11. package/template/blank/sections/blank-section/settings/layout.ts +2 -0
  12. package/template/blank/sections/blank-section/settings/translations.ts +8 -0
  13. package/template/blank/sections/blank-section/showcases/1.ts +15 -0
  14. package/template/blank/sections/blank-section/showcases/translations.ts +10 -0
  15. package/template/blank/sections/blank-section/type.ts +5 -0
  16. package/template/collections/assets/collection_cover_image.png +0 -0
  17. package/template/collections/example-collection/configuration.ts +21 -0
  18. package/template/crane.config.json +1 -1
  19. package/template/footers/example-footer/ExampleFooter.vue +4 -4
  20. package/template/footers/example-footer/component/LegalLinks.vue +1 -1
  21. package/template/footers/example-footer/component/MadeWith.vue +1 -1
  22. package/template/footers/example-footer/component/ReportAbuse.vue +1 -1
  23. package/template/footers/example-footer/settings/design.ts +5 -4
  24. package/template/footers/example-footer/settings/translations.ts +4 -3
  25. package/template/footers/example-footer/showcases/1.ts +4 -2
  26. package/template/footers/example-footer/showcases/translations.ts +4 -2
  27. package/template/headers/example-header/ExampleHeader.vue +1 -1
  28. package/template/headers/example-header/component/Account.vue +1 -1
  29. package/template/headers/example-header/component/CategoriesDropdown.vue +1 -1
  30. package/template/headers/example-header/component/Logo.vue +7 -7
  31. package/template/headers/example-header/component/NavigationMenu.vue +1 -1
  32. package/template/headers/example-header/settings/content.ts +8 -1
  33. package/template/headers/example-header/settings/design.ts +7 -1
  34. package/template/headers/example-header/settings/layout.ts +1 -1
  35. package/template/headers/example-header/settings/translations.ts +4 -2
  36. package/template/headers/example-header/showcases/1.ts +15 -11
  37. package/template/headers/example-header/showcases/2.ts +12 -8
  38. package/template/headers/example-header/showcases/translations.ts +4 -2
  39. package/template/layouts/catalog/example-catalog/components/Icon.vue +14 -14
  40. package/template/layouts/catalog/example-catalog/slots/custom-bottom-bar/CustomBottomBar.vue +1 -1
  41. package/template/package.json +1 -0
  42. package/template/page-templates/example-template/configuration.ts +8 -10
  43. package/template/page-templates/example-template/pages/catalog.ts +3 -6
  44. package/template/page-templates/example-template/pages/category.ts +3 -6
  45. package/template/page-templates/example-template/pages/home.ts +42 -57
  46. package/template/page-templates/example-template/pages/product.ts +3 -6
  47. package/template/preview/sections/preview.html +10 -6
  48. package/template/preview/shared/api-routes.ts +235 -102
  49. package/template/preview/shared/logger.ts +9 -0
  50. package/template/preview/shared/preview.ts +108 -72
  51. package/template/preview/shared/utils.ts +63 -43
  52. package/template/preview/ssr-server.ts +1 -1
  53. package/template/reference/sections/about-us/AboutUs.vue +20 -22
  54. package/template/reference/sections/about-us/component/Image.vue +18 -18
  55. package/template/reference/sections/about-us/component/Stats.vue +40 -40
  56. package/template/reference/sections/about-us/component/Title.vue +1 -1
  57. package/template/reference/sections/about-us/settings/content.ts +15 -19
  58. package/template/reference/sections/about-us/settings/design.ts +14 -18
  59. package/template/reference/sections/about-us/settings/layout.ts +7 -5
  60. package/template/reference/sections/about-us/settings/translations.ts +4 -2
  61. package/template/reference/sections/about-us/showcases/1.ts +48 -62
  62. package/template/reference/sections/about-us/showcases/2.ts +44 -56
  63. package/template/reference/sections/about-us/showcases/translations.ts +4 -2
  64. package/template/reference/sections/featured-products/FeaturedProducts.vue +12 -6
  65. package/template/reference/sections/featured-products/component/ProductItem.vue +18 -1
  66. package/template/reference/sections/featured-products/component/ProductPlaceholder.vue +42 -0
  67. package/template/reference/sections/featured-products/component/Title.vue +1 -1
  68. package/template/reference/sections/featured-products/settings/content.ts +8 -10
  69. package/template/reference/sections/featured-products/settings/design.ts +7 -7
  70. package/template/reference/sections/featured-products/settings/translations.ts +4 -2
  71. package/template/reference/sections/featured-products/showcases/1.ts +8 -12
  72. package/template/reference/sections/featured-products/showcases/translations.ts +4 -2
  73. package/template/reference/sections/intro-slider/IntroSlider.vue +6 -6
  74. package/template/reference/sections/intro-slider/component/Slider.vue +42 -43
  75. package/template/reference/sections/intro-slider/component/Title.vue +7 -7
  76. package/template/reference/sections/intro-slider/settings/content.ts +33 -36
  77. package/template/reference/sections/intro-slider/settings/design.ts +17 -22
  78. package/template/reference/sections/intro-slider/settings/layout.ts +6 -4
  79. package/template/reference/sections/intro-slider/settings/translations.ts +4 -2
  80. package/template/reference/sections/intro-slider/showcases/1.ts +52 -75
  81. package/template/reference/sections/intro-slider/showcases/2.ts +50 -72
  82. package/template/reference/sections/intro-slider/showcases/translations.ts +4 -2
  83. package/template/reference/sections/tag-lines/TagLines.vue +41 -47
  84. package/template/reference/sections/tag-lines/component/HighlightedText.vue +1 -1
  85. package/template/reference/sections/tag-lines/component/SectionImage.vue +18 -18
  86. package/template/reference/sections/tag-lines/component/Title.vue +1 -1
  87. package/template/reference/sections/tag-lines/settings/content.ts +47 -47
  88. package/template/reference/sections/tag-lines/settings/design.ts +15 -19
  89. package/template/reference/sections/tag-lines/settings/layout.ts +6 -4
  90. package/template/reference/sections/tag-lines/settings/translations.ts +4 -2
  91. package/template/reference/sections/tag-lines/showcases/1.ts +40 -50
  92. package/template/reference/sections/tag-lines/showcases/2.ts +40 -50
  93. package/template/reference/sections/tag-lines/showcases/translations.ts +4 -2
  94. package/template/reference/sections/trending-categories/TrendingCategories.vue +1 -1
  95. package/template/reference/sections/trending-categories/component/CategoryItem.vue +18 -1
  96. package/template/reference/sections/trending-categories/component/Title.vue +1 -1
  97. package/template/reference/sections/trending-categories/settings/content.ts +8 -10
  98. package/template/reference/sections/trending-categories/settings/design.ts +7 -7
  99. package/template/reference/sections/trending-categories/settings/translations.ts +4 -2
  100. package/template/reference/sections/trending-categories/showcases/1.ts +14 -15
  101. package/template/reference/sections/trending-categories/showcases/translations.ts +4 -2
  102. package/template/reference/shared/components/Button.vue +6 -6
  103. package/template/reference/shared/components/SectionWrapper.vue +5 -5
  104. package/template/reference/shared/components/Tagline.vue +12 -11
  105. package/template/reference/templates/reference-template-apparel/configuration.ts +8 -8
  106. package/template/reference/templates/reference-template-apparel/pages/catalog.ts +3 -6
  107. package/template/reference/templates/reference-template-apparel/pages/category.ts +3 -6
  108. package/template/reference/templates/reference-template-apparel/pages/home.ts +14 -18
  109. package/template/reference/templates/reference-template-apparel/pages/product.ts +3 -6
  110. package/template/reference/templates/reference-template-bike/configuration.ts +9 -9
  111. package/template/reference/templates/reference-template-bike/pages/catalog.ts +3 -6
  112. package/template/reference/templates/reference-template-bike/pages/category.ts +3 -6
  113. package/template/reference/templates/reference-template-bike/pages/home.ts +14 -18
  114. package/template/reference/templates/reference-template-bike/pages/product.ts +3 -6
  115. package/template/sections/example-section/ExampleSection.vue +3 -5
  116. package/template/sections/example-section/component/button/Button.vue +1 -1
  117. package/template/sections/example-section/component/image/Image.vue +43 -43
  118. package/template/sections/example-section/component/image/ImagesGrid.vue +21 -32
  119. package/template/sections/example-section/component/selectbox/Selectbox.vue +1 -1
  120. package/template/sections/example-section/component/title/Title.vue +1 -1
  121. package/template/sections/example-section/component/toggle/Toggle.vue +4 -4
  122. package/template/sections/example-section/settings/content.ts +25 -34
  123. package/template/sections/example-section/settings/design.ts +15 -19
  124. package/template/sections/example-section/settings/layout.ts +15 -14
  125. package/template/sections/example-section/settings/translations.ts +4 -2
  126. package/template/sections/example-section/showcases/1.ts +52 -79
  127. package/template/sections/example-section/showcases/2.ts +46 -62
  128. package/template/sections/example-section/showcases/3.ts +50 -76
  129. package/template/sections/example-section/showcases/translations.ts +4 -2
  130. package/template/shared/components/LanguageSelector.vue +1 -1
  131. package/template/shared/components/SectionWrapper.vue +5 -5
@@ -1,4 +1,10 @@
1
- export default {
1
+ import {
2
+ content,
3
+ design,
4
+ showcase,
5
+ } from '@lightspeed/crane-api';
6
+
7
+ export default showcase.init({
2
8
  showcaseId: '3',
3
9
  previewImage: {
4
10
  set: {
@@ -10,23 +16,17 @@ export default {
10
16
  blockName: '$label.showcase_3.blockName',
11
17
  layoutId: 'Caption_On_Image',
12
18
  content: {
13
- section_title: {
14
- type: 'INPUTBOX',
19
+ section_title: content.default.inputbox({
15
20
  text: '$label.showcase_3.section_title.text',
16
- },
17
-
18
- images: {
19
- type: 'DECK',
21
+ }),
22
+ images: content.default.deck({
20
23
  cards: [
21
24
  {
22
25
  settings: {
23
- image_text: {
24
- type: 'TEXTAREA',
26
+ image_text: content.default.textarea({
25
27
  text: '$label.showcase_3.image_text_1.text',
26
- },
27
-
28
- image_content: {
29
- type: 'IMAGE',
28
+ }),
29
+ image_content: content.default.image({
30
30
  imageData: {
31
31
  set: {
32
32
  MOBILE_WEBP_LOW_RES: {
@@ -44,24 +44,18 @@ export default {
44
44
  },
45
45
  borderInfo: {},
46
46
  },
47
- },
48
-
49
- image_link: {
50
- type: 'INPUTBOX',
47
+ }),
48
+ image_link: content.default.inputbox({
51
49
  text: '$label.showcase_3.image_link_1.text',
52
- },
50
+ }),
53
51
  },
54
52
  },
55
-
56
53
  {
57
54
  settings: {
58
- image_text: {
59
- type: 'TEXTAREA',
55
+ image_text: content.default.textarea({
60
56
  text: '$label.showcase_3.image_text_2.text',
61
- },
62
-
63
- image_content: {
64
- type: 'IMAGE',
57
+ }),
58
+ image_content: content.default.image({
65
59
  imageData: {
66
60
  set: {
67
61
  MOBILE_WEBP_LOW_RES: {
@@ -79,24 +73,18 @@ export default {
79
73
  },
80
74
  borderInfo: {},
81
75
  },
82
- },
83
-
84
- image_link: {
85
- type: 'INPUTBOX',
76
+ }),
77
+ image_link: content.default.inputbox({
86
78
  text: '$label.showcase_3.image_link_1.text',
87
- },
79
+ }),
88
80
  },
89
81
  },
90
-
91
82
  {
92
83
  settings: {
93
- image_text: {
94
- type: 'TEXTAREA',
84
+ image_text: content.default.textarea({
95
85
  text: '$label.showcase_3.image_text_3.text',
96
- },
97
-
98
- image_content: {
99
- type: 'IMAGE',
86
+ }),
87
+ image_content: content.default.image({
100
88
  imageData: {
101
89
  set: {
102
90
  MOBILE_WEBP_LOW_RES: {
@@ -114,24 +102,18 @@ export default {
114
102
  },
115
103
  borderInfo: {},
116
104
  },
117
- },
118
-
119
- image_link: {
120
- type: 'INPUTBOX',
105
+ }),
106
+ image_link: content.default.inputbox({
121
107
  text: '$label.showcase_3.image_link_1.text',
122
- },
108
+ }),
123
109
  },
124
110
  },
125
-
126
111
  {
127
112
  settings: {
128
- image_text: {
129
- type: 'TEXTAREA',
113
+ image_text: content.default.textarea({
130
114
  text: '$label.showcase_3.image_text_4.text',
131
- },
132
-
133
- image_content: {
134
- type: 'IMAGE',
115
+ }),
116
+ image_content: content.default.image({
135
117
  imageData: {
136
118
  set: {
137
119
  MOBILE_WEBP_LOW_RES: {
@@ -149,60 +131,52 @@ export default {
149
131
  },
150
132
  borderInfo: {},
151
133
  },
152
- },
134
+ }),
153
135
  },
154
136
  },
155
137
  ],
156
- },
157
- toggle: {
158
- type: 'TOGGLE',
138
+ }),
139
+ toggle: content.default.toggle({
159
140
  enabled: true,
160
- },
161
- selectbox: {
162
- type: 'SELECTBOX',
141
+ }),
142
+ selectbox: content.default.selectbox({
163
143
  value: 'one',
164
- },
165
- info: {
166
- type: 'INFO',
144
+ }),
145
+ info: content.default.info({
167
146
  text: '$label.showcase_3.info.text',
168
147
  button: {
169
148
  title: '$label.showcase_3.info.button.title',
170
149
  link: 'https://example.com',
171
150
  },
172
- },
173
- button: {
174
- type: 'BUTTON',
151
+ }),
152
+ button: content.default.button({
175
153
  title: '$label.showcase_1.button.defaults.title',
176
154
  buttonType: 'HYPER_LINK',
177
155
  link: 'https://www.example.com',
178
- },
156
+ }),
179
157
  },
180
158
  design: {
181
- section_title: {
182
- type: 'TEXT',
159
+ section_title: design.default.text({
183
160
  font: 'pt_mono',
184
161
  size: 48,
185
162
  bold: true,
186
163
  italic: false,
187
164
  color: '#FFFFFF',
188
- },
189
- image_text: {
190
- type: 'TEXT',
165
+ }),
166
+ image_text: design.default.text({
191
167
  font: 'pt_mono',
192
168
  size: 24,
193
169
  bold: true,
194
170
  italic: false,
195
171
  color: '#FFFFFF',
196
- },
197
- background: {
198
- type: 'BACKGROUND',
172
+ }),
173
+ background: design.default.background({
199
174
  style: 'GRADIENT',
200
175
  color: ['#131313', '#292929'],
201
- },
202
- image_content: {
203
- type: 'IMAGE',
176
+ }),
177
+ image_content: design.default.image({
204
178
  overlay: 'GRADIENT',
205
179
  color: ['#000000', '#00000033'],
206
- },
180
+ }),
207
181
  },
208
- } as const;
182
+ });
@@ -1,4 +1,6 @@
1
- export default {
1
+ import { translation } from '@lightspeed/crane-api';
2
+
3
+ export default translation.init({
2
4
  en: {
3
5
  '$label.showcase_1.blockName': 'Reference Section — Retail',
4
6
  '$label.showcase_1.section_title.text': 'Trending collections',
@@ -110,4 +112,4 @@ export default {
110
112
  '$label.showcase_1.button.defaults.title': 'Titre du bouton',
111
113
  '$label.showcase_2.button.defaults.title': 'Titre du bouton',
112
114
  },
113
- } as const;
115
+ });
@@ -45,7 +45,7 @@ const navigateToTranslationPage = (language: Language) => {
45
45
  };
46
46
  </script>
47
47
 
48
- <style scoped lang="scss">
48
+ <style scoped>
49
49
  .language-selector {
50
50
  display: flex;
51
51
  }
@@ -6,7 +6,7 @@
6
6
  </section>
7
7
  </template>
8
8
 
9
- <style lang="scss" scoped>
9
+ <style scoped>
10
10
  .section {
11
11
  padding: 60px 20px;
12
12
 
@@ -17,10 +17,10 @@
17
17
  @media screen and (min-width: 1200px) {
18
18
  padding: 100px;
19
19
  }
20
+ }
20
21
 
21
- &__wrapper {
22
- max-width: 1120px;
23
- margin: 0 auto;
24
- }
22
+ .section__wrapper {
23
+ max-width: 1120px;
24
+ margin: 0 auto;
25
25
  }
26
26
  </style>