@liquidcommerce/elements-sdk 2.6.0-beta.40 → 2.6.0-beta.42

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.
Files changed (68) hide show
  1. package/README.md +79 -171
  2. package/dist/index.checkout.esm.js +6814 -6806
  3. package/dist/index.esm.js +10596 -10567
  4. package/dist/types/auto-initialize/shared-utils.d.ts +5 -0
  5. package/dist/types/core/base-component.service.d.ts +2 -1
  6. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +1 -0
  7. package/dist/types/interfaces/core.interface.d.ts +5 -4
  8. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
  9. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  10. package/dist/types/utils/dom-compat.d.ts +2 -0
  11. package/docs/gitbook/actions.md +964 -0
  12. package/docs/gitbook/address.md +48 -0
  13. package/docs/gitbook/cart.md +65 -0
  14. package/docs/gitbook/checkout.md +131 -0
  15. package/docs/gitbook/events.md +1765 -0
  16. package/docs/gitbook/overview.md +166 -0
  17. package/docs/gitbook/product.md +64 -0
  18. package/docs/gitbook/quick-start-guide.md +393 -0
  19. package/docs/v1/README.md +210 -0
  20. package/docs/v1/api/actions/address-actions.md +281 -0
  21. package/docs/v1/api/actions/cart-actions.md +337 -0
  22. package/docs/v1/api/actions/checkout-actions.md +387 -0
  23. package/docs/v1/api/actions/product-actions.md +115 -0
  24. package/docs/v1/api/client.md +482 -0
  25. package/docs/v1/api/configuration.md +1 -0
  26. package/docs/v1/api/injection-methods.md +247 -0
  27. package/docs/v1/api/typescript-types.md +1 -0
  28. package/docs/v1/api/ui-helpers.md +200 -0
  29. package/docs/v1/examples/advanced-patterns.md +96 -0
  30. package/docs/v1/examples/checkout-flow.md +91 -0
  31. package/docs/v1/examples/custom-theming.md +63 -0
  32. package/docs/v1/examples/multi-product-page.md +90 -0
  33. package/docs/v1/examples/simple-product-page.md +89 -0
  34. package/docs/v1/getting-started/concepts.md +507 -0
  35. package/docs/v1/getting-started/installation.md +328 -0
  36. package/docs/v1/getting-started/quick-start.md +405 -0
  37. package/docs/v1/guides/address-component.md +431 -0
  38. package/docs/v1/guides/best-practices.md +324 -0
  39. package/docs/v1/guides/cart-component.md +737 -0
  40. package/docs/v1/guides/checkout-component.md +672 -0
  41. package/docs/v1/guides/events.md +926 -0
  42. package/docs/v1/guides/product-component.md +686 -0
  43. package/docs/v1/guides/product-list-component.md +598 -0
  44. package/docs/v1/guides/theming.md +216 -0
  45. package/docs/v1/integration/angular.md +39 -0
  46. package/docs/v1/integration/laravel.md +41 -0
  47. package/docs/v1/integration/nextjs.md +60 -0
  48. package/docs/v1/integration/proxy-setup.md +89 -0
  49. package/docs/v1/integration/react.md +64 -0
  50. package/docs/v1/integration/vanilla-js.md +84 -0
  51. package/docs/v1/integration/vue.md +34 -0
  52. package/docs/v1/reference/browser-support.md +44 -0
  53. package/docs/v1/reference/error-handling.md +70 -0
  54. package/docs/v1/reference/performance.md +54 -0
  55. package/docs/v1/reference/troubleshooting.md +64 -0
  56. package/package.json +1 -1
  57. package/docs/actions.md +0 -320
  58. package/docs/address.md +0 -242
  59. package/docs/browser-support.md +0 -279
  60. package/docs/cart.md +0 -387
  61. package/docs/checkout.md +0 -420
  62. package/docs/configuration.md +0 -1017
  63. package/docs/events.md +0 -181
  64. package/docs/product-list.md +0 -311
  65. package/docs/product.md +0 -250
  66. package/docs/proxy.md +0 -228
  67. package/docs/theming.md +0 -682
  68. package/docs/troubleshooting.md +0 -793
@@ -1,7 +1,12 @@
1
1
  import type { IInjectCheckoutParams, IInjectedComponent, ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/core.interface';
2
2
  export declare const SHARED_ATTR: {
3
3
  readonly SCRIPT: {
4
+ readonly MAIN: "data-liquid-commerce-elements";
5
+ readonly TOKEN: "data-token";
6
+ readonly ENV: "data-env";
7
+ readonly DEBUG_MODE: "data-debug-mode";
4
8
  readonly CHECKOUT_PARAM: "data-checkout-param";
9
+ readonly CHECKOUT_URL: "data-checkout-url";
5
10
  };
6
11
  readonly ELEMENT: {
7
12
  readonly CHECKOUT: "data-lce-checkout";
@@ -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;
@@ -1,5 +1,6 @@
1
1
  import type { ICheckoutAmounts, ICheckoutItem } from '@/interfaces/api/checkout.interface';
2
2
  export interface IBaseCheckoutEventData {
3
+ token: string;
3
4
  cartId: string;
4
5
  isGift: boolean;
5
6
  billingSameAsShipping: boolean;
@@ -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;