@openreceive/svelte 0.1.1 → 0.2.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 +30 -0
- package/dist/Checkout.svelte +124 -53
- package/dist/Checkout.svelte.d.ts +14 -0
- package/dist/index.d.ts +1 -42
- package/dist/index.js +2 -58
- package/package.json +54 -14
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @openreceive/svelte
|
|
2
|
+
|
|
3
|
+
Svelte wrapper for the OpenReceive checkout custom element. Requires Svelte 5.
|
|
4
|
+
|
|
5
|
+
## Mount
|
|
6
|
+
|
|
7
|
+
The component ships as a raw SFC on the `@openreceive/svelte/checkout.svelte`
|
|
8
|
+
subpath (your bundler's Svelte plugin compiles it); import the checkout styles
|
|
9
|
+
once.
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import Checkout from "@openreceive/svelte/checkout.svelte";
|
|
14
|
+
import "@openreceive/svelte/styles.css";
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<Checkout reference="order-123" onSettled={() => console.log("paid")} />
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Pass `reference` to let the element create the checkout (create mode), or pass a
|
|
21
|
+
`checkout` snapshot to render one your server already created. Prop names,
|
|
22
|
+
defaults, and the full surface are shared across the wrappers — see
|
|
23
|
+
`docs/internal/wrapper-parity.md` in the repository.
|
|
24
|
+
|
|
25
|
+
Event handlers (`onCopy`, `onOpenWallet`, `onState`, `onSettled`,
|
|
26
|
+
`onProviderCopy`, `onStartOver`, `onError`) are ordinary props, not
|
|
27
|
+
framework-native events: pass them as props (`onSettled={handler}`), not with
|
|
28
|
+
`on:settled`. Each receives the DOM `CustomEvent` the element dispatches.
|
|
29
|
+
|
|
30
|
+
Part of [OpenReceive](https://openreceive.org). Start with the [Node quickstart](https://github.com/openreceive/openreceive/blob/master/docs/guides/quickstart-node.md); the full API is in the [API reference](https://github.com/openreceive/openreceive/blob/master/docs/guides/api-reference.md).
|
package/dist/Checkout.svelte
CHANGED
|
@@ -1,62 +1,133 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
import {
|
|
4
|
+
createWrapperCheckoutShellBinding,
|
|
5
|
+
defineElements,
|
|
6
|
+
validateCheckoutProps,
|
|
7
|
+
type CheckoutElementListeners,
|
|
8
|
+
type CheckoutShellOptions,
|
|
9
|
+
type CheckoutSnapshot,
|
|
10
|
+
type ThemePreference,
|
|
11
|
+
} from "./index.js";
|
|
12
|
+
|
|
13
|
+
// Prop names, defaults, and per-mode applicability are the shared contract in
|
|
14
|
+
// docs/internal/wrapper-parity.md. This list RESTATES it because Svelte props
|
|
15
|
+
// are declarations, not a type: `export let` (and `let { … } = $props()` under
|
|
16
|
+
// runes) has to name every prop, so it cannot be derived from
|
|
17
|
+
// WrapperCheckoutComponentProps the way Vue's defineProps and
|
|
18
|
+
// React's CheckoutProps are. The duplication is forced, not neglected;
|
|
19
|
+
// tests/wrapper-parity.test.mjs is what keeps it in step.
|
|
20
|
+
// Snapshot mode: pass a `checkout` to render it directly.
|
|
21
|
+
// Create mode: omit `checkout` and pass `reference` (+ optional `prefix`); the underlying
|
|
22
|
+
// <openreceive-checkout> element creates the checkout, then renders and polls itself.
|
|
23
|
+
export let checkout: CheckoutSnapshot | undefined = undefined;
|
|
24
|
+
export let reference: string | undefined = undefined;
|
|
25
|
+
export let prefix: string | undefined = undefined;
|
|
26
|
+
export let paymentWizard: boolean | undefined = undefined;
|
|
27
|
+
export let decodeLinkUrl: string | undefined = undefined;
|
|
28
|
+
export let themeToggle: boolean | undefined = undefined;
|
|
29
|
+
export let defaultTheme: ThemePreference | undefined = undefined;
|
|
30
|
+
export let storageKey: string | undefined = undefined;
|
|
31
|
+
// Create mode only.
|
|
32
|
+
export let metadata: Record<string, unknown> | undefined = undefined;
|
|
33
|
+
export let syncUrl: boolean | undefined = undefined;
|
|
34
|
+
export let resumePathPrefix: string | undefined = undefined;
|
|
35
|
+
export let routeReference: string | undefined = undefined;
|
|
36
|
+
export let onCopy: ((event: Event) => void) | undefined = undefined;
|
|
37
|
+
export let onOpenWallet: ((event: Event) => void) | undefined = undefined;
|
|
38
|
+
export let onState: ((event: Event) => void) | undefined = undefined;
|
|
39
|
+
export let onSettled: ((event: Event) => void) | undefined = undefined;
|
|
40
|
+
export let onProviderCopy: ((event: Event) => void) | undefined = undefined;
|
|
41
|
+
export let onStartOver: ((event: Event) => void) | undefined = undefined;
|
|
42
|
+
export let onError: ((event: Event) => void) | undefined = undefined;
|
|
43
|
+
export let options: CheckoutShellOptions = {};
|
|
44
|
+
|
|
45
|
+
// Storage and matchMedia only exist in the browser: resolving the theme before mount
|
|
46
|
+
// would make a server-rendered shell disagree with the first client render.
|
|
47
|
+
let mounted = false;
|
|
48
|
+
|
|
49
|
+
onMount(() => {
|
|
50
|
+
defineElements();
|
|
51
|
+
mounted = true;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
$: validateCheckoutProps({
|
|
55
|
+
framework: "@openreceive/svelte",
|
|
56
|
+
checkout,
|
|
57
|
+
reference,
|
|
58
|
+
metadata,
|
|
59
|
+
syncUrl,
|
|
60
|
+
resumePathPrefix,
|
|
61
|
+
routeReference,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
$: shell = createWrapperCheckoutShellBinding(checkout ?? null, {
|
|
65
|
+
...options,
|
|
66
|
+
themeToggle: themeToggle ?? options.themeToggle ?? true,
|
|
67
|
+
deferThemeResolution: !mounted,
|
|
68
|
+
...(reference === undefined ? {} : { reference }),
|
|
69
|
+
...(prefix === undefined ? {} : { prefix }),
|
|
70
|
+
...(paymentWizard === undefined ? {} : { paymentWizard }),
|
|
71
|
+
...(decodeLinkUrl === undefined ? {} : { decodeLinkUrl }),
|
|
72
|
+
...(defaultTheme === undefined ? {} : { defaultTheme }),
|
|
73
|
+
...(storageKey === undefined ? {} : { storageKey }),
|
|
74
|
+
...(metadata === undefined ? {} : { metadata }),
|
|
75
|
+
...(syncUrl === undefined ? {} : { syncUrl }),
|
|
76
|
+
...(resumePathPrefix === undefined ? {} : { resumePathPrefix }),
|
|
77
|
+
...(routeReference === undefined ? {} : { routeReference }),
|
|
78
|
+
...(onCopy === undefined ? {} : { onCopy }),
|
|
79
|
+
...(onOpenWallet === undefined ? {} : { onOpenWallet }),
|
|
80
|
+
...(onState === undefined ? {} : { onState }),
|
|
81
|
+
...(onSettled === undefined ? {} : { onSettled }),
|
|
82
|
+
...(onProviderCopy === undefined ? {} : { onProviderCopy }),
|
|
83
|
+
...(onStartOver === undefined ? {} : { onStartOver }),
|
|
84
|
+
...(onError === undefined ? {} : { onError }),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// biome-ignore lint/correctness/noUnusedVariables: applied by the use: directive below, which biome does not read.
|
|
88
|
+
function checkoutListeners(node: HTMLElement, listeners: CheckoutElementListeners) {
|
|
89
|
+
let activeListeners = listeners;
|
|
90
|
+
|
|
91
|
+
const attach = () => {
|
|
92
|
+
for (const [name, listener] of Object.entries(activeListeners)) {
|
|
93
|
+
if (listener !== undefined) {
|
|
94
|
+
node.addEventListener(name, listener);
|
|
34
95
|
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
detach();
|
|
42
|
-
activeListeners = nextListeners;
|
|
43
|
-
attach();
|
|
44
|
-
},
|
|
45
|
-
destroy() {
|
|
46
|
-
detach();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const detach = () => {
|
|
99
|
+
for (const [name, listener] of Object.entries(activeListeners)) {
|
|
100
|
+
if (listener !== undefined) {
|
|
101
|
+
node.removeEventListener(name, listener);
|
|
47
102
|
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
attach();
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
update(nextListeners: CheckoutElementListeners) {
|
|
110
|
+
detach();
|
|
111
|
+
activeListeners = nextListeners;
|
|
112
|
+
attach();
|
|
113
|
+
},
|
|
114
|
+
destroy() {
|
|
115
|
+
detach();
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
50
119
|
</script>
|
|
51
120
|
|
|
52
|
-
<section {...shell.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
121
|
+
<section {...shell.rootAttributes}>
|
|
122
|
+
{#if shell.themeToggle}
|
|
123
|
+
<svelte:element
|
|
124
|
+
this={shell.themeToggle.tagName}
|
|
125
|
+
{...shell.themeToggle.attributes}
|
|
126
|
+
/>
|
|
127
|
+
{/if}
|
|
57
128
|
<svelte:element
|
|
58
129
|
this={shell.checkout.tagName}
|
|
59
|
-
{...shell.checkout.
|
|
60
|
-
use:checkoutListeners={shell.checkout.
|
|
130
|
+
{...shell.checkout.attributes}
|
|
131
|
+
use:checkoutListeners={shell.checkout.listeners}
|
|
61
132
|
/>
|
|
62
133
|
</section>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Hand-written module shape for the shipped SFC (the raw component is copied into dist
|
|
2
|
+
// by the package build, so no compiler emits this). The props themselves come from the
|
|
3
|
+
// shared wrapper type, so the surface exists in exactly one place.
|
|
4
|
+
//
|
|
5
|
+
// Typed as Svelte 5's `Component`, not a `SvelteComponent` subclass: the peer
|
|
6
|
+
// is Svelte >= 5, where `new Checkout(...)` throws and `mount()` is the only
|
|
7
|
+
// way in — a class typing advertised an instantiation that fails.
|
|
8
|
+
import type { Component } from "svelte";
|
|
9
|
+
import type { WrapperCheckoutComponentProps } from "./index.js";
|
|
10
|
+
|
|
11
|
+
export type SvelteCheckoutProps = WrapperCheckoutComponentProps;
|
|
12
|
+
|
|
13
|
+
declare const Checkout: Component<SvelteCheckoutProps>;
|
|
14
|
+
export default Checkout;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,42 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineOpenReceiveElements, type DefineOpenReceiveElementsOptions } from "@openreceive/elements";
|
|
3
|
-
export { OPENRECEIVE_CHECKOUT_ELEMENT_EVENTS, OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME, OPENRECEIVE_THEME_STORAGE_KEY, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME, applyCheckoutThemeAttributes, applyOpenReceiveThemeAttributes, createCheckoutController, createCheckoutElement, createCheckoutElementAttributes, createCheckoutElementListeners, createCheckoutShell, createCheckoutShellModel, createOpenReceiveStoredThemeModel, createOpenReceiveThemeModel, createOpenReceiveThemeToggleElement, createOpenReceiveThemeToggleElementAttributes, readOpenReceiveThemePreference, syncOpenReceiveStoredThemeControls, toggleOpenReceiveStoredThemeControls, toggleOpenReceiveStoredThemePreference, writeOpenReceiveThemePreference } from "@openreceive/browser/internal";
|
|
4
|
-
export type { CreateCheckoutElementOptions, CreateCheckoutShellOptions, CreateOpenReceiveThemeToggleElementOptions, CheckoutElementAttributeOptions, CheckoutElementAttributes, CheckoutElementDocument, CheckoutElementEventHandlers, CheckoutElementListeners, CheckoutController, CheckoutControllerOptions, CheckoutShellElements, CheckoutShellCheckoutBinding, CheckoutShellModel, CheckoutShellOptions, CheckoutShellThemeToggleBinding, CheckoutElementTarget, CheckoutSnapshot, OpenReceiveReadThemePreferenceOptions, OpenReceiveStoredThemeModelOptions, OpenReceiveThemeAttributeTarget, OpenReceiveThemeControlTargets, OpenReceiveThemeLabelTarget, OpenReceiveThemeModel, OpenReceiveThemeModelOptions, OpenReceiveThemePreference, OpenReceiveThemeStorageOptions, OpenReceiveThemeToggleElementAttributeOptions, OpenReceiveThemeToggleElementAttributes } from "@openreceive/browser/internal";
|
|
5
|
-
export { defineOpenReceiveElements } from "@openreceive/elements";
|
|
6
|
-
export type { DefineOpenReceiveElementsOptions } from "@openreceive/elements";
|
|
7
|
-
export interface OpenReceiveSvelteCheckoutPropsOptions extends CheckoutElementAttributeOptions {
|
|
8
|
-
}
|
|
9
|
-
export interface OpenReceiveSvelteCheckoutBindingOptions extends OpenReceiveSvelteCheckoutPropsOptions, CheckoutElementEventHandlers {
|
|
10
|
-
}
|
|
11
|
-
export interface OpenReceiveSvelteCheckoutBinding {
|
|
12
|
-
readonly tagName: typeof OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME;
|
|
13
|
-
readonly props: CheckoutElementAttributes;
|
|
14
|
-
readonly events: CheckoutElementListeners;
|
|
15
|
-
}
|
|
16
|
-
export interface OpenReceiveSvelteThemeToggleBinding {
|
|
17
|
-
readonly tagName: typeof OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME;
|
|
18
|
-
readonly props: OpenReceiveThemeToggleElementAttributes;
|
|
19
|
-
}
|
|
20
|
-
export interface OpenReceiveSvelteCheckoutShellBinding {
|
|
21
|
-
readonly theme: OpenReceiveThemeModel;
|
|
22
|
-
readonly rootProps: OpenReceiveThemeModel["attributes"];
|
|
23
|
-
readonly checkout: OpenReceiveSvelteCheckoutBinding;
|
|
24
|
-
readonly themeToggle: OpenReceiveSvelteThemeToggleBinding;
|
|
25
|
-
}
|
|
26
|
-
export interface OpenReceiveSvelteCheckoutComponentOptions extends CheckoutShellOptions {
|
|
27
|
-
readonly defineElementsOptions?: DefineOpenReceiveElementsOptions;
|
|
28
|
-
}
|
|
29
|
-
export interface OpenReceiveSvelteCheckoutComponentModel extends OpenReceiveSvelteCheckoutShellBinding {
|
|
30
|
-
readonly componentName: "Checkout";
|
|
31
|
-
readonly defineElements: typeof defineOpenReceiveElements;
|
|
32
|
-
readonly defineElementsOptions?: DefineOpenReceiveElementsOptions;
|
|
33
|
-
}
|
|
34
|
-
export declare function createOpenReceiveSvelteCheckoutProps(snapshot: CheckoutSnapshot, options?: OpenReceiveSvelteCheckoutPropsOptions): CheckoutElementAttributes;
|
|
35
|
-
export declare function createOpenReceiveSvelteCheckoutBinding(snapshot: CheckoutSnapshot, options?: OpenReceiveSvelteCheckoutBindingOptions): OpenReceiveSvelteCheckoutBinding;
|
|
36
|
-
export declare function createOpenReceiveSvelteThemeBinding(theme: OpenReceiveThemePreference, options?: OpenReceiveThemeModelOptions): OpenReceiveThemeModel;
|
|
37
|
-
export declare function createOpenReceiveSvelteStoredThemeBinding(options?: OpenReceiveStoredThemeModelOptions): OpenReceiveThemeModel;
|
|
38
|
-
export declare function createOpenReceiveSvelteThemeToggleBinding(options?: OpenReceiveThemeToggleElementAttributeOptions): OpenReceiveSvelteThemeToggleBinding;
|
|
39
|
-
export declare function createOpenReceiveSvelteCheckoutShellBinding(snapshot: CheckoutSnapshot, options?: CheckoutShellOptions): OpenReceiveSvelteCheckoutShellBinding;
|
|
40
|
-
export declare function createOpenReceiveSvelteCheckoutComponentModel(snapshot: CheckoutSnapshot, options?: OpenReceiveSvelteCheckoutComponentOptions): OpenReceiveSvelteCheckoutComponentModel;
|
|
41
|
-
export declare function createOpenReceiveSvelteCheckoutController(options: CheckoutControllerOptions): CheckoutController;
|
|
42
|
-
export declare function createOpenReceiveSvelteCheckoutShell(snapshot: CheckoutSnapshot, options?: CreateCheckoutShellOptions): CheckoutShellElements;
|
|
1
|
+
export * from '@openreceive/elements/wrapper-shared';
|
package/dist/index.js
CHANGED
|
@@ -1,58 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { OPENRECEIVE_CHECKOUT_ELEMENT_EVENTS, OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME, OPENRECEIVE_THEME_STORAGE_KEY, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME, applyCheckoutThemeAttributes, applyOpenReceiveThemeAttributes, createCheckoutController, createCheckoutElement, createCheckoutElementAttributes, createCheckoutElementListeners, createCheckoutShell, createCheckoutShellModel, createOpenReceiveStoredThemeModel, createOpenReceiveThemeModel, createOpenReceiveThemeToggleElement, createOpenReceiveThemeToggleElementAttributes, readOpenReceiveThemePreference, syncOpenReceiveStoredThemeControls, toggleOpenReceiveStoredThemeControls, toggleOpenReceiveStoredThemePreference, writeOpenReceiveThemePreference } from "@openreceive/browser/internal";
|
|
4
|
-
export { defineOpenReceiveElements } from "@openreceive/elements";
|
|
5
|
-
export function createOpenReceiveSvelteCheckoutProps(snapshot, options = {}) {
|
|
6
|
-
return createCheckoutElementAttributes(snapshot, options);
|
|
7
|
-
}
|
|
8
|
-
export function createOpenReceiveSvelteCheckoutBinding(snapshot, options = {}) {
|
|
9
|
-
return {
|
|
10
|
-
tagName: OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME,
|
|
11
|
-
props: createOpenReceiveSvelteCheckoutProps(snapshot, options),
|
|
12
|
-
events: createCheckoutElementListeners(options)
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export function createOpenReceiveSvelteThemeBinding(theme, options = {}) {
|
|
16
|
-
return createOpenReceiveThemeModel(theme, options);
|
|
17
|
-
}
|
|
18
|
-
export function createOpenReceiveSvelteStoredThemeBinding(options = {}) {
|
|
19
|
-
return createOpenReceiveStoredThemeModel(options);
|
|
20
|
-
}
|
|
21
|
-
export function createOpenReceiveSvelteThemeToggleBinding(options = {}) {
|
|
22
|
-
return {
|
|
23
|
-
tagName: OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME,
|
|
24
|
-
props: createOpenReceiveThemeToggleElementAttributes(options)
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export function createOpenReceiveSvelteCheckoutShellBinding(snapshot, options = {}) {
|
|
28
|
-
const shell = createCheckoutShellModel(snapshot, options);
|
|
29
|
-
return {
|
|
30
|
-
theme: shell.theme,
|
|
31
|
-
rootProps: shell.rootAttributes,
|
|
32
|
-
checkout: {
|
|
33
|
-
tagName: shell.checkout.tagName,
|
|
34
|
-
props: shell.checkout.attributes,
|
|
35
|
-
events: shell.checkout.listeners
|
|
36
|
-
},
|
|
37
|
-
themeToggle: {
|
|
38
|
-
tagName: shell.themeToggle.tagName,
|
|
39
|
-
props: shell.themeToggle.attributes
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export function createOpenReceiveSvelteCheckoutComponentModel(snapshot, options = {}) {
|
|
44
|
-
const { defineElementsOptions, ...shellOptions } = options;
|
|
45
|
-
const shell = createOpenReceiveSvelteCheckoutShellBinding(snapshot, shellOptions);
|
|
46
|
-
return {
|
|
47
|
-
componentName: "Checkout",
|
|
48
|
-
defineElements: defineOpenReceiveElements,
|
|
49
|
-
defineElementsOptions,
|
|
50
|
-
...shell
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
export function createOpenReceiveSvelteCheckoutController(options) {
|
|
54
|
-
return createCheckoutController(options);
|
|
55
|
-
}
|
|
56
|
-
export function createOpenReceiveSvelteCheckoutShell(snapshot, options = {}) {
|
|
57
|
-
return createCheckoutShell(snapshot, options);
|
|
58
|
-
}
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@openreceive/elements/wrapper-shared";
|
package/package.json
CHANGED
|
@@ -1,28 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openreceive/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Svelte wrapper for the OpenReceive checkout custom element.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bitcoin",
|
|
7
|
+
"lightning",
|
|
8
|
+
"payments",
|
|
9
|
+
"nwc",
|
|
10
|
+
"bolt11",
|
|
11
|
+
"openreceive",
|
|
12
|
+
"svelte",
|
|
13
|
+
"checkout"
|
|
14
|
+
],
|
|
4
15
|
"type": "module",
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"**/*.css"
|
|
18
|
+
],
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"svelte": "./dist/index.js",
|
|
5
22
|
"dependencies": {
|
|
6
|
-
"@openreceive/browser": "0.
|
|
7
|
-
"@openreceive/elements": "0.
|
|
23
|
+
"@openreceive/browser": "0.2.1",
|
|
24
|
+
"@openreceive/elements": "0.2.1"
|
|
8
25
|
},
|
|
9
26
|
"peerDependencies": {
|
|
10
|
-
"svelte": ">=
|
|
11
|
-
},
|
|
12
|
-
"peerDependenciesMeta": {
|
|
13
|
-
"svelte": {
|
|
14
|
-
"optional": true
|
|
15
|
-
}
|
|
27
|
+
"svelte": ">=5.0.0"
|
|
16
28
|
},
|
|
17
29
|
"exports": {
|
|
18
|
-
".":
|
|
19
|
-
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"svelte": "./dist/index.js",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./checkout.svelte": {
|
|
36
|
+
"types": "./dist/Checkout.svelte.d.ts",
|
|
37
|
+
"svelte": "./dist/Checkout.svelte",
|
|
38
|
+
"default": "./dist/Checkout.svelte"
|
|
39
|
+
},
|
|
20
40
|
"./styles.css": "./dist/styles.css"
|
|
21
41
|
},
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
23
42
|
"files": [
|
|
24
43
|
"dist",
|
|
25
44
|
"README.md",
|
|
26
45
|
"LICENSE"
|
|
27
|
-
]
|
|
28
|
-
|
|
46
|
+
],
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsup src/index.ts --format esm --dts --clean --target es2022 --out-dir dist && node ../../../tools/package/copy-static.mjs src dist styles.css Checkout.svelte Checkout.svelte.d.ts",
|
|
49
|
+
"prepack": "npm run build"
|
|
50
|
+
},
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"author": "OpenReceive <info@openreceive.org>",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/openreceive/openreceive.git",
|
|
56
|
+
"directory": "packages/js/svelte"
|
|
57
|
+
},
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/openreceive/openreceive/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://openreceive.org",
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=22"
|
|
67
|
+
}
|
|
68
|
+
}
|