@gem-sdk/pages 2.0.0-dev.709 → 2.0.0-dev.737

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.
@@ -89,7 +89,7 @@ const Toolbox = ()=>{
89
89
  for (const variant of font.variants){
90
90
  const cloneFont = JSON.parse(JSON.stringify(font));
91
91
  cloneFont.variants = [
92
- variant
92
+ variant.toString()
93
93
  ]; // set single variant. Fix error reload font when change href other variant
94
94
  const fontName = cloneFont.family;
95
95
  const variantName = variant;
@@ -142,7 +142,7 @@ const Toolbox = ()=>{
142
142
  const fontWeights = getListFontWeightTypos.getListFontWeightTypos(detail.data?.typography);
143
143
  const font = Object.entries(detail.data?.font).map(([, value])=>({
144
144
  ...value,
145
- variants: value.variants.filter((variant)=>fontWeights.includes(variant) || variant === 'regular' && fontWeights.includes('400')).map((variant)=>variant === 'regular' ? '400' : variant)
145
+ variants: value.variants.filter((variant)=>fontWeights.includes(variant?.toString()) || variant === 'regular' && fontWeights.includes('400')).map((variant)=>variant === 'regular' ? '400' : variant)
146
146
  })).map((item)=>{
147
147
  if (item.type == 'custom') {
148
148
  const isGoogleFont = shopifyCdnWithGoogleFonts.shopifyCdnWithGoogleFonts.find((ggFont)=>ggFont.family == item.family);
@@ -7,11 +7,6 @@ const baseDevices = {
7
7
  tablet: '1024px',
8
8
  mobile: '767px'
9
9
  };
10
- const devicesOrder = [
11
- 'desktop',
12
- 'tablet',
13
- 'mobile'
14
- ];
15
10
  const flattenObject = (obj, prefix)=>{
16
11
  return Object.keys(obj).reduce((acc, k)=>{
17
12
  const pre = prefix ? `${prefix}-` : '';
@@ -115,7 +110,7 @@ const genCSS = (input, mobileOnly)=>{
115
110
  const cssData = genCSSVariable(deviceData);
116
111
  return `:root{${cssData}}`;
117
112
  }
118
- return devicesOrder.map((device)=>{
113
+ return core.DEVICES.map((device)=>{
119
114
  const deviceData = getValueByDevice(data, device);
120
115
  if (device === 'desktop') {
121
116
  deviceData.color = data.color;
@@ -85,7 +85,7 @@ const Toolbox = ()=>{
85
85
  for (const variant of font.variants){
86
86
  const cloneFont = JSON.parse(JSON.stringify(font));
87
87
  cloneFont.variants = [
88
- variant
88
+ variant.toString()
89
89
  ]; // set single variant. Fix error reload font when change href other variant
90
90
  const fontName = cloneFont.family;
91
91
  const variantName = variant;
@@ -138,7 +138,7 @@ const Toolbox = ()=>{
138
138
  const fontWeights = getListFontWeightTypos(detail.data?.typography);
139
139
  const font = Object.entries(detail.data?.font).map(([, value])=>({
140
140
  ...value,
141
- variants: value.variants.filter((variant)=>fontWeights.includes(variant) || variant === 'regular' && fontWeights.includes('400')).map((variant)=>variant === 'regular' ? '400' : variant)
141
+ variants: value.variants.filter((variant)=>fontWeights.includes(variant?.toString()) || variant === 'regular' && fontWeights.includes('400')).map((variant)=>variant === 'regular' ? '400' : variant)
142
142
  })).map((item)=>{
143
143
  if (item.type == 'custom') {
144
144
  const isGoogleFont = shopifyCdnWithGoogleFonts.find((ggFont)=>ggFont.family == item.family);
@@ -1,15 +1,10 @@
1
- import { getShortName } from '@gem-sdk/core';
1
+ import { DEVICES, getShortName } from '@gem-sdk/core';
2
2
  import merge from 'deepmerge';
3
3
 
4
4
  const baseDevices = {
5
5
  tablet: '1024px',
6
6
  mobile: '767px'
7
7
  };
8
- const devicesOrder = [
9
- 'desktop',
10
- 'tablet',
11
- 'mobile'
12
- ];
13
8
  const flattenObject = (obj, prefix)=>{
14
9
  return Object.keys(obj).reduce((acc, k)=>{
15
10
  const pre = prefix ? `${prefix}-` : '';
@@ -113,7 +108,7 @@ const genCSS = (input, mobileOnly)=>{
113
108
  const cssData = genCSSVariable(deviceData);
114
109
  return `:root{${cssData}}`;
115
110
  }
116
- return devicesOrder.map((device)=>{
111
+ return DEVICES.map((device)=>{
117
112
  const deviceData = getValueByDevice(data, device);
118
113
  if (device === 'desktop') {
119
114
  deviceData.color = data.color;
@@ -1,4 +1,4 @@
1
- import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, ProductOffer, AppAPIType, PublicStoreFrontData, CollectionQueryResponse, ProductSelectFragment, FetchFunc, ThemePageQueryResponse, StorePropertyQueryResponse, PublishedThemePageSelectFragment } from '@gem-sdk/core';
1
+ import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, ProductSelectFragment, ProductOffer, AppAPIType, PublicStoreFrontData, CollectionQueryResponse, FetchFunc, ThemePageQueryResponse, StorePropertyQueryResponse, PublishedThemePageSelectFragment } from '@gem-sdk/core';
2
2
  import { NextPage, GetStaticPaths } from 'next';
3
3
  import * as next_seo from 'next-seo';
4
4
  import { NextSeoProps } from 'next-seo';
@@ -270,4 +270,4 @@ declare const BuilderPage: React.FC<BuilderPageProps>;
270
270
 
271
271
  declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
272
272
 
273
- export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PageBuilderPropsV2, PreviewPage, ProductDetailPage, StaticPage, StaticPagePropsV2, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, usePagePreview, useTrackingView };
273
+ export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PageBuilderPropsV2, PreviewPage, ProductDetailPage, ProductPageProps, StaticPage, StaticPagePropsV2, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, usePagePreview, useTrackingView };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.0.0-dev.709",
3
+ "version": "2.0.0-dev.737",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "next": "14.2.20"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.0.0-dev.704",
29
+ "@gem-sdk/core": "2.0.0-dev.737",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.0.0-dev.695",
31
31
  "@gem-sdk/plugin-quick-view": "2.0.0-dev.695",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.695"