@namiml/web-sdk 1.7.3-1 → 1.7.4-beta.1

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/README.md CHANGED
@@ -32,3 +32,36 @@ yarn add @namiml/web-sdk
32
32
  Example apps showing how to use the SDK are available in our [Nami Web SDK repo](https://github.com/namiml/nami-web-sdk).
33
33
 
34
34
  More information on configuring and using the SDK is available in our docs at [https://learn.namiml.com](https://learn.namiml.com).
35
+
36
+ ## Legacy & polyfills
37
+
38
+ We provide two optional entry points so you can support older browsers or load polyfills only when needed.
39
+
40
+ - Legacy build
41
+ - Use the legacy entry point to load a version of the SDK that works on older browsers.
42
+ - ESM: `import Nami from '@namiml/web-sdk/legacy'`
43
+ - CommonJS: `const Nami = require('@namiml/web-sdk/legacy')`
44
+
45
+ - Polyfills (optional)
46
+ - If you need to include polyfills for older browsers, we provide a small polyfills bundle you can load before the SDK.
47
+ - ESM: `import '@namiml/web-sdk/polyfills'`
48
+ - CommonJS: `require('@namiml/web-sdk/polyfills')`
49
+ - You can also include the polyfills script directly in a page before loading the SDK bundle.
50
+
51
+ Recommended patterns
52
+
53
+ - Most modern apps should import the default package entry (modern bundle):
54
+
55
+ ```js
56
+ import Nami from '@namiml/web-sdk'
57
+ ```
58
+
59
+ - For older browsers, load polyfills first then the legacy bundle:
60
+
61
+ ```js
62
+ import '@namiml/web-sdk/polyfills'
63
+ import Nami from '@namiml/web-sdk/legacy'
64
+ ```
65
+
66
+ This lets you ship the smallest modern bundle to the majority of users while opting into legacy and polyfills only when required.
67
+
@@ -7,8 +7,9 @@ import { TDevice } from '../types/device';
7
7
  import { Callback } from '../types/components/containers';
8
8
  import type { NamiFlow } from '../nami/flow/NamiFlow';
9
9
  import { NamiPaywallEvent, NamiPaywallLaunchContext } from '../types/externals/paywall';
10
+ import { SimpleEventTarget } from '../utils/simple-event-target';
10
11
  export declare const initialState: TPaywallContext;
11
- export declare class PaywallContextProvider extends EventTarget implements ReactiveController {
12
+ export declare class PaywallContextProvider extends SimpleEventTarget implements ReactiveController {
12
13
  static providers: PaywallContextProvider[];
13
14
  host: ReactiveControllerHost | null;
14
15
  state: TPaywallContext;
@@ -20,5 +20,5 @@ export declare class NamiPaywallScreen extends LitElement {
20
20
  private postImpression;
21
21
  private postPaywallScreenData;
22
22
  private getTemplate;
23
- render(): import("lit").TemplateResult<1>;
23
+ render(): import("lit-html").TemplateResult<1>;
24
24
  }
@@ -18,5 +18,5 @@ export declare class NamiCarouselContainer extends NamiElement {
18
18
  private handleSlideChange;
19
19
  private getCarouselOnChange;
20
20
  private getCarouselSlides;
21
- render(): import("lit").TemplateResult<1>;
21
+ render(): import("lit-html").TemplateResult<1>;
22
22
  }
@@ -11,5 +11,5 @@ export declare class NamiCollapseContainer extends NamiElement {
11
11
  private isCollapsed;
12
12
  private _handleClick;
13
13
  protected styles(): CSSResult;
14
- render(): import("lit").TemplateResult<1>;
14
+ render(): import("lit-html").TemplateResult<1>;
15
15
  }
@@ -20,5 +20,5 @@ export declare class NamiButton extends NamiElement {
20
20
  private _handleKeyUp;
21
21
  private _handleClick;
22
22
  protected styles(): CSSResult;
23
- render(): any[] | import("lit").TemplateResult<1>;
23
+ render(): any[] | import("lit-html").TemplateResult<1>;
24
24
  }
@@ -8,5 +8,5 @@ export declare class NamiQRCode extends NamiElement {
8
8
  firstUpdated(): void;
9
9
  protected updated(changedProps: Map<string, unknown>): void;
10
10
  private get computedSize();
11
- render(): import("lit").TemplateResult<1>;
11
+ render(): import("lit-html").TemplateResult<1>;
12
12
  }
@@ -8,5 +8,5 @@ export declare class NamiRadioButton extends NamiElement {
8
8
  constructor();
9
9
  protected styles(): CSSResult;
10
10
  private get isActive();
11
- render(): import("lit").TemplateResult<1>;
11
+ render(): import("lit-html").TemplateResult<1>;
12
12
  }
@@ -10,5 +10,5 @@ export declare class NamiSegmentPicker extends NamiElement {
10
10
  constructor();
11
11
  private _handleClick;
12
12
  protected styles(): CSSResult;
13
- render(): import("lit").TemplateResult<1>;
13
+ render(): import("lit-html").TemplateResult<1>;
14
14
  }
@@ -12,5 +12,5 @@ export declare class NamiSegmentPickerItem extends NamiElement {
12
12
  private _handleHover;
13
13
  updated(changedProperties: PropertyValues): void;
14
14
  protected styles(): CSSResult;
15
- render(): import("lit").TemplateResult<1>;
15
+ render(): import("lit-html").TemplateResult<1>;
16
16
  }
@@ -14,5 +14,5 @@ export declare class NamiToggleSwitch extends NamiElement {
14
14
  protected styles(): CSSResult;
15
15
  private applyPlateStyles;
16
16
  private applyHandleStyles;
17
- render(): import("lit").TemplateResult<1>;
17
+ render(): import("lit-html").TemplateResult<1>;
18
18
  }
@@ -4,6 +4,8 @@ import type { TSegmentPickerItem, TTextLikeComponent } from "../../types/compone
4
4
  import type { TSemverObj } from "../../utils/parsers";
5
5
  export declare function parseSize(value: string | number, scaleFactor: number): string;
6
6
  export declare function backgroundColor(value: string, fallback?: string): string;
7
+ export declare function filteredBorderColor(value: string, fallback?: string): string;
8
+ export declare function filteredTextColor(value: string, fallback?: string): string;
7
9
  export declare function pickAndApplyBackgroundColor(component: TBaseComponent, inFocusedState?: boolean): string;
8
10
  export declare function flexDirection({ direction }: TBaseComponent): string;
9
11
  export declare function alignAndJustifyItems(component: TBaseComponent): string;
@@ -0,0 +1,10 @@
1
+ import "./polyfills";
2
+ import "./shims/globalThis";
3
+ import "./shims/getAttributeNames";
4
+ export { Nami } from "./nami";
5
+ export { NamiCampaignManager } from "./nami/campaign";
6
+ export { NamiCustomerManager } from "./nami/customer";
7
+ export { NamiPaywallManager } from "./nami/paywalls";
8
+ export { NamiEntitlementManager } from "./nami/entitlement";
9
+ export * from "./types/externals";
10
+ import "./components";