@gem-sdk/components 2.0.0-dev.380 → 2.0.0-dev.382
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/article/components/ArticleTitle.js +4 -3
- package/dist/cjs/article/components/ArticleTitle.liquid.js +7 -8
- package/dist/cjs/article/setting/ArticleList.js +2 -2
- package/dist/cjs/article/setting/configs/ArticleImage/presets.js +1 -1
- package/dist/cjs/grid/row/commons/getStyle.js +7 -1
- package/dist/cjs/grid/section/setting/Section.js +2 -6
- package/dist/esm/article/components/ArticleTitle.js +4 -3
- package/dist/esm/article/components/ArticleTitle.liquid.js +7 -8
- package/dist/esm/article/setting/ArticleList.js +2 -2
- package/dist/esm/article/setting/configs/ArticleImage/presets.js +1 -1
- package/dist/esm/grid/row/commons/getStyle.js +7 -1
- package/dist/esm/grid/section/setting/Section.js +2 -6
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ var Link = require('next/link');
|
|
|
8
8
|
var Text = require('../../text/components/Text.js');
|
|
9
9
|
var core = require('@gem-sdk/core');
|
|
10
10
|
var useArticleLink = require('../hooks/useArticleLink.js');
|
|
11
|
+
var system = require('@gem-sdk/system');
|
|
11
12
|
|
|
12
13
|
const ArticleTitle = ({ setting, builderProps, styles })=>{
|
|
13
14
|
const article = core.useArticleStore((s)=>s.article);
|
|
@@ -16,7 +17,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
|
|
|
16
17
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
17
18
|
id: `shopify-text-element-${builderProps?.uid}`,
|
|
18
19
|
"data-article-id": article?.baseID?.replace('gid://shopify/OnlineStoreArticle/', ''),
|
|
19
|
-
children: !article ? null : setting?.enableLink
|
|
20
|
+
children: system.If(!article ? null : setting?.enableLink, /*#__PURE__*/ jsxRuntime.jsx(Link, {
|
|
20
21
|
href: shopifyArticleLink,
|
|
21
22
|
target: target,
|
|
22
23
|
title: article?.title,
|
|
@@ -29,7 +30,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
|
|
|
29
30
|
excludeFlex: true
|
|
30
31
|
}
|
|
31
32
|
})
|
|
32
|
-
})
|
|
33
|
+
}), /*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
33
34
|
builderProps: builderProps,
|
|
34
35
|
styles: styles,
|
|
35
36
|
setting: {
|
|
@@ -37,7 +38,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
|
|
|
37
38
|
text: article.title,
|
|
38
39
|
excludeFlex: true
|
|
39
40
|
}
|
|
40
|
-
})
|
|
41
|
+
}))
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
44
|
|
|
@@ -6,15 +6,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var core = require('@gem-sdk/core');
|
|
7
7
|
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
8
8
|
var helpers = require('../../helpers.js');
|
|
9
|
+
var system = require('@gem-sdk/system');
|
|
9
10
|
|
|
10
11
|
const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
|
|
11
12
|
const target = setting?.openNewTab ? '_blank' : '_self';
|
|
12
13
|
return core.template`
|
|
13
|
-
${setting?.enableLink
|
|
14
|
-
|
|
14
|
+
${system.If(setting?.enableLink, core.template`
|
|
15
|
+
<a href="${helpers.getLinkArticle(setting?.linkArticle, setting?.customURL)}" target="${{
|
|
15
16
|
target
|
|
16
17
|
}}" title="{{article.title}}">
|
|
17
|
-
|
|
18
|
+
${Text_liquid.default({
|
|
18
19
|
styles: styles,
|
|
19
20
|
setting: {
|
|
20
21
|
...setting,
|
|
@@ -26,9 +27,8 @@ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
|
|
|
26
27
|
'data-id': builderProps?.uid
|
|
27
28
|
}
|
|
28
29
|
})}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
${Text_liquid.default({
|
|
30
|
+
</a>
|
|
31
|
+
`, core.template`${Text_liquid.default({
|
|
32
32
|
styles: styles,
|
|
33
33
|
setting: {
|
|
34
34
|
...setting,
|
|
@@ -39,8 +39,7 @@ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
|
|
|
39
39
|
builderAttrs: {
|
|
40
40
|
'data-id': builderProps?.uid
|
|
41
41
|
}
|
|
42
|
-
})}
|
|
43
|
-
`}
|
|
42
|
+
})}`)}
|
|
44
43
|
`;
|
|
45
44
|
};
|
|
46
45
|
|
|
@@ -510,7 +510,7 @@ const config = {
|
|
|
510
510
|
tag: 'ArticleImage',
|
|
511
511
|
label: 'Article Image',
|
|
512
512
|
settings: {
|
|
513
|
-
linkArticle:
|
|
513
|
+
linkArticle: 'go-to-article'
|
|
514
514
|
},
|
|
515
515
|
styles: {
|
|
516
516
|
position: {
|
|
@@ -774,7 +774,7 @@ const config = {
|
|
|
774
774
|
tag: 'ArticleTitle',
|
|
775
775
|
settings: {
|
|
776
776
|
htmlTag: 'h1',
|
|
777
|
-
linkArticle:
|
|
777
|
+
linkArticle: 'go-to-article'
|
|
778
778
|
},
|
|
779
779
|
styles: {
|
|
780
780
|
typo: {
|
|
@@ -11,6 +11,11 @@ const getRowStyle = (rowProps)=>{
|
|
|
11
11
|
const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
|
|
12
12
|
const { width, columnGap, fullWidth, background, verticalGutter, verticalGutterMobile } = styles ?? {};
|
|
13
13
|
const innerRadius = getInnerRadius.getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
|
|
14
|
+
const overFlowStyle = core.makeStyleResponsive('of', {
|
|
15
|
+
desktop: innerRadius.desktop ? 'hidden' : undefined,
|
|
16
|
+
tablet: innerRadius.tablet ? 'hidden' : undefined,
|
|
17
|
+
mobile: innerRadius.mobile ? 'hidden' : undefined
|
|
18
|
+
});
|
|
14
19
|
const childHasChildren = builderProps?.builderData?.childrens?.length;
|
|
15
20
|
const bgVideoAspectRatioStyle = {
|
|
16
21
|
...core.makeStyleResponsive('aspect', {
|
|
@@ -33,7 +38,8 @@ const getRowStyle = (rowProps)=>{
|
|
|
33
38
|
...core.makeStyleResponsive('cg', verticalGutter),
|
|
34
39
|
...core.makeStyleResponsive('rg', verticalGutterMobile),
|
|
35
40
|
...layout ? core.composeGridLayout(layout) : core.makeStyleResponsive('gtc', responsive),
|
|
36
|
-
...core.makeStyleResponsive('w', sizeStyles.content)
|
|
41
|
+
...core.makeStyleResponsive('w', sizeStyles.content),
|
|
42
|
+
...overFlowStyle
|
|
37
43
|
};
|
|
38
44
|
};
|
|
39
45
|
const getPostPurchaseStyle = ()=>{
|
|
@@ -46,9 +46,7 @@ const config = {
|
|
|
46
46
|
tablet: {
|
|
47
47
|
padding: {
|
|
48
48
|
top: 'var(--g-s-2xl)',
|
|
49
|
-
bottom: 'var(--g-s-2xl)'
|
|
50
|
-
left: 'var(--g-s-l)',
|
|
51
|
-
right: 'var(--g-s-l)'
|
|
49
|
+
bottom: 'var(--g-s-2xl)'
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
}
|
|
@@ -73,9 +71,7 @@ const config = {
|
|
|
73
71
|
mobile: {
|
|
74
72
|
padding: {
|
|
75
73
|
top: '20px',
|
|
76
|
-
bottom: '20px'
|
|
77
|
-
left: 'var(--g-s-l)',
|
|
78
|
-
right: 'var(--g-s-l)'
|
|
74
|
+
bottom: '20px'
|
|
79
75
|
}
|
|
80
76
|
}
|
|
81
77
|
}
|
|
@@ -4,6 +4,7 @@ import Link from 'next/link';
|
|
|
4
4
|
import Text from '../../text/components/Text.js';
|
|
5
5
|
import { useArticleStore } from '@gem-sdk/core';
|
|
6
6
|
import { useArticleLink } from '../hooks/useArticleLink.js';
|
|
7
|
+
import { If } from '@gem-sdk/system';
|
|
7
8
|
|
|
8
9
|
const ArticleTitle = ({ setting, builderProps, styles })=>{
|
|
9
10
|
const article = useArticleStore((s)=>s.article);
|
|
@@ -12,7 +13,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
|
|
|
12
13
|
return /*#__PURE__*/ jsx("div", {
|
|
13
14
|
id: `shopify-text-element-${builderProps?.uid}`,
|
|
14
15
|
"data-article-id": article?.baseID?.replace('gid://shopify/OnlineStoreArticle/', ''),
|
|
15
|
-
children: !article ? null : setting?.enableLink
|
|
16
|
+
children: If(!article ? null : setting?.enableLink, /*#__PURE__*/ jsx(Link, {
|
|
16
17
|
href: shopifyArticleLink,
|
|
17
18
|
target: target,
|
|
18
19
|
title: article?.title,
|
|
@@ -25,7 +26,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
|
|
|
25
26
|
excludeFlex: true
|
|
26
27
|
}
|
|
27
28
|
})
|
|
28
|
-
})
|
|
29
|
+
}), /*#__PURE__*/ jsx(Text, {
|
|
29
30
|
builderProps: builderProps,
|
|
30
31
|
styles: styles,
|
|
31
32
|
setting: {
|
|
@@ -33,7 +34,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
|
|
|
33
34
|
text: article.title,
|
|
34
35
|
excludeFlex: true
|
|
35
36
|
}
|
|
36
|
-
})
|
|
37
|
+
}))
|
|
37
38
|
});
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
import { template } from '@gem-sdk/core';
|
|
3
3
|
import Text from '../../text/components/Text.liquid.js';
|
|
4
4
|
import { getLinkArticle } from '../../helpers.js';
|
|
5
|
+
import { If } from '@gem-sdk/system';
|
|
5
6
|
|
|
6
7
|
const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
|
|
7
8
|
const target = setting?.openNewTab ? '_blank' : '_self';
|
|
8
9
|
return template`
|
|
9
|
-
${setting?.enableLink
|
|
10
|
-
|
|
10
|
+
${If(setting?.enableLink, template`
|
|
11
|
+
<a href="${getLinkArticle(setting?.linkArticle, setting?.customURL)}" target="${{
|
|
11
12
|
target
|
|
12
13
|
}}" title="{{article.title}}">
|
|
13
|
-
|
|
14
|
+
${Text({
|
|
14
15
|
styles: styles,
|
|
15
16
|
setting: {
|
|
16
17
|
...setting,
|
|
@@ -22,9 +23,8 @@ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
|
|
|
22
23
|
'data-id': builderProps?.uid
|
|
23
24
|
}
|
|
24
25
|
})}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
${Text({
|
|
26
|
+
</a>
|
|
27
|
+
`, template`${Text({
|
|
28
28
|
styles: styles,
|
|
29
29
|
setting: {
|
|
30
30
|
...setting,
|
|
@@ -35,8 +35,7 @@ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
|
|
|
35
35
|
builderAttrs: {
|
|
36
36
|
'data-id': builderProps?.uid
|
|
37
37
|
}
|
|
38
|
-
})}
|
|
39
|
-
`}
|
|
38
|
+
})}`)}
|
|
40
39
|
`;
|
|
41
40
|
};
|
|
42
41
|
|
|
@@ -506,7 +506,7 @@ const config = {
|
|
|
506
506
|
tag: 'ArticleImage',
|
|
507
507
|
label: 'Article Image',
|
|
508
508
|
settings: {
|
|
509
|
-
linkArticle:
|
|
509
|
+
linkArticle: 'go-to-article'
|
|
510
510
|
},
|
|
511
511
|
styles: {
|
|
512
512
|
position: {
|
|
@@ -770,7 +770,7 @@ const config = {
|
|
|
770
770
|
tag: 'ArticleTitle',
|
|
771
771
|
settings: {
|
|
772
772
|
htmlTag: 'h1',
|
|
773
|
-
linkArticle:
|
|
773
|
+
linkArticle: 'go-to-article'
|
|
774
774
|
},
|
|
775
775
|
styles: {
|
|
776
776
|
typo: {
|
|
@@ -9,6 +9,11 @@ const getRowStyle = (rowProps)=>{
|
|
|
9
9
|
const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
|
|
10
10
|
const { width, columnGap, fullWidth, background, verticalGutter, verticalGutterMobile } = styles ?? {};
|
|
11
11
|
const innerRadius = getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
|
|
12
|
+
const overFlowStyle = makeStyleResponsive('of', {
|
|
13
|
+
desktop: innerRadius.desktop ? 'hidden' : undefined,
|
|
14
|
+
tablet: innerRadius.tablet ? 'hidden' : undefined,
|
|
15
|
+
mobile: innerRadius.mobile ? 'hidden' : undefined
|
|
16
|
+
});
|
|
12
17
|
const childHasChildren = builderProps?.builderData?.childrens?.length;
|
|
13
18
|
const bgVideoAspectRatioStyle = {
|
|
14
19
|
...makeStyleResponsive('aspect', {
|
|
@@ -31,7 +36,8 @@ const getRowStyle = (rowProps)=>{
|
|
|
31
36
|
...makeStyleResponsive('cg', verticalGutter),
|
|
32
37
|
...makeStyleResponsive('rg', verticalGutterMobile),
|
|
33
38
|
...layout ? composeGridLayout(layout) : makeStyleResponsive('gtc', responsive),
|
|
34
|
-
...makeStyleResponsive('w', sizeStyles.content)
|
|
39
|
+
...makeStyleResponsive('w', sizeStyles.content),
|
|
40
|
+
...overFlowStyle
|
|
35
41
|
};
|
|
36
42
|
};
|
|
37
43
|
const getPostPurchaseStyle = ()=>{
|
|
@@ -42,9 +42,7 @@ const config = {
|
|
|
42
42
|
tablet: {
|
|
43
43
|
padding: {
|
|
44
44
|
top: 'var(--g-s-2xl)',
|
|
45
|
-
bottom: 'var(--g-s-2xl)'
|
|
46
|
-
left: 'var(--g-s-l)',
|
|
47
|
-
right: 'var(--g-s-l)'
|
|
45
|
+
bottom: 'var(--g-s-2xl)'
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
}
|
|
@@ -69,9 +67,7 @@ const config = {
|
|
|
69
67
|
mobile: {
|
|
70
68
|
padding: {
|
|
71
69
|
top: '20px',
|
|
72
|
-
bottom: '20px'
|
|
73
|
-
left: 'var(--g-s-l)',
|
|
74
|
-
right: 'var(--g-s-l)'
|
|
70
|
+
bottom: '20px'
|
|
75
71
|
}
|
|
76
72
|
}
|
|
77
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.382",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@gem-sdk/core": "2.0.0-dev.380",
|
|
26
|
-
"@gem-sdk/styles": "2.0.0-dev.
|
|
26
|
+
"@gem-sdk/styles": "2.0.0-dev.381",
|
|
27
27
|
"@gem-sdk/system": "2.0.0-dev.371",
|
|
28
28
|
"@types/react-transition-group": "^4.4.5"
|
|
29
29
|
},
|