@gem-sdk/components 2.0.0-dev.846 → 2.0.0-dev.849

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Text=require("../../text/components/Text.js");const CollectionTitle=({setting:e})=>{let t=core.useCollection();return jsxRuntime.jsx(Text.default,{styles:e,setting:{text:t?.title??"Collection title",excludeFlex:!0}})};exports.default=CollectionTitle;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Text=require("../../text/components/Text.js");const CollectionTitle=({setting:e})=>{let t=core.useCollection(),l=e?.htmlTag;return jsxRuntime.jsx(Text.default,{styles:e,setting:{text:t?.title??"Collection title",excludeFlex:!0,htmlTag:l}})};exports.default=CollectionTitle;
@@ -2,7 +2,7 @@
2
2
  <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M8.66634 5.16663C8.20611 5.16663 7.83301 5.53973 7.83301 5.99996V9.99996C7.83301 10.4602 8.20611 10.8333 8.66634 10.8333H9.99967C10.4599 10.8333 10.833 10.4602 10.833 9.99996V8.16663H18.4997V31.8333H16.6663C16.2062 31.8333 15.833 32.2064 15.833 32.6666V34C15.833 34.4601 16.2062 34.8333 16.6663 34.8333H23.333C23.7932 34.8333 24.1663 34.4601 24.1663 34V32.6666C24.1663 32.2064 23.7932 31.8333 23.333 31.8333H21.4997V8.16663H29.1663V9.99996C29.1663 10.4602 29.5395 10.8333 29.9997 10.8333H31.333C31.7932 10.8333 32.1663 10.4602 32.1663 9.99996V5.99996C32.1663 5.53972 31.7932 5.16663 31.333 5.16663H8.66634Z" fill="currentColor"/>
4
4
  </svg>
5
- `,settings:[{id:"setting",controls:[{id:"groupLineClamp",type:"group",label:"Title text",controls:[{id:"typo",type:"typography-v2",label:"Text Style",default:{type:"heading-1",attrs:{color:"text-2"}},ignoreReRender:!0}]},{id:"textAlign",label:"Align",type:"segment",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left"},{label:"Center",value:"center",type:"text",tooltip:"Align center"},{label:"Right",value:"right",type:"text",tooltip:"Align right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify"}],devices:{desktop:{default:"left"}}}]}],ui:[{label:{en:"Text"},type:"control",setting:{id:"typo"},layout:"vertical"},{type:"control",label:{en:"Align"},setting:{id:"textAlign"}}],editorConfigs:{placeholder:{flowPage:"GP_COLLECTION"}},presets:[{id:"collection-title",name:{en:"Collection Title"},icon:{desktop:`
5
+ `,settings:[{id:"setting",controls:[{id:"groupLineClamp",type:"group",label:"Title text",controls:[{id:"typo",type:"typography-v2",label:"Text Style",default:{type:"heading-1",attrs:{color:"text-2"}},ignoreReRender:!0}]},{id:"textAlign",label:"Align",type:"segment",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left"},{label:"Center",value:"center",type:"text",tooltip:"Align center"},{label:"Right",value:"right",type:"text",tooltip:"Align right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify"}],devices:{desktop:{default:"left"}}},{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"},{value:"div",label:"Div"}],default:"h1"}]}],ui:[{label:{en:"Text"},type:"control",setting:{id:"typo"},layout:"vertical"},{type:"control",label:{en:"Align"},setting:{id:"textAlign"}},{type:"group",label:{en:"SEO"},controls:[{type:"control",label:{en:"HTML tag"},setting:{id:"htmlTag"}}]}],editorConfigs:{placeholder:{flowPage:"GP_COLLECTION"}},presets:[{id:"collection-title",name:{en:"Collection Title"},icon:{desktop:`
6
6
  <svg width="94" height="48" viewBox="0 0 94 48" fill="none" xmlns="http://www.w3.org/2000/svg">
7
7
  <path d="M20.951 10.1477H19.1783C19.1101 9.76894 18.9832 9.43561 18.7976 9.14773C18.612 8.85985 18.3847 8.61553 18.1158 8.41477C17.8468 8.21401 17.5457 8.0625 17.2124 7.96023C16.8828 7.85795 16.5324 7.80682 16.1612 7.80682C15.4908 7.80682 14.8904 7.97538 14.3601 8.3125C13.8336 8.64962 13.4169 9.14394 13.1101 9.79545C12.8071 10.447 12.6555 11.2424 12.6555 12.1818C12.6555 13.1288 12.8071 13.928 13.1101 14.5795C13.4169 15.2311 13.8355 15.7235 14.3658 16.0568C14.8961 16.3902 15.4927 16.5568 16.1555 16.5568C16.523 16.5568 16.8714 16.5076 17.201 16.4091C17.5343 16.3068 17.8355 16.1572 18.1044 15.9602C18.3733 15.7633 18.6006 15.5227 18.7862 15.2386C18.9756 14.9508 19.1063 14.6212 19.1783 14.25L20.951 14.2557C20.8563 14.8277 20.6726 15.3542 20.3999 15.8352C20.1309 16.3125 19.7843 16.7254 19.3601 17.0739C18.9396 17.4186 18.4586 17.6856 17.9169 17.875C17.3752 18.0644 16.7843 18.1591 16.1442 18.1591C15.1366 18.1591 14.2389 17.9205 13.451 17.4432C12.6631 16.9621 12.0419 16.2746 11.5874 15.3807C11.1366 14.4867 10.9112 13.4205 10.9112 12.1818C10.9112 10.9394 11.1385 9.87311 11.593 8.98295C12.0476 8.08901 12.6688 7.40341 13.4567 6.92614C14.2446 6.44508 15.1404 6.20455 16.1442 6.20455C16.7616 6.20455 17.3374 6.29356 17.8714 6.47159C18.4093 6.64583 18.8923 6.90341 19.3203 7.24432C19.7483 7.58144 20.1025 7.99432 20.3828 8.48295C20.6631 8.9678 20.8525 9.52273 20.951 10.1477ZM26.5916 18.1761C25.7734 18.1761 25.0594 17.9886 24.4496 17.6136C23.8397 17.2386 23.3662 16.714 23.0291 16.0398C22.692 15.3655 22.5234 14.5777 22.5234 13.6761C22.5234 12.7708 22.692 11.9792 23.0291 11.3011C23.3662 10.6231 23.8397 10.0966 24.4496 9.72159C25.0594 9.34659 25.7734 9.15909 26.5916 9.15909C27.4098 9.15909 28.1238 9.34659 28.7337 9.72159C29.3435 10.0966 29.817 10.6231 30.1541 11.3011C30.4912 11.9792 30.6598 12.7708 30.6598 13.6761C30.6598 14.5777 30.4912 15.3655 30.1541 16.0398C29.817 16.714 29.3435 17.2386 28.7337 17.6136C28.1238 17.9886 27.4098 18.1761 26.5916 18.1761ZM26.5973 16.75C27.1276 16.75 27.567 16.6098 27.9155 16.3295C28.264 16.0492 28.5215 15.6761 28.6882 15.2102C28.8587 14.7443 28.9439 14.2311 28.9439 13.6705C28.9439 13.1136 28.8587 12.6023 28.6882 12.1364C28.5215 11.6667 28.264 11.2898 27.9155 11.0057C27.567 10.7216 27.1276 10.5795 26.5973 10.5795C26.0632 10.5795 25.62 10.7216 25.2678 11.0057C24.9193 11.2898 24.6598 11.6667 24.4893 12.1364C24.3227 12.6023 24.2393 13.1136 24.2393 13.6705C24.2393 14.2311 24.3227 14.7443 24.4893 15.2102C24.6598 15.6761 24.9193 16.0492 25.2678 16.3295C25.62 16.6098 26.0632 16.75 26.5973 16.75ZM34.255 6.36364V18H32.5561V6.36364H34.255ZM38.2393 6.36364V18H36.5405V6.36364H38.2393ZM44.2862 18.1761C43.4264 18.1761 42.6858 17.9924 42.0646 17.625C41.4472 17.2538 40.9699 16.733 40.6328 16.0625C40.2995 15.3883 40.1328 14.5985 40.1328 13.6932C40.1328 12.7992 40.2995 12.0114 40.6328 11.3295C40.9699 10.6477 41.4396 10.1155 42.0419 9.73295C42.648 9.35038 43.3563 9.15909 44.1669 9.15909C44.6593 9.15909 45.1366 9.24053 45.5987 9.40341C46.0608 9.56629 46.4756 9.82197 46.843 10.1705C47.2105 10.5189 47.5002 10.9716 47.7124 11.5284C47.9245 12.0814 48.0305 12.7538 48.0305 13.5455V14.1477H41.093V12.875H46.3658C46.3658 12.428 46.2749 12.0322 46.093 11.6875C45.9112 11.339 45.6555 11.0644 45.326 10.8636C45.0002 10.6629 44.6177 10.5625 44.1783 10.5625C43.701 10.5625 43.2843 10.6799 42.9283 10.9148C42.576 11.1458 42.3033 11.4489 42.1101 11.8239C41.9207 12.1951 41.826 12.5985 41.826 13.0341V14.0284C41.826 14.6117 41.9283 15.108 42.1328 15.517C42.3411 15.9261 42.6309 16.2386 43.0021 16.4545C43.3733 16.6667 43.8071 16.7727 44.3033 16.7727C44.6252 16.7727 44.9188 16.7273 45.1839 16.6364C45.4491 16.5417 45.6783 16.4015 45.8714 16.2159C46.0646 16.0303 46.2124 15.8011 46.3146 15.5284L47.9226 15.8182C47.7938 16.2917 47.5627 16.7064 47.2294 17.0625C46.8999 17.4148 46.4851 17.6894 45.9851 17.8864C45.4889 18.0795 44.9226 18.1761 44.2862 18.1761ZM53.5916 18.1761C52.7469 18.1761 52.0196 17.9848 51.4098 17.6023C50.8037 17.2159 50.3378 16.6837 50.0121 16.0057C49.6863 15.3277 49.5234 14.5511 49.5234 13.6761C49.5234 12.7898 49.6901 12.0076 50.0234 11.3295C50.3568 10.6477 50.8265 10.1155 51.4325 9.73295C52.0386 9.35038 52.7526 9.15909 53.5746 9.15909C54.2375 9.15909 54.8284 9.2822 55.3473 9.52841C55.8662 9.77083 56.2848 10.1117 56.603 10.5511C56.925 10.9905 57.1162 11.5038 57.1768 12.0909H55.5234C55.4325 11.6818 55.2242 11.3295 54.8984 11.0341C54.5765 10.7386 54.1446 10.5909 53.603 10.5909C53.1295 10.5909 52.7147 10.7159 52.3587 10.9659C52.0064 11.2121 51.7318 11.5644 51.5348 12.0227C51.3378 12.4773 51.2393 13.0152 51.2393 13.6364C51.2393 14.2727 51.3359 14.822 51.5291 15.2841C51.7223 15.7462 51.995 16.1042 52.3473 16.358C52.7034 16.6117 53.1219 16.7386 53.603 16.7386C53.925 16.7386 54.2166 16.6799 54.478 16.5625C54.7431 16.4413 54.9647 16.2689 55.1428 16.0455C55.3246 15.822 55.4515 15.553 55.5234 15.2386H57.1768C57.1162 15.803 56.9325 16.3068 56.6257 16.75C56.3189 17.1932 55.9079 17.5417 55.3928 17.7955C54.8814 18.0492 54.281 18.1761 53.5916 18.1761ZM63.0675 9.27273V10.6364H58.3004V9.27273H63.0675ZM59.5788 7.18182H61.2777V15.4375C61.2777 15.767 61.3269 16.0152 61.4254 16.1818C61.5239 16.3447 61.6508 16.4564 61.8061 16.517C61.9652 16.5739 62.1375 16.6023 62.3232 16.6023C62.4595 16.6023 62.5788 16.5928 62.6811 16.5739C62.7834 16.5549 62.8629 16.5398 62.9197 16.5284L63.2266 17.9318C63.1281 17.9697 62.9879 18.0076 62.8061 18.0455C62.6243 18.0871 62.397 18.1098 62.1243 18.1136C61.6773 18.1212 61.2607 18.0417 60.8743 17.875C60.4879 17.7083 60.1754 17.4508 59.9368 17.1023C59.6982 16.7538 59.5788 16.3163 59.5788 15.7898V7.18182ZM64.9467 18V9.27273H66.6456V18H64.9467ZM65.8047 7.92614C65.5092 7.92614 65.2554 7.82765 65.0433 7.63068C64.835 7.42992 64.7308 7.19129 64.7308 6.91477C64.7308 6.63447 64.835 6.39583 65.0433 6.19886C65.2554 5.99811 65.5092 5.89773 65.8047 5.89773C66.1001 5.89773 66.352 5.99811 66.5604 6.19886C66.7725 6.39583 66.8786 6.63447 66.8786 6.91477C66.8786 7.19129 66.7725 7.42992 66.5604 7.63068C66.352 7.82765 66.1001 7.92614 65.8047 7.92614ZM72.6072 18.1761C71.7891 18.1761 71.075 17.9886 70.4652 17.6136C69.8554 17.2386 69.3819 16.714 69.0447 16.0398C68.7076 15.3655 68.5391 14.5777 68.5391 13.6761C68.5391 12.7708 68.7076 11.9792 69.0447 11.3011C69.3819 10.6231 69.8554 10.0966 70.4652 9.72159C71.075 9.34659 71.7891 9.15909 72.6072 9.15909C73.4254 9.15909 74.1394 9.34659 74.7493 9.72159C75.3591 10.0966 75.8326 10.6231 76.1697 11.3011C76.5069 11.9792 76.6754 12.7708 76.6754 13.6761C76.6754 14.5777 76.5069 15.3655 76.1697 16.0398C75.8326 16.714 75.3591 17.2386 74.7493 17.6136C74.1394 17.9886 73.4254 18.1761 72.6072 18.1761ZM72.6129 16.75C73.1432 16.75 73.5826 16.6098 73.9311 16.3295C74.2796 16.0492 74.5372 15.6761 74.7038 15.2102C74.8743 14.7443 74.9595 14.2311 74.9595 13.6705C74.9595 13.1136 74.8743 12.6023 74.7038 12.1364C74.5372 11.6667 74.2796 11.2898 73.9311 11.0057C73.5826 10.7216 73.1432 10.5795 72.6129 10.5795C72.0788 10.5795 71.6357 10.7216 71.2834 11.0057C70.9349 11.2898 70.6754 11.6667 70.505 12.1364C70.3383 12.6023 70.255 13.1136 70.255 13.6705C70.255 14.2311 70.3383 14.7443 70.505 15.2102C70.6754 15.6761 70.9349 16.0492 71.2834 16.3295C71.6357 16.6098 72.0788 16.75 72.6129 16.75ZM80.2706 12.8182V18H78.5717V9.27273H80.2024V10.6932H80.3104C80.5111 10.2311 80.8255 9.85985 81.2536 9.57955C81.6854 9.29924 82.2289 9.15909 82.8842 9.15909C83.4789 9.15909 83.9998 9.28409 84.4467 9.53409C84.8937 9.7803 85.2403 10.1477 85.4865 10.6364C85.7327 11.125 85.8558 11.7292 85.8558 12.4489V18H84.157V12.6534C84.157 12.0208 83.9922 11.5265 83.6626 11.1705C83.3331 10.8106 82.8804 10.6307 82.3047 10.6307C81.9107 10.6307 81.5604 10.7159 81.2536 10.8864C80.9505 11.0568 80.71 11.3068 80.532 11.6364C80.3577 11.9621 80.2706 12.3561 80.2706 12.8182ZM32.2436 31.875V30.3636H41.2493V31.875H37.6186V42H35.8686V31.875H32.2436ZM43.103 42V33.2727H44.8018V42H43.103ZM43.9609 31.9261C43.6655 31.9261 43.4117 31.8277 43.1996 31.6307C42.9912 31.4299 42.8871 31.1913 42.8871 30.9148C42.8871 30.6345 42.9912 30.3958 43.1996 30.1989C43.4117 29.9981 43.6655 29.8977 43.9609 29.8977C44.2564 29.8977 44.5083 29.9981 44.7166 30.1989C44.9287 30.3958 45.0348 30.6345 45.0348 30.9148C45.0348 31.1913 44.9287 31.4299 44.7166 31.6307C44.5083 31.8277 44.2564 31.9261 43.9609 31.9261ZM51.1612 33.2727V34.6364H46.3942V33.2727H51.1612ZM47.6726 31.1818H49.3714V39.4375C49.3714 39.767 49.4207 40.0152 49.5192 40.1818C49.6177 40.3447 49.7446 40.4564 49.8999 40.517C50.0589 40.5739 50.2313 40.6023 50.4169 40.6023C50.5533 40.6023 50.6726 40.5928 50.7749 40.5739C50.8771 40.5549 50.9567 40.5398 51.0135 40.5284L51.3203 41.9318C51.2218 41.9697 51.0817 42.0076 50.8999 42.0455C50.718 42.0871 50.4908 42.1098 50.218 42.1136C49.7711 42.1212 49.3544 42.0417 48.968 41.875C48.5817 41.7083 48.2692 41.4508 48.0305 41.1023C47.7919 40.7538 47.6726 40.3163 47.6726 39.7898V31.1818ZM54.9268 30.3636V42H53.228V30.3636H54.9268ZM60.9737 42.1761C60.1139 42.1761 59.3733 41.9924 58.7521 41.625C58.1347 41.2538 57.6574 40.733 57.3203 40.0625C56.987 39.3883 56.8203 38.5985 56.8203 37.6932C56.8203 36.7992 56.987 36.0114 57.3203 35.3295C57.6574 34.6477 58.1271 34.1155 58.7294 33.733C59.3355 33.3504 60.0438 33.1591 60.8544 33.1591C61.3468 33.1591 61.8241 33.2405 62.2862 33.4034C62.7483 33.5663 63.1631 33.822 63.5305 34.1705C63.898 34.5189 64.1877 34.9716 64.3999 35.5284C64.612 36.0814 64.718 36.7538 64.718 37.5455V38.1477H57.7805V36.875H63.0533C63.0533 36.428 62.9624 36.0322 62.7805 35.6875C62.5987 35.339 62.343 35.0644 62.0135 34.8636C61.6877 34.6629 61.3052 34.5625 60.8658 34.5625C60.3885 34.5625 59.9718 34.6799 59.6158 34.9148C59.2635 35.1458 58.9908 35.4489 58.7976 35.8239C58.6082 36.1951 58.5135 36.5985 58.5135 37.0341V38.0284C58.5135 38.6117 58.6158 39.108 58.8203 39.517C59.0286 39.9261 59.3184 40.2386 59.6896 40.4545C60.0608 40.6667 60.4946 40.7727 60.9908 40.7727C61.3127 40.7727 61.6063 40.7273 61.8714 40.6364C62.1366 40.5417 62.3658 40.4015 62.5589 40.2159C62.7521 40.0303 62.8999 39.8011 63.0021 39.5284L64.6101 39.8182C64.4813 40.2917 64.2502 40.7064 63.9169 41.0625C63.5874 41.4148 63.1726 41.6894 62.6726 41.8864C62.1764 42.0795 61.6101 42.1761 60.9737 42.1761Z" fill="#F9F9F9"/>
8
8
  </svg>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../grid/components/ChildrenDroppable.js"),Loading=require("../../common/components/Loading.js"),react=require("react"),Row=require("../../grid/components/Row.js"),dynamic=require("next/dynamic");const ProductNotFound=dynamic(()=>Promise.resolve().then(function(){return require("./ProductNotFound.js")}),{loading:Loading.default}),Product=({children:e,setting:r,styles:t,style:i,builderAttrs:d})=>{let{productSetting:o,quantity:u,readOnly:n,isAuto:s,isSyncProduct:c,...a}=r??{},{...l}=t??{},m=core.usePageType(),j=core.usePageStore(e=>e.dynamicProduct),x=o?.productStatus=="dynamic"?j??{}:{};return"PRODUCT"===m&&s?jsxRuntime.jsx(jsxRuntime.Fragment,{children:core.isEmptyChildren(e)?jsxRuntime.jsx(ChildrenDroppable.default,{}):e}):jsxRuntime.jsx(LocalProduct,{builderAttrs:d,rowSetting:a,rowStyles:l,style:i,productSetting:{...o,...x},quantity:u,readOnly:n,isSyncProduct:c,children:e})},LocalProduct=({children:e,productSetting:r,quantity:t,readOnly:i,rowSetting:d,style:o,rowStyles:u,builderAttrs:n,isSyncProduct:s})=>{let c=r?.productId??"latest",a=r?.initialVariantId,{data:l,isLoading:m,error:j}=core.useProductQuery(c),[x,p]=react.useState(!0),P=core.useEditorMode();return!j&&(l||m)||"edit"!==P?jsxRuntime.jsx(jsxRuntime.Fragment,{children:m?jsxRuntime.jsx(Loading.default,{}):j?jsxRuntime.jsxs("div",{children:["Error: ",j?.message]}):l?jsxRuntime.jsx(core.ProductProvider,{product:l,initialVariantId:a,quantity:t,readOnly:i,isSyncProduct:s,children:jsxRuntime.jsx(Row.default,{builderAttrs:n,style:o,setting:d,styles:u,..."edit"===P?{"data-product-id":l?.baseID?.replace("gid://shopify/Product/","")}:{},children:core.isEmptyChildren(e)?jsxRuntime.jsx(ChildrenDroppable.default,{}):e})},`uid-${l.id}-${a??""}`):null}):x?jsxRuntime.jsx(ProductNotFound,{builderAttrs:n,productSrc:"PickProduct",onClose:()=>p(!1),children:e}):null};exports.default=Product;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../grid/components/ChildrenDroppable.js"),Loading=require("../../common/components/Loading.js"),react=require("react"),Row=require("../../grid/components/Row.js"),dynamic=require("next/dynamic"),index=require("../../post-purchase/product/helpers/index.js");const ProductNotFound=dynamic(()=>Promise.resolve().then(function(){return require("./ProductNotFound.js")}),{loading:Loading.default}),Product=({children:e,setting:r,styles:t,style:o,builderAttrs:i})=>{let{productSetting:d,quantity:u,readOnly:n,isAuto:s,isSyncProduct:c,...a}=r??{},{...l}=t??{},m=core.usePageType(),x=core.usePageStore(e=>e.dynamicProduct),j=d?.productStatus=="dynamic"?x??{}:{};return"PRODUCT"===m&&s?jsxRuntime.jsx(jsxRuntime.Fragment,{children:core.isEmptyChildren(e)?jsxRuntime.jsx(ChildrenDroppable.default,{}):e}):jsxRuntime.jsx(LocalProduct,{builderAttrs:i,rowSetting:a,rowStyles:l,style:o,productSetting:{...d,...j},quantity:u,readOnly:n,isSyncProduct:c,children:e})},LocalProduct=({children:e,productSetting:r,quantity:t,readOnly:o,rowSetting:i,style:d,rowStyles:u,builderAttrs:n,isSyncProduct:s})=>{let c=r?.productId??"latest",a=r?.initialVariantId,l=core.usePageStore(e=>e.publicStoreFrontData),m=react.useMemo(()=>index.hasPublicStoreFrontData(l)?index.createStoreFrontFetcher(l):void 0,[l]),{data:x,isLoading:j,error:p}=core.useProductQuery(c,void 0,m),[P,h]=react.useState(!0),g=core.useEditorMode();return!p&&(x||j)||"edit"!==g?jsxRuntime.jsx(jsxRuntime.Fragment,{children:j?jsxRuntime.jsx(Loading.default,{}):p?jsxRuntime.jsxs("div",{children:["Error: ",p?.message]}):x?jsxRuntime.jsx(core.ProductProvider,{product:x,initialVariantId:a,quantity:t,readOnly:o,isSyncProduct:s,children:jsxRuntime.jsx(Row.default,{builderAttrs:n,style:d,setting:i,styles:u,..."edit"===g?{"data-product-id":x?.baseID?.replace("gid://shopify/Product/","")}:{},children:core.isEmptyChildren(e)?jsxRuntime.jsx(ChildrenDroppable.default,{}):e})},`uid-${x.id}-${a??""}`):null}):P?jsxRuntime.jsx(ProductNotFound,{builderAttrs:n,productSrc:"PickProduct",onClose:()=>h(!1),children:e}):null};exports.default=Product;
@@ -67,7 +67,7 @@ ${core.RenderIf(core.isLocalEnv,'<script src="{{ \'gp-product.v2.js\' | asset_ur
67
67
  assign target_collection = null
68
68
  assign productSrc = '${u}'
69
69
  assign c = 0
70
- assign limit = ${f&&"latest"==p?a?.numOfSelectedProducts||4:m}
70
+ assign limit = ${f&&"latest"===p?"RelatedProduct"===u?m:a?.numOfSelectedProducts||4:m}
71
71
  if request.page_type == 'collection' or preview_page_type == 'collection'
72
72
  assign target_collection = collection
73
73
  if target_collection == empty or target_collection == null
@@ -94,86 +94,90 @@ ${core.RenderIf(core.isLocalEnv,'<script src="{{ \'gp-product.v2.js\' | asset_ur
94
94
  assign idAssignProduct = assignProduct.id
95
95
  assign allProducts = collections.all.products
96
96
 
97
- if relatedTag == 'collection'
98
- for collection in collections
99
- assign collectionId = collection.id
100
- assign isInCollection = false
101
- assign collectionsAssignProduct = assignProduct.collections
102
- for item in collectionsAssignProduct
103
- if item.id == collectionId
104
- assign isInCollection = true
97
+ if relatedTag == 'collection'
98
+ for collection in collections
99
+ assign collectionId = collection.id
100
+ assign isInCollection = false
101
+ assign collectionsAssignProduct = assignProduct.collections
102
+ for item in collectionsAssignProduct
103
+ if item.id == collectionId
104
+ assign isInCollection = true
105
+ endif
106
+ endfor
107
+ if isInCollection
108
+ for item in allProducts
109
+ assign handle = item.handle
110
+ assign productF = all_products[handle] | sort
111
+ assign idOfProduct = all_products[handle].id
112
+ for product in collection.products
113
+ assign productCollectionId = product.id
114
+ unless arrayListProducts contains handle
115
+ if productCollectionId == idOfProduct and idAssignProduct != idOfProduct
116
+ assign products = products | concat: productF
117
+ if stringListProducts.size > 0
118
+ assign stringListProducts = stringListProducts | append: ', '
119
+ endif
120
+ assign stringListProducts = stringListProducts | append: handle
121
+ assign arrayListProducts = stringListProducts | split: ", "
122
+ endif
123
+ endunless
124
+ endfor
125
+ endfor
105
126
  endif
106
127
  endfor
107
- if isInCollection
108
- for item in allProducts
109
- assign handle = item.handle
110
- assign productF = all_products[handle] | sort
111
- assign idOfProduct = all_products[handle].id
112
- for product in collection.products
113
- assign productCollectionId = product.id
114
- unless arrayListProducts contains handle
115
- if productCollectionId == idOfProduct and idAssignProduct != idOfProduct
116
- assign products = products | concat: productF
117
- if stringListProducts.size > 0
118
- assign stringListProducts = stringListProducts | append: ', '
119
- endif
120
- assign stringListProducts = stringListProducts | append: handle
121
- assign arrayListProducts = stringListProducts | split: ", "
122
- endif
123
- endunless
124
- endfor
125
- endfor
126
- endif
127
- endfor
128
- endif
129
-
130
- if relatedTag == 'vendor'
131
- assign vendorAssignProduct = assignProduct.vendor
132
- for item in allProducts
133
- assign handle = item.handle
134
- assign productF = all_products[handle] | sort
135
- assign vendorOfProduct = all_products[handle].vendor
136
- assign idOfProduct = all_products[handle].id
137
- if vendorOfProduct == vendorAssignProduct and idAssignProduct != idOfProduct
138
- assign products = products | concat: productF
139
- endif
140
- endfor
141
- endif
128
+ endif
142
129
 
143
- if relatedTag == 'production-type'
144
- assign typeAssignProduct = assignProduct.type
145
- for item in allProducts
146
- assign handle = item.handle
147
- assign productF = all_products[handle] | sort
148
- assign typeOfProduct = all_products[handle].type
149
- assign idOfProduct = all_products[handle].id
150
- if typeOfProduct == typeAssignProduct and idAssignProduct != idOfProduct
151
- assign products = products | concat: productF
152
- endif
153
- endfor
154
- endif
155
- if relatedTag == 'tags'
156
- assign tagsAssignProduct = assignProduct.tags
157
- for item in allProducts
158
- assign handle = item.handle
159
- assign productF = all_products[handle] | sort
160
- assign tagsOfProduct = all_products[handle].tags
130
+ if relatedTag == 'vendor'
131
+ assign vendorAssignProduct = assignProduct.vendor
132
+ for item in allProducts
133
+ assign handle = item.handle
134
+ assign productF = all_products[handle] | sort
135
+ assign vendorOfProduct = all_products[handle].vendor
161
136
  assign idOfProduct = all_products[handle].id
162
- for tag in tagsAssignProduct
163
- assign tagItem = tag
164
- unless arrayListProducts contains handle
165
- if tagsOfProduct contains tagItem and idAssignProduct != idOfProduct
166
- assign products = products | concat: productF
167
- if stringListProducts.size > 0
168
- assign stringListProducts = stringListProducts | append: ', '
169
- endif
170
- assign stringListProducts = stringListProducts | append: handle
171
- assign arrayListProducts = stringListProducts | split: ", "
172
- endif
173
- endunless
174
- endfor
175
- endfor
176
- endif
137
+ if vendorOfProduct == vendorAssignProduct and idAssignProduct != idOfProduct
138
+ assign products = products | concat: productF
139
+ endif
140
+ endfor
141
+ endif
142
+
143
+ if relatedTag == 'production-type'
144
+ assign typeAssignProduct = assignProduct.type
145
+ for item in allProducts
146
+ assign handle = item.handle
147
+ assign productF = all_products[handle] | sort
148
+ assign typeOfProduct = all_products[handle].type
149
+ assign idOfProduct = all_products[handle].id
150
+ if typeOfProduct == typeAssignProduct and idAssignProduct != idOfProduct
151
+ assign products = products | concat: productF
152
+ endif
153
+ endfor
154
+ endif
155
+
156
+ if relatedTag == 'tags'
157
+ assign tagsAssignProduct = assignProduct.tags
158
+ for item in allProducts
159
+ assign handle = item.handle
160
+ assign productF = all_products[handle] | sort
161
+ assign tagsOfProduct = all_products[handle].tags
162
+ assign idOfProduct = all_products[handle].id
163
+ for tag in tagsAssignProduct
164
+ assign tagItem = tag
165
+ unless arrayListProducts contains handle
166
+ if tagsOfProduct contains tagItem and idAssignProduct != idOfProduct
167
+ assign products = products | concat: productF
168
+ if stringListProducts.size > 0
169
+ assign stringListProducts = stringListProducts | append: ', '
170
+ endif
171
+ assign stringListProducts = stringListProducts | append: handle
172
+ assign arrayListProducts = stringListProducts | split: ", "
173
+ endif
174
+ endunless
175
+ endfor
176
+ endfor
177
+ endif
178
+ paginate products by ${m||4}
179
+ assign products = products
180
+ endpaginate
177
181
  else if productSrc == 'PickProduct'
178
182
  unless ${g}
179
183
  assign products = null | sort
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useCollection as e}from"@gem-sdk/core";import l from"../../text/components/Text.js";let CollectionTitle=({setting:o})=>{let i=e();return t(l,{styles:o,setting:{text:i?.title??"Collection title",excludeFlex:!0}})};export{CollectionTitle as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{useCollection as e}from"@gem-sdk/core";import l from"../../text/components/Text.js";let CollectionTitle=({setting:o})=>{let i=e(),r=o?.htmlTag;return t(l,{styles:o,setting:{text:i?.title??"Collection title",excludeFlex:!0,htmlTag:r}})};export{CollectionTitle as default};
@@ -2,7 +2,7 @@ let config={tag:"CollectionTitle",label:"Collection Title",icon:`
2
2
  <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M8.66634 5.16663C8.20611 5.16663 7.83301 5.53973 7.83301 5.99996V9.99996C7.83301 10.4602 8.20611 10.8333 8.66634 10.8333H9.99967C10.4599 10.8333 10.833 10.4602 10.833 9.99996V8.16663H18.4997V31.8333H16.6663C16.2062 31.8333 15.833 32.2064 15.833 32.6666V34C15.833 34.4601 16.2062 34.8333 16.6663 34.8333H23.333C23.7932 34.8333 24.1663 34.4601 24.1663 34V32.6666C24.1663 32.2064 23.7932 31.8333 23.333 31.8333H21.4997V8.16663H29.1663V9.99996C29.1663 10.4602 29.5395 10.8333 29.9997 10.8333H31.333C31.7932 10.8333 32.1663 10.4602 32.1663 9.99996V5.99996C32.1663 5.53972 31.7932 5.16663 31.333 5.16663H8.66634Z" fill="currentColor"/>
4
4
  </svg>
5
- `,settings:[{id:"setting",controls:[{id:"groupLineClamp",type:"group",label:"Title text",controls:[{id:"typo",type:"typography-v2",label:"Text Style",default:{type:"heading-1",attrs:{color:"text-2"}},ignoreReRender:!0}]},{id:"textAlign",label:"Align",type:"segment",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left"},{label:"Center",value:"center",type:"text",tooltip:"Align center"},{label:"Right",value:"right",type:"text",tooltip:"Align right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify"}],devices:{desktop:{default:"left"}}}]}],ui:[{label:{en:"Text"},type:"control",setting:{id:"typo"},layout:"vertical"},{type:"control",label:{en:"Align"},setting:{id:"textAlign"}}],editorConfigs:{placeholder:{flowPage:"GP_COLLECTION"}},presets:[{id:"collection-title",name:{en:"Collection Title"},icon:{desktop:`
5
+ `,settings:[{id:"setting",controls:[{id:"groupLineClamp",type:"group",label:"Title text",controls:[{id:"typo",type:"typography-v2",label:"Text Style",default:{type:"heading-1",attrs:{color:"text-2"}},ignoreReRender:!0}]},{id:"textAlign",label:"Align",type:"segment",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left"},{label:"Center",value:"center",type:"text",tooltip:"Align center"},{label:"Right",value:"right",type:"text",tooltip:"Align right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify"}],devices:{desktop:{default:"left"}}},{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"},{value:"div",label:"Div"}],default:"h1"}]}],ui:[{label:{en:"Text"},type:"control",setting:{id:"typo"},layout:"vertical"},{type:"control",label:{en:"Align"},setting:{id:"textAlign"}},{type:"group",label:{en:"SEO"},controls:[{type:"control",label:{en:"HTML tag"},setting:{id:"htmlTag"}}]}],editorConfigs:{placeholder:{flowPage:"GP_COLLECTION"}},presets:[{id:"collection-title",name:{en:"Collection Title"},icon:{desktop:`
6
6
  <svg width="94" height="48" viewBox="0 0 94 48" fill="none" xmlns="http://www.w3.org/2000/svg">
7
7
  <path d="M20.951 10.1477H19.1783C19.1101 9.76894 18.9832 9.43561 18.7976 9.14773C18.612 8.85985 18.3847 8.61553 18.1158 8.41477C17.8468 8.21401 17.5457 8.0625 17.2124 7.96023C16.8828 7.85795 16.5324 7.80682 16.1612 7.80682C15.4908 7.80682 14.8904 7.97538 14.3601 8.3125C13.8336 8.64962 13.4169 9.14394 13.1101 9.79545C12.8071 10.447 12.6555 11.2424 12.6555 12.1818C12.6555 13.1288 12.8071 13.928 13.1101 14.5795C13.4169 15.2311 13.8355 15.7235 14.3658 16.0568C14.8961 16.3902 15.4927 16.5568 16.1555 16.5568C16.523 16.5568 16.8714 16.5076 17.201 16.4091C17.5343 16.3068 17.8355 16.1572 18.1044 15.9602C18.3733 15.7633 18.6006 15.5227 18.7862 15.2386C18.9756 14.9508 19.1063 14.6212 19.1783 14.25L20.951 14.2557C20.8563 14.8277 20.6726 15.3542 20.3999 15.8352C20.1309 16.3125 19.7843 16.7254 19.3601 17.0739C18.9396 17.4186 18.4586 17.6856 17.9169 17.875C17.3752 18.0644 16.7843 18.1591 16.1442 18.1591C15.1366 18.1591 14.2389 17.9205 13.451 17.4432C12.6631 16.9621 12.0419 16.2746 11.5874 15.3807C11.1366 14.4867 10.9112 13.4205 10.9112 12.1818C10.9112 10.9394 11.1385 9.87311 11.593 8.98295C12.0476 8.08901 12.6688 7.40341 13.4567 6.92614C14.2446 6.44508 15.1404 6.20455 16.1442 6.20455C16.7616 6.20455 17.3374 6.29356 17.8714 6.47159C18.4093 6.64583 18.8923 6.90341 19.3203 7.24432C19.7483 7.58144 20.1025 7.99432 20.3828 8.48295C20.6631 8.9678 20.8525 9.52273 20.951 10.1477ZM26.5916 18.1761C25.7734 18.1761 25.0594 17.9886 24.4496 17.6136C23.8397 17.2386 23.3662 16.714 23.0291 16.0398C22.692 15.3655 22.5234 14.5777 22.5234 13.6761C22.5234 12.7708 22.692 11.9792 23.0291 11.3011C23.3662 10.6231 23.8397 10.0966 24.4496 9.72159C25.0594 9.34659 25.7734 9.15909 26.5916 9.15909C27.4098 9.15909 28.1238 9.34659 28.7337 9.72159C29.3435 10.0966 29.817 10.6231 30.1541 11.3011C30.4912 11.9792 30.6598 12.7708 30.6598 13.6761C30.6598 14.5777 30.4912 15.3655 30.1541 16.0398C29.817 16.714 29.3435 17.2386 28.7337 17.6136C28.1238 17.9886 27.4098 18.1761 26.5916 18.1761ZM26.5973 16.75C27.1276 16.75 27.567 16.6098 27.9155 16.3295C28.264 16.0492 28.5215 15.6761 28.6882 15.2102C28.8587 14.7443 28.9439 14.2311 28.9439 13.6705C28.9439 13.1136 28.8587 12.6023 28.6882 12.1364C28.5215 11.6667 28.264 11.2898 27.9155 11.0057C27.567 10.7216 27.1276 10.5795 26.5973 10.5795C26.0632 10.5795 25.62 10.7216 25.2678 11.0057C24.9193 11.2898 24.6598 11.6667 24.4893 12.1364C24.3227 12.6023 24.2393 13.1136 24.2393 13.6705C24.2393 14.2311 24.3227 14.7443 24.4893 15.2102C24.6598 15.6761 24.9193 16.0492 25.2678 16.3295C25.62 16.6098 26.0632 16.75 26.5973 16.75ZM34.255 6.36364V18H32.5561V6.36364H34.255ZM38.2393 6.36364V18H36.5405V6.36364H38.2393ZM44.2862 18.1761C43.4264 18.1761 42.6858 17.9924 42.0646 17.625C41.4472 17.2538 40.9699 16.733 40.6328 16.0625C40.2995 15.3883 40.1328 14.5985 40.1328 13.6932C40.1328 12.7992 40.2995 12.0114 40.6328 11.3295C40.9699 10.6477 41.4396 10.1155 42.0419 9.73295C42.648 9.35038 43.3563 9.15909 44.1669 9.15909C44.6593 9.15909 45.1366 9.24053 45.5987 9.40341C46.0608 9.56629 46.4756 9.82197 46.843 10.1705C47.2105 10.5189 47.5002 10.9716 47.7124 11.5284C47.9245 12.0814 48.0305 12.7538 48.0305 13.5455V14.1477H41.093V12.875H46.3658C46.3658 12.428 46.2749 12.0322 46.093 11.6875C45.9112 11.339 45.6555 11.0644 45.326 10.8636C45.0002 10.6629 44.6177 10.5625 44.1783 10.5625C43.701 10.5625 43.2843 10.6799 42.9283 10.9148C42.576 11.1458 42.3033 11.4489 42.1101 11.8239C41.9207 12.1951 41.826 12.5985 41.826 13.0341V14.0284C41.826 14.6117 41.9283 15.108 42.1328 15.517C42.3411 15.9261 42.6309 16.2386 43.0021 16.4545C43.3733 16.6667 43.8071 16.7727 44.3033 16.7727C44.6252 16.7727 44.9188 16.7273 45.1839 16.6364C45.4491 16.5417 45.6783 16.4015 45.8714 16.2159C46.0646 16.0303 46.2124 15.8011 46.3146 15.5284L47.9226 15.8182C47.7938 16.2917 47.5627 16.7064 47.2294 17.0625C46.8999 17.4148 46.4851 17.6894 45.9851 17.8864C45.4889 18.0795 44.9226 18.1761 44.2862 18.1761ZM53.5916 18.1761C52.7469 18.1761 52.0196 17.9848 51.4098 17.6023C50.8037 17.2159 50.3378 16.6837 50.0121 16.0057C49.6863 15.3277 49.5234 14.5511 49.5234 13.6761C49.5234 12.7898 49.6901 12.0076 50.0234 11.3295C50.3568 10.6477 50.8265 10.1155 51.4325 9.73295C52.0386 9.35038 52.7526 9.15909 53.5746 9.15909C54.2375 9.15909 54.8284 9.2822 55.3473 9.52841C55.8662 9.77083 56.2848 10.1117 56.603 10.5511C56.925 10.9905 57.1162 11.5038 57.1768 12.0909H55.5234C55.4325 11.6818 55.2242 11.3295 54.8984 11.0341C54.5765 10.7386 54.1446 10.5909 53.603 10.5909C53.1295 10.5909 52.7147 10.7159 52.3587 10.9659C52.0064 11.2121 51.7318 11.5644 51.5348 12.0227C51.3378 12.4773 51.2393 13.0152 51.2393 13.6364C51.2393 14.2727 51.3359 14.822 51.5291 15.2841C51.7223 15.7462 51.995 16.1042 52.3473 16.358C52.7034 16.6117 53.1219 16.7386 53.603 16.7386C53.925 16.7386 54.2166 16.6799 54.478 16.5625C54.7431 16.4413 54.9647 16.2689 55.1428 16.0455C55.3246 15.822 55.4515 15.553 55.5234 15.2386H57.1768C57.1162 15.803 56.9325 16.3068 56.6257 16.75C56.3189 17.1932 55.9079 17.5417 55.3928 17.7955C54.8814 18.0492 54.281 18.1761 53.5916 18.1761ZM63.0675 9.27273V10.6364H58.3004V9.27273H63.0675ZM59.5788 7.18182H61.2777V15.4375C61.2777 15.767 61.3269 16.0152 61.4254 16.1818C61.5239 16.3447 61.6508 16.4564 61.8061 16.517C61.9652 16.5739 62.1375 16.6023 62.3232 16.6023C62.4595 16.6023 62.5788 16.5928 62.6811 16.5739C62.7834 16.5549 62.8629 16.5398 62.9197 16.5284L63.2266 17.9318C63.1281 17.9697 62.9879 18.0076 62.8061 18.0455C62.6243 18.0871 62.397 18.1098 62.1243 18.1136C61.6773 18.1212 61.2607 18.0417 60.8743 17.875C60.4879 17.7083 60.1754 17.4508 59.9368 17.1023C59.6982 16.7538 59.5788 16.3163 59.5788 15.7898V7.18182ZM64.9467 18V9.27273H66.6456V18H64.9467ZM65.8047 7.92614C65.5092 7.92614 65.2554 7.82765 65.0433 7.63068C64.835 7.42992 64.7308 7.19129 64.7308 6.91477C64.7308 6.63447 64.835 6.39583 65.0433 6.19886C65.2554 5.99811 65.5092 5.89773 65.8047 5.89773C66.1001 5.89773 66.352 5.99811 66.5604 6.19886C66.7725 6.39583 66.8786 6.63447 66.8786 6.91477C66.8786 7.19129 66.7725 7.42992 66.5604 7.63068C66.352 7.82765 66.1001 7.92614 65.8047 7.92614ZM72.6072 18.1761C71.7891 18.1761 71.075 17.9886 70.4652 17.6136C69.8554 17.2386 69.3819 16.714 69.0447 16.0398C68.7076 15.3655 68.5391 14.5777 68.5391 13.6761C68.5391 12.7708 68.7076 11.9792 69.0447 11.3011C69.3819 10.6231 69.8554 10.0966 70.4652 9.72159C71.075 9.34659 71.7891 9.15909 72.6072 9.15909C73.4254 9.15909 74.1394 9.34659 74.7493 9.72159C75.3591 10.0966 75.8326 10.6231 76.1697 11.3011C76.5069 11.9792 76.6754 12.7708 76.6754 13.6761C76.6754 14.5777 76.5069 15.3655 76.1697 16.0398C75.8326 16.714 75.3591 17.2386 74.7493 17.6136C74.1394 17.9886 73.4254 18.1761 72.6072 18.1761ZM72.6129 16.75C73.1432 16.75 73.5826 16.6098 73.9311 16.3295C74.2796 16.0492 74.5372 15.6761 74.7038 15.2102C74.8743 14.7443 74.9595 14.2311 74.9595 13.6705C74.9595 13.1136 74.8743 12.6023 74.7038 12.1364C74.5372 11.6667 74.2796 11.2898 73.9311 11.0057C73.5826 10.7216 73.1432 10.5795 72.6129 10.5795C72.0788 10.5795 71.6357 10.7216 71.2834 11.0057C70.9349 11.2898 70.6754 11.6667 70.505 12.1364C70.3383 12.6023 70.255 13.1136 70.255 13.6705C70.255 14.2311 70.3383 14.7443 70.505 15.2102C70.6754 15.6761 70.9349 16.0492 71.2834 16.3295C71.6357 16.6098 72.0788 16.75 72.6129 16.75ZM80.2706 12.8182V18H78.5717V9.27273H80.2024V10.6932H80.3104C80.5111 10.2311 80.8255 9.85985 81.2536 9.57955C81.6854 9.29924 82.2289 9.15909 82.8842 9.15909C83.4789 9.15909 83.9998 9.28409 84.4467 9.53409C84.8937 9.7803 85.2403 10.1477 85.4865 10.6364C85.7327 11.125 85.8558 11.7292 85.8558 12.4489V18H84.157V12.6534C84.157 12.0208 83.9922 11.5265 83.6626 11.1705C83.3331 10.8106 82.8804 10.6307 82.3047 10.6307C81.9107 10.6307 81.5604 10.7159 81.2536 10.8864C80.9505 11.0568 80.71 11.3068 80.532 11.6364C80.3577 11.9621 80.2706 12.3561 80.2706 12.8182ZM32.2436 31.875V30.3636H41.2493V31.875H37.6186V42H35.8686V31.875H32.2436ZM43.103 42V33.2727H44.8018V42H43.103ZM43.9609 31.9261C43.6655 31.9261 43.4117 31.8277 43.1996 31.6307C42.9912 31.4299 42.8871 31.1913 42.8871 30.9148C42.8871 30.6345 42.9912 30.3958 43.1996 30.1989C43.4117 29.9981 43.6655 29.8977 43.9609 29.8977C44.2564 29.8977 44.5083 29.9981 44.7166 30.1989C44.9287 30.3958 45.0348 30.6345 45.0348 30.9148C45.0348 31.1913 44.9287 31.4299 44.7166 31.6307C44.5083 31.8277 44.2564 31.9261 43.9609 31.9261ZM51.1612 33.2727V34.6364H46.3942V33.2727H51.1612ZM47.6726 31.1818H49.3714V39.4375C49.3714 39.767 49.4207 40.0152 49.5192 40.1818C49.6177 40.3447 49.7446 40.4564 49.8999 40.517C50.0589 40.5739 50.2313 40.6023 50.4169 40.6023C50.5533 40.6023 50.6726 40.5928 50.7749 40.5739C50.8771 40.5549 50.9567 40.5398 51.0135 40.5284L51.3203 41.9318C51.2218 41.9697 51.0817 42.0076 50.8999 42.0455C50.718 42.0871 50.4908 42.1098 50.218 42.1136C49.7711 42.1212 49.3544 42.0417 48.968 41.875C48.5817 41.7083 48.2692 41.4508 48.0305 41.1023C47.7919 40.7538 47.6726 40.3163 47.6726 39.7898V31.1818ZM54.9268 30.3636V42H53.228V30.3636H54.9268ZM60.9737 42.1761C60.1139 42.1761 59.3733 41.9924 58.7521 41.625C58.1347 41.2538 57.6574 40.733 57.3203 40.0625C56.987 39.3883 56.8203 38.5985 56.8203 37.6932C56.8203 36.7992 56.987 36.0114 57.3203 35.3295C57.6574 34.6477 58.1271 34.1155 58.7294 33.733C59.3355 33.3504 60.0438 33.1591 60.8544 33.1591C61.3468 33.1591 61.8241 33.2405 62.2862 33.4034C62.7483 33.5663 63.1631 33.822 63.5305 34.1705C63.898 34.5189 64.1877 34.9716 64.3999 35.5284C64.612 36.0814 64.718 36.7538 64.718 37.5455V38.1477H57.7805V36.875H63.0533C63.0533 36.428 62.9624 36.0322 62.7805 35.6875C62.5987 35.339 62.343 35.0644 62.0135 34.8636C61.6877 34.6629 61.3052 34.5625 60.8658 34.5625C60.3885 34.5625 59.9718 34.6799 59.6158 34.9148C59.2635 35.1458 58.9908 35.4489 58.7976 35.8239C58.6082 36.1951 58.5135 36.5985 58.5135 37.0341V38.0284C58.5135 38.6117 58.6158 39.108 58.8203 39.517C59.0286 39.9261 59.3184 40.2386 59.6896 40.4545C60.0608 40.6667 60.4946 40.7727 60.9908 40.7727C61.3127 40.7727 61.6063 40.7273 61.8714 40.6364C62.1366 40.5417 62.3658 40.4015 62.5589 40.2159C62.7521 40.0303 62.8999 39.8011 63.0021 39.5284L64.6101 39.8182C64.4813 40.2917 64.2502 40.7064 63.9169 41.0625C63.5874 41.4148 63.1726 41.6894 62.6726 41.8864C62.1764 42.0795 61.6101 42.1761 60.9737 42.1761Z" fill="#F9F9F9"/>
8
8
  </svg>
@@ -1 +1 @@
1
- import{jsx as t,Fragment as r,jsxs as o}from"react/jsx-runtime";import{usePageType as d,usePageStore as e,isEmptyChildren as i,useProductQuery as c,useEditorMode as n,ProductProvider as l}from"@gem-sdk/core";import u from"../../grid/components/ChildrenDroppable.js";import s from"../../common/components/Loading.js";import{useState as a}from"react";import m from"../../grid/components/Row.js";import p from"next/dynamic";let ProductNotFound=p(()=>import("./ProductNotFound.js"),{loading:s}),Product=({children:o,setting:c,styles:n,style:l,builderAttrs:s})=>{let{productSetting:a,quantity:m,readOnly:p,isAuto:P,isSyncProduct:y,...g}=c??{},{...f}=n??{},h=d(),S=e(t=>t.dynamicProduct),b=a?.productStatus=="dynamic"?S??{}:{};return"PRODUCT"===h&&P?t(r,{children:i(o)?t(u,{}):o}):t(LocalProduct,{builderAttrs:s,rowSetting:g,rowStyles:f,style:l,productSetting:{...a,...b},quantity:m,readOnly:p,isSyncProduct:y,children:o})},LocalProduct=({children:d,productSetting:e,quantity:p,readOnly:P,rowSetting:y,style:g,rowStyles:f,builderAttrs:h,isSyncProduct:S})=>{let b=e?.productId??"latest",j=e?.initialVariantId,{data:w,isLoading:x,error:A}=c(b),[C,D]=a(!0),F=n();return!A&&(w||x)||"edit"!==F?t(r,{children:x?t(s,{}):A?o("div",{children:["Error: ",A?.message]}):w?t(l,{product:w,initialVariantId:j,quantity:p,readOnly:P,isSyncProduct:S,children:t(m,{builderAttrs:h,style:g,setting:y,styles:f,..."edit"===F?{"data-product-id":w?.baseID?.replace("gid://shopify/Product/","")}:{},children:i(d)?t(u,{}):d})},`uid-${w.id}-${j??""}`):null}):C?t(ProductNotFound,{builderAttrs:h,productSrc:"PickProduct",onClose:()=>D(!1),children:d}):null};export{Product as default};
1
+ import{jsx as t,Fragment as r,jsxs as o}from"react/jsx-runtime";import{usePageType as d,usePageStore as e,isEmptyChildren as i,useProductQuery as c,useEditorMode as n,ProductProvider as l}from"@gem-sdk/core";import u from"../../grid/components/ChildrenDroppable.js";import s from"../../common/components/Loading.js";import{useMemo as a,useState as m}from"react";import p from"../../grid/components/Row.js";import P from"next/dynamic";import{hasPublicStoreFrontData as h,createStoreFrontFetcher as y}from"../../post-purchase/product/helpers/index.js";let ProductNotFound=P(()=>import("./ProductNotFound.js"),{loading:s}),Product=({children:o,setting:c,styles:n,style:l,builderAttrs:s})=>{let{productSetting:a,quantity:m,readOnly:p,isAuto:P,isSyncProduct:h,...y}=c??{},{...f}=n??{},g=d(),S=e(t=>t.dynamicProduct),b=a?.productStatus=="dynamic"?S??{}:{};return"PRODUCT"===g&&P?t(r,{children:i(o)?t(u,{}):o}):t(LocalProduct,{builderAttrs:s,rowSetting:y,rowStyles:f,style:l,productSetting:{...a,...b},quantity:m,readOnly:p,isSyncProduct:h,children:o})},LocalProduct=({children:d,productSetting:P,quantity:f,readOnly:g,rowSetting:S,style:b,rowStyles:j,builderAttrs:x,isSyncProduct:D})=>{let F=P?.productId??"latest",v=P?.initialVariantId,w=e(t=>t.publicStoreFrontData),A=a(()=>h(w)?y(w):void 0,[w]),{data:C,isLoading:I,error:L}=c(F,void 0,A),[N,k]=m(!0),O=n();return!L&&(C||I)||"edit"!==O?t(r,{children:I?t(s,{}):L?o("div",{children:["Error: ",L?.message]}):C?t(l,{product:C,initialVariantId:v,quantity:f,readOnly:g,isSyncProduct:D,children:t(p,{builderAttrs:x,style:b,setting:S,styles:j,..."edit"===O?{"data-product-id":C?.baseID?.replace("gid://shopify/Product/","")}:{},children:i(d)?t(u,{}):d})},`uid-${C.id}-${v??""}`):null}):N?t(ProductNotFound,{builderAttrs:x,productSrc:"PickProduct",onClose:()=>k(!1),children:d}):null};export{Product as default};
@@ -67,7 +67,7 @@ ${s(i,'<script src="{{ \'gp-product.v2.js\' | asset_url }}" defer="defer"></scri
67
67
  assign target_collection = null
68
68
  assign productSrc = '${O}'
69
69
  assign c = 0
70
- assign limit = ${k&&"latest"==T?b?.numOfSelectedProducts||4:A}
70
+ assign limit = ${k&&"latest"===T?"RelatedProduct"===O?A:b?.numOfSelectedProducts||4:A}
71
71
  if request.page_type == 'collection' or preview_page_type == 'collection'
72
72
  assign target_collection = collection
73
73
  if target_collection == empty or target_collection == null
@@ -94,86 +94,90 @@ ${s(i,'<script src="{{ \'gp-product.v2.js\' | asset_url }}" defer="defer"></scri
94
94
  assign idAssignProduct = assignProduct.id
95
95
  assign allProducts = collections.all.products
96
96
 
97
- if relatedTag == 'collection'
98
- for collection in collections
99
- assign collectionId = collection.id
100
- assign isInCollection = false
101
- assign collectionsAssignProduct = assignProduct.collections
102
- for item in collectionsAssignProduct
103
- if item.id == collectionId
104
- assign isInCollection = true
97
+ if relatedTag == 'collection'
98
+ for collection in collections
99
+ assign collectionId = collection.id
100
+ assign isInCollection = false
101
+ assign collectionsAssignProduct = assignProduct.collections
102
+ for item in collectionsAssignProduct
103
+ if item.id == collectionId
104
+ assign isInCollection = true
105
+ endif
106
+ endfor
107
+ if isInCollection
108
+ for item in allProducts
109
+ assign handle = item.handle
110
+ assign productF = all_products[handle] | sort
111
+ assign idOfProduct = all_products[handle].id
112
+ for product in collection.products
113
+ assign productCollectionId = product.id
114
+ unless arrayListProducts contains handle
115
+ if productCollectionId == idOfProduct and idAssignProduct != idOfProduct
116
+ assign products = products | concat: productF
117
+ if stringListProducts.size > 0
118
+ assign stringListProducts = stringListProducts | append: ', '
119
+ endif
120
+ assign stringListProducts = stringListProducts | append: handle
121
+ assign arrayListProducts = stringListProducts | split: ", "
122
+ endif
123
+ endunless
124
+ endfor
125
+ endfor
105
126
  endif
106
127
  endfor
107
- if isInCollection
108
- for item in allProducts
109
- assign handle = item.handle
110
- assign productF = all_products[handle] | sort
111
- assign idOfProduct = all_products[handle].id
112
- for product in collection.products
113
- assign productCollectionId = product.id
114
- unless arrayListProducts contains handle
115
- if productCollectionId == idOfProduct and idAssignProduct != idOfProduct
116
- assign products = products | concat: productF
117
- if stringListProducts.size > 0
118
- assign stringListProducts = stringListProducts | append: ', '
119
- endif
120
- assign stringListProducts = stringListProducts | append: handle
121
- assign arrayListProducts = stringListProducts | split: ", "
122
- endif
123
- endunless
124
- endfor
125
- endfor
126
- endif
127
- endfor
128
- endif
129
-
130
- if relatedTag == 'vendor'
131
- assign vendorAssignProduct = assignProduct.vendor
132
- for item in allProducts
133
- assign handle = item.handle
134
- assign productF = all_products[handle] | sort
135
- assign vendorOfProduct = all_products[handle].vendor
136
- assign idOfProduct = all_products[handle].id
137
- if vendorOfProduct == vendorAssignProduct and idAssignProduct != idOfProduct
138
- assign products = products | concat: productF
139
- endif
140
- endfor
141
- endif
128
+ endif
142
129
 
143
- if relatedTag == 'production-type'
144
- assign typeAssignProduct = assignProduct.type
145
- for item in allProducts
146
- assign handle = item.handle
147
- assign productF = all_products[handle] | sort
148
- assign typeOfProduct = all_products[handle].type
149
- assign idOfProduct = all_products[handle].id
150
- if typeOfProduct == typeAssignProduct and idAssignProduct != idOfProduct
151
- assign products = products | concat: productF
152
- endif
153
- endfor
154
- endif
155
- if relatedTag == 'tags'
156
- assign tagsAssignProduct = assignProduct.tags
157
- for item in allProducts
158
- assign handle = item.handle
159
- assign productF = all_products[handle] | sort
160
- assign tagsOfProduct = all_products[handle].tags
130
+ if relatedTag == 'vendor'
131
+ assign vendorAssignProduct = assignProduct.vendor
132
+ for item in allProducts
133
+ assign handle = item.handle
134
+ assign productF = all_products[handle] | sort
135
+ assign vendorOfProduct = all_products[handle].vendor
161
136
  assign idOfProduct = all_products[handle].id
162
- for tag in tagsAssignProduct
163
- assign tagItem = tag
164
- unless arrayListProducts contains handle
165
- if tagsOfProduct contains tagItem and idAssignProduct != idOfProduct
166
- assign products = products | concat: productF
167
- if stringListProducts.size > 0
168
- assign stringListProducts = stringListProducts | append: ', '
169
- endif
170
- assign stringListProducts = stringListProducts | append: handle
171
- assign arrayListProducts = stringListProducts | split: ", "
172
- endif
173
- endunless
174
- endfor
175
- endfor
176
- endif
137
+ if vendorOfProduct == vendorAssignProduct and idAssignProduct != idOfProduct
138
+ assign products = products | concat: productF
139
+ endif
140
+ endfor
141
+ endif
142
+
143
+ if relatedTag == 'production-type'
144
+ assign typeAssignProduct = assignProduct.type
145
+ for item in allProducts
146
+ assign handle = item.handle
147
+ assign productF = all_products[handle] | sort
148
+ assign typeOfProduct = all_products[handle].type
149
+ assign idOfProduct = all_products[handle].id
150
+ if typeOfProduct == typeAssignProduct and idAssignProduct != idOfProduct
151
+ assign products = products | concat: productF
152
+ endif
153
+ endfor
154
+ endif
155
+
156
+ if relatedTag == 'tags'
157
+ assign tagsAssignProduct = assignProduct.tags
158
+ for item in allProducts
159
+ assign handle = item.handle
160
+ assign productF = all_products[handle] | sort
161
+ assign tagsOfProduct = all_products[handle].tags
162
+ assign idOfProduct = all_products[handle].id
163
+ for tag in tagsAssignProduct
164
+ assign tagItem = tag
165
+ unless arrayListProducts contains handle
166
+ if tagsOfProduct contains tagItem and idAssignProduct != idOfProduct
167
+ assign products = products | concat: productF
168
+ if stringListProducts.size > 0
169
+ assign stringListProducts = stringListProducts | append: ', '
170
+ endif
171
+ assign stringListProducts = stringListProducts | append: handle
172
+ assign arrayListProducts = stringListProducts | split: ", "
173
+ endif
174
+ endunless
175
+ endfor
176
+ endfor
177
+ endif
178
+ paginate products by ${A||4}
179
+ assign products = products
180
+ endpaginate
177
181
  else if productSrc == 'PickProduct'
178
182
  unless ${I}
179
183
  assign products = null | sort
@@ -613,6 +613,7 @@ type CollectionBannerProps = BasePropsWrap<Setting$7> & {
613
613
  declare const CollectionBanner$1: ({ builderAttrs, builderProps, setting, style, children, }: CollectionBannerProps) => React.JSX.Element;
614
614
 
615
615
  type CollectionTitleProps = BaseProps<{
616
+ htmlTag?: React.ElementType;
616
617
  textAlign?: ObjectDevices<AlignProp>;
617
618
  /**
618
619
  * @deprecated please use color inside `typo` instead
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.846",
3
+ "version": "2.0.0-dev.849",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,7 +21,7 @@
21
21
  "format": "prettier --write \"./src/**/*.{ts,tsx}\""
22
22
  },
23
23
  "devDependencies": {
24
- "@gem-sdk/core": "2.0.0-dev.843",
24
+ "@gem-sdk/core": "2.0.0-dev.849",
25
25
  "@gem-sdk/styles": "1.14.0-dev.831",
26
26
  "@types/react-transition-group": "^4.4.5"
27
27
  },