@gem-sdk/core 1.48.0-dev.89 → 1.48.0-dev.91

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.
@@ -14,10 +14,13 @@ require('react-transition-group');
14
14
  require('@gem-sdk/core');
15
15
  require('classnames');
16
16
  require('dayjs');
17
+ var index = require('../helpers/interaction/index.js');
17
18
  require('../helpers/convert.js');
18
19
 
19
20
  const InteractionSuffix = ({ tag, uid })=>{
21
+ const { closeSelectOnPage } = index.useInteraction();
20
22
  const currentInteraction = PageContext.usePageStore((s)=>s.interactionData?.item);
23
+ const isSelectOnPage = PageContext.usePageStore((s)=>s.interactionData?.isSelectOnPage);
21
24
  const isCurrentInteractionTarget = react.useMemo(()=>{
22
25
  return currentInteraction?.targets?.find((t)=>t.uid === uid);
23
26
  }, [
@@ -50,6 +53,11 @@ const InteractionSuffix = ({ tag, uid })=>{
50
53
  }
51
54
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
52
55
  children: [
56
+ isSelectOnPage && /*#__PURE__*/ jsxRuntime.jsx("button", {
57
+ className: "gp-bg-[#F4F4F4] gp-px-2 gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-sm gp-font-medium gp-hidden interaction-use-element-btn",
58
+ onClick: closeSelectOnPage,
59
+ children: "Use element"
60
+ }),
53
61
  /*#__PURE__*/ jsxRuntime.jsx("div", {
54
62
  className: "hidden gp-left-[-40px] gp-left-[-80px] gp-right-[-40px] gp-right-[-80px]"
55
63
  }),
@@ -1,6 +1,23 @@
1
1
  'use strict';
2
2
 
3
+ require('react/jsx-runtime');
4
+ require('zustand');
5
+ require('react');
6
+ require('swr');
7
+ var PageContext = require('../../contexts/PageContext.js');
8
+ require('@gem-sdk/adapter-shopify');
9
+ require('swr/mutation');
10
+ require('swr/infinite');
11
+ require('vanilla-lazyload');
12
+ require('../../hooks/useCartUI.js');
13
+ require('react-transition-group');
14
+ require('@gem-sdk/core');
15
+ require('classnames');
16
+ require('dayjs');
17
+ require('../convert.js');
18
+
3
19
  const useInteraction = ()=>{
20
+ const setInteractionIsSelectOnPage = PageContext.usePageStore((s)=>s.setInteractionIsSelectOnPage);
4
21
  const onListener = ({ event, selector }, callback)=>{
5
22
  const element = document.querySelector(selector);
6
23
  if (!element) return;
@@ -30,10 +47,19 @@ const useInteraction = ()=>{
30
47
  [key]: value
31
48
  }));
32
49
  };
50
+ const closeSelectOnPage = ()=>{
51
+ setInteractionIsSelectOnPage(false);
52
+ const event = new CustomEvent('editor:interaction:change-select-on-page', {
53
+ bubbles: true,
54
+ detail: false
55
+ });
56
+ window.dispatchEvent(event);
57
+ };
33
58
  return {
34
59
  onListener,
35
60
  trigger,
36
- saveToElementInteractionData
61
+ saveToElementInteractionData,
62
+ closeSelectOnPage
37
63
  };
38
64
  };
39
65
 
@@ -12,10 +12,13 @@ import 'react-transition-group';
12
12
  import '@gem-sdk/core';
13
13
  import 'classnames';
14
14
  import 'dayjs';
15
+ import { useInteraction } from '../helpers/interaction/index.js';
15
16
  import '../helpers/convert.js';
16
17
 
17
18
  const InteractionSuffix = ({ tag, uid })=>{
19
+ const { closeSelectOnPage } = useInteraction();
18
20
  const currentInteraction = usePageStore((s)=>s.interactionData?.item);
21
+ const isSelectOnPage = usePageStore((s)=>s.interactionData?.isSelectOnPage);
19
22
  const isCurrentInteractionTarget = useMemo(()=>{
20
23
  return currentInteraction?.targets?.find((t)=>t.uid === uid);
21
24
  }, [
@@ -48,6 +51,11 @@ const InteractionSuffix = ({ tag, uid })=>{
48
51
  }
49
52
  return /*#__PURE__*/ jsxs(Fragment, {
50
53
  children: [
54
+ isSelectOnPage && /*#__PURE__*/ jsx("button", {
55
+ className: "gp-bg-[#F4F4F4] gp-px-2 gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-sm gp-font-medium gp-hidden interaction-use-element-btn",
56
+ onClick: closeSelectOnPage,
57
+ children: "Use element"
58
+ }),
51
59
  /*#__PURE__*/ jsx("div", {
52
60
  className: "hidden gp-left-[-40px] gp-left-[-80px] gp-right-[-40px] gp-right-[-80px]"
53
61
  }),
@@ -1,4 +1,21 @@
1
+ import 'react/jsx-runtime';
2
+ import 'zustand';
3
+ import 'react';
4
+ import 'swr';
5
+ import { usePageStore } from '../../contexts/PageContext.js';
6
+ import '@gem-sdk/adapter-shopify';
7
+ import 'swr/mutation';
8
+ import 'swr/infinite';
9
+ import 'vanilla-lazyload';
10
+ import '../../hooks/useCartUI.js';
11
+ import 'react-transition-group';
12
+ import '@gem-sdk/core';
13
+ import 'classnames';
14
+ import 'dayjs';
15
+ import '../convert.js';
16
+
1
17
  const useInteraction = ()=>{
18
+ const setInteractionIsSelectOnPage = usePageStore((s)=>s.setInteractionIsSelectOnPage);
2
19
  const onListener = ({ event, selector }, callback)=>{
3
20
  const element = document.querySelector(selector);
4
21
  if (!element) return;
@@ -28,10 +45,19 @@ const useInteraction = ()=>{
28
45
  [key]: value
29
46
  }));
30
47
  };
48
+ const closeSelectOnPage = ()=>{
49
+ setInteractionIsSelectOnPage(false);
50
+ const event = new CustomEvent('editor:interaction:change-select-on-page', {
51
+ bubbles: true,
52
+ detail: false
53
+ });
54
+ window.dispatchEvent(event);
55
+ };
31
56
  return {
32
57
  onListener,
33
58
  trigger,
34
- saveToElementInteractionData
59
+ saveToElementInteractionData,
60
+ closeSelectOnPage
35
61
  };
36
62
  };
37
63
 
@@ -39327,6 +39327,7 @@ declare const useInteraction: () => {
39327
39327
  selector: string;
39328
39328
  }) => void;
39329
39329
  saveToElementInteractionData: (element: HTMLElement, key: string, value: string) => void;
39330
+ closeSelectOnPage: () => void;
39330
39331
  };
39331
39332
 
39332
39333
  export { AddOn, AddonProvider, AddonProviderProps, AdvancedType, 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, 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, FeraReviewsV3WidgetType, FeraReviewsWidgetType, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GRADIENT_BGR_KEY, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, GrowaveWidgetType, 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, SettingUIGroup, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeSettingGlobal, SizeType, SpacingType, StampedWidgetType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, 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, 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, getResonsiveStyleShadow, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getSeoTagFromTypo, 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, 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.48.0-dev.89",
3
+ "version": "1.48.0-dev.91",
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.48.0-dev.3",
31
- "@gem-sdk/styles": "1.48.0-dev.86",
31
+ "@gem-sdk/styles": "1.48.0-dev.91",
32
32
  "@types/classnames": "^2.3.1"
33
33
  },
34
34
  "dependencies": {