@liquidcommerce/elements-sdk 2.7.1 → 2.7.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.
@@ -7,6 +7,7 @@ import { TelemetryService } from '@/core/telemetry/telemetry.service';
7
7
  import type { ComponentType } from '@/enums';
8
8
  import type { ConfigsKeyType, ConfigsType } from '@/interfaces/configs';
9
9
  import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
10
+ import { SafeHTMLElement } from '@/utils/dom-compat';
10
11
  import { CommandService } from './command/command.service';
11
12
  export interface IBaseComponentConfig {
12
13
  type: ComponentType;
@@ -25,7 +26,7 @@ export interface IOnStoreChanged {
25
26
  value: any;
26
27
  oldValue: any;
27
28
  }
28
- export declare abstract class BaseComponent<TParams = Record<string, any>, TConfig = ConfigsType> extends HTMLElement {
29
+ export declare abstract class BaseComponent<TParams = Record<string, any>, TConfig = ConfigsType> extends SafeHTMLElement {
29
30
  protected readonly store: StoreService;
30
31
  protected readonly commands: CommandService;
31
32
  protected readonly themeProvider: ThemeProviderService;
@@ -92,6 +92,10 @@ export interface IInjectCheckoutParams {
92
92
  checkoutId?: string;
93
93
  hideHeader?: boolean;
94
94
  }
95
+ export interface IInjectCheckoutBuilderParams extends IInjectCheckoutParams {
96
+ simulatePresale?: boolean;
97
+ presaleExpiresInMinutes?: number;
98
+ }
95
99
  export interface ILiquidCommerceElementsUIMethod {
96
100
  cartButton(containerId: string, showItemsCount?: boolean): void;
97
101
  floatingCartButton(showItemsCount?: boolean): void;
@@ -116,10 +120,7 @@ export interface ILiquidCommerceElementsBuilderClient {
116
120
  injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
117
121
  injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
118
122
  injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
119
- injectCheckoutElement(containerId: string, options?: {
120
- simulatePresale?: boolean;
121
- presaleExpiresInMinutes?: number;
122
- }): Promise<IInjectedComponent | null>;
123
+ injectCheckoutElement(params: IInjectCheckoutBuilderParams): Promise<IInjectedComponent | null>;
123
124
  injectProductList(params: IInjectProductListParams): Promise<void>;
124
125
  actions: ILiquidCommerceElementsActions;
125
126
  }
@@ -1,3 +1,4 @@
1
+ import { SafeHTMLElement } from '@/utils/dom-compat';
1
2
  declare global {
2
3
  interface Window {
3
4
  Stripe: any;
@@ -23,7 +24,7 @@ export interface IStripeFormStatus {
23
24
  hasError: boolean;
24
25
  errorMessage: string | null;
25
26
  }
26
- export declare class CheckoutStripeFormComponent extends HTMLElement {
27
+ export declare class CheckoutStripeFormComponent extends SafeHTMLElement {
27
28
  private _initialized;
28
29
  private _stripe;
29
30
  private _stripeElements;
@@ -1,5 +1,6 @@
1
1
  import type { ComponentType } from '@/enums';
2
- export declare class LceElementComponent extends HTMLElement {
2
+ import { SafeHTMLElement } from '@/utils/dom-compat';
3
+ export declare class LceElementComponent extends SafeHTMLElement {
3
4
  private _initialized;
4
5
  protected _container: ShadowRoot | null;
5
6
  private _wrappedComponentRerender;
@@ -0,0 +1,2 @@
1
+ export declare const SafeHTMLElement: typeof HTMLElement;
2
+ export declare function isHTMLElement(value: unknown): value is HTMLElement;