@gem-sdk/core 1.14.0-dev.815 → 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.
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +27 -1
- package/dist/cjs/graphql/queries/preview-page.generated.js +2 -2
- package/dist/cjs/hooks/animation/useAnimationTarget.js +1 -1
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +27 -1
- package/dist/esm/graphql/queries/preview-page.generated.js +3 -3
- package/dist/esm/hooks/animation/useAnimationTarget.js +1 -1
- package/dist/types/index.d.ts +5 -1
- package/package.json +1 -1
|
@@ -27,4 +27,30 @@
|
|
|
27
27
|
...CustomFontSelect
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
`,PreviewThemePageSelect=`
|
|
31
|
+
fragment PreviewThemePageSelect on PublishedThemePage {
|
|
32
|
+
id
|
|
33
|
+
name
|
|
34
|
+
handle
|
|
35
|
+
isMobile
|
|
36
|
+
sectionPosition
|
|
37
|
+
pageSections {
|
|
38
|
+
...PublishedPageSectionSelect
|
|
39
|
+
}
|
|
40
|
+
themePageCustomSections {
|
|
41
|
+
...PublishedCustomSectionSelect
|
|
42
|
+
}
|
|
43
|
+
themePageDataSEO {
|
|
44
|
+
...DataSEOSelect
|
|
45
|
+
}
|
|
46
|
+
pageStyle {
|
|
47
|
+
...PublishedThemeStyleSelect
|
|
48
|
+
}
|
|
49
|
+
themePageAnalytic {
|
|
50
|
+
...AnalyticSelect
|
|
51
|
+
}
|
|
52
|
+
themePageCustomCode {
|
|
53
|
+
...CustomCodeSelect
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`;exports.PreviewThemePageSelect=PreviewThemePageSelect,exports.PublishedThemePageSelect=PublishedThemePageSelect;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";var publishedThemePage_generated=require("../fragments/published-theme-page.generated.js"),publishedPageSection_generated=require("../fragments/published-page-section.generated.js"),publishedCustomSection_generated=require("../fragments/published-custom-section.generated.js"),dataSeo_generated=require("../fragments/data-seo.generated.js"),publishedThemeStyle_generated=require("../fragments/published-theme-style.generated.js"),analytic_generated=require("../fragments/analytic.generated.js"),customCode_generated=require("../fragments/custom-code.generated.js");const PreviewPageDocument=`
|
|
2
2
|
query previewPage($handleURL: String, $pageType: PublishedThemePageType!) {
|
|
3
3
|
previewPage(handleURL: $handleURL, pageType: $pageType) {
|
|
4
|
-
...
|
|
4
|
+
...PreviewThemePageSelect
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
${publishedThemePage_generated.
|
|
7
|
+
${publishedThemePage_generated.PreviewThemePageSelect}
|
|
8
8
|
${publishedPageSection_generated.PublishedPageSectionSelect}
|
|
9
9
|
${publishedCustomSection_generated.PublishedCustomSectionSelect}
|
|
10
10
|
${dataSeo_generated.DataSeoSelect}
|
|
@@ -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.
|
|
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;
|
|
@@ -27,4 +27,30 @@ let PublishedThemePageSelect=`
|
|
|
27
27
|
...CustomFontSelect
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
`,PreviewThemePageSelect=`
|
|
31
|
+
fragment PreviewThemePageSelect on PublishedThemePage {
|
|
32
|
+
id
|
|
33
|
+
name
|
|
34
|
+
handle
|
|
35
|
+
isMobile
|
|
36
|
+
sectionPosition
|
|
37
|
+
pageSections {
|
|
38
|
+
...PublishedPageSectionSelect
|
|
39
|
+
}
|
|
40
|
+
themePageCustomSections {
|
|
41
|
+
...PublishedCustomSectionSelect
|
|
42
|
+
}
|
|
43
|
+
themePageDataSEO {
|
|
44
|
+
...DataSEOSelect
|
|
45
|
+
}
|
|
46
|
+
pageStyle {
|
|
47
|
+
...PublishedThemeStyleSelect
|
|
48
|
+
}
|
|
49
|
+
themePageAnalytic {
|
|
50
|
+
...AnalyticSelect
|
|
51
|
+
}
|
|
52
|
+
themePageCustomCode {
|
|
53
|
+
...CustomCodeSelect
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`;export{PreviewThemePageSelect,PublishedThemePageSelect};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{PreviewThemePageSelect as e}from"../fragments/published-theme-page.generated.js";import{PublishedPageSectionSelect as r}from"../fragments/published-page-section.generated.js";import{PublishedCustomSectionSelect as t}from"../fragments/published-custom-section.generated.js";import{DataSeoSelect as a}from"../fragments/data-seo.generated.js";import{PublishedThemeStyleSelect as m}from"../fragments/published-theme-style.generated.js";import{AnalyticSelect as g}from"../fragments/analytic.generated.js";import{CustomCodeSelect as s}from"../fragments/custom-code.generated.js";let PreviewPageDocument=`
|
|
2
2
|
query previewPage($handleURL: String, $pageType: PublishedThemePageType!) {
|
|
3
3
|
previewPage(handleURL: $handleURL, pageType: $pageType) {
|
|
4
|
-
...
|
|
4
|
+
...PreviewThemePageSelect
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
${e}
|
|
8
|
-
${t}
|
|
9
8
|
${r}
|
|
9
|
+
${t}
|
|
10
10
|
${a}
|
|
11
11
|
${m}
|
|
12
12
|
${g}
|
|
@@ -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:
|
|
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};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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;
|