@gem-sdk/pages 2.6.0-staging.23 → 3.0.0-pre-production.1

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.
@@ -11,7 +11,6 @@ var parseJson = require('../helpers/parse-json.js');
11
11
  var nextjs = require('@sentry/nextjs');
12
12
  var customFonts = require('../custom-fonts.js');
13
13
  var genFavicon = require('../helpers/gen-favicon.js');
14
- var index = require('../../constants/index.js');
15
14
 
16
15
  const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
17
16
  try {
@@ -59,7 +58,6 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
59
58
  ]);
60
59
  const mobileOnly = dataBuilder.isMobile ?? false;
61
60
  const description = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
62
- const title = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === index.PublishedThemePageMetafields.GLOBAL_META_TITLE)?.value;
63
61
  const thumbnail = parseJson.parseJson(dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
64
62
  const noindex = dataBuilder?.metafields?.find((item)=>item?.key === 'noindex')?.value;
65
63
  const nofollow = dataBuilder?.metafields?.find((item)=>item?.key === 'nofollow')?.value;
@@ -68,12 +66,12 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
68
66
  const favicon = shopData?.storeProperty?.favicon ?? '';
69
67
  const seo = {
70
68
  defaultTitle: shopMeta?.shop.name,
71
- title: title || dataBuilder?.name,
69
+ title: dataBuilder?.name,
72
70
  description: description ?? shopMeta?.shop.description,
73
71
  openGraph: {
74
72
  site_name: shopMeta?.shop.name,
75
73
  locale: shopMeta?.localization.country.isoCode,
76
- title: (title || dataBuilder?.name) ?? shopMeta?.shop.name,
74
+ title: dataBuilder?.name ?? shopMeta?.shop.name,
77
75
  description: description ?? shopMeta?.shop.description,
78
76
  images: thumbnail ? [
79
77
  thumbnail
@@ -35,9 +35,6 @@ const getFontFromGroupSetting = (fonts, groupSetting)=>{
35
35
  }
36
36
  }
37
37
  };
38
- const uniqueArray = (arr)=>{
39
- return Array.from(new Set(arr));
40
- };
41
38
  const getFontValue = (fonts, value)=>{
42
39
  let customFontFamily = value.custom?.fontFamily;
43
40
  if (typeof customFontFamily === 'string') {
@@ -63,18 +60,15 @@ const getFontValue = (fonts, value)=>{
63
60
  });
64
61
  const customFontWeight = value.custom?.fontWeight && variants.includes(value.custom?.fontWeight) ? value.custom?.fontWeight : variants[0];
65
62
  if (customFontWeight) {
66
- const fontVariants = uniqueArray([
67
- customFontWeight,
68
- ...value?.attrs?.isAlwaysLoadBold ? [
69
- '700'
70
- ] : []
71
- ]);
72
63
  const isExist = fonts.find((item)=>item.family == fontFamily && item.variants.includes(customFontWeight));
73
64
  if (!isExist) {
74
65
  const isFontFamily = fonts.find((item)=>item.family == fontFamily);
75
66
  if (isFontFamily) {
76
67
  isFontFamily.variants.push(customFontWeight);
77
68
  } else {
69
+ const fontVariants = [
70
+ customFontWeight
71
+ ];
78
72
  if (customFontWeight !== '700') {
79
73
  if (variants.includes('700')) {
80
74
  fontVariants.push('700'); // Auto add 700 for bold in editor inline
@@ -9,7 +9,6 @@ import { parseJson, serializableJson } from '../helpers/parse-json.js';
9
9
  import { captureException } from '@sentry/nextjs';
10
10
  import { getCustomFonts } from '../custom-fonts.js';
11
11
  import { genResizeFaviconUrl } from '../helpers/gen-favicon.js';
12
- import { PublishedThemePageMetafields } from '../../constants/index.js';
13
12
 
14
13
  const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
15
14
  try {
@@ -57,7 +56,6 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
57
56
  ]);
58
57
  const mobileOnly = dataBuilder.isMobile ?? false;
59
58
  const description = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
60
- const title = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === PublishedThemePageMetafields.GLOBAL_META_TITLE)?.value;
61
59
  const thumbnail = parseJson(dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
62
60
  const noindex = dataBuilder?.metafields?.find((item)=>item?.key === 'noindex')?.value;
63
61
  const nofollow = dataBuilder?.metafields?.find((item)=>item?.key === 'nofollow')?.value;
@@ -66,12 +64,12 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
66
64
  const favicon = shopData?.storeProperty?.favicon ?? '';
67
65
  const seo = {
68
66
  defaultTitle: shopMeta?.shop.name,
69
- title: title || dataBuilder?.name,
67
+ title: dataBuilder?.name,
70
68
  description: description ?? shopMeta?.shop.description,
71
69
  openGraph: {
72
70
  site_name: shopMeta?.shop.name,
73
71
  locale: shopMeta?.localization.country.isoCode,
74
- title: (title || dataBuilder?.name) ?? shopMeta?.shop.name,
72
+ title: dataBuilder?.name ?? shopMeta?.shop.name,
75
73
  description: description ?? shopMeta?.shop.description,
76
74
  images: thumbnail ? [
77
75
  thumbnail
@@ -33,9 +33,6 @@ const getFontFromGroupSetting = (fonts, groupSetting)=>{
33
33
  }
34
34
  }
35
35
  };
36
- const uniqueArray = (arr)=>{
37
- return Array.from(new Set(arr));
38
- };
39
36
  const getFontValue = (fonts, value)=>{
40
37
  let customFontFamily = value.custom?.fontFamily;
41
38
  if (typeof customFontFamily === 'string') {
@@ -61,18 +58,15 @@ const getFontValue = (fonts, value)=>{
61
58
  });
62
59
  const customFontWeight = value.custom?.fontWeight && variants.includes(value.custom?.fontWeight) ? value.custom?.fontWeight : variants[0];
63
60
  if (customFontWeight) {
64
- const fontVariants = uniqueArray([
65
- customFontWeight,
66
- ...value?.attrs?.isAlwaysLoadBold ? [
67
- '700'
68
- ] : []
69
- ]);
70
61
  const isExist = fonts.find((item)=>item.family == fontFamily && item.variants.includes(customFontWeight));
71
62
  if (!isExist) {
72
63
  const isFontFamily = fonts.find((item)=>item.family == fontFamily);
73
64
  if (isFontFamily) {
74
65
  isFontFamily.variants.push(customFontWeight);
75
66
  } else {
67
+ const fontVariants = [
68
+ customFontWeight
69
+ ];
76
70
  if (customFontWeight !== '700') {
77
71
  if (variants.includes('700')) {
78
72
  fontVariants.push('700'); // Auto add 700 for bold in editor inline
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.6.0-staging.23",
3
+ "version": "3.0.0-pre-production.1",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,10 +26,10 @@
26
26
  "next": "latest"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.6.0-staging.19",
30
- "@gem-sdk/plugin-cookie-bar": "2.6.0-staging.13",
31
- "@gem-sdk/plugin-quick-view": "2.6.0-staging.13",
32
- "@gem-sdk/plugin-sticky-add-to-cart": "2.6.0-staging.13"
29
+ "@gem-sdk/core": "3.0.0-pre-production.1",
30
+ "@gem-sdk/plugin-cookie-bar": "3.0.0-pre-production.1",
31
+ "@gem-sdk/plugin-quick-view": "3.0.0-pre-production.1",
32
+ "@gem-sdk/plugin-sticky-add-to-cart": "3.0.0-pre-production.1"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "next": ">=13"
@@ -1,15 +0,0 @@
1
- 'use strict';
2
-
3
- exports.PublishedThemePageMetafields = void 0;
4
- (function(PublishedThemePageMetafields) {
5
- PublishedThemePageMetafields["CUSTOM_CODE_HEADER"] = 'custom_code_header';
6
- PublishedThemePageMetafields["CUSTOM_CODE_BODY"] = 'custom_code_body';
7
- PublishedThemePageMetafields["ANALYTICS_GA_TRACKING_ID"] = 'analytics_ga_tracking_id';
8
- PublishedThemePageMetafields["ANALYTICS_FB_PIXEL_ID"] = 'analytics_fb_pixel_id';
9
- PublishedThemePageMetafields["ANALYTICS_TIKTOK_PIXEL_ID"] = 'analytics_tiktok_pixel_id';
10
- PublishedThemePageMetafields["GLOBAL_META_DESCRIPTION"] = 'global-meta-description';
11
- PublishedThemePageMetafields["GLOBAL_META_TITLE"] = 'global-meta-title';
12
- PublishedThemePageMetafields["GLOBAL_META_THUMBNAIL"] = 'global-meta-thumbnail';
13
- PublishedThemePageMetafields["NOINDEX_KEY"] = 'noindex';
14
- PublishedThemePageMetafields["NOFOLLOW_KEY"] = 'nofollow';
15
- })(exports.PublishedThemePageMetafields || (exports.PublishedThemePageMetafields = {}));
@@ -1,15 +0,0 @@
1
- var PublishedThemePageMetafields;
2
- (function(PublishedThemePageMetafields) {
3
- PublishedThemePageMetafields["CUSTOM_CODE_HEADER"] = 'custom_code_header';
4
- PublishedThemePageMetafields["CUSTOM_CODE_BODY"] = 'custom_code_body';
5
- PublishedThemePageMetafields["ANALYTICS_GA_TRACKING_ID"] = 'analytics_ga_tracking_id';
6
- PublishedThemePageMetafields["ANALYTICS_FB_PIXEL_ID"] = 'analytics_fb_pixel_id';
7
- PublishedThemePageMetafields["ANALYTICS_TIKTOK_PIXEL_ID"] = 'analytics_tiktok_pixel_id';
8
- PublishedThemePageMetafields["GLOBAL_META_DESCRIPTION"] = 'global-meta-description';
9
- PublishedThemePageMetafields["GLOBAL_META_TITLE"] = 'global-meta-title';
10
- PublishedThemePageMetafields["GLOBAL_META_THUMBNAIL"] = 'global-meta-thumbnail';
11
- PublishedThemePageMetafields["NOINDEX_KEY"] = 'noindex';
12
- PublishedThemePageMetafields["NOFOLLOW_KEY"] = 'nofollow';
13
- })(PublishedThemePageMetafields || (PublishedThemePageMetafields = {}));
14
-
15
- export { PublishedThemePageMetafields };