@gem-sdk/components 12.0.0-dev.82 → 12.0.0-dev.85
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:
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "12.0.0-dev.85",
|
|
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.
|
|
30
|
-
"@gem-sdk/styles": "12.0.0-dev.
|
|
29
|
+
"@gem-sdk/core": "12.0.0-dev.84",
|
|
30
|
+
"@gem-sdk/styles": "12.0.0-dev.84",
|
|
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",
|