@gem-sdk/components 2.1.27-staging.4 → 2.1.27-staging.6

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.
@@ -14,7 +14,7 @@ const ArticleList = ({ styles, setting, className, children, builderProps })=>{
14
14
  const { articleSetting, numberOfArticle } = setting ?? {};
15
15
  const { articleIds, articlePickType } = articleSetting ?? {};
16
16
  const articlesQuery = {
17
- first: articleIds?.length ?? 50,
17
+ first: articleIds?.length || 50,
18
18
  where: {
19
19
  baseIDIn: [
20
20
  ...articleSetting?.articleIds ?? []
@@ -34,7 +34,7 @@ const isHexTransparent = (hex)=>{
34
34
  return Boolean(a);
35
35
  };
36
36
  const youtubeShortsRegex = /^(?:https?:\/\/)?(?:www\.)?youtube\.com\/shorts\/([^"&?/\s]{11})$/i;
37
- const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, isCapitalize, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceInventoryQuantity })=>{
37
+ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceInventoryQuantity })=>{
38
38
  const hasLiquidInValue = new RegExp(/\{\{.*?\}\}|\{%.*?%\}/).test(val?.toString() ?? '');
39
39
  const translateLimit = pageContext?.isTranslateWithLocale ? 1000 : 5000;
40
40
  if (!translate || !val?.toString().trim() || val.toString().length > translateLimit || hasLiquidInValue || pageContext?.isPreviewing) return val ?? defaultVal;
@@ -49,9 +49,6 @@ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, i
49
49
  if (isReplaceInventoryQuantity) {
50
50
  locale += ` | replace: '<$quantity$>', inventory_quantity | replace: '&lt;$quantity$&gt;', inventory_quantity`;
51
51
  }
52
- if (isCapitalize) {
53
- locale = `${locale} | downcase`;
54
- }
55
52
  if (isLiquid) return locale;
56
53
  return `{{ ${locale} }}`;
57
54
  };
@@ -90,7 +90,7 @@ const Text = /*#__PURE__*/ React.forwardRef(({ styles, builderAttrs, style, sett
90
90
  overflow: 'hidden'
91
91
  },
92
92
  dangerouslySetInnerHTML: {
93
- __html: common.getDisplayText(text?.toString() ?? '<p><br></p>', styles?.typo?.attrs?.transform === 'capitalize')
93
+ __html: common.getDisplayText(text?.toString() ?? '<p><br></p>')
94
94
  }
95
95
  })
96
96
  }),
@@ -32,7 +32,6 @@ const Text = ({ styles, builderAttrs, style, setting, advanced, builderProps, cl
32
32
  uid: builderProps?.uid,
33
33
  settingId: setting?.translate,
34
34
  pageContext,
35
- isCapitalize: styles?.typo?.attrs?.transform === 'capitalize',
36
35
  translate: setting.translate,
37
36
  isReplaceLocationOrigin: isViewliveHeadingOrTextComponent
38
37
  });
@@ -40,7 +39,7 @@ const Text = ({ styles, builderAttrs, style, setting, advanced, builderProps, cl
40
39
  displayText = renderText;
41
40
  }
42
41
  } else {
43
- displayText = common.getDisplayText(renderText ?? '', styles?.typo?.attrs?.transform === 'capitalize');
42
+ displayText = common.getDisplayText(renderText ?? '');
44
43
  }
45
44
  return core.template`
46
45
  {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
@@ -10,7 +10,7 @@ const ArticleList = ({ styles, setting, className, children, builderProps })=>{
10
10
  const { articleSetting, numberOfArticle } = setting ?? {};
11
11
  const { articleIds, articlePickType } = articleSetting ?? {};
12
12
  const articlesQuery = {
13
- first: articleIds?.length ?? 50,
13
+ first: articleIds?.length || 50,
14
14
  where: {
15
15
  baseIDIn: [
16
16
  ...articleSetting?.articleIds ?? []
@@ -32,7 +32,7 @@ const isHexTransparent = (hex)=>{
32
32
  return Boolean(a);
33
33
  };
34
34
  const youtubeShortsRegex = /^(?:https?:\/\/)?(?:www\.)?youtube\.com\/shorts\/([^"&?/\s]{11})$/i;
35
- const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, isCapitalize, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceInventoryQuantity })=>{
35
+ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceInventoryQuantity })=>{
36
36
  const hasLiquidInValue = new RegExp(/\{\{.*?\}\}|\{%.*?%\}/).test(val?.toString() ?? '');
37
37
  const translateLimit = pageContext?.isTranslateWithLocale ? 1000 : 5000;
38
38
  if (!translate || !val?.toString().trim() || val.toString().length > translateLimit || hasLiquidInValue || pageContext?.isPreviewing) return val ?? defaultVal;
@@ -47,9 +47,6 @@ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, i
47
47
  if (isReplaceInventoryQuantity) {
48
48
  locale += ` | replace: '<$quantity$>', inventory_quantity | replace: '&lt;$quantity$&gt;', inventory_quantity`;
49
49
  }
50
- if (isCapitalize) {
51
- locale = `${locale} | downcase`;
52
- }
53
50
  if (isLiquid) return locale;
54
51
  return `{{ ${locale} }}`;
55
52
  };
@@ -86,7 +86,7 @@ const Text = /*#__PURE__*/ forwardRef(({ styles, builderAttrs, style, setting, a
86
86
  overflow: 'hidden'
87
87
  },
88
88
  dangerouslySetInnerHTML: {
89
- __html: getDisplayText(text?.toString() ?? '<p><br></p>', styles?.typo?.attrs?.transform === 'capitalize')
89
+ __html: getDisplayText(text?.toString() ?? '<p><br></p>')
90
90
  }
91
91
  })
92
92
  }),
@@ -28,7 +28,6 @@ const Text = ({ styles, builderAttrs, style, setting, advanced, builderProps, cl
28
28
  uid: builderProps?.uid,
29
29
  settingId: setting?.translate,
30
30
  pageContext,
31
- isCapitalize: styles?.typo?.attrs?.transform === 'capitalize',
32
31
  translate: setting.translate,
33
32
  isReplaceLocationOrigin: isViewliveHeadingOrTextComponent
34
33
  });
@@ -36,7 +35,7 @@ const Text = ({ styles, builderAttrs, style, setting, advanced, builderProps, cl
36
35
  displayText = renderText;
37
36
  }
38
37
  } else {
39
- displayText = getDisplayText(renderText ?? '', styles?.typo?.attrs?.transform === 'capitalize');
38
+ displayText = getDisplayText(renderText ?? '');
40
39
  }
41
40
  return template`
42
41
  {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
@@ -7809,7 +7809,7 @@ declare const isTransparentColor: (str?: string) => boolean;
7809
7809
  declare const isTransparentRGBA: (rgbStr: string) => boolean;
7810
7810
  declare const isHexTransparent: (hex: string) => boolean;
7811
7811
  declare const youtubeShortsRegex: RegExp;
7812
- declare const getDynamicSourceLocales: ({ val, uid, settingId, isLiquid, pageContext, isCapitalize, defaultVal, translate, isReplaceLocationOrigin, isReplaceInventoryQuantity, }: DynamicSource) => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>;
7812
+ declare const getDynamicSourceLocales: ({ val, uid, settingId, isLiquid, pageContext, defaultVal, translate, isReplaceLocationOrigin, isReplaceInventoryQuantity, }: DynamicSource) => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>;
7813
7813
  declare const getStaticLocale: (tag: string, key: string) => string;
7814
7814
  declare const getSettingPreloadData: (disabledValue: string, enabledValue?: string) => string;
7815
7815
  declare const getInsertLinkData: (defaultWrap: string, setting?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.1.27-staging.4",
3
+ "version": "2.1.27-staging.6",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",