@shopware/cms-base-layer 1.5.1 → 2.1.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 (198) hide show
  1. package/README.md +398 -12
  2. package/app/app.config.ts +18 -0
  3. package/app/assets/icons/check-circle.svg +3 -0
  4. package/app/assets/icons/checkmark.svg +3 -0
  5. package/app/assets/icons/chevron.svg +3 -0
  6. package/app/assets/icons/exclamation-circle.svg +3 -0
  7. package/app/assets/icons/star-empty.svg +3 -0
  8. package/app/assets/icons/star-filled.svg +3 -0
  9. package/app/assets/icons/user.svg +1 -0
  10. package/app/components/SwCategoryNavigation.vue +83 -0
  11. package/app/components/SwCategoryNavigationLink.vue +128 -0
  12. package/{components → app/components}/SwContactForm.vue +27 -27
  13. package/app/components/SwFilterChips.vue +144 -0
  14. package/app/components/SwFilterDropdown.vue +54 -0
  15. package/app/components/SwListingProductPrice.vue +89 -0
  16. package/{components → app/components}/SwMedia3D.vue +4 -2
  17. package/{components → app/components}/SwNewsletterForm.vue +45 -34
  18. package/{components → app/components}/SwPagination.vue +3 -5
  19. package/{components → app/components}/SwProductAddToCart.vue +22 -27
  20. package/app/components/SwProductCard.vue +169 -0
  21. package/app/components/SwProductCardDetails.vue +74 -0
  22. package/app/components/SwProductCardImage.vue +90 -0
  23. package/app/components/SwProductCardSkeleton.vue +33 -0
  24. package/app/components/SwProductGallery.vue +43 -0
  25. package/app/components/SwProductListingFilter.vue +75 -0
  26. package/app/components/SwProductListingFilters.vue +304 -0
  27. package/app/components/SwProductListingFiltersHorizontal.vue +306 -0
  28. package/{components → app/components}/SwProductPrice.vue +3 -3
  29. package/app/components/SwProductRating.vue +40 -0
  30. package/{components → app/components}/SwProductReviews.vue +25 -23
  31. package/app/components/SwProductReviewsForm.vue +292 -0
  32. package/{components → app/components}/SwProductUnits.vue +10 -15
  33. package/app/components/SwQuantitySelect.vue +103 -0
  34. package/{components → app/components}/SwSlider.vue +154 -55
  35. package/app/components/SwSortDropdown.vue +87 -0
  36. package/app/components/SwStockInfo.vue +44 -0
  37. package/{components → app/components}/SwVariantConfigurator.vue +13 -12
  38. package/app/components/listing-filters/SwFilterPrice.vue +219 -0
  39. package/app/components/listing-filters/SwFilterProperties.vue +120 -0
  40. package/app/components/listing-filters/SwFilterRating.vue +99 -0
  41. package/app/components/listing-filters/SwFilterShippingFree.vue +114 -0
  42. package/app/components/public/cms/CmsBlockSpatialViewer.vue +94 -0
  43. package/app/components/public/cms/CmsGenericBlock.md +42 -0
  44. package/{components → app/components}/public/cms/CmsGenericBlock.vue +15 -1
  45. package/{components → app/components}/public/cms/CmsPage.md +19 -2
  46. package/{components → app/components}/public/cms/CmsPage.vue +30 -5
  47. package/{components → app/components}/public/cms/block/CmsBlockCenterText.vue +1 -1
  48. package/{components → app/components}/public/cms/block/CmsBlockGalleryBuybox.vue +5 -5
  49. package/{components → app/components}/public/cms/block/CmsBlockImageBubbleRow.vue +5 -5
  50. package/app/components/public/cms/block/CmsBlockImageFourColumn.vue +41 -0
  51. package/app/components/public/cms/block/CmsBlockImageGalleryBig.vue +42 -0
  52. package/app/components/public/cms/block/CmsBlockImageHighlightRow.vue +37 -0
  53. package/{components → app/components}/public/cms/block/CmsBlockImageSimpleGrid.vue +11 -5
  54. package/{components → app/components}/public/cms/block/CmsBlockImageText.vue +7 -3
  55. package/{components → app/components}/public/cms/block/CmsBlockImageTextBubble.vue +13 -16
  56. package/{components → app/components}/public/cms/block/CmsBlockImageTextCover.vue +7 -9
  57. package/app/components/public/cms/block/CmsBlockImageTextGallery.vue +88 -0
  58. package/app/components/public/cms/block/CmsBlockImageTextRow.vue +53 -0
  59. package/{components → app/components}/public/cms/block/CmsBlockImageThreeColumn.vue +10 -4
  60. package/app/components/public/cms/block/CmsBlockImageThreeCover.vue +37 -0
  61. package/app/components/public/cms/block/CmsBlockImageTwoColumn.vue +37 -0
  62. package/{components → app/components}/public/cms/block/CmsBlockProductHeading.vue +1 -1
  63. package/{components → app/components}/public/cms/block/CmsBlockProductThreeColumn.vue +10 -4
  64. package/{components → app/components}/public/cms/block/CmsBlockSidebarFilter.vue +3 -1
  65. package/{components → app/components}/public/cms/block/CmsBlockTextOnImage.vue +8 -5
  66. package/app/components/public/cms/element/CmsElementBuyBox.vue +145 -0
  67. package/app/components/public/cms/element/CmsElementCategoryNavigation.vue +53 -0
  68. package/{components → app/components}/public/cms/element/CmsElementCrossSelling.vue +22 -6
  69. package/{components → app/components}/public/cms/element/CmsElementImage.vue +58 -21
  70. package/app/components/public/cms/element/CmsElementImageGallery.vue +225 -0
  71. package/{components → app/components}/public/cms/element/CmsElementImageSlider.vue +2 -2
  72. package/{components → app/components}/public/cms/element/CmsElementProductBox.vue +8 -1
  73. package/app/components/public/cms/element/CmsElementProductDescriptionReviews.vue +217 -0
  74. package/{components → app/components}/public/cms/element/CmsElementProductListing.vue +31 -95
  75. package/app/components/public/cms/element/CmsElementProductName.vue +16 -0
  76. package/app/components/public/cms/element/CmsElementProductSlider.vue +101 -0
  77. package/app/components/public/cms/element/CmsElementSidebarFilter.vue +20 -0
  78. package/{components → app/components}/public/cms/element/CmsElementText.vue +17 -12
  79. package/app/components/public/cms/element/SwProductListingPagination.vue +70 -0
  80. package/{components → app/components}/public/cms/section/CmsSectionDefault.vue +2 -2
  81. package/app/components/public/cms/section/CmsSectionSidebar.vue +39 -0
  82. package/app/components/public/cms/skeleton/ProductCardSkeleton.vue +28 -0
  83. package/app/components/ui/BaseButton.vue +102 -0
  84. package/app/components/ui/BaseIcon.vue +15 -0
  85. package/app/components/ui/Checkbox.vue +49 -0
  86. package/app/components/ui/CheckmarkIcon.vue +23 -0
  87. package/app/components/ui/ChevronIcon.vue +34 -0
  88. package/app/components/ui/ExclamationIcon.vue +11 -0
  89. package/app/components/ui/IconButton.vue +32 -0
  90. package/app/components/ui/RadioButton.vue +26 -0
  91. package/app/components/ui/StarIcon.vue +18 -0
  92. package/app/components/ui/SwitchButton.vue +100 -0
  93. package/app/components/ui/UserIcon.vue +11 -0
  94. package/app/components/ui/WishlistIcon.vue +15 -0
  95. package/app/composables/useImagePlaceholder.ts +27 -0
  96. package/app/composables/useLcpImagePreload.test.ts +229 -0
  97. package/app/composables/useLcpImagePreload.ts +39 -0
  98. package/{helpers → app/helpers}/clientOnly.ts +5 -0
  99. package/app/helpers/cms/findFirstCmsImageUrl.ts +86 -0
  100. package/app/helpers/cms/getImageSizes.test.ts +50 -0
  101. package/app/helpers/cms/getImageSizes.ts +36 -0
  102. package/app/helpers/html-to-vue/ast.ts +106 -0
  103. package/{helpers → app/helpers}/html-to-vue/getOptionsFromNode.ts +1 -1
  104. package/{helpers → app/helpers}/html-to-vue/renderToHtml.ts +7 -11
  105. package/app/helpers/html-to-vue/renderer.ts +116 -0
  106. package/app/plugins/unocss-runtime.client.ts +23 -0
  107. package/app/providers/shopware.test.ts +213 -0
  108. package/app/providers/shopware.ts +107 -0
  109. package/dist/index.d.mts +3 -3
  110. package/dist/index.d.ts +3 -3
  111. package/dist/index.mjs +2 -2
  112. package/index.d.ts +36 -0
  113. package/nuxt.config.ts +100 -6
  114. package/package.json +33 -23
  115. package/uno.config.ts +94 -0
  116. package/components/SwCategoryNavigation.vue +0 -44
  117. package/components/SwCategoryNavigationLink.vue +0 -57
  118. package/components/SwListingProductPrice.vue +0 -89
  119. package/components/SwProductCard.vue +0 -286
  120. package/components/SwProductGallery.vue +0 -39
  121. package/components/SwProductListingFilter.vue +0 -42
  122. package/components/SwProductListingFilters.vue +0 -292
  123. package/components/listing-filters/SwFilterPrice.vue +0 -160
  124. package/components/listing-filters/SwFilterProperties.vue +0 -123
  125. package/components/listing-filters/SwFilterRating.vue +0 -101
  126. package/components/listing-filters/SwFilterShippingFree.vue +0 -104
  127. package/components/public/cms/CmsGenericBlock.md +0 -27
  128. package/components/public/cms/block/CmsBlockImageFourColumn.vue +0 -29
  129. package/components/public/cms/block/CmsBlockImageHighlightRow.vue +0 -27
  130. package/components/public/cms/block/CmsBlockImageTextGallery.vue +0 -85
  131. package/components/public/cms/block/CmsBlockImageTextRow.vue +0 -43
  132. package/components/public/cms/block/CmsBlockImageThreeCover.vue +0 -27
  133. package/components/public/cms/block/CmsBlockImageTwoColumn.vue +0 -25
  134. package/components/public/cms/element/CmsElementBuyBox.vue +0 -190
  135. package/components/public/cms/element/CmsElementCategoryNavigation.vue +0 -167
  136. package/components/public/cms/element/CmsElementImageGallery.vue +0 -249
  137. package/components/public/cms/element/CmsElementProductDescriptionReviews.vue +0 -123
  138. package/components/public/cms/element/CmsElementProductName.vue +0 -10
  139. package/components/public/cms/element/CmsElementProductSlider.vue +0 -80
  140. package/components/public/cms/element/CmsElementSidebarFilter.vue +0 -12
  141. package/components/public/cms/section/CmsSectionSidebar.vue +0 -41
  142. package/components/public/cms/skeleton/ProductCardSkeleton.vue +0 -44
  143. package/helpers/html-to-vue/ast.ts +0 -72
  144. package/helpers/html-to-vue/renderer.ts +0 -56
  145. /package/{components → app/components}/SwSharedPrice.vue +0 -0
  146. /package/{components → app/components}/public/cms/CmsGenericElement.md +0 -0
  147. /package/{components → app/components}/public/cms/CmsGenericElement.vue +0 -0
  148. /package/{components → app/components}/public/cms/CmsNoComponent.vue +0 -0
  149. /package/{components → app/components}/public/cms/block/CmsBlockCategoryNavigation.vue +0 -0
  150. /package/{components → app/components}/public/cms/block/CmsBlockCrossSelling.vue +0 -0
  151. /package/{components → app/components}/public/cms/block/CmsBlockCustomForm.vue +0 -0
  152. /package/{components → app/components}/public/cms/block/CmsBlockDefault.vue +0 -0
  153. /package/{components → app/components}/public/cms/block/CmsBlockForm.vue +0 -0
  154. /package/{components → app/components}/public/cms/block/CmsBlockHtml.vue +0 -0
  155. /package/{components → app/components}/public/cms/block/CmsBlockImage.vue +0 -0
  156. /package/{components → app/components}/public/cms/block/CmsBlockImageCover.vue +0 -0
  157. /package/{components → app/components}/public/cms/block/CmsBlockImageGallery.vue +0 -0
  158. /package/{components → app/components}/public/cms/block/CmsBlockImageSlider.vue +0 -0
  159. /package/{components → app/components}/public/cms/block/CmsBlockProductDescriptionReviews.vue +0 -0
  160. /package/{components → app/components}/public/cms/block/CmsBlockProductListing.vue +0 -0
  161. /package/{components → app/components}/public/cms/block/CmsBlockProductSlider.vue +0 -0
  162. /package/{components → app/components}/public/cms/block/CmsBlockText.vue +0 -0
  163. /package/{components → app/components}/public/cms/block/CmsBlockTextHero.vue +0 -0
  164. /package/{components → app/components}/public/cms/block/CmsBlockTextTeaser.vue +0 -0
  165. /package/{components → app/components}/public/cms/block/CmsBlockTextTeaserSection.vue +0 -0
  166. /package/{components → app/components}/public/cms/block/CmsBlockTextThreeColumn.vue +0 -0
  167. /package/{components → app/components}/public/cms/block/CmsBlockTextTwoColumn.vue +0 -0
  168. /package/{components → app/components}/public/cms/block/CmsBlockVimeoVideo.vue +0 -0
  169. /package/{components → app/components}/public/cms/block/CmsBlockYoutubeVideo.vue +0 -0
  170. /package/{components → app/components}/public/cms/element/CmsElementBuyBox.md +0 -0
  171. /package/{components → app/components}/public/cms/element/CmsElementCategoryNavigation.md +0 -0
  172. /package/{components → app/components}/public/cms/element/CmsElementCrossSelling.md +0 -0
  173. /package/{components → app/components}/public/cms/element/CmsElementCustomForm.md +0 -0
  174. /package/{components → app/components}/public/cms/element/CmsElementCustomForm.vue +0 -0
  175. /package/{components → app/components}/public/cms/element/CmsElementForm.md +0 -0
  176. /package/{components → app/components}/public/cms/element/CmsElementForm.vue +0 -0
  177. /package/{components → app/components}/public/cms/element/CmsElementHtml.vue +0 -0
  178. /package/{components → app/components}/public/cms/element/CmsElementImage.md +0 -0
  179. /package/{components → app/components}/public/cms/element/CmsElementImageGallery.md +0 -0
  180. /package/{components → app/components}/public/cms/element/CmsElementImageGallery3dPlaceholder.vue +0 -0
  181. /package/{components → app/components}/public/cms/element/CmsElementImageSlider.md +0 -0
  182. /package/{components → app/components}/public/cms/element/CmsElementManufacturerLogo.md +0 -0
  183. /package/{components → app/components}/public/cms/element/CmsElementManufacturerLogo.vue +0 -0
  184. /package/{components → app/components}/public/cms/element/CmsElementProductBox.md +0 -0
  185. /package/{components → app/components}/public/cms/element/CmsElementProductDescriptionReviews.md +0 -0
  186. /package/{components → app/components}/public/cms/element/CmsElementProductListing.md +0 -0
  187. /package/{components → app/components}/public/cms/element/CmsElementProductName.md +0 -0
  188. /package/{components → app/components}/public/cms/element/CmsElementProductSlider.md +0 -0
  189. /package/{components → app/components}/public/cms/element/CmsElementSidebarFilter.md +0 -0
  190. /package/{components → app/components}/public/cms/element/CmsElementText.md +0 -0
  191. /package/{components → app/components}/public/cms/element/CmsElementVimeoVideo.md +0 -0
  192. /package/{components → app/components}/public/cms/element/CmsElementVimeoVideo.vue +0 -0
  193. /package/{components → app/components}/public/cms/element/CmsElementYoutubeVideo.md +0 -0
  194. /package/{components → app/components}/public/cms/element/CmsElementYoutubeVideo.vue +0 -0
  195. /package/{components → app/components}/public/cms/section/CmsSectionDefault.md +0 -0
  196. /package/{components → app/components}/public/cms/section/CmsSectionSidebar.md +0 -0
  197. /package/{helpers → app/helpers}/html-to-vue/getOptionsFromNode.test.ts +0 -0
  198. /package/{helpers → app/helpers}/media/isSpatial.ts +0 -0
package/nuxt.config.ts CHANGED
@@ -1,19 +1,113 @@
1
+ import { createResolver } from "@nuxt/kit";
1
2
  import type { NuxtConfig } from "@nuxt/schema";
2
3
  import { defineNuxtConfig } from "nuxt/config";
4
+
5
+ const { resolve: resolveLayer } = createResolver(import.meta.url);
6
+
3
7
  export default defineNuxtConfig({
8
+ // @tresjs/nuxt is not included here because SwMedia3D is excluded from auto-import
9
+ // to prevent bundling heavy 3D libraries in the initial bundle.
10
+ // If you need 3D support, add "@tresjs/nuxt" to your app's nuxt.config.ts modules array
11
+ // and dynamically import SwMedia3D using defineAsyncComponent.
12
+ modules: ["@unocss/nuxt", "@nuxt/image"],
13
+
14
+ hooks: {
15
+ "components:extend"(components) {
16
+ // Exclude SwMedia3D from auto-import to prevent bundling heavy 3D libraries
17
+ // It should be dynamically imported when needed using defineAsyncComponent.
18
+ const index = components.findIndex(
19
+ (c) =>
20
+ c.pascalName === "SwMedia3D" ||
21
+ c.kebabName === "sw-media3-d" ||
22
+ c.filePath?.includes("SwMedia3D.vue"),
23
+ );
24
+ if (index > -1) {
25
+ components.splice(index, 1);
26
+ }
27
+ },
28
+ },
29
+
30
+ // @ts-ignore - @nuxt/image config may not be typed in some layer contexts
31
+ image: {
32
+ quality: 90,
33
+ format: ["webp", "avif", "jpg"],
34
+ // Custom Shopware provider that maps Nuxt Image modifiers to Shopware query parameters
35
+ provider: "shopware",
36
+ providers: {
37
+ shopware: {
38
+ name: "shopware",
39
+ provider: resolveLayer("./app/providers/shopware.ts"),
40
+ },
41
+ },
42
+
43
+ // Responsive breakpoints matching UnoCSS
44
+ screens: {
45
+ xs: 320,
46
+ sm: 640,
47
+ md: 768,
48
+ lg: 1024,
49
+ xl: 1280,
50
+ xxl: 1536,
51
+ },
52
+
53
+ // Presets for common CMS use cases
54
+ presets: {
55
+ productCard: {
56
+ modifiers: {
57
+ format: "webp",
58
+ quality: 90,
59
+ fit: "cover",
60
+ },
61
+ },
62
+ productDetail: {
63
+ modifiers: {
64
+ format: "webp",
65
+ quality: 90,
66
+ fit: "contain",
67
+ },
68
+ },
69
+ thumbnail: {
70
+ modifiers: {
71
+ format: "webp",
72
+ quality: 90,
73
+ width: 150,
74
+ height: 150,
75
+ fit: "cover",
76
+ },
77
+ },
78
+ hero: {
79
+ modifiers: {
80
+ format: "webp",
81
+ quality: 95,
82
+ fit: "cover",
83
+ },
84
+ },
85
+ },
86
+ },
87
+
4
88
  components: [
5
89
  {
6
- path: "./components/public",
7
- pathPrefix: false,
8
- // global: true,
90
+ path: resolveLayer("./app/components"),
91
+ pattern: "Sw*",
92
+ extensions: [".vue"],
93
+ global: true,
9
94
  },
10
95
  {
11
- path: "./components/",
12
- pattern: "Sw*",
96
+ path: resolveLayer("./app/components/ui"),
97
+ extensions: [".vue"],
98
+ prefix: "Sw",
99
+ global: true,
100
+ },
101
+ {
102
+ path: resolveLayer("./app/components/public"),
103
+ pathPrefix: false,
104
+ global: true,
13
105
  extensions: [".vue"],
14
- global: false,
15
106
  },
16
107
  ],
108
+ alias: {
109
+ "@cms-assets": resolveLayer("./app/assets"),
110
+ },
17
111
  build: {
18
112
  transpile: ["@shopware/cms-base-layer"],
19
113
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware/cms-base-layer",
3
- "version": "1.5.1",
3
+ "version": "2.1.0",
4
4
  "description": "Vue CMS Nuxt Layer for Shopware",
5
5
  "author": "Shopware",
6
6
  "repository": {
@@ -23,47 +23,57 @@
23
23
  "main": "./nuxt.config.ts",
24
24
  "files": [
25
25
  "dist",
26
- "components",
26
+ "app",
27
27
  "helpers",
28
28
  "index.cjs",
29
- "nuxt.config.ts"
29
+ "index.d.ts",
30
+ "app.config.ts",
31
+ "nuxt.config.ts",
32
+ "uno.config.ts"
30
33
  ],
31
34
  "dependencies": {
32
- "@nuxt/kit": "3.17.5",
33
- "@tresjs/cientos": "4.3.0",
34
- "@tresjs/core": "4.3.3",
35
+ "@iconify-json/carbon": "1.2.18",
36
+ "@nuxt/image": "2.0.0",
37
+ "@nuxt/kit": "4.2.2",
38
+ "@tresjs/cientos": "5.2.4",
39
+ "@tresjs/nuxt": "^5.1.6",
40
+ "@unocss/nuxt": "66.6.0",
41
+ "@unocss/runtime": "66.6.0",
35
42
  "@vuelidate/core": "2.0.3",
36
43
  "@vuelidate/validators": "2.0.4",
37
- "@vueuse/core": "13.3.0",
44
+ "@vueuse/core": "14.1.0",
38
45
  "entities": "6.0.0",
39
46
  "html-to-ast": "0.0.6",
40
- "three": "0.173.0",
41
- "vue": "3.5.16",
47
+ "three": "0.182.0",
48
+ "unocss": "66.6.0",
49
+ "vue": "3.5.27",
42
50
  "xss": "1.0.15",
43
- "@shopware/composables": "1.9.1",
44
- "@shopware/api-client": "1.3.0",
45
- "@shopware/helpers": "1.5.0"
51
+ "@shopware/api-client": "1.5.0",
52
+ "@shopware/composables": "1.11.0",
53
+ "@shopware/helpers": "1.7.0"
46
54
  },
47
55
  "devDependencies": {
48
56
  "@biomejs/biome": "1.8.3",
49
- "@nuxt/schema": "3.17.5",
50
- "@types/three": "0.173.0",
51
- "@vitest/coverage-v8": "3.2.3",
52
- "nuxt": "3.17.5",
53
- "typescript": "5.8.3",
57
+ "@nuxt/schema": "4.2.2",
58
+ "@types/three": "0.182.0",
59
+ "@typescript/native-preview": "7.0.0-dev.20260111.1",
60
+ "@vitest/coverage-v8": "4.0.18",
61
+ "nuxt": "4.2.2",
62
+ "typescript": "5.9.3",
54
63
  "unbuild": "2.0.0",
55
- "vitest": "3.2.3",
56
- "vue-router": "4.5.1",
57
- "vue-tsc": "2.2.10",
64
+ "vitest": "4.0.18",
65
+ "vue-router": "4.6.4",
66
+ "vue-tsc": "3.2.2",
58
67
  "tsconfig": "0.0.0"
59
68
  },
60
69
  "scripts": {
61
- "build": "unbuild",
70
+ "build": "nuxt prepare && unbuild",
62
71
  "dev": "unbuild --stub",
63
72
  "lint": "biome check .",
64
73
  "lint:fix": "biome check . --write && pnpm run typecheck",
65
- "typecheck": "tsc --noEmit",
74
+ "typecheck": "pnpm nuxt prepare && tsgo --noEmit",
66
75
  "test": "vitest run",
67
- "test:watch": "vitest"
76
+ "test:watch": "vitest",
77
+ "check-colors": "tsx scripts/check-unused-colors.ts"
68
78
  }
69
79
  }
package/uno.config.ts ADDED
@@ -0,0 +1,94 @@
1
+ import {
2
+ defineConfig,
3
+ presetAttributify,
4
+ presetIcons,
5
+ presetTypography,
6
+ presetWind3,
7
+ } from "unocss";
8
+
9
+ export default defineConfig({
10
+ shortcuts: {},
11
+ preflights: [
12
+ {
13
+ getCSS: () => `
14
+ /* Filter collapse transition */
15
+ .filter-collapse-enter-active,
16
+ .filter-collapse-leave-active {
17
+ transition: all 0.3s ease-in-out;
18
+ overflow: hidden;
19
+ }
20
+
21
+ .filter-collapse-enter-from,
22
+ .filter-collapse-leave-to {
23
+ max-height: 0;
24
+ opacity: 0;
25
+ }
26
+
27
+ .filter-collapse-enter-to,
28
+ .filter-collapse-leave-from {
29
+ max-height: 1000px;
30
+ opacity: 1;
31
+ }
32
+ `,
33
+ },
34
+ ],
35
+ theme: {
36
+ colors: {
37
+ "brand-primary": "#543B95",
38
+ "surface-surface": "#FFFFFF",
39
+ "outline-outline": "#79747E",
40
+ "outline-outline-variant": "#CAC4D0",
41
+ "outline-outline-primary": "#543B95",
42
+ "surface-on-surface": "#1D1B20",
43
+ "surface-surface-variant": "#FBF6FF",
44
+ "states-success": "#15B31C",
45
+ "surface-on-surface-variant": "#696470",
46
+ "surface-surface-disabled": "#E8E8E8",
47
+ "surface-on-surface-disabled": "#9893A6",
48
+ "surface-surface-primary": "#D0BCFF",
49
+ "states-warning": "#F57C00",
50
+ "surface-surface-container": "#F3EDF7",
51
+ "surface-surface-container-highest": "#E6E0E9",
52
+ "states-error": "#D12D24",
53
+ "states-on-error": "#FFFFFF",
54
+ "brand-primary-hover": "#45317A",
55
+ "brand-on-primary": "#FFFFFF",
56
+ "brand-secondary": "#E1D5FF",
57
+ "brand-secondary-hover": "#D0BCFC",
58
+ "brand-on-secondary": "#3A276A",
59
+ "brand-tertiary": "#F1F1F1",
60
+ "brand-tertiary-hover": "#E3E3E3",
61
+ "brand-on-tertiary": "#1D1B20",
62
+ "other-sale": "#D12D24",
63
+ "overlay-dark-highest": "rgba(0, 0, 0, 0.75)",
64
+ "overlay-dark-high": "rgba(0, 0, 0, 0.5)",
65
+ "overlay-dark": "rgba(0, 0, 0, 0.3)",
66
+ "overlay-dark-low": "rgba(0, 0, 0, 0.12)",
67
+ "overlay-dark-lowest": "rgba(0, 0, 0, 0.08)",
68
+ "overlay-light-highest": "rgba(255, 255, 255, 0.75)",
69
+ "overlay-light-high": "rgba(255, 255, 255, 0.5)",
70
+ "overlay-light": "rgba(255, 255, 255, 0.25)",
71
+ "overlay-light-low": "rgba(255, 255, 255, 0.12)",
72
+ "overlay-light-lowest": "rgba(255, 255, 255, 0.08)",
73
+ "fixed-fixed-on-image": "#FFFFFF",
74
+ },
75
+ fontFamily: {
76
+ inter: "Inter",
77
+ Noto_Serif: "Noto Serif",
78
+ },
79
+ },
80
+ safelist: ["states-success", "states-error", "states-info", "states-warning"],
81
+ presets: [
82
+ presetWind3(),
83
+ presetIcons({
84
+ collections: {
85
+ carbon: () =>
86
+ import("@iconify-json/carbon/icons.json", {
87
+ with: { type: "json" },
88
+ }).then((i) => i.default),
89
+ },
90
+ }),
91
+ presetAttributify(),
92
+ presetTypography(),
93
+ ],
94
+ });
@@ -1,44 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Schemas } from "#shopware";
3
-
4
- const props = withDefaults(
5
- defineProps<{
6
- activeCategory: Schemas["Category"];
7
- elements: Schemas["Category"][];
8
- level: number;
9
- }>(),
10
- {
11
- level: 0,
12
- },
13
- );
14
-
15
- function getHighlightCategory(navigationElement: Schemas["Category"]) {
16
- return (
17
- (props.activeCategory?.path || "").includes(navigationElement.id) ||
18
- navigationElement.id === props.activeCategory?.id
19
- );
20
- }
21
- </script>
22
- <template>
23
- <ul v-if="props.elements?.length" class="list-none m-0 px-5">
24
- <li
25
- v-for="(navigationElement, index) in props.elements"
26
- :key="index"
27
- :class="{
28
- 'border-b border-gray-200': props.level === 0,
29
- }"
30
- >
31
- <SwCategoryNavigationLink
32
- :navigation-element="navigationElement"
33
- :is-highlighted="getHighlightCategory(navigationElement)"
34
- :is-active="navigationElement.id === props.activeCategory?.id"
35
- />
36
- <SwCategoryNavigation
37
- v-if="navigationElement.children"
38
- :elements="navigationElement.children"
39
- :active-category="props.activeCategory"
40
- :level="props.level + 1"
41
- />
42
- </li>
43
- </ul>
44
- </template>
@@ -1,57 +0,0 @@
1
- <script setup lang="ts">
2
- import {
3
- buildUrlPrefix,
4
- getCategoryRoute,
5
- getTranslatedProperty,
6
- urlIsAbsolute,
7
- } from "@shopware/helpers";
8
- import { computed } from "vue";
9
- import { RouterLink } from "vue-router";
10
- import { useUrlResolver } from "#imports";
11
- import type { Schemas } from "#shopware";
12
-
13
- interface Props {
14
- navigationElement: Schemas["Category"];
15
- isActive?: boolean;
16
- isHighlighted?: boolean;
17
- }
18
-
19
- const props = defineProps<Props>();
20
- const { getUrlPrefix } = useUrlResolver();
21
- const url = computed(() => {
22
- return buildUrlPrefix(
23
- getCategoryRoute(props.navigationElement),
24
- getUrlPrefix(),
25
- );
26
- });
27
- </script>
28
- <template>
29
- <div
30
- class="flex items-center py-2 px-5 text-base rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 my-2"
31
- >
32
- <RouterLink
33
- v-if="!urlIsAbsolute(url.path)"
34
- :to="url"
35
- :class="[
36
- props.isHighlighted ? 'font-bold' : 'font-normal',
37
- props.isActive ? 'text-indigo-600' : 'text-gray-900',
38
- ]"
39
- >
40
- <span>{{ getTranslatedProperty(navigationElement, "name") }}</span>
41
- </RouterLink>
42
- <a
43
- v-else
44
- :href="url.path"
45
- :class="[
46
- props.isHighlighted ? 'font-bold' : 'font-normal',
47
- props.isActive ? 'text-indigo-600' : 'text-gray-900',
48
- ]"
49
- :target="
50
- navigationElement.externalLink || navigationElement.linkNewTab
51
- ? '_blank'
52
- : ''
53
- "
54
- ><span>{{ getTranslatedProperty(navigationElement, "name") }}</span></a
55
- >
56
- </div>
57
- </template>
@@ -1,89 +0,0 @@
1
- <script setup lang="ts">
2
- import { useCmsTranslations, useProductPrice } from "@shopware/composables";
3
- import { defu } from "defu";
4
- import { toRefs } from "vue";
5
- import type { Schemas } from "#shopware";
6
-
7
- const props = defineProps<{
8
- product: Schemas["Product"];
9
- }>();
10
-
11
- type Translations = {
12
- listing: {
13
- variantsFrom: string;
14
- previously: string;
15
- from: string;
16
- to: string;
17
- };
18
- };
19
-
20
- let translations: Translations = {
21
- listing: {
22
- variantsFrom: "variants from",
23
- previously: "previously",
24
- from: "from",
25
- to: "to",
26
- },
27
- };
28
-
29
- translations = defu(useCmsTranslations(), translations) as Translations;
30
-
31
- const { product } = toRefs(props);
32
-
33
- const {
34
- price,
35
- unitPrice,
36
- displayFromVariants,
37
- displayFrom,
38
- isListPrice,
39
- regulationPrice,
40
- } = useProductPrice(product);
41
- </script>
42
-
43
- <template>
44
- <div :id="product.id">
45
- <SwSharedPrice
46
- v-if="isListPrice"
47
- class="text-l text-gray-900 basis-2/6 justify-end line-through"
48
- :value="price?.listPrice?.price"
49
- />
50
- <template v-if="!isListPrice">
51
- <div class="h-6"><!-- placeholder --></div>
52
- </template>
53
- <SwSharedPrice
54
- v-if="displayFromVariants"
55
- class="text-xl text-gray-900 basis-2/6 justify-end"
56
- :value="displayFromVariants"
57
- >
58
- <template #beforePrice
59
- ><span v-if="displayFromVariants" class="text-sm">{{
60
- translations.listing.variantsFrom
61
- }}</span></template
62
- >
63
- </SwSharedPrice>
64
- <SwSharedPrice
65
- class="text-gray-900 basis-2/6"
66
- :class="{
67
- 'text-red-600 font-bold': isListPrice,
68
- 'justify-end text-xl':
69
- regulationPrice || !regulationPrice || !displayFromVariants,
70
- }"
71
- :value="unitPrice"
72
- >
73
- <template #beforePrice
74
- ><span v-if="displayFrom || displayFromVariants" class="text-sm">{{
75
- translations.listing.from
76
- }}</span></template
77
- >
78
- </SwSharedPrice>
79
- <template v-if="regulationPrice">
80
- <div class="flex gap-2 justify-end text-gray-500 text-3.5 mb-2">
81
- {{ translations.listing.previously }}
82
- <SwSharedPrice :value="regulationPrice" />
83
- </div>
84
- </template>
85
- <template v-if="!regulationPrice">
86
- <div class="h-7"><!-- placeholder --></div>
87
- </template>
88
- </div>
89
- </template>