@gem-sdk/components 2.0.0-dev.289 → 2.0.0-dev.294

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 (74) hide show
  1. package/dist/cjs/accordion/components/common/styles.js +1 -2
  2. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +1 -1
  3. package/dist/cjs/carousel/components/Carousel.js +2 -3
  4. package/dist/cjs/carousel/components/CarouselItem.js +6 -2
  5. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +1 -1
  6. package/dist/cjs/grid/row/commons/getAttr.js +3 -2
  7. package/dist/cjs/image/components/AdaptiveImage.js +1 -1
  8. package/dist/cjs/image/components/AdaptiveImage.liquid.js +4 -4
  9. package/dist/cjs/image/components/Image.js +1 -5
  10. package/dist/cjs/image/components/common/styles.js +2 -2
  11. package/dist/cjs/image/components/helpers/getNextImageLiquidAttrs.js +6 -24
  12. package/dist/cjs/image/components/helpers/getNextImageReactAttrs.js +3 -3
  13. package/dist/cjs/post-purchase/button/setting/configs/settings.js +10 -8
  14. package/dist/cjs/post-purchase/callout-banner/components/CalloutText.js +1 -2
  15. package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +8 -0
  16. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +3 -3
  17. package/dist/cjs/post-purchase/countdown-timer/settings/config/setting.js +2 -1
  18. package/dist/cjs/product/components/FileUpload/components/common/index.js +1 -1
  19. package/dist/cjs/product/components/Product.js +3 -3
  20. package/dist/cjs/product/components/ProductImagesV2/jsx/ProductImages.js +1 -5
  21. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeatureVideo.js +36 -0
  22. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageOnly.js +83 -51
  23. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductGalleryCarousel.js +3 -1
  24. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductGalleryGrid.js +3 -2
  25. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductImagesLightBox.js +29 -11
  26. package/dist/cjs/product/setting/product/configs/uiV2.js +2 -2
  27. package/dist/cjs/product/setting/product-image-v2/ProductFeatureImage.js +0 -363
  28. package/dist/cjs/product/setting/product-image-v2/ProductGalleryImage.js +0 -493
  29. package/dist/cjs/product/setting/product-image-v2/ProductImages.js +1 -3
  30. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +2 -5
  31. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +4 -7
  32. package/dist/cjs/setting.js +2 -2
  33. package/dist/cjs/third-party/components/RechargeSubscriptions.liquid.js +1 -1
  34. package/dist/cjs/third-party/setting/RechargeSubscriptions.js +5 -2
  35. package/dist/cjs/video/components/Video.js +1 -1
  36. package/dist/esm/accordion/components/common/styles.js +1 -2
  37. package/dist/esm/banner/components/HeroBannerItem.liquid.js +1 -1
  38. package/dist/esm/carousel/components/Carousel.js +2 -3
  39. package/dist/esm/carousel/components/CarouselItem.js +6 -2
  40. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +1 -1
  41. package/dist/esm/grid/row/commons/getAttr.js +3 -2
  42. package/dist/esm/image/components/AdaptiveImage.js +2 -2
  43. package/dist/esm/image/components/AdaptiveImage.liquid.js +4 -4
  44. package/dist/esm/image/components/Image.js +2 -6
  45. package/dist/esm/image/components/common/styles.js +2 -2
  46. package/dist/esm/image/components/helpers/getNextImageLiquidAttrs.js +6 -24
  47. package/dist/esm/image/components/helpers/getNextImageReactAttrs.js +3 -3
  48. package/dist/esm/post-purchase/button/setting/configs/settings.js +10 -8
  49. package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +2 -3
  50. package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +8 -1
  51. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +3 -3
  52. package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +2 -1
  53. package/dist/esm/product/components/FileUpload/components/common/index.js +1 -1
  54. package/dist/esm/product/components/Product.js +3 -3
  55. package/dist/esm/product/components/ProductImagesV2/jsx/ProductImages.js +1 -5
  56. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeatureVideo.js +32 -0
  57. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageOnly.js +84 -52
  58. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductGalleryCarousel.js +3 -1
  59. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductGalleryGrid.js +3 -2
  60. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductImagesLightBox.js +31 -13
  61. package/dist/esm/product/setting/product/configs/uiV2.js +2 -2
  62. package/dist/esm/product/setting/product-image-v2/ProductFeatureImage.js +1 -361
  63. package/dist/esm/product/setting/product-image-v2/ProductGalleryImage.js +1 -492
  64. package/dist/esm/product/setting/product-image-v2/ProductImages.js +1 -3
  65. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +2 -5
  66. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +4 -7
  67. package/dist/esm/setting.js +2 -2
  68. package/dist/esm/third-party/components/RechargeSubscriptions.liquid.js +1 -1
  69. package/dist/esm/third-party/setting/RechargeSubscriptions.js +5 -2
  70. package/dist/esm/video/components/Video.js +2 -2
  71. package/dist/types/index.d.ts +2 -0
  72. package/package.json +2 -2
  73. package/dist/cjs/product/setting/product-image-v2/configs/settings.js +0 -327
  74. package/dist/esm/product/setting/product-image-v2/configs/settings.js +0 -325
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { jsx } from 'react/jsx-runtime';
3
- import { useFeaturedImageGlobal, cls } from '@gem-sdk/core';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { useFeaturedImageGlobal, useEditorMode, cls } from '@gem-sdk/core';
4
4
  import Carousel from '../../../../../carousel/components/Carousel.js';
5
5
  import CarouselItem from '../../../../../carousel/components/CarouselItem.js';
6
6
  import NextImage from '../../../../../image/components/NextImage.js';
@@ -8,6 +8,8 @@ import '../../../../../modal/components/confirm.js';
8
8
  import Modal from '../../../../../modal/components/Modal.js';
9
9
  import { useMemo } from 'react';
10
10
  import { isFeatureMedia } from '../../common/productFeaturedImage.js';
11
+ import ProductFeatureVideo from './ProductFeatureVideo.js';
12
+ import MediaIcon from './MediaIcon.js';
11
13
 
12
14
  const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio, onHandleClose })=>{
13
15
  const featuredImageGlobal = useFeaturedImageGlobal();
@@ -28,6 +30,11 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
28
30
  mobile: false,
29
31
  tablet: false
30
32
  };
33
+ const mode = useEditorMode();
34
+ const isRenderVideo = (image)=>mode !== 'edit' && [
35
+ 'VIDEO',
36
+ 'EXTERNAL_VIDEO'
37
+ ].includes(image?.contentType || '');
31
38
  return /*#__PURE__*/ jsx(Modal, {
32
39
  setting: {
33
40
  open: open
@@ -103,17 +110,28 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
103
110
  fullHeight: true,
104
111
  children: productImages?.map((image)=>/*#__PURE__*/ jsx(CarouselItem, {
105
112
  className: `gem-slider-item gem-slider-item-${builderPropUID} gp-flex gp-items-center gp-justify-center gp-px-4`,
106
- children: /*#__PURE__*/ jsx(NextImage, {
107
- src: isFeatureMedia(image?.contentType) ? image?.previewImage : image?.src,
108
- width: image?.width,
109
- height: image?.height,
110
- alt: image?.alt,
111
- "content-type": image?.contentType,
112
- setting: {
113
- aspectRatio: imageRatio
114
- },
115
- className: cls('gp-h-full gp-w-full gp-object-contain')
116
- }, image?.id)
113
+ children: !isRenderVideo(image) ? /*#__PURE__*/ jsxs(Fragment, {
114
+ children: [
115
+ /*#__PURE__*/ jsx(NextImage, {
116
+ src: isFeatureMedia(image?.contentType) ? image?.previewImage : image?.src,
117
+ width: image?.width,
118
+ height: image?.height,
119
+ alt: image?.alt,
120
+ "content-type": image?.contentType,
121
+ setting: {
122
+ aspectRatio: imageRatio
123
+ },
124
+ className: cls('gp-h-full gp-w-full gp-object-contain')
125
+ }, image?.id),
126
+ /*#__PURE__*/ jsx(MediaIcon, {
127
+ contentType: image?.contentType ?? ''
128
+ })
129
+ ]
130
+ }) : /*#__PURE__*/ jsx(ProductFeatureVideo, {
131
+ type: image?.contentType,
132
+ url: image.src ?? '',
133
+ aspectRatio: imageRatio
134
+ })
117
135
  }, image?.id))
118
136
  })
119
137
  });
@@ -182,11 +182,11 @@ const SettingUIV2 = [
182
182
  type: 'select',
183
183
  options: [
184
184
  {
185
- label: 'Link variants, quantity between same products',
185
+ label: 'Link variants, quantity <br> between same products',
186
186
  value: true
187
187
  },
188
188
  {
189
- label: 'Unlink variants, quantity between same products',
189
+ label: 'Unlink variants, quantity <br> between same products',
190
190
  value: false
191
191
  }
192
192
  ],
@@ -1,363 +1,3 @@
1
- import { CAROUSEL_ANIMATION } from '../../../carousel/components/plugins/AnimationPlugin.js';
2
-
3
- const getDefaultResponsive = (defaultValue)=>{
4
- return {
5
- desktop: {
6
- default: defaultValue
7
- }
8
- };
9
- };
10
- const productFeatureImageSetting = [
11
- {
12
- id: 'hoverEffect',
13
- label: 'Hover Effect',
14
- type: 'select',
15
- hide: true,
16
- hideOnMode: {
17
- mobileOnly: true
18
- },
19
- options: [
20
- {
21
- title: 'None',
22
- value: 'none'
23
- },
24
- {
25
- title: 'Zoom',
26
- value: 'zoom'
27
- },
28
- {
29
- title: 'Show other image',
30
- value: 'other'
31
- }
32
- ],
33
- default: 'none'
34
- },
35
- {
36
- id: 'zoomType',
37
- type: 'select',
38
- label: 'Zoom Type',
39
- hide: true,
40
- default: 'default',
41
- hideOnMode: {
42
- mobileOnly: true
43
- },
44
- options: [
45
- {
46
- title: 'Default',
47
- value: 'default'
48
- },
49
- {
50
- title: 'Glasses',
51
- value: 'glasses'
52
- }
53
- ]
54
- },
55
- {
56
- id: 'zoom',
57
- type: 'range',
58
- label: 'Zoom Value',
59
- min: 100,
60
- max: 200,
61
- step: 10,
62
- default: 150,
63
- units: [
64
- '%'
65
- ],
66
- useOnlyUnitInit: true
67
- },
68
- {
69
- id: 'otherImage',
70
- label: 'Other image',
71
- type: 'select',
72
- options: [
73
- {
74
- title: 'Image 1',
75
- value: 0
76
- },
77
- {
78
- title: 'Image 2',
79
- value: 1
80
- },
81
- {
82
- title: 'Image 3',
83
- value: 2
84
- },
85
- {
86
- title: 'Image 4',
87
- value: 3
88
- },
89
- {
90
- title: 'Last image',
91
- value: -1
92
- }
93
- ],
94
- default: 0
95
- },
96
- {
97
- id: 'ftClickOpenLightBox',
98
- label: 'Click Effect',
99
- type: 'select',
100
- options: [
101
- {
102
- title: 'None',
103
- value: 'none'
104
- },
105
- {
106
- title: 'Open view image',
107
- value: 'popup'
108
- },
109
- {
110
- title: 'Open product page',
111
- value: 'product-link'
112
- }
113
- ],
114
- devices: getDefaultResponsive('none')
115
- },
116
- {
117
- id: 'ftClickOpenNewTab',
118
- type: 'segment',
119
- options: [
120
- {
121
- title: 'Current',
122
- value: false
123
- },
124
- {
125
- title: 'New tab',
126
- value: true
127
- }
128
- ],
129
- default: false
130
- },
131
- {
132
- id: 'ftNavigationPosition',
133
- label: 'Navigation',
134
- type: 'layout-segment',
135
- iconViewBox: '0 0 78 48',
136
- enableItemBackground: true,
137
- enableTooltip: true,
138
- options: [
139
- {
140
- title: 'No navigation',
141
- value: 'none',
142
- type: 'slide-control',
143
- isTextIcon: true
144
- },
145
- {
146
- title: 'Display inside navigation',
147
- value: 'inside',
148
- type: 'slide-control'
149
- },
150
- {
151
- title: 'Display outside navigation',
152
- value: 'outside',
153
- type: 'slide-control'
154
- }
155
- ],
156
- devices: getDefaultResponsive('none')
157
- },
158
- {
159
- id: 'ftLoop',
160
- type: 'toggle',
161
- devices: getDefaultResponsive(false)
162
- },
163
- {
164
- id: 'ftPauseOnHover',
165
- label: 'Pause On Hover',
166
- type: 'toggle',
167
- hide: true,
168
- default: true
169
- },
170
- {
171
- id: 'ftAnimationSpeed',
172
- label: 'Slide speed',
173
- type: 'input:unit',
174
- useOnlyUnitInit: true,
175
- min: 1,
176
- units: [
177
- 'ms'
178
- ],
179
- default: 500
180
- },
181
- {
182
- id: 'ftAnimationMode',
183
- label: 'Animation',
184
- type: 'select',
185
- default: CAROUSEL_ANIMATION.EASE_OUT.value,
186
- options: [
187
- {
188
- title: 'Ease in',
189
- value: CAROUSEL_ANIMATION.EASE_IN.value
190
- },
191
- {
192
- title: 'Ease out',
193
- value: CAROUSEL_ANIMATION.EASE_OUT.value
194
- },
195
- {
196
- title: 'Ease in out',
197
- value: CAROUSEL_ANIMATION.EASE_IN_OUT.value
198
- }
199
- ]
200
- },
201
- {
202
- id: 'ftArrowIcon',
203
- type: 'icon',
204
- hide: true,
205
- label: 'Custom Arrow',
206
- info: 'Choose from list or paste any SVG icon',
207
- default: `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
208
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM10.6828 8.13017C10.5266 7.95661 10.2734 7.95661 10.1172 8.13017C9.96095 8.30374 9.96095 8.58515 10.1172 8.75871L13.0343 12L10.1172 15.2413C9.96095 15.4149 9.96095 15.6963 10.1172 15.8698C10.2734 16.0434 10.5266 16.0434 10.6828 15.8698L13.8828 12.3143C14.0391 12.1407 14.0391 11.8593 13.8828 11.6857L10.6828 8.13017Z" fill="currentColor"/>
209
- </svg>`
210
- },
211
- {
212
- id: 'ftArrowIconColor',
213
- label: 'Icon color',
214
- type: 'colorpicker',
215
- default: '#000000'
216
- },
217
- {
218
- id: 'ftDragToScroll',
219
- label: 'Drag to scroll',
220
- type: 'toggle',
221
- hide: true,
222
- default: false
223
- },
224
- {
225
- id: 'ftArrowNavColor',
226
- label: 'Nav. color',
227
- type: 'colorpicker'
228
- },
229
- {
230
- id: 'ftArrowNavBorder',
231
- label: 'Nav. border',
232
- type: 'border',
233
- default: {
234
- borderType: 'none',
235
- border: 'none',
236
- borderWidth: '1px',
237
- width: '1px 1px 1px 1px',
238
- isCustom: false
239
- }
240
- },
241
- {
242
- id: 'ftArrowNavRadius',
243
- label: 'Nav. corner',
244
- type: 'radius-preset',
245
- default: {
246
- btrr: '0px',
247
- bblr: '0px',
248
- bbrr: '0px',
249
- btlr: '0px',
250
- radiusType: 'none'
251
- }
252
- }
253
- ];
254
- const productSelectDisplaySetting = [
255
- {
256
- id: 'typeDisplay',
257
- type: 'select',
258
- options: [
259
- {
260
- title: 'All images',
261
- value: 'all-images'
262
- },
263
- {
264
- title: 'Select manually',
265
- value: 'select-manual'
266
- }
267
- ],
268
- default: 'all-images'
269
- },
270
- {
271
- id: 'preDisplay',
272
- type: 'select',
273
- label: 'Pre-display',
274
- default: '1st-available-variant',
275
- options: [
276
- {
277
- title: '1st available variant',
278
- value: '1st-available-variant'
279
- },
280
- {
281
- title: '1st image',
282
- value: '1st-images'
283
- },
284
- {
285
- title: '1st video',
286
- value: '1st-video'
287
- },
288
- {
289
- title: '1st 3D model',
290
- value: '1st-3d-mode'
291
- }
292
- ]
293
- }
294
- ];
295
- const productFeatureImageStyle = [
296
- {
297
- id: 'ftShape',
298
- type: 'size-setting',
299
- label: '',
300
- devices: {
301
- desktop: {
302
- default: {
303
- shape: 'square',
304
- shapeValue: '1/1',
305
- width: '100%',
306
- height: undefined,
307
- shapeLinked: true
308
- }
309
- }
310
- },
311
- settingConfig: {
312
- width: {
313
- displayOptions: [
314
- 'full'
315
- ]
316
- }
317
- },
318
- hiddenSettings: [
319
- 'padding',
320
- 'gap'
321
- ]
322
- },
323
- {
324
- id: 'ftLayout',
325
- type: 'layout-segment',
326
- iconViewBox: '0 0 66 48',
327
- enableItemBackground: true,
328
- enableTooltip: true,
329
- label: 'Image scale',
330
- options: [
331
- {
332
- label: 'Fill image',
333
- value: 'cover',
334
- type: 'image'
335
- },
336
- {
337
- label: 'Fit image',
338
- value: 'contain',
339
- type: 'image'
340
- }
341
- ],
342
- devices: getDefaultResponsive('cover')
343
- },
344
- {
345
- id: 'ftCorner',
346
- type: 'radius-preset',
347
- label: 'Corner',
348
- default: {
349
- btrr: '0px',
350
- bblr: '0px',
351
- bbrr: '0px',
352
- btlr: '0px',
353
- radiusType: 'none'
354
- },
355
- state: {
356
- hover: true,
357
- normal: true
358
- }
359
- }
360
- ];
361
1
  const productFeatureImageUI = [
362
2
  {
363
3
  type: 'control',
@@ -605,4 +245,4 @@ const productFeatureImageNavigationUI = [
605
245
  }
606
246
  ];
607
247
 
608
- export { productFeatureImageNavigationUI, productFeatureImageSetting, productFeatureImageStyle, productFeatureImageUI, productSelectDisplaySetting, productSelectImage };
248
+ export { productFeatureImageNavigationUI, productFeatureImageUI, productSelectImage };