@lime-bundles/widget 4.1.1 → 4.3.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
@@ -82,12 +86,6 @@ declare class LimeBundleElement extends HTMLElement {
82
86
  * `.lb-bundle-widget { ... }` reach the widget's DOM.
83
87
  */
84
88
  private shopCustomCss;
85
- /**
86
- * Shop-wide out-of-stock behaviour, resolved from the `$app` shop metafield
87
- * before the first render. Defaults to `show_greyed_out` so a failed or
88
- * missing fetch degrades to "bundles still render".
89
- */
90
- private outOfStockBehavior;
91
89
  constructor();
92
90
  connectedCallback(): void;
93
91
  disconnectedCallback(): void;
@@ -98,6 +96,14 @@ declare class LimeBundleElement extends HTMLElement {
98
96
  private get storefrontToken();
99
97
  private get bundleGid();
100
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();
101
107
  private get appUrl();
102
108
  private get analyticsEnabled();
103
109
  private get country();
@@ -134,6 +140,21 @@ declare class LimeBundleElement extends HTMLElement {
134
140
  * instead of creating a new one every click.
135
141
  */
136
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;
137
158
  private reportAddToCartEvent;
138
159
  private renderBundles;
139
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
@@ -82,12 +86,6 @@ declare class LimeBundleElement extends HTMLElement {
82
86
  * `.lb-bundle-widget { ... }` reach the widget's DOM.
83
87
  */
84
88
  private shopCustomCss;
85
- /**
86
- * Shop-wide out-of-stock behaviour, resolved from the `$app` shop metafield
87
- * before the first render. Defaults to `show_greyed_out` so a failed or
88
- * missing fetch degrades to "bundles still render".
89
- */
90
- private outOfStockBehavior;
91
89
  constructor();
92
90
  connectedCallback(): void;
93
91
  disconnectedCallback(): void;
@@ -98,6 +96,14 @@ declare class LimeBundleElement extends HTMLElement {
98
96
  private get storefrontToken();
99
97
  private get bundleGid();
100
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();
101
107
  private get appUrl();
102
108
  private get analyticsEnabled();
103
109
  private get country();
@@ -134,6 +140,21 @@ declare class LimeBundleElement extends HTMLElement {
134
140
  * instead of creating a new one every click.
135
141
  */
136
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;
137
158
  private reportAddToCartEvent;
138
159
  private renderBundles;
139
160
  private setupImpressionFor;