@gem-sdk/components 2.0.0-dev.550 → 2.0.0-dev.552
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/estimate-delivery/components/EstimateDate.liquid.js +64 -0
- package/dist/cjs/estimate-delivery/components/common/getNewSetting.js +2 -2
- package/dist/cjs/estimate-delivery/setting/configs/settings.js +9 -6
- package/dist/cjs/estimate-delivery/setting/configs/uiV2.js +3 -3
- package/dist/cjs/image/setting/Image.js +1 -1
- package/dist/cjs/image/setting/configs/settings.js +2 -1
- package/dist/cjs/image/setting/configs/uiV2.js +4 -4
- package/dist/cjs/index.liquid.js +2 -5
- package/dist/cjs/product/components/ProductBadge/common/getAttrs.js +2 -19
- package/dist/cjs/product/components/ProductBadge/index.liquid.js +15 -0
- package/dist/cjs/product/setting/constant/bundle-layout/horizontalThree.js +468 -464
- package/dist/cjs/product/setting/constant/bundle-layout/horizontalTwo.js +5 -1
- package/dist/cjs/product/setting/constant/bundle-layout/verticalThree.js +363 -359
- package/dist/cjs/product/setting/constant/bundle-layout/verticalTwo.js +363 -359
- package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +60 -0
- package/dist/esm/estimate-delivery/components/common/getNewSetting.js +2 -2
- package/dist/esm/estimate-delivery/setting/configs/settings.js +9 -6
- package/dist/esm/estimate-delivery/setting/configs/uiV2.js +3 -3
- package/dist/esm/image/setting/Image.js +1 -1
- package/dist/esm/image/setting/configs/settings.js +2 -1
- package/dist/esm/image/setting/configs/uiV2.js +4 -4
- package/dist/esm/index.liquid.js +1 -5
- package/dist/esm/product/components/ProductBadge/common/getAttrs.js +2 -19
- package/dist/esm/product/components/ProductBadge/index.liquid.js +17 -2
- package/dist/esm/product/setting/constant/bundle-layout/horizontalThree.js +468 -464
- package/dist/esm/product/setting/constant/bundle-layout/horizontalTwo.js +5 -1
- package/dist/esm/product/setting/constant/bundle-layout/verticalThree.js +363 -359
- package/dist/esm/product/setting/constant/bundle-layout/verticalTwo.js +363 -359
- package/dist/types/index.d.ts +43 -2
- package/package.json +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
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 system = require('@gem-sdk/system');
|
|
8
|
+
require('../../accordion/components/common/classes.js');
|
|
9
|
+
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
10
|
+
require('html-react-parser');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('react');
|
|
13
|
+
require('next/link');
|
|
14
|
+
var getNewSetting = require('./common/getNewSetting.js');
|
|
15
|
+
var getAdvanced = require('./common/getAdvanced.js');
|
|
16
|
+
require('../../marquee/common/classes.js');
|
|
17
|
+
require('../../product/components/constants/product-bundle.js');
|
|
18
|
+
require('../../product/components/ProductBadge/types.js');
|
|
19
|
+
require('../../product/components/ProductBadge/constants.js');
|
|
20
|
+
require('../../product/components/ProductBadge/utils/shape.js');
|
|
21
|
+
require('../../product/components/ProductBundle/common/styles.js');
|
|
22
|
+
require('../../product/components/ProductBundle/common/classes.js');
|
|
23
|
+
require('../../product/components/ProductButton/common/types.js');
|
|
24
|
+
|
|
25
|
+
const EstimateDate = ({ setting = {}, styles, builderAttrs, style, builderProps, advanced, isText, pageContext })=>{
|
|
26
|
+
const wrapperClasses = system.createClass({
|
|
27
|
+
'estimate-date-container': true
|
|
28
|
+
});
|
|
29
|
+
const advancedClass = getAdvanced.getClassAdvanced({
|
|
30
|
+
setting,
|
|
31
|
+
advanced,
|
|
32
|
+
type: 'Liquid'
|
|
33
|
+
});
|
|
34
|
+
const newSetting = getNewSetting.getNewSetting({
|
|
35
|
+
type: 'Liquid',
|
|
36
|
+
styles,
|
|
37
|
+
setting,
|
|
38
|
+
builderProps
|
|
39
|
+
});
|
|
40
|
+
return core.template`
|
|
41
|
+
<gp-estimate-date>
|
|
42
|
+
${Text_liquid.default({
|
|
43
|
+
builderProps,
|
|
44
|
+
builderAttrs,
|
|
45
|
+
advanced: {
|
|
46
|
+
...advanced,
|
|
47
|
+
cssClass: advancedClass
|
|
48
|
+
},
|
|
49
|
+
style,
|
|
50
|
+
styles,
|
|
51
|
+
setting: newSetting,
|
|
52
|
+
className: wrapperClasses,
|
|
53
|
+
isText,
|
|
54
|
+
pageContext,
|
|
55
|
+
elementAttrs: {
|
|
56
|
+
'setting-estimate-date': encodeURIComponent(JSON.stringify(setting))
|
|
57
|
+
}
|
|
58
|
+
})}
|
|
59
|
+
</gp-estimate-date>
|
|
60
|
+
${core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-estimate-date.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-estimate-date.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
61
|
+
`;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.default = EstimateDate;
|
|
@@ -69,12 +69,12 @@ const getTextContent = ({ type, styles, setting, builderProps, pageContext })=>{
|
|
|
69
69
|
isCapitalize: styles?.typo?.attrs?.transform === 'capitalize',
|
|
70
70
|
translate: setting?.translate
|
|
71
71
|
}).toString();
|
|
72
|
-
return `${TextInline.default({
|
|
72
|
+
return `${setting?.enableCustomText ? TextInline.default({
|
|
73
73
|
styles: getStyle.getStyleEstimateDate(styles, 'typoCustom'),
|
|
74
74
|
setting: {
|
|
75
75
|
text: textWithTranslate
|
|
76
76
|
}
|
|
77
|
-
})} ${TextInline.default({
|
|
77
|
+
}) : ''} ${TextInline.default({
|
|
78
78
|
styles: getStyle.getStyleEstimateDate(styles, 'typoDate'),
|
|
79
79
|
setting: {
|
|
80
80
|
text: getDayEst(setting)
|
|
@@ -52,24 +52,27 @@ const EstimateDateSettings = [
|
|
|
52
52
|
label: 'Min estimate',
|
|
53
53
|
type: 'input:number',
|
|
54
54
|
default: 2,
|
|
55
|
-
emptyOnClear:
|
|
56
|
-
min:
|
|
55
|
+
emptyOnClear: false,
|
|
56
|
+
min: 1,
|
|
57
|
+
max: 99969999
|
|
57
58
|
},
|
|
58
59
|
{
|
|
59
60
|
id: 'maxEstimate',
|
|
60
61
|
label: 'Max estimate',
|
|
61
62
|
type: 'input:number',
|
|
62
|
-
emptyOnClear: true,
|
|
63
63
|
default: 5,
|
|
64
|
-
|
|
64
|
+
emptyOnClear: false,
|
|
65
|
+
min: 1,
|
|
66
|
+
max: 99969999
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
id: 'estimateTime',
|
|
68
70
|
label: 'Estimate',
|
|
69
71
|
type: 'input:number',
|
|
70
|
-
emptyOnClear: true,
|
|
71
72
|
default: 5,
|
|
72
|
-
|
|
73
|
+
emptyOnClear: false,
|
|
74
|
+
min: 0,
|
|
75
|
+
max: 99969999
|
|
73
76
|
}
|
|
74
77
|
]
|
|
75
78
|
}
|
|
@@ -144,7 +144,7 @@ const SettingUIV2 = [
|
|
|
144
144
|
label: {
|
|
145
145
|
en: 'Content'
|
|
146
146
|
},
|
|
147
|
-
iconName: 'polaris-text-
|
|
147
|
+
iconName: 'polaris-text-block',
|
|
148
148
|
fixedValue: 'Estimate delivery between',
|
|
149
149
|
getValueFromSettingID: 'customText',
|
|
150
150
|
isHideClear: true,
|
|
@@ -227,8 +227,8 @@ const SettingUIV2 = [
|
|
|
227
227
|
type: 'medium',
|
|
228
228
|
top: '4px',
|
|
229
229
|
bottom: '4px',
|
|
230
|
-
left: '
|
|
231
|
-
right: '
|
|
230
|
+
left: '16px',
|
|
231
|
+
right: '16px'
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
}
|
|
@@ -23,7 +23,8 @@ const SettingUIV2 = [
|
|
|
23
23
|
newValue: {
|
|
24
24
|
shape: 'square',
|
|
25
25
|
shapeValue: '1/1',
|
|
26
|
-
shapeLinked: true
|
|
26
|
+
shapeLinked: true,
|
|
27
|
+
width: '1200px'
|
|
27
28
|
},
|
|
28
29
|
groupType: 'style',
|
|
29
30
|
controlType: 'style'
|
|
@@ -56,7 +57,8 @@ const SettingUIV2 = [
|
|
|
56
57
|
controlId: 'shape',
|
|
57
58
|
newValue: {
|
|
58
59
|
shape: 'original',
|
|
59
|
-
shapeValue: ''
|
|
60
|
+
shapeValue: '',
|
|
61
|
+
width: '1200px'
|
|
60
62
|
},
|
|
61
63
|
groupType: 'style',
|
|
62
64
|
controlType: 'style'
|
|
@@ -283,7 +285,6 @@ const SettingUIV2 = [
|
|
|
283
285
|
en: 'Alt text'
|
|
284
286
|
},
|
|
285
287
|
iconName: 'polaris-text-block',
|
|
286
|
-
fixedValue: 'Describes the appearance of the image',
|
|
287
288
|
getValueFromSettingID: 'alt',
|
|
288
289
|
isHideClear: true,
|
|
289
290
|
controls: [
|
|
@@ -304,7 +305,6 @@ const SettingUIV2 = [
|
|
|
304
305
|
en: 'Image title'
|
|
305
306
|
},
|
|
306
307
|
iconName: 'polaris-text-block',
|
|
307
|
-
fixedValue: 'Title',
|
|
308
308
|
getValueFromSettingID: 'title',
|
|
309
309
|
isHideClear: true,
|
|
310
310
|
controls: [
|
package/dist/cjs/index.liquid.js
CHANGED
|
@@ -29,7 +29,7 @@ var CollectionBanner_liquid = require('./collection/components/collection-banner
|
|
|
29
29
|
var Countdown_liquid = require('./countdown-timer/components/Countdown.liquid.js');
|
|
30
30
|
var Coupon_liquid = require('./coupon/components/Coupon.liquid.js');
|
|
31
31
|
var Dialog_liquid = require('./dialog/components/Dialog.liquid.js');
|
|
32
|
-
require('
|
|
32
|
+
var EstimateDate_liquid = require('./estimate-delivery/components/EstimateDate.liquid.js');
|
|
33
33
|
var Col_liquid = require('./grid/col/Col.liquid.js');
|
|
34
34
|
var Row_liquid = require('./grid/row/Row.liquid.js');
|
|
35
35
|
var Section_liquid = require('./grid/section/Section.liquid.js');
|
|
@@ -198,10 +198,6 @@ var StellarDeliveryDatePickup_liquid = require('./third-party/components/Stellar
|
|
|
198
198
|
var ThirdPartySlot_liquid = require('./third-party-slot/components/ThirdPartySlot.liquid.js');
|
|
199
199
|
var ShopPayInstallments_liquid = require('./shop-pay-installment/components/ShopPayInstallments.liquid.js');
|
|
200
200
|
var Sticky_liquid = require('./sticky/components/Sticky.liquid.js');
|
|
201
|
-
require('react/jsx-runtime');
|
|
202
|
-
require('react');
|
|
203
|
-
require('next/link');
|
|
204
|
-
require('@gem-sdk/system');
|
|
205
201
|
|
|
206
202
|
|
|
207
203
|
|
|
@@ -233,6 +229,7 @@ exports.CollectionBanner = CollectionBanner_liquid.default;
|
|
|
233
229
|
exports.Countdown = Countdown_liquid.default;
|
|
234
230
|
exports.Coupon = Coupon_liquid.default;
|
|
235
231
|
exports.Dialog = Dialog_liquid.default;
|
|
232
|
+
exports.EstimateDate = EstimateDate_liquid.default;
|
|
236
233
|
exports.Col = Col_liquid.default;
|
|
237
234
|
exports.Row = Row_liquid.default;
|
|
238
235
|
exports.Section = Section_liquid.default;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var core = require('@gem-sdk/core');
|
|
4
|
-
|
|
5
3
|
const getImageAttr = ({ setting })=>{
|
|
6
4
|
return {
|
|
7
5
|
src: setting?.image?.src,
|
|
@@ -10,27 +8,12 @@ const getImageAttr = ({ setting })=>{
|
|
|
10
8
|
};
|
|
11
9
|
};
|
|
12
10
|
const getContainerAttrs = (props)=>{
|
|
13
|
-
const { builderAttrs, builderProps
|
|
14
|
-
const isTextBadge = setting?.contentType === 'text';
|
|
11
|
+
const { builderAttrs, builderProps } = props;
|
|
15
12
|
return {
|
|
16
13
|
...builderAttrs,
|
|
17
14
|
'data-id': builderProps?.uid || '',
|
|
18
15
|
id: `g-product-badge-${builderProps?.uid}`,
|
|
19
|
-
'gp-data-hidden': 'false'
|
|
20
|
-
'gp-data': `${core.dataStringify({
|
|
21
|
-
displayContent: setting?.displayContent,
|
|
22
|
-
minPrice: '{{ minPriceValue }}',
|
|
23
|
-
variantIDs: '{{ product.variants | map: "id" | json | escape }}',
|
|
24
|
-
variantInventoryQuantities: '{{ product.variants | map: "inventory_quantity" | json | escape }}',
|
|
25
|
-
amountDiscount: '{{amountDiscountValue}}',
|
|
26
|
-
percentDiscount: '{{percentDiscountValue}}',
|
|
27
|
-
price: '{{price}}',
|
|
28
|
-
displayTrigger: setting?.displayTrigger,
|
|
29
|
-
uid: builderProps?.uid,
|
|
30
|
-
productCreatedAt: '{{product.created_at | date: "%Y-%m-%d" }}',
|
|
31
|
-
productTags: '{{ product.tags | join: "," }}',
|
|
32
|
-
isTextBadge
|
|
33
|
-
})}`
|
|
16
|
+
'gp-data-hidden': 'false'
|
|
34
17
|
};
|
|
35
18
|
};
|
|
36
19
|
const getEditTooltipAttrs = (props)=>{
|
|
@@ -77,6 +77,20 @@ const ProductBadge = (props)=>{
|
|
|
77
77
|
setting
|
|
78
78
|
})
|
|
79
79
|
});
|
|
80
|
+
const createDataState = system.createStateOrContext({
|
|
81
|
+
displayContent: setting?.displayContent,
|
|
82
|
+
minPrice: '{{ minPriceValue }}',
|
|
83
|
+
variantIDs: '{{ product.variants | map: "id" | json | escape }}',
|
|
84
|
+
variantInventoryQuantities: '{{ product.variants | map: "inventory_quantity" | json | escape }}',
|
|
85
|
+
amountDiscount: '{{amountDiscountValue}}',
|
|
86
|
+
percentDiscount: '{{percentDiscountValue}}',
|
|
87
|
+
price: '{{price}}',
|
|
88
|
+
displayTrigger: setting?.displayTrigger,
|
|
89
|
+
uid: props.builderProps?.uid,
|
|
90
|
+
productCreatedAt: '{{product.created_at | date: "%Y-%m-%d" }}',
|
|
91
|
+
productTags: '{{ product.tags | join: "," }}',
|
|
92
|
+
isTextBadge
|
|
93
|
+
});
|
|
80
94
|
return core.template`
|
|
81
95
|
{% if product %}
|
|
82
96
|
${generateLiquidContent.generateBadgeContent(setting?.displayContent)}
|
|
@@ -85,6 +99,7 @@ const ProductBadge = (props)=>{
|
|
|
85
99
|
${{
|
|
86
100
|
...containerAttrs
|
|
87
101
|
}}
|
|
102
|
+
gp-data='${core.dataStringify(createDataState)}'
|
|
88
103
|
class="containerClass"
|
|
89
104
|
style="${containerStyle}"
|
|
90
105
|
>
|