@gem-sdk/core 1.14.0-dev.443 → 1.14.0-dev.446
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,6 +1,6 @@
|
|
|
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:
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${
|
|
6
|
-
`}return
|
|
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)=>{if(!s||!e||s?.radiusType!=="custom")return{};let a=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",r=constant.stateMapping?.[e];return{[`-${r}-bblr${a}`]:s.bblr,[`-${r}-bbrr${a}`]:s.bbrr,[`-${r}-btlr${a}`]:s.btlr,[`-${r}-btrr${a}`]: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;case"circle":case"none":case"custom":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;case"circle":case"none":case"custom":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;case"circle":case"none":case"custom":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=>e?.active?.radiusType==="custom"?getCustomRadius("normal",e?.active):getRadiusCSSFromGlobal("normal",e?.active?.radiusType),composeCornerCss=(e,s=!1)=>{let t;if(!e)return"";let{radiusType:a,bblr:r,bbrr:o,btlr:i,btrr:c}=e,u=s?" !important":"";switch(a){case"medium":case"large":case"small":t=`border-radius: var(--g-radius-${a});`;break;case"circle":case"none":case"custom":t=`
|
|
2
|
+
${r?`border-bottom-left-radius: ${r}${u};`:""}
|
|
3
|
+
${o?`border-bottom-right-radius: ${o}${u};`:""}
|
|
4
|
+
${i?`border-top-left-radius: ${i}${u};`:""}
|
|
5
|
+
${c?`border-top-right-radius: ${c}${u};`:""}
|
|
6
|
+
`}return t};exports.composeCornerCss=composeCornerCss,exports.composeRadius=composeRadius,exports.composeRadiusResponsive=composeRadiusResponsive,exports.getCornerCSSFromGlobal=getCornerCSSFromGlobal,exports.getCustomRadius=getCustomRadius,exports.getRadiusCSSFromGlobal=getRadiusCSSFromGlobal,exports.getRadiusStyleActiveState=getRadiusStyleActiveState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{devicesMapping as e,stateMapping as
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${
|
|
6
|
-
`}return
|
|
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,t,r)=>{if(!t||!a)return{};let o=r&&"desktop"!==r?e?.[r]:"",i=s?.[a];return{[`-${i}-radius${o}`]:`var(--g-radius-${t})`}},getCustomRadius=(a,t,r)=>{if(!t||!a||t?.radiusType!=="custom")return{};let o=r&&"desktop"!==r?e?.[r]:"",i=s?.[a];return{[`-${i}-bblr${o}`]:t.bblr,[`-${i}-bbrr${o}`]:t.bbrr,[`-${i}-btlr${o}`]:t.btlr,[`-${i}-btrr${o}`]:t.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;case"circle":case"none":case"custom":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;case"circle":case"none":case"custom":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;case"circle":case"none":case"custom":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=>e?.active?.radiusType==="custom"?getCustomRadius("normal",e?.active):getRadiusCSSFromGlobal("normal",e?.active?.radiusType),composeCornerCss=(e,s=!1)=>{let a;if(!e)return"";let{radiusType:t,bblr:r,bbrr:o,btlr:i,btrr:u}=e,c=s?" !important":"";switch(t){case"medium":case"large":case"small":a=`border-radius: var(--g-radius-${t});`;break;case"circle":case"none":case"custom":a=`
|
|
2
|
+
${r?`border-bottom-left-radius: ${r}${c};`:""}
|
|
3
|
+
${o?`border-bottom-right-radius: ${o}${c};`:""}
|
|
4
|
+
${i?`border-top-left-radius: ${i}${c};`:""}
|
|
5
|
+
${u?`border-top-right-radius: ${u}${c};`:""}
|
|
6
|
+
`}return a};export{composeCornerCss,composeRadius,composeRadiusResponsive,getCornerCSSFromGlobal,getCustomRadius,getRadiusCSSFromGlobal,getRadiusStyleActiveState};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -822,6 +822,12 @@ type LayoutControlType<T> = SharedControlType<T> & {
|
|
|
822
822
|
isProductLayout?: boolean;
|
|
823
823
|
};
|
|
824
824
|
|
|
825
|
+
type LayoutBannerControlType<T> = SharedControlType<T> & {
|
|
826
|
+
type: 'layout-banner';
|
|
827
|
+
maxCol?: number;
|
|
828
|
+
isProductLayout?: boolean;
|
|
829
|
+
};
|
|
830
|
+
|
|
825
831
|
type CollectionBannerControlType<T> = SharedControlType<T> & {
|
|
826
832
|
type: 'collectionBanner';
|
|
827
833
|
value?: Background;
|
|
@@ -973,7 +979,7 @@ type Dropdown<T> = SharedControlType<T> & {
|
|
|
973
979
|
}[];
|
|
974
980
|
};
|
|
975
981
|
|
|
976
|
-
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> | 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>;
|
|
982
|
+
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>;
|
|
977
983
|
type Setting<P extends BaseProps> = {
|
|
978
984
|
id: 'setting';
|
|
979
985
|
note?: string;
|