@namiml/web-sdk 1.7.3 → 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 +33 -0
- package/dist/components/ContextProvider.d.ts +2 -1
- package/dist/components/PaywallScreen.d.ts +1 -1
- package/dist/components/containers/CarouselContainer.d.ts +1 -1
- package/dist/components/containers/CollapseContainer.d.ts +1 -1
- package/dist/components/elements/Button.d.ts +1 -1
- package/dist/components/elements/QRCode.d.ts +1 -1
- package/dist/components/elements/RadioButton.d.ts +1 -1
- package/dist/components/elements/SegmentPicker.d.ts +1 -1
- package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
- package/dist/components/elements/ToggleSwitch.d.ts +1 -1
- package/dist/components/utils/styles.d.ts +2 -0
- package/dist/nami-web-legacy.d.ts +10 -0
- package/dist/nami-web.cjs +61 -59
- package/dist/nami-web.d.ts +2 -0
- package/dist/nami-web.legacy.cjs +236 -0
- package/dist/nami-web.legacy.mjs +236 -0
- package/dist/nami-web.legacy.umd.js +236 -0
- package/dist/nami-web.mjs +61 -59
- package/dist/nami-web.umd.js +35 -33
- package/dist/polyfills.cjs +26907 -0
- package/dist/polyfills.d.ts +6 -0
- package/dist/polyfills.js +26905 -0
- package/dist/utils/const.d.ts +1 -1
- package/dist/utils/simple-event-target.d.ts +7 -0
- package/package.json +29 -2
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
|
|
12
|
+
export declare class PaywallContextProvider extends SimpleEventTarget implements ReactiveController {
|
|
12
13
|
static providers: PaywallContextProvider[];
|
|
13
14
|
host: ReactiveControllerHost | null;
|
|
14
15
|
state: TPaywallContext;
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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";
|