@gem-sdk/components 2.0.0-dev.254 → 2.0.0-dev.258
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/callout-banner/components/CalloutBox.js +1 -1
- package/dist/cjs/post-purchase/product/components/ProductOffer.js +3 -2
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/uiV2.js +5 -2
- package/dist/cjs/post-purchase/text/settings/text/uiV2.js +16 -2
- 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/callout-banner/components/CalloutBox.js +1 -1
- package/dist/esm/post-purchase/product/components/ProductOffer.js +3 -2
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/uiV2.js +5 -2
- package/dist/esm/post-purchase/text/settings/text/uiV2.js +16 -2
- 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 +23 -38
- 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
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
8
|
var React = require('react');
|
|
9
|
-
var
|
|
9
|
+
var system = require('@gem-sdk/system');
|
|
10
|
+
var Row = require('../../grid/row/Row.js');
|
|
10
11
|
var AdaptiveImage = require('../../image/components/AdaptiveImage.js');
|
|
11
12
|
var HTML5Embed = require('../../video/components/HTML5Embed.js');
|
|
12
|
-
var system = require('@gem-sdk/system');
|
|
13
13
|
var getStyle = require('./common/getStyle.js');
|
|
14
14
|
var getClasses = require('./common/getClasses.js');
|
|
15
15
|
var common = require('./common/common.js');
|
|
@@ -3,8 +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');
|
|
7
6
|
var system = require('@gem-sdk/system');
|
|
7
|
+
var Row_liquid = require('../../grid/row/Row.liquid.js');
|
|
8
8
|
var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
9
9
|
var HTML5Embed_liquid = require('../../video/components/HTML5Embed.liquid.js');
|
|
10
10
|
require('react');
|
package/dist/cjs/builder.js
CHANGED
|
@@ -149,9 +149,9 @@ var CollectionToolbar = require('./collection/components/CollectionToolbar.js');
|
|
|
149
149
|
var CollectionPaginator = require('./collection/components/CollectionPaginator.js');
|
|
150
150
|
require('./countdown-timer/setting/configs/settings.js');
|
|
151
151
|
var Countdown = require('./countdown-timer/components/Countdown.js');
|
|
152
|
-
var Col = require('./grid/
|
|
153
|
-
var Row = require('./grid/
|
|
154
|
-
var Section = require('./grid/
|
|
152
|
+
var Col = require('./grid/col/Col.js');
|
|
153
|
+
var Row = require('./grid/row/Row.js');
|
|
154
|
+
var Section = require('./grid/section/Section.js');
|
|
155
155
|
var Root = require('./grid/components/Root.js');
|
|
156
156
|
var Heading = require('./heading/Heading.js');
|
|
157
157
|
var Header = require('./header/components/Header.js');
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var Col = require('../../grid/
|
|
7
|
+
var Col = require('../../grid/col/Col.js');
|
|
8
8
|
require('react');
|
|
9
|
-
var core = require('@gem-sdk/core');
|
|
10
9
|
require('next/head');
|
|
11
10
|
var ChildrenDroppable = require('../../grid/components/ChildrenDroppable.js');
|
|
11
|
+
var core = require('@gem-sdk/core');
|
|
12
12
|
require('next/image');
|
|
13
13
|
require('@gem-sdk/system');
|
|
14
14
|
require('react-youtube');
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
8
|
require('react');
|
|
9
|
-
|
|
9
|
+
require('@gem-sdk/system');
|
|
10
|
+
var Row = require('../../grid/row/Row.js');
|
|
10
11
|
var Link = require('../../link/components/Link.js');
|
|
11
12
|
|
|
12
13
|
const composeAspect = (input)=>{
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var core = require('@gem-sdk/core');
|
|
7
|
-
|
|
7
|
+
require('@gem-sdk/system');
|
|
8
|
+
var Row_liquid = require('../../grid/row/Row.liquid.js');
|
|
8
9
|
|
|
9
10
|
const composeAspect = (input)=>{
|
|
10
11
|
if (!input || !input.width || !input.height || !input.src) return undefined;
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
6
|
var helpers = require('../../helpers.js');
|
|
7
|
+
require('@gem-sdk/system');
|
|
7
8
|
require('react/jsx-runtime');
|
|
8
9
|
require('react');
|
|
9
|
-
require('@gem-sdk/system');
|
|
10
10
|
require('../../product/components/ProductVariants/variants/index.js');
|
|
11
11
|
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
12
12
|
require('../../product/components/ProductBadge/constants.js');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var core = require('@gem-sdk/core');
|
|
8
|
+
var ChildrenDroppable = require('../components/ChildrenDroppable.js');
|
|
9
|
+
var getStyles = require('./common/getStyles.js');
|
|
10
|
+
var getClass = require('./common/getClass.js');
|
|
11
|
+
var getAttr = require('./common/getAttr.js');
|
|
12
|
+
|
|
13
|
+
const Column = (props)=>{
|
|
14
|
+
const { builderAttrs, children } = props;
|
|
15
|
+
const pageType = core.usePageType();
|
|
16
|
+
const isPostPurchase = pageType === 'POST_PURCHASE';
|
|
17
|
+
const { colStyle } = getStyles.getStyles(props, isPostPurchase);
|
|
18
|
+
const { colClass } = getClass.getClass(props);
|
|
19
|
+
const { colAttr } = getAttr.getAttr(props);
|
|
20
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
21
|
+
...builderAttrs,
|
|
22
|
+
...colAttr,
|
|
23
|
+
style: colStyle,
|
|
24
|
+
className: colClass,
|
|
25
|
+
children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.default = Column;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@gem-sdk/core');
|
|
6
|
+
var getStyles = require('./common/getStyles.js');
|
|
7
|
+
var getClass = require('./common/getClass.js');
|
|
8
|
+
var getAttr = require('./common/getAttr.js');
|
|
9
|
+
|
|
10
|
+
const Column = ({ children, className, style, builderAttrs, builderProps, advanced, setting, styles, justifyContent, order, ...props })=>{
|
|
11
|
+
const { colStyle } = getStyles.getStyles(props);
|
|
12
|
+
const { colClass } = getClass.getClass(props);
|
|
13
|
+
const { colAttr } = getAttr.getAttr(props);
|
|
14
|
+
return core.template`<div
|
|
15
|
+
${{
|
|
16
|
+
...colAttr
|
|
17
|
+
}}
|
|
18
|
+
style="${colStyle}"
|
|
19
|
+
class="${colClass}"
|
|
20
|
+
>
|
|
21
|
+
${children ?? ''}
|
|
22
|
+
</div>`;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.default = Column;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var system = require('@gem-sdk/system');
|
|
4
|
+
|
|
5
|
+
const getAttr = (props)=>{
|
|
6
|
+
const { setting } = props;
|
|
7
|
+
const colAttr = system.createAttr({
|
|
8
|
+
'data-same-height-display-contents': !!setting?.allowSameHeight
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
colAttr
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.getAttr = getAttr;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var system = require('@gem-sdk/system');
|
|
4
|
+
|
|
5
|
+
const getClass = (props)=>{
|
|
6
|
+
const { className, builderProps, styles, advanced } = props;
|
|
7
|
+
const colClass = system.createClass({
|
|
8
|
+
...className && {
|
|
9
|
+
[className]: true
|
|
10
|
+
},
|
|
11
|
+
...builderProps?.uid && {
|
|
12
|
+
[builderProps.uid]: true
|
|
13
|
+
},
|
|
14
|
+
...advanced?.cssClass && {
|
|
15
|
+
[advanced?.cssClass]: true
|
|
16
|
+
},
|
|
17
|
+
'gp-relative gp-flex gp-flex-col': true,
|
|
18
|
+
'gp-w-full': styles?.fullWidth
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
colClass
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.getClass = getClass;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var system = require('@gem-sdk/system');
|
|
5
4
|
var core = require('@gem-sdk/core');
|
|
6
5
|
|
|
7
|
-
const
|
|
6
|
+
const getStyles = (props, isPostPurchase)=>{
|
|
7
|
+
const { styles, justifyContent, order, layout, parentTag, children } = props;
|
|
8
8
|
const display = core.getResponsiveValue(layout, 'display');
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
10
|
const displayByBreakpointIfChildrenEmpty = {};
|
|
10
11
|
const DEVICES = [
|
|
11
12
|
'desktop',
|
|
@@ -19,23 +20,28 @@ const Column = ({ children, className, style, builderAttrs, builderProps, advanc
|
|
|
19
20
|
for (const device of DEVICES){
|
|
20
21
|
displayByBreakpointIfChildrenEmpty[device] = core.getResponsiveValueByScreen(display, device) === 'fit' || !!layout && core.isColumnDirectionExist(layout, device) || REMOVE_SPACING_COMPONENT_TAG.includes(parentTag || '') ? 'none' : styles?.display?.[device];
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const orderRender = ()=>{
|
|
24
|
+
const od = order ?? styles?.order;
|
|
25
|
+
if (isPostPurchase) {
|
|
26
|
+
return {
|
|
27
|
+
desktop: od?.desktop,
|
|
28
|
+
tablet: od?.desktop,
|
|
29
|
+
mobile: od?.desktop
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return od;
|
|
33
|
+
};
|
|
34
|
+
const colStyle = system.createStyle({
|
|
27
35
|
...core.makeStyleResponsive('cg', styles?.gap),
|
|
28
36
|
...core.makeStyleResponsive('rg', styles?.gap),
|
|
29
37
|
...core.makeStyleResponsive('ai', styles?.alignItem),
|
|
30
38
|
...core.makeStyleResponsive('jc', justifyContent ?? styles?.justifyContent),
|
|
31
|
-
...core.makeStyleResponsive('o',
|
|
39
|
+
...core.makeStyleResponsive('o', orderRender()),
|
|
32
40
|
...core.makeStyleResponsive('d', children ? styles?.display : displayByBreakpointIfChildrenEmpty)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
${children ?? ''}
|
|
38
|
-
</div>`;
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
colStyle
|
|
44
|
+
};
|
|
39
45
|
};
|
|
40
46
|
|
|
41
|
-
exports.
|
|
47
|
+
exports.getStyles = getStyles;
|
package/dist/cjs/grid/next.js
CHANGED
|
@@ -8,16 +8,16 @@ require('react/jsx-runtime');
|
|
|
8
8
|
require('react');
|
|
9
9
|
require('@gem-sdk/core');
|
|
10
10
|
|
|
11
|
-
const Section = dynamic(()=>Promise.resolve().then(function () { return require('./
|
|
11
|
+
const Section = dynamic(()=>Promise.resolve().then(function () { return require('./section/Section.js'); }), {
|
|
12
12
|
loading: Loading.default
|
|
13
13
|
});
|
|
14
|
-
const Row = dynamic(()=>Promise.resolve().then(function () { return require('./
|
|
14
|
+
const Row = dynamic(()=>Promise.resolve().then(function () { return require('./row/Row.js'); }), {
|
|
15
15
|
loading: Loading.default
|
|
16
16
|
});
|
|
17
17
|
const Root = dynamic(()=>Promise.resolve().then(function () { return require('./components/Root.js'); }), {
|
|
18
18
|
loading: Loading.default
|
|
19
19
|
});
|
|
20
|
-
const Col = dynamic(()=>Promise.resolve().then(function () { return require('./
|
|
20
|
+
const Col = dynamic(()=>Promise.resolve().then(function () { return require('./col/Col.js'); }), {
|
|
21
21
|
loading: Loading.default
|
|
22
22
|
});
|
|
23
23
|
var grid = {
|
|
@@ -4,22 +4,32 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var core = require('@gem-sdk/core');
|
|
8
7
|
var Head = require('next/head');
|
|
9
|
-
var ChildrenDroppable = require('
|
|
10
|
-
var useRowStyles = require('../hooks/useRowStyles.js');
|
|
8
|
+
var ChildrenDroppable = require('../components/ChildrenDroppable.js');
|
|
11
9
|
var HTML5Embed = require('../../video/components/HTML5Embed.js');
|
|
12
|
-
var common = require('../../video/helpers/common.js');
|
|
10
|
+
var common$1 = require('../../video/helpers/common.js');
|
|
13
11
|
var LiteYouTubeEmbed = require('../../video/components/LiteYouTubeEmbed.js');
|
|
12
|
+
var system = require('@gem-sdk/system');
|
|
13
|
+
var getAttr = require('./commons/getAttr.js');
|
|
14
|
+
var getStyle = require('./commons/getStyle.js');
|
|
15
|
+
var getClass = require('./commons/getClass.js');
|
|
16
|
+
var common = require('./commons/common.js');
|
|
17
|
+
var useRowSetting = require('./hooks/useRowSetting.js');
|
|
14
18
|
|
|
15
19
|
const Row = (props)=>{
|
|
16
|
-
const {
|
|
17
|
-
const
|
|
18
|
-
const { styles, setting, className, builderAttrs, builderProps, children } = props;
|
|
19
|
-
const { isSection, lazy, as: Element = 'div' } = setting ?? {};
|
|
20
|
+
const { styles, setting, children } = props;
|
|
21
|
+
const { isSection, as: Element = 'div' } = setting ?? {};
|
|
20
22
|
const { background } = styles ?? {};
|
|
23
|
+
const { builderAttrs, cacheHeightOutViewport, bgVideo, isRowEmpty, rowClassEditorOnly, isRenderPlaceholderViewBox, isPostPurchase, ref, postPurchaseVerticalAlign } = useRowSetting.useRowSettings(props);
|
|
24
|
+
const { rowStyle, backgroundBoxStyle, embedVideoStyle, sectionStyle } = getStyle.getRowStyle(props);
|
|
25
|
+
const { rowAttr, sectionAttr } = getAttr.getAttr(props);
|
|
26
|
+
const { rowClass, backgroundBoxClass, backgroundBoxInnerClass, sectionClass, wrapperYoutubeClasses, iframeYoutubeClasses } = getClass.getClass(props);
|
|
27
|
+
const className = system.createClass({
|
|
28
|
+
[rowClass]: true,
|
|
29
|
+
[rowClassEditorOnly]: true
|
|
30
|
+
});
|
|
21
31
|
const embed = React.useMemo(()=>{
|
|
22
|
-
if (!
|
|
32
|
+
if (!common.checkHasBackgroundVideo(background)) return;
|
|
23
33
|
if (bgVideo?.videoType === 'html5' && !bgVideo.videoHtml5) return null;
|
|
24
34
|
if (bgVideo?.videoType === 'youtube' && !bgVideo.video) return null;
|
|
25
35
|
if (bgVideo?.videoType === 'html5' && bgVideo.videoHtml5) {
|
|
@@ -30,18 +40,13 @@ const Row = (props)=>{
|
|
|
30
40
|
autoplay: true,
|
|
31
41
|
src: bgVideo.videoHtml5,
|
|
32
42
|
title: "Video",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
pointerEvents: 'none',
|
|
36
|
-
transform: 'translateY(-50%)',
|
|
37
|
-
top: '50%'
|
|
38
|
-
},
|
|
39
|
-
className: "gp-relative"
|
|
43
|
+
className: "gp-relative",
|
|
44
|
+
style: embedVideoStyle
|
|
40
45
|
});
|
|
41
46
|
}
|
|
42
47
|
const youtubeUrl = bgVideo?.video ?? '';
|
|
43
|
-
const videoId = common.getYoutubeVideoId(youtubeUrl);
|
|
44
|
-
if (!common.youtubeVideoRegex.test(youtubeUrl) || !videoId) return undefined;
|
|
48
|
+
const videoId = common$1.getYoutubeVideoId(youtubeUrl);
|
|
49
|
+
if (!common$1.youtubeVideoRegex.test(youtubeUrl) || !videoId) return undefined;
|
|
45
50
|
const params = `&loop=${bgVideo?.loop ? 1 : 0}&playlist=${videoId}&showinfo=0&rel=0&fs=0&enablejsapi=1`;
|
|
46
51
|
return /*#__PURE__*/ jsxRuntime.jsx(LiteYouTubeEmbed.default, {
|
|
47
52
|
id: videoId,
|
|
@@ -54,54 +59,43 @@ const Row = (props)=>{
|
|
|
54
59
|
noCookie: true,
|
|
55
60
|
muted: true,
|
|
56
61
|
lazy: false,
|
|
57
|
-
style:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
transform: 'translateY(-50%)',
|
|
61
|
-
top: '50%'
|
|
62
|
-
},
|
|
63
|
-
wrapperClass: "gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none",
|
|
64
|
-
iframeClass: "!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"
|
|
62
|
+
style: embedVideoStyle,
|
|
63
|
+
wrapperClass: wrapperYoutubeClasses,
|
|
64
|
+
iframeClass: iframeYoutubeClasses
|
|
65
65
|
});
|
|
66
66
|
}, [
|
|
67
67
|
bgVideo,
|
|
68
|
-
|
|
68
|
+
embedVideoStyle
|
|
69
69
|
]);
|
|
70
70
|
const element = /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
71
|
-
...builderAttrs,
|
|
72
|
-
...otherProps,
|
|
73
|
-
id: builderProps?.uid,
|
|
74
|
-
"data-id": builderProps?.uidInteraction ?? builderProps?.uid,
|
|
75
71
|
ref: ref,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
...builderAttrs,
|
|
73
|
+
...rowAttr,
|
|
74
|
+
style: rowStyle,
|
|
75
|
+
className: className,
|
|
80
76
|
children: [
|
|
81
77
|
!!embed && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
82
|
-
className:
|
|
83
|
-
style:
|
|
84
|
-
...radiusStyleInner
|
|
85
|
-
},
|
|
78
|
+
className: backgroundBoxClass,
|
|
79
|
+
style: backgroundBoxStyle,
|
|
86
80
|
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
87
|
-
className:
|
|
81
|
+
className: backgroundBoxInnerClass,
|
|
88
82
|
children: embed
|
|
89
83
|
})
|
|
90
84
|
}),
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
isRenderPlaceholderViewBox ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
86
|
+
style: {
|
|
87
|
+
height: `${cacheHeightOutViewport}px`
|
|
88
|
+
}
|
|
89
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
90
|
+
children: isRowEmpty ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : React.Children.map(children, (el)=>{
|
|
93
91
|
if (/*#__PURE__*/ React.isValidElement(el)) return /*#__PURE__*/ React.createElement(el.type, {
|
|
94
92
|
...el.props,
|
|
95
93
|
key: el.key,
|
|
96
94
|
order: setting?.order,
|
|
97
|
-
justifyContent:
|
|
95
|
+
justifyContent: isPostPurchase ? postPurchaseVerticalAlign : setting?.verticalAlign
|
|
98
96
|
});
|
|
99
97
|
return null;
|
|
100
98
|
})
|
|
101
|
-
}) : /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
102
|
-
style: {
|
|
103
|
-
height: `${cacheHeightOutViewport}px`
|
|
104
|
-
}
|
|
105
99
|
})
|
|
106
100
|
]
|
|
107
101
|
});
|
|
@@ -127,14 +121,9 @@ const Row = (props)=>{
|
|
|
127
121
|
]
|
|
128
122
|
}),
|
|
129
123
|
isSection ? /*#__PURE__*/ jsxRuntime.jsx(Element, {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
style:
|
|
133
|
-
...wrapStyle,
|
|
134
|
-
...core.makeStyleResponsive('w', sizeStyles.wrapper),
|
|
135
|
-
...core.makeStyleResponsive('pl', sizeStyles.padding),
|
|
136
|
-
...core.makeStyleResponsive('pr', sizeStyles.padding)
|
|
137
|
-
},
|
|
124
|
+
...sectionAttr,
|
|
125
|
+
className: sectionClass,
|
|
126
|
+
style: sectionStyle,
|
|
138
127
|
children: element
|
|
139
128
|
}) : element
|
|
140
129
|
]
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@gem-sdk/core');
|
|
6
|
+
var helpers = require('../../helpers.js');
|
|
7
|
+
var common$2 = require('../../banner/components/common/common.js');
|
|
8
|
+
var HTML5Embed_liquid = require('../../video/components/HTML5Embed.liquid.js');
|
|
9
|
+
var getStyle = require('./commons/getStyle.js');
|
|
10
|
+
var getClass = require('./commons/getClass.js');
|
|
11
|
+
var getAttr = require('./commons/getAttr.js');
|
|
12
|
+
var system = require('@gem-sdk/system');
|
|
13
|
+
var getData = require('./commons/getData.js');
|
|
14
|
+
var common = require('./commons/common.js');
|
|
15
|
+
var common$1 = require('../../video/helpers/common.js');
|
|
16
|
+
var LiteYouTubeEmbed_liquid = require('../../video/components/LiteYouTubeEmbed.liquid.js');
|
|
17
|
+
|
|
18
|
+
const Row = (props)=>{
|
|
19
|
+
const { styles, setting, rawChildren, builderProps } = props;
|
|
20
|
+
const { isSection } = setting ?? {};
|
|
21
|
+
const { background } = styles ?? {};
|
|
22
|
+
const elementTag = isSection ? 'section' : 'div';
|
|
23
|
+
const { stateData } = getData.getData(props);
|
|
24
|
+
const { rowStyle, backgroundBoxStyle, embedVideoStyle, sectionStyle } = getStyle.getRowStyle(props);
|
|
25
|
+
const { rowAttr, sectionAttr } = getAttr.getAttr(props);
|
|
26
|
+
const { rowClass, backgroundBoxClass, backgroundBoxInnerClass, sectionClass, wrapperYoutubeClasses, iframeYoutubeClasses } = getClass.getClass(props);
|
|
27
|
+
const className = system.createClass({
|
|
28
|
+
[rowClass]: true
|
|
29
|
+
});
|
|
30
|
+
const embed = ()=>{
|
|
31
|
+
if (!common.checkHasBackgroundVideo(background)) return;
|
|
32
|
+
const backgroundResponsive = common$2.getResponsiveSetting(background || {});
|
|
33
|
+
if (common.isRenderHtmlVideo(background)) {
|
|
34
|
+
return HTML5Embed_liquid.default({
|
|
35
|
+
uid: builderProps?.uid,
|
|
36
|
+
muted: true,
|
|
37
|
+
loop: backgroundResponsive.desktop?.loop,
|
|
38
|
+
controls: false,
|
|
39
|
+
autoplay: true,
|
|
40
|
+
src: '',
|
|
41
|
+
title: 'Video',
|
|
42
|
+
className: 'gp-relative',
|
|
43
|
+
style: embedVideoStyle
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (common.isRenderYoutubeVideo(background)) {
|
|
47
|
+
const youtubeUrl = backgroundResponsive?.desktop?.video ?? '';
|
|
48
|
+
const videoId = common$1.getYoutubeVideoId(youtubeUrl) || '';
|
|
49
|
+
const isLoop = false;
|
|
50
|
+
const params = `&loop=${isLoop}&playlist=${videoId}&showinfo=0&rel=0&fs=0&enablejsapi=1`;
|
|
51
|
+
return LiteYouTubeEmbed_liquid.default({
|
|
52
|
+
uid: builderProps?.uid,
|
|
53
|
+
id: videoId,
|
|
54
|
+
isHeroBanner: true,
|
|
55
|
+
autoplay: true,
|
|
56
|
+
title: 'Video',
|
|
57
|
+
controls: false,
|
|
58
|
+
params: params,
|
|
59
|
+
adNetwork: false,
|
|
60
|
+
noCookie: true,
|
|
61
|
+
muted: true,
|
|
62
|
+
lazy: backgroundResponsive?.desktop?.lazyLoad ?? true,
|
|
63
|
+
preload: true,
|
|
64
|
+
style: embedVideoStyle,
|
|
65
|
+
wrapperClass: wrapperYoutubeClasses,
|
|
66
|
+
iframeClass: iframeYoutubeClasses
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const renderComponentScript = ()=>{
|
|
71
|
+
if (!common.checkHasBackgroundVideo(background)) return;
|
|
72
|
+
return core.template`
|
|
73
|
+
${core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-row.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-row.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
74
|
+
`;
|
|
75
|
+
};
|
|
76
|
+
const element = core.template`
|
|
77
|
+
<gp-row gp-data='${stateData}' ${{
|
|
78
|
+
...rowAttr
|
|
79
|
+
}} class="${className}" style="${rowStyle}">
|
|
80
|
+
${system.If(!!embed(), core.template /* liquid */ `
|
|
81
|
+
<div class="${backgroundBoxClass}" style="${backgroundBoxStyle}">
|
|
82
|
+
<div class="${backgroundBoxInnerClass}">${embed()}</div>
|
|
83
|
+
</div>
|
|
84
|
+
`)}
|
|
85
|
+
|
|
86
|
+
${core.WrapRenderChildren({
|
|
87
|
+
uid: builderProps?.uid || '',
|
|
88
|
+
customProps: rawChildren?.[0].customProps
|
|
89
|
+
}, rawChildren?.map((child)=>{
|
|
90
|
+
if (child) {
|
|
91
|
+
return core.RenderChildren({
|
|
92
|
+
...child,
|
|
93
|
+
order: setting?.order,
|
|
94
|
+
layout: setting?.layout,
|
|
95
|
+
justifyContent: setting?.verticalAlign
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}))}
|
|
99
|
+
|
|
100
|
+
${renderComponentScript()}
|
|
101
|
+
</gp-row>
|
|
102
|
+
`;
|
|
103
|
+
return core.template`
|
|
104
|
+
${core.RenderIf(!!styles?.preloadBgImage, `${core.RenderIf(!!background?.desktop?.image?.src, `<link rel="preload" href="${background?.desktop?.image?.src}" as="image" />`)}${core.RenderIf(!!background?.tablet?.image?.src, `<link rel="preload" href="${background?.tablet?.image?.src}" as="image" />`)}${core.RenderIf(!!background?.mobile?.image?.src, `<link rel="preload" href="${background?.mobile?.image?.src}" as="image" />`)}`)}
|
|
105
|
+
|
|
106
|
+
${core.RenderIf(!!isSection, `{% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}`)}
|
|
107
|
+
|
|
108
|
+
${system.If(isSection, core.template /* liquid */ `
|
|
109
|
+
<${elementTag}
|
|
110
|
+
${{
|
|
111
|
+
...sectionAttr
|
|
112
|
+
}}
|
|
113
|
+
class="${sectionClass} ${isSection ? helpers.getSettingPreloadData('gps-lazy') : ''}"
|
|
114
|
+
style="${sectionStyle}"
|
|
115
|
+
>
|
|
116
|
+
${element}
|
|
117
|
+
</${elementTag}>
|
|
118
|
+
`, core.template /* liquid */ `${element}`)}
|
|
119
|
+
`;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
exports.default = Row;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var arrow = require('../../../carousel/components/common/arrow.js');
|
|
5
|
+
|
|
6
|
+
const checkHasBackgroundVideo = (background)=>{
|
|
7
|
+
const DEVICES = [
|
|
8
|
+
'desktop',
|
|
9
|
+
'tablet',
|
|
10
|
+
'mobile'
|
|
11
|
+
];
|
|
12
|
+
return DEVICES.some((item)=>{
|
|
13
|
+
const bg = core.getValueByDevice(background, item);
|
|
14
|
+
if (bg) return bg.videoType === 'html5' && bg.videoHtml5 || bg.videoType === 'youtube' && bg.video;
|
|
15
|
+
return false;
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const isRenderHtmlVideo = (background)=>{
|
|
19
|
+
const backgroundResponsive = arrow.getResponsiveSetting(background || {});
|
|
20
|
+
const videoType = backgroundResponsive.desktop?.videoType;
|
|
21
|
+
const videoTypeTablet = backgroundResponsive.tablet?.videoType;
|
|
22
|
+
const videoTypeMobile = backgroundResponsive.mobile?.videoType;
|
|
23
|
+
return videoType == 'html5' || videoTypeTablet == 'html5' || videoTypeMobile == 'html5';
|
|
24
|
+
};
|
|
25
|
+
const isRenderYoutubeVideo = (background)=>{
|
|
26
|
+
const backgroundResponsive = arrow.getResponsiveSetting(background || {});
|
|
27
|
+
const videoType = backgroundResponsive.desktop?.videoType;
|
|
28
|
+
const videoTypeTablet = backgroundResponsive.tablet?.videoType;
|
|
29
|
+
const videoTypeMobile = backgroundResponsive.mobile?.videoType;
|
|
30
|
+
return videoType == 'youtube' || videoTypeTablet == 'youtube' || videoTypeMobile == 'youtube';
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.checkHasBackgroundVideo = checkHasBackgroundVideo;
|
|
34
|
+
exports.isRenderHtmlVideo = isRenderHtmlVideo;
|
|
35
|
+
exports.isRenderYoutubeVideo = isRenderYoutubeVideo;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var system = require('@gem-sdk/system');
|
|
4
|
+
|
|
5
|
+
const getAttr = (props)=>{
|
|
6
|
+
const { builderProps, setting } = props;
|
|
7
|
+
const rowAttr = system.createAttr({
|
|
8
|
+
'data-id': builderProps?.uidInteraction ?? builderProps?.uid ?? '',
|
|
9
|
+
id: builderProps?.uid ?? ''
|
|
10
|
+
});
|
|
11
|
+
const sectionAttr = system.createAttr({
|
|
12
|
+
'data-same-height-display-contents': !!setting?.allowSameHeight
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
rowAttr,
|
|
16
|
+
sectionAttr
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.getAttr = getAttr;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var system = require('@gem-sdk/system');
|
|
4
|
+
|
|
5
|
+
const getClass = (props)=>{
|
|
6
|
+
const { builderProps, advanced, className } = props;
|
|
7
|
+
const backgroundBoxClass = system.createClass({
|
|
8
|
+
'gp-background-video gp-absolute gp-overflow-hidden gp-w-full gp-h-full left-0 top-0': true
|
|
9
|
+
});
|
|
10
|
+
const backgroundBoxInnerClass = system.createClass({
|
|
11
|
+
'gp-bg-video gp-relative gp-h-full': true
|
|
12
|
+
});
|
|
13
|
+
const rowClass = system.createClass({
|
|
14
|
+
...className && {
|
|
15
|
+
[className]: true
|
|
16
|
+
},
|
|
17
|
+
...builderProps?.uid && {
|
|
18
|
+
[builderProps.uid]: true
|
|
19
|
+
},
|
|
20
|
+
'gp-relative gp-mx-auto gp-mb-0 gp-grid gp-max-w-full gp-transition-colors gp-duration-200 gp-ease-in-out [&_*]:gp-max-w-full': true,
|
|
21
|
+
...advanced?.cssClass && {
|
|
22
|
+
[advanced?.cssClass]: true
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const sectionClass = system.createClass({
|
|
26
|
+
'gp-mx-auto gp-max-w-full [&_*]:gp-max-w-full': true
|
|
27
|
+
});
|
|
28
|
+
const wrapperYoutubeClasses = system.createClass({
|
|
29
|
+
'gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none': true
|
|
30
|
+
});
|
|
31
|
+
const iframeYoutubeClasses = system.createClass({
|
|
32
|
+
'!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]': true
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
rowClass,
|
|
36
|
+
backgroundBoxClass,
|
|
37
|
+
backgroundBoxInnerClass,
|
|
38
|
+
sectionClass,
|
|
39
|
+
wrapperYoutubeClasses,
|
|
40
|
+
iframeYoutubeClasses
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.getClass = getClass;
|