@gem-sdk/components 12.0.0-dev.80 → 12.0.0-dev.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/post-purchase/buyer-consent/components/BuyerConsent.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/ProductSubscription.js +1 -1
- package/dist/esm/post-purchase/buyer-consent/components/BuyerConsent.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/ProductSubscription.js +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +2 -2
|
@@ -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})=>{let
|
|
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 c=core.useProduct(),a=core.usePageStore(e=>e.buyerConsentChecked),o=core.usePageStore(e=>e.setBuyerConsentChecked),{description:n,policyLabel:u,policyLink:i,align:y}=t??{},m=c?.id?`buyer-consent-product-${s?.uid}-${c.id}`:void 0,d=helpers$1.getComponentTag(i),h=system.createStyle(styles.getWrapperStyles({styles:e})),C=system.createClass(classes.getWrapperClassName({align:y,uid:s?.uid})),x=system.createStyle(styles.getContainerStyles({styles:e})),j=system.createClass(classes.getCheckboxContainerClassName()),p=system.createStyle(styles.getTextStyle({styles:e})),g=system.createClass(classes.getLinkComponentClassName()),b=system.createStyle(classes.getLinkComponentStyles()),k=React.useMemo(()=>helpers.extractProductID(c?.baseID??""),[c?.baseID]),P=React.useMemo(()=>{let e=`${k}`;return a?.[e]??!0},[a,k]),R=e=>{let s=`${k}`,t={...a,[s]:e.target.checked};o(t)};return jsxRuntime.jsx("div",{...r,style:{...l},children:jsxRuntime.jsx("div",{"data-id":s?.uid,style:h,className:C,children:jsxRuntime.jsxs("label",{htmlFor:m,dir:e?.direction??"ltr",style:x,className:j,children:[jsxRuntime.jsx(PostPurchaseCheckbox.default,{id:m,name:m,type:"checkbox",checked:P,onChange:R}),jsxRuntime.jsxs("bdo",{dir:e?.direction??"ltr",style:p,children:[n," ",jsxRuntime.jsx(d,{target:"_blank",rel:"noreferrer",href:i,className:g,style:b,children:u})]})]})})})};exports.default=BuyerConsent;
|
package/dist/cjs/post-purchase/product/components/product-subscription/ProductSubscription.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),React=require("react"),index=require("../../constants/index.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),useSellingPlanChange=require("./hooks/useSellingPlanChange.js"),useSellingSubscription=require("./hooks/useSellingSubscription.js"),useSellingPlanOptions=require("./hooks/useSellingPlanOptions.js"),useSubscriptionVisibility=require("./hooks/useSubscriptionVisibility.js"),OneTimePurchaseTooltip=require("./components/OneTimePurchaseTooltip.js"),SellingPlanDropdown=require("./components/SellingPlanDropdown.js"),SellingPlanLabel=require("./components/SellingPlanLabel.js"),SellingPlanRadio=require("./components/SellingPlanRadio.js"),SubscriptionDetail=require("./components/SubscriptionDetail.js"),SubscriptionRadio=require("./components/SubscriptionRadio.js");const ProductSubscription=({styles:e,setting:s,builderProps:i,builderAttrs:n,style:l,children:t})=>{let r=core.useProduct(),{defaultValue:u,selectedSellingPlan:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),React=require("react"),index=require("../../constants/index.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),useSellingPlanChange=require("./hooks/useSellingPlanChange.js"),useSellingSubscription=require("./hooks/useSellingSubscription.js"),useSellingPlanOptions=require("./hooks/useSellingPlanOptions.js"),useSubscriptionVisibility=require("./hooks/useSubscriptionVisibility.js"),OneTimePurchaseTooltip=require("./components/OneTimePurchaseTooltip.js"),SellingPlanDropdown=require("./components/SellingPlanDropdown.js"),SellingPlanLabel=require("./components/SellingPlanLabel.js"),SellingPlanRadio=require("./components/SellingPlanRadio.js"),SubscriptionDetail=require("./components/SubscriptionDetail.js"),SubscriptionRadio=require("./components/SubscriptionRadio.js"),useDynamicProduct=require("../../hooks/useDynamicProduct.js");const ProductSubscription=({styles:e,setting:s,builderProps:i,builderAttrs:n,style:l,children:t})=>{let r=core.useProduct(),{defaultValue:u,selectedSellingPlan:o,setSelectedSellingPlan:a}=useSellingSubscription.useSellingSubscription(s),c=useSellingPlanOptions.useSellingPlanOptions(s),{selectedValue:d,handleSellingPlanChange:p}=useSellingPlanChange.useSellingPlanChange({defaultValue:u,selectedSellingPlan:o,setSelectedSellingPlan:a,sellingPlanOptions:c}),S=React.useRef(null),m=React.useId(),{selectedType:g,shouldShowRadio:j,isOneTimeHidden:x,hasNoSellingPlanOptions:b,setSubscriptionSellingType:P}=useSubscriptionVisibility.useSubscriptionVisibility({setting:s}),y=system.createStyle(styles.getSubscriptionStyles(e)),R=system.createStyle(styles.getSubscriptionWrapperStyles(e?.align)),h=system.createClass(classes.getWrapperClasses()),T=system.createClass(classes.getContainerClasses()),O=system.createStyle({...l}),{isEditMode:q}=core.useRenderMode(),C=`product-subscription-${r?.baseID}`,I=r?.baseID,E=`subscription-type-selection-${m}`,N=s?.sellingType===index.SubscriptionEnum.ONE_TIME,D=s?.sellingType===index.SubscriptionEnum.SUBSCRIPTION,{isDynamicProduct:v}=useDynamicProduct.useDynamicProduct();if(x||b||v)return q?jsxRuntime.jsxs("div",{...n,style:O,children:[jsxRuntime.jsx(OneTimePurchaseTooltip.OneTimePurchaseTooltip,{ref:S,setting:s}),core.filterToolbarPreview(t,!0)]}):null;let k=e=>jsxRuntime.jsxs("div",{...n,style:O,children:[jsxRuntime.jsx("div",{ref:S,"data-selling-type":s?.sellingType,id:C,className:h,style:R,children:e}),core.filterToolbarPreview(t,!0)]}),f=()=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:s?.sellingStyle==="radio"?jsxRuntime.jsx(SellingPlanRadio.SellingPlanRadio,{setting:s,styles:e,builderProps:i,productId:I??"",sellingPlanOptions:c,selectedValue:d,onChange:p}):jsxRuntime.jsx(SellingPlanDropdown.SellingPlanDropdown,{setting:s,sellingPlanOptions:c,selectedValue:d,onChange:p})});return k(N&&j?jsxRuntime.jsx("div",{className:T,style:y,children:jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${I}-one-time-radio`,name:E,value:index.SubscriptionEnum.ONE_TIME,checked:g===index.SubscriptionEnum.ONE_TIME,className:"!gp-items-start",onChange:e=>{e.target.checked&&P(index.SubscriptionEnum.ONE_TIME)},children:jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e})})}):D&&j?jsxRuntime.jsxs("div",{className:T,style:y,children:[jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${I}-subscription-radio`,name:E,value:index.SubscriptionEnum.SUBSCRIPTION,checked:g===index.SubscriptionEnum.SUBSCRIPTION,className:"!gp-items-start",onChange:e=>{e.target.checked&&P(index.SubscriptionEnum.SUBSCRIPTION)},children:jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e})}),g===index.SubscriptionEnum.SUBSCRIPTION&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"gp-pl-7",children:f()}),jsxRuntime.jsx("div",{className:"gp-pl-7",children:jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:s,styles:e})})]})]}):jsxRuntime.jsxs("div",{className:T,style:y,children:[jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e}),f(),jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:s,styles:e})]}))};exports.default=ProductSubscription;
|
|
@@ -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 m,getContainerStyles as
|
|
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 m,getContainerStyles as i,getTextStyle as c}from"../common/styles.js";import{getWrapperClassName as d,getCheckboxContainerClassName as n,getLinkComponentClassName as l,getLinkComponentStyles as a}from"../common/classes.js";import{getComponentTag as h}from"../common/helpers.js";import{useProduct as u,usePageStore as p}from"@gem-sdk/core";import{extractProductID as y}from"../../../helpers.js";import f from"./PostPurchaseCheckbox.js";let DEFAULT_PRE_CHECK_VALUE=!0,COMPONENT_ID_PREFIX="buyer-consent-product",BuyerConsent=({styles:C,builderProps:b,setting:k,builderAttrs:j,style:E})=>{let _=u(),g=p(e=>e.buyerConsentChecked),N=p(e=>e.setBuyerConsentChecked),{description:P,policyLabel:x,policyLink:D,align:I}=k??{},$=_?.id?`buyer-consent-product-${b?.uid}-${_.id}`:void 0,v=h(D),B=o(m({styles:C})),F=s(d({align:I,uid:b?.uid})),A=o(i({styles:C})),L=s(n()),O=o(c({styles:C})),R=s(l()),T=o(a()),U=t(()=>y(_?.baseID??""),[_?.baseID]),H=t(()=>{let e=`${U}`;return g?.[e]??!0},[g,U]),K=e=>{let r=`${U}`,t={...g,[r]:e.target.checked};N(t)};return e("div",{...j,style:{...E},children:e("div",{"data-id":b?.uid,style:B,className:F,children:r("label",{htmlFor:$,dir:C?.direction??"ltr",style:A,className:L,children:[e(f,{id:$,name:$,type:"checkbox",checked:H,onChange:K}),r("bdo",{dir:C?.direction??"ltr",style:O,children:[P," ",e(v,{target:"_blank",rel:"noreferrer",href:D,className:R,style:T,children:x})]})]})})})};export{BuyerConsent as default};
|
package/dist/esm/post-purchase/product/components/product-subscription/ProductSubscription.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as s,Fragment as i}from"react/jsx-runtime";import{useProduct as t,useRenderMode as o,filterToolbarPreview as l}from"@gem-sdk/core";import{createStyle as n,createClass as r}from"@gem-sdk/system";import{useRef as m,useId as c}from"react";import{SubscriptionEnum as a}from"../../constants/index.js";import{getWrapperClasses as p,getContainerClasses as d}from"./common/classes.js";import{getSubscriptionStyles as g,getSubscriptionWrapperStyles as u}from"./common/styles.js";import{useSellingPlanChange as h}from"./hooks/useSellingPlanChange.js";import{useSellingSubscription as S}from"./hooks/useSellingSubscription.js";import{useSellingPlanOptions as f}from"./hooks/useSellingPlanOptions.js";import{useSubscriptionVisibility as y}from"./hooks/useSubscriptionVisibility.js";import{OneTimePurchaseTooltip as I}from"./components/OneTimePurchaseTooltip.js";import{SellingPlanDropdown as N}from"./components/SellingPlanDropdown.js";import{SellingPlanLabel as P}from"./components/SellingPlanLabel.js";import{SellingPlanRadio as
|
|
1
|
+
import{jsxs as e,jsx as s,Fragment as i}from"react/jsx-runtime";import{useProduct as t,useRenderMode as o,filterToolbarPreview as l}from"@gem-sdk/core";import{createStyle as n,createClass as r}from"@gem-sdk/system";import{useRef as m,useId as c}from"react";import{SubscriptionEnum as a}from"../../constants/index.js";import{getWrapperClasses as p,getContainerClasses as d}from"./common/classes.js";import{getSubscriptionStyles as g,getSubscriptionWrapperStyles as u}from"./common/styles.js";import{useSellingPlanChange as h}from"./hooks/useSellingPlanChange.js";import{useSellingSubscription as S}from"./hooks/useSellingSubscription.js";import{useSellingPlanOptions as f}from"./hooks/useSellingPlanOptions.js";import{useSubscriptionVisibility as y}from"./hooks/useSubscriptionVisibility.js";import{OneTimePurchaseTooltip as I}from"./components/OneTimePurchaseTooltip.js";import{SellingPlanDropdown as N}from"./components/SellingPlanDropdown.js";import{SellingPlanLabel as P}from"./components/SellingPlanLabel.js";import{SellingPlanRadio as j}from"./components/SellingPlanRadio.js";import{SubscriptionDetail as b}from"./components/SubscriptionDetail.js";import{SubscriptionRadio as T}from"./components/SubscriptionRadio.js";import{useDynamicProduct as O}from"../../hooks/useDynamicProduct.js";let ProductSubscription=({styles:k,setting:v,builderProps:C,builderAttrs:E,style:R,children:B})=>{let D=t(),{defaultValue:U,selectedSellingPlan:M,setSelectedSellingPlan:$}=S(v),_=f(v),{selectedValue:x,handleSellingPlanChange:V}=h({defaultValue:U,selectedSellingPlan:M,setSelectedSellingPlan:$,sellingPlanOptions:_}),w=m(null),L=c(),{selectedType:q,shouldShowRadio:z,isOneTimeHidden:A,hasNoSellingPlanOptions:F,setSubscriptionSellingType:G}=y({setting:v}),H=n(g(k)),J=n(u(k?.align)),K=r(p()),Q=r(d()),W=n({...R}),{isEditMode:X}=o(),Y=`product-subscription-${D?.baseID}`,Z=D?.baseID,ee=`subscription-type-selection-${L}`,es=v?.sellingType===a.ONE_TIME,ei=v?.sellingType===a.SUBSCRIPTION,{isDynamicProduct:et}=O();if(A||F||et)return X?e("div",{...E,style:W,children:[s(I,{ref:w,setting:v}),l(B,!0)]}):null;let eo=i=>e("div",{...E,style:W,children:[s("div",{ref:w,"data-selling-type":v?.sellingType,id:Y,className:K,style:J,children:i}),l(B,!0)]}),el=()=>s(i,{children:v?.sellingStyle==="radio"?s(j,{setting:v,styles:k,builderProps:C,productId:Z??"",sellingPlanOptions:_,selectedValue:x,onChange:V}):s(N,{setting:v,sellingPlanOptions:_,selectedValue:x,onChange:V})});return eo(es&&z?s("div",{className:Q,style:H,children:s(T,{id:`${Z}-one-time-radio`,name:ee,value:a.ONE_TIME,checked:q===a.ONE_TIME,className:"!gp-items-start",onChange:e=>{e.target.checked&&G(a.ONE_TIME)},children:s(P,{setting:v,styles:k})})}):ei&&z?e("div",{className:Q,style:H,children:[s(T,{id:`${Z}-subscription-radio`,name:ee,value:a.SUBSCRIPTION,checked:q===a.SUBSCRIPTION,className:"!gp-items-start",onChange:e=>{e.target.checked&&G(a.SUBSCRIPTION)},children:s(P,{setting:v,styles:k})}),q===a.SUBSCRIPTION&&e(i,{children:[s("div",{className:"gp-pl-7",children:el()}),s("div",{className:"gp-pl-7",children:s(b,{setting:v,styles:k})})]})]}):e("div",{className:Q,style:H,children:[s(P,{setting:v,styles:k}),el(),s(b,{setting:v,styles:k})]}))};export{ProductSubscription as default};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Property } from 'csstype';
|
|
|
5
5
|
import * as _gem_sdk_keen_slider from '@gem-sdk/keen-slider';
|
|
6
6
|
import { KeenSliderInstance } from '@gem-sdk/keen-slider';
|
|
7
7
|
import { Swiper } from '@gem-sdk/swiper';
|
|
8
|
-
import React$1, { ReactNode
|
|
8
|
+
import React$1, { ReactNode } from 'react';
|
|
9
9
|
import * as _gem_sdk_swiper_types_swiper_class from '@gem-sdk/swiper/types/swiper-class';
|
|
10
10
|
|
|
11
11
|
type AccordionSettingProps = {
|
|
@@ -3561,9 +3561,9 @@ type PostPurchaseBuyerConsentStyleProps = {
|
|
|
3561
3561
|
textAlign?: AlignItemProp;
|
|
3562
3562
|
typo?: PostPurchaseTypo;
|
|
3563
3563
|
};
|
|
3564
|
-
type PostPurchaseBuyerConsentProps =
|
|
3564
|
+
type PostPurchaseBuyerConsentProps = BasePropsWrap<PostPurchaseBuyerConsentSettingProps, PostPurchaseBuyerConsentStyleProps>;
|
|
3565
3565
|
|
|
3566
|
-
declare const BuyerConsent: FC<PostPurchaseBuyerConsentProps>;
|
|
3566
|
+
declare const BuyerConsent: React.FC<PostPurchaseBuyerConsentProps>;
|
|
3567
3567
|
|
|
3568
3568
|
declare const postPurchaseBuyerConsentSetting: {
|
|
3569
3569
|
PostPurchaseBuyerConsent: _gem_sdk_core.ComponentSetting<PostPurchaseBuyerConsentProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "12.0.0-dev.
|
|
3
|
+
"version": "12.0.0-dev.81",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
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.
|
|
29
|
+
"@gem-sdk/core": "12.0.0-dev.81",
|
|
30
30
|
"@gem-sdk/styles": "12.0.0-dev.71",
|
|
31
31
|
"@gem-sdk/system": "12.0.0-dev.53",
|
|
32
32
|
"@types/react-transition-group": "^4.4.12",
|