@gem-sdk/pages 2.5.3-staging.0 → 2.5.3-staging.11

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.
@@ -59,6 +59,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
59
59
  const mobileOnly = dataBuilder.isMobile ?? false;
60
60
  const description = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
61
61
  const thumbnail = parseJson.parseJson(dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
62
+ const noindex = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'noindex')?.value;
63
+ const nofollow = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'nofollow')?.value;
62
64
  const shopMeta = shopifyMeta.status === 'fulfilled' ? shopifyMeta.value : undefined;
63
65
  const shopData = storeProperty.status === 'fulfilled' ? storeProperty.value : undefined;
64
66
  const favicon = shopData?.storeProperty?.favicon ?? '';
@@ -75,6 +77,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
75
77
  thumbnail
76
78
  ] : []
77
79
  },
80
+ noindex: noindex === 'true',
81
+ nofollow: nofollow === 'true',
78
82
  canonical: `https://${shopData?.storeProperty?.primaryDomain}/${slug}`,
79
83
  additionalMetaTags: [
80
84
  {
@@ -35,6 +35,9 @@ const getFontFromGroupSetting = (fonts, groupSetting)=>{
35
35
  }
36
36
  }
37
37
  };
38
+ const uniqueArray = (arr)=>{
39
+ return Array.from(new Set(arr));
40
+ };
38
41
  const getFontValue = (fonts, value)=>{
39
42
  let customFontFamily = value.custom?.fontFamily;
40
43
  if (typeof customFontFamily === 'string') {
@@ -60,15 +63,18 @@ const getFontValue = (fonts, value)=>{
60
63
  });
61
64
  const customFontWeight = value.custom?.fontWeight && variants.includes(value.custom?.fontWeight) ? value.custom?.fontWeight : variants[0];
62
65
  if (customFontWeight) {
66
+ const fontVariants = uniqueArray([
67
+ customFontWeight,
68
+ ...value.attrs.isAlwaysLoadBold ? [
69
+ '700'
70
+ ] : []
71
+ ]);
63
72
  const isExist = fonts.find((item)=>item.family == fontFamily && item.variants.includes(customFontWeight));
64
73
  if (!isExist) {
65
74
  const isFontFamily = fonts.find((item)=>item.family == fontFamily);
66
75
  if (isFontFamily) {
67
76
  isFontFamily.variants.push(customFontWeight);
68
77
  } else {
69
- const fontVariants = [
70
- customFontWeight
71
- ];
72
78
  if (customFontWeight !== '700') {
73
79
  if (variants.includes('700')) {
74
80
  fontVariants.push('700'); // Auto add 700 for bold in editor inline
@@ -74,7 +74,8 @@ function normalizePageSectionResponseV2(sections, orders) {
74
74
  const parseBuilderTemplateV2 = (data)=>{
75
75
  return normalizePageSectionResponseV2([
76
76
  ...data?.pageSections ?? [],
77
- ...data?.themePageCustomSections ?? []
77
+ ...data?.themePageCustomSections ?? [],
78
+ ...data?.themeSections ?? []
78
79
  ], data?.sectionPosition);
79
80
  };
80
81
  const parseBuilderTemplate = (data)=>{
@@ -57,6 +57,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
57
57
  const mobileOnly = dataBuilder.isMobile ?? false;
58
58
  const description = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
59
59
  const thumbnail = parseJson(dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
60
+ const noindex = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'noindex')?.value;
61
+ const nofollow = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'nofollow')?.value;
60
62
  const shopMeta = shopifyMeta.status === 'fulfilled' ? shopifyMeta.value : undefined;
61
63
  const shopData = storeProperty.status === 'fulfilled' ? storeProperty.value : undefined;
62
64
  const favicon = shopData?.storeProperty?.favicon ?? '';
@@ -73,6 +75,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
73
75
  thumbnail
74
76
  ] : []
75
77
  },
78
+ noindex: noindex === 'true',
79
+ nofollow: nofollow === 'true',
76
80
  canonical: `https://${shopData?.storeProperty?.primaryDomain}/${slug}`,
77
81
  additionalMetaTags: [
78
82
  {
@@ -33,6 +33,9 @@ const getFontFromGroupSetting = (fonts, groupSetting)=>{
33
33
  }
34
34
  }
35
35
  };
36
+ const uniqueArray = (arr)=>{
37
+ return Array.from(new Set(arr));
38
+ };
36
39
  const getFontValue = (fonts, value)=>{
37
40
  let customFontFamily = value.custom?.fontFamily;
38
41
  if (typeof customFontFamily === 'string') {
@@ -58,15 +61,18 @@ const getFontValue = (fonts, value)=>{
58
61
  });
59
62
  const customFontWeight = value.custom?.fontWeight && variants.includes(value.custom?.fontWeight) ? value.custom?.fontWeight : variants[0];
60
63
  if (customFontWeight) {
64
+ const fontVariants = uniqueArray([
65
+ customFontWeight,
66
+ ...value.attrs.isAlwaysLoadBold ? [
67
+ '700'
68
+ ] : []
69
+ ]);
61
70
  const isExist = fonts.find((item)=>item.family == fontFamily && item.variants.includes(customFontWeight));
62
71
  if (!isExist) {
63
72
  const isFontFamily = fonts.find((item)=>item.family == fontFamily);
64
73
  if (isFontFamily) {
65
74
  isFontFamily.variants.push(customFontWeight);
66
75
  } else {
67
- const fontVariants = [
68
- customFontWeight
69
- ];
70
76
  if (customFontWeight !== '700') {
71
77
  if (variants.includes('700')) {
72
78
  fontVariants.push('700'); // Auto add 700 for bold in editor inline
@@ -72,7 +72,8 @@ function normalizePageSectionResponseV2(sections, orders) {
72
72
  const parseBuilderTemplateV2 = (data)=>{
73
73
  return normalizePageSectionResponseV2([
74
74
  ...data?.pageSections ?? [],
75
- ...data?.themePageCustomSections ?? []
75
+ ...data?.themePageCustomSections ?? [],
76
+ ...data?.themeSections ?? []
76
77
  ], data?.sectionPosition);
77
78
  };
78
79
  const parseBuilderTemplate = (data)=>{
@@ -143,7 +143,14 @@ declare function normalizePageSectionResponseV2(sections?: ShopType.Maybe<Sectio
143
143
  priority: boolean;
144
144
  data: any;
145
145
  }[];
146
- declare const parseBuilderTemplateV2: (data?: PublishedThemePageSelectFragment) => {
146
+ type ParseBuilderTemplateV2Props = PublishedThemePageSelectFragment & {
147
+ themeSections?: {
148
+ id: string;
149
+ name: string;
150
+ content: string;
151
+ }[];
152
+ };
153
+ declare const parseBuilderTemplateV2: (data?: ParseBuilderTemplateV2Props) => {
147
154
  uid: string;
148
155
  lazy: boolean;
149
156
  priority: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.5.3-staging.0",
3
+ "version": "2.5.3-staging.11",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "next": "latest"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.5.3-staging.0",
29
+ "@gem-sdk/core": "2.5.3-staging.10",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.1.0",
31
31
  "@gem-sdk/plugin-quick-view": "2.1.0",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.1.0"