@gem-sdk/components 2.1.27-staging.2 → 2.1.27-staging.21
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/ArticleList.js +1 -1
- package/dist/cjs/builder.js +3 -1
- package/dist/cjs/button/components/Button.liquid.js +3 -3
- package/dist/cjs/collection/components/CollectionPaginator.liquid.js +1 -1
- package/dist/cjs/collection/setting/CollectionPaginator.js +5 -0
- package/dist/cjs/helpers.js +26 -4
- package/dist/cjs/image/components/AdaptiveImage.js +4 -3
- package/dist/cjs/image/components/Image.js +2 -21
- package/dist/cjs/image/helpers/getSrcSet.js +2 -1
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.liquid.js +2 -0
- package/dist/cjs/intersection-observer/useInView.js +2 -0
- package/dist/cjs/post-purchase/product/components/variants/Dropdown.js +1 -1
- package/dist/cjs/product/components/ProductButton.js +1 -1
- package/dist/cjs/product/components/ProductButton.liquid.js +21 -3
- package/dist/cjs/product/components/ProductList.liquid.js +4 -8
- package/dist/cjs/product/components/ProductTag.js +9 -1
- package/dist/cjs/text/components/Text.js +2 -1
- package/dist/cjs/text/components/Text.liquid.js +2 -2
- package/dist/cjs/text/components/common.js +14 -0
- package/dist/cjs/third-party/components/Bogos/BogosSampleContent.js +9 -10
- package/dist/cjs/third-party/components/EcoboostifyShoppableReelUgc.js +32 -0
- package/dist/cjs/third-party/components/EcoboostifyShoppableReelUgc.liquid.js +12 -0
- package/dist/cjs/third-party/components/RechargeSubscriptions.liquid.js +1 -1
- package/dist/cjs/third-party/components/Releasit.liquid.js +4 -2
- package/dist/cjs/third-party/configs/BoldProductOptions.js +2 -2
- package/dist/cjs/third-party/configs/EcoboostifyShoppableReelUgc.js +12 -0
- package/dist/cjs/third-party/next.js +5 -0
- package/dist/cjs/third-party/setting/EcoboostifyShoppableReelUgc.js +142 -0
- package/dist/cjs/third-party/setting/RechargeSubscriptions.js +5 -2
- package/dist/cjs/third-party/setting/Releasit.js +59 -2
- package/dist/cjs/third-party/setting/index.js +3 -1
- package/dist/esm/article/components/ArticleList.js +1 -1
- package/dist/esm/builder.js +3 -1
- package/dist/esm/button/components/Button.liquid.js +3 -3
- package/dist/esm/collection/components/CollectionPaginator.liquid.js +1 -1
- package/dist/esm/collection/setting/CollectionPaginator.js +5 -0
- package/dist/esm/helpers.js +25 -5
- package/dist/esm/image/components/AdaptiveImage.js +4 -3
- package/dist/esm/image/components/Image.js +2 -21
- package/dist/esm/image/helpers/getSrcSet.js +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.liquid.js +1 -0
- package/dist/esm/intersection-observer/useInView.js +2 -0
- package/dist/esm/post-purchase/product/components/variants/Dropdown.js +1 -1
- package/dist/esm/product/components/ProductButton.js +1 -1
- package/dist/esm/product/components/ProductButton.liquid.js +21 -3
- package/dist/esm/product/components/ProductList.liquid.js +4 -8
- package/dist/esm/product/components/ProductTag.js +10 -2
- package/dist/esm/text/components/Text.js +2 -1
- package/dist/esm/text/components/Text.liquid.js +2 -2
- package/dist/esm/text/components/common.js +12 -0
- package/dist/esm/third-party/components/Bogos/BogosSampleContent.js +10 -11
- package/dist/esm/third-party/components/EcoboostifyShoppableReelUgc.js +28 -0
- package/dist/esm/third-party/components/EcoboostifyShoppableReelUgc.liquid.js +8 -0
- package/dist/esm/third-party/components/RechargeSubscriptions.liquid.js +1 -1
- package/dist/esm/third-party/components/Releasit.liquid.js +4 -2
- package/dist/esm/third-party/configs/BoldProductOptions.js +2 -2
- package/dist/esm/third-party/configs/EcoboostifyShoppableReelUgc.js +8 -0
- package/dist/esm/third-party/next.js +5 -0
- package/dist/esm/third-party/setting/EcoboostifyShoppableReelUgc.js +138 -0
- package/dist/esm/third-party/setting/RechargeSubscriptions.js +5 -2
- package/dist/esm/third-party/setting/Releasit.js +59 -2
- package/dist/esm/third-party/setting/index.js +3 -1
- package/dist/types/index.d.ts +32 -3
- package/package.json +3 -3
- package/dist/cjs/image/components/NoDataImage.js +0 -133
- package/dist/esm/image/components/NoDataImage.js +0 -129
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var EcoboostifyShoppableReelUgc = require('../configs/EcoboostifyShoppableReelUgc.js');
|
|
6
|
+
|
|
7
|
+
const config = {
|
|
8
|
+
tag: EcoboostifyShoppableReelUgc.default.tag,
|
|
9
|
+
label: EcoboostifyShoppableReelUgc.default.label,
|
|
10
|
+
icon: '<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="https://cdn.shopify.com/app-store/listing_images/cdbdfc53291cf8d2908e72deae77f94e/icon/CJWKq4vxxIkDEAE=.png">',
|
|
11
|
+
editorConfigs: {
|
|
12
|
+
component: {
|
|
13
|
+
isThirdParty: true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
presets: [
|
|
17
|
+
{
|
|
18
|
+
id: EcoboostifyShoppableReelUgc.default.id,
|
|
19
|
+
name: {
|
|
20
|
+
en: EcoboostifyShoppableReelUgc.default.label
|
|
21
|
+
},
|
|
22
|
+
hideTextContent: true,
|
|
23
|
+
icon: {
|
|
24
|
+
desktop: `<div class="w-full flex flex-col items-center">
|
|
25
|
+
<img class="w-24 border border-dark-200 rounded-medium" src="https://cdn.shopify.com/app-store/listing_images/cdbdfc53291cf8d2908e72deae77f94e/icon/CJWKq4vxxIkDEAE=.png">
|
|
26
|
+
<span class="preset-item-title">EcoBoostify Shoppable Reel UGC</span>
|
|
27
|
+
</div>`
|
|
28
|
+
},
|
|
29
|
+
components: [
|
|
30
|
+
{
|
|
31
|
+
tag: EcoboostifyShoppableReelUgc.default.tag
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
settings: [
|
|
37
|
+
{
|
|
38
|
+
id: 'setting',
|
|
39
|
+
controls: [
|
|
40
|
+
{
|
|
41
|
+
id: 'appBlockId',
|
|
42
|
+
type: 'input',
|
|
43
|
+
default: ''
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'widgetType',
|
|
47
|
+
label: 'Choose widget',
|
|
48
|
+
type: 'select',
|
|
49
|
+
options: [
|
|
50
|
+
{
|
|
51
|
+
label: 'Reel Playlist',
|
|
52
|
+
value: 'reel-playlist'
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
default: 'reel-playlist'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'playlistId',
|
|
59
|
+
label: 'Playlist ID',
|
|
60
|
+
type: 'input'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'install',
|
|
64
|
+
type: 'open-link',
|
|
65
|
+
target: '_blank',
|
|
66
|
+
linkType: 'install',
|
|
67
|
+
href: 'https://apps.shopify.com/ecoboostify?utm_source=gempages',
|
|
68
|
+
appName: EcoboostifyShoppableReelUgc.default.label
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'openApp',
|
|
72
|
+
type: 'open-link',
|
|
73
|
+
target: '_blank',
|
|
74
|
+
linkType: 'openApp',
|
|
75
|
+
href: 'https://admin.shopify.com/?redirect=/apps/ecoboostify',
|
|
76
|
+
appName: EcoboostifyShoppableReelUgc.default.label
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'align',
|
|
80
|
+
label: 'Alignment',
|
|
81
|
+
type: 'segment',
|
|
82
|
+
options: [
|
|
83
|
+
{
|
|
84
|
+
label: 'Left',
|
|
85
|
+
value: 'left',
|
|
86
|
+
type: 'align'
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: 'Center',
|
|
90
|
+
value: 'center',
|
|
91
|
+
type: 'align'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: 'Right',
|
|
95
|
+
value: 'right',
|
|
96
|
+
type: 'align'
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
devices: {
|
|
100
|
+
desktop: {
|
|
101
|
+
default: 'left'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
ui: [
|
|
109
|
+
{
|
|
110
|
+
type: 'control',
|
|
111
|
+
setting: {
|
|
112
|
+
id: 'install'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: 'control',
|
|
117
|
+
setting: {
|
|
118
|
+
id: 'playlistId'
|
|
119
|
+
},
|
|
120
|
+
label: {
|
|
121
|
+
en: 'Playlist ID'
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: 'control',
|
|
126
|
+
setting: {
|
|
127
|
+
id: 'openApp'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: 'control',
|
|
132
|
+
label: {
|
|
133
|
+
en: 'Align'
|
|
134
|
+
},
|
|
135
|
+
setting: {
|
|
136
|
+
id: 'align'
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
exports.default = config;
|
|
@@ -54,8 +54,11 @@ const config = {
|
|
|
54
54
|
options: [
|
|
55
55
|
{
|
|
56
56
|
label: 'Subscription Widget',
|
|
57
|
-
value: 'subscription-widget'
|
|
58
|
-
|
|
57
|
+
value: 'subscription-widget'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'Subscription Widget 2.0',
|
|
61
|
+
value: 'subscription-widget-v2'
|
|
59
62
|
}
|
|
60
63
|
],
|
|
61
64
|
default: 'subscription-widget'
|
|
@@ -11,6 +11,11 @@ const config = {
|
|
|
11
11
|
editorConfigs: {
|
|
12
12
|
component: {
|
|
13
13
|
isThirdParty: true
|
|
14
|
+
},
|
|
15
|
+
placeholder: {
|
|
16
|
+
flowTag: [
|
|
17
|
+
'Product'
|
|
18
|
+
]
|
|
14
19
|
}
|
|
15
20
|
},
|
|
16
21
|
presets: [
|
|
@@ -39,6 +44,16 @@ const config = {
|
|
|
39
44
|
{
|
|
40
45
|
id: 'setting',
|
|
41
46
|
controls: [
|
|
47
|
+
{
|
|
48
|
+
id: 'appBlockId',
|
|
49
|
+
type: 'input',
|
|
50
|
+
default: ''
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'productHandle',
|
|
54
|
+
type: 'input',
|
|
55
|
+
default: ''
|
|
56
|
+
},
|
|
42
57
|
{
|
|
43
58
|
id: 'install',
|
|
44
59
|
type: 'open-link',
|
|
@@ -55,6 +70,38 @@ const config = {
|
|
|
55
70
|
href: 'https://admin.shopify.com/?redirect=/apps/releasit-cod-order-form',
|
|
56
71
|
appName: Releasit.default.label
|
|
57
72
|
},
|
|
73
|
+
{
|
|
74
|
+
id: 'version',
|
|
75
|
+
label: 'Choose version',
|
|
76
|
+
type: 'select',
|
|
77
|
+
default: 'v1',
|
|
78
|
+
options: [
|
|
79
|
+
{
|
|
80
|
+
label: 'V1',
|
|
81
|
+
value: 'v1'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: 'V2',
|
|
85
|
+
value: 'v2'
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'widgetTypeV2',
|
|
91
|
+
label: 'Choose widget',
|
|
92
|
+
type: 'select',
|
|
93
|
+
default: 'button-app-block',
|
|
94
|
+
options: [
|
|
95
|
+
{
|
|
96
|
+
label: 'Releasit button',
|
|
97
|
+
value: 'button-app-block'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: 'Releasit embedded form',
|
|
101
|
+
value: 'form-app-block'
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
58
105
|
{
|
|
59
106
|
id: 'align',
|
|
60
107
|
label: 'Alignment',
|
|
@@ -95,12 +142,22 @@ const config = {
|
|
|
95
142
|
{
|
|
96
143
|
type: 'control',
|
|
97
144
|
label: {
|
|
98
|
-
en: 'Choose
|
|
145
|
+
en: 'Choose version'
|
|
99
146
|
},
|
|
100
147
|
setting: {
|
|
101
|
-
id: '
|
|
148
|
+
id: 'version'
|
|
102
149
|
}
|
|
103
150
|
},
|
|
151
|
+
{
|
|
152
|
+
type: 'control',
|
|
153
|
+
label: {
|
|
154
|
+
en: 'Choose widget'
|
|
155
|
+
},
|
|
156
|
+
setting: {
|
|
157
|
+
id: 'widgetTypeV2'
|
|
158
|
+
},
|
|
159
|
+
condition: 'version === "v2"'
|
|
160
|
+
},
|
|
104
161
|
{
|
|
105
162
|
type: 'control',
|
|
106
163
|
setting: {
|
|
@@ -115,6 +115,7 @@ var GloColorSwatchvariantImage = require('./GloColorSwatchvariantImage.js');
|
|
|
115
115
|
var BfSizeChartSizeGuide = require('./BfSizeChartSizeGuide.js');
|
|
116
116
|
var AlsoBoughtCbb = require('./AlsoBoughtCbb.js');
|
|
117
117
|
var HextomFreeShippingBar = require('./HextomFreeShippingBar.js');
|
|
118
|
+
var EcoboostifyShoppableReelUgc = require('./EcoboostifyShoppableReelUgc.js');
|
|
118
119
|
|
|
119
120
|
var index = {
|
|
120
121
|
HextomCountdownTimerBar: HextomCountdownTimerBar.default,
|
|
@@ -229,7 +230,8 @@ var index = {
|
|
|
229
230
|
GloColorSwatchvariantImage: GloColorSwatchvariantImage.default,
|
|
230
231
|
BfSizeChartSizeGuide: BfSizeChartSizeGuide.default,
|
|
231
232
|
AlsoBoughtCbb: AlsoBoughtCbb.default,
|
|
232
|
-
HextomFreeShippingBar: HextomFreeShippingBar.default
|
|
233
|
+
HextomFreeShippingBar: HextomFreeShippingBar.default,
|
|
234
|
+
EcoboostifyShoppableReelUgc: EcoboostifyShoppableReelUgc.default
|
|
233
235
|
};
|
|
234
236
|
|
|
235
237
|
exports.default = index;
|
|
@@ -10,7 +10,7 @@ const ArticleList = ({ styles, setting, className, children, builderProps })=>{
|
|
|
10
10
|
const { articleSetting, numberOfArticle } = setting ?? {};
|
|
11
11
|
const { articleIds, articlePickType } = articleSetting ?? {};
|
|
12
12
|
const articlesQuery = {
|
|
13
|
-
first: articleIds?.length
|
|
13
|
+
first: articleIds?.length || 50,
|
|
14
14
|
where: {
|
|
15
15
|
baseIDIn: [
|
|
16
16
|
...articleSetting?.articleIds ?? []
|
package/dist/esm/builder.js
CHANGED
|
@@ -119,6 +119,7 @@ import GloColorSwatchvariantImage from './third-party/components/GloColorSwatchv
|
|
|
119
119
|
import BfSizeChartSizeGuide from './third-party/components/BfSizeChartSizeGuide.js';
|
|
120
120
|
import AlsoBoughtCbb from './third-party/components/AlsoBoughtCbb.js';
|
|
121
121
|
import HextomFreeShippingBar from './third-party/components/HextomFreeShippingBar.js';
|
|
122
|
+
import EcoboostifyShoppableReelUgc from './third-party/components/EcoboostifyShoppableReelUgc.js';
|
|
122
123
|
import CartLineVariant from './cart/components/CartLineVariant.js';
|
|
123
124
|
import Cart from './cart/components/Cart.js';
|
|
124
125
|
import CartList from './cart/components/CartList.js';
|
|
@@ -499,7 +500,8 @@ var builder = {
|
|
|
499
500
|
GloColorSwatchvariantImage,
|
|
500
501
|
BfSizeChartSizeGuide,
|
|
501
502
|
AlsoBoughtCbb,
|
|
502
|
-
HextomFreeShippingBar
|
|
503
|
+
HextomFreeShippingBar,
|
|
504
|
+
EcoboostifyShoppableReelUgc
|
|
503
505
|
};
|
|
504
506
|
|
|
505
507
|
export { builder as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { splitStyle, makeStyleResponsive, makeGlobalSize, composeTypographyClassName, composeTypographyStyle, composeBorderCss, composeCornerCss, getSingleColorVariable, template, cls, getGlobalColorStateClass, getGlobalColorStateStyle, composeRadius, getStyleShadowState, composeSize, getGradientBgrStyleForButton, RenderIf } from '@gem-sdk/core';
|
|
2
2
|
import { getInsertLinkData, getDynamicSourceLocales } from '../../helpers.js';
|
|
3
3
|
|
|
4
|
-
const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId })=>{
|
|
4
|
+
const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId, isForceValue = false })=>{
|
|
5
5
|
const { align, size, backgroundColor, textColor, roundedBtn, iconSpacing, globalSize } = styles;
|
|
6
6
|
const { label, iconSvg, btnLink, htmlType, disabled, loading, iconAlign, iconVisible, translate, disabledLoading = true } = setting;
|
|
7
7
|
const [wrapStyle, restStyle] = splitStyle([
|
|
@@ -66,7 +66,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
|
|
|
66
66
|
color: ${getSingleColorVariable(styles?.textColor?.hover)};
|
|
67
67
|
}
|
|
68
68
|
`;
|
|
69
|
-
const labelValDisplay = getDynamicSourceLocales({
|
|
69
|
+
const labelValDisplay = isForceValue ? label : getDynamicSourceLocales({
|
|
70
70
|
val: label,
|
|
71
71
|
uid: builderProps?.uidTranslate ?? builderProps?.uid,
|
|
72
72
|
settingId: translate ?? 'label',
|
|
@@ -157,7 +157,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
|
|
|
157
157
|
>${iconSvg}</span>`)}
|
|
158
158
|
<span
|
|
159
159
|
data-gp-text
|
|
160
|
-
class="${`gp-button-text-only gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line gp-z-1 gp-h-full gp-flex gp-items-center gp-overflow-hidden ${nodePrice ? appendTypoClass : ''}
|
|
160
|
+
class="${`gp-content-product-button gp-button-text-only gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line gp-z-1 gp-h-full gp-flex gp-items-center gp-overflow-hidden ${nodePrice ? appendTypoClass : ''}
|
|
161
161
|
${styles?.typo?.attrs?.italic ? '[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]' : ''}`}"
|
|
162
162
|
style="${{
|
|
163
163
|
...nodePrice && appendTypoStyle,
|
|
@@ -3,7 +3,7 @@ import { getDynamicSourceLocales, getSettingPreloadData } from '../../helpers.js
|
|
|
3
3
|
|
|
4
4
|
const CollectionPaginator = ({ setting, builderProps, pageContext })=>{
|
|
5
5
|
const { layout, previousText, nextText, typographyPaginator, normalColor, activeColor, align, typo, translate } = setting ?? {};
|
|
6
|
-
const numberOfProductOfProductList = pageContext?.numberOfProductOfProductList || 0;
|
|
6
|
+
const numberOfProductOfProductList = setting?.numberOfProducts || pageContext?.numberOfProductOfProductList || 0;
|
|
7
7
|
const limit = numberOfProductOfProductList > 0 ? numberOfProductOfProductList : 4;
|
|
8
8
|
const appendTypoClass = composeTypographyClassName(typo, typographyPaginator);
|
|
9
9
|
const appendTypoStyle = composeTypographyStyle(typo, typographyPaginator);
|
package/dist/esm/helpers.js
CHANGED
|
@@ -32,7 +32,7 @@ const isHexTransparent = (hex)=>{
|
|
|
32
32
|
return Boolean(a);
|
|
33
33
|
};
|
|
34
34
|
const youtubeShortsRegex = /^(?:https?:\/\/)?(?:www\.)?youtube\.com\/shorts\/([^"&?/\s]{11})$/i;
|
|
35
|
-
const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext,
|
|
35
|
+
const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceInventoryQuantity })=>{
|
|
36
36
|
const hasLiquidInValue = new RegExp(/\{\{.*?\}\}|\{%.*?%\}/).test(val?.toString() ?? '');
|
|
37
37
|
const translateLimit = pageContext?.isTranslateWithLocale ? 1000 : 5000;
|
|
38
38
|
if (!translate || !val?.toString().trim() || val.toString().length > translateLimit || hasLiquidInValue || pageContext?.isPreviewing) return val ?? defaultVal;
|
|
@@ -47,9 +47,6 @@ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, i
|
|
|
47
47
|
if (isReplaceInventoryQuantity) {
|
|
48
48
|
locale += ` | replace: '<$quantity$>', inventory_quantity | replace: '<$quantity$>', inventory_quantity`;
|
|
49
49
|
}
|
|
50
|
-
if (isCapitalize) {
|
|
51
|
-
locale = `${locale} | downcase`;
|
|
52
|
-
}
|
|
53
50
|
if (isLiquid) return locale;
|
|
54
51
|
return `{{ ${locale} }}`;
|
|
55
52
|
};
|
|
@@ -124,5 +121,28 @@ const replaceLinkData = (text, isTranslate)=>{
|
|
|
124
121
|
}
|
|
125
122
|
return text;
|
|
126
123
|
};
|
|
124
|
+
const getAllHrefFromString = (htmlString)=>{
|
|
125
|
+
if (!htmlString) return [];
|
|
126
|
+
const regex = /href="([^"]*)"/g;
|
|
127
|
+
const hrefs = [];
|
|
128
|
+
let match;
|
|
129
|
+
while((match = regex.exec(htmlString)) !== null){
|
|
130
|
+
match[1] && hrefs.push(match[1]);
|
|
131
|
+
}
|
|
132
|
+
return hrefs;
|
|
133
|
+
};
|
|
134
|
+
const replaceAllHrefFromString = (htmlString, hrefs)=>{
|
|
135
|
+
if (!htmlString) return '';
|
|
136
|
+
const regex = /href="([^"]*)"/g;
|
|
137
|
+
let match;
|
|
138
|
+
let i = 0;
|
|
139
|
+
while((match = regex.exec(htmlString)) !== null){
|
|
140
|
+
if (match[1]) {
|
|
141
|
+
htmlString = htmlString.replace(match[1], hrefs[i] ?? '');
|
|
142
|
+
i++;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return htmlString;
|
|
146
|
+
};
|
|
127
147
|
|
|
128
|
-
export { getDynamicSourceLocales, getInsertLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex };
|
|
148
|
+
export { getAllHrefFromString, getDynamicSourceLocales, getInsertLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceAllHrefFromString, replaceLinkData, youtubeShortsRegex };
|
|
@@ -3,6 +3,7 @@ import Head from 'next/head';
|
|
|
3
3
|
import Img from './Img.js';
|
|
4
4
|
|
|
5
5
|
const AdaptiveImage = ({ srcSet, priority, pictureClass, imagePlaceholder, ...rest })=>{
|
|
6
|
+
const fallBackImage = 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
|
|
6
7
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
7
8
|
children: [
|
|
8
9
|
/*#__PURE__*/ jsxs(Head, {
|
|
@@ -32,17 +33,17 @@ const AdaptiveImage = ({ srcSet, priority, pictureClass, imagePlaceholder, ...re
|
|
|
32
33
|
children: [
|
|
33
34
|
!!srcSet?.mobile?.src && /*#__PURE__*/ jsx("source", {
|
|
34
35
|
media: "(max-width: 767px)",
|
|
35
|
-
srcSet: srcSet.mobile.src
|
|
36
|
+
srcSet: srcSet.mobile.src || fallBackImage
|
|
36
37
|
}),
|
|
37
38
|
!!srcSet?.tablet?.src && /*#__PURE__*/ jsx("source", {
|
|
38
39
|
media: "(max-width: 1024px)",
|
|
39
|
-
srcSet: srcSet?.tablet?.src
|
|
40
|
+
srcSet: srcSet?.tablet?.src || fallBackImage
|
|
40
41
|
}),
|
|
41
42
|
/*#__PURE__*/ jsx(Img, {
|
|
42
43
|
...rest,
|
|
43
44
|
loading: priority ? 'eager' : 'lazy',
|
|
44
45
|
image: {
|
|
45
|
-
src: srcSet?.desktop?.src || imagePlaceholder?.['desktop']
|
|
46
|
+
src: srcSet?.desktop?.src || imagePlaceholder?.['desktop'] || fallBackImage
|
|
46
47
|
}
|
|
47
48
|
})
|
|
48
49
|
]
|
|
@@ -4,13 +4,11 @@ import Link from '../../link/components/Link.js';
|
|
|
4
4
|
import AdaptiveImage from './AdaptiveImage.js';
|
|
5
5
|
import NextImage from './NextImage.js';
|
|
6
6
|
import { composeAspectRatio } from './helpers.js';
|
|
7
|
-
import NoDataImage from './NoDataImage.js';
|
|
8
|
-
import { useMemo } from 'react';
|
|
9
7
|
|
|
10
8
|
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, children, onClick, onLoad })=>{
|
|
11
9
|
const { image, imageLink, srcSet, isNotLazyload } = setting ?? {};
|
|
12
10
|
const { customAspectRadio } = styles ?? {};
|
|
13
|
-
|
|
11
|
+
useCurrentDevice();
|
|
14
12
|
const { shape } = styles ?? {};
|
|
15
13
|
const WrapLink = imageLink?.link ? Link : 'div';
|
|
16
14
|
const opacity = {
|
|
@@ -55,18 +53,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
55
53
|
custom: customAspectRadio
|
|
56
54
|
})
|
|
57
55
|
};
|
|
58
|
-
const isShowNoDataState = useMemo(()=>{
|
|
59
|
-
if (setting?.disableNoDataState) return false;
|
|
60
|
-
if (currentDevice === 'mobile') return !setting?.srcSet?.mobile?.src && !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
|
|
61
|
-
if (currentDevice === 'tablet') return !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
|
|
62
|
-
return !setting?.srcSet?.desktop?.src;
|
|
63
|
-
}, [
|
|
64
|
-
currentDevice,
|
|
65
|
-
setting?.disableNoDataState,
|
|
66
|
-
setting?.srcSet?.desktop?.src,
|
|
67
|
-
setting?.srcSet?.mobile?.src,
|
|
68
|
-
setting?.srcSet?.tablet?.src
|
|
69
|
-
]);
|
|
70
56
|
return /*#__PURE__*/ jsxs("div", {
|
|
71
57
|
...builderAttrs,
|
|
72
58
|
"data-id": builderProps?.uid,
|
|
@@ -94,12 +80,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
94
80
|
...makeStyleResponsive('jc', styles?.align)
|
|
95
81
|
},
|
|
96
82
|
children: [
|
|
97
|
-
|
|
98
|
-
style: {
|
|
99
|
-
...imageWidth,
|
|
100
|
-
...imageHeight
|
|
101
|
-
}
|
|
102
|
-
}) : setting?.isAdaptive ? /*#__PURE__*/ jsx(AdaptiveImage, {
|
|
83
|
+
setting?.isAdaptive ? /*#__PURE__*/ jsx(AdaptiveImage, {
|
|
103
84
|
srcSet: setting.srcSet,
|
|
104
85
|
pictureClass: "gp-contents",
|
|
105
86
|
className: cls(className, 'gp-inline-block gp-w-full gp-max-w-full', handleConvertClassColor(styles?.borderImg)),
|
|
@@ -28,7 +28,8 @@ const getSrcSetLiquid = (liquid, storage)=>{
|
|
|
28
28
|
return `{{ '${liquid}' | asset_img_url: '768x' }} 768w, {{ '${liquid}' | asset_img_url: '1024x' }} 1024w, {{ '${liquid}' | asset_img_url: 'master' }} 1440w`;
|
|
29
29
|
};
|
|
30
30
|
const getSrcSetLink = (link)=>{
|
|
31
|
-
return
|
|
31
|
+
return link; // Since image src didn't change in size so this line of code is pointless
|
|
32
|
+
// return `${link} 768w,${link} 1024w,${link} 1440w`;
|
|
32
33
|
};
|
|
33
34
|
const getImageSrc = (image, currentDevice)=>{
|
|
34
35
|
let src = image?.backupFilePath;
|
package/dist/esm/index.js
CHANGED
|
@@ -217,6 +217,7 @@ export { default as GloColorSwatchvariantImage } from './third-party/components/
|
|
|
217
217
|
export { default as BfSizeChartSizeGuide } from './third-party/components/BfSizeChartSizeGuide.js';
|
|
218
218
|
export { default as AlsoBoughtCbb } from './third-party/components/AlsoBoughtCbb.js';
|
|
219
219
|
export { default as HextomFreeShippingBar } from './third-party/components/HextomFreeShippingBar.js';
|
|
220
|
+
export { default as EcoboostifyShoppableReelUgc } from './third-party/components/EcoboostifyShoppableReelUgc.js';
|
|
220
221
|
export { default as thirdPartyInstantSetting } from './third-party-instant/setting/index.js';
|
|
221
222
|
export { default as InstantJudgemeReviews } from './third-party-instant/components/InstantJudgemeReviews.js';
|
|
222
223
|
export { default as InstantLooxReviews } from './third-party-instant/components/InstantLooxReviews.js';
|
|
@@ -307,7 +308,7 @@ export { index_liquid as liquidComponents };
|
|
|
307
308
|
export { default as builderComponent } from './builder.js';
|
|
308
309
|
import 'react/jsx-runtime';
|
|
309
310
|
export { ELEMENT_Z_INDEX } from './common/const.js';
|
|
310
|
-
export { getDynamicSourceLocales, getInsertLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex } from './helpers.js';
|
|
311
|
+
export { getAllHrefFromString, getDynamicSourceLocales, getInsertLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceAllHrefFromString, replaceLinkData, youtubeShortsRegex } from './helpers.js';
|
|
311
312
|
export { default as postPurchaseTextSetting } from './post-purchase/text/setting/index.js';
|
|
312
313
|
export { default as PostPurchaseText } from './post-purchase/text/Text.js';
|
|
313
314
|
export { convertSizeToWidth, transformHighlighTag, transformNumberTag } from './stock-counter/helpers.js';
|
package/dist/esm/index.liquid.js
CHANGED
|
@@ -172,6 +172,7 @@ export { default as GloColorSwatchvariantImage } from './third-party/components/
|
|
|
172
172
|
export { default as BfSizeChartSizeGuide } from './third-party/components/BfSizeChartSizeGuide.liquid.js';
|
|
173
173
|
export { default as AlsoBoughtCbb } from './third-party/components/AlsoBoughtCbb.liquid.js';
|
|
174
174
|
export { default as HextomFreeShippingBar } from './third-party/components/HextomFreeShippingBar.liquid.js';
|
|
175
|
+
export { default as EcoboostifyShoppableReelUgc } from './third-party/components/EcoboostifyShoppableReelUgc.liquid.js';
|
|
175
176
|
export { default as ImageComparison } from './image-comparison/components/ImageComparison.liquid.js';
|
|
176
177
|
export { default as ThirdPartySlot } from './third-party-slot/components/ThirdPartySlot.liquid.js';
|
|
177
178
|
export { default as Sticky } from './sticky/components/Sticky.liquid.js';
|
|
@@ -44,11 +44,13 @@ function useInView({ triggerOnce, skip, addRootMargin = 0, initialInView, onChan
|
|
|
44
44
|
// Add listeners for visibility change
|
|
45
45
|
window.addEventListener('scroll', handleVisibilityChange);
|
|
46
46
|
window.addEventListener('resize', handleVisibilityChange);
|
|
47
|
+
window.addEventListener('trigger-change-in-view', handleVisibilityChange);
|
|
47
48
|
// Initial check
|
|
48
49
|
handleVisibilityChange();
|
|
49
50
|
unobserve.current = ()=>{
|
|
50
51
|
window.removeEventListener('scroll', handleVisibilityChange);
|
|
51
52
|
window.removeEventListener('resize', handleVisibilityChange);
|
|
53
|
+
window.removeEventListener('trigger-change-in-view', handleVisibilityChange);
|
|
52
54
|
if (frameId.current) cancelAnimationFrame(frameId.current);
|
|
53
55
|
frameId.current = undefined;
|
|
54
56
|
};
|
|
@@ -65,7 +65,7 @@ const DropdownVariant = ({ option, optionPosition, optionNumber, variantGroup, v
|
|
|
65
65
|
children: /*#__PURE__*/ jsx("span", {
|
|
66
66
|
className: "gp-max-w-full",
|
|
67
67
|
children: /*#__PURE__*/ jsx("span", {
|
|
68
|
-
className: "gp-block gp-overflow-hidden",
|
|
68
|
+
className: "gp-block gp-overflow-hidden gp-truncate",
|
|
69
69
|
children: label
|
|
70
70
|
})
|
|
71
71
|
})
|
|
@@ -214,7 +214,7 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
|
|
|
214
214
|
]);
|
|
215
215
|
const isInStock = useCurrentVariantInStock();
|
|
216
216
|
const isDisable = !isInStock || createCartLoading || addToCartLoading;
|
|
217
|
-
const label = !isInStock ? setting?.outOfStockLabel : setting?.label;
|
|
217
|
+
const label = !isInStock ? !currentVariant ? 'Unavailable' : setting?.outOfStockLabel : setting?.label;
|
|
218
218
|
if (!isInStock && isCustomOutOfStock) {
|
|
219
219
|
buttonStyles.backgroundColor = {
|
|
220
220
|
normal: oosBackground
|
|
@@ -184,6 +184,22 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
|
|
|
184
184
|
pageContext,
|
|
185
185
|
translate: setting?.translate
|
|
186
186
|
});
|
|
187
|
+
const labelUnavailableTranslate = getDynamicSourceLocales({
|
|
188
|
+
val: 'Unavailable',
|
|
189
|
+
uid: builderProps?.uid,
|
|
190
|
+
settingId: 'unavailableLabel',
|
|
191
|
+
isLiquid: true,
|
|
192
|
+
pageContext,
|
|
193
|
+
translate: setting?.translate ? 'unavailableLabel' : undefined
|
|
194
|
+
});
|
|
195
|
+
const labelOutOfStockTranslate = getDynamicSourceLocales({
|
|
196
|
+
val: setting?.outOfStockLabel,
|
|
197
|
+
uid: builderProps?.uid,
|
|
198
|
+
settingId: 'outOfStockLabel',
|
|
199
|
+
isLiquid: true,
|
|
200
|
+
pageContext,
|
|
201
|
+
translate: setting?.translate ? 'outOfStockLabel' : undefined
|
|
202
|
+
});
|
|
187
203
|
return template /* liquid */ `
|
|
188
204
|
{%- liquid
|
|
189
205
|
assign inventory_quantity = variant.inventory_quantity | default: 0
|
|
@@ -191,6 +207,8 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
|
|
|
191
207
|
<gp-product-button
|
|
192
208
|
class="gp-product-button"
|
|
193
209
|
gp-data-wrapper="true"
|
|
210
|
+
label-out-of-Stock="${pageContext?.isPreviewing ? labelOutOfStockTranslate : `{{${labelOutOfStockTranslate}}}`}"
|
|
211
|
+
label-unavailable="${pageContext?.isPreviewing ? labelUnavailableTranslate : `{{${labelUnavailableTranslate}}}`}"
|
|
194
212
|
gp-data='${JSON.stringify({
|
|
195
213
|
setting: {
|
|
196
214
|
actionEffect: setting?.actionEffect,
|
|
@@ -268,8 +286,7 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
|
|
|
268
286
|
'gp-data-hidden': `{% if variant.available %}true{% endif %}`
|
|
269
287
|
},
|
|
270
288
|
setting: {
|
|
271
|
-
label:
|
|
272
|
-
translate: setting?.translate ? 'outOfStockLabel' : undefined,
|
|
289
|
+
label: `${pageContext?.isPreviewing ? labelOutOfStockTranslate : `{{${labelOutOfStockTranslate}}}`}`,
|
|
273
290
|
htmlType: 'button',
|
|
274
291
|
iconAlign: iconAlign,
|
|
275
292
|
iconSvg: iconSvg,
|
|
@@ -288,7 +305,8 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
|
|
|
288
305
|
}
|
|
289
306
|
},
|
|
290
307
|
pageContext,
|
|
291
|
-
nodePrice: composeNodePrice()
|
|
308
|
+
nodePrice: composeNodePrice(),
|
|
309
|
+
isForceValue: true
|
|
292
310
|
})}
|
|
293
311
|
</gp-product-button>
|
|
294
312
|
${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-product-button.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-product-button.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
@@ -233,6 +233,7 @@ const ProductList = ({ setting, builderProps, styles, className, children, advan
|
|
|
233
233
|
endif
|
|
234
234
|
assign arrayRelatedExclude = relatedExclude | split: ","
|
|
235
235
|
assign idSelectedList = ''
|
|
236
|
+
assign relatedListProduct = null
|
|
236
237
|
for collection in collections
|
|
237
238
|
assign collectionId = collection.id
|
|
238
239
|
assign isInCollection = false
|
|
@@ -247,20 +248,15 @@ const ProductList = ({ setting, builderProps, styles, className, children, advan
|
|
|
247
248
|
break
|
|
248
249
|
else
|
|
249
250
|
assign idSelectedList = idSelectedList | append: "," | append: product.id
|
|
251
|
+
assign productSelected = product | sort
|
|
252
|
+
assign relatedListProduct = relatedListProduct | concat: productSelected
|
|
250
253
|
endif
|
|
251
254
|
endfor
|
|
252
255
|
endif
|
|
253
256
|
endunless
|
|
254
257
|
endfor
|
|
255
258
|
endfor
|
|
256
|
-
|
|
257
|
-
assign handle = item.handle
|
|
258
|
-
assign productF = item | sort
|
|
259
|
-
if idSelectedList contains item.id
|
|
260
|
-
assign products = products | concat: productF
|
|
261
|
-
endif
|
|
262
|
-
endfor
|
|
263
|
-
assign products = products | uniq
|
|
259
|
+
assign products = relatedListProduct | uniq
|
|
264
260
|
when 'vendor'
|
|
265
261
|
assign vendorAssignProduct = assignProduct.vendor
|
|
266
262
|
assign productFilter = allProductsPaginated | where: 'vendor', vendorAssignProduct
|