@gem-sdk/components 12.0.0-dev.82 → 12.0.0-dev.87

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"),React=require("react"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers$1=require("../common/helpers.js"),core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),PostPurchaseCheckbox=require("./PostPurchaseCheckbox.js");const DEFAULT_PRE_CHECK_VALUE=!0,COMPONENT_ID_PREFIX="buyer-consent-product",BuyerConsent=({styles:e,builderProps:s,setting:t,builderAttrs:r,style:l})=>{let{isEditMode:c}=core.useRenderMode(),a=core.useProduct(),o=core.usePageStore(e=>e.buyerConsentChecked),n=core.usePageStore(e=>e.setBuyerConsentChecked),i=core.usePageStore(e=>e.subscriptionVisible),{description:u,policyLabel:d,policyLink:y,align:m}=t??{},h=a?.id?`buyer-consent-product-${s?.uid}-${a.id}`:void 0,C=helpers$1.getComponentTag(y),x=system.createStyle(styles.getWrapperStyles({styles:e})),j=system.createClass(classes.getWrapperClassName({align:m,uid:s?.uid})),p=system.createStyle(styles.getContainerStyles({styles:e})),g=system.createClass(classes.getCheckboxContainerClassName()),b=system.createStyle(styles.getTextStyle({styles:e})),P=system.createClass(classes.getLinkComponentClassName()),k=system.createStyle(classes.getLinkComponentStyles()),R=React.useMemo(()=>helpers.extractProductID(a?.baseID??""),[a?.baseID]),S=React.useMemo(()=>{let e=`${R}`;return o?.[e]??!0},[o,R]),q=e=>{let s=`${R}`,t={...o,[s]:e.target.checked};n(t)},N=!c&&!i?.[a?.id??""];return N?null:jsxRuntime.jsx("div",{...r,style:{...l},children:jsxRuntime.jsx("div",{"data-id":s?.uid,style:x,className:j,children:jsxRuntime.jsxs("label",{htmlFor:h,dir:e?.direction??"ltr",style:p,className:g,children:[jsxRuntime.jsx(PostPurchaseCheckbox.default,{id:h,name:h,type:"checkbox",checked:S,onChange:q}),jsxRuntime.jsxs("bdo",{dir:e?.direction??"ltr",style:b,children:[u," ",jsxRuntime.jsx(C,{target:"_blank",rel:"noreferrer",href:y,className:P,style:k,children:d})]})]})})})};exports.default=BuyerConsent;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers$1=require("../common/helpers.js"),core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),PostPurchaseCheckbox=require("./PostPurchaseCheckbox.js");const DEFAULT_PRE_CHECK_VALUE=!0,COMPONENT_ID_PREFIX="buyer-consent-product",BuyerConsent=({styles:e,builderProps:s,setting:t,builderAttrs:r,style:l,children:c})=>{let{isEditMode:o}=core.useRenderMode(),a=core.useProduct(),n=core.usePageStore(e=>e.buyerConsentChecked),i=core.usePageStore(e=>e.setBuyerConsentChecked),u=core.usePageStore(e=>e.subscriptionVisible),{description:d,policyLabel:y,policyLink:m,align:h}=t??{},C=a?.id?`buyer-consent-product-${s?.uid}-${a.id}`:void 0,x=helpers$1.getComponentTag(m),j=system.createStyle(styles.getWrapperStyles({styles:e})),p=system.createClass(classes.getWrapperClassName({align:h,uid:s?.uid})),b=system.createStyle(styles.getContainerStyles({styles:e})),g=system.createClass(classes.getCheckboxContainerClassName()),P=system.createStyle(styles.getTextStyle({styles:e})),k=system.createClass(classes.getLinkComponentClassName()),R=system.createStyle(classes.getLinkComponentStyles()),S=React.useMemo(()=>helpers.extractProductID(a?.baseID??""),[a?.baseID]),q=React.useMemo(()=>{let e=`${S}`;return n?.[e]??!0},[n,S]),N=e=>{let s=`${S}`,t={...n,[s]:e.target.checked};i(t)},_=!o&&!u?.[a?.id??""];return _?null:jsxRuntime.jsxs("div",{...r,style:{...l},children:[jsxRuntime.jsx("div",{"data-id":s?.uid,style:j,className:p,children:jsxRuntime.jsxs("label",{htmlFor:C,dir:e?.direction??"ltr",style:b,className:g,children:[jsxRuntime.jsx(PostPurchaseCheckbox.default,{id:C,name:C,type:"checkbox",checked:q,onChange:N}),jsxRuntime.jsxs("bdo",{dir:e?.direction??"ltr",style:P,children:[d," ",jsxRuntime.jsx(x,{target:"_blank",rel:"noreferrer",href:m,className:k,style:R,children:y})]})]})}),core.filterToolbarPreview(c,!1)]})};exports.default=BuyerConsent;
@@ -9,4 +9,4 @@
9
9
  </defs>
10
10
  </svg>
11
11
  <span class="preset-item-title"> Shop Pay Installments</span>
12
- </div>`,config={tag:helpers.APP_CONFIG.id,label:helpers.APP_CONFIG.label,icon,settings:settings.ShopPayInstallmentSettings,ui:[{type:"group",label:{en:""},options:{labelSpacing:"small"},controls:[{type:"control",label:{en:""},layout:"vertical",setting:{id:"setupGuide"}}]}],editorConfigs:{placeholder:{flowTag:["Product"]},component:{isThirdParty:!0}},presets:[{id:"shop-pay-installment",name:"Shop Pay Installments",icon:{desktop:icon},components:[{tag:"ShopPayInstallments",advanced:{margin:{desktop:{bottom:"var(--g-s-l)"}}}}]}]};exports.default=config;
12
+ </div>`,config={tag:helpers.APP_CONFIG.id,label:helpers.APP_CONFIG.label,icon,settings:settings.ShopPayInstallmentSettings,ui:[{type:"group",label:{en:""},options:{labelSpacing:"small"},controls:[{type:"control",label:{en:""},layout:"vertical",setting:{id:"setupGuide"}}]}],uiV2:[{messageConfig:{type:"info",message:"Shop Pay Installments is available only for U.S.-based merchants selling in USD with Shopify Payments and Shop Pay activated."}}],editorConfigs:{placeholder:{flowTag:["Product"]},component:{isThirdParty:!0}},presets:[{id:"shop-pay-installment",name:"Shop Pay Installments",icon:{desktop:icon},components:[{tag:"ShopPayInstallments",advanced:{margin:{desktop:{bottom:"var(--g-s-l)"}}}}]}]};exports.default=config;
@@ -1 +1 @@
1
- "use strict";const ShopPayInstallmentSettings=[{id:"setting",info:{next_link_text:"Shop Pay Installments is available only for U.S.-based merchants selling in USD with Shopify Payments and Shop Pay activated.",info_bg_color:"#3C67FF40"},controls:[]}];exports.ShopPayInstallmentSettings=ShopPayInstallmentSettings;
1
+ "use strict";const ShopPayInstallmentSettings=[{id:"setting",controls:[]}];exports.ShopPayInstallmentSettings=ShopPayInstallmentSettings;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useMemo as t}from"react";import{createStyle as o,createClass as s}from"@gem-sdk/system";import{getWrapperStyles as i,getContainerStyles as m,getTextStyle as c}from"../common/styles.js";import{getWrapperClassName as d,getCheckboxContainerClassName as l,getLinkComponentClassName as n,getLinkComponentStyles as a}from"../common/classes.js";import{getComponentTag as u}from"../common/helpers.js";import{useRenderMode as h,useProduct as p,usePageStore as y}from"@gem-sdk/core";import{extractProductID as b}from"../../../helpers.js";import f from"./PostPurchaseCheckbox.js";let DEFAULT_PRE_CHECK_VALUE=!0,COMPONENT_ID_PREFIX="buyer-consent-product",BuyerConsent=({styles:C,builderProps:k,setting:j,builderAttrs:E,style:_})=>{let{isEditMode:g}=h(),N=p(),P=y(e=>e.buyerConsentChecked),x=y(e=>e.setBuyerConsentChecked),D=y(e=>e.subscriptionVisible),{description:I,policyLabel:$,policyLink:v,align:B}=j??{},F=N?.id?`buyer-consent-product-${k?.uid}-${N.id}`:void 0,A=u(v),L=o(i({styles:C})),O=s(d({align:B,uid:k?.uid})),R=o(m({styles:C})),T=s(l()),U=o(c({styles:C})),V=s(n()),H=o(a()),K=t(()=>b(N?.baseID??""),[N?.baseID]),M=t(()=>{let e=`${K}`;return P?.[e]??!0},[P,K]),X=e=>{let r=`${K}`,t={...P,[r]:e.target.checked};x(t)},q=!g&&!D?.[N?.id??""];return q?null:e("div",{...E,style:{..._},children:e("div",{"data-id":k?.uid,style:L,className:O,children:r("label",{htmlFor:F,dir:C?.direction??"ltr",style:R,className:T,children:[e(f,{id:F,name:F,type:"checkbox",checked:M,onChange:X}),r("bdo",{dir:C?.direction??"ltr",style:U,children:[I," ",e(A,{target:"_blank",rel:"noreferrer",href:v,className:V,style:H,children:$})]})]})})})};export{BuyerConsent as default};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useMemo as t}from"react";import{createStyle as o,createClass as s}from"@gem-sdk/system";import{getWrapperStyles as i,getContainerStyles as m,getTextStyle as c}from"../common/styles.js";import{getWrapperClassName as d,getCheckboxContainerClassName as l,getLinkComponentClassName as n,getLinkComponentStyles as a}from"../common/classes.js";import{getComponentTag as u}from"../common/helpers.js";import{useRenderMode as h,useProduct as p,usePageStore as y,filterToolbarPreview as b}from"@gem-sdk/core";import{extractProductID as f}from"../../../helpers.js";import C from"./PostPurchaseCheckbox.js";let DEFAULT_PRE_CHECK_VALUE=!0,COMPONENT_ID_PREFIX="buyer-consent-product",BuyerConsent=({styles:k,builderProps:j,setting:E,builderAttrs:_,style:g,children:N})=>{let{isEditMode:P}=h(),x=p(),D=y(e=>e.buyerConsentChecked),I=y(e=>e.setBuyerConsentChecked),$=y(e=>e.subscriptionVisible),{description:v,policyLabel:B,policyLink:F,align:A}=E??{},L=x?.id?`buyer-consent-product-${j?.uid}-${x.id}`:void 0,O=u(F),R=o(i({styles:k})),T=s(d({align:A,uid:j?.uid})),U=o(m({styles:k})),V=s(l()),H=o(c({styles:k})),K=s(n()),M=o(a()),X=t(()=>f(x?.baseID??""),[x?.baseID]),q=t(()=>{let e=`${X}`;return D?.[e]??!0},[D,X]),w=e=>{let r=`${X}`,t={...D,[r]:e.target.checked};I(t)},z=!P&&!$?.[x?.id??""];return z?null:e("div",{..._,style:{...g},children:[r("div",{"data-id":j?.uid,style:R,className:T,children:e("label",{htmlFor:L,dir:k?.direction??"ltr",style:U,className:V,children:[r(C,{id:L,name:L,type:"checkbox",checked:q,onChange:w}),e("bdo",{dir:k?.direction??"ltr",style:H,children:[v," ",r(O,{target:"_blank",rel:"noreferrer",href:F,className:K,style:M,children:B})]})]})}),b(N,!1)]})};export{BuyerConsent as default};
@@ -1,4 +1,4 @@
1
- import{APP_CONFIG as A}from"../components/common/helpers.js";import{ShopPayInstallmentSettings as t}from"./configs/settings.js";let icon=`<div class="w-full flex flex-col items-center">
1
+ import{APP_CONFIG as A}from"../components/common/helpers.js";import{ShopPayInstallmentSettings as e}from"./configs/settings.js";let icon=`<div class="w-full flex flex-col items-center">
2
2
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
3
  <rect width="24" height="24" rx="3" fill="url(#pattern0_26273_9952)"/>
4
4
  <defs>
@@ -9,4 +9,4 @@ import{APP_CONFIG as A}from"../components/common/helpers.js";import{ShopPayInsta
9
9
  </defs>
10
10
  </svg>
11
11
  <span class="preset-item-title"> Shop Pay Installments</span>
12
- </div>`,config={tag:A.id,label:A.label,icon,settings:t,ui:[{type:"group",label:{en:""},options:{labelSpacing:"small"},controls:[{type:"control",label:{en:""},layout:"vertical",setting:{id:"setupGuide"}}]}],editorConfigs:{placeholder:{flowTag:["Product"]},component:{isThirdParty:!0}},presets:[{id:"shop-pay-installment",name:"Shop Pay Installments",icon:{desktop:icon},components:[{tag:"ShopPayInstallments",advanced:{margin:{desktop:{bottom:"var(--g-s-l)"}}}}]}]};export{config as default};
12
+ </div>`,config={tag:A.id,label:A.label,icon,settings:e,ui:[{type:"group",label:{en:""},options:{labelSpacing:"small"},controls:[{type:"control",label:{en:""},layout:"vertical",setting:{id:"setupGuide"}}]}],uiV2:[{messageConfig:{type:"info",message:"Shop Pay Installments is available only for U.S.-based merchants selling in USD with Shopify Payments and Shop Pay activated."}}],editorConfigs:{placeholder:{flowTag:["Product"]},component:{isThirdParty:!0}},presets:[{id:"shop-pay-installment",name:"Shop Pay Installments",icon:{desktop:icon},components:[{tag:"ShopPayInstallments",advanced:{margin:{desktop:{bottom:"var(--g-s-l)"}}}}]}]};export{config as default};
@@ -1 +1 @@
1
- let ShopPayInstallmentSettings=[{id:"setting",info:{next_link_text:"Shop Pay Installments is available only for U.S.-based merchants selling in USD with Shopify Payments and Shop Pay activated.",info_bg_color:"#3C67FF40"},controls:[]}];export{ShopPayInstallmentSettings};
1
+ let ShopPayInstallmentSettings=[{id:"setting",controls:[]}];export{ShopPayInstallmentSettings};
@@ -3561,7 +3561,9 @@ type PostPurchaseBuyerConsentStyleProps = {
3561
3561
  textAlign?: AlignItemProp;
3562
3562
  typo?: PostPurchaseTypo;
3563
3563
  };
3564
- type PostPurchaseBuyerConsentProps = BasePropsWrap<PostPurchaseBuyerConsentSettingProps, PostPurchaseBuyerConsentStyleProps>;
3564
+ type PostPurchaseBuyerConsentProps = BasePropsWrap<PostPurchaseBuyerConsentSettingProps, PostPurchaseBuyerConsentStyleProps> & {
3565
+ children: React.ReactNode;
3566
+ };
3565
3567
 
3566
3568
  declare const BuyerConsent: React.FC<PostPurchaseBuyerConsentProps>;
3567
3569
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "12.0.0-dev.82",
3
+ "version": "12.0.0-dev.87",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,8 +26,8 @@
26
26
  "i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/translate/extract-texts-to-locales.js && node ./scripts/translate/en-keys-usage.js"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "12.0.0-dev.82",
30
- "@gem-sdk/styles": "12.0.0-dev.71",
29
+ "@gem-sdk/core": "12.0.0-dev.87",
30
+ "@gem-sdk/styles": "12.0.0-dev.86",
31
31
  "@gem-sdk/system": "12.0.0-dev.53",
32
32
  "@types/react-transition-group": "^4.4.12",
33
33
  "tsup": "8.5.1",