@gem-sdk/core 1.14.0-next.61 → 1.14.0-next.63

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.
@@ -16,6 +16,7 @@
16
16
  }
17
17
  }
18
18
  }
19
+ totalCount
19
20
  }
20
21
  }
21
22
  `;
@@ -18,6 +18,22 @@ const composeTypographyCss = (typography)=>{
18
18
  ${lineHeight ? `line-height: ${lineHeight};` : ''}
19
19
  `;
20
20
  };
21
+ const composeTypographyV2Css = (typography)=>{
22
+ const typographyCustom = typography?.custom;
23
+ const { fontFamily , fontSize , fontWeight , lineHeight , letterSpacing } = typographyCustom ?? {};
24
+ const typographyAttrs = typography?.attrs;
25
+ const { bold , italic , underline , transform } = typographyAttrs ?? {};
26
+ return `
27
+ ${fontFamily ? `font-family: var(--g-font-${fontFamily}, ${fontFamily});` : ''}
28
+ ${fontSize?.desktop ? `font-size: ${fontSize?.desktop};` : ''}
29
+ ${bold ? `font-weight: bold;` : fontWeight ? `font-weight: ${fontWeight};` : ''}
30
+ ${letterSpacing ? `letter-spacing: ${letterSpacing};` : ''}
31
+ ${lineHeight ? `line-height: ${lineHeight};` : ''}
32
+ ${italic ? `font-style: italic;` : ''}
33
+ ${underline ? `text-decoration-line: underline;` : ''}
34
+ ${transform ? `text-transform: ${transform};` : ''}
35
+ `;
36
+ };
21
37
  function getCustomCSSByDevice(typography, device) {
22
38
  if (!typography || !device) return {};
23
39
  const suffix = device === 'desktop' || !device ? '' : `-${device}`;
@@ -85,4 +101,5 @@ exports.composeTypographyClassName = composeTypographyClassName;
85
101
  exports.composeTypographyCss = composeTypographyCss;
86
102
  exports.composeTypographyStyle = composeTypographyStyle;
87
103
  exports.composeTypographyV2 = composeTypographyV2;
104
+ exports.composeTypographyV2Css = composeTypographyV2Css;
88
105
  exports.genTypoClass = genTypoClass;
package/dist/cjs/index.js CHANGED
@@ -186,6 +186,7 @@ exports.composeTypographyClassName = typography.composeTypographyClassName;
186
186
  exports.composeTypographyCss = typography.composeTypographyCss;
187
187
  exports.composeTypographyStyle = typography.composeTypographyStyle;
188
188
  exports.composeTypographyV2 = typography.composeTypographyV2;
189
+ exports.composeTypographyV2Css = typography.composeTypographyV2Css;
189
190
  exports.genTypoClass = typography.genTypoClass;
190
191
  exports.composeCornerCss = radius.composeCornerCss;
191
192
  exports.composeRadius = radius.composeRadius;
@@ -14,6 +14,7 @@
14
14
  }
15
15
  }
16
16
  }
17
+ totalCount
17
18
  }
18
19
  }
19
20
  `;
@@ -16,6 +16,22 @@ const composeTypographyCss = (typography)=>{
16
16
  ${lineHeight ? `line-height: ${lineHeight};` : ''}
17
17
  `;
18
18
  };
19
+ const composeTypographyV2Css = (typography)=>{
20
+ const typographyCustom = typography?.custom;
21
+ const { fontFamily , fontSize , fontWeight , lineHeight , letterSpacing } = typographyCustom ?? {};
22
+ const typographyAttrs = typography?.attrs;
23
+ const { bold , italic , underline , transform } = typographyAttrs ?? {};
24
+ return `
25
+ ${fontFamily ? `font-family: var(--g-font-${fontFamily}, ${fontFamily});` : ''}
26
+ ${fontSize?.desktop ? `font-size: ${fontSize?.desktop};` : ''}
27
+ ${bold ? `font-weight: bold;` : fontWeight ? `font-weight: ${fontWeight};` : ''}
28
+ ${letterSpacing ? `letter-spacing: ${letterSpacing};` : ''}
29
+ ${lineHeight ? `line-height: ${lineHeight};` : ''}
30
+ ${italic ? `font-style: italic;` : ''}
31
+ ${underline ? `text-decoration-line: underline;` : ''}
32
+ ${transform ? `text-transform: ${transform};` : ''}
33
+ `;
34
+ };
19
35
  function getCustomCSSByDevice(typography, device) {
20
36
  if (!typography || !device) return {};
21
37
  const suffix = device === 'desktop' || !device ? '' : `-${device}`;
@@ -77,4 +93,4 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
77
93
  };
78
94
  };
79
95
 
80
- export { composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, genTypoClass };
96
+ export { composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass };
package/dist/esm/index.js CHANGED
@@ -40,7 +40,7 @@ export { genVariable } from './helpers/css-variable.js';
40
40
  export { composeGridLayout, convertOldLayout, gridToArrayRegex, optionLayoutStyle } from './helpers/layout.js';
41
41
  export { isDefined } from './helpers/is-defined.js';
42
42
  export { composeTextColorCss, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getSingleColorVariable, isColor } from './helpers/colors.js';
43
- export { composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, genTypoClass } from './helpers/typography.js';
43
+ export { composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
44
44
  export { composeCornerCss, composeRadius, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
45
45
  export { getSelectedVariant, parseSelectedOption } from './helpers/product.js';
46
46
  import * as fpixel from './helpers/tracking/fpixel.js';
@@ -7464,7 +7464,7 @@ declare const ShopProvider: React.FC<ShopProviderProps>;
7464
7464
  declare const useShopStore: <U>(selector: (state: ExtractState<StoreApi<ShopContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
7465
7465
 
7466
7466
  type CollectionSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'updatedAt' | 'deletedAt' | 'title' | 'handle' | 'description' | 'descriptionHtml' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'platform' | 'tags' | 'isStorefront' | 'isSample'> & {
7467
- products?: Maybe<{
7467
+ products?: Maybe<Pick<ProductConnection, 'totalCount'> & {
7468
7468
  edges: Array<{
7469
7469
  node?: Maybe<Pick<Product, 'id' | 'title' | 'handle' | 'description' | 'status'> & {
7470
7470
  featuredImage?: Maybe<Pick<Media, 'src'>>;
@@ -7610,7 +7610,7 @@ type CollectionsQueryResponse = {
7610
7610
  collections?: Maybe<{
7611
7611
  edges: Array<{
7612
7612
  node?: Maybe<Pick<Collection, 'id' | 'createdAt' | 'updatedAt' | 'deletedAt' | 'title' | 'handle' | 'description' | 'descriptionHtml' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'platform' | 'tags' | 'isStorefront' | 'isSample'> & {
7613
- products?: Maybe<{
7613
+ products?: Maybe<Pick<ProductConnection, 'totalCount'> & {
7614
7614
  edges: Array<{
7615
7615
  node?: Maybe<Pick<Product, 'id' | 'title' | 'handle' | 'description' | 'status'> & {
7616
7616
  featuredImage?: Maybe<Pick<Media, 'src'>>;
@@ -7817,6 +7817,7 @@ declare const composeTextColorCss: (color?: ColorValueType) => string;
7817
7817
  type TypographyClass = `g-${TypographyType}`;
7818
7818
  declare const genTypoClass: (name: TypographyType) => TypographyClass;
7819
7819
  declare const composeTypographyCss: (typography: TypographySetting | undefined) => string;
7820
+ declare const composeTypographyV2Css: (typography: TypographySettingV2 | undefined) => string;
7820
7821
  declare const composeTypography: (typography?: ObjectDevices<TypographyProps>) => React.CSSProperties;
7821
7822
  declare const composeTypographyV2: (value?: TypographyV2Props, attrs?: TypographyV2Attrs) => React.CSSProperties;
7822
7823
  declare const composeTypographyAttr: (attrs?: TypographyV2Attrs) => React.CSSProperties;
@@ -9670,4 +9671,4 @@ type PublishedThemePageSelectFragment = Pick<PublishedThemePage, 'id' | 'name' |
9670
9671
 
9671
9672
  declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
9672
9673
 
9673
- 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, PageType, 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, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, VariantSelectFragment, WiserWidgetType, baseAssetURL, calculateFirstProduct, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, 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, isSafari, loadScript, makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeNullUndefined, 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 };
9674
+ 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, PageType, 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, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, VariantSelectFragment, WiserWidgetType, baseAssetURL, calculateFirstProduct, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, 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, isSafari, loadScript, makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeNullUndefined, 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.14.0-next.61",
3
+ "version": "1.14.0-next.63",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",