@shopware/cms-base-layer 0.0.0-canary-20260119102409 → 0.0.0-canary-20260119103402

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/README.md CHANGED
@@ -349,7 +349,7 @@ No additional packages needed to be installed.
349
349
 
350
350
  Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/cms-base-layer/CHANGELOG.md)
351
351
 
352
- ### Latest changes: 0.0.0-canary-20260119102409
352
+ ### Latest changes: 0.0.0-canary-20260119103402
353
353
 
354
354
  ### Minor Changes
355
355
 
@@ -361,6 +361,8 @@ Full changelog for stable version is available [here](https://github.com/shopwar
361
361
 
362
362
  ### Patch Changes
363
363
 
364
+ - [#2226](https://github.com/shopware/frontends/pull/2226) [`d77eacc`](https://github.com/shopware/frontends/commit/d77eaccdec6c56a6f2d999048c751fb9f01177d4) Thanks [@mkucmus](https://github.com/mkucmus)! - Add config prop support to `SwProductGallery` and make `CmsElementImageGallery` respect `minHeight`, `navigationArrows`, and `navigationDots` config values.
365
+
364
366
  - [#2210](https://github.com/shopware/frontends/pull/2210) [`c6b88b7`](https://github.com/shopware/frontends/commit/c6b88b7d2c50054188356aeb0f83053554d442f5) Thanks [@mkucmus](https://github.com/mkucmus)! - Anchor tags with "btn btn-primary" classes from the API were not being
365
367
  transformed to Tailwind utility classes due to condition matching issues
366
368
  in the html-to-vue renderer.
@@ -1,30 +1,34 @@
1
1
  <script setup lang="ts">
2
- import type { CmsElementImageGallery } from "@shopware/composables";
2
+ import type {
3
+ CmsElementImageGallery,
4
+ SliderElementConfig,
5
+ } from "@shopware/composables";
3
6
  import { ref, watch } from "vue";
4
7
  import type { Schemas } from "#shopware";
5
8
 
6
- const props = defineProps<{
9
+ const { product, config = {} } = defineProps<{
7
10
  product: Schemas["Product"];
11
+ config?: Partial<SliderElementConfig>;
8
12
  }>();
13
+
14
+ const defaultConfig: SliderElementConfig = {
15
+ minHeight: { value: "300px", source: "static" },
16
+ navigationArrows: { value: "inside", source: "static" },
17
+ navigationDots: { value: "inside", source: "static" },
18
+ };
19
+
9
20
  const content = ref<CmsElementImageGallery>();
10
21
 
11
22
  watch(
12
- () => props.product,
13
- (value) => {
14
- const media = value.media;
23
+ [() => product, () => config],
24
+ ([currentProduct, currentConfig]) => {
15
25
  content.value = {
16
26
  config: {
17
- minHeight: {
18
- value: "300px",
19
- source: "static",
20
- },
21
- navigationArrows: {
22
- value: "inside",
23
- source: "static",
24
- },
27
+ ...defaultConfig,
28
+ ...currentConfig,
25
29
  },
26
30
  data: {
27
- sliderItems: media,
31
+ sliderItems: currentProduct.media,
28
32
  },
29
33
  } as CmsElementImageGallery;
30
34
  },
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import type { CmsElementImageGallery } from "@shopware/composables";
3
3
  import { computed, defineAsyncComponent, ref } from "vue";
4
- import { useImagePlaceholder } from "#imports";
4
+ import { useCmsElementConfig, useImagePlaceholder } from "#imports";
5
5
  import { isSpatial } from "../../../../helpers/media/isSpatial";
6
6
 
7
7
  // Load SwMedia3D only on client-side to avoid SSR issues with three.js packages
@@ -13,6 +13,21 @@ const props = defineProps<{
13
13
  content: CmsElementImageGallery;
14
14
  }>();
15
15
 
16
+ const { getConfigValue } = useCmsElementConfig(props.content);
17
+
18
+ const DEFAULT_MIN_HEIGHT = "500px";
19
+ const DEFAULT_NAVIGATION = "inside";
20
+
21
+ const minHeight = computed(
22
+ () => getConfigValue("minHeight") || DEFAULT_MIN_HEIGHT,
23
+ );
24
+ const navigationArrows = computed(
25
+ () => getConfigValue("navigationArrows") || DEFAULT_NAVIGATION,
26
+ );
27
+ const navigationDots = computed(
28
+ () => getConfigValue("navigationDots") || DEFAULT_NAVIGATION,
29
+ );
30
+
16
31
  const currentIndex = ref(0);
17
32
  const mediaGallery = computed(() => props.content.data?.sliderItems ?? []);
18
33
  const placeholderSvg = useImagePlaceholder();
@@ -75,7 +90,8 @@ function onTouchEnd() {
75
90
  <div class="w-full">
76
91
  <!-- Main Image Display -->
77
92
  <div
78
- class="w-full h-[400px] sm:h-[500px] lg:h-[600px] xl:h-[700px] relative overflow-hidden"
93
+ class="w-full relative overflow-hidden"
94
+ :style="{ minHeight }"
79
95
  @touchstart="onTouchStart"
80
96
  @touchmove="onTouchMove"
81
97
  @touchend="onTouchEnd"
@@ -124,12 +140,17 @@ function onTouchEnd() {
124
140
 
125
141
  <!-- Navigation Arrows -->
126
142
  <div
127
- v-if="mediaGallery.length > 1"
143
+ v-if="mediaGallery.length > 1 && navigationArrows !== 'none'"
128
144
  class="absolute inset-0 flex items-center justify-between px-2 sm:px-4 pointer-events-none"
129
145
  >
130
146
  <!-- Previous Button -->
131
147
  <button
132
- class="w-10 h-10 rounded-full transition bg-white/20 hover:bg-white/50 disabled:opacity-50 pointer-events-auto shadow-lg flex items-center justify-center"
148
+ :class="[
149
+ 'w-10 h-10 rounded-full transition disabled:opacity-50 pointer-events-auto shadow-lg flex items-center justify-center',
150
+ navigationArrows === 'outside'
151
+ ? 'bg-brand-tertiary text-surface-on-surface'
152
+ : 'bg-surface-surface/20 hover:bg-surface-surface/50',
153
+ ]"
133
154
  :disabled="currentIndex === 0"
134
155
  aria-label="Previous image"
135
156
  @click="previous"
@@ -139,7 +160,12 @@ function onTouchEnd() {
139
160
 
140
161
  <!-- Next Button -->
141
162
  <button
142
- class="w-10 h-10 rounded-full transition bg-white/20 hover:bg-white/50 disabled:opacity-50 pointer-events-auto shadow-lg flex items-center justify-center"
163
+ :class="[
164
+ 'w-10 h-10 rounded-full transition disabled:opacity-50 pointer-events-auto shadow-lg flex items-center justify-center',
165
+ navigationArrows === 'outside'
166
+ ? 'bg-brand-tertiary text-surface-on-surface'
167
+ : 'bg-surface-surface/20 hover:bg-surface-surface/50',
168
+ ]"
143
169
  :disabled="currentIndex === mediaGallery.length - 1"
144
170
  aria-label="Next image"
145
171
  @click="next"
@@ -150,8 +176,11 @@ function onTouchEnd() {
150
176
 
151
177
  <!-- Dot Indicators -->
152
178
  <div
153
- v-if="mediaGallery.length > 1"
154
- class="flex justify-center items-center gap-2 mt-2"
179
+ v-if="mediaGallery.length > 1 && navigationDots !== 'none'"
180
+ :class="[
181
+ 'flex justify-center items-center gap-2',
182
+ navigationDots === 'outside' ? 'mt-4' : 'absolute bottom-4 left-1/2 transform -translate-x-1/2',
183
+ ]"
155
184
  >
156
185
  <button
157
186
  v-for="(image, index) in mediaGallery"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware/cms-base-layer",
3
- "version": "0.0.0-canary-20260119102409",
3
+ "version": "0.0.0-canary-20260119103402",
4
4
  "description": "Vue CMS Nuxt Layer for Shopware",
5
5
  "author": "Shopware",
6
6
  "repository": {
@@ -48,8 +48,8 @@
48
48
  "vue": "3.5.26",
49
49
  "xss": "1.0.15",
50
50
  "@shopware/api-client": "1.4.0",
51
- "@shopware/composables": "1.10.0",
52
- "@shopware/helpers": "1.6.0"
51
+ "@shopware/helpers": "1.6.0",
52
+ "@shopware/composables": "1.10.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@biomejs/biome": "1.8.3",