@gem-sdk/components 2.0.0-staging.154 → 2.0.0-staging.161
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/hero-banner/index.liquid.js +1 -1
- package/dist/cjs/builder.js +4 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.liquid.js +4 -0
- package/dist/cjs/post-purchase/product/components/ProductDiscountTag.js +5 -2
- package/dist/cjs/post-purchase/product/components/ProductOffer.js +16 -3
- package/dist/cjs/post-purchase/product/components/ProductPrice.js +3 -1
- package/dist/cjs/post-purchase/product/components/ProductPriceBreakdown.js +9 -21
- package/dist/cjs/post-purchase/product/constants/ProductOfferPlaceholder.js +149 -0
- package/dist/cjs/post-purchase/product/hooks/useDynamicProduct.js +28 -0
- package/dist/cjs/post-purchase/product/settings/ProductOffer.js +26 -0
- package/dist/cjs/product/components/ProductBundleDiscountItem.liquid.js +3 -3
- package/dist/cjs/product/components/ProductVariants/variants/index.js +1 -1
- package/dist/cjs/product/components/ProductVariants/variants/index.liquid.js +1 -1
- package/dist/cjs/third-party/components/EssentialAnnouncementBar.js +33 -0
- package/dist/cjs/third-party/components/EssentialAnnouncementBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/EssentialCountdownTimerBar.js +33 -0
- package/dist/cjs/third-party/components/EssentialCountdownTimerBar.liquid.js +12 -0
- package/dist/cjs/third-party/configs/EssentialAnnouncementBar.js +12 -0
- package/dist/cjs/third-party/configs/EssentialCountdownTimerBar.js +12 -0
- package/dist/cjs/third-party/helpers/thirdParty.js +1 -1
- package/dist/cjs/third-party/next.js +10 -0
- package/dist/cjs/third-party/setting/EssentialAnnouncementBar.js +142 -0
- package/dist/cjs/third-party/setting/EssentialCountdownTimerBar.js +142 -0
- package/dist/cjs/third-party/setting/index.js +4 -0
- package/dist/esm/banner/components/hero-banner/index.liquid.js +1 -1
- package/dist/esm/builder.js +4 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.liquid.js +2 -0
- package/dist/esm/post-purchase/product/components/ProductDiscountTag.js +5 -2
- package/dist/esm/post-purchase/product/components/ProductOffer.js +16 -3
- package/dist/esm/post-purchase/product/components/ProductPrice.js +3 -1
- package/dist/esm/post-purchase/product/components/ProductPriceBreakdown.js +9 -21
- package/dist/esm/post-purchase/product/constants/ProductOfferPlaceholder.js +147 -0
- package/dist/esm/post-purchase/product/hooks/useDynamicProduct.js +26 -0
- package/dist/esm/post-purchase/product/settings/ProductOffer.js +26 -0
- package/dist/esm/product/components/ProductBundleDiscountItem.liquid.js +3 -3
- package/dist/esm/product/components/ProductVariants/variants/index.js +1 -1
- package/dist/esm/product/components/ProductVariants/variants/index.liquid.js +1 -1
- package/dist/esm/third-party/components/EssentialAnnouncementBar.js +29 -0
- package/dist/esm/third-party/components/EssentialAnnouncementBar.liquid.js +8 -0
- package/dist/esm/third-party/components/EssentialCountdownTimerBar.js +29 -0
- package/dist/esm/third-party/components/EssentialCountdownTimerBar.liquid.js +8 -0
- package/dist/esm/third-party/configs/EssentialAnnouncementBar.js +8 -0
- package/dist/esm/third-party/configs/EssentialCountdownTimerBar.js +8 -0
- package/dist/esm/third-party/helpers/thirdParty.js +1 -1
- package/dist/esm/third-party/next.js +10 -0
- package/dist/esm/third-party/setting/EssentialAnnouncementBar.js +138 -0
- package/dist/esm/third-party/setting/EssentialCountdownTimerBar.js +138 -0
- package/dist/esm/third-party/setting/index.js +206 -202
- package/dist/types/index.d.ts +38 -1
- package/package.json +2 -2
|
@@ -266,7 +266,6 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
266
266
|
}}">
|
|
267
267
|
<gp-hero-banner
|
|
268
268
|
gp-data='${core.dataStringify({
|
|
269
|
-
href: urlData?.href ?? '',
|
|
270
269
|
target: urlData?.target ?? '_blank',
|
|
271
270
|
background: backgroundResponsive,
|
|
272
271
|
uid: builderProps?.uid,
|
|
@@ -279,6 +278,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
279
278
|
contentPosition2Col: styles?.contentPosition2Col,
|
|
280
279
|
aspectRatio: setting?.aspectRatio
|
|
281
280
|
}).replaceAll("'", ''')}'
|
|
281
|
+
gp-href="${urlData.href}"
|
|
282
282
|
${{
|
|
283
283
|
...builderAttrs
|
|
284
284
|
}}
|
package/dist/cjs/builder.js
CHANGED
|
@@ -112,6 +112,8 @@ var MyappgurusProductReviews = require('./third-party/components/MyappgurusProdu
|
|
|
112
112
|
var HulkProductOptions = require('./third-party/components/HulkProductOptions.js');
|
|
113
113
|
var TrustshopProductReviews = require('./third-party/components/TrustshopProductReviews.js');
|
|
114
114
|
var StellarDeliveryDatePickup = require('./third-party/components/StellarDeliveryDatePickup.js');
|
|
115
|
+
var EssentialCountdownTimerBar = require('./third-party/components/EssentialCountdownTimerBar.js');
|
|
116
|
+
var EssentialAnnouncementBar = require('./third-party/components/EssentialAnnouncementBar.js');
|
|
115
117
|
var CartLineVariant = require('./cart/components/CartLineVariant.js');
|
|
116
118
|
var Cart = require('./cart/components/Cart.js');
|
|
117
119
|
var CartList = require('./cart/components/CartList.js');
|
|
@@ -248,6 +250,8 @@ var PostPurchaseLink = require('./post-purchase/link/components/PostPurchaseLink
|
|
|
248
250
|
var Text$1 = require('./post-purchase/text/Text.js');
|
|
249
251
|
|
|
250
252
|
var builder = {
|
|
253
|
+
EssentialAnnouncementBar: EssentialAnnouncementBar.default,
|
|
254
|
+
EssentialCountdownTimerBar: EssentialCountdownTimerBar.default,
|
|
251
255
|
StellarDeliveryDatePickup: StellarDeliveryDatePickup.default,
|
|
252
256
|
TrustshopProductReviews: TrustshopProductReviews.default,
|
|
253
257
|
HulkProductOptions: HulkProductOptions.default,
|
package/dist/cjs/index.js
CHANGED
|
@@ -207,6 +207,8 @@ var MyappgurusProductReviews = require('./third-party/components/MyappgurusProdu
|
|
|
207
207
|
var HulkProductOptions = require('./third-party/components/HulkProductOptions.js');
|
|
208
208
|
var TrustshopProductReviews = require('./third-party/components/TrustshopProductReviews.js');
|
|
209
209
|
var StellarDeliveryDatePickup = require('./third-party/components/StellarDeliveryDatePickup.js');
|
|
210
|
+
var EssentialCountdownTimerBar = require('./third-party/components/EssentialCountdownTimerBar.js');
|
|
211
|
+
var EssentialAnnouncementBar = require('./third-party/components/EssentialAnnouncementBar.js');
|
|
210
212
|
var index$x = require('./third-party-instant/setting/index.js');
|
|
211
213
|
var InstantJudgemeReviews = require('./third-party-instant/components/InstantJudgemeReviews.js');
|
|
212
214
|
var InstantLooxReviews = require('./third-party-instant/components/InstantLooxReviews.js');
|
|
@@ -516,6 +518,8 @@ exports.MyappgurusProductReviews = MyappgurusProductReviews.default;
|
|
|
516
518
|
exports.HulkProductOptions = HulkProductOptions.default;
|
|
517
519
|
exports.TrustshopProductReviews = TrustshopProductReviews.default;
|
|
518
520
|
exports.StellarDeliveryDatePickup = StellarDeliveryDatePickup.default;
|
|
521
|
+
exports.EssentialCountdownTimerBar = EssentialCountdownTimerBar.default;
|
|
522
|
+
exports.EssentialAnnouncementBar = EssentialAnnouncementBar.default;
|
|
519
523
|
exports.thirdPartyInstantSetting = index$x.default;
|
|
520
524
|
exports.InstantJudgemeReviews = InstantJudgemeReviews.default;
|
|
521
525
|
exports.InstantLooxReviews = InstantLooxReviews.default;
|
package/dist/cjs/index.liquid.js
CHANGED
|
@@ -161,6 +161,8 @@ var DiscountyBulkDiscountSales_liquid = require('./third-party/components/Discou
|
|
|
161
161
|
var TrustreviewsProductReviews_liquid = require('./third-party/components/TrustreviewsProductReviews.liquid.js');
|
|
162
162
|
var MyappgurusProductReviews_liquid = require('./third-party/components/MyappgurusProductReviews.liquid.js');
|
|
163
163
|
var HulkProductOptions_liquid = require('./third-party/components/HulkProductOptions.liquid.js');
|
|
164
|
+
var EssentialCountdownTimerBar_liquid = require('./third-party/components/EssentialCountdownTimerBar.liquid.js');
|
|
165
|
+
var EssentialAnnouncementBar_liquid = require('./third-party/components/EssentialAnnouncementBar.liquid.js');
|
|
164
166
|
var TrustshopProductReviews_liquid = require('./third-party/components/TrustshopProductReviews.liquid.js');
|
|
165
167
|
var StellarDeliveryDatePickup_liquid = require('./third-party/components/StellarDeliveryDatePickup.liquid.js');
|
|
166
168
|
var ImageComparison_liquid = require('./image-comparison/components/ImageComparison.liquid.js');
|
|
@@ -346,6 +348,8 @@ exports.DiscountyBulkDiscountSales = DiscountyBulkDiscountSales_liquid.default;
|
|
|
346
348
|
exports.TrustreviewsProductReviews = TrustreviewsProductReviews_liquid.default;
|
|
347
349
|
exports.MyappgurusProductReviews = MyappgurusProductReviews_liquid.default;
|
|
348
350
|
exports.HulkProductOptions = HulkProductOptions_liquid.default;
|
|
351
|
+
exports.EssentialCountdownTimerBar = EssentialCountdownTimerBar_liquid.default;
|
|
352
|
+
exports.EssentialAnnouncementBar = EssentialAnnouncementBar_liquid.default;
|
|
349
353
|
exports.TrustshopProductReviews = TrustshopProductReviews_liquid.default;
|
|
350
354
|
exports.StellarDeliveryDatePickup = StellarDeliveryDatePickup_liquid.default;
|
|
351
355
|
exports.ImageComparison = ImageComparison_liquid.default;
|
|
@@ -6,26 +6,29 @@ 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 Text = require('../../text/Text.js');
|
|
9
|
+
var useDynamicProduct = require('../hooks/useDynamicProduct.js');
|
|
9
10
|
|
|
10
11
|
const PostPurchaseProductDiscountTag = ({ setting = {}, styles = {}, style, builderAttrs, builderProps, children })=>{
|
|
11
12
|
const currentProduct = core.useProduct();
|
|
12
13
|
const currentProductId = currentProduct?.baseID?.replace('gid://shopify/Product/', '');
|
|
13
14
|
const currentOfferDiscount = core.useProductOfferDiscount();
|
|
15
|
+
const { isDynamicProduct, isEnableDynamicDiscount } = useDynamicProduct.useDynamicProduct();
|
|
14
16
|
const { typo } = styles;
|
|
15
17
|
const { message } = setting;
|
|
18
|
+
const hasDiscount = !!currentOfferDiscount || isDynamicProduct && isEnableDynamicDiscount;
|
|
16
19
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
17
20
|
...builderAttrs,
|
|
18
21
|
className: core.cls(builderProps?.uid, 'gp-flex gp-w-full'),
|
|
19
22
|
style: {
|
|
20
23
|
...style,
|
|
21
|
-
opacity:
|
|
24
|
+
opacity: hasDiscount ? 1 : 0.2
|
|
22
25
|
},
|
|
23
26
|
id: `shopify-text-element-${builderProps?.uid}`,
|
|
24
27
|
"data-product-id": currentProductId,
|
|
25
28
|
children: [
|
|
26
29
|
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
27
30
|
setting: {
|
|
28
|
-
text:
|
|
31
|
+
text: hasDiscount ? message : message?.replace(new RegExp(/\{\{Discount\}\}/, 'gi'), '0%')
|
|
29
32
|
},
|
|
30
33
|
styles: {
|
|
31
34
|
typo
|
|
@@ -12,14 +12,20 @@ var Loading = require('../../../common/components/Loading.js');
|
|
|
12
12
|
var ProductVariant = require('./ProductVariant.js');
|
|
13
13
|
var helper = require('../../utils/helper.js');
|
|
14
14
|
var index = require('../helpers/index.js');
|
|
15
|
+
var ProductOfferPlaceholder = require('../constants/ProductOfferPlaceholder.js');
|
|
16
|
+
var useDynamicProduct = require('../hooks/useDynamicProduct.js');
|
|
15
17
|
|
|
16
18
|
const PostPurchaseProductOffer = ({ styles, builderAttrs, builderProps, children, setting })=>{
|
|
17
19
|
const mode = core.useEditorMode();
|
|
18
|
-
const { productSetting, productOfferLayout, inlineAlignment, variantSelected, ...rowSetting } = setting || {};
|
|
20
|
+
const { productSetting, productOfferLayout, inlineAlignment, variantSelected, discountAndShippingFee, ...rowSetting } = setting || {};
|
|
19
21
|
const { productOfferColumnGap, productOfferVerticalGutter, productOfferWidth, ...rowStyles } = styles || {};
|
|
20
22
|
const productOffers = core.usePageStore((s)=>s.productOffers);
|
|
21
23
|
const publicStoreFrontData = core.usePageStore((s)=>s.publicStoreFrontData);
|
|
22
|
-
const
|
|
24
|
+
const { isDynamicProduct } = useDynamicProduct.useDynamicProduct();
|
|
25
|
+
const dynamicDiscountOffer = core.usePageStore((s)=>s.dynamicDiscountOffer);
|
|
26
|
+
const totalProduct = React.useMemo(()=>isDynamicProduct ? dynamicDiscountOffer?.appliedProductCount : productOffers?.length, [
|
|
27
|
+
dynamicDiscountOffer?.appliedProductCount,
|
|
28
|
+
isDynamicProduct,
|
|
23
29
|
productOffers?.length
|
|
24
30
|
]);
|
|
25
31
|
const sortedProductBaseIDs = React.useMemo(()=>{
|
|
@@ -45,7 +51,14 @@ const PostPurchaseProductOffer = ({ styles, builderAttrs, builderProps, children
|
|
|
45
51
|
const products = React.useMemo(()=>core.flattenConnection(productData.data?.products), [
|
|
46
52
|
productData.data?.products
|
|
47
53
|
]);
|
|
48
|
-
const productSortedById =
|
|
54
|
+
const productSortedById = React.useMemo(()=>{
|
|
55
|
+
return isDynamicProduct && dynamicDiscountOffer?.appliedProductCount ? Array(dynamicDiscountOffer.appliedProductCount).fill(ProductOfferPlaceholder.productOfferPlaceholder) : sortedProductBaseIDs?.map((id)=>products?.find((el)=>el?.baseID === id)).filter(Boolean);
|
|
56
|
+
}, [
|
|
57
|
+
isDynamicProduct,
|
|
58
|
+
dynamicDiscountOffer?.appliedProductCount,
|
|
59
|
+
sortedProductBaseIDs,
|
|
60
|
+
products
|
|
61
|
+
]);
|
|
49
62
|
const getStyles = ()=>{
|
|
50
63
|
return {
|
|
51
64
|
...core.makeStyleResponsive('cg', productOfferColumnGap),
|
|
@@ -7,6 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var Text = require('../../text/Text.js');
|
|
10
|
+
var useDynamicProduct = require('../hooks/useDynamicProduct.js');
|
|
10
11
|
|
|
11
12
|
const PostPurchaseProductPrice = ({ styles, style, builderAttrs, builderProps, children })=>{
|
|
12
13
|
const currentVariant = core.useCurrentVariant();
|
|
@@ -14,6 +15,7 @@ const PostPurchaseProductPrice = ({ styles, style, builderAttrs, builderProps, c
|
|
|
14
15
|
const price = currentVariant?.price ?? 0;
|
|
15
16
|
const salePrice = currentVariant?.salePrice ?? 0;
|
|
16
17
|
const discount = parseFloat(core.shopifyPriceRounding(core.useProductOfferDiscount(), 2));
|
|
18
|
+
const { isDynamicProduct } = useDynamicProduct.useDynamicProduct();
|
|
17
19
|
const priceShow = React.useMemo(()=>{
|
|
18
20
|
if (!discount) {
|
|
19
21
|
if (styles?.priceType === 'compare') {
|
|
@@ -54,7 +56,7 @@ const PostPurchaseProductPrice = ({ styles, style, builderAttrs, builderProps, c
|
|
|
54
56
|
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
55
57
|
styles: styles,
|
|
56
58
|
setting: {
|
|
57
|
-
text: moneyFormatted
|
|
59
|
+
text: isDynamicProduct ? '$???' : moneyFormatted
|
|
58
60
|
},
|
|
59
61
|
className: core.cls({
|
|
60
62
|
'gp-money': styles?.priceType === 'regular',
|
|
@@ -8,6 +8,7 @@ var core = require('@gem-sdk/core');
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var helper = require('../../utils/helper.js');
|
|
10
10
|
var MoneyLine = require('./priceBreakdown/MoneyLine.js');
|
|
11
|
+
var useDynamicProduct = require('../hooks/useDynamicProduct.js');
|
|
11
12
|
|
|
12
13
|
const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, builderAttrs, builderProps, children })=>{
|
|
13
14
|
const currentVariant = core.useCurrentVariant();
|
|
@@ -22,6 +23,7 @@ const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, b
|
|
|
22
23
|
const discountShopifyFormat = core.shopifyPriceRounding(discountWithQuantity, 2);
|
|
23
24
|
const totalMoneyFormatted = core.useFormatMoney(subTotal - parseFloat(discountShopifyFormat), false);
|
|
24
25
|
const currentProductId = currentProduct?.baseID?.replace('gid://shopify/Product/', '');
|
|
26
|
+
const { isDynamicProduct, dynamicPrice, dynamicDiscount, isEnableDynamicDiscount } = useDynamicProduct.useDynamicProduct();
|
|
25
27
|
const { labelStyle, moneyStyle, spacing, width, align, isShowPrice } = styles;
|
|
26
28
|
const itemGap = React.useMemo(()=>{
|
|
27
29
|
return helper.postPurchaseSpacing[spacing || 'none'];
|
|
@@ -34,19 +36,19 @@ const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, b
|
|
|
34
36
|
}, [
|
|
35
37
|
isShowPrice
|
|
36
38
|
]);
|
|
37
|
-
const
|
|
39
|
+
const getMoneyLines = ()=>{
|
|
38
40
|
const data = [];
|
|
39
41
|
if (styles.isShowSubTotalLabel !== false) {
|
|
40
42
|
data.push({
|
|
41
43
|
title: setting.subTotalLabel,
|
|
42
|
-
money: subTotalMoneyFormatted,
|
|
44
|
+
money: isDynamicProduct ? dynamicPrice : subTotalMoneyFormatted,
|
|
43
45
|
uniqueId: 'subTotalLabel'
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
48
|
if (styles.isShowDiscountLabel !== false) {
|
|
47
49
|
data.push({
|
|
48
50
|
title: setting.discountLabel,
|
|
49
|
-
money: discount > 0 ? discountMoneyFormatted : 'No discount',
|
|
51
|
+
money: isDynamicProduct && dynamicDiscount && isEnableDynamicDiscount ? `${dynamicDiscount.value}%` : discount > 0 ? discountMoneyFormatted : 'No discount',
|
|
50
52
|
uniqueId: 'discountLabel'
|
|
51
53
|
});
|
|
52
54
|
}
|
|
@@ -72,25 +74,11 @@ const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, b
|
|
|
72
74
|
}
|
|
73
75
|
data.push({
|
|
74
76
|
title: setting.totalLabel,
|
|
75
|
-
money: totalMoneyFormatted,
|
|
77
|
+
money: isDynamicProduct ? dynamicPrice : totalMoneyFormatted,
|
|
76
78
|
uniqueId: 'totalLabel'
|
|
77
79
|
});
|
|
78
80
|
return data;
|
|
79
|
-
}
|
|
80
|
-
discount,
|
|
81
|
-
discountMoneyFormatted,
|
|
82
|
-
setting.discountLabel,
|
|
83
|
-
setting.shippingLabel,
|
|
84
|
-
setting.subTotalLabel,
|
|
85
|
-
setting.taxesLabel,
|
|
86
|
-
setting.totalLabel,
|
|
87
|
-
styles.isShowSubTotalLabel,
|
|
88
|
-
styles.isShowDiscountLabel,
|
|
89
|
-
styles.isShowShippingLabel,
|
|
90
|
-
styles.isShowTaxesLabel,
|
|
91
|
-
subTotalMoneyFormatted,
|
|
92
|
-
totalMoneyFormatted
|
|
93
|
-
]);
|
|
81
|
+
};
|
|
94
82
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
95
83
|
children: [
|
|
96
84
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
@@ -141,9 +129,9 @@ const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, b
|
|
|
141
129
|
...core.makeStyleResponsive('w', width),
|
|
142
130
|
gap: itemGap
|
|
143
131
|
},
|
|
144
|
-
children:
|
|
132
|
+
children: getMoneyLines().map((item)=>/*#__PURE__*/ jsxRuntime.jsxs(React.Fragment, {
|
|
145
133
|
children: [
|
|
146
|
-
item.uniqueId === 'totalLabel' &&
|
|
134
|
+
item.uniqueId === 'totalLabel' && getMoneyLines().length > 1 && /*#__PURE__*/ jsxRuntime.jsx("hr", {}),
|
|
147
135
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
148
136
|
children: /*#__PURE__*/ jsxRuntime.jsx(MoneyLine.default, {
|
|
149
137
|
uniqueId: item.uniqueId,
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const productOfferPlaceholder = {
|
|
4
|
+
id: '',
|
|
5
|
+
title: 'Dynamic product',
|
|
6
|
+
description: 'This is a dynamic product. The actual product will appear here based on your setup',
|
|
7
|
+
descriptionHtml: '<p class="QN2lPu">This is a dynamic product. The actual product will</p>\n<p class="QN2lPu">appear here based on your setup</p>',
|
|
8
|
+
createdAt: '2024-07-01T04:19:51.286753Z',
|
|
9
|
+
handle: 'dynamic-product',
|
|
10
|
+
averageRating: 0,
|
|
11
|
+
isStorefront: true,
|
|
12
|
+
isSample: false,
|
|
13
|
+
baseID: '',
|
|
14
|
+
sku: '',
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
id: '1',
|
|
18
|
+
name: 'Variant',
|
|
19
|
+
optionType: '',
|
|
20
|
+
values: [
|
|
21
|
+
{
|
|
22
|
+
id: '1',
|
|
23
|
+
label: 'Variant option',
|
|
24
|
+
isDefault: true,
|
|
25
|
+
baseID: ''
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
vendor: '',
|
|
31
|
+
featuredImage: {
|
|
32
|
+
id: '542178560626918105',
|
|
33
|
+
contentType: 'IMAGE',
|
|
34
|
+
previewImage: '',
|
|
35
|
+
src: 'https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png',
|
|
36
|
+
width: 449,
|
|
37
|
+
height: 449,
|
|
38
|
+
alt: ''
|
|
39
|
+
},
|
|
40
|
+
collections: {
|
|
41
|
+
edges: [
|
|
42
|
+
{
|
|
43
|
+
node: {
|
|
44
|
+
id: '502321959132988135',
|
|
45
|
+
title: 'Home page'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
node: {
|
|
50
|
+
id: '539286505089204764',
|
|
51
|
+
title: 'b'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
node: {
|
|
56
|
+
id: '539286505089401372',
|
|
57
|
+
title: 'e'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
tags: [],
|
|
63
|
+
medias: {
|
|
64
|
+
edges: [
|
|
65
|
+
{
|
|
66
|
+
cursor: 'gqFpzweGNIc/AALZoXYB',
|
|
67
|
+
node: {
|
|
68
|
+
id: '542178560626918105',
|
|
69
|
+
contentType: 'IMAGE',
|
|
70
|
+
previewImage: '',
|
|
71
|
+
src: 'https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png',
|
|
72
|
+
width: 449,
|
|
73
|
+
height: 449,
|
|
74
|
+
alt: ''
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
pageInfo: {
|
|
79
|
+
endCursor: 'gqFpzweGNIc/AALZoXYB',
|
|
80
|
+
hasNextPage: true
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
variants: {
|
|
84
|
+
edges: [
|
|
85
|
+
{
|
|
86
|
+
cursor: 'gqFpzwc5ZqRtDAMIoXYC',
|
|
87
|
+
node: {
|
|
88
|
+
id: '520560088328176392',
|
|
89
|
+
title: 'Default Title',
|
|
90
|
+
barcode: '',
|
|
91
|
+
baseID: 'gid://shopify/ProductVariant/49298248925463',
|
|
92
|
+
costPrice: 88,
|
|
93
|
+
height: 0,
|
|
94
|
+
inventoryPolicy: 'DENY',
|
|
95
|
+
inventoryQuantity: 211,
|
|
96
|
+
inventoryStatus: '',
|
|
97
|
+
isDigital: true,
|
|
98
|
+
length: 0,
|
|
99
|
+
lowInventoryAmount: 0,
|
|
100
|
+
manageInventory: false,
|
|
101
|
+
mediaId: '0',
|
|
102
|
+
platform: 'SHOPIFY',
|
|
103
|
+
price: 88,
|
|
104
|
+
salePrice: 88,
|
|
105
|
+
sku: '',
|
|
106
|
+
soldIndividually: false,
|
|
107
|
+
weight: 0,
|
|
108
|
+
width: 0,
|
|
109
|
+
selectedOptions: [],
|
|
110
|
+
media: undefined
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
cursor: 'gqFpzwc5ZqRtDAMIoXYC',
|
|
115
|
+
node: {
|
|
116
|
+
id: '520560088328176392',
|
|
117
|
+
title: 'Default Title',
|
|
118
|
+
barcode: '',
|
|
119
|
+
baseID: 'gid://shopify/ProductVariant/49298248925463',
|
|
120
|
+
costPrice: 88,
|
|
121
|
+
height: 0,
|
|
122
|
+
inventoryPolicy: 'DENY',
|
|
123
|
+
inventoryQuantity: 211,
|
|
124
|
+
inventoryStatus: '',
|
|
125
|
+
isDigital: true,
|
|
126
|
+
length: 0,
|
|
127
|
+
lowInventoryAmount: 0,
|
|
128
|
+
manageInventory: false,
|
|
129
|
+
mediaId: '0',
|
|
130
|
+
platform: 'SHOPIFY',
|
|
131
|
+
price: 88,
|
|
132
|
+
salePrice: 88,
|
|
133
|
+
sku: '',
|
|
134
|
+
soldIndividually: false,
|
|
135
|
+
weight: 0,
|
|
136
|
+
width: 0,
|
|
137
|
+
selectedOptions: [],
|
|
138
|
+
media: undefined
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
pageInfo: {
|
|
143
|
+
hasNextPage: false,
|
|
144
|
+
endCursor: 'gaFpzwc5ZqRtDAMI'
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
exports.productOfferPlaceholder = productOfferPlaceholder;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
const useDynamicProduct = ()=>{
|
|
7
|
+
const dynamicDiscountOffer = core.usePageStore((s)=>s.dynamicDiscountOffer);
|
|
8
|
+
const isDynamicProduct = React.useMemo(()=>{
|
|
9
|
+
return !!dynamicDiscountOffer;
|
|
10
|
+
}, [
|
|
11
|
+
dynamicDiscountOffer
|
|
12
|
+
]);
|
|
13
|
+
// false = No discount
|
|
14
|
+
const isEnableDynamicDiscount = React.useMemo(()=>{
|
|
15
|
+
return dynamicDiscountOffer?.isEnabled;
|
|
16
|
+
}, [
|
|
17
|
+
dynamicDiscountOffer
|
|
18
|
+
]);
|
|
19
|
+
const dynamicPrice = '$???';
|
|
20
|
+
return {
|
|
21
|
+
isDynamicProduct,
|
|
22
|
+
dynamicPrice,
|
|
23
|
+
dynamicDiscount: dynamicDiscountOffer,
|
|
24
|
+
isEnableDynamicDiscount
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.useDynamicProduct = useDynamicProduct;
|
|
@@ -184,6 +184,14 @@ const config = {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
|
+
{
|
|
188
|
+
id: 'dynamicOfferQuantity',
|
|
189
|
+
type: 'dynamic-offer-quantity',
|
|
190
|
+
min: 1,
|
|
191
|
+
max: 4,
|
|
192
|
+
default: 2,
|
|
193
|
+
isOnlyAcceptInteger: true
|
|
194
|
+
},
|
|
187
195
|
{
|
|
188
196
|
id: 'discountAndShippingFee',
|
|
189
197
|
type: 'discount-and-shipping-fee-product-offer',
|
|
@@ -377,6 +385,24 @@ const config = {
|
|
|
377
385
|
},
|
|
378
386
|
layout: 'vertical'
|
|
379
387
|
},
|
|
388
|
+
{
|
|
389
|
+
type: 'group',
|
|
390
|
+
label: {
|
|
391
|
+
en: 'Product offers'
|
|
392
|
+
},
|
|
393
|
+
controls: [
|
|
394
|
+
{
|
|
395
|
+
type: 'control',
|
|
396
|
+
label: {
|
|
397
|
+
en: 'Quantity'
|
|
398
|
+
},
|
|
399
|
+
setting: {
|
|
400
|
+
id: 'dynamicOfferQuantity'
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
condition: 'false'
|
|
405
|
+
},
|
|
380
406
|
{
|
|
381
407
|
type: 'control',
|
|
382
408
|
label: {
|
|
@@ -48,9 +48,9 @@ const ProductBundleDiscountItem = ({ children, parentSetting, parentStyles, inde
|
|
|
48
48
|
return selected === i;
|
|
49
49
|
};
|
|
50
50
|
return core.template`
|
|
51
|
-
<
|
|
51
|
+
<gp-product-bundle-discount-item
|
|
52
52
|
${bundleItem}
|
|
53
|
-
class="product-bundle-item cursor-pointer"
|
|
53
|
+
class="product-bundle-item cursor-pointer gp-block"
|
|
54
54
|
style="${{
|
|
55
55
|
...sizeSettings.padding,
|
|
56
56
|
...core.makeStyleState('bg', parentStyles?.backgroundColor),
|
|
@@ -96,7 +96,7 @@ const ProductBundleDiscountItem = ({ children, parentSetting, parentStyles, inde
|
|
|
96
96
|
${children}
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
99
|
-
</
|
|
99
|
+
</gp-product-bundle-discount-item>
|
|
100
100
|
`;
|
|
101
101
|
};
|
|
102
102
|
|
|
@@ -81,7 +81,7 @@ const VariantItem = ({ name, variantKey, optionName, optionValue, ...props })=>{
|
|
|
81
81
|
htmlFor: `${props.uid}-${variantKey}`,
|
|
82
82
|
children: [
|
|
83
83
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
84
|
-
className: "gp-invisible !gp-max-w-[150px] gp-left-[50%] gp-translate-x-[-50%] gp-translate-y-0 gp-absolute gp-bottom-[calc(100%+20px)] gp-text-[12px] group-hover:gp-visible gp-w-max gp-bg-[#333333] gp-text-[#F9F9F9] gp-px-[8px] gp-py-[4px] gp-rounded-[8px] gp-mb-[-10px] after:gp-content-[''] after:gp-absolute after:gp-p-[7px] after:gp-left-0 after:gp-w-full after:gp-bottom-[-10px]",
|
|
84
|
+
className: "gp-invisible !gp-max-w-[0px] lg:!gp-max-w-[150px] gp-left-[50%] gp-translate-x-[-50%] gp-translate-y-0 gp-absolute gp-bottom-[calc(100%+20px)] gp-text-[12px] group-hover:gp-visible gp-w-max gp-bg-[#333333] gp-text-[#F9F9F9] gp-px-[0px] lg:gp-px-[8px] gp-py-[4px] gp-rounded-[8px] gp-mb-[-10px] after:gp-content-[''] after:gp-absolute after:gp-p-[0px] lg:after:gp-p-[7px] after:gp-left-0 after:gp-w-full after:gp-bottom-[-10px]",
|
|
85
85
|
children: [
|
|
86
86
|
/*#__PURE__*/ jsxRuntime.jsx("p", {
|
|
87
87
|
className: "gp-text-[#F9F9F9]",
|
|
@@ -120,7 +120,7 @@ const VariantItem = ({ name, variantKey, value, id, activeClass, optionPosition,
|
|
|
120
120
|
for="{{product.id}}-${props.uid}-${variantKey}"
|
|
121
121
|
class="gp-group gp-relative option-item gp-child-item-${props.uid}"
|
|
122
122
|
>
|
|
123
|
-
<div class="gp-invisible !gp-max-w-[150px] gp-left-[50%] gp-translate-x-[-50%] gp-translate-y-0 gp-absolute gp-bottom-[calc(100%+20px)] gp-text-[12px] group-hover:gp-visible gp-w-max gp-bg-[#333333] gp-text-[#F9F9F9] gp-px-[8px] gp-py-[4px] gp-rounded-[8px] gp-mb-[-10px] after:gp-content-[''] after:gp-absolute after:gp-p-[7px] after:gp-left-0 after:gp-w-full after:gp-bottom-[-10px]">
|
|
123
|
+
<div class="gp-invisible !gp-max-w-[0px] lg:!gp-max-w-[150px] gp-left-[50%] gp-translate-x-[-50%] gp-translate-y-0 gp-absolute gp-bottom-[calc(100%+20px)] gp-text-[12px] group-hover:gp-visible gp-w-max gp-bg-[#333333] gp-text-[#F9F9F9] gp-px-[0px] lg:gp-px-[8px] gp-py-[4px] gp-rounded-[8px] gp-mb-[-10px] after:gp-content-[''] after:gp-absolute after:gp-p-[0px] lg:after:gp-p-[7px] after:gp-left-0 after:gp-w-full after:gp-bottom-[-10px]">
|
|
124
124
|
<p class="gp-text-[#F9F9F9]">${value?.label}</p>
|
|
125
125
|
<svg class="gp-absolute gp-left-[50%] gp-translate-x-[-50%] gp-translate-y-0 gp-z-10 gp-bottom-[-4px]" width="8" height="4" viewBox="0 0 16 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
126
126
|
<path d="M8 10L0 0L16 1.41326e-06L8 10Z" fill="#333333"/>
|
|
@@ -0,0 +1,33 @@
|
|
|
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 ThirdPartyPreview = require('./ThirdPartyPreview.js');
|
|
9
|
+
var EssentialAnnouncementBar$1 = require('../configs/EssentialAnnouncementBar.js');
|
|
10
|
+
|
|
11
|
+
const EssentialAnnouncementBarContent = ()=>{
|
|
12
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
13
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
14
|
+
className: "gp-p-2",
|
|
15
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ThirdPartyPreview.default, {
|
|
16
|
+
setting: {
|
|
17
|
+
label: 'Essential Announcement Bar',
|
|
18
|
+
iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${EssentialAnnouncementBar$1.default.logoUrl}">`
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const EssentialAnnouncementBar = ({ setting })=>{
|
|
25
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
26
|
+
style: {
|
|
27
|
+
...core.makeStyleResponsive('ta', setting?.align)
|
|
28
|
+
},
|
|
29
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(EssentialAnnouncementBarContent, {})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.default = EssentialAnnouncementBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var thirdParty = require('../helpers/thirdParty.js');
|
|
6
|
+
|
|
7
|
+
const EssentialAnnouncementBar = ({ setting, advanced })=>{
|
|
8
|
+
const { align, appBlockId } = setting ?? {};
|
|
9
|
+
return thirdParty.getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block `);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.default = EssentialAnnouncementBar;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 ThirdPartyPreview = require('./ThirdPartyPreview.js');
|
|
9
|
+
var EssentialCountdownTimerBar$1 = require('../configs/EssentialCountdownTimerBar.js');
|
|
10
|
+
|
|
11
|
+
const EssentialCountdownTimerBarContent = ()=>{
|
|
12
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
13
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
14
|
+
className: "gp-p-2",
|
|
15
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ThirdPartyPreview.default, {
|
|
16
|
+
setting: {
|
|
17
|
+
label: 'Essential Countdown Timer Bar',
|
|
18
|
+
iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${EssentialCountdownTimerBar$1.default.logoUrl}">`
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const EssentialCountdownTimerBar = ({ setting })=>{
|
|
25
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
26
|
+
style: {
|
|
27
|
+
...core.makeStyleResponsive('ta', setting?.align)
|
|
28
|
+
},
|
|
29
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(EssentialCountdownTimerBarContent, {})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.default = EssentialCountdownTimerBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var thirdParty = require('../helpers/thirdParty.js');
|
|
6
|
+
|
|
7
|
+
const EssentialCountdownTimerBar = ({ setting, advanced })=>{
|
|
8
|
+
const { align, appBlockId } = setting ?? {};
|
|
9
|
+
return thirdParty.getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block `);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.default = EssentialCountdownTimerBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var AppConfig = {
|
|
6
|
+
id: 'essential-announcement-bar',
|
|
7
|
+
label: 'Essential Announcement Bar',
|
|
8
|
+
logoUrl: 'https://cdn.shopify.com/app-store/listing_images/15e8255158a042a1eab34a4c45c72aa5/icon/CMK1jPv9uoADEAE=.png',
|
|
9
|
+
tag: 'EssentialAnnouncementBar'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.default = AppConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var AppConfig = {
|
|
6
|
+
id: 'essential-countdown-timer-bar',
|
|
7
|
+
label: 'Essential Countdown Timer Bar',
|
|
8
|
+
logoUrl: 'https://cdn.shopify.com/app-store/listing_images/f84bf9e49eca8bd84c2af7488461363b/icon/CPzKxLTD4_UCEAE=.png',
|
|
9
|
+
tag: 'EssentialCountdownTimerBar'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.default = AppConfig;
|
|
@@ -39,7 +39,7 @@ const getLiquidForAppBlock = (appBlockId, align, cssClass)=>{
|
|
|
39
39
|
<div
|
|
40
40
|
class="gp-flex gp-w-full gp-items-center ${cssClass}"
|
|
41
41
|
style="${{
|
|
42
|
-
...core.makeStyleResponsive('
|
|
42
|
+
...core.makeStyleResponsive('jc', align)
|
|
43
43
|
}}"
|
|
44
44
|
>
|
|
45
45
|
{% for block in app_blocks %}
|