@lightspeed/crane 1.4.2 → 2.0.1

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 (120) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/UPGRADE.md +19 -0
  3. package/dist/app.d.mts +1 -1028
  4. package/dist/app.d.ts +1 -1028
  5. package/dist/app.mjs +1 -1
  6. package/dist/cli.mjs +20 -7
  7. package/package.json +4 -3
  8. package/template/footers/example-footer/ExampleFooter.vue +1 -1
  9. package/template/footers/example-footer/client.ts +2 -1
  10. package/template/footers/example-footer/component/LegalLinks.vue +1 -1
  11. package/template/footers/example-footer/component/MadeWith.vue +1 -1
  12. package/template/footers/example-footer/component/ReportAbuse.vue +1 -1
  13. package/template/footers/example-footer/entity/color.ts +2 -2
  14. package/template/footers/example-footer/server.ts +2 -1
  15. package/template/headers/example-header/client.ts +2 -1
  16. package/template/headers/example-header/component/Account.vue +1 -1
  17. package/template/headers/example-header/component/Cart.vue +1 -1
  18. package/template/headers/example-header/component/CategoriesDropdown.vue +1 -1
  19. package/template/headers/example-header/component/Logo.vue +1 -1
  20. package/template/headers/example-header/component/NavigationMenu.vue +1 -1
  21. package/template/headers/example-header/component/SearchForm.vue +1 -1
  22. package/template/headers/example-header/server.ts +2 -1
  23. package/template/index.d.ts +1 -1
  24. package/template/layouts/catalog/example-catalog/Main.vue +1 -1
  25. package/template/layouts/catalog/example-catalog/slots/custom-bottom-bar/client.ts +2 -1
  26. package/template/layouts/catalog/example-catalog/slots/custom-bottom-bar/server.ts +2 -1
  27. package/template/layouts/category/example-category/Main.vue +1 -1
  28. package/template/layouts/category/example-category/settings/content.ts +1 -1
  29. package/template/layouts/category/example-category/settings/design.ts +1 -1
  30. package/template/layouts/product/example-product/Main.vue +1 -1
  31. package/template/layouts/product/example-product/settings/content.ts +1 -1
  32. package/template/layouts/product/example-product/settings/design.ts +1 -1
  33. package/template/package.json +6 -3
  34. package/template/page-templates/example-template/pages/catalog.ts +1 -1
  35. package/template/page-templates/example-template/pages/category.ts +1 -1
  36. package/template/page-templates/example-template/pages/product.ts +1 -1
  37. package/template/preview/sections/preview.html +1 -1
  38. package/template/preview/shared/api-routes.ts +515 -41
  39. package/template/preview/shared/mock.ts +43 -41
  40. package/template/preview/shared/preview.ts +220 -123
  41. package/template/preview/shared/utils.ts +209 -62
  42. package/template/preview/ssr-server.ts +430 -0
  43. package/template/preview/vite.config.js +76 -75
  44. package/template/reference/sections/about-us/AboutUs.vue +1 -1
  45. package/template/reference/sections/about-us/client.ts +1 -1
  46. package/template/reference/sections/about-us/component/Image.vue +1 -1
  47. package/template/reference/sections/about-us/component/Stats.vue +2 -2
  48. package/template/reference/sections/about-us/component/Title.vue +1 -1
  49. package/template/reference/sections/about-us/server.ts +1 -1
  50. package/template/reference/sections/about-us/util/visibility-provider.ts +1 -1
  51. package/template/reference/sections/featured-products/FeaturedProducts.vue +65 -0
  52. package/template/reference/sections/featured-products/assets/arrow.svg +3 -0
  53. package/template/reference/sections/featured-products/assets/custom_section_showcase_1_preview.png +0 -0
  54. package/template/reference/sections/featured-products/client.ts +6 -0
  55. package/template/reference/sections/featured-products/component/ProductItem.vue +71 -0
  56. package/template/reference/sections/featured-products/component/Title.vue +31 -0
  57. package/template/reference/sections/featured-products/entity/color.ts +4 -0
  58. package/template/reference/sections/featured-products/server.ts +6 -0
  59. package/template/reference/sections/featured-products/settings/content.ts +14 -0
  60. package/template/reference/sections/featured-products/settings/design.ts +33 -0
  61. package/template/reference/sections/featured-products/settings/translations.ts +24 -0
  62. package/template/reference/sections/featured-products/showcases/1.ts +28 -0
  63. package/template/reference/sections/featured-products/showcases/translations.ts +16 -0
  64. package/template/reference/sections/featured-products/type.ts +5 -0
  65. package/template/reference/sections/intro-slider/IntroSlider.vue +1 -1
  66. package/template/reference/sections/intro-slider/client.ts +2 -1
  67. package/template/reference/sections/intro-slider/component/Slider.vue +8 -2
  68. package/template/reference/sections/intro-slider/component/Title.vue +1 -1
  69. package/template/reference/sections/intro-slider/entity/color.ts +2 -2
  70. package/template/reference/sections/intro-slider/server.ts +2 -1
  71. package/template/reference/sections/tag-lines/TagLines.vue +1 -1
  72. package/template/reference/sections/tag-lines/client.ts +2 -1
  73. package/template/reference/sections/tag-lines/component/SectionImage.vue +1 -1
  74. package/template/reference/sections/tag-lines/component/Title.vue +1 -1
  75. package/template/reference/sections/tag-lines/composables/highlighted-text-image-list.ts +4 -3
  76. package/template/reference/sections/tag-lines/server.ts +2 -1
  77. package/template/reference/sections/trending-categories/TrendingCategories.vue +70 -0
  78. package/template/reference/sections/trending-categories/assets/arrow.svg +3 -0
  79. package/template/reference/sections/trending-categories/assets/custom_section_showcase_1_preview.png +0 -0
  80. package/template/reference/sections/trending-categories/client.ts +6 -0
  81. package/template/reference/sections/trending-categories/component/CategoryItem.vue +62 -0
  82. package/template/reference/sections/trending-categories/component/Title.vue +32 -0
  83. package/template/reference/sections/trending-categories/entity/color.ts +4 -0
  84. package/template/reference/sections/trending-categories/server.ts +6 -0
  85. package/template/reference/sections/trending-categories/settings/content.ts +14 -0
  86. package/template/reference/sections/trending-categories/settings/design.ts +33 -0
  87. package/template/reference/sections/trending-categories/settings/translations.ts +24 -0
  88. package/template/reference/sections/trending-categories/showcases/1.ts +36 -0
  89. package/template/reference/sections/trending-categories/showcases/translations.ts +22 -0
  90. package/template/reference/sections/trending-categories/type.ts +5 -0
  91. package/template/reference/shared/components/Button.vue +1 -1
  92. package/template/reference/shared/utils/styles.ts +1 -0
  93. package/template/reference/templates/reference-template-apparel/pages/catalog.ts +1 -1
  94. package/template/reference/templates/reference-template-apparel/pages/category.ts +1 -1
  95. package/template/reference/templates/reference-template-apparel/pages/home.ts +10 -0
  96. package/template/reference/templates/reference-template-apparel/pages/product.ts +1 -1
  97. package/template/reference/templates/reference-template-bike/pages/catalog.ts +1 -1
  98. package/template/reference/templates/reference-template-bike/pages/category.ts +1 -1
  99. package/template/reference/templates/reference-template-bike/pages/home.ts +10 -0
  100. package/template/reference/templates/reference-template-bike/pages/product.ts +1 -1
  101. package/template/sections/example-section/ExampleSection.vue +8 -1
  102. package/template/sections/example-section/client.ts +2 -1
  103. package/template/sections/example-section/component/button/Button.vue +1 -1
  104. package/template/sections/example-section/component/image/Image.vue +1 -1
  105. package/template/sections/example-section/component/image/ImagesGrid.vue +1 -1
  106. package/template/sections/example-section/component/selectbox/Selectbox.vue +1 -1
  107. package/template/sections/example-section/component/title/Title.vue +1 -1
  108. package/template/sections/example-section/component/toggle/Toggle.vue +1 -1
  109. package/template/sections/example-section/entity/color.ts +2 -2
  110. package/template/sections/example-section/server.ts +2 -1
  111. package/template/sections/example-section/settings/translations.ts +1 -1
  112. package/template/sections/example-section/showcases/1.ts +2 -22
  113. package/template/sections/example-section/showcases/2.ts +2 -22
  114. package/template/sections/example-section/showcases/3.ts +2 -22
  115. package/template/sections/example-section/showcases/translations.ts +11 -149
  116. package/template/shared/components/LanguageSelector.vue +1 -1
  117. package/template/shared/translation.ts +16 -0
  118. package/template/shared/utils.ts +3 -1
  119. package/template/tsconfig.json +1 -0
  120. package/types.d.ts +6 -457
@@ -1,5 +1,4 @@
1
-
2
- export type ExternalContentMock = ExternalContentData
1
+ export type ExternalContentMock = ExternalContentData;
3
2
 
4
3
  /**
5
4
  * Default mock configuration
@@ -11,11 +10,11 @@ export const externalContentMock: ExternalContentMock = {
11
10
  account: {
12
11
  title: 'My Account',
13
12
  url: '/account',
14
- target: '_self'
13
+ target: '_self',
15
14
  },
16
15
  cart: {
17
16
  url: '/cart',
18
- count: 3
17
+ count: 3,
19
18
  },
20
19
  languages: [
21
20
  {
@@ -23,42 +22,42 @@ export const externalContentMock: ExternalContentMock = {
23
22
  description: 'English',
24
23
  main: true,
25
24
  selected: true,
26
- url: '/en'
25
+ url: '/en',
27
26
  },
28
27
  {
29
28
  code: 'es',
30
29
  description: 'Español',
31
30
  main: false,
32
31
  selected: false,
33
- url: '/es'
34
- }
32
+ url: '/es',
33
+ },
35
34
  ],
36
35
  legalPages: [
37
36
  {
38
37
  title: 'Privacy Policy',
39
- url: '/privacy'
38
+ url: '/privacy',
40
39
  },
41
40
  {
42
41
  title: 'Terms of Service',
43
- url: '/terms'
42
+ url: '/terms',
44
43
  },
45
44
  {
46
45
  title: 'Refund Policy',
47
- url: '/refunds'
48
- }
46
+ url: '/refunds',
47
+ },
49
48
  ],
50
49
  reportAbuse: {
51
50
  title: 'Report Abuse',
52
51
  url: '/report-abuse',
53
- target: '_blank'
52
+ target: '_blank',
54
53
  },
55
54
  madeWith: {
56
55
  url: 'https://www.lightspeedhq.com',
57
56
  target: '_blank',
58
57
  icon: '/assets/lightspeed-icon.png',
59
58
  poweredBy: 'Powered by',
60
- company: 'Lightspeed'
61
- }
59
+ company: 'Lightspeed',
60
+ },
62
61
  },
63
62
 
64
63
  category: {
@@ -70,15 +69,16 @@ export const externalContentMock: ExternalContentMock = {
70
69
  imageUrl: '/assets/electronics-category.jpg',
71
70
  thumbnailImageUrl: '/assets/electronics-thumb.jpg',
72
71
  alt: 'Electronics category',
72
+ productsCount: 0,
73
73
  imageBorderInfo: {
74
74
  homogeneity: true,
75
- color: {
76
- r: 255,
77
- g: 255,
78
- b: 255,
79
- a: 1
80
- }
81
- }
75
+ dominatingColor: {
76
+ red: 255,
77
+ green: 255,
78
+ blue: 255,
79
+ alpha: 1,
80
+ },
81
+ },
82
82
  },
83
83
  {
84
84
  id: 2,
@@ -86,7 +86,8 @@ export const externalContentMock: ExternalContentMock = {
86
86
  url: '/categories/clothing',
87
87
  imageUrl: '/assets/clothing-category.jpg',
88
88
  thumbnailImageUrl: '/assets/clothing-thumb.jpg',
89
- alt: 'Clothing category'
89
+ alt: 'Clothing category',
90
+ productsCount: 0,
90
91
  },
91
92
  {
92
93
  id: 3,
@@ -94,8 +95,9 @@ export const externalContentMock: ExternalContentMock = {
94
95
  url: '/categories/home-garden',
95
96
  imageUrl: '/assets/home-garden-category.jpg',
96
97
  thumbnailImageUrl: '/assets/home-garden-thumb.jpg',
97
- alt: 'Home & Garden category'
98
- }
98
+ alt: 'Home & Garden category',
99
+ productsCount: 0,
100
+ },
99
101
  ],
100
102
  categoryTree: [
101
103
  {
@@ -103,7 +105,7 @@ export const externalContentMock: ExternalContentMock = {
103
105
  name: 'Electronics',
104
106
  nameTranslated: {
105
107
  en: 'Electronics',
106
- es: 'Electrónicos'
108
+ es: 'Electrónicos',
107
109
  },
108
110
  urlPath: '/electronics',
109
111
  enabled: true,
@@ -113,31 +115,31 @@ export const externalContentMock: ExternalContentMock = {
113
115
  name: 'Smartphones',
114
116
  nameTranslated: {
115
117
  en: 'Smartphones',
116
- es: 'Teléfonos inteligentes'
118
+ es: 'Teléfonos inteligentes',
117
119
  },
118
120
  urlPath: '/electronics/smartphones',
119
121
  enabled: true,
120
- children: []
122
+ children: [],
121
123
  },
122
124
  {
123
125
  id: 12,
124
126
  name: 'Laptops',
125
127
  nameTranslated: {
126
128
  en: 'Laptops',
127
- es: 'Portátiles'
129
+ es: 'Portátiles',
128
130
  },
129
131
  urlPath: '/electronics/laptops',
130
132
  enabled: true,
131
- children: []
132
- }
133
- ]
133
+ children: [],
134
+ },
135
+ ],
134
136
  },
135
137
  {
136
138
  id: 2,
137
139
  name: 'Clothing',
138
140
  nameTranslated: {
139
141
  en: 'Clothing',
140
- es: 'Ropa'
142
+ es: 'Ropa',
141
143
  },
142
144
  urlPath: '/clothing',
143
145
  enabled: true,
@@ -147,27 +149,27 @@ export const externalContentMock: ExternalContentMock = {
147
149
  name: 'Men\'s Clothing',
148
150
  nameTranslated: {
149
151
  en: 'Men\'s Clothing',
150
- es: 'Ropa para hombres'
152
+ es: 'Ropa para hombres',
151
153
  },
152
154
  urlPath: '/clothing/mens',
153
155
  enabled: true,
154
- children: []
156
+ children: [],
155
157
  },
156
158
  {
157
159
  id: 22,
158
160
  name: 'Women\'s Clothing',
159
161
  nameTranslated: {
160
162
  en: 'Women\'s Clothing',
161
- es: 'Ropa para mujeres'
163
+ es: 'Ropa para mujeres',
162
164
  },
163
165
  urlPath: '/clothing/womens',
164
166
  enabled: true,
165
- children: []
166
- }
167
- ]
168
- }
169
- ]
170
- }
167
+ children: [],
168
+ },
169
+ ],
170
+ },
171
+ ],
172
+ },
171
173
  };
172
174
 
173
175
  export function getExternalContentMock(): ExternalContentMock {