@gem-sdk/core 1.14.0-dev.702 → 1.14.0-dev.705
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/components/constant.js +1 -1
- package/dist/cjs/components/toolbar/Tooltip.js +1 -1
- package/dist/cjs/hooks/useToolbarPostPurchase.js +1 -1
- package/dist/esm/components/constant.js +1 -1
- package/dist/esm/components/toolbar/Tooltip.js +1 -1
- package/dist/esm/hooks/useToolbarPostPurchase.js +1 -1
- package/dist/types/index.d.ts +6 -8
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductImages","ProductImagesV2","Sticky","Heading"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs"],excludeApplyStyle=["IconListV2","IconList"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductPriceBreakdown"],postPurchaseWrapElements=["
|
|
1
|
+
"use strict";const disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductImages","ProductImagesV2","Sticky","Heading"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs"],excludeApplyStyle=["IconListV2","IconList"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductPriceBreakdown","PostPurchaseCalloutText"],postPurchaseWrapElements=["Row","Section","PostPurchaseCalloutBox","PostPurchaseProductOffer"];exports.customRenderChildren=customRenderChildren,exports.disableWrap=disableWrap,exports.excludeApplyStyle=excludeApplyStyle,exports.postPurchaseRequiredElements=postPurchaseRequiredElements,exports.postPurchaseWrapElements=postPurchaseWrapElements;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime");function Tooltip({children:t,enable:e,text:o="Tooltip Text",position:i="right",width:r,...l}){return jsxRuntime.jsxs("div",{...l,"data-toolbar-tooltip-trigger":!0,children:[t,e&&jsxRuntime.jsx("div",{style:{width:r
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime");function Tooltip({children:t,enable:e,text:o="Tooltip Text",position:i="right",width:r,...l}){return jsxRuntime.jsxs("div",{...l,"data-toolbar-tooltip-trigger":!0,children:[t,e&&jsxRuntime.jsx("div",{style:{width:r,zIndex:50},"data-toolbar-tooltip":!0,"data-toolbar-tooltip-position":i,dangerouslySetInnerHTML:{__html:o}})]})}exports.default=Tooltip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var constant=require("../components/constant.js"),ShopContext=require("../contexts/ShopContext.js");const usePostPurchase=(e,t)=>{let
|
|
1
|
+
"use strict";var constant=require("../components/constant.js"),ShopContext=require("../contexts/ShopContext.js");const usePostPurchase=(e,t)=>{let r=ShopContext.useShopStore(e=>e.pageType),n=(e,r)=>{let n=e||t,o=0,s=(r||document).querySelectorAll(`[data-component-tag="${n}"]`);if("PostPurchaseProductOffer"===n)return s.length;let u="";return s.forEach(e=>{let t=e.closest('[data-component-tag="PostPurchaseProductOffer"]'),r=t?.getAttribute("data-uid")||"",s=e.closest('[data-component-tag="Product"]'),c=s?.querySelectorAll(`[data-component-tag="${n}"]`).length||0,a=t?r!==u?c:0:1;t&&(u=r),o+=a}),o},o=()=>{let e=n();return e<=1},s=()=>{let t=document.querySelector(`[data-uid="${e}"]`);if(!t)return!1;for(let e of constant.postPurchaseRequiredElements){let r=n(e),o=n(e,t);if(o>0&&r-o<1)return!0}return!1},u=constant.postPurchaseRequiredElements.reduce((t,r)=>{let n=document.querySelector(`[data-uid="${e}"]`);if(!n)return 0;let o=n.querySelectorAll(`[data-component-tag="${r}"]`).length;return t+o},0),c=()=>{if("POST_PURCHASE"!==r)return!1;let e=!1;return constant.postPurchaseRequiredElements.includes(t)&&(e=o())?e:!!constant.postPurchaseWrapElements.includes(t)&&u>0&&s()},a=()=>{if(constant.postPurchaseRequiredElements.includes(t))return{text:"This element is required <br> and can’t be deleted",width:"175px"};{let e="Section"===t?"section":"element";return{text:`This ${e} contains required <br> elements and cannot be deleted`,width:"206px"}}};return{isUnableDelete:c,tooltipText:a,isDisableDuplicate:()=>"GP_FUNNEL_PAGE"===r&&"ProductList"===t}};exports.usePostPurchase=usePostPurchase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductImages","ProductImagesV2","Sticky","Heading"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs"],excludeApplyStyle=["IconListV2","IconList"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductPriceBreakdown"],postPurchaseWrapElements=["
|
|
1
|
+
let disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductImages","ProductImagesV2","Sticky","Heading"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs"],excludeApplyStyle=["IconListV2","IconList"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductPriceBreakdown","PostPurchaseCalloutText"],postPurchaseWrapElements=["Row","Section","PostPurchaseCalloutBox","PostPurchaseProductOffer"];export{customRenderChildren,disableWrap,excludeApplyStyle,postPurchaseRequiredElements,postPurchaseWrapElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as o}from"react/jsx-runtime";function Tooltip({children:i,enable:r,text:
|
|
1
|
+
import{jsxs as t,jsx as o}from"react/jsx-runtime";function Tooltip({children:i,enable:r,text:l="Tooltip Text",position:a="right",width:e,...d}){return t("div",{...d,"data-toolbar-tooltip-trigger":!0,children:[i,r&&o("div",{style:{width:e,zIndex:50},"data-toolbar-tooltip":!0,"data-toolbar-tooltip-position":a,dangerouslySetInnerHTML:{__html:l}})]})}export{Tooltip as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{postPurchaseRequiredElements as e,postPurchaseWrapElements as t}from"../components/constant.js";import{useShopStore as
|
|
1
|
+
import{postPurchaseRequiredElements as e,postPurchaseWrapElements as t}from"../components/constant.js";import{useShopStore as r}from"../contexts/ShopContext.js";let usePostPurchase=(n,o)=>{let u=r(e=>e.pageType),l=(e,t)=>{let r=e||o,n=0,u=(t||document).querySelectorAll(`[data-component-tag="${r}"]`);if("PostPurchaseProductOffer"===r)return u.length;let l="";return u.forEach(e=>{let t=e.closest('[data-component-tag="PostPurchaseProductOffer"]'),o=t?.getAttribute("data-uid")||"",u=e.closest('[data-component-tag="Product"]'),c=u?.querySelectorAll(`[data-component-tag="${r}"]`).length||0,a=t?o!==l?c:0:1;t&&(l=o),n+=a}),n},c=()=>{let e=l();return e<=1},a=()=>{let t=document.querySelector(`[data-uid="${n}"]`);if(!t)return!1;for(let r of e){let e=l(r),n=l(r,t);if(n>0&&e-n<1)return!0}return!1},d=e.reduce((e,t)=>{let r=document.querySelector(`[data-uid="${n}"]`);if(!r)return 0;let o=r.querySelectorAll(`[data-component-tag="${t}"]`).length;return e+o},0),s=()=>{if("POST_PURCHASE"!==u)return!1;let r=!1;return e.includes(o)&&(r=c())?r:!!t.includes(o)&&d>0&&a()},i=()=>{if(e.includes(o))return{text:"This element is required <br> and can’t be deleted",width:"175px"};{let e="Section"===o?"section":"element";return{text:`This ${e} contains required <br> elements and cannot be deleted`,width:"206px"}}};return{isUnableDelete:s,tooltipText:i,isDisableDuplicate:()=>"GP_FUNNEL_PAGE"===u&&"ProductList"===o}};export{usePostPurchase};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7289,19 +7289,17 @@ type ProductInputCurrencyUnitControlType<T> = SharedControlType<T> & {
|
|
|
7289
7289
|
type PostPurchaseFontSize = 'default' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
7290
7290
|
type PostPurchaseFontWeight = 'normal' | 'bold';
|
|
7291
7291
|
type PostPurchaseTextTransform = 'none' | 'uppercase' | 'capitalize' | 'lowercase';
|
|
7292
|
-
type PostPurchaseTextColor = 'success' | 'warning' | 'critical' | 'default';
|
|
7292
|
+
type PostPurchaseTextColor = 'success' | 'warning' | 'critical' | 'default' | 'defaultButton' | 'defaultLink';
|
|
7293
7293
|
type PostPurchaseTypo = {
|
|
7294
|
-
fontSize
|
|
7295
|
-
fontWeight
|
|
7296
|
-
textTransform
|
|
7297
|
-
textColor
|
|
7294
|
+
fontSize?: PostPurchaseFontSize;
|
|
7295
|
+
fontWeight?: PostPurchaseFontWeight;
|
|
7296
|
+
textTransform?: PostPurchaseTextTransform;
|
|
7297
|
+
textColor?: PostPurchaseTextColor;
|
|
7298
7298
|
};
|
|
7299
7299
|
type TypographyPostPurchaseControlType<T> = SharedControlType<T> & {
|
|
7300
7300
|
type: 'typography-post-purchase';
|
|
7301
7301
|
default?: PostPurchaseTypo;
|
|
7302
|
-
|
|
7303
|
-
align?: boolean;
|
|
7304
|
-
};
|
|
7302
|
+
hiddenColorSetting?: boolean;
|
|
7305
7303
|
};
|
|
7306
7304
|
|
|
7307
7305
|
type ProductOffersControlType<T> = SharedControlType<T> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.14.0-dev.
|
|
3
|
+
"version": "1.14.0-dev.705",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@gem-sdk/adapter-shopify": "1.14.0-dev.619",
|
|
28
|
-
"@gem-sdk/styles": "1.14.0-dev.
|
|
28
|
+
"@gem-sdk/styles": "1.14.0-dev.705"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-error-boundary": "4.0.10",
|