@lime-bundles/widget 4.2.0 → 4.4.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.d.cts CHANGED
@@ -26,6 +26,10 @@ import { BuyerResolver } from '@lime-bundles/core';
26
26
  * 3. /products/<handle> segment of window.location.pathname
27
27
  * 4. fallthrough: renders nothing, fires `lime-bundle:error`
28
28
  *
29
+ * Multi-product renderers (volume) bind to the product this embed is
30
+ * standing on: the explicit `product-id` attribute wins, then the handle
31
+ * cascade above, then the bundle's first product when neither names one.
32
+ *
29
33
  * ## Add-to-cart behaviour
30
34
  *
31
35
  * Merchants who do nothing get a default: the widget calls Shopify's
@@ -92,6 +96,14 @@ declare class LimeBundleElement extends HTMLElement {
92
96
  private get storefrontToken();
93
97
  private get bundleGid();
94
98
  private get productHandleAttr();
99
+ /**
100
+ * The current product's id — full GID (`gid://shopify/Product/123`) or
101
+ * bare numeric id. Tells multi-product renderers (volume) which of the
102
+ * bundle's products this embed is standing on; takes precedence over the
103
+ * handle cascade. Without it (and with no resolvable handle) they bind to
104
+ * the bundle's first product.
105
+ */
106
+ private get productIdAttr();
95
107
  private get appUrl();
96
108
  private get analyticsEnabled();
97
109
  private get country();
@@ -128,6 +140,21 @@ declare class LimeBundleElement extends HTMLElement {
128
140
  * instead of creating a new one every click.
129
141
  */
130
142
  private defaultAddToCart;
143
+ /**
144
+ * Remove this widget's own earlier lines — the ones tagged with the
145
+ * `_lime_bundle_gid` attribute — from the saved cart, so a shopper who
146
+ * clicked add three times while deciding checks out with only what they
147
+ * just built. Lines without the tag were put in the cart by something
148
+ * else (the host site, a previous non-widget purchase flow) and are
149
+ * left alone.
150
+ *
151
+ * Returns the cart id when the cart is still usable. Returns null after
152
+ * calling `dropSavedCart` when it isn't: either the id no longer
153
+ * resolves (expired or merged on Shopify's side), or the removal itself
154
+ * failed — in both cases a fresh cart is the only way to guarantee the
155
+ * checkout matches the shopper's current build.
156
+ */
157
+ private clearAbandonedBundleLines;
131
158
  private reportAddToCartEvent;
132
159
  private renderBundles;
133
160
  private setupImpressionFor;
package/dist/index.d.ts CHANGED
@@ -26,6 +26,10 @@ import { BuyerResolver } from '@lime-bundles/core';
26
26
  * 3. /products/<handle> segment of window.location.pathname
27
27
  * 4. fallthrough: renders nothing, fires `lime-bundle:error`
28
28
  *
29
+ * Multi-product renderers (volume) bind to the product this embed is
30
+ * standing on: the explicit `product-id` attribute wins, then the handle
31
+ * cascade above, then the bundle's first product when neither names one.
32
+ *
29
33
  * ## Add-to-cart behaviour
30
34
  *
31
35
  * Merchants who do nothing get a default: the widget calls Shopify's
@@ -92,6 +96,14 @@ declare class LimeBundleElement extends HTMLElement {
92
96
  private get storefrontToken();
93
97
  private get bundleGid();
94
98
  private get productHandleAttr();
99
+ /**
100
+ * The current product's id — full GID (`gid://shopify/Product/123`) or
101
+ * bare numeric id. Tells multi-product renderers (volume) which of the
102
+ * bundle's products this embed is standing on; takes precedence over the
103
+ * handle cascade. Without it (and with no resolvable handle) they bind to
104
+ * the bundle's first product.
105
+ */
106
+ private get productIdAttr();
95
107
  private get appUrl();
96
108
  private get analyticsEnabled();
97
109
  private get country();
@@ -128,6 +140,21 @@ declare class LimeBundleElement extends HTMLElement {
128
140
  * instead of creating a new one every click.
129
141
  */
130
142
  private defaultAddToCart;
143
+ /**
144
+ * Remove this widget's own earlier lines — the ones tagged with the
145
+ * `_lime_bundle_gid` attribute — from the saved cart, so a shopper who
146
+ * clicked add three times while deciding checks out with only what they
147
+ * just built. Lines without the tag were put in the cart by something
148
+ * else (the host site, a previous non-widget purchase flow) and are
149
+ * left alone.
150
+ *
151
+ * Returns the cart id when the cart is still usable. Returns null after
152
+ * calling `dropSavedCart` when it isn't: either the id no longer
153
+ * resolves (expired or merged on Shopify's side), or the removal itself
154
+ * failed — in both cases a fresh cart is the only way to guarantee the
155
+ * checkout matches the shopper's current build.
156
+ */
157
+ private clearAbandonedBundleLines;
131
158
  private reportAddToCartEvent;
132
159
  private renderBundles;
133
160
  private setupImpressionFor;