@gem-sdk/core 2.0.0-staging.955 → 2.0.0-staging.966
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,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),shop=require("../hooks/shop.js"),AddonContext=require("../contexts/AddonContext.js");const AddOn=({name:e})=>{let t=AddonContext.useAddon(e),n=shop.usePluginEnable();return n?.includes(e)?jsxRuntime.jsx(t,{}):null};exports.default=AddOn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var constant=require("./constant.js"),makeStyle=require("./make-style.js");const getCornerCSSFromGlobal=e=>e?.radiusType?["custom","circle"].includes(e?.radiusType)?makeStyle.makeStyle({bblr:e.bblr,bbrr:e.bbrr,btlr:e.btlr,btrr:e.btrr}):makeStyle.makeStyle({radius:`var(--g-radius-${e?.radiusType})`}):{},getRadiusCSSFromGlobal=(e,s,t)=>{if(!s||!e)return{};let a=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",r=constant.stateMapping?.[e];return{[`-${r}-radius${a}`]:`var(--g-radius-${s})`}},getCustomRadius=(e,s,t)=>{let a=["custom","pill","rounded","single","none","circle","square"];if(!s||!e||!a.includes(s?.radiusType??""))return{};let r=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",o=constant.stateMapping?.[e];return{[`-${o}-bblr${r}`]:s.bblr,[`-${o}-bbrr${r}`]:s.bbrr,[`-${o}-btlr${r}`]:s.btlr,[`-${o}-btrr${r}`]:s.btrr}},composeRadius=e=>e?"desktop"in e||"tablet"in e||"mobile"in e?composeRadiusResponsiveState(e):composeRadiusState(e):{},composeRadiusResponsive=e=>{let s={};return Object.assign(s,getCustomRadius("normal",e?.desktop,"desktop")),Object.assign(s,getCustomRadius("normal",e?.tablet,"tablet")),Object.assign(s,getCustomRadius("normal",e?.mobile,"mobile")),s},composeRadiusState=(e,s)=>{let t={};switch(e?.normal?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("normal",e?.normal?.radiusType,s));break;default:Object.assign(t,getCustomRadius("normal",e?.normal,s))}switch(e?.hover?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("hover",e?.hover?.radiusType,s));break;default:Object.assign(t,getCustomRadius("hover",e?.hover,s))}switch(e?.focus?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("focus",e?.focus?.radiusType,s));break;default:Object.assign(t,getCustomRadius("focus",e?.focus,s))}return t},composeRadiusResponsiveState=e=>{let s={};return Object.assign(s,composeRadiusState(e?.desktop,"desktop")),Object.assign(s,composeRadiusState(e?.tablet,"tablet")),Object.assign(s,composeRadiusState(e?.mobile,"mobile")),s},getRadiusStyleActiveState=e=>{let s=["circle","square","rounded","none","custom"];return s.includes(
|
|
1
|
+
"use strict";var constant=require("./constant.js"),makeStyle=require("./make-style.js");const getCornerCSSFromGlobal=e=>e?.radiusType?["custom","circle"].includes(e?.radiusType)?makeStyle.makeStyle({bblr:e.bblr,bbrr:e.bbrr,btlr:e.btlr,btrr:e.btrr}):makeStyle.makeStyle({radius:`var(--g-radius-${e?.radiusType})`}):{},getRadiusCSSFromGlobal=(e,s,t)=>{if(!s||!e)return{};let a=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",r=constant.stateMapping?.[e];return{[`-${r}-radius${a}`]:`var(--g-radius-${s})`}},getCustomRadius=(e,s,t)=>{let a=["custom","pill","rounded","single","none","circle","square"];if(!s||!e||!a.includes(s?.radiusType??""))return{};let r=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",o=constant.stateMapping?.[e];return{[`-${o}-bblr${r}`]:s.bblr,[`-${o}-bbrr${r}`]:s.bbrr,[`-${o}-btlr${r}`]:s.btlr,[`-${o}-btrr${r}`]:s.btrr}},composeRadius=e=>e?"desktop"in e||"tablet"in e||"mobile"in e?composeRadiusResponsiveState(e):composeRadiusState(e):{},composeRadiusResponsive=e=>{let s={};return Object.assign(s,getCustomRadius("normal",e?.desktop,"desktop")),Object.assign(s,getCustomRadius("normal",e?.tablet,"tablet")),Object.assign(s,getCustomRadius("normal",e?.mobile,"mobile")),s},composeRadiusState=(e,s)=>{let t={};switch(e?.normal?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("normal",e?.normal?.radiusType,s));break;default:Object.assign(t,getCustomRadius("normal",e?.normal,s))}switch(e?.hover?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("hover",e?.hover?.radiusType,s));break;default:Object.assign(t,getCustomRadius("hover",e?.hover,s))}switch(e?.focus?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("focus",e?.focus?.radiusType,s));break;default:Object.assign(t,getCustomRadius("focus",e?.focus,s))}return t},composeRadiusResponsiveState=e=>{let s={};return Object.assign(s,composeRadiusState(e?.desktop,"desktop")),Object.assign(s,composeRadiusState(e?.tablet,"tablet")),Object.assign(s,composeRadiusState(e?.mobile,"mobile")),s},getRadiusStyleActiveState=e=>{let s=["circle","square","rounded","none","custom"],t=e?.active||e?.normal;return s.includes(t?.radiusType||"")?getCustomRadius("normal",t):getRadiusCSSFromGlobal("normal",t?.radiusType)},composeCornerCss=(e,s=!1)=>{let t;if(!e)return"";let{radiusType:a,bblr:r,bbrr:o,btlr:i,btrr:u}=e,l=s?" !important":"";switch(a){case"medium":case"large":case"small":t=`border-radius: var(--g-radius-${a});`;break;case"circle":case"square":case"none":case"rounded":case"custom":t=`
|
|
2
2
|
${r?`border-bottom-left-radius: ${r}${l};`:""}
|
|
3
3
|
${o?`border-bottom-right-radius: ${o}${l};`:""}
|
|
4
4
|
${i?`border-top-left-radius: ${i}${l};`:""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{usePluginEnable as o}from"../hooks/shop.js";import{useAddon as r}from"../contexts/AddonContext.js";let AddOn=({name:e})=>{let n=r(e),d=o();return d?.includes(e)?t(n,{}):null};export{AddOn as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{devicesMapping as e,stateMapping as s}from"./constant.js";import{makeStyle as
|
|
2
|
-
${
|
|
1
|
+
import{devicesMapping as e,stateMapping as s}from"./constant.js";import{makeStyle as a}from"./make-style.js";let getCornerCSSFromGlobal=e=>e?.radiusType?["custom","circle"].includes(e?.radiusType)?a({bblr:e.bblr,bbrr:e.bbrr,btlr:e.btlr,btrr:e.btrr}):a({radius:`var(--g-radius-${e?.radiusType})`}):{},getRadiusCSSFromGlobal=(a,r,t)=>{if(!r||!a)return{};let o=t&&"desktop"!==t?e?.[t]:"",i=s?.[a];return{[`-${i}-radius${o}`]:`var(--g-radius-${r})`}},getCustomRadius=(a,r,t)=>{let o=["custom","pill","rounded","single","none","circle","square"];if(!r||!a||!o.includes(r?.radiusType??""))return{};let i=t&&"desktop"!==t?e?.[t]:"",u=s?.[a];return{[`-${u}-bblr${i}`]:r.bblr,[`-${u}-bbrr${i}`]:r.bbrr,[`-${u}-btlr${i}`]:r.btlr,[`-${u}-btrr${i}`]:r.btrr}},composeRadius=e=>e?"desktop"in e||"tablet"in e||"mobile"in e?composeRadiusResponsiveState(e):composeRadiusState(e):{},composeRadiusResponsive=e=>{let s={};return Object.assign(s,getCustomRadius("normal",e?.desktop,"desktop")),Object.assign(s,getCustomRadius("normal",e?.tablet,"tablet")),Object.assign(s,getCustomRadius("normal",e?.mobile,"mobile")),s},composeRadiusState=(e,s)=>{let a={};switch(e?.normal?.radiusType){case"medium":case"large":case"small":Object.assign(a,getRadiusCSSFromGlobal("normal",e?.normal?.radiusType,s));break;default:Object.assign(a,getCustomRadius("normal",e?.normal,s))}switch(e?.hover?.radiusType){case"medium":case"large":case"small":Object.assign(a,getRadiusCSSFromGlobal("hover",e?.hover?.radiusType,s));break;default:Object.assign(a,getCustomRadius("hover",e?.hover,s))}switch(e?.focus?.radiusType){case"medium":case"large":case"small":Object.assign(a,getRadiusCSSFromGlobal("focus",e?.focus?.radiusType,s));break;default:Object.assign(a,getCustomRadius("focus",e?.focus,s))}return a},composeRadiusResponsiveState=e=>{let s={};return Object.assign(s,composeRadiusState(e?.desktop,"desktop")),Object.assign(s,composeRadiusState(e?.tablet,"tablet")),Object.assign(s,composeRadiusState(e?.mobile,"mobile")),s},getRadiusStyleActiveState=e=>{let s=["circle","square","rounded","none","custom"],a=e?.active||e?.normal;return s.includes(a?.radiusType||"")?getCustomRadius("normal",a):getRadiusCSSFromGlobal("normal",a?.radiusType)},composeCornerCss=(e,s=!1)=>{let a;if(!e)return"";let{radiusType:r,bblr:t,bbrr:o,btlr:i,btrr:u}=e,l=s?" !important":"";switch(r){case"medium":case"large":case"small":a=`border-radius: var(--g-radius-${r});`;break;case"circle":case"square":case"none":case"rounded":case"custom":a=`
|
|
2
|
+
${t?`border-bottom-left-radius: ${t}${l};`:""}
|
|
3
3
|
${o?`border-bottom-right-radius: ${o}${l};`:""}
|
|
4
4
|
${i?`border-top-left-radius: ${i}${l};`:""}
|
|
5
5
|
${u?`border-top-right-radius: ${u}${l};`:""}
|
|
6
|
-
`}return
|
|
6
|
+
`}return a};export{composeCornerCss,composeRadius,composeRadiusResponsive,getCornerCSSFromGlobal,getCustomRadius,getRadiusCSSFromGlobal,getRadiusStyleActiveState};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -37469,6 +37469,11 @@ type ProductSourceControlType<T> = SharedControlType<T> & {
|
|
|
37469
37469
|
type: 'product-source';
|
|
37470
37470
|
};
|
|
37471
37471
|
|
|
37472
|
+
type ColumnWithSlider<T> = SharedControlType<T> & {
|
|
37473
|
+
type: 'column-with-slider';
|
|
37474
|
+
fallbackArrayValue?: number[];
|
|
37475
|
+
};
|
|
37476
|
+
|
|
37472
37477
|
type BehaviorStateControlType<T> = {
|
|
37473
37478
|
id: string;
|
|
37474
37479
|
type: 'behavior-state';
|
|
@@ -37490,7 +37495,7 @@ type GroupControlType<T> = {
|
|
|
37490
37495
|
mobileOnly?: boolean;
|
|
37491
37496
|
};
|
|
37492
37497
|
};
|
|
37493
|
-
type ControlProp<T> = (ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputStepperControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | Option$7<T> | OptionValueControlType<T> | OptionIllustrationControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | Option$4<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 | VariantListingControlType | 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> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | DisplayTriggerControlType<T> | CustomPositionControlType<T> | DealControlType<T> | ProductHandleType<T> | ColorPickerV2ControlType<T> | BorderV2ControlType<T> | CornerV2ControlType<T> | PaddingV2ControlType<T> | BackgroundImageType<T> | BackgroundVideoType<T> | ShadowV2ControlType<T> | BackgroundMediaControlType<T> | BackgroundMediaComboControlType<T> | BackgroundVideoType<T> | ImageV2ControlType<T> | LayoutSelectorControlType<T> | ComboControlType<T> | DynamicOfferQuantity<T> | ImagePostPurchase<T> | ImageSelect<T> | InputSliderControlType<T> | VariantSwatchesPresetV2ControlType<T> | LayoutCarouselSelectorControlType<T> | BannerControlType<T> | ProductSourceControlType<T>) & {
|
|
37498
|
+
type ControlProp<T> = (ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputStepperControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | Option$7<T> | OptionValueControlType<T> | OptionIllustrationControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | Option$4<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 | VariantListingControlType | 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> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | DisplayTriggerControlType<T> | CustomPositionControlType<T> | DealControlType<T> | ProductHandleType<T> | ColorPickerV2ControlType<T> | BorderV2ControlType<T> | CornerV2ControlType<T> | PaddingV2ControlType<T> | BackgroundImageType<T> | BackgroundVideoType<T> | ShadowV2ControlType<T> | BackgroundMediaControlType<T> | BackgroundMediaComboControlType<T> | BackgroundVideoType<T> | ImageV2ControlType<T> | LayoutSelectorControlType<T> | ComboControlType<T> | DynamicOfferQuantity<T> | ImagePostPurchase<T> | ImageSelect<T> | InputSliderControlType<T> | VariantSwatchesPresetV2ControlType<T> | LayoutCarouselSelectorControlType<T> | BannerControlType<T> | ProductSourceControlType<T> | ColumnWithSlider<T>) & {
|
|
37494
37499
|
validate?: ValidateType;
|
|
37495
37500
|
};
|
|
37496
37501
|
type ValidateType = {
|