@gem-sdk/core 1.57.11 → 1.57.12
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.
|
@@ -19,6 +19,9 @@ require('../convert.js');
|
|
|
19
19
|
const useInteraction = ()=>{
|
|
20
20
|
const ref = react.useRef();
|
|
21
21
|
const setInteractionIsSelectOnPage = PageContext.usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
22
|
+
const sidebarMode = PageContext.usePageStore((s)=>s.sidebarMode);
|
|
23
|
+
const selectType = PageContext.usePageStore((s)=>s.interactionData?.selectType);
|
|
24
|
+
const interactionData = PageContext.usePageStore((s)=>s.interactionData);
|
|
22
25
|
function findElementIncludingSelf(element, selector) {
|
|
23
26
|
if (!(element instanceof Document) && element?.matches(selector)) {
|
|
24
27
|
return element;
|
|
@@ -89,6 +92,14 @@ const useInteraction = ()=>{
|
|
|
89
92
|
});
|
|
90
93
|
window.dispatchEvent(event);
|
|
91
94
|
};
|
|
95
|
+
const isInteractionMode = react.useMemo(()=>sidebarMode === 'interaction' && (!interactionData?.isSelectOnPage || selectType === 'PAGE'), [
|
|
96
|
+
sidebarMode,
|
|
97
|
+
interactionData?.isSelectOnPage,
|
|
98
|
+
selectType
|
|
99
|
+
]);
|
|
100
|
+
const isSelectOnPage = react.useMemo(()=>interactionData?.isSelectOnPage, [
|
|
101
|
+
interactionData?.isSelectOnPage
|
|
102
|
+
]);
|
|
92
103
|
return {
|
|
93
104
|
onListener,
|
|
94
105
|
trigger,
|
|
@@ -98,7 +109,9 @@ const useInteraction = ()=>{
|
|
|
98
109
|
findElementIncludingSelf,
|
|
99
110
|
getInteractionPreviousData,
|
|
100
111
|
changeSelectMode,
|
|
101
|
-
selectInteractionElement
|
|
112
|
+
selectInteractionElement,
|
|
113
|
+
isInteractionMode,
|
|
114
|
+
isSelectOnPage
|
|
102
115
|
};
|
|
103
116
|
};
|
|
104
117
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
1
|
+
import { useRef, useMemo } from 'react';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'zustand';
|
|
4
4
|
import 'swr';
|
|
@@ -17,6 +17,9 @@ import '../convert.js';
|
|
|
17
17
|
const useInteraction = ()=>{
|
|
18
18
|
const ref = useRef();
|
|
19
19
|
const setInteractionIsSelectOnPage = usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
20
|
+
const sidebarMode = usePageStore((s)=>s.sidebarMode);
|
|
21
|
+
const selectType = usePageStore((s)=>s.interactionData?.selectType);
|
|
22
|
+
const interactionData = usePageStore((s)=>s.interactionData);
|
|
20
23
|
function findElementIncludingSelf(element, selector) {
|
|
21
24
|
if (!(element instanceof Document) && element?.matches(selector)) {
|
|
22
25
|
return element;
|
|
@@ -87,6 +90,14 @@ const useInteraction = ()=>{
|
|
|
87
90
|
});
|
|
88
91
|
window.dispatchEvent(event);
|
|
89
92
|
};
|
|
93
|
+
const isInteractionMode = useMemo(()=>sidebarMode === 'interaction' && (!interactionData?.isSelectOnPage || selectType === 'PAGE'), [
|
|
94
|
+
sidebarMode,
|
|
95
|
+
interactionData?.isSelectOnPage,
|
|
96
|
+
selectType
|
|
97
|
+
]);
|
|
98
|
+
const isSelectOnPage = useMemo(()=>interactionData?.isSelectOnPage, [
|
|
99
|
+
interactionData?.isSelectOnPage
|
|
100
|
+
]);
|
|
90
101
|
return {
|
|
91
102
|
onListener,
|
|
92
103
|
trigger,
|
|
@@ -96,7 +107,9 @@ const useInteraction = ()=>{
|
|
|
96
107
|
findElementIncludingSelf,
|
|
97
108
|
getInteractionPreviousData,
|
|
98
109
|
changeSelectMode,
|
|
99
|
-
selectInteractionElement
|
|
110
|
+
selectInteractionElement,
|
|
111
|
+
isInteractionMode,
|
|
112
|
+
isSelectOnPage
|
|
100
113
|
};
|
|
101
114
|
};
|
|
102
115
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -41539,7 +41539,7 @@ declare const getAppBlocks: (section: PublishedPageSection$1 & {
|
|
|
41539
41539
|
declare const addAppBlockId: (component: Component) => Component;
|
|
41540
41540
|
|
|
41541
41541
|
declare const useInteraction: () => {
|
|
41542
|
-
onListener: ({ event, selector, elementRef }: {
|
|
41542
|
+
onListener: ({ event, selector, elementRef, }: {
|
|
41543
41543
|
event: string;
|
|
41544
41544
|
selector: string;
|
|
41545
41545
|
elementRef?: React.MutableRefObject<HTMLElement> | undefined;
|
|
@@ -41564,6 +41564,8 @@ declare const useInteraction: () => {
|
|
|
41564
41564
|
settingType: string;
|
|
41565
41565
|
$target: HTMLElement;
|
|
41566
41566
|
}) => void;
|
|
41567
|
+
isInteractionMode: boolean;
|
|
41568
|
+
isSelectOnPage: boolean | undefined;
|
|
41567
41569
|
};
|
|
41568
41570
|
|
|
41569
41571
|
export { AddOn, AddonProvider, AddonProviderProps, AdvancedType, AirProductReview, AliReviewsWidgetType, AlignItemProp, AlignProp, AnimationBaseSetting, AnimationConfig, AnimationDirectionType, AnimationEasingType, AnimationFadeSettingType, AnimationSetting, AnimationSettingType, AnimationShakeSettingType, AnimationSlideSettingType, AnimationTrigger, AnimationTriggerType, AnimationType, AnimationZoomDirectionType, AnimationZoomSettingType, appAPI as AppAPIType, ArticleListProvider, ArticleListProviderProps, ArticleProvider, ArticleProviderProps, Background, BaseProps, BasePropsWrap, BlockEntity, BogosWidgetType, BoldSubscriptionsWidgetType, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CSSStateKey, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionSelectFragment, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentPreset, ComponentSetting, ContainerProp, ControlProp, ControlTriggerAction, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, DynamicCollection, DynamicProduct, ExtractState, FastBundleWidgetType, FeraReviewsV3WidgetType, FeraReviewsWidgetType, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GRADIENT_BGR_KEY, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, GrowaveWidgetTypeV1, GrowaveWidgetTypeV2, HSLAColorType, HSLColorType, HexColorType, ImageShape$1 as ImageShape, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, Interaction, InteractionCondition, InteractionElement, InteractionTarget, InteractionTargetEvent, InteractionTargetEventObject, InteractionTriggerEvent, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsAdvancedWidgetType, LaiProductReviewsWidgetType, LibrarySaleFunnelDocument, LibrarySaleFunnelQueryResponse, LibrarySaleFunnelQueryVariables, LibraryTemplateDocument, LibraryTemplateQueryResponse, LibraryTemplateQueryVariables, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices$1 as NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OmnisendWidgetType, OnlyOne, OpinewDesignWidgetType, OpinewWidgetType, OptionNormalStyle, OptionSpecialStyle, Options, PageContext, PageProvider, PageProviderProps, PageType, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PostPurchaseTypo, PreOrderNowWodWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductOffer, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublicStoreFrontData, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, Ratio$1 as Ratio, RawChild, RenderMemo as Render, RenderChildren, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveKey, ResponsiveStateProp, RivyoWidgetType, RoundedSize, RyviuWidgetType, SaleFunnelDiscount$1 as SaleFunnelDiscount, SaleFunnelDiscountEdge$1 as SaleFunnelDiscountEdge, SaleFunnelDiscountObjectType$1 as SaleFunnelDiscountObjectType, SaleFunnelDiscountType$1 as SaleFunnelDiscountType, SaleFunnelDiscountValueType$1 as SaleFunnelDiscountValueType, SaleFunnelDiscountsDocument, SaleFunnelDiscountsQueryResponse, SaleFunnelDiscountsQueryVariables, Scalars$1 as Scalars, ScaleByDirection, SectionData, SectionEntity, SectionProvider, SectionProviderProps, SettingByAnimationType, SettingByAnimationValues, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopLibraryPageDocument, ShopLibraryPageQueryResponse, ShopLibraryPageQueryVariables, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeSettingGlobal, SizeType, SpacingType, StampedWidgetType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TagShopWidgetType, ThemePageDocument, ThemePageQueryResponse, ThemePageQueryVariables, ThemeSectionStatus$1 as ThemeSectionStatus, TransformProp, TriggerConfig, TrustooWidgetType, TypographyProps, TypographySetting, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, UltimateSalesBoostWidgetType, VariantSelectFragment, VitalsWidgetType, WiserV2WidgetType, WiserWidgetType, WrapRenderChildren, YotpoReviewsWidgetType, addAppBlockId, animations, baseAssetURL, calculateFirstProduct, checkAvailableVariantInStock, checkInStock, cls, composeAdvanceStyle, composeAdvanceStyleForPostPurchase, composeBackgroundCss, composeBorderCss, composeCornerCss, composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeGridLayout, composeMemo, composePositionLineHeight, composePostionIconList, composeRadius, composeRadiusResponsive, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, convertHTML, convertOldLayout, convertTextAlignToJustify, dataStringify, fetchMedias, fetchVariants, filterAttrInStyle, filterCornerInStyle, filterToolbarPreview, flattenConnection, formatMoney, fpixel, genSizeClass, genTypoClass, genVariable, generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey, getAppBlocks, getAspectRatioGlobalSize, getBgImageByDevice, getBorderRadiusStyle, getBorderStyle, getCarouselContainerHeight, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getGlobalSizeGap, getGradientBgrStyleByDevice, getGradientBgrStyleForButton, getHeightByShapeGlobalSize, getPaddingGlobalSize, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveStyleShadow, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleBgColor, getStyleShadow, getStyleShadowState, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isColumnDirectionExist, isDefined, isEmptyChildren, isLocalEnv, isSafari, loadScript, makeAspectRatio, makeContainerWidthOrHeight, makeDotGapToCarouselStyle, makeFixedBgAttachment, makeGlobalSize, makeGlobalSizeHeightResponsive, makeGlobalSizeIcon, makeGlobalSizeWidthResponsive, makeHeight, makeLineClamp, makeStyle, makeStyleKey, makeStyleResponsive, makeStyleResponsiveByScreen, makeStyleResponsiveState, makeStyleState, makeStyleWithDefault, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeAttrInStyle, removeNullUndefined, removePaddingYInStyle, removeUndefinedValuesFromObject, shopifyPriceRounding, splitStyle, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useArticleListStore, useArticleStore, useArticlesQuery, useBlogsQuery, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckAvailableVariantInStock, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useHasPreSelected, useInitialSwatchesOptions, useInteraction, useIsSampleProduct, useIsStorefrontProduct, useIsSyncProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, useMoneyFormat, usePageStore, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductOfferDiscount, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useProductsQueryAll, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.57.
|
|
3
|
+
"version": "1.57.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@gem-sdk/adapter-shopify": "1.57.0",
|
|
31
|
-
"@gem-sdk/styles": "1.57.
|
|
31
|
+
"@gem-sdk/styles": "1.57.12",
|
|
32
32
|
"@types/classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|