@gem-sdk/core 1.12.0-next.17 → 1.12.0-next.21
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.
|
@@ -87,46 +87,47 @@ const Render = ({ uid , builder , components , parentId , extraFiles ={} , ...pa
|
|
|
87
87
|
...passProps
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
|
+
} else {
|
|
91
|
+
liquid = render.template`<div style="${style}" class="${item.uid}">
|
|
92
|
+
${render.RenderIf(item?.childrens?.length, ()=>{
|
|
93
|
+
return Component({
|
|
94
|
+
builderProps: {
|
|
95
|
+
uid,
|
|
96
|
+
builderData: item
|
|
97
|
+
},
|
|
98
|
+
styles: item.styles,
|
|
99
|
+
setting: item.settings,
|
|
100
|
+
...passProps,
|
|
101
|
+
rawChildren: item.childrens.map((id)=>{
|
|
102
|
+
return {
|
|
103
|
+
...builder[id],
|
|
104
|
+
uid: id,
|
|
105
|
+
builder,
|
|
106
|
+
components,
|
|
107
|
+
customProps
|
|
108
|
+
};
|
|
109
|
+
}),
|
|
110
|
+
children: item.childrens.map((id)=>RenderChildren({
|
|
111
|
+
uid: id,
|
|
112
|
+
builder,
|
|
113
|
+
components,
|
|
114
|
+
customProps
|
|
115
|
+
})).join('')
|
|
116
|
+
});
|
|
117
|
+
}, ()=>{
|
|
118
|
+
return Component({
|
|
119
|
+
builderProps: {
|
|
120
|
+
uid,
|
|
121
|
+
builderData: item
|
|
122
|
+
},
|
|
123
|
+
styles: item.styles,
|
|
124
|
+
setting: item.settings,
|
|
125
|
+
isText: componentTexts.includes(item.tag) ? true : null,
|
|
126
|
+
...passProps
|
|
127
|
+
});
|
|
128
|
+
})}
|
|
129
|
+
</div>`;
|
|
90
130
|
}
|
|
91
|
-
liquid = render.template`<div style="${style}" class="${item.uid}">
|
|
92
|
-
${render.RenderIf(item?.childrens?.length, ()=>{
|
|
93
|
-
return Component({
|
|
94
|
-
builderProps: {
|
|
95
|
-
uid,
|
|
96
|
-
builderData: item
|
|
97
|
-
},
|
|
98
|
-
styles: item.styles,
|
|
99
|
-
setting: item.settings,
|
|
100
|
-
...passProps,
|
|
101
|
-
rawChildren: item.childrens.map((id)=>{
|
|
102
|
-
return {
|
|
103
|
-
...builder[id],
|
|
104
|
-
uid: id,
|
|
105
|
-
builder,
|
|
106
|
-
components,
|
|
107
|
-
customProps
|
|
108
|
-
};
|
|
109
|
-
}),
|
|
110
|
-
children: item.childrens.map((id)=>RenderChildren({
|
|
111
|
-
uid: id,
|
|
112
|
-
builder,
|
|
113
|
-
components,
|
|
114
|
-
customProps
|
|
115
|
-
})).join('')
|
|
116
|
-
});
|
|
117
|
-
}, ()=>{
|
|
118
|
-
return Component({
|
|
119
|
-
builderProps: {
|
|
120
|
-
uid,
|
|
121
|
-
builderData: item
|
|
122
|
-
},
|
|
123
|
-
styles: item.styles,
|
|
124
|
-
setting: item.settings,
|
|
125
|
-
isText: componentTexts.includes(item.tag) ? true : null,
|
|
126
|
-
...passProps
|
|
127
|
-
});
|
|
128
|
-
})}
|
|
129
|
-
</div>`;
|
|
130
131
|
return {
|
|
131
132
|
liquid,
|
|
132
133
|
extraFiles: customProps.extraFiles
|
|
@@ -35,7 +35,7 @@ const useFormatMoney = (amount, withCurrency)=>{
|
|
|
35
35
|
return 0;
|
|
36
36
|
}
|
|
37
37
|
// shopify làm tròn bằng cách cắt đi các số ở đằng sau chứ không sử dụng toFixed để làm tròn như toán học
|
|
38
|
-
number = (number
|
|
38
|
+
number = parseFloat(`${number}`).toFixed(Number(precision) + 1).slice(0, -1);
|
|
39
39
|
const parts = number.split('.'), dollars = parts[0]?.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1' + thousands), cents = parts[1] ? decimal + parts[1] : '';
|
|
40
40
|
return dollars + cents;
|
|
41
41
|
}
|
|
@@ -83,46 +83,47 @@ const Render = ({ uid , builder , components , parentId , extraFiles ={} , ...pa
|
|
|
83
83
|
...passProps
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
|
+
} else {
|
|
87
|
+
liquid = template`<div style="${style}" class="${item.uid}">
|
|
88
|
+
${RenderIf(item?.childrens?.length, ()=>{
|
|
89
|
+
return Component({
|
|
90
|
+
builderProps: {
|
|
91
|
+
uid,
|
|
92
|
+
builderData: item
|
|
93
|
+
},
|
|
94
|
+
styles: item.styles,
|
|
95
|
+
setting: item.settings,
|
|
96
|
+
...passProps,
|
|
97
|
+
rawChildren: item.childrens.map((id)=>{
|
|
98
|
+
return {
|
|
99
|
+
...builder[id],
|
|
100
|
+
uid: id,
|
|
101
|
+
builder,
|
|
102
|
+
components,
|
|
103
|
+
customProps
|
|
104
|
+
};
|
|
105
|
+
}),
|
|
106
|
+
children: item.childrens.map((id)=>RenderChildren({
|
|
107
|
+
uid: id,
|
|
108
|
+
builder,
|
|
109
|
+
components,
|
|
110
|
+
customProps
|
|
111
|
+
})).join('')
|
|
112
|
+
});
|
|
113
|
+
}, ()=>{
|
|
114
|
+
return Component({
|
|
115
|
+
builderProps: {
|
|
116
|
+
uid,
|
|
117
|
+
builderData: item
|
|
118
|
+
},
|
|
119
|
+
styles: item.styles,
|
|
120
|
+
setting: item.settings,
|
|
121
|
+
isText: componentTexts.includes(item.tag) ? true : null,
|
|
122
|
+
...passProps
|
|
123
|
+
});
|
|
124
|
+
})}
|
|
125
|
+
</div>`;
|
|
86
126
|
}
|
|
87
|
-
liquid = template`<div style="${style}" class="${item.uid}">
|
|
88
|
-
${RenderIf(item?.childrens?.length, ()=>{
|
|
89
|
-
return Component({
|
|
90
|
-
builderProps: {
|
|
91
|
-
uid,
|
|
92
|
-
builderData: item
|
|
93
|
-
},
|
|
94
|
-
styles: item.styles,
|
|
95
|
-
setting: item.settings,
|
|
96
|
-
...passProps,
|
|
97
|
-
rawChildren: item.childrens.map((id)=>{
|
|
98
|
-
return {
|
|
99
|
-
...builder[id],
|
|
100
|
-
uid: id,
|
|
101
|
-
builder,
|
|
102
|
-
components,
|
|
103
|
-
customProps
|
|
104
|
-
};
|
|
105
|
-
}),
|
|
106
|
-
children: item.childrens.map((id)=>RenderChildren({
|
|
107
|
-
uid: id,
|
|
108
|
-
builder,
|
|
109
|
-
components,
|
|
110
|
-
customProps
|
|
111
|
-
})).join('')
|
|
112
|
-
});
|
|
113
|
-
}, ()=>{
|
|
114
|
-
return Component({
|
|
115
|
-
builderProps: {
|
|
116
|
-
uid,
|
|
117
|
-
builderData: item
|
|
118
|
-
},
|
|
119
|
-
styles: item.styles,
|
|
120
|
-
setting: item.settings,
|
|
121
|
-
isText: componentTexts.includes(item.tag) ? true : null,
|
|
122
|
-
...passProps
|
|
123
|
-
});
|
|
124
|
-
})}
|
|
125
|
-
</div>`;
|
|
126
127
|
return {
|
|
127
128
|
liquid,
|
|
128
129
|
extraFiles: customProps.extraFiles
|
|
@@ -33,7 +33,7 @@ const useFormatMoney = (amount, withCurrency)=>{
|
|
|
33
33
|
return 0;
|
|
34
34
|
}
|
|
35
35
|
// shopify làm tròn bằng cách cắt đi các số ở đằng sau chứ không sử dụng toFixed để làm tròn như toán học
|
|
36
|
-
number = (number
|
|
36
|
+
number = parseFloat(`${number}`).toFixed(Number(precision) + 1).slice(0, -1);
|
|
37
37
|
const parts = number.split('.'), dollars = parts[0]?.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1' + thousands), cents = parts[1] ? decimal + parts[1] : '';
|
|
38
38
|
return dollars + cents;
|
|
39
39
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7076,13 +7076,15 @@ type ShadowProps = {
|
|
|
7076
7076
|
};
|
|
7077
7077
|
type Border = {
|
|
7078
7078
|
borderType?: BorderTypeName;
|
|
7079
|
-
border?:
|
|
7079
|
+
border?: BorderStyle$1;
|
|
7080
7080
|
color?: ColorValueType;
|
|
7081
7081
|
width?: string;
|
|
7082
7082
|
isCustom?: boolean;
|
|
7083
7083
|
position?: BorderPosition;
|
|
7084
|
+
borderWidth?: string;
|
|
7084
7085
|
};
|
|
7085
7086
|
type BorderTypeName = 'none' | 'style-1' | 'style-2' | 'style-3';
|
|
7087
|
+
type BorderStyle$1 = 'none' | 'solid' | 'dotted' | 'dashed';
|
|
7086
7088
|
type BorderPosition = 'top' | 'left' | 'right' | 'bottom' | 'all';
|
|
7087
7089
|
type SwatchesOptionType = 'radio_buttons' | 'dropdown' | 'color' | 'image' | 'rectangle_list' | string;
|
|
7088
7090
|
declare const OptionNormalStyle: string[];
|
|
@@ -8086,4 +8088,4 @@ type PublishedThemePageSelectFragment = Pick<PublishedThemePage, 'id' | 'name' |
|
|
|
8086
8088
|
|
|
8087
8089
|
declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
|
|
8088
8090
|
|
|
8089
|
-
export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, BoldSubscriptionsWidgetType, Border,
|
|
8091
|
+
export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, 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, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OptionNormalStyle, OptionSpecialStyle, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, Ratio$1 as Ratio, RenderMemo as Render, RenderChildren, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RivyoWidgetType, RoundedSize, RyviuWidgetType, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeType, SpacingType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographyType, VariantSelectFragment, WiserWidgetType, baseAssetURL, calculateFirstProduct, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypographyCss, convertOldLayout, dataStringify, fetchMedias, fetchVariants, flattenConnection, fpixel, genSizeClass, genTypoClass, genVariable, generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isDefined, isEmptyChildren, isLocalEnv, loadScript, makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, splitStyle, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, 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, useIsSampleProduct, useIsStorefrontProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, useMoneyFormat, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, 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.12.0-next.
|
|
3
|
+
"version": "1.12.0-next.21",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@gem-sdk/adapter-shopify": "1.12.0-next.13",
|
|
28
|
-
"@gem-sdk/styles": "1.12.0-next.
|
|
28
|
+
"@gem-sdk/styles": "1.12.0-next.20"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-error-boundary": "4.0.3",
|