@gem-sdk/components 2.0.0-dev.454 → 2.0.0-dev.456

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.
@@ -8,10 +8,18 @@ var core = require('@gem-sdk/core');
8
8
  var ChildrenDroppable = require('../../../grid/components/ChildrenDroppable.js');
9
9
  var composeStyles = require('./common/composeStyles.js');
10
10
  var system = require('@gem-sdk/system');
11
+ var composeAttrs = require('../newsletter/common/composeAttrs.js');
11
12
 
12
- const ContactForm = ({ children, styles, setting })=>{
13
- const containerStyle = system.createStyle(composeStyles.composeContainerStyles(setting, styles));
13
+ const ContactForm = ({ children, styles, setting, style, builderAttrs, builderProps })=>{
14
+ const containerStyle = system.createStyle(composeStyles.composeContainerStyles(setting, styles, style));
15
+ const attrs = system.createAttr({
16
+ ...composeAttrs.composeContainerAttrs({
17
+ uid: builderProps?.uid || ''
18
+ }, setting)
19
+ });
14
20
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
21
+ ...attrs,
22
+ ...builderAttrs,
15
23
  style: containerStyle,
16
24
  children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
17
25
  });
@@ -4,7 +4,7 @@ var common = require('../../../helpers/common.js');
4
4
  var core = require('@gem-sdk/core');
5
5
 
6
6
  const composeStyles = (styles)=>common.filterTruthy(styles);
7
- const composeContainerStyles = (setting, styles)=>{
7
+ const composeContainerStyles = (setting, styles, style)=>{
8
8
  const { background } = setting ?? {};
9
9
  const { globalSize } = styles ?? {};
10
10
  const composeGlobalSize = core.makeGlobalSize(globalSize);
@@ -16,7 +16,8 @@ const composeContainerStyles = (setting, styles)=>{
16
16
  ...core.composeBorderResponsive(styles?.border),
17
17
  ...core.composeRadiusResponsive(styles?.rounded),
18
18
  ...core.getStyleBackgroundByDevice(background),
19
- ...core.getGradientBgrStyleByDevice(background)
19
+ ...core.getGradientBgrStyleByDevice(background),
20
+ ...style
20
21
  });
21
22
  };
22
23
 
@@ -8,14 +8,27 @@ var core = require('@gem-sdk/core');
8
8
  var ChildrenDroppable = require('../../../grid/components/ChildrenDroppable.js');
9
9
  var system = require('@gem-sdk/system');
10
10
  var composeStyles = require('../contact/common/composeStyles.js');
11
+ var composeAttrs = require('./common/composeAttrs.js');
11
12
 
12
- const Newsletter = ({ children, setting, styles })=>{
13
- const containerStyle = system.createStyle(composeStyles.composeContainerStyles(setting, styles));
13
+ const getAttr = ({ uid })=>{
14
+ return {
15
+ 'data-id': uid
16
+ };
17
+ };
18
+ const Newsletter = ({ children, setting, styles, style, builderAttrs, builderProps })=>{
19
+ const containerStyle = system.createStyle(composeStyles.composeContainerStyles(setting, styles, style));
20
+ const attrs = system.createAttr({
21
+ ...composeAttrs.composeContainerAttrs({
22
+ uid: builderProps?.uid || ''
23
+ }, setting)
24
+ });
14
25
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
15
- className: "gp-border-box",
26
+ ...attrs,
27
+ ...builderAttrs,
16
28
  style: containerStyle,
17
29
  children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
18
30
  });
19
31
  };
20
32
 
21
33
  exports.default = Newsletter;
34
+ exports.getAttr = getAttr;
@@ -5,8 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const ContactSettings = [
6
6
  {
7
7
  id: 'setting',
8
- note: `This element sends submissions to <a class="no-underline text-primary-250" target="_blank" href="https://help.shopify.com/en/manual/customers/manage-customers#email-customers">the sender email address</a>`,
9
8
  controls: [
9
+ {
10
+ id: 'contentBanner',
11
+ type: 'banner',
12
+ message: `This element sends submissions to <a class="no-underline text-primary-250" target="_blank" href="https://help.shopify.com/en/manual/customers/manage-customers#email-customers">the sender email address</a>`,
13
+ closable: true
14
+ },
10
15
  {
11
16
  id: 'callbackURL',
12
17
  type: 'pick-link',
@@ -1,6 +1,16 @@
1
1
  'use strict';
2
2
 
3
3
  const SettingUIV2 = [
4
+ {
5
+ controls: [
6
+ {
7
+ setting: {
8
+ id: 'contentBanner'
9
+ },
10
+ layout: 'vertical'
11
+ }
12
+ ]
13
+ },
4
14
  {
5
15
  label: {
6
16
  en: 'Message'
@@ -67,7 +67,6 @@ const FormCheckboxSettings = [
67
67
  type: 'input:slider',
68
68
  step: 1,
69
69
  min: 0,
70
- max: 40,
71
70
  devices: {
72
71
  desktop: {
73
72
  default: '4px'
@@ -5,8 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const NewsletterSettings = [
6
6
  {
7
7
  id: 'setting',
8
- note: `This element sends submissions to <a class="no-underline text-primary-250" target="_blank" href="https://help.shopify.com/en/manual/customers/manage-customers#email-customers">the sender email address</a>`,
9
8
  controls: [
9
+ {
10
+ id: 'contentBanner',
11
+ type: 'banner',
12
+ message: `You can manage collected email in <a class="no-underline text-primary-250" target="_blank" href="https://admin.shopify.com/customers">Customers</a>`,
13
+ closable: true
14
+ },
10
15
  {
11
16
  id: 'afterSubmitAction',
12
17
  type: 'select',
@@ -47,7 +52,8 @@ const NewsletterSettings = [
47
52
  id: 'successColor',
48
53
  type: 'color-picker-v2',
49
54
  label: 'Color',
50
- default: '#00A042'
55
+ default: '#00A042',
56
+ compoDefaultValue: '#00A042'
51
57
  },
52
58
  {
53
59
  id: 'errorMessage',
@@ -61,7 +67,8 @@ const NewsletterSettings = [
61
67
  id: 'errorColor',
62
68
  type: 'color-picker-v2',
63
69
  label: 'Color',
64
- default: '#F44336'
70
+ default: '#F44336',
71
+ compoDefaultValue: '#F44336'
65
72
  },
66
73
  {
67
74
  id: 'translate',
@@ -1,6 +1,16 @@
1
1
  'use strict';
2
2
 
3
3
  const SettingUIV2 = [
4
+ {
5
+ controls: [
6
+ {
7
+ setting: {
8
+ id: 'contentBanner'
9
+ },
10
+ layout: 'vertical'
11
+ }
12
+ ]
13
+ },
4
14
  {
5
15
  label: {
6
16
  en: 'Message'
@@ -13,7 +13,13 @@ var classes = require('../common/classes.js');
13
13
  const ProductOfferItem = (props)=>{
14
14
  const { product, setting, builderProps, children, index, totalProduct, builderAttrs, styles } = props;
15
15
  const mode = core.useEditorMode();
16
- const { variantSelected, ...rowSetting } = setting ?? {};
16
+ const { variantSelected, productOfferLayout, layout, ...rowSetting } = setting ?? {};
17
+ Object.keys(layout || {}).forEach((device)=>{
18
+ const key = device;
19
+ if (productOfferLayout?.[key] === '2col' && layout?.[key]) {
20
+ layout[key].display = 'fill';
21
+ }
22
+ });
17
23
  const variantId = variantSelected?.[product?.baseID ?? '']?.variantId;
18
24
  const attrs$1 = system.createAttr({
19
25
  ...attrs.getProductOfferAttrs(product, builderProps?.uid)
@@ -33,7 +39,10 @@ const ProductOfferItem = (props)=>{
33
39
  } : {},
34
40
  children: /*#__PURE__*/ jsxRuntime.jsx(Row.default, {
35
41
  builderAttrs: builderAttrs,
36
- setting: rowSetting,
42
+ setting: {
43
+ ...rowSetting,
44
+ layout
45
+ },
37
46
  styles: styles,
38
47
  children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
39
48
  })
@@ -78,7 +78,7 @@ const SettingUIV2 = [
78
78
  en: 'Style'
79
79
  },
80
80
  popoverLabel: {
81
- en: 'Line through'
81
+ en: 'Line through style'
82
82
  },
83
83
  getValueFromSettingID: 'lineColor',
84
84
  comboType: 'color',
@@ -3,11 +3,19 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { isEmptyChildren } from '@gem-sdk/core';
4
4
  import ChildrenDroppable from '../../../grid/components/ChildrenDroppable.js';
5
5
  import { composeContainerStyles } from './common/composeStyles.js';
6
- import { createStyle } from '@gem-sdk/system';
6
+ import { createStyle, createAttr } from '@gem-sdk/system';
7
+ import { composeContainerAttrs } from '../newsletter/common/composeAttrs.js';
7
8
 
8
- const ContactForm = ({ children, styles, setting })=>{
9
- const containerStyle = createStyle(composeContainerStyles(setting, styles));
9
+ const ContactForm = ({ children, styles, setting, style, builderAttrs, builderProps })=>{
10
+ const containerStyle = createStyle(composeContainerStyles(setting, styles, style));
11
+ const attrs = createAttr({
12
+ ...composeContainerAttrs({
13
+ uid: builderProps?.uid || ''
14
+ }, setting)
15
+ });
10
16
  return /*#__PURE__*/ jsx("div", {
17
+ ...attrs,
18
+ ...builderAttrs,
11
19
  style: containerStyle,
12
20
  children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
13
21
  });
@@ -2,7 +2,7 @@ import { filterTruthy } from '../../../helpers/common.js';
2
2
  import { makeGlobalSize, composeBorderResponsive, composeRadiusResponsive, getStyleBackgroundByDevice, getGradientBgrStyleByDevice } from '@gem-sdk/core';
3
3
 
4
4
  const composeStyles = (styles)=>filterTruthy(styles);
5
- const composeContainerStyles = (setting, styles)=>{
5
+ const composeContainerStyles = (setting, styles, style)=>{
6
6
  const { background } = setting ?? {};
7
7
  const { globalSize } = styles ?? {};
8
8
  const composeGlobalSize = makeGlobalSize(globalSize);
@@ -14,7 +14,8 @@ const composeContainerStyles = (setting, styles)=>{
14
14
  ...composeBorderResponsive(styles?.border),
15
15
  ...composeRadiusResponsive(styles?.rounded),
16
16
  ...getStyleBackgroundByDevice(background),
17
- ...getGradientBgrStyleByDevice(background)
17
+ ...getGradientBgrStyleByDevice(background),
18
+ ...style
18
19
  });
19
20
  };
20
21
 
@@ -2,16 +2,28 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { isEmptyChildren } from '@gem-sdk/core';
4
4
  import ChildrenDroppable from '../../../grid/components/ChildrenDroppable.js';
5
- import { createStyle } from '@gem-sdk/system';
5
+ import { createStyle, createAttr } from '@gem-sdk/system';
6
6
  import { composeContainerStyles } from '../contact/common/composeStyles.js';
7
+ import { composeContainerAttrs } from './common/composeAttrs.js';
7
8
 
8
- const Newsletter = ({ children, setting, styles })=>{
9
- const containerStyle = createStyle(composeContainerStyles(setting, styles));
9
+ const getAttr = ({ uid })=>{
10
+ return {
11
+ 'data-id': uid
12
+ };
13
+ };
14
+ const Newsletter = ({ children, setting, styles, style, builderAttrs, builderProps })=>{
15
+ const containerStyle = createStyle(composeContainerStyles(setting, styles, style));
16
+ const attrs = createAttr({
17
+ ...composeContainerAttrs({
18
+ uid: builderProps?.uid || ''
19
+ }, setting)
20
+ });
10
21
  return /*#__PURE__*/ jsx("div", {
11
- className: "gp-border-box",
22
+ ...attrs,
23
+ ...builderAttrs,
12
24
  style: containerStyle,
13
25
  children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
14
26
  });
15
27
  };
16
28
 
17
- export { Newsletter as default };
29
+ export { Newsletter as default, getAttr };
@@ -1,8 +1,13 @@
1
1
  const ContactSettings = [
2
2
  {
3
3
  id: 'setting',
4
- note: `This element sends submissions to <a class="no-underline text-primary-250" target="_blank" href="https://help.shopify.com/en/manual/customers/manage-customers#email-customers">the sender email address</a>`,
5
4
  controls: [
5
+ {
6
+ id: 'contentBanner',
7
+ type: 'banner',
8
+ message: `This element sends submissions to <a class="no-underline text-primary-250" target="_blank" href="https://help.shopify.com/en/manual/customers/manage-customers#email-customers">the sender email address</a>`,
9
+ closable: true
10
+ },
6
11
  {
7
12
  id: 'callbackURL',
8
13
  type: 'pick-link',
@@ -1,4 +1,14 @@
1
1
  const SettingUIV2 = [
2
+ {
3
+ controls: [
4
+ {
5
+ setting: {
6
+ id: 'contentBanner'
7
+ },
8
+ layout: 'vertical'
9
+ }
10
+ ]
11
+ },
2
12
  {
3
13
  label: {
4
14
  en: 'Message'
@@ -63,7 +63,6 @@ const FormCheckboxSettings = [
63
63
  type: 'input:slider',
64
64
  step: 1,
65
65
  min: 0,
66
- max: 40,
67
66
  devices: {
68
67
  desktop: {
69
68
  default: '4px'
@@ -1,8 +1,13 @@
1
1
  const NewsletterSettings = [
2
2
  {
3
3
  id: 'setting',
4
- note: `This element sends submissions to <a class="no-underline text-primary-250" target="_blank" href="https://help.shopify.com/en/manual/customers/manage-customers#email-customers">the sender email address</a>`,
5
4
  controls: [
5
+ {
6
+ id: 'contentBanner',
7
+ type: 'banner',
8
+ message: `You can manage collected email in <a class="no-underline text-primary-250" target="_blank" href="https://admin.shopify.com/customers">Customers</a>`,
9
+ closable: true
10
+ },
6
11
  {
7
12
  id: 'afterSubmitAction',
8
13
  type: 'select',
@@ -43,7 +48,8 @@ const NewsletterSettings = [
43
48
  id: 'successColor',
44
49
  type: 'color-picker-v2',
45
50
  label: 'Color',
46
- default: '#00A042'
51
+ default: '#00A042',
52
+ compoDefaultValue: '#00A042'
47
53
  },
48
54
  {
49
55
  id: 'errorMessage',
@@ -57,7 +63,8 @@ const NewsletterSettings = [
57
63
  id: 'errorColor',
58
64
  type: 'color-picker-v2',
59
65
  label: 'Color',
60
- default: '#F44336'
66
+ default: '#F44336',
67
+ compoDefaultValue: '#F44336'
61
68
  },
62
69
  {
63
70
  id: 'translate',
@@ -1,4 +1,14 @@
1
1
  const SettingUIV2 = [
2
+ {
3
+ controls: [
4
+ {
5
+ setting: {
6
+ id: 'contentBanner'
7
+ },
8
+ layout: 'vertical'
9
+ }
10
+ ]
11
+ },
2
12
  {
3
13
  label: {
4
14
  en: 'Message'
@@ -11,7 +11,13 @@ import { getProductOfferItemClasses } from '../common/classes.js';
11
11
  const ProductOfferItem = (props)=>{
12
12
  const { product, setting, builderProps, children, index, totalProduct, builderAttrs, styles } = props;
13
13
  const mode = useEditorMode();
14
- const { variantSelected, ...rowSetting } = setting ?? {};
14
+ const { variantSelected, productOfferLayout, layout, ...rowSetting } = setting ?? {};
15
+ Object.keys(layout || {}).forEach((device)=>{
16
+ const key = device;
17
+ if (productOfferLayout?.[key] === '2col' && layout?.[key]) {
18
+ layout[key].display = 'fill';
19
+ }
20
+ });
15
21
  const variantId = variantSelected?.[product?.baseID ?? '']?.variantId;
16
22
  const attrs = createAttr({
17
23
  ...getProductOfferAttrs(product, builderProps?.uid)
@@ -31,7 +37,10 @@ const ProductOfferItem = (props)=>{
31
37
  } : {},
32
38
  children: /*#__PURE__*/ jsx(Row, {
33
39
  builderAttrs: builderAttrs,
34
- setting: rowSetting,
40
+ setting: {
41
+ ...rowSetting,
42
+ layout
43
+ },
35
44
  styles: styles,
36
45
  children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
37
46
  })
@@ -76,7 +76,7 @@ const SettingUIV2 = [
76
76
  en: 'Style'
77
77
  },
78
78
  popoverLabel: {
79
- en: 'Line through'
79
+ en: 'Line through style'
80
80
  },
81
81
  getValueFromSettingID: 'lineColor',
82
82
  comboType: 'color',
@@ -1607,6 +1607,7 @@ type NewsLetterSetting = {
1607
1607
  size?: SizeSetting;
1608
1608
  width?: ObjectDevices$1<string | number | undefined>;
1609
1609
  afterSubmitActionToggle?: ObjectDevices$1<boolean>;
1610
+ contentBanner?: string;
1610
1611
  };
1611
1612
  type NewsLetterStyle = {
1612
1613
  globalSize?: ObjectDevices$1<SizeSettingGlobal>;
@@ -1698,9 +1699,9 @@ type TextInputStyle = {
1698
1699
  };
1699
1700
  type TextInputProps = BasePropsWrap<TextInputSetting, TextInputStyle, Advanced> & Omit<React.ComponentPropsWithoutRef<'input'>, ''>;
1700
1701
 
1701
- declare const Newsletter$1: ({ children, setting, styles }: NewsletterProps) => React.JSX.Element;
1702
+ declare const Newsletter$1: ({ children, setting, styles, style, builderAttrs, builderProps, }: NewsletterProps) => React.JSX.Element;
1702
1703
 
1703
- declare const ContactForm$1: ({ children, styles, setting }: NewsletterProps) => React.JSX.Element;
1704
+ declare const ContactForm$1: ({ children, styles, setting, style, builderAttrs, builderProps, }: NewsletterProps) => React.JSX.Element;
1704
1705
 
1705
1706
  declare const FormEmail$1: ({ builderProps, builderAttrs, setting, advanced, children, styles, }: FormEmailProps) => React.JSX.Element;
1706
1707
 
@@ -7257,8 +7258,8 @@ declare const _default$1: {
7257
7258
  Coupon: React.FC<CouponProps>;
7258
7259
  Dialog: (props: DialogProps) => React.JSX.Element;
7259
7260
  EstimateDate: React.FC<EstimateDateProps>;
7260
- Newsletter: ({ children, setting, styles }: NewsletterProps) => React.JSX.Element;
7261
- ContactForm: ({ children, styles, setting }: NewsletterProps) => React.JSX.Element;
7261
+ Newsletter: ({ children, setting, styles, style, builderAttrs, builderProps, }: NewsletterProps) => React.JSX.Element;
7262
+ ContactForm: ({ children, styles, setting, style, builderAttrs, builderProps, }: NewsletterProps) => React.JSX.Element;
7262
7263
  FormEmail: ({ builderProps, builderAttrs, setting, advanced, children, styles, }: FormEmailProps) => React.JSX.Element;
7263
7264
  SubmitButton: ({ setting, builderProps, builderAttrs, style, styles, advanced, children, }: SubmitButtonProps) => React.JSX.Element;
7264
7265
  TextField: React.FC<TextFieldProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.454",
3
+ "version": "2.0.0-dev.456",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -23,7 +23,7 @@
23
23
  "update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
24
24
  },
25
25
  "devDependencies": {
26
- "@gem-sdk/core": "2.0.0-dev.453",
26
+ "@gem-sdk/core": "2.0.0-dev.455",
27
27
  "@gem-sdk/styles": "2.0.0-dev.381",
28
28
  "@gem-sdk/system": "2.0.0-dev.451",
29
29
  "@types/react-transition-group": "^4.4.5"