@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.
- package/dist/cjs/banner/components/HeroBannerItem.js +2 -2
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +1 -1
- package/dist/cjs/builder.js +3 -3
- package/dist/cjs/cart/components/CartList.js +2 -2
- package/dist/cjs/collection/components/CollectionBanner.js +2 -1
- package/dist/cjs/collection/components/CollectionBanner.liquid.js +2 -1
- package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +1 -1
- package/dist/cjs/grid/col/Col.js +29 -0
- package/dist/cjs/grid/col/Col.liquid.js +25 -0
- package/dist/cjs/grid/col/common/getAttr.js +15 -0
- package/dist/cjs/grid/col/common/getClass.js +25 -0
- package/dist/cjs/grid/{components/Col.liquid.js → col/common/getStyles.js} +22 -16
- package/dist/cjs/grid/next.js +3 -3
- package/dist/cjs/grid/{components → row}/Row.js +44 -55
- package/dist/cjs/grid/row/Row.liquid.js +122 -0
- package/dist/cjs/grid/row/commons/common.js +35 -0
- package/dist/cjs/grid/row/commons/getAttr.js +20 -0
- package/dist/cjs/grid/row/commons/getClass.js +44 -0
- package/dist/cjs/grid/row/commons/getData.js +17 -0
- package/dist/cjs/grid/row/commons/getStyle.js +102 -0
- package/dist/cjs/grid/{components → row/commons}/helpers.js +4 -4
- package/dist/cjs/grid/row/hooks/useRowSetting.js +78 -0
- package/dist/cjs/grid/{setting/row → row/setting}/configs/uiV2.js +1 -1
- package/dist/cjs/grid/{components → section}/Section.js +1 -1
- package/dist/cjs/grid/{components → section}/Section.liquid.js +1 -1
- package/dist/cjs/grid/{setting → section/setting}/Section.js +4 -4
- package/dist/cjs/grid/setting/index.js +3 -3
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.liquid.js +3 -3
- package/dist/cjs/post-purchase/button/setting/configs/settings.js +21 -3
- package/dist/cjs/post-purchase/button/setting/configs/uiV2.js +1 -1
- package/dist/cjs/post-purchase/callout-banner/components/CalloutBox.js +1 -1
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +24 -6
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/uiV2.js +1 -1
- package/dist/cjs/post-purchase/product/components/ProductOffer.js +3 -2
- package/dist/cjs/post-purchase/product/settings/accept-button/configs/settings.js +21 -3
- package/dist/cjs/post-purchase/product/settings/accept-button/configs/uiV2.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +21 -3
- package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/uiV2.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +22 -5
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/uiV2.js +6 -3
- package/dist/cjs/post-purchase/product/settings/product-variants/configs/uiV2.js +2 -1
- package/dist/cjs/post-purchase/product/settings/product-variants/settings/settingsV2.js +15 -3
- package/dist/cjs/post-purchase/utils/constants.js +20 -10
- package/dist/cjs/product/components/Product.js +2 -1
- package/dist/cjs/product/components/Product.liquid.js +2 -1
- package/dist/cjs/product/components/ProductList.js +1 -1
- package/dist/cjs/product/components/ProductList.liquid.js +1 -1
- package/dist/cjs/product/components/ProductQuickView/ProductQuickView.js +2 -2
- package/dist/cjs/sticky/components/Sticky.js +1 -1
- package/dist/esm/banner/components/HeroBannerItem.js +2 -2
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +1 -1
- package/dist/esm/builder.js +3 -3
- package/dist/esm/cart/components/CartList.js +2 -2
- package/dist/esm/collection/components/CollectionBanner.js +2 -1
- package/dist/esm/collection/components/CollectionBanner.liquid.js +2 -1
- package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +1 -1
- package/dist/esm/grid/col/Col.js +25 -0
- package/dist/esm/grid/col/Col.liquid.js +21 -0
- package/dist/esm/grid/col/common/getAttr.js +13 -0
- package/dist/esm/grid/col/common/getClass.js +23 -0
- package/dist/esm/grid/{components/Col.liquid.js → col/common/getStyles.js} +23 -15
- package/dist/esm/grid/next.js +3 -3
- package/dist/esm/grid/{components → row}/Row.js +41 -52
- package/dist/esm/grid/row/Row.liquid.js +118 -0
- package/dist/esm/grid/row/commons/common.js +31 -0
- package/dist/esm/grid/row/commons/getAttr.js +18 -0
- package/dist/esm/grid/row/commons/getClass.js +42 -0
- package/dist/esm/grid/row/commons/getData.js +15 -0
- package/dist/esm/grid/row/commons/getStyle.js +100 -0
- package/dist/esm/grid/{components → row/commons}/helpers.js +4 -4
- package/dist/esm/grid/row/hooks/useRowSetting.js +76 -0
- package/dist/esm/grid/{setting/row → row/setting}/configs/uiV2.js +1 -1
- package/dist/esm/grid/{components → section}/Section.js +1 -1
- package/dist/esm/grid/{components → section}/Section.liquid.js +1 -1
- package/dist/esm/grid/{setting → section/setting}/Section.js +4 -4
- package/dist/esm/grid/setting/index.js +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.liquid.js +3 -3
- package/dist/esm/post-purchase/button/setting/configs/settings.js +21 -3
- package/dist/esm/post-purchase/button/setting/configs/uiV2.js +1 -1
- package/dist/esm/post-purchase/callout-banner/components/CalloutBox.js +1 -1
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +24 -6
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/uiV2.js +1 -1
- package/dist/esm/post-purchase/product/components/ProductOffer.js +3 -2
- package/dist/esm/post-purchase/product/settings/accept-button/configs/settings.js +21 -3
- package/dist/esm/post-purchase/product/settings/accept-button/configs/uiV2.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +21 -3
- package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/uiV2.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +22 -5
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/uiV2.js +6 -3
- package/dist/esm/post-purchase/product/settings/product-variants/configs/uiV2.js +2 -1
- package/dist/esm/post-purchase/product/settings/product-variants/settings/settingsV2.js +15 -3
- package/dist/esm/post-purchase/utils/constants.js +20 -10
- package/dist/esm/product/components/Product.js +2 -1
- package/dist/esm/product/components/Product.liquid.js +2 -1
- package/dist/esm/product/components/ProductList.js +1 -1
- package/dist/esm/product/components/ProductList.liquid.js +1 -1
- package/dist/esm/product/components/ProductQuickView/ProductQuickView.js +2 -2
- package/dist/esm/sticky/components/Sticky.js +1 -1
- package/dist/types/index.d.ts +27 -42
- package/package.json +2 -2
- package/dist/cjs/grid/components/Col.js +0 -44
- package/dist/cjs/grid/components/Row.liquid.js +0 -141
- package/dist/cjs/grid/hooks/useRowStyles.js +0 -153
- package/dist/esm/grid/components/Col.js +0 -40
- package/dist/esm/grid/components/Row.liquid.js +0 -137
- package/dist/esm/grid/hooks/useRowStyles.js +0 -151
- /package/dist/cjs/grid/{setting → col/setting}/Col.js +0 -0
- /package/dist/cjs/grid/{hooks → row/commons}/getInnerRadius.js +0 -0
- /package/dist/cjs/grid/{setting/row → row/setting}/Row.js +0 -0
- /package/dist/cjs/grid/{setting/row → row/setting}/configs/presets.js +0 -0
- /package/dist/cjs/grid/{setting/row → row/setting}/configs/settings.js +0 -0
- /package/dist/cjs/grid/{setting/row → row/setting}/configs/uiV1.js +0 -0
- /package/dist/cjs/grid/{setting/section → section/setting}/configs/settings.js +0 -0
- /package/dist/cjs/grid/{setting/section → section/setting}/configs/uiV1.js +0 -0
- /package/dist/cjs/grid/{setting/section → section/setting}/configs/uiV2.js +0 -0
- /package/dist/esm/grid/{setting → col/setting}/Col.js +0 -0
- /package/dist/esm/grid/{hooks → row/commons}/getInnerRadius.js +0 -0
- /package/dist/esm/grid/{setting/row → row/setting}/Row.js +0 -0
- /package/dist/esm/grid/{setting/row → row/setting}/configs/presets.js +0 -0
- /package/dist/esm/grid/{setting/row → row/setting}/configs/settings.js +0 -0
- /package/dist/esm/grid/{setting/row → row/setting}/configs/uiV1.js +0 -0
- /package/dist/esm/grid/{setting/section → section/setting}/configs/settings.js +0 -0
- /package/dist/esm/grid/{setting/section → section/setting}/configs/uiV1.js +0 -0
- /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
|
-
|
|
259
|
+
type: 'dropdown:input',
|
|
260
|
+
inputType: 'number',
|
|
261
|
+
hideUnit: false,
|
|
261
262
|
units: [
|
|
262
263
|
'px',
|
|
263
264
|
'%'
|
|
264
265
|
],
|
|
265
|
-
|
|
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: '
|
|
6
|
-
value:
|
|
5
|
+
label: 'XSmall',
|
|
6
|
+
value: 'xtight',
|
|
7
|
+
displayValue: '5px',
|
|
8
|
+
showValue: true
|
|
7
9
|
},
|
|
8
10
|
{
|
|
9
|
-
label: '
|
|
10
|
-
value: '
|
|
11
|
+
label: 'Small',
|
|
12
|
+
value: 'tight',
|
|
13
|
+
displayValue: '9px',
|
|
14
|
+
showValue: true
|
|
11
15
|
},
|
|
12
16
|
{
|
|
13
|
-
label: '
|
|
14
|
-
value: '
|
|
17
|
+
label: 'Default',
|
|
18
|
+
value: 'none',
|
|
19
|
+
displayValue: '14px',
|
|
20
|
+
showValue: true
|
|
15
21
|
},
|
|
16
22
|
{
|
|
17
|
-
label: 'Medium
|
|
18
|
-
value: 'loose'
|
|
23
|
+
label: 'Medium',
|
|
24
|
+
value: 'loose',
|
|
25
|
+
displayValue: '21px',
|
|
26
|
+
showValue: true
|
|
19
27
|
},
|
|
20
28
|
{
|
|
21
|
-
label: 'Large
|
|
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
|
-
|
|
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
|
-
|
|
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/
|
|
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/
|
|
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/
|
|
8
|
-
var Row = require('../../../grid/
|
|
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
|
|
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';
|
package/dist/esm/builder.js
CHANGED
|
@@ -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/
|
|
149
|
-
import Row from './grid/
|
|
150
|
-
import Section from './grid/
|
|
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/
|
|
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
|
|
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
|
|
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 {
|
|
1
|
+
import { createStyle } from '@gem-sdk/system';
|
|
2
|
+
import { getResponsiveValue, getResponsiveValueByScreen, isColumnDirectionExist, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
3
|
|
|
3
|
-
const
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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',
|
|
37
|
+
...makeStyleResponsive('o', orderRender()),
|
|
28
38
|
...makeStyleResponsive('d', children ? styles?.display : displayByBreakpointIfChildrenEmpty)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
${children ?? ''}
|
|
34
|
-
</div>`;
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
colStyle
|
|
42
|
+
};
|
|
35
43
|
};
|
|
36
44
|
|
|
37
|
-
export {
|
|
45
|
+
export { getStyles };
|
package/dist/esm/grid/next.js
CHANGED
|
@@ -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('./
|
|
7
|
+
const Section = dynamic(()=>import('./section/Section.js'), {
|
|
8
8
|
loading: Loading
|
|
9
9
|
});
|
|
10
|
-
const Row = dynamic(()=>import('./
|
|
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('./
|
|
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 '
|
|
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 {
|
|
13
|
-
const
|
|
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 (!
|
|
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
|
-
|
|
30
|
-
|
|
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
|
-
|
|
55
|
-
|
|
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
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
...builderAttrs,
|
|
69
|
+
...rowAttr,
|
|
70
|
+
style: rowStyle,
|
|
71
|
+
className: className,
|
|
76
72
|
children: [
|
|
77
73
|
!!embed && /*#__PURE__*/ jsx("div", {
|
|
78
|
-
className:
|
|
79
|
-
style:
|
|
80
|
-
...radiusStyleInner
|
|
81
|
-
},
|
|
74
|
+
className: backgroundBoxClass,
|
|
75
|
+
style: backgroundBoxStyle,
|
|
82
76
|
children: /*#__PURE__*/ jsx("div", {
|
|
83
|
-
className:
|
|
77
|
+
className: backgroundBoxInnerClass,
|
|
84
78
|
children: embed
|
|
85
79
|
})
|
|
86
80
|
}),
|
|
87
|
-
|
|
88
|
-
|
|
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:
|
|
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
|
-
|
|
127
|
-
|
|
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
|
]
|