@gem-sdk/components 2.0.0-dev.594 → 2.0.0-dev.595

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,7 +8,7 @@ var helpers = require('./helpers.js');
8
8
  var helper = require('../../../post-purchase/utils/helper.js');
9
9
 
10
10
  const getRowStyle = (rowProps)=>{
11
- const { children, setting, builderProps, styles, style, advanced, isNotFullWidth } = rowProps;
11
+ const { children, setting, builderProps, styles, style, advanced, isNotFullWidth, parentStyle } = rowProps;
12
12
  const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
13
13
  const { width, columnGap, rowGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding } = styles ?? {};
14
14
  const innerRadius = getInnerRadius.getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
@@ -93,7 +93,8 @@ const getRowStyle = (rowProps)=>{
93
93
  ...getGlobalStyles(),
94
94
  ...getRowNormalStyle(),
95
95
  ...getMarginByWidth(),
96
- ...isPostPurchase ? getPostPurchaseStyle() : {}
96
+ ...isPostPurchase ? getPostPurchaseStyle() : {},
97
+ ...setting?.sameHeightSubgridContainer && parentStyle
97
98
  });
98
99
  const backgroundBoxStyle = system.createStyle({
99
100
  ...getRadiusStyleInner()
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
6
7
  var core = require('@gem-sdk/core');
7
8
  var ChildrenDroppable = require('../../../grid/components/ChildrenDroppable.js');
8
9
  var getStyle = require('./common/getStyle.js');
@@ -23,17 +24,21 @@ const ProductListGridLayout = (props)=>{
23
24
  product: product,
24
25
  readOnly: true,
25
26
  children: /*#__PURE__*/ jsxRuntime.jsx("div", {
27
+ ...mode === 'edit' ? getAttrProductItemEditor(product?.baseID) : {},
28
+ className: productItemClass,
26
29
  style: {
27
- ...productItemStyle
30
+ '--grchild': setting?.sameHeight ? generateGridRowArray?.[index]?.gridRow : undefined,
31
+ '--mbchild': generateGridRowArray?.[index]?.marginBottom
28
32
  },
29
- children: /*#__PURE__*/ jsxRuntime.jsx("div", {
30
- ...mode === 'edit' ? getAttrProductItemEditor(product?.baseID) : {},
31
- className: productItemClass,
32
- style: {
33
- '--grchild': setting?.sameHeight ? generateGridRowArray?.[index]?.gridRow : undefined,
34
- '--mbchild': generateGridRowArray?.[index]?.marginBottom
35
- },
36
- children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
33
+ children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : React.Children.map(children, (el)=>{
34
+ if (/*#__PURE__*/ React.isValidElement(el)) {
35
+ return /*#__PURE__*/ React.createElement(el.type, {
36
+ ...el.props,
37
+ parentStyle: productItemStyle,
38
+ key: el.key
39
+ });
40
+ }
41
+ return null;
37
42
  })
38
43
  })
39
44
  }, product?.baseID))
@@ -6,7 +6,7 @@ import { createStyleObject } from './helpers.js';
6
6
  import { postPurchaseViewSpacing } from '../../../post-purchase/utils/helper.js';
7
7
 
8
8
  const getRowStyle = (rowProps)=>{
9
- const { children, setting, builderProps, styles, style, advanced, isNotFullWidth } = rowProps;
9
+ const { children, setting, builderProps, styles, style, advanced, isNotFullWidth, parentStyle } = rowProps;
10
10
  const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
11
11
  const { width, columnGap, rowGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding } = styles ?? {};
12
12
  const innerRadius = getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
@@ -91,7 +91,8 @@ const getRowStyle = (rowProps)=>{
91
91
  ...getGlobalStyles(),
92
92
  ...getRowNormalStyle(),
93
93
  ...getMarginByWidth(),
94
- ...isPostPurchase ? getPostPurchaseStyle() : {}
94
+ ...isPostPurchase ? getPostPurchaseStyle() : {},
95
+ ...setting?.sameHeightSubgridContainer && parentStyle
95
96
  });
96
97
  const backgroundBoxStyle = createStyle({
97
98
  ...getRadiusStyleInner()
@@ -1,4 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
+ import { Children, isValidElement, createElement } from 'react';
2
3
  import { useEditorMode, ProductProvider, isEmptyChildren } from '@gem-sdk/core';
3
4
  import ChildrenDroppable from '../../../grid/components/ChildrenDroppable.js';
4
5
  import { getStyle } from './common/getStyle.js';
@@ -19,17 +20,21 @@ const ProductListGridLayout = (props)=>{
19
20
  product: product,
20
21
  readOnly: true,
21
22
  children: /*#__PURE__*/ jsx("div", {
23
+ ...mode === 'edit' ? getAttrProductItemEditor(product?.baseID) : {},
24
+ className: productItemClass,
22
25
  style: {
23
- ...productItemStyle
26
+ '--grchild': setting?.sameHeight ? generateGridRowArray?.[index]?.gridRow : undefined,
27
+ '--mbchild': generateGridRowArray?.[index]?.marginBottom
24
28
  },
25
- children: /*#__PURE__*/ jsx("div", {
26
- ...mode === 'edit' ? getAttrProductItemEditor(product?.baseID) : {},
27
- className: productItemClass,
28
- style: {
29
- '--grchild': setting?.sameHeight ? generateGridRowArray?.[index]?.gridRow : undefined,
30
- '--mbchild': generateGridRowArray?.[index]?.marginBottom
31
- },
32
- children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
29
+ children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : Children.map(children, (el)=>{
30
+ if (/*#__PURE__*/ isValidElement(el)) {
31
+ return /*#__PURE__*/ createElement(el.type, {
32
+ ...el.props,
33
+ parentStyle: productItemStyle,
34
+ key: el.key
35
+ });
36
+ }
37
+ return null;
33
38
  })
34
39
  })
35
40
  }, product?.baseID))
@@ -521,6 +521,7 @@ type RowProps = BaseProps<RowSettingsType, RowStylesType> & BasePropsWrap<{
521
521
  isNotFullWidth?: boolean;
522
522
  rawChildren?: any[];
523
523
  hiddenEmptyCol?: boolean;
524
+ parentStyle?: React.CSSProperties;
524
525
  };
525
526
 
526
527
  type ColProps = BasePropsWrap<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.594",
3
+ "version": "2.0.0-dev.595",
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.584",
26
+ "@gem-sdk/core": "2.0.0-dev.595",
27
27
  "@gem-sdk/styles": "2.0.0-dev.571",
28
28
  "@gem-sdk/system": "2.0.0-dev.504",
29
29
  "@types/react-transition-group": "^4.4.5"