@lime-bundles/widget 4.6.0 → 4.6.2

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 CHANGED
@@ -43,6 +43,8 @@ function intlFormatMoney(currencyCode) {
43
43
  }
44
44
  var BUNDLE_GID_ATTRIBUTE = "_lime_bundle_gid";
45
45
  var BUNDLE_TYPE_ATTRIBUTE = "_lime_bundle_type";
46
+ var BUNDLE_ROLE_ATTRIBUTE = "_lime_bundle_role";
47
+ var BUNDLE_ROLE_GET = "get";
46
48
  function bundleLineAttributes(bundleGid, bundleType) {
47
49
  return [
48
50
  { key: BUNDLE_GID_ATTRIBUTE, value: bundleGid },
@@ -3170,7 +3172,8 @@ function buildBogoCartItems(sides, percent, buyQty, getQty) {
3170
3172
  {
3171
3173
  variantId: Number(sides[1].selectedVariantId),
3172
3174
  quantity: getQty,
3173
- priceCents: getPriceCents
3175
+ priceCents: getPriceCents,
3176
+ attributes: [{ key: BUNDLE_ROLE_ATTRIBUTE, value: BUNDLE_ROLE_GET }]
3174
3177
  }
3175
3178
  ];
3176
3179
  }
@@ -3195,18 +3198,20 @@ function renderBogoBundle(container, bundle, onAddToCart, onCleanup) {
3195
3198
  productQuantities: bundle.productQuantities,
3196
3199
  variantQuantities: bundle.variantQuantities
3197
3200
  };
3201
+ const buyAllowed = bundle.buyVariantIds?.length ? bundle.buyVariantIds : null;
3202
+ const getAllowed = bundle.getVariantIds?.length ? bundle.getVariantIds : null;
3198
3203
  const sides = [
3199
3204
  {
3200
3205
  ...adaptProduct(buyProduct, bundle.id, {
3201
3206
  quantities,
3202
- allowedVariantIds: bundle.selectedVariantIds?.[0] ?? null
3207
+ allowedVariantIds: buyAllowed
3203
3208
  }),
3204
3209
  role: "buy"
3205
3210
  },
3206
3211
  {
3207
3212
  ...adaptProduct(getProduct, bundle.id, {
3208
3213
  quantities,
3209
- allowedVariantIds: bundle.selectedVariantIds?.[1] ?? null
3214
+ allowedVariantIds: getAllowed
3210
3215
  }),
3211
3216
  role: "get"
3212
3217
  }
@@ -3268,7 +3273,12 @@ function renderBogoBundle(container, bundle, onAddToCart, onCleanup) {
3268
3273
  buildBogoCartItems(sides, percent, buyQty, getQty).map((item) => ({
3269
3274
  merchandiseId: "gid://shopify/ProductVariant/" + item.variantId,
3270
3275
  quantity: item.quantity,
3271
- attributes: bundleLineAttributes(bundle.id, bundle.bundleType)
3276
+ // Per-line extras (the reward marker) on top of the attribution
3277
+ // every line carries.
3278
+ attributes: [
3279
+ ...bundleLineAttributes(bundle.id, bundle.bundleType),
3280
+ ...item.attributes ?? []
3281
+ ]
3272
3282
  }))
3273
3283
  );
3274
3284
  });
@@ -4352,8 +4362,10 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
4352
4362
  internally (with the .lb-edge-fade treatment) when content exceeds
4353
4363
  this. */
4354
4364
  --lb-list-max-height: 360px;
4355
- /* Depth of the soft fade at a scroll list's clipped edge. */
4356
- --lb-edge-fade-size: 20px;
4365
+ /* Depth of the soft fade at a scroll list's clipped edge. Sized to dim
4366
+ roughly half of the peeking product row (~90px tall): at 20px shoppers
4367
+ read the cut as the end of the list and missed the products below. */
4368
+ --lb-edge-fade-size: 48px;
4357
4369
  /* Derived "small" corner radius for chips and badges \u2014 the low-stock badge,
4358
4370
  the volume tier badge, the multi-step count chip. Controls and media
4359
4371
  (thumbnails, selects, steppers, buttons) take the full --lb-radius: they
package/dist/index.js CHANGED
@@ -37,6 +37,8 @@ function intlFormatMoney(currencyCode) {
37
37
  }
38
38
  var BUNDLE_GID_ATTRIBUTE = "_lime_bundle_gid";
39
39
  var BUNDLE_TYPE_ATTRIBUTE = "_lime_bundle_type";
40
+ var BUNDLE_ROLE_ATTRIBUTE = "_lime_bundle_role";
41
+ var BUNDLE_ROLE_GET = "get";
40
42
  function bundleLineAttributes(bundleGid, bundleType) {
41
43
  return [
42
44
  { key: BUNDLE_GID_ATTRIBUTE, value: bundleGid },
@@ -3176,7 +3178,8 @@ function buildBogoCartItems(sides, percent, buyQty, getQty) {
3176
3178
  {
3177
3179
  variantId: Number(sides[1].selectedVariantId),
3178
3180
  quantity: getQty,
3179
- priceCents: getPriceCents
3181
+ priceCents: getPriceCents,
3182
+ attributes: [{ key: BUNDLE_ROLE_ATTRIBUTE, value: BUNDLE_ROLE_GET }]
3180
3183
  }
3181
3184
  ];
3182
3185
  }
@@ -3201,18 +3204,20 @@ function renderBogoBundle(container, bundle, onAddToCart, onCleanup) {
3201
3204
  productQuantities: bundle.productQuantities,
3202
3205
  variantQuantities: bundle.variantQuantities
3203
3206
  };
3207
+ const buyAllowed = bundle.buyVariantIds?.length ? bundle.buyVariantIds : null;
3208
+ const getAllowed = bundle.getVariantIds?.length ? bundle.getVariantIds : null;
3204
3209
  const sides = [
3205
3210
  {
3206
3211
  ...adaptProduct(buyProduct, bundle.id, {
3207
3212
  quantities,
3208
- allowedVariantIds: bundle.selectedVariantIds?.[0] ?? null
3213
+ allowedVariantIds: buyAllowed
3209
3214
  }),
3210
3215
  role: "buy"
3211
3216
  },
3212
3217
  {
3213
3218
  ...adaptProduct(getProduct, bundle.id, {
3214
3219
  quantities,
3215
- allowedVariantIds: bundle.selectedVariantIds?.[1] ?? null
3220
+ allowedVariantIds: getAllowed
3216
3221
  }),
3217
3222
  role: "get"
3218
3223
  }
@@ -3274,7 +3279,12 @@ function renderBogoBundle(container, bundle, onAddToCart, onCleanup) {
3274
3279
  buildBogoCartItems(sides, percent, buyQty, getQty).map((item) => ({
3275
3280
  merchandiseId: "gid://shopify/ProductVariant/" + item.variantId,
3276
3281
  quantity: item.quantity,
3277
- attributes: bundleLineAttributes(bundle.id, bundle.bundleType)
3282
+ // Per-line extras (the reward marker) on top of the attribution
3283
+ // every line carries.
3284
+ attributes: [
3285
+ ...bundleLineAttributes(bundle.id, bundle.bundleType),
3286
+ ...item.attributes ?? []
3287
+ ]
3278
3288
  }))
3279
3289
  );
3280
3290
  });
@@ -4361,8 +4371,10 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
4361
4371
  internally (with the .lb-edge-fade treatment) when content exceeds
4362
4372
  this. */
4363
4373
  --lb-list-max-height: 360px;
4364
- /* Depth of the soft fade at a scroll list's clipped edge. */
4365
- --lb-edge-fade-size: 20px;
4374
+ /* Depth of the soft fade at a scroll list's clipped edge. Sized to dim
4375
+ roughly half of the peeking product row (~90px tall): at 20px shoppers
4376
+ read the cut as the end of the list and missed the products below. */
4377
+ --lb-edge-fade-size: 48px;
4366
4378
  /* Derived "small" corner radius for chips and badges \u2014 the low-stock badge,
4367
4379
  the volume tier badge, the multi-step count chip. Controls and media
4368
4380
  (thumbnails, selects, steppers, buttons) take the full --lb-radius: they