@gem-sdk/components 2.0.0-staging.147 → 2.0.0-staging.149

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.
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ const getTextDropContent = (textContent)=>{
4
+ if (textContent?.includes('{max_size}')) {
5
+ return textContent?.replace('{max_size}', '10MB');
6
+ }
7
+ return textContent;
8
+ };
9
+
10
+ exports.getTextDropContent = getTextDropContent;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var core = require('@gem-sdk/core');
8
+ var index = require('./FileUpload/components/common/index.js');
8
9
 
9
10
  const FileUpload = ({ setting, styles, builderProps })=>{
10
11
  const appendTypoClass = core.composeTypographyClassName(styles?.typo);
@@ -104,7 +105,7 @@ const FileUpload = ({ setting, styles, builderProps })=>{
104
105
  ...core.getGlobalColorStateStyle('c', styles?.textColor),
105
106
  ...core.makeStyleResponsive('ta', styles?.textAlign)
106
107
  },
107
- children: setting?.textContent
108
+ children: index.getTextDropContent(setting?.textContent)
108
109
  })
109
110
  ]
110
111
  })
@@ -4,6 +4,7 @@ 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');
7
8
 
8
9
  const FileUpload = ({ setting, styles, builderProps, pageContext })=>{
9
10
  const appendTypoClass = core.composeTypographyClassName(styles?.typo);
@@ -11,7 +12,7 @@ const FileUpload = ({ setting, styles, builderProps, pageContext })=>{
11
12
  const composeGlobalSize = core.makeGlobalSize(setting?.size);
12
13
  const composePaddingSize = core.makeGlobalSize(setting?.paddingSize);
13
14
  const displayText = helpers.getDynamicSourceLocales({
14
- val: setting?.textContent,
15
+ val: index.getTextDropContent(setting?.textContent),
15
16
  uid: builderProps?.uid,
16
17
  settingId: 'textContent',
17
18
  pageContext,
@@ -19,8 +19,8 @@ const config = {
19
19
  controls: [
20
20
  {
21
21
  id: 'textContent',
22
- type: 'input',
23
- default: 'Click or drop your image to upload (Max 10MB)'
22
+ type: 'textarea',
23
+ default: 'Click or drop your image to upload (Max {max_size})'
24
24
  },
25
25
  {
26
26
  id: 'translate',
@@ -865,14 +865,29 @@ const config = {
865
865
  ]
866
866
  },
867
867
  {
868
- type: 'control',
868
+ type: 'group',
869
869
  label: {
870
870
  en: 'Text'
871
871
  },
872
- setting: {
873
- id: 'typo'
874
- },
875
- layout: 'vertical'
872
+ controls: [
873
+ {
874
+ type: 'control',
875
+ label: {
876
+ en: 'Content'
877
+ },
878
+ layout: 'horizontal',
879
+ setting: {
880
+ id: 'textContent'
881
+ }
882
+ },
883
+ {
884
+ type: 'control',
885
+ setting: {
886
+ id: 'typo'
887
+ },
888
+ layout: 'vertical'
889
+ }
890
+ ]
876
891
  },
877
892
  {
878
893
  type: 'group',
@@ -19,7 +19,7 @@ const BoldSubscriptions = ({ setting, advanced })=>{
19
19
  {% else %}
20
20
  {% assign app_blocks = section.blocks | where: "type", "@app" %}
21
21
  {% for block in app_blocks %}
22
- {% if block.type == '@app' and block.id == '${appBlockId}' %}
22
+ {% if block.type == '@app' and block.id contains '${appBlockId}' %}
23
23
  {% render block %}
24
24
  {% endif %}
25
25
  {% endfor %}
@@ -39,11 +39,11 @@ const getLiquidForAppBlock = (appBlockId, align, cssClass)=>{
39
39
  <div
40
40
  class="gp-flex gp-w-full gp-items-center ${cssClass}"
41
41
  style="${{
42
- ...core.makeStyleResponsive('jc', align)
42
+ ...core.makeStyleResponsive('ta', align)
43
43
  }}"
44
44
  >
45
45
  {% for block in app_blocks %}
46
- {% if block.type == '@app' and block.id == '${appBlockId}' %}
46
+ {% if block.type == '@app' and block.id contains '${appBlockId}' %}
47
47
  {% render block %}
48
48
  {% endif %}
49
49
  {% endfor %}
@@ -0,0 +1,8 @@
1
+ const getTextDropContent = (textContent)=>{
2
+ if (textContent?.includes('{max_size}')) {
3
+ return textContent?.replace('{max_size}', '10MB');
4
+ }
5
+ return textContent;
6
+ };
7
+
8
+ export { getTextDropContent };
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { composeTypographyClassName, composeTypographyStyle, makeGlobalSize, makeStyleResponsive, makeStyle, makeStyleState, composeRadius, handleConvertBorderWidth, handleConvertBorderStyle, handleConvertBorderColor, getStyleShadowState, cls, getGlobalColorStateStyle } from '@gem-sdk/core';
4
+ import { getTextDropContent } from './FileUpload/components/common/index.js';
4
5
 
5
6
  const FileUpload = ({ setting, styles, builderProps })=>{
6
7
  const appendTypoClass = composeTypographyClassName(styles?.typo);
@@ -100,7 +101,7 @@ const FileUpload = ({ setting, styles, builderProps })=>{
100
101
  ...getGlobalColorStateStyle('c', styles?.textColor),
101
102
  ...makeStyleResponsive('ta', styles?.textAlign)
102
103
  },
103
- children: setting?.textContent
104
+ children: getTextDropContent(setting?.textContent)
104
105
  })
105
106
  ]
106
107
  })
@@ -1,5 +1,6 @@
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';
3
4
 
4
5
  const FileUpload = ({ setting, styles, builderProps, pageContext })=>{
5
6
  const appendTypoClass = composeTypographyClassName(styles?.typo);
@@ -7,7 +8,7 @@ const FileUpload = ({ setting, styles, builderProps, pageContext })=>{
7
8
  const composeGlobalSize = makeGlobalSize(setting?.size);
8
9
  const composePaddingSize = makeGlobalSize(setting?.paddingSize);
9
10
  const displayText = getDynamicSourceLocales({
10
- val: setting?.textContent,
11
+ val: getTextDropContent(setting?.textContent),
11
12
  uid: builderProps?.uid,
12
13
  settingId: 'textContent',
13
14
  pageContext,
@@ -15,8 +15,8 @@ const config = {
15
15
  controls: [
16
16
  {
17
17
  id: 'textContent',
18
- type: 'input',
19
- default: 'Click or drop your image to upload (Max 10MB)'
18
+ type: 'textarea',
19
+ default: 'Click or drop your image to upload (Max {max_size})'
20
20
  },
21
21
  {
22
22
  id: 'translate',
@@ -861,14 +861,29 @@ const config = {
861
861
  ]
862
862
  },
863
863
  {
864
- type: 'control',
864
+ type: 'group',
865
865
  label: {
866
866
  en: 'Text'
867
867
  },
868
- setting: {
869
- id: 'typo'
870
- },
871
- layout: 'vertical'
868
+ controls: [
869
+ {
870
+ type: 'control',
871
+ label: {
872
+ en: 'Content'
873
+ },
874
+ layout: 'horizontal',
875
+ setting: {
876
+ id: 'textContent'
877
+ }
878
+ },
879
+ {
880
+ type: 'control',
881
+ setting: {
882
+ id: 'typo'
883
+ },
884
+ layout: 'vertical'
885
+ }
886
+ ]
872
887
  },
873
888
  {
874
889
  type: 'group',
@@ -15,7 +15,7 @@ const BoldSubscriptions = ({ setting, advanced })=>{
15
15
  {% else %}
16
16
  {% assign app_blocks = section.blocks | where: "type", "@app" %}
17
17
  {% for block in app_blocks %}
18
- {% if block.type == '@app' and block.id == '${appBlockId}' %}
18
+ {% if block.type == '@app' and block.id contains '${appBlockId}' %}
19
19
  {% render block %}
20
20
  {% endif %}
21
21
  {% endfor %}
@@ -37,11 +37,11 @@ const getLiquidForAppBlock = (appBlockId, align, cssClass)=>{
37
37
  <div
38
38
  class="gp-flex gp-w-full gp-items-center ${cssClass}"
39
39
  style="${{
40
- ...makeStyleResponsive('jc', align)
40
+ ...makeStyleResponsive('ta', align)
41
41
  }}"
42
42
  >
43
43
  {% for block in app_blocks %}
44
- {% if block.type == '@app' and block.id == '${appBlockId}' %}
44
+ {% if block.type == '@app' and block.id contains '${appBlockId}' %}
45
45
  {% render block %}
46
46
  {% endif %}
47
47
  {% endfor %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.147",
3
+ "version": "2.0.0-staging.149",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",