@gem-sdk/components 2.0.0-dev.261 → 2.0.0-dev.266

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 (108) hide show
  1. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +3 -2
  2. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +3 -2
  3. package/dist/cjs/grid/row/setting/configs/settings.js +9 -83
  4. package/dist/cjs/grid/section/setting/configs/settings.js +13 -75
  5. package/dist/cjs/icon-list-hoz/setting/configs/settings.js +4 -17
  6. package/dist/cjs/post-purchase/advanced-list/setting/configs/uiV2.js +3 -15
  7. package/dist/cjs/post-purchase/line/setting/configs/settings.js +3 -1
  8. package/dist/cjs/post-purchase/line/setting/configs/uiV2.js +2 -1
  9. package/dist/cjs/post-purchase/link/components/PostPurchaseLink.js +23 -14
  10. package/dist/cjs/post-purchase/link/components/common/getClasses.js +7 -1
  11. package/dist/cjs/post-purchase/link/setting/configs/settings.js +21 -14
  12. package/dist/cjs/post-purchase/product/common/getClasses.js +45 -0
  13. package/dist/cjs/post-purchase/product/common/getStyles.js +43 -0
  14. package/dist/cjs/post-purchase/product/components/product-image/FeatureImage.js +32 -42
  15. package/dist/cjs/post-purchase/product/components/product-image/ImageListCarousel.js +6 -65
  16. package/dist/cjs/post-purchase/product/components/product-image/ImageListGrid.js +24 -68
  17. package/dist/cjs/post-purchase/product/components/product-image/ItemCarouselPostPurchase.js +42 -0
  18. package/dist/cjs/post-purchase/product/components/product-image/ItemGridPostPurchase.js +42 -0
  19. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/Arrow.js +29 -0
  20. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +35 -0
  21. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchaseContext.js +22 -0
  22. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +75 -0
  23. package/dist/cjs/post-purchase/product/components/product-image/index.js +41 -43
  24. package/dist/cjs/post-purchase/product/components/product-image/layouts/FeatureImageWithGalleryImage.js +22 -58
  25. package/dist/cjs/post-purchase/product/components/product-image/layouts/OnlyGalleryImage.js +19 -12
  26. package/dist/cjs/post-purchase/product/constants/index.js +36 -0
  27. package/dist/cjs/post-purchase/product/hooks/product-image/useCarousel.js +14 -0
  28. package/dist/cjs/post-purchase/product/hooks/product-image/useFeatureImagePostPurchase.js +32 -0
  29. package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +43 -0
  30. package/dist/cjs/post-purchase/product/hooks/product-image/useNavigationCarouselPostPurchase.js +32 -0
  31. package/dist/cjs/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +60 -0
  32. package/dist/cjs/post-purchase/product/hooks/product-image/useSlideCarousel.js +35 -0
  33. package/dist/cjs/post-purchase/product/settings/product-description/settingV2.js +6 -9
  34. package/dist/cjs/post-purchase/product/settings/product-image/ProductFeatureImage.js +41 -0
  35. package/dist/cjs/post-purchase/product/settings/product-image/ProductGalleryImage.js +0 -118
  36. package/dist/cjs/post-purchase/product/settings/product-image/ProductImages.js +8 -79
  37. package/dist/cjs/post-purchase/product/settings/product-image/setting-v1.js +163 -0
  38. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +375 -0
  39. package/dist/cjs/post-purchase/product/settings/product-image/uiV1.js +42 -0
  40. package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +235 -0
  41. package/dist/cjs/post-purchase/product/settings/product-price/uiV2.js +0 -3
  42. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +10 -6
  43. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/uiV2.js +2 -2
  44. package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +3 -1
  45. package/dist/cjs/post-purchase/product/settings/product-title/settingV2.js +6 -9
  46. package/dist/cjs/post-purchase/text/settings/text/settingV2.js +0 -7
  47. package/dist/cjs/post-purchase/text/settings/text/uiV2.js +2 -2
  48. package/dist/cjs/product/components/FileUpload/components/common/index.js +3 -2
  49. package/dist/cjs/product/setting/product/configs/presets.js +1 -1
  50. package/dist/cjs/product/setting/product/configs/settings.js +4 -20
  51. package/dist/cjs/setting.js +2 -1
  52. package/dist/esm/banner/components/HeroBannerItem.liquid.js +3 -2
  53. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +3 -2
  54. package/dist/esm/grid/row/setting/configs/settings.js +9 -83
  55. package/dist/esm/grid/section/setting/configs/settings.js +13 -75
  56. package/dist/esm/icon-list-hoz/setting/configs/settings.js +4 -17
  57. package/dist/esm/post-purchase/advanced-list/setting/configs/uiV2.js +3 -15
  58. package/dist/esm/post-purchase/line/setting/configs/settings.js +3 -1
  59. package/dist/esm/post-purchase/line/setting/configs/uiV2.js +2 -1
  60. package/dist/esm/post-purchase/link/components/PostPurchaseLink.js +25 -16
  61. package/dist/esm/post-purchase/link/components/common/getClasses.js +7 -2
  62. package/dist/esm/post-purchase/link/setting/configs/settings.js +21 -14
  63. package/dist/esm/post-purchase/product/common/getClasses.js +37 -1
  64. package/dist/esm/post-purchase/product/common/getStyles.js +39 -1
  65. package/dist/esm/post-purchase/product/components/product-image/FeatureImage.js +32 -42
  66. package/dist/esm/post-purchase/product/components/product-image/ImageListCarousel.js +7 -66
  67. package/dist/esm/post-purchase/product/components/product-image/ImageListGrid.js +24 -68
  68. package/dist/esm/post-purchase/product/components/product-image/ItemCarouselPostPurchase.js +40 -0
  69. package/dist/esm/post-purchase/product/components/product-image/ItemGridPostPurchase.js +40 -0
  70. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/Arrow.js +27 -0
  71. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +33 -0
  72. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchaseContext.js +19 -0
  73. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +73 -0
  74. package/dist/esm/post-purchase/product/components/product-image/index.js +42 -44
  75. package/dist/esm/post-purchase/product/components/product-image/layouts/FeatureImageWithGalleryImage.js +22 -58
  76. package/dist/esm/post-purchase/product/components/product-image/layouts/OnlyGalleryImage.js +19 -12
  77. package/dist/esm/post-purchase/product/constants/index.js +34 -0
  78. package/dist/esm/post-purchase/product/hooks/product-image/useCarousel.js +12 -0
  79. package/dist/esm/post-purchase/product/hooks/product-image/useFeatureImagePostPurchase.js +30 -0
  80. package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +41 -0
  81. package/dist/esm/post-purchase/product/hooks/product-image/useNavigationCarouselPostPurchase.js +30 -0
  82. package/dist/esm/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +58 -0
  83. package/dist/esm/post-purchase/product/hooks/product-image/useSlideCarousel.js +33 -0
  84. package/dist/esm/post-purchase/product/settings/product-description/settingV2.js +6 -9
  85. package/dist/esm/post-purchase/product/settings/product-image/ProductFeatureImage.js +41 -0
  86. package/dist/esm/post-purchase/product/settings/product-image/ProductGalleryImage.js +1 -118
  87. package/dist/esm/post-purchase/product/settings/product-image/ProductImages.js +8 -79
  88. package/dist/esm/post-purchase/product/settings/product-image/setting-v1.js +161 -0
  89. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +373 -0
  90. package/dist/esm/post-purchase/product/settings/product-image/uiV1.js +40 -0
  91. package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +233 -0
  92. package/dist/esm/post-purchase/product/settings/product-price/uiV2.js +0 -3
  93. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +10 -6
  94. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/uiV2.js +2 -2
  95. package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +3 -1
  96. package/dist/esm/post-purchase/product/settings/product-title/settingV2.js +6 -9
  97. package/dist/esm/post-purchase/text/settings/text/settingV2.js +0 -7
  98. package/dist/esm/post-purchase/text/settings/text/uiV2.js +2 -2
  99. package/dist/esm/product/components/FileUpload/components/common/index.js +3 -2
  100. package/dist/esm/product/setting/product/configs/presets.js +1 -1
  101. package/dist/esm/product/setting/product/configs/settings.js +4 -20
  102. package/dist/esm/setting.js +2 -1
  103. package/dist/types/index.d.ts +12 -5
  104. package/package.json +4 -4
  105. package/dist/cjs/post-purchase/product/components/product-image/Arrow.js +0 -60
  106. package/dist/cjs/post-purchase/product/components/product-image/CarouselPostPurchase.js +0 -78
  107. package/dist/esm/post-purchase/product/components/product-image/Arrow.js +0 -58
  108. package/dist/esm/post-purchase/product/components/product-image/CarouselPostPurchase.js +0 -76
@@ -1,78 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- var jsxRuntime = require('react/jsx-runtime');
5
- var core = require('@gem-sdk/core');
6
- var Image = require('../../../image/components/Image.js');
7
- var React = require('react');
8
-
9
- const CarouselPostPurchase = (props)=>{
10
- const { productImages, moveToIdx, itemPerRow, ilBorder, ilAspectRatio, ilObjectFit } = props;
11
- const featuredImageGlobal = core.useFeaturedImageGlobal();
12
- const setProductFeaturedImage = core.useProductStore((s)=>s.setProductFeaturedImage);
13
- const list = React.useCallback(()=>{
14
- const temp = [
15
- ...productImages
16
- ];
17
- return temp?.splice(moveToIdx, itemPerRow);
18
- }, [
19
- productImages,
20
- itemPerRow,
21
- moveToIdx
22
- ]);
23
- const listRender = React.useMemo(()=>{
24
- const listItem = list();
25
- if (listItem.length < itemPerRow) {
26
- const temp = [
27
- ...productImages
28
- ];
29
- Array.from({
30
- length: itemPerRow - listItem.length
31
- }).forEach(()=>{
32
- temp.push(null);
33
- });
34
- return temp;
35
- }
36
- return listItem;
37
- }, [
38
- list,
39
- itemPerRow,
40
- productImages
41
- ]);
42
- return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
43
- children: listRender?.map((image, index)=>{
44
- if (!image) {
45
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
46
- className: "gp-w-full"
47
- }, index);
48
- }
49
- const source = {
50
- src: image.src || 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
51
- alt: ''
52
- };
53
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
54
- "aria-hidden": "true",
55
- className: `gp-w-full gp-border ${image?.id === featuredImageGlobal?.id && ilBorder !== 'none' ? '!gp-border-[#d9d9d9]' : 'gp-border-transparent'}`,
56
- onClick: ()=>{
57
- setProductFeaturedImage(image);
58
- },
59
- children: /*#__PURE__*/ jsxRuntime.jsx(Image.default, {
60
- setting: {
61
- srcSet: {
62
- desktop: source,
63
- mobile: source,
64
- tablet: source
65
- }
66
- },
67
- styles: {
68
- aspectRatio: ilAspectRatio,
69
- objectFit: ilObjectFit,
70
- enableBorder: 'none'
71
- }
72
- }, image?.src)
73
- }, image.id);
74
- })
75
- });
76
- };
77
-
78
- exports.CarouselPostPurchase = CarouselPostPurchase;
@@ -1,58 +0,0 @@
1
- 'use client';
2
- import { jsx } from 'react/jsx-runtime';
3
- import { useMemo } from 'react';
4
-
5
- const NEXT_AND_PREV_URLS = {
6
- PREVIOUS: 'https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a2eb5093-0203-4973-8ade-183d5bdefdce.svg',
7
- NEXT: 'https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a5ac0286-5941-4bd7-a21d-72a6c017aeea.svg',
8
- NEXT_DISABLED: 'https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3d1f159-001d-4301-bead-214606caf995.svg',
9
- PREVIOUS_DISABLED: 'https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-33e3810b-a94c-40a1-a48b-4eba39013f15.svg',
10
- VERTICAL_PREVIOUS: 'https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-4e4e886a-5aa1-4bb3-ab48-aa7752fd5eba.svg',
11
- VERTICAL_NEXT: 'https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3c3d74c-2cde-49e5-9854-8079f5239013.svg',
12
- VERTICAL_NEXT_DISABLED: 'https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-6c7f10a8-a205-43bd-b39c-aab044bb3771.svg',
13
- VERTICAL_PREVIOUS_DISABLED: 'https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-010c3c2a-fcc3-4b09-84a2-734d924ad49b.svg'
14
- };
15
- const ArrowPostPurchase = (props)=>{
16
- const { moveToIdx, setMoveToIdx, type, navigation, maxIdx, vertical, layoutType } = props;
17
- const disabled = type == 'next' ? moveToIdx >= maxIdx : moveToIdx === 0;
18
- const imgSrc = useMemo(()=>{
19
- let temp = '';
20
- if (type === 'next') {
21
- if (vertical) {
22
- if (disabled) temp = NEXT_AND_PREV_URLS.VERTICAL_NEXT_DISABLED;
23
- else temp = NEXT_AND_PREV_URLS.VERTICAL_NEXT;
24
- } else {
25
- if (disabled) temp = NEXT_AND_PREV_URLS.NEXT_DISABLED;
26
- else temp = NEXT_AND_PREV_URLS.NEXT;
27
- }
28
- } else {
29
- if (vertical) {
30
- if (disabled) temp = NEXT_AND_PREV_URLS.VERTICAL_PREVIOUS_DISABLED;
31
- else temp = NEXT_AND_PREV_URLS.VERTICAL_PREVIOUS;
32
- } else {
33
- if (disabled) temp = NEXT_AND_PREV_URLS.PREVIOUS_DISABLED;
34
- else temp = NEXT_AND_PREV_URLS.PREVIOUS;
35
- }
36
- }
37
- return temp;
38
- }, [
39
- type,
40
- vertical,
41
- disabled
42
- ]);
43
- if (navigation === 'none' || layoutType === 'one-col') return null;
44
- return /*#__PURE__*/ jsx("button", {
45
- className: `gp-w-[24px] gp-h-[24px] gp-shrink-0 gp-flex gp-items-center gp-justify-center`,
46
- disabled: disabled,
47
- onClick: ()=>{
48
- if (type === 'next') setMoveToIdx(moveToIdx + 1);
49
- else setMoveToIdx(moveToIdx - 1);
50
- },
51
- children: /*#__PURE__*/ jsx("img", {
52
- src: imgSrc,
53
- alt: `gp-arrow-${type}`
54
- })
55
- });
56
- };
57
-
58
- export { ArrowPostPurchase };
@@ -1,76 +0,0 @@
1
- 'use client';
2
- import { jsx, Fragment } from 'react/jsx-runtime';
3
- import { useFeaturedImageGlobal, useProductStore } from '@gem-sdk/core';
4
- import PostPurchaseImage from '../../../image/components/Image.js';
5
- import { useCallback, useMemo } from 'react';
6
-
7
- const CarouselPostPurchase = (props)=>{
8
- const { productImages, moveToIdx, itemPerRow, ilBorder, ilAspectRatio, ilObjectFit } = props;
9
- const featuredImageGlobal = useFeaturedImageGlobal();
10
- const setProductFeaturedImage = useProductStore((s)=>s.setProductFeaturedImage);
11
- const list = useCallback(()=>{
12
- const temp = [
13
- ...productImages
14
- ];
15
- return temp?.splice(moveToIdx, itemPerRow);
16
- }, [
17
- productImages,
18
- itemPerRow,
19
- moveToIdx
20
- ]);
21
- const listRender = useMemo(()=>{
22
- const listItem = list();
23
- if (listItem.length < itemPerRow) {
24
- const temp = [
25
- ...productImages
26
- ];
27
- Array.from({
28
- length: itemPerRow - listItem.length
29
- }).forEach(()=>{
30
- temp.push(null);
31
- });
32
- return temp;
33
- }
34
- return listItem;
35
- }, [
36
- list,
37
- itemPerRow,
38
- productImages
39
- ]);
40
- return /*#__PURE__*/ jsx(Fragment, {
41
- children: listRender?.map((image, index)=>{
42
- if (!image) {
43
- return /*#__PURE__*/ jsx("div", {
44
- className: "gp-w-full"
45
- }, index);
46
- }
47
- const source = {
48
- src: image.src || 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
49
- alt: ''
50
- };
51
- return /*#__PURE__*/ jsx("div", {
52
- "aria-hidden": "true",
53
- className: `gp-w-full gp-border ${image?.id === featuredImageGlobal?.id && ilBorder !== 'none' ? '!gp-border-[#d9d9d9]' : 'gp-border-transparent'}`,
54
- onClick: ()=>{
55
- setProductFeaturedImage(image);
56
- },
57
- children: /*#__PURE__*/ jsx(PostPurchaseImage, {
58
- setting: {
59
- srcSet: {
60
- desktop: source,
61
- mobile: source,
62
- tablet: source
63
- }
64
- },
65
- styles: {
66
- aspectRatio: ilAspectRatio,
67
- objectFit: ilObjectFit,
68
- enableBorder: 'none'
69
- }
70
- }, image?.src)
71
- }, image.id);
72
- })
73
- });
74
- };
75
-
76
- export { CarouselPostPurchase };