@gem-sdk/components 2.0.0-dev.255 → 2.0.0-dev.259

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.
Files changed (126) hide show
  1. package/dist/cjs/banner/components/HeroBannerItem.js +2 -2
  2. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +1 -1
  3. package/dist/cjs/builder.js +3 -3
  4. package/dist/cjs/cart/components/CartList.js +2 -2
  5. package/dist/cjs/collection/components/CollectionBanner.js +2 -1
  6. package/dist/cjs/collection/components/CollectionBanner.liquid.js +2 -1
  7. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +1 -1
  8. package/dist/cjs/grid/col/Col.js +29 -0
  9. package/dist/cjs/grid/col/Col.liquid.js +25 -0
  10. package/dist/cjs/grid/col/common/getAttr.js +15 -0
  11. package/dist/cjs/grid/col/common/getClass.js +25 -0
  12. package/dist/cjs/grid/{components/Col.liquid.js → col/common/getStyles.js} +22 -16
  13. package/dist/cjs/grid/next.js +3 -3
  14. package/dist/cjs/grid/{components → row}/Row.js +44 -55
  15. package/dist/cjs/grid/row/Row.liquid.js +122 -0
  16. package/dist/cjs/grid/row/commons/common.js +35 -0
  17. package/dist/cjs/grid/row/commons/getAttr.js +20 -0
  18. package/dist/cjs/grid/row/commons/getClass.js +44 -0
  19. package/dist/cjs/grid/row/commons/getData.js +17 -0
  20. package/dist/cjs/grid/row/commons/getStyle.js +102 -0
  21. package/dist/cjs/grid/{components → row/commons}/helpers.js +4 -4
  22. package/dist/cjs/grid/row/hooks/useRowSetting.js +78 -0
  23. package/dist/cjs/grid/{setting/row → row/setting}/configs/uiV2.js +1 -1
  24. package/dist/cjs/grid/{components → section}/Section.js +1 -1
  25. package/dist/cjs/grid/{components → section}/Section.liquid.js +1 -1
  26. package/dist/cjs/grid/{setting → section/setting}/Section.js +4 -4
  27. package/dist/cjs/grid/setting/index.js +3 -3
  28. package/dist/cjs/index.js +3 -3
  29. package/dist/cjs/index.liquid.js +3 -3
  30. package/dist/cjs/post-purchase/button/setting/configs/settings.js +21 -3
  31. package/dist/cjs/post-purchase/button/setting/configs/uiV2.js +1 -1
  32. package/dist/cjs/post-purchase/callout-banner/components/CalloutBox.js +1 -1
  33. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +24 -6
  34. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/uiV2.js +1 -1
  35. package/dist/cjs/post-purchase/product/components/ProductOffer.js +3 -2
  36. package/dist/cjs/post-purchase/product/settings/accept-button/configs/settings.js +21 -3
  37. package/dist/cjs/post-purchase/product/settings/accept-button/configs/uiV2.js +1 -1
  38. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +21 -3
  39. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/uiV2.js +1 -1
  40. package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +22 -5
  41. package/dist/cjs/post-purchase/product/settings/product-quantity/configs/uiV2.js +6 -3
  42. package/dist/cjs/post-purchase/product/settings/product-variants/configs/uiV2.js +2 -1
  43. package/dist/cjs/post-purchase/product/settings/product-variants/settings/settingsV2.js +15 -3
  44. package/dist/cjs/post-purchase/utils/constants.js +20 -10
  45. package/dist/cjs/product/components/Product.js +2 -1
  46. package/dist/cjs/product/components/Product.liquid.js +2 -1
  47. package/dist/cjs/product/components/ProductList.js +1 -1
  48. package/dist/cjs/product/components/ProductList.liquid.js +1 -1
  49. package/dist/cjs/product/components/ProductQuickView/ProductQuickView.js +2 -2
  50. package/dist/cjs/sticky/components/Sticky.js +1 -1
  51. package/dist/esm/banner/components/HeroBannerItem.js +2 -2
  52. package/dist/esm/banner/components/HeroBannerItem.liquid.js +1 -1
  53. package/dist/esm/builder.js +3 -3
  54. package/dist/esm/cart/components/CartList.js +2 -2
  55. package/dist/esm/collection/components/CollectionBanner.js +2 -1
  56. package/dist/esm/collection/components/CollectionBanner.liquid.js +2 -1
  57. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +1 -1
  58. package/dist/esm/grid/col/Col.js +25 -0
  59. package/dist/esm/grid/col/Col.liquid.js +21 -0
  60. package/dist/esm/grid/col/common/getAttr.js +13 -0
  61. package/dist/esm/grid/col/common/getClass.js +23 -0
  62. package/dist/esm/grid/{components/Col.liquid.js → col/common/getStyles.js} +23 -15
  63. package/dist/esm/grid/next.js +3 -3
  64. package/dist/esm/grid/{components → row}/Row.js +41 -52
  65. package/dist/esm/grid/row/Row.liquid.js +118 -0
  66. package/dist/esm/grid/row/commons/common.js +31 -0
  67. package/dist/esm/grid/row/commons/getAttr.js +18 -0
  68. package/dist/esm/grid/row/commons/getClass.js +42 -0
  69. package/dist/esm/grid/row/commons/getData.js +15 -0
  70. package/dist/esm/grid/row/commons/getStyle.js +100 -0
  71. package/dist/esm/grid/{components → row/commons}/helpers.js +4 -4
  72. package/dist/esm/grid/row/hooks/useRowSetting.js +76 -0
  73. package/dist/esm/grid/{setting/row → row/setting}/configs/uiV2.js +1 -1
  74. package/dist/esm/grid/{components → section}/Section.js +1 -1
  75. package/dist/esm/grid/{components → section}/Section.liquid.js +1 -1
  76. package/dist/esm/grid/{setting → section/setting}/Section.js +4 -4
  77. package/dist/esm/grid/setting/index.js +3 -3
  78. package/dist/esm/index.js +3 -3
  79. package/dist/esm/index.liquid.js +3 -3
  80. package/dist/esm/post-purchase/button/setting/configs/settings.js +21 -3
  81. package/dist/esm/post-purchase/button/setting/configs/uiV2.js +1 -1
  82. package/dist/esm/post-purchase/callout-banner/components/CalloutBox.js +1 -1
  83. package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +24 -6
  84. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/uiV2.js +1 -1
  85. package/dist/esm/post-purchase/product/components/ProductOffer.js +3 -2
  86. package/dist/esm/post-purchase/product/settings/accept-button/configs/settings.js +21 -3
  87. package/dist/esm/post-purchase/product/settings/accept-button/configs/uiV2.js +1 -1
  88. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +21 -3
  89. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/uiV2.js +1 -1
  90. package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +22 -5
  91. package/dist/esm/post-purchase/product/settings/product-quantity/configs/uiV2.js +6 -3
  92. package/dist/esm/post-purchase/product/settings/product-variants/configs/uiV2.js +2 -1
  93. package/dist/esm/post-purchase/product/settings/product-variants/settings/settingsV2.js +15 -3
  94. package/dist/esm/post-purchase/utils/constants.js +20 -10
  95. package/dist/esm/product/components/Product.js +2 -1
  96. package/dist/esm/product/components/Product.liquid.js +2 -1
  97. package/dist/esm/product/components/ProductList.js +1 -1
  98. package/dist/esm/product/components/ProductList.liquid.js +1 -1
  99. package/dist/esm/product/components/ProductQuickView/ProductQuickView.js +2 -2
  100. package/dist/esm/sticky/components/Sticky.js +1 -1
  101. package/dist/types/index.d.ts +27 -42
  102. package/package.json +2 -2
  103. package/dist/cjs/grid/components/Col.js +0 -44
  104. package/dist/cjs/grid/components/Row.liquid.js +0 -141
  105. package/dist/cjs/grid/hooks/useRowStyles.js +0 -153
  106. package/dist/esm/grid/components/Col.js +0 -40
  107. package/dist/esm/grid/components/Row.liquid.js +0 -137
  108. package/dist/esm/grid/hooks/useRowStyles.js +0 -151
  109. /package/dist/cjs/grid/{setting → col/setting}/Col.js +0 -0
  110. /package/dist/cjs/grid/{hooks → row/commons}/getInnerRadius.js +0 -0
  111. /package/dist/cjs/grid/{setting/row → row/setting}/Row.js +0 -0
  112. /package/dist/cjs/grid/{setting/row → row/setting}/configs/presets.js +0 -0
  113. /package/dist/cjs/grid/{setting/row → row/setting}/configs/settings.js +0 -0
  114. /package/dist/cjs/grid/{setting/row → row/setting}/configs/uiV1.js +0 -0
  115. /package/dist/cjs/grid/{setting/section → section/setting}/configs/settings.js +0 -0
  116. /package/dist/cjs/grid/{setting/section → section/setting}/configs/uiV1.js +0 -0
  117. /package/dist/cjs/grid/{setting/section → section/setting}/configs/uiV2.js +0 -0
  118. /package/dist/esm/grid/{setting → col/setting}/Col.js +0 -0
  119. /package/dist/esm/grid/{hooks → row/commons}/getInnerRadius.js +0 -0
  120. /package/dist/esm/grid/{setting/row → row/setting}/Row.js +0 -0
  121. /package/dist/esm/grid/{setting/row → row/setting}/configs/presets.js +0 -0
  122. /package/dist/esm/grid/{setting/row → row/setting}/configs/settings.js +0 -0
  123. /package/dist/esm/grid/{setting/row → row/setting}/configs/uiV1.js +0 -0
  124. /package/dist/esm/grid/{setting/section → section/setting}/configs/settings.js +0 -0
  125. /package/dist/esm/grid/{setting/section → section/setting}/configs/uiV1.js +0 -0
  126. /package/dist/esm/grid/{setting/section → section/setting}/configs/uiV2.js +0 -0
@@ -255,14 +255,26 @@ const ProductVariantSettingsV2 = [
255
255
  },
256
256
  {
257
257
  id: 'width',
258
- type: 'input:unit',
259
258
  label: 'Width',
260
- min: 0,
259
+ type: 'dropdown:input',
260
+ inputType: 'number',
261
+ hideUnit: false,
261
262
  units: [
262
263
  'px',
263
264
  '%'
264
265
  ],
265
- hide: true,
266
+ displayOptions: [
267
+ {
268
+ label: 'Full',
269
+ value: '100%',
270
+ showValue: true
271
+ },
272
+ {
273
+ label: 'Default',
274
+ value: 'default',
275
+ showValue: true
276
+ }
277
+ ],
266
278
  devices: {
267
279
  desktop: {
268
280
  default: '100%'
@@ -2,24 +2,34 @@
2
2
 
3
3
  const postPurchaseSpacing = [
4
4
  {
5
- label: 'Default (14px)',
6
- value: undefined
5
+ label: 'XSmall',
6
+ value: 'xtight',
7
+ displayValue: '5px',
8
+ showValue: true
7
9
  },
8
10
  {
9
- label: 'XSmall (5px)',
10
- value: 'xtight'
11
+ label: 'Small',
12
+ value: 'tight',
13
+ displayValue: '9px',
14
+ showValue: true
11
15
  },
12
16
  {
13
- label: 'Small (9px)',
14
- value: 'tight'
17
+ label: 'Default',
18
+ value: 'none',
19
+ displayValue: '14px',
20
+ showValue: true
15
21
  },
16
22
  {
17
- label: 'Medium (21px)',
18
- value: 'loose'
23
+ label: 'Medium',
24
+ value: 'loose',
25
+ displayValue: '21px',
26
+ showValue: true
19
27
  },
20
28
  {
21
- label: 'Large (38px)',
22
- value: 'xloose'
29
+ label: 'Large',
30
+ value: 'xloose',
31
+ displayValue: '38px',
32
+ showValue: true
23
33
  }
24
34
  ];
25
35
  const postPurchaseViewSpacing = [
@@ -8,7 +8,8 @@ var core = require('@gem-sdk/core');
8
8
  var ChildrenDroppable = require('../../grid/components/ChildrenDroppable.js');
9
9
  var Loading = require('../../common/components/Loading.js');
10
10
  var React = require('react');
11
- var Row = require('../../grid/components/Row.js');
11
+ require('@gem-sdk/system');
12
+ var Row = require('../../grid/row/Row.js');
12
13
  var dynamic = require('next/dynamic');
13
14
  var index = require('../../post-purchase/product/helpers/index.js');
14
15
 
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@gem-sdk/core');
6
- var Row_liquid = require('../../grid/components/Row.liquid.js');
6
+ require('@gem-sdk/system');
7
+ var Row_liquid = require('../../grid/row/Row.liquid.js');
7
8
  var helpers = require('../../helpers.js');
8
9
 
9
10
  const PRODUCT_ID_LATEST = 'latest';
@@ -18,7 +18,7 @@ var product = require('../helpers/product.js');
18
18
  var SalePageProductListWarning = require('./SalePageProductListWarning.js');
19
19
  var common = require('../../dialog/helpers/common.js');
20
20
  var Head = require('next/head');
21
- var helpers = require('../../grid/components/helpers.js');
21
+ var helpers = require('../../grid/row/commons/helpers.js');
22
22
 
23
23
  const ProductNotFound = dynamic(()=>Promise.resolve().then(function () { return require('./ProductNotFound.js'); }), {
24
24
  loading: Loading.default
@@ -11,7 +11,7 @@ var arrow = require('../../carousel/components/common/arrow.js');
11
11
  var dots = require('../../carousel/components/common/dots.js');
12
12
  var productFeaturedImage = require('./ProductImages/common/productFeaturedImage.js');
13
13
  var helpers = require('../../helpers.js');
14
- var helpers$1 = require('../../grid/components/helpers.js');
14
+ var helpers$1 = require('../../grid/row/commons/helpers.js');
15
15
 
16
16
  const ProductList = ({ setting, builderProps, styles, className, children, advanced, pageContext, style })=>{
17
17
  const PREFIX_COLLECTION_ID = 'gid://shopify/Collection/';
@@ -4,8 +4,8 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
- var Col = require('../../../grid/components/Col.js');
8
- var Row = require('../../../grid/components/Row.js');
7
+ var Col = require('../../../grid/col/Col.js');
8
+ var Row = require('../../../grid/row/Row.js');
9
9
  var React = require('react');
10
10
  require('../../../modal/components/confirm.js');
11
11
  var Modal = require('../../../modal/components/Modal.js');
@@ -8,8 +8,8 @@ var core = require('@gem-sdk/core');
8
8
  var Head = require('next/head');
9
9
  var ChildrenDroppable = require('../../grid/components/ChildrenDroppable.js');
10
10
  var React = require('react');
11
- var helpers = require('../../grid/components/helpers.js');
12
11
  var _const = require('../../common/const.js');
12
+ var helpers = require('../../grid/row/commons/helpers.js');
13
13
 
14
14
  const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
15
15
  const { width, fullWidth, position, minimize, background, preloadBgImage } = setting ?? {};
@@ -2,10 +2,10 @@
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useEditorMode, filterToolbarPreview, getAspectRatioGlobalSize } from '@gem-sdk/core';
4
4
  import { useMemo } from 'react';
5
- import Row from '../../grid/components/Row.js';
5
+ import { createStyle, createClass } from '@gem-sdk/system';
6
+ import Row from '../../grid/row/Row.js';
6
7
  import AdaptiveImage from '../../image/components/AdaptiveImage.js';
7
8
  import HTML5Embed from '../../video/components/HTML5Embed.js';
8
- import { createStyle, createClass } from '@gem-sdk/system';
9
9
  import { getContainerStyle, getOverlayStyle, getRowStyle, getAdaptiveStyle, getBackgroundStyle, getContainBackgroundStyle, getYoutubeIframeStyle, getHtml5VideoStyle } from './common/getStyle.js';
10
10
  import { getContainerClasses, getOverlayClasses, getRowClasses, getAdaptivePictureClasses, getAdaptiveClasses, getBackgroundClasses, getContainBackgroundClasses, getHtml5VideoClasses, getWrapperYoutubeClasses, getIframeYoutubeClasses } from './common/getClasses.js';
11
11
  import { getAspectRatioSettings, getBackgroundImageHeroBanner, showVideoType, horizontalAlign, getWidth, scrollToContentBanner, getBgImage } from './common/common.js';
@@ -1,6 +1,6 @@
1
1
  import { template, getAspectRatioGlobalSize, getResponsiveValueByScreen } from '@gem-sdk/core';
2
- import Row from '../../grid/components/Row.liquid.js';
3
2
  import { createStyle, createClass, If } from '@gem-sdk/system';
3
+ import Row from '../../grid/row/Row.liquid.js';
4
4
  import NextImage from '../../image/components/NextImage.liquid.js';
5
5
  import HTML5Embed from '../../video/components/HTML5Embed.liquid.js';
6
6
  import 'react';
@@ -145,9 +145,9 @@ import CollectionToolbar from './collection/components/CollectionToolbar.js';
145
145
  import CollectionPaginator from './collection/components/CollectionPaginator.js';
146
146
  import './countdown-timer/setting/configs/settings.js';
147
147
  import Countdown from './countdown-timer/components/Countdown.js';
148
- import Column from './grid/components/Col.js';
149
- import Row from './grid/components/Row.js';
150
- import Section from './grid/components/Section.js';
148
+ import Column from './grid/col/Col.js';
149
+ import Row from './grid/row/Row.js';
150
+ import Section from './grid/section/Section.js';
151
151
  import Root from './grid/components/Root.js';
152
152
  import Heading from './heading/Heading.js';
153
153
  import Header from './header/components/Header.js';
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import Column from '../../grid/components/Col.js';
3
+ import Column from '../../grid/col/Col.js';
4
4
  import 'react';
5
- import { useCartData, CartLineProvider, isEmptyChildren } from '@gem-sdk/core';
6
5
  import 'next/head';
7
6
  import ChildrenDroppable from '../../grid/components/ChildrenDroppable.js';
7
+ import { useCartData, CartLineProvider, isEmptyChildren } from '@gem-sdk/core';
8
8
  import 'next/image';
9
9
  import '@gem-sdk/system';
10
10
  import 'react-youtube';
@@ -2,7 +2,8 @@
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
3
  import { useCollection, useEditorMode, makeStyleResponsive, cls, getStyleBackgroundByDevice, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState } from '@gem-sdk/core';
4
4
  import 'react';
5
- import Row from '../../grid/components/Row.js';
5
+ import '@gem-sdk/system';
6
+ import Row from '../../grid/row/Row.js';
6
7
  import Link from '../../link/components/Link.js';
7
8
 
8
9
  const composeAspect = (input)=>{
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
  import { makeStyleResponsive, template, cls, getStyleBackgroundByDevice, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, RenderIf } from '@gem-sdk/core';
3
- import Row from '../../grid/components/Row.liquid.js';
3
+ import '@gem-sdk/system';
4
+ import Row from '../../grid/row/Row.liquid.js';
4
5
 
5
6
  const composeAspect = (input)=>{
6
7
  if (!input || !input.width || !input.height || !input.src) return undefined;
@@ -1,8 +1,8 @@
1
1
  import { RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { getDynamicSourceLocales, getSettingPreloadData } from '../../helpers.js';
3
+ import '@gem-sdk/system';
3
4
  import 'react/jsx-runtime';
4
5
  import 'react';
5
- import '@gem-sdk/system';
6
6
  import '../../product/components/ProductVariants/variants/index.js';
7
7
  import Text from '../../text/components/Text.liquid.js';
8
8
  import '../../product/components/ProductBadge/constants.js';
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { usePageType, isEmptyChildren } from '@gem-sdk/core';
4
+ import ChildrenDroppable from '../components/ChildrenDroppable.js';
5
+ import { getStyles } from './common/getStyles.js';
6
+ import { getClass } from './common/getClass.js';
7
+ import { getAttr } from './common/getAttr.js';
8
+
9
+ const Column = (props)=>{
10
+ const { builderAttrs, children } = props;
11
+ const pageType = usePageType();
12
+ const isPostPurchase = pageType === 'POST_PURCHASE';
13
+ const { colStyle } = getStyles(props, isPostPurchase);
14
+ const { colClass } = getClass(props);
15
+ const { colAttr } = getAttr(props);
16
+ return /*#__PURE__*/ jsx("div", {
17
+ ...builderAttrs,
18
+ ...colAttr,
19
+ style: colStyle,
20
+ className: colClass,
21
+ children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
22
+ });
23
+ };
24
+
25
+ export { Column as default };
@@ -0,0 +1,21 @@
1
+ import { template } from '@gem-sdk/core';
2
+ import { getStyles } from './common/getStyles.js';
3
+ import { getClass } from './common/getClass.js';
4
+ import { getAttr } from './common/getAttr.js';
5
+
6
+ const Column = ({ children, className, style, builderAttrs, builderProps, advanced, setting, styles, justifyContent, order, ...props })=>{
7
+ const { colStyle } = getStyles(props);
8
+ const { colClass } = getClass(props);
9
+ const { colAttr } = getAttr(props);
10
+ return template`<div
11
+ ${{
12
+ ...colAttr
13
+ }}
14
+ style="${colStyle}"
15
+ class="${colClass}"
16
+ >
17
+ ${children ?? ''}
18
+ </div>`;
19
+ };
20
+
21
+ export { Column as default };
@@ -0,0 +1,13 @@
1
+ import { createAttr } from '@gem-sdk/system';
2
+
3
+ const getAttr = (props)=>{
4
+ const { setting } = props;
5
+ const colAttr = createAttr({
6
+ 'data-same-height-display-contents': !!setting?.allowSameHeight
7
+ });
8
+ return {
9
+ colAttr
10
+ };
11
+ };
12
+
13
+ export { getAttr };
@@ -0,0 +1,23 @@
1
+ import { createClass } from '@gem-sdk/system';
2
+
3
+ const getClass = (props)=>{
4
+ const { className, builderProps, styles, advanced } = props;
5
+ const colClass = createClass({
6
+ ...className && {
7
+ [className]: true
8
+ },
9
+ ...builderProps?.uid && {
10
+ [builderProps.uid]: true
11
+ },
12
+ ...advanced?.cssClass && {
13
+ [advanced?.cssClass]: true
14
+ },
15
+ 'gp-relative gp-flex gp-flex-col': true,
16
+ 'gp-w-full': styles?.fullWidth
17
+ });
18
+ return {
19
+ colClass
20
+ };
21
+ };
22
+
23
+ export { getClass };
@@ -1,7 +1,10 @@
1
- import { getResponsiveValue, getResponsiveValueByScreen, isColumnDirectionExist, template, makeStyleResponsive, cls } from '@gem-sdk/core';
1
+ import { createStyle } from '@gem-sdk/system';
2
+ import { getResponsiveValue, getResponsiveValueByScreen, isColumnDirectionExist, makeStyleResponsive } from '@gem-sdk/core';
2
3
 
3
- const Column = ({ children, className, style, builderAttrs, builderProps, advanced, setting, styles, justifyContent, order, layout, parentTag, ...props })=>{
4
+ const getStyles = (props, isPostPurchase)=>{
5
+ const { styles, justifyContent, order, layout, parentTag, children } = props;
4
6
  const display = getResponsiveValue(layout, 'display');
7
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
8
  const displayByBreakpointIfChildrenEmpty = {};
6
9
  const DEVICES = [
7
10
  'desktop',
@@ -15,23 +18,28 @@ const Column = ({ children, className, style, builderAttrs, builderProps, advanc
15
18
  for (const device of DEVICES){
16
19
  displayByBreakpointIfChildrenEmpty[device] = getResponsiveValueByScreen(display, device) === 'fit' || !!layout && isColumnDirectionExist(layout, device) || REMOVE_SPACING_COMPONENT_TAG.includes(parentTag || '') ? 'none' : styles?.display?.[device];
17
20
  }
18
- return template`<div
19
- ${{
20
- ...props
21
- }}
22
- style="${{
21
+ const orderRender = ()=>{
22
+ const od = order ?? styles?.order;
23
+ if (isPostPurchase) {
24
+ return {
25
+ desktop: od?.desktop,
26
+ tablet: od?.desktop,
27
+ mobile: od?.desktop
28
+ };
29
+ }
30
+ return od;
31
+ };
32
+ const colStyle = createStyle({
23
33
  ...makeStyleResponsive('cg', styles?.gap),
24
34
  ...makeStyleResponsive('rg', styles?.gap),
25
35
  ...makeStyleResponsive('ai', styles?.alignItem),
26
36
  ...makeStyleResponsive('jc', justifyContent ?? styles?.justifyContent),
27
- ...makeStyleResponsive('o', order ?? styles?.order),
37
+ ...makeStyleResponsive('o', orderRender()),
28
38
  ...makeStyleResponsive('d', children ? styles?.display : displayByBreakpointIfChildrenEmpty)
29
- }}"
30
- class="${cls(className, builderProps?.uid, advanced?.cssClass, 'gp-relative gp-flex gp-flex-col', styles?.fullWidth ? 'gp-w-full' : '')}"
31
- data-same-height-display-contents="${!!setting?.allowSameHeight}"
32
- >
33
- ${children ?? ''}
34
- </div>`;
39
+ });
40
+ return {
41
+ colStyle
42
+ };
35
43
  };
36
44
 
37
- export { Column as default };
45
+ export { getStyles };
@@ -4,16 +4,16 @@ import 'react/jsx-runtime';
4
4
  import 'react';
5
5
  import '@gem-sdk/core';
6
6
 
7
- const Section = dynamic(()=>import('./components/Section.js'), {
7
+ const Section = dynamic(()=>import('./section/Section.js'), {
8
8
  loading: Loading
9
9
  });
10
- const Row = dynamic(()=>import('./components/Row.js'), {
10
+ const Row = dynamic(()=>import('./row/Row.js'), {
11
11
  loading: Loading
12
12
  });
13
13
  const Root = dynamic(()=>import('./components/Root.js'), {
14
14
  loading: Loading
15
15
  });
16
- const Col = dynamic(()=>import('./components/Col.js'), {
16
+ const Col = dynamic(()=>import('./col/Col.js'), {
17
17
  loading: Loading
18
18
  });
19
19
  var grid = {
@@ -1,21 +1,31 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useMemo, Children, isValidElement, createElement } from 'react';
3
- import { useEditorMode, cls, isEmptyChildren, makeStyleResponsive } from '@gem-sdk/core';
4
3
  import Head from 'next/head';
5
- import ChildrenDroppable from './ChildrenDroppable.js';
6
- import { useRowStyles } from '../hooks/useRowStyles.js';
4
+ import ChildrenDroppable from '../components/ChildrenDroppable.js';
7
5
  import HTML5Embed from '../../video/components/HTML5Embed.js';
8
6
  import { getYoutubeVideoId, youtubeVideoRegex } from '../../video/helpers/common.js';
9
7
  import LiteYouTubeEmbed from '../../video/components/LiteYouTubeEmbed.js';
8
+ import { createClass } from '@gem-sdk/system';
9
+ import { getAttr } from './commons/getAttr.js';
10
+ import { getRowStyle } from './commons/getStyle.js';
11
+ import { getClass } from './commons/getClass.js';
12
+ import { checkHasBackgroundVideo } from './commons/common.js';
13
+ import { useRowSettings } from './hooks/useRowSetting.js';
10
14
 
11
15
  const Row = (props)=>{
12
- const { inView, cacheHeightOutViewport, sizeStyles, wrapStyle, radiusStyleInner, otherProps, bgVideoAspectRatioStyle, bgVideo, ref, getStyles, getVerticalAlign } = useRowStyles(props);
13
- const mode = useEditorMode();
14
- const { styles, setting, className, builderAttrs, builderProps, children } = props;
15
- const { isSection, lazy, as: Element = 'div' } = setting ?? {};
16
+ const { styles, setting, children } = props;
17
+ const { isSection, as: Element = 'div' } = setting ?? {};
16
18
  const { background } = styles ?? {};
19
+ const { builderAttrs, cacheHeightOutViewport, bgVideo, isRowEmpty, rowClassEditorOnly, isRenderPlaceholderViewBox, isPostPurchase, ref, postPurchaseVerticalAlign } = useRowSettings(props);
20
+ const { rowStyle, backgroundBoxStyle, embedVideoStyle, sectionStyle } = getRowStyle(props);
21
+ const { rowAttr, sectionAttr } = getAttr(props);
22
+ const { rowClass, backgroundBoxClass, backgroundBoxInnerClass, sectionClass, wrapperYoutubeClasses, iframeYoutubeClasses } = getClass(props);
23
+ const className = createClass({
24
+ [rowClass]: true,
25
+ [rowClassEditorOnly]: true
26
+ });
17
27
  const embed = useMemo(()=>{
18
- if (!bgVideo) return null;
28
+ if (!checkHasBackgroundVideo(background)) return;
19
29
  if (bgVideo?.videoType === 'html5' && !bgVideo.videoHtml5) return null;
20
30
  if (bgVideo?.videoType === 'youtube' && !bgVideo.video) return null;
21
31
  if (bgVideo?.videoType === 'html5' && bgVideo.videoHtml5) {
@@ -26,13 +36,8 @@ const Row = (props)=>{
26
36
  autoplay: true,
27
37
  src: bgVideo.videoHtml5,
28
38
  title: "Video",
29
- style: {
30
- ...bgVideoAspectRatioStyle,
31
- pointerEvents: 'none',
32
- transform: 'translateY(-50%)',
33
- top: '50%'
34
- },
35
- className: "gp-relative"
39
+ className: "gp-relative",
40
+ style: embedVideoStyle
36
41
  });
37
42
  }
38
43
  const youtubeUrl = bgVideo?.video ?? '';
@@ -50,54 +55,43 @@ const Row = (props)=>{
50
55
  noCookie: true,
51
56
  muted: true,
52
57
  lazy: false,
53
- style: {
54
- ...bgVideoAspectRatioStyle,
55
- pointerEvents: 'none',
56
- transform: 'translateY(-50%)',
57
- top: '50%'
58
- },
59
- wrapperClass: "gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none",
60
- iframeClass: "!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"
58
+ style: embedVideoStyle,
59
+ wrapperClass: wrapperYoutubeClasses,
60
+ iframeClass: iframeYoutubeClasses
61
61
  });
62
62
  }, [
63
63
  bgVideo,
64
- bgVideoAspectRatioStyle
64
+ embedVideoStyle
65
65
  ]);
66
66
  const element = /*#__PURE__*/ jsxs("div", {
67
- ...builderAttrs,
68
- ...otherProps,
69
- id: builderProps?.uid,
70
- "data-id": builderProps?.uidInteraction ?? builderProps?.uid,
71
67
  ref: ref,
72
- style: getStyles(),
73
- className: cls(className, builderProps?.uid, 'gp-mb-0 gp-relative gp-mx-auto gp-grid gp-max-w-full gp-transition-colors gp-duration-200 gp-ease-in-out ', {
74
- 'gp-content-visibility-hidden': mode !== 'edit' && lazy && !inView
75
- }),
68
+ ...builderAttrs,
69
+ ...rowAttr,
70
+ style: rowStyle,
71
+ className: className,
76
72
  children: [
77
73
  !!embed && /*#__PURE__*/ jsx("div", {
78
- className: "gp-absolute gp-overflow-hidden gp-w-full gp-h-full left-0 top-0",
79
- style: {
80
- ...radiusStyleInner
81
- },
74
+ className: backgroundBoxClass,
75
+ style: backgroundBoxStyle,
82
76
  children: /*#__PURE__*/ jsx("div", {
83
- className: cls('gp-background-video gp-relative gp-h-full'),
77
+ className: backgroundBoxInnerClass,
84
78
  children: embed
85
79
  })
86
80
  }),
87
- inView || mode !== 'edit' ? /*#__PURE__*/ jsx(Fragment, {
88
- children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : Children.map(children, (el)=>{
81
+ isRenderPlaceholderViewBox ? /*#__PURE__*/ jsx("div", {
82
+ style: {
83
+ height: `${cacheHeightOutViewport}px`
84
+ }
85
+ }) : /*#__PURE__*/ jsx(Fragment, {
86
+ children: isRowEmpty ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : Children.map(children, (el)=>{
89
87
  if (/*#__PURE__*/ isValidElement(el)) return /*#__PURE__*/ createElement(el.type, {
90
88
  ...el.props,
91
89
  key: el.key,
92
90
  order: setting?.order,
93
- justifyContent: getVerticalAlign()
91
+ justifyContent: isPostPurchase ? postPurchaseVerticalAlign : setting?.verticalAlign
94
92
  });
95
93
  return null;
96
94
  })
97
- }) : /*#__PURE__*/ jsx("div", {
98
- style: {
99
- height: `${cacheHeightOutViewport}px`
100
- }
101
95
  })
102
96
  ]
103
97
  });
@@ -123,14 +117,9 @@ const Row = (props)=>{
123
117
  ]
124
118
  }),
125
119
  isSection ? /*#__PURE__*/ jsx(Element, {
126
- className: "gp-mx-auto gp-max-w-full [&_*]:gp-max-w-full",
127
- "data-same-height-display-contents": !!setting?.allowSameHeight,
128
- style: {
129
- ...wrapStyle,
130
- ...makeStyleResponsive('w', sizeStyles.wrapper),
131
- ...makeStyleResponsive('pl', sizeStyles.padding),
132
- ...makeStyleResponsive('pr', sizeStyles.padding)
133
- },
120
+ ...sectionAttr,
121
+ className: sectionClass,
122
+ style: sectionStyle,
134
123
  children: element
135
124
  }) : element
136
125
  ]