ui.shipaid.com 0.3.147 → 0.3.149

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.
@@ -33,6 +33,12 @@ export declare const removeProtectionWithCheckoutPlus: () => Promise<void>;
33
33
  export declare const hasProtectionWithCheckoutPlus: () => Promise<boolean>;
34
34
  export declare const resetShipAidSharedCache: () => void;
35
35
  export declare const openCarousel: (from: string) => void;
36
+ /**
37
+ * Ensures the learn-more carousel is mounted in the DOM.
38
+ * This allows external elements to trigger the modal via events without requiring prior user interaction.
39
+ * @param store - ShipAid store configuration
40
+ */
41
+ export declare const ensureLearnMoreCarousel: (store?: ShipAidStore | null) => void;
36
42
  /**
37
43
  * Refresh Shopify cart UI sections (drawer, icons, cart page) after cart changes.
38
44
  * This ensures the UI stays in sync after ShipAid modifies the cart.
@@ -68,18 +68,39 @@ export declare class ShipAidWidget extends LitElement {
68
68
  private _sellingPlanId?;
69
69
  private _isUpdatingShipAid;
70
70
  private _lastCartEventAt;
71
- private _isReplacingCartSections;
71
+ private _checkoutButtonStylesInjected;
72
+ private _cachedCheckoutButton;
73
+ private _cachedCheckoutButtonClasses;
72
74
  private _onShipAidCartEvent;
73
75
  private _onShipAidInternalCartUpdated;
74
76
  protected shouldUpdate(props: PropertyValues): boolean;
75
77
  protected shouldPersistPopup(): "learn-more" | null;
76
78
  protected setPopupKey(): void;
77
- private _pendingLearnMoreSource;
78
79
  private _openLearnMore;
79
80
  private _toggleBenefits;
80
81
  private _handleHelpClick;
81
82
  private _handleHelpKeydown;
82
83
  private _handleSeeDetails;
84
+ /**
85
+ * Get the contactless checkout selector from DB or sessionStorage
86
+ * @private
87
+ */
88
+ private _getContactlessCheckoutSelector;
89
+ /**
90
+ * Check if we should use contactless checkout template
91
+ * @private
92
+ */
93
+ private _shouldUseContactlessCheckout;
94
+ /**
95
+ * Check if widget should be shown based on config
96
+ * @private
97
+ */
98
+ private _shouldShowWidgetContent;
99
+ /**
100
+ * Determine which template to render
101
+ * @private
102
+ */
103
+ private _getTemplateToRender;
83
104
  /**
84
105
  * Internal state
85
106
  */
@@ -154,7 +175,7 @@ export declare class ShipAidWidget extends LitElement {
154
175
  /** Re-enable checkout buttons after updating protection */
155
176
  private _enableCheckoutButtons;
156
177
  /** Templates */
157
- learnMorePopupTemplate(): import("lit").TemplateResult<1> | undefined;
178
+ learnMorePopupTemplate(): null;
158
179
  confirmationPopupTemplate(): import("lit").TemplateResult<1>;
159
180
  getElementsBySelector: (selector: string | null) => never[] | NodeListOf<Element>;
160
181
  addStylesIfNeeded: () => void;
@@ -163,11 +184,43 @@ export declare class ShipAidWidget extends LitElement {
163
184
  getSubscription(_cart: ShopifyCart | undefined): Promise<string | null | undefined>;
164
185
  renderImpactTitle: (isGreenProtectionEnabled: boolean, isFreeGiftEnabled: boolean) => import("lit").TemplateResult<1>;
165
186
  private _renderBenefitsSection;
187
+ /**
188
+ * Inject global styles for checkoutButtonTemplate (only once)
189
+ * @private
190
+ */
191
+ private _injectCheckoutButtonGlobalStyles;
192
+ /**
193
+ * Find and cache the original checkout button for checkoutButtonTemplate
194
+ * @private
195
+ */
196
+ private _findAndCacheCheckoutButton;
197
+ /**
198
+ * Calculate cart totals for checkoutButtonTemplate
199
+ * @private
200
+ */
201
+ private _calculateCheckoutCartTotals;
202
+ /**
203
+ * Get impact features for checkoutButtonTemplate
204
+ * @private
205
+ */
206
+ private _getCheckoutImpactFeatures;
207
+ /**
208
+ * Render Get Mechanism theme checkout button
209
+ * Modern UI based on the mechanism theme design
210
+ * @private
211
+ */
212
+ private _renderGetMechanismCheckoutButton;
213
+ /**
214
+ * Render default/original checkout button UI
215
+ * @private
216
+ */
217
+ private _renderDefaultCheckoutButton;
166
218
  checkoutButtonTemplate(): import("lit").TemplateResult<1> | undefined;
167
- renderPopups(): import("lit").TemplateResult<1> | null | undefined;
219
+ renderPopups(): import("lit").TemplateResult<1> | null;
168
220
  promptTemplate(): import("lit").TemplateResult<1> | undefined;
169
221
  connectedCallback(): Promise<void>;
170
222
  disconnectedCallback(): void;
223
+ updated(changedProperties: PropertyValues): void;
171
224
  updateProtection(force?: boolean): Promise<void>;
172
225
  protected render(): import("lit").TemplateResult<1>;
173
226
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui.shipaid.com",
3
3
  "private": false,
4
- "version": "0.3.147",
4
+ "version": "0.3.149",
5
5
  "type": "module",
6
6
  "main": "dist/widget.umd.js",
7
7
  "unpkg": "dist/widget.iife.js",