@gem-sdk/core 1.14.0-dev.816 → 1.14.0-dev.821

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";var react=require("react"),useAnimationConfig=require("./useAnimationConfig.js");const SPACING_ACTIVE_ATTRIBUTE="data-spacing",TOOLBAR_ACTIVE_ATTRIBUTE="data-toolbar-active",OUTLINE_ACTIVE_ATTRIBUTE="data-outline-active",TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE="data-toolbar-add-active",useAnimationTarget=t=>{let{isEnabledAnimation:e}=useAnimationConfig.useAnimationConfig(t),r=t.tag,a=t.uid,o=react.useRef(null),u=react.useRef([]),T=t=>{if(u.current)for(let e of u.current)t?(e.toolbar?.setAttribute(TOOLBAR_ACTIVE_ATTRIBUTE,"true"),e.outline?.setAttribute(OUTLINE_ACTIVE_ATTRIBUTE,"true"),e.spacing?.setAttribute(SPACING_ACTIVE_ATTRIBUTE,"true"),e.addSectionTop?.setAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE,"true"),e.addSectionBottom?.setAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE,"true")):(e.toolbar?.removeAttribute(TOOLBAR_ACTIVE_ATTRIBUTE),e.outline?.removeAttribute(OUTLINE_ACTIVE_ATTRIBUTE),e.spacing?.removeAttribute(SPACING_ACTIVE_ATTRIBUTE),e.addSectionTop?.removeAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE),e.addSectionBottom?.removeAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE))},i=t=>{let e=t.querySelector("[data-toolbar-add-top]"),r=t.querySelector("[data-toolbar-add-bottom]"),a=Array.from(t.children),o=a.find(t=>null!==t.getAttribute("data-toolbar")),u=a.find(t=>null!==t.getAttribute("data-outline"));return{sectionToolbar:o,sectionOutline:u,sectionAddTop:e,sectionAddBottom:r}},n=react.useCallback(t=>t.reduce((t,e)=>{let a=null,o=null,u=e,T=e.querySelector("[data-toolbar][data-toolbar-active]"),n=e.querySelector("[data-outline][data-outline-active]"),A=Array.from(u.children),c=A.find(t=>null!==t.getAttribute("data-spacing"));switch(r){case"Button":case"SubmitButton":case"ProductButton":case"DynamicCheckout":u=e.querySelector(".gp-button-base");break;case"ProductProperties":u=e.querySelector("input");break;case"Icon":u=e.firstElementChild;break;case"ProductTag":u=e?.children[0]?.children[0];break;case"Section":{u=e;let{sectionOutline:t,sectionToolbar:r,sectionAddTop:A,sectionAddBottom:c}=i(u);n=t,T=r,a=A,o=c;break}default:u=e}let l={target:u,toolbar:T,outline:n,spacing:c,addSectionTop:a,addSectionBottom:o};return t.push(l),t},[]),[r]),A=react.useCallback(()=>{if(!e)return;o.current||(o.current=document.querySelectorAll(`[data-uid="${a}"]`));let t=Array.from(o.current);if(!t.length)return;let r=n(t);u.current=r},[a,n,e]);return{targetObjects:u,setToolbarActive:T,initListOfTargets:A}};exports.useAnimationTarget=useAnimationTarget;
1
+ "use strict";var react=require("react"),useAnimationConfig=require("./useAnimationConfig.js");const SPACING_ACTIVE_ATTRIBUTE="data-spacing-margin-bottom-active",TOOLBAR_ACTIVE_ATTRIBUTE="data-toolbar-active",OUTLINE_ACTIVE_ATTRIBUTE="data-outline-active",TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE="data-toolbar-add-active",useAnimationTarget=t=>{let{isEnabledAnimation:e}=useAnimationConfig.useAnimationConfig(t),r=t.tag,a=t.uid,o=react.useRef(null),u=react.useRef([]),T=t=>{if(u.current)for(let e of u.current)t?(e.toolbar?.setAttribute(TOOLBAR_ACTIVE_ATTRIBUTE,"true"),e.outline?.setAttribute(OUTLINE_ACTIVE_ATTRIBUTE,"true"),e.spacing?.setAttribute(SPACING_ACTIVE_ATTRIBUTE,"true"),e.addSectionTop?.setAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE,"true"),e.addSectionBottom?.setAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE,"true")):(e.toolbar?.removeAttribute(TOOLBAR_ACTIVE_ATTRIBUTE),e.outline?.removeAttribute(OUTLINE_ACTIVE_ATTRIBUTE),e.spacing?.removeAttribute(SPACING_ACTIVE_ATTRIBUTE),e.addSectionTop?.removeAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE),e.addSectionBottom?.removeAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE))},i=t=>{let e=t.querySelector("[data-toolbar-add-top]"),r=t.querySelector("[data-toolbar-add-bottom]"),a=Array.from(t.children),o=a.find(t=>null!==t.getAttribute("data-toolbar")),u=a.find(t=>null!==t.getAttribute("data-outline"));return{sectionToolbar:o,sectionOutline:u,sectionAddTop:e,sectionAddBottom:r}},n=react.useCallback(t=>t.reduce((t,e)=>{let a=null,o=null,u=e,T=e.querySelector("[data-toolbar][data-toolbar-active]"),n=e.querySelector("[data-outline][data-outline-active]"),A=Array.from(u.children),c=A.find(t=>{let e=t.getAttribute("data-spacing");return null!==e&&t.querySelector("[data-spacing-margin-bottom")});switch(r){case"Button":case"SubmitButton":case"ProductButton":case"DynamicCheckout":u=e.querySelector(".gp-button-base");break;case"ProductProperties":u=e.querySelector("input");break;case"Icon":u=e.firstElementChild;break;case"ProductTag":u=e?.children[0]?.children[0];break;case"Section":{u=e;let{sectionOutline:t,sectionToolbar:r,sectionAddTop:A,sectionAddBottom:c}=i(u);n=t,T=r,a=A,o=c;break}default:u=e}let l={target:u,toolbar:T,outline:n,spacing:c,addSectionTop:a,addSectionBottom:o};return t.push(l),t},[]),[r]),A=react.useCallback(()=>{if(!e)return;o.current||(o.current=document.querySelectorAll(`[data-uid="${a}"]`));let t=Array.from(o.current);if(!t.length)return;let r=n(t);u.current=r},[a,n,e]);return{targetObjects:u,setToolbarActive:T,initListOfTargets:A}};exports.useAnimationTarget=useAnimationTarget;
@@ -1 +1 @@
1
- import{useRef as t,useCallback as e}from"react";import{useAnimationConfig as r}from"./useAnimationConfig.js";let SPACING_ACTIVE_ATTRIBUTE="data-spacing",TOOLBAR_ACTIVE_ATTRIBUTE="data-toolbar-active",OUTLINE_ACTIVE_ATTRIBUTE="data-outline-active",TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE="data-toolbar-add-active",useAnimationTarget=a=>{let{isEnabledAnimation:T}=r(a),o=a.tag,u=a.uid,A=t(null),i=t([]),n=t=>{if(i.current)for(let e of i.current)t?(e.toolbar?.setAttribute(TOOLBAR_ACTIVE_ATTRIBUTE,"true"),e.outline?.setAttribute(OUTLINE_ACTIVE_ATTRIBUTE,"true"),e.spacing?.setAttribute(SPACING_ACTIVE_ATTRIBUTE,"true"),e.addSectionTop?.setAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE,"true"),e.addSectionBottom?.setAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE,"true")):(e.toolbar?.removeAttribute(TOOLBAR_ACTIVE_ATTRIBUTE),e.outline?.removeAttribute(OUTLINE_ACTIVE_ATTRIBUTE),e.spacing?.removeAttribute(SPACING_ACTIVE_ATTRIBUTE),e.addSectionTop?.removeAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE),e.addSectionBottom?.removeAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE))},l=t=>{let e=t.querySelector("[data-toolbar-add-top]"),r=t.querySelector("[data-toolbar-add-bottom]"),a=Array.from(t.children),T=a.find(t=>null!==t.getAttribute("data-toolbar")),o=a.find(t=>null!==t.getAttribute("data-outline"));return{sectionToolbar:T,sectionOutline:o,sectionAddTop:e,sectionAddBottom:r}},c=e(t=>t.reduce((t,e)=>{let r=null,a=null,T=e,u=e.querySelector("[data-toolbar][data-toolbar-active]"),A=e.querySelector("[data-outline][data-outline-active]"),i=Array.from(T.children),n=i.find(t=>null!==t.getAttribute("data-spacing"));switch(o){case"Button":case"SubmitButton":case"ProductButton":case"DynamicCheckout":T=e.querySelector(".gp-button-base");break;case"ProductProperties":T=e.querySelector("input");break;case"Icon":T=e.firstElementChild;break;case"ProductTag":T=e?.children[0]?.children[0];break;case"Section":{T=e;let{sectionOutline:t,sectionToolbar:o,sectionAddTop:i,sectionAddBottom:n}=l(T);A=t,u=o,r=i,a=n;break}default:T=e}let c={target:T,toolbar:u,outline:A,spacing:n,addSectionTop:r,addSectionBottom:a};return t.push(c),t},[]),[o]),d=e(()=>{if(!T)return;A.current||(A.current=document.querySelectorAll(`[data-uid="${u}"]`));let t=Array.from(A.current);if(!t.length)return;let e=c(t);i.current=e},[u,c,T]);return{targetObjects:i,setToolbarActive:n,initListOfTargets:d}};export{useAnimationTarget};
1
+ import{useRef as t,useCallback as e}from"react";import{useAnimationConfig as r}from"./useAnimationConfig.js";let SPACING_ACTIVE_ATTRIBUTE="data-spacing-margin-bottom-active",TOOLBAR_ACTIVE_ATTRIBUTE="data-toolbar-active",OUTLINE_ACTIVE_ATTRIBUTE="data-outline-active",TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE="data-toolbar-add-active",useAnimationTarget=a=>{let{isEnabledAnimation:o}=r(a),T=a.tag,u=a.uid,i=t(null),A=t([]),n=t=>{if(A.current)for(let e of A.current)t?(e.toolbar?.setAttribute(TOOLBAR_ACTIVE_ATTRIBUTE,"true"),e.outline?.setAttribute(OUTLINE_ACTIVE_ATTRIBUTE,"true"),e.spacing?.setAttribute(SPACING_ACTIVE_ATTRIBUTE,"true"),e.addSectionTop?.setAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE,"true"),e.addSectionBottom?.setAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE,"true")):(e.toolbar?.removeAttribute(TOOLBAR_ACTIVE_ATTRIBUTE),e.outline?.removeAttribute(OUTLINE_ACTIVE_ATTRIBUTE),e.spacing?.removeAttribute(SPACING_ACTIVE_ATTRIBUTE),e.addSectionTop?.removeAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE),e.addSectionBottom?.removeAttribute(TOOLBAR_ADD_SECTION_ACTIVE_ATTRIBUTE))},l=t=>{let e=t.querySelector("[data-toolbar-add-top]"),r=t.querySelector("[data-toolbar-add-bottom]"),a=Array.from(t.children),o=a.find(t=>null!==t.getAttribute("data-toolbar")),T=a.find(t=>null!==t.getAttribute("data-outline"));return{sectionToolbar:o,sectionOutline:T,sectionAddTop:e,sectionAddBottom:r}},c=e(t=>t.reduce((t,e)=>{let r=null,a=null,o=e,u=e.querySelector("[data-toolbar][data-toolbar-active]"),i=e.querySelector("[data-outline][data-outline-active]"),A=Array.from(o.children),n=A.find(t=>{let e=t.getAttribute("data-spacing");return null!==e&&t.querySelector("[data-spacing-margin-bottom")});switch(T){case"Button":case"SubmitButton":case"ProductButton":case"DynamicCheckout":o=e.querySelector(".gp-button-base");break;case"ProductProperties":o=e.querySelector("input");break;case"Icon":o=e.firstElementChild;break;case"ProductTag":o=e?.children[0]?.children[0];break;case"Section":{o=e;let{sectionOutline:t,sectionToolbar:T,sectionAddTop:A,sectionAddBottom:n}=l(o);i=t,u=T,r=A,a=n;break}default:o=e}let c={target:o,toolbar:u,outline:i,spacing:n,addSectionTop:r,addSectionBottom:a};return t.push(c),t},[]),[T]),d=e(()=>{if(!o)return;i.current||(i.current=document.querySelectorAll(`[data-uid="${u}"]`));let t=Array.from(i.current);if(!t.length)return;let e=c(t);A.current=e},[u,c,o]);return{targetObjects:A,setToolbarActive:n,initListOfTargets:d}};export{useAnimationTarget};
@@ -7377,6 +7377,10 @@ type VariantSwatchesPresetControlType<T> = SharedControlType<T> & {
7377
7377
  id?: string;
7378
7378
  type: 'variant:presets';
7379
7379
  };
7380
+ type VariantSwatchesOnlyDefaultVariantControlType<T> = SharedControlType<T> & {
7381
+ id?: string;
7382
+ type: 'variant:default';
7383
+ };
7380
7384
 
7381
7385
  type LayoutControlType<T> = SharedControlType<T> & {
7382
7386
  type: 'layout';
@@ -7691,7 +7695,7 @@ type PostPurchaseTextareaControlType<T> = SharedControlType<T> & {
7691
7695
  }[];
7692
7696
  };
7693
7697
 
7694
- type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | ProductListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | BackgroundColorPickerType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | SneakPeakControlType<T> | PostPurchaseTextareaControlType<T>;
7698
+ type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | BackgroundColorPickerType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | SneakPeakControlType<T> | PostPurchaseTextareaControlType<T>;
7695
7699
  type ControlTriggerAction = {
7696
7700
  controlId: string;
7697
7701
  newValue?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.14.0-dev.816",
3
+ "version": "1.14.0-dev.821",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",