@lime-bundles/react 4.1.0 → 5.0.0
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/index.cjs +11 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +11 -13
- package/dist/index.js.map +1 -1
- package/docs/react-nextjs.md +14 -5
- package/docs/web-component.md +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,6 @@ __export(index_exports, {
|
|
|
30
30
|
VariantDropdown: () => VariantDropdown,
|
|
31
31
|
VolumeBundle: () => VolumeBundle,
|
|
32
32
|
WIDGET_CONFIG_DEFAULTS: () => import_core13.WIDGET_CONFIG_DEFAULTS,
|
|
33
|
-
applyABVariantB: () => import_core13.applyABVariantB,
|
|
34
33
|
applyWidgetConfigVars: () => import_core13.applyWidgetConfigVars,
|
|
35
34
|
calculateDiscount: () => import_core13.calculateDiscount,
|
|
36
35
|
calculateTierSavings: () => import_core13.calculateTierSavings,
|
|
@@ -40,12 +39,13 @@ __export(index_exports, {
|
|
|
40
39
|
fetchBundleData: () => fetchBundleData,
|
|
41
40
|
fetchBundlesForProduct: () => import_core13.fetchBundlesForProduct,
|
|
42
41
|
fetchShopCustomCss: () => fetchShopCustomCss,
|
|
42
|
+
fnv1a: () => import_core13.fnv1a,
|
|
43
43
|
formatCents: () => import_core13.formatCents,
|
|
44
44
|
formatCountdown: () => import_core13.formatCountdown,
|
|
45
45
|
formatMoney: () => import_core13.formatMoney,
|
|
46
46
|
formatUnitPrice: () => import_core13.formatUnitPrice,
|
|
47
|
-
getABTestAssignment: () => import_core13.getABTestAssignment,
|
|
48
47
|
getActiveTier: () => import_core13.getActiveTier,
|
|
48
|
+
getLinkGroupAssignment: () => import_core13.getLinkGroupAssignment,
|
|
49
49
|
hasConsent: () => import_core13.hasConsent,
|
|
50
50
|
injectCustomCss: () => import_core13.injectCustomCss,
|
|
51
51
|
mergeWidgetConfig: () => import_core13.mergeWidgetConfig,
|
|
@@ -54,6 +54,7 @@ __export(index_exports, {
|
|
|
54
54
|
parseMetaobjectBundle: () => import_core13.parseMetaobjectBundle,
|
|
55
55
|
parseMetaobjectBundleStrict: () => import_core13.parseMetaobjectBundleStrict,
|
|
56
56
|
percentageDiscountUnit: () => import_core13.percentageDiscountUnit,
|
|
57
|
+
pickVariantFromWeights: () => import_core13.pickVariantFromWeights,
|
|
57
58
|
reportAddToCart: () => import_core13.reportAddToCart,
|
|
58
59
|
reportImpression: () => import_core13.reportImpression,
|
|
59
60
|
sanitizeCustomCss: () => import_core13.sanitizeCustomCss,
|
|
@@ -230,7 +231,7 @@ function useAnalytics(options) {
|
|
|
230
231
|
);
|
|
231
232
|
(0, import_react2.useEffect)(() => {
|
|
232
233
|
impressionFiredRef.current = false;
|
|
233
|
-
}, [options.bundleGid
|
|
234
|
+
}, [options.bundleGid]);
|
|
234
235
|
(0, import_react2.useEffect)(() => {
|
|
235
236
|
if (options.enabled === false) return;
|
|
236
237
|
if (impressionFiredRef.current) return;
|
|
@@ -241,8 +242,7 @@ function useAnalytics(options) {
|
|
|
241
242
|
(0, import_core4.reportImpression)(config, {
|
|
242
243
|
bundleGid: options.bundleGid,
|
|
243
244
|
bundleType: options.bundleType,
|
|
244
|
-
|
|
245
|
-
abVariant: options.abVariant
|
|
245
|
+
linkGroupId: options.linkGroupId
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
248
|
return cleanup;
|
|
@@ -252,8 +252,7 @@ function useAnalytics(options) {
|
|
|
252
252
|
options.enabled,
|
|
253
253
|
options.bundleGid,
|
|
254
254
|
options.bundleType,
|
|
255
|
-
options.
|
|
256
|
-
options.abVariant
|
|
255
|
+
options.linkGroupId
|
|
257
256
|
]);
|
|
258
257
|
const trackAddToCart = (0, import_react2.useCallback)(
|
|
259
258
|
(event) => {
|
|
@@ -264,8 +263,7 @@ function useAnalytics(options) {
|
|
|
264
263
|
productId: event.productId,
|
|
265
264
|
quantity: event.quantity,
|
|
266
265
|
totalPrice: event.totalPrice,
|
|
267
|
-
|
|
268
|
-
abVariant: options.abVariant
|
|
266
|
+
linkGroupId: options.linkGroupId
|
|
269
267
|
});
|
|
270
268
|
},
|
|
271
269
|
[
|
|
@@ -273,8 +271,7 @@ function useAnalytics(options) {
|
|
|
273
271
|
options.enabled,
|
|
274
272
|
options.bundleGid,
|
|
275
273
|
options.bundleType,
|
|
276
|
-
options.
|
|
277
|
-
options.abVariant
|
|
274
|
+
options.linkGroupId
|
|
278
275
|
]
|
|
279
276
|
);
|
|
280
277
|
return { elementRef, trackAddToCart };
|
|
@@ -1552,7 +1549,6 @@ var import_core13 = require("@lime-bundles/core");
|
|
|
1552
1549
|
VariantDropdown,
|
|
1553
1550
|
VolumeBundle,
|
|
1554
1551
|
WIDGET_CONFIG_DEFAULTS,
|
|
1555
|
-
applyABVariantB,
|
|
1556
1552
|
applyWidgetConfigVars,
|
|
1557
1553
|
calculateDiscount,
|
|
1558
1554
|
calculateTierSavings,
|
|
@@ -1562,12 +1558,13 @@ var import_core13 = require("@lime-bundles/core");
|
|
|
1562
1558
|
fetchBundleData,
|
|
1563
1559
|
fetchBundlesForProduct,
|
|
1564
1560
|
fetchShopCustomCss,
|
|
1561
|
+
fnv1a,
|
|
1565
1562
|
formatCents,
|
|
1566
1563
|
formatCountdown,
|
|
1567
1564
|
formatMoney,
|
|
1568
1565
|
formatUnitPrice,
|
|
1569
|
-
getABTestAssignment,
|
|
1570
1566
|
getActiveTier,
|
|
1567
|
+
getLinkGroupAssignment,
|
|
1571
1568
|
hasConsent,
|
|
1572
1569
|
injectCustomCss,
|
|
1573
1570
|
mergeWidgetConfig,
|
|
@@ -1576,6 +1573,7 @@ var import_core13 = require("@lime-bundles/core");
|
|
|
1576
1573
|
parseMetaobjectBundle,
|
|
1577
1574
|
parseMetaobjectBundleStrict,
|
|
1578
1575
|
percentageDiscountUnit,
|
|
1576
|
+
pickVariantFromWeights,
|
|
1579
1577
|
reportAddToCart,
|
|
1580
1578
|
reportImpression,
|
|
1581
1579
|
sanitizeCustomCss,
|