@gem-sdk/components 2.0.0-staging.149 → 2.0.0-staging.151
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.
- package/dist/cjs/button/components/Button.liquid.js +2 -2
- package/dist/cjs/helpers.js +4 -1
- package/dist/cjs/product/components/FileUpload/components/common/index.js +2 -2
- package/dist/cjs/product/components/FileUpload.liquid.js +3 -3
- package/dist/cjs/product/setting/FileUpload.js +1 -1
- package/dist/esm/button/components/Button.liquid.js +2 -2
- package/dist/esm/helpers.js +4 -1
- package/dist/esm/product/components/FileUpload/components/common/index.js +2 -2
- package/dist/esm/product/components/FileUpload.liquid.js +3 -3
- package/dist/esm/product/setting/FileUpload.js +1 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -85,9 +85,9 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
|
|
|
85
85
|
return core.template`
|
|
86
86
|
<gp-button gp-data='${core.dataStringify({
|
|
87
87
|
btnLink: setting?.btnLink
|
|
88
|
-
})}
|
|
88
|
+
})}' style="${{
|
|
89
89
|
...wrapStyle
|
|
90
|
-
}}
|
|
90
|
+
}}">
|
|
91
91
|
<div
|
|
92
92
|
style="${{
|
|
93
93
|
...restStyle,
|
package/dist/cjs/helpers.js
CHANGED
|
@@ -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 })=>{
|
|
37
|
+
const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, isCapitalize, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceMaxSize })=>{
|
|
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;
|
|
@@ -46,6 +46,9 @@ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, i
|
|
|
46
46
|
if (isReplaceLocationOrigin) {
|
|
47
47
|
locale += ` | replace: '$locationOrigin', locationOrigin`;
|
|
48
48
|
}
|
|
49
|
+
if (isReplaceMaxSize) {
|
|
50
|
+
locale += ` | replace: '$max_size', '10MB'`;
|
|
51
|
+
}
|
|
49
52
|
if (isCapitalize) {
|
|
50
53
|
locale = `${locale} | downcase`;
|
|
51
54
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const getTextDropContent = (textContent)=>{
|
|
4
|
-
if (textContent?.includes('
|
|
5
|
-
return textContent?.replace('
|
|
4
|
+
if (textContent?.includes('$max_size')) {
|
|
5
|
+
return textContent?.replace('$max_size', '10MB');
|
|
6
6
|
}
|
|
7
7
|
return textContent;
|
|
8
8
|
};
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
6
|
var helpers = require('../../helpers.js');
|
|
7
|
-
var index = require('./FileUpload/components/common/index.js');
|
|
8
7
|
|
|
9
8
|
const FileUpload = ({ setting, styles, builderProps, pageContext })=>{
|
|
10
9
|
const appendTypoClass = core.composeTypographyClassName(styles?.typo);
|
|
@@ -12,12 +11,13 @@ const FileUpload = ({ setting, styles, builderProps, pageContext })=>{
|
|
|
12
11
|
const composeGlobalSize = core.makeGlobalSize(setting?.size);
|
|
13
12
|
const composePaddingSize = core.makeGlobalSize(setting?.paddingSize);
|
|
14
13
|
const displayText = helpers.getDynamicSourceLocales({
|
|
15
|
-
val:
|
|
14
|
+
val: setting?.textContent,
|
|
16
15
|
uid: builderProps?.uid,
|
|
17
16
|
settingId: 'textContent',
|
|
18
17
|
pageContext,
|
|
19
18
|
isCapitalize: styles?.typo?.attrs?.transform === 'capitalize',
|
|
20
|
-
translate: setting?.translate
|
|
19
|
+
translate: setting?.translate,
|
|
20
|
+
isReplaceMaxSize: true
|
|
21
21
|
});
|
|
22
22
|
const cssInLine = `
|
|
23
23
|
.${builderProps?.uid}:hover .gp-file-upload__icon {
|
|
@@ -81,9 +81,9 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
|
|
|
81
81
|
return template`
|
|
82
82
|
<gp-button gp-data='${dataStringify({
|
|
83
83
|
btnLink: setting?.btnLink
|
|
84
|
-
})}
|
|
84
|
+
})}' style="${{
|
|
85
85
|
...wrapStyle
|
|
86
|
-
}}
|
|
86
|
+
}}">
|
|
87
87
|
<div
|
|
88
88
|
style="${{
|
|
89
89
|
...restStyle,
|
package/dist/esm/helpers.js
CHANGED
|
@@ -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 })=>{
|
|
35
|
+
const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, isCapitalize, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceMaxSize })=>{
|
|
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;
|
|
@@ -44,6 +44,9 @@ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, i
|
|
|
44
44
|
if (isReplaceLocationOrigin) {
|
|
45
45
|
locale += ` | replace: '$locationOrigin', locationOrigin`;
|
|
46
46
|
}
|
|
47
|
+
if (isReplaceMaxSize) {
|
|
48
|
+
locale += ` | replace: '$max_size', '10MB'`;
|
|
49
|
+
}
|
|
47
50
|
if (isCapitalize) {
|
|
48
51
|
locale = `${locale} | downcase`;
|
|
49
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const getTextDropContent = (textContent)=>{
|
|
2
|
-
if (textContent?.includes('
|
|
3
|
-
return textContent?.replace('
|
|
2
|
+
if (textContent?.includes('$max_size')) {
|
|
3
|
+
return textContent?.replace('$max_size', '10MB');
|
|
4
4
|
}
|
|
5
5
|
return textContent;
|
|
6
6
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { composeTypographyClassName, composeTypographyStyle, makeGlobalSize, template, makeStyleResponsive, makeStyle, makeStyleState, composeRadius, handleConvertBorderWidth, handleConvertBorderStyle, handleConvertBorderColor, getStyleShadowState, cls, getGlobalColorStateStyle, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
2
|
import { getDynamicSourceLocales, getSettingPreloadData } from '../../helpers.js';
|
|
3
|
-
import { getTextDropContent } from './FileUpload/components/common/index.js';
|
|
4
3
|
|
|
5
4
|
const FileUpload = ({ setting, styles, builderProps, pageContext })=>{
|
|
6
5
|
const appendTypoClass = composeTypographyClassName(styles?.typo);
|
|
@@ -8,12 +7,13 @@ const FileUpload = ({ setting, styles, builderProps, pageContext })=>{
|
|
|
8
7
|
const composeGlobalSize = makeGlobalSize(setting?.size);
|
|
9
8
|
const composePaddingSize = makeGlobalSize(setting?.paddingSize);
|
|
10
9
|
const displayText = getDynamicSourceLocales({
|
|
11
|
-
val:
|
|
10
|
+
val: setting?.textContent,
|
|
12
11
|
uid: builderProps?.uid,
|
|
13
12
|
settingId: 'textContent',
|
|
14
13
|
pageContext,
|
|
15
14
|
isCapitalize: styles?.typo?.attrs?.transform === 'capitalize',
|
|
16
|
-
translate: setting?.translate
|
|
15
|
+
translate: setting?.translate,
|
|
16
|
+
isReplaceMaxSize: true
|
|
17
17
|
});
|
|
18
18
|
const cssInLine = `
|
|
19
19
|
.${builderProps?.uid}:hover .gp-file-upload__icon {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7833,12 +7833,13 @@ type DynamicSource = {
|
|
|
7833
7833
|
defaultVal?: string;
|
|
7834
7834
|
translate?: string;
|
|
7835
7835
|
isReplaceLocationOrigin?: boolean;
|
|
7836
|
+
isReplaceMaxSize?: boolean;
|
|
7836
7837
|
};
|
|
7837
7838
|
declare const isTransparentColor: (str?: string) => boolean;
|
|
7838
7839
|
declare const isTransparentRGBA: (rgbStr: string) => boolean;
|
|
7839
7840
|
declare const isHexTransparent: (hex: string) => boolean;
|
|
7840
7841
|
declare const youtubeShortsRegex: RegExp;
|
|
7841
|
-
declare const getDynamicSourceLocales: ({ val, uid, settingId, isLiquid, pageContext, isCapitalize, defaultVal, translate, isReplaceLocationOrigin, }: DynamicSource) => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>;
|
|
7842
|
+
declare const getDynamicSourceLocales: ({ val, uid, settingId, isLiquid, pageContext, isCapitalize, defaultVal, translate, isReplaceLocationOrigin, isReplaceMaxSize, }: DynamicSource) => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>;
|
|
7842
7843
|
declare const getStaticLocale: (tag: string, key: string) => string;
|
|
7843
7844
|
declare const getSettingPreloadData: (disabledValue: string, enabledValue?: string) => string;
|
|
7844
7845
|
declare const getInsertLinkData: (defaultWrap: string, setting?: {
|