@openreceive/angular 0.1.1 → 0.2.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.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @openreceive/angular
2
+
3
+ Angular wrapper for the OpenReceive checkout custom element.
4
+
5
+ ## Mount
6
+
7
+ The standalone component ships on the `@openreceive/angular/checkout-component`
8
+ subpath; import the checkout styles once (e.g. in your global stylesheet or the
9
+ `styles` array of `angular.json`).
10
+
11
+ ```ts
12
+ import { Component } from "@angular/core";
13
+ import { CheckoutComponent } from "@openreceive/angular/checkout-component";
14
+
15
+ @Component({
16
+ selector: "app-checkout-page",
17
+ standalone: true,
18
+ imports: [CheckoutComponent],
19
+ template: `
20
+ <openreceive-angular-checkout reference="order-123" [onSettled]="onSettled" />
21
+ `,
22
+ })
23
+ export class CheckoutPageComponent {
24
+ onSettled = () => console.log("paid");
25
+ }
26
+ ```
27
+
28
+ ```css
29
+ @import "@openreceive/angular/styles.css";
30
+ ```
31
+
32
+ Three names, one checkout: the exported class is `CheckoutComponent`, its
33
+ Angular selector is `openreceive-angular-checkout`, and it renders the
34
+ `<openreceive-checkout>` custom element inside itself (defining it on mount).
35
+
36
+ Pass `reference` to let the element create the checkout (create mode), or pass a
37
+ `checkout` snapshot to render one your server already created. Prop names,
38
+ defaults, and the full surface are shared across the wrappers — see
39
+ `docs/internal/wrapper-parity.md` in the repository.
40
+
41
+ Event handlers (`onCopy`, `onOpenWallet`, `onState`, `onSettled`,
42
+ `onProviderCopy`, `onStartOver`, `onError`) are `@Input()` props, not Angular
43
+ `@Output()` events: bind them as inputs (`[onSettled]="handler"`), not with
44
+ `(settled)="..."`. Each receives the DOM `CustomEvent` the element dispatches.
45
+
46
+ 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OpenReceive contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @openreceive/angular
2
+
3
+ Angular wrapper for the OpenReceive checkout custom element.
4
+
5
+ ## Mount
6
+
7
+ The standalone component ships on the `@openreceive/angular/checkout-component`
8
+ subpath; import the checkout styles once (e.g. in your global stylesheet or the
9
+ `styles` array of `angular.json`).
10
+
11
+ ```ts
12
+ import { Component } from "@angular/core";
13
+ import { CheckoutComponent } from "@openreceive/angular/checkout-component";
14
+
15
+ @Component({
16
+ selector: "app-checkout-page",
17
+ standalone: true,
18
+ imports: [CheckoutComponent],
19
+ template: `
20
+ <openreceive-angular-checkout reference="order-123" [onSettled]="onSettled" />
21
+ `,
22
+ })
23
+ export class CheckoutPageComponent {
24
+ onSettled = () => console.log("paid");
25
+ }
26
+ ```
27
+
28
+ ```css
29
+ @import "@openreceive/angular/styles.css";
30
+ ```
31
+
32
+ Three names, one checkout: the exported class is `CheckoutComponent`, its
33
+ Angular selector is `openreceive-angular-checkout`, and it renders the
34
+ `<openreceive-checkout>` custom element inside itself (defining it on mount).
35
+
36
+ Pass `reference` to let the element create the checkout (create mode), or pass a
37
+ `checkout` snapshot to render one your server already created. Prop names,
38
+ defaults, and the full surface are shared across the wrappers — see
39
+ `docs/internal/wrapper-parity.md` in the repository.
40
+
41
+ Event handlers (`onCopy`, `onOpenWallet`, `onState`, `onSettled`,
42
+ `onProviderCopy`, `onStartOver`, `onError`) are `@Input()` props, not Angular
43
+ `@Output()` events: bind them as inputs (`[onSettled]="handler"`), not with
44
+ `(settled)="..."`. Each receives the DOM `CustomEvent` the element dispatches.
45
+
46
+ 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).
@@ -0,0 +1,298 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ElementRef, NgZone, Input, Directive, ChangeDetectorRef, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
3
+ import { defineElements, validateCheckoutProps, createWrapperCheckoutShellBinding } from '@openreceive/angular';
4
+
5
+ /**
6
+ * Applying a wrapper binding to a custom element, independent of Angular.
7
+ *
8
+ * Angular templates can only bind attribute names written out literally, so a
9
+ * hand-transcribed `[attr.*]` list silently drops any attribute the shared
10
+ * factory later adds. Driving attributes and listeners from the binding object
11
+ * keeps Angular in step with the other wrappers by construction.
12
+ */
13
+ const EMPTY_APPLIED_ELEMENT_BINDINGS = {
14
+ attributes: [],
15
+ listeners: [],
16
+ };
17
+ function applyElementBindings(element, bindings, applied) {
18
+ return {
19
+ attributes: syncAttributes(element, bindings.attributes ?? {}, applied.attributes),
20
+ listeners: syncListeners(element, bindings.listeners ?? {}, applied.listeners),
21
+ };
22
+ }
23
+ function detachElementListeners(element, listeners) {
24
+ for (const [name, handler] of listeners)
25
+ element.removeEventListener(name, handler);
26
+ }
27
+ function syncAttributes(element, attributes, applied) {
28
+ for (const name of applied) {
29
+ if (attributes[name] === undefined)
30
+ element.removeAttribute(name);
31
+ }
32
+ const next = [];
33
+ for (const [name, value] of Object.entries(attributes)) {
34
+ if (value === undefined)
35
+ continue;
36
+ if (element.getAttribute(name) !== value)
37
+ element.setAttribute(name, value);
38
+ next.push(name);
39
+ }
40
+ return next;
41
+ }
42
+ function syncListeners(element, listeners, attached) {
43
+ const next = Object.entries(listeners).flatMap(([name, handler]) => handler === undefined ? [] : [[name, handler]]);
44
+ const unchanged = next.length === attached.length &&
45
+ next.every(([name, handler], index) => {
46
+ const current = attached[index];
47
+ return current !== undefined && current[0] === name && current[1] === handler;
48
+ });
49
+ if (unchanged)
50
+ return attached;
51
+ detachElementListeners(element, attached);
52
+ for (const [name, handler] of next)
53
+ element.addEventListener(name, handler);
54
+ return next;
55
+ }
56
+
57
+ /** Applies a wrapper binding's attributes and listeners to the element host. */
58
+ class ElementBindingsDirective {
59
+ bindings = {};
60
+ applied = EMPTY_APPLIED_ELEMENT_BINDINGS;
61
+ // Zone-wrapped handlers are cached per original handler: the applier compares
62
+ // identity to decide whether to re-attach, so a fresh wrapper each pass would
63
+ // detach and re-add every listener on every change.
64
+ zoneWrapped = new WeakMap();
65
+ host = inject(ElementRef);
66
+ zone = inject(NgZone);
67
+ ngOnChanges() {
68
+ // Setting attributes restarts the element's poll/countdown timers. Applying them
69
+ // outside Angular keeps those timers unpatched, so they never schedule a change
70
+ // detection pass; the listeners below re-enter the zone for host callbacks.
71
+ this.zone.runOutsideAngular(() => {
72
+ this.applied = applyElementBindings(this.host.nativeElement, { ...this.bindings, listeners: this.zoneListeners(this.bindings.listeners) }, this.applied);
73
+ });
74
+ }
75
+ ngOnDestroy() {
76
+ detachElementListeners(this.host.nativeElement, this.applied.listeners);
77
+ this.applied = EMPTY_APPLIED_ELEMENT_BINDINGS;
78
+ }
79
+ zoneListeners(listeners) {
80
+ if (listeners === undefined)
81
+ return {};
82
+ const wrapped = {};
83
+ for (const [name, handler] of Object.entries(listeners)) {
84
+ if (handler === undefined)
85
+ continue;
86
+ let entry = this.zoneWrapped.get(handler);
87
+ if (entry === undefined) {
88
+ entry = (event) => this.zone.run(() => handler(event));
89
+ this.zoneWrapped.set(handler, entry);
90
+ }
91
+ wrapped[name] = entry;
92
+ }
93
+ return wrapped;
94
+ }
95
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: ElementBindingsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
96
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.3", type: ElementBindingsDirective, isStandalone: true, selector: "[openreceiveElementBindings]", inputs: { bindings: ["openreceiveElementBindings", "bindings"] }, usesOnChanges: true, ngImport: i0 });
97
+ }
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: ElementBindingsDirective, decorators: [{
99
+ type: Directive,
100
+ args: [{
101
+ selector: "[openreceiveElementBindings]",
102
+ standalone: true,
103
+ }]
104
+ }], propDecorators: { bindings: [{
105
+ type: Input,
106
+ args: ["openreceiveElementBindings"]
107
+ }] } });
108
+
109
+ class CheckoutComponent {
110
+ // Prop names, defaults, and per-mode applicability are the shared contract in
111
+ // docs/internal/wrapper-parity.md. These inputs RESTATE it because `@Input()`
112
+ // is a decorator on a declared field: a type cannot generate fields, so they
113
+ // cannot be derived from WrapperCheckoutComponentProps the way
114
+ // Vue's defineProps and React's CheckoutProps are. The duplication is forced,
115
+ // not neglected; tests/wrapper-parity.test.mjs is what keeps it in step.
116
+ // Snapshot mode: bind a `checkout` to render it directly.
117
+ // Create mode: omit `checkout` and bind `reference` (+ optional `prefix`); the underlying
118
+ // <openreceive-checkout> element creates the checkout, then renders and polls itself.
119
+ checkout;
120
+ reference;
121
+ prefix;
122
+ paymentWizard;
123
+ decodeLinkUrl;
124
+ themeToggle;
125
+ defaultTheme;
126
+ storageKey;
127
+ // Create mode only.
128
+ metadata;
129
+ syncUrl;
130
+ resumePathPrefix;
131
+ routeReference;
132
+ onCopy;
133
+ onOpenWallet;
134
+ onState;
135
+ onSettled;
136
+ onProviderCopy;
137
+ onStartOver;
138
+ onError;
139
+ options = {};
140
+ /**
141
+ * The custom elements render only once this flips, and it flips inside
142
+ * `runOutsideAngular`: the element starts poll and countdown timers in its
143
+ * connected callback, and zone-patched timers would schedule a change-detection
144
+ * pass on every tick for the lifetime of the checkout.
145
+ */
146
+ elementsReady = false;
147
+ zone = inject(NgZone);
148
+ changeDetector = inject(ChangeDetectorRef);
149
+ // Rebuilt on input changes only. A getter would rebuild the whole binding
150
+ // (storage reads, matchMedia, fresh objects) on every change-detection pass.
151
+ // Null until the first `ngOnChanges`: inputs are not set yet at construction,
152
+ // so building (and validating) here would reject every instantiation.
153
+ shellBinding = null;
154
+ // The shell root's attributes, driven by the same directive as the custom
155
+ // elements: a hand-transcribed [attr.*] list would silently drop any root
156
+ // attribute the shared factory later adds.
157
+ rootBindings = {};
158
+ ngAfterViewInit() {
159
+ // No-op during Angular Universal SSR: custom elements only exist in the
160
+ // browser, and the element renders itself after hydration.
161
+ if (globalThis.customElements === undefined || globalThis.HTMLElement === undefined)
162
+ return;
163
+ this.zone.runOutsideAngular(() => {
164
+ defineElements();
165
+ this.elementsReady = true;
166
+ // Rebuild so the mounted shell carries the stored theme, not the deferred default.
167
+ this.applyShell();
168
+ this.changeDetector.detectChanges();
169
+ });
170
+ }
171
+ ngOnChanges() {
172
+ this.applyShell();
173
+ }
174
+ get shell() {
175
+ return this.shellBinding;
176
+ }
177
+ applyShell() {
178
+ this.shellBinding = this.buildShell();
179
+ this.rootBindings = { attributes: this.shellBinding.rootAttributes };
180
+ }
181
+ buildShell() {
182
+ validateCheckoutProps({
183
+ framework: "@openreceive/angular",
184
+ checkout: this.checkout,
185
+ reference: this.reference,
186
+ metadata: this.metadata,
187
+ syncUrl: this.syncUrl,
188
+ resumePathPrefix: this.resumePathPrefix,
189
+ routeReference: this.routeReference,
190
+ });
191
+ const options = {
192
+ ...this.options,
193
+ themeToggle: this.themeToggle ?? this.options.themeToggle ?? true,
194
+ // Storage and matchMedia only exist in the browser: resolving the theme before
195
+ // the elements mount would make a server-rendered shell disagree with hydration.
196
+ deferThemeResolution: !this.elementsReady,
197
+ ...(this.reference === undefined ? {} : { reference: this.reference }),
198
+ ...(this.prefix === undefined ? {} : { prefix: this.prefix }),
199
+ ...(this.paymentWizard === undefined ? {} : { paymentWizard: this.paymentWizard }),
200
+ ...(this.decodeLinkUrl === undefined ? {} : { decodeLinkUrl: this.decodeLinkUrl }),
201
+ ...(this.defaultTheme === undefined ? {} : { defaultTheme: this.defaultTheme }),
202
+ ...(this.storageKey === undefined ? {} : { storageKey: this.storageKey }),
203
+ ...(this.metadata === undefined ? {} : { metadata: this.metadata }),
204
+ ...(this.syncUrl === undefined ? {} : { syncUrl: this.syncUrl }),
205
+ ...(this.resumePathPrefix === undefined ? {} : { resumePathPrefix: this.resumePathPrefix }),
206
+ ...(this.routeReference === undefined ? {} : { routeReference: this.routeReference }),
207
+ ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),
208
+ ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),
209
+ ...(this.onState === undefined ? {} : { onState: this.onState }),
210
+ ...(this.onSettled === undefined ? {} : { onSettled: this.onSettled }),
211
+ ...(this.onProviderCopy === undefined ? {} : { onProviderCopy: this.onProviderCopy }),
212
+ ...(this.onStartOver === undefined ? {} : { onStartOver: this.onStartOver }),
213
+ ...(this.onError === undefined ? {} : { onError: this.onError }),
214
+ };
215
+ return createWrapperCheckoutShellBinding(this.checkout ?? null, options);
216
+ }
217
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: CheckoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
218
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.3", type: CheckoutComponent, isStandalone: true, selector: "openreceive-angular-checkout", inputs: { checkout: "checkout", reference: "reference", prefix: "prefix", paymentWizard: "paymentWizard", decodeLinkUrl: "decodeLinkUrl", themeToggle: "themeToggle", defaultTheme: "defaultTheme", storageKey: "storageKey", metadata: "metadata", syncUrl: "syncUrl", resumePathPrefix: "resumePathPrefix", routeReference: "routeReference", onCopy: "onCopy", onOpenWallet: "onOpenWallet", onState: "onState", onSettled: "onSettled", onProviderCopy: "onProviderCopy", onStartOver: "onStartOver", onError: "onError", options: "options" }, usesOnChanges: true, ngImport: i0, template: `
219
+ <section [openreceiveElementBindings]="rootBindings">
220
+ @if (elementsReady && shell; as shell) {
221
+ @if (shell.themeToggle) {
222
+ <openreceive-theme-toggle
223
+ [openreceiveElementBindings]="shell.themeToggle"
224
+ ></openreceive-theme-toggle>
225
+ }
226
+ <openreceive-checkout [openreceiveElementBindings]="shell.checkout"></openreceive-checkout>
227
+ }
228
+ </section>
229
+ `, isInline: true, dependencies: [{ kind: "directive", type: ElementBindingsDirective, selector: "[openreceiveElementBindings]", inputs: ["openreceiveElementBindings"] }] });
230
+ }
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: CheckoutComponent, decorators: [{
232
+ type: Component,
233
+ args: [{
234
+ selector: "openreceive-angular-checkout",
235
+ standalone: true,
236
+ imports: [ElementBindingsDirective],
237
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
238
+ template: `
239
+ <section [openreceiveElementBindings]="rootBindings">
240
+ @if (elementsReady && shell; as shell) {
241
+ @if (shell.themeToggle) {
242
+ <openreceive-theme-toggle
243
+ [openreceiveElementBindings]="shell.themeToggle"
244
+ ></openreceive-theme-toggle>
245
+ }
246
+ <openreceive-checkout [openreceiveElementBindings]="shell.checkout"></openreceive-checkout>
247
+ }
248
+ </section>
249
+ `,
250
+ }]
251
+ }], propDecorators: { checkout: [{
252
+ type: Input
253
+ }], reference: [{
254
+ type: Input
255
+ }], prefix: [{
256
+ type: Input
257
+ }], paymentWizard: [{
258
+ type: Input
259
+ }], decodeLinkUrl: [{
260
+ type: Input
261
+ }], themeToggle: [{
262
+ type: Input
263
+ }], defaultTheme: [{
264
+ type: Input
265
+ }], storageKey: [{
266
+ type: Input
267
+ }], metadata: [{
268
+ type: Input
269
+ }], syncUrl: [{
270
+ type: Input
271
+ }], resumePathPrefix: [{
272
+ type: Input
273
+ }], routeReference: [{
274
+ type: Input
275
+ }], onCopy: [{
276
+ type: Input
277
+ }], onOpenWallet: [{
278
+ type: Input
279
+ }], onState: [{
280
+ type: Input
281
+ }], onSettled: [{
282
+ type: Input
283
+ }], onProviderCopy: [{
284
+ type: Input
285
+ }], onStartOver: [{
286
+ type: Input
287
+ }], onError: [{
288
+ type: Input
289
+ }], options: [{
290
+ type: Input
291
+ }] } });
292
+
293
+ /**
294
+ * Generated bundle index. Do not edit.
295
+ */
296
+
297
+ export { CheckoutComponent };
298
+ //# sourceMappingURL=openreceive-angular-checkout-component.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openreceive-angular-checkout-component.mjs","sources":["../../src/element-bindings.ts","../../src/openreceive-element-bindings.directive.ts","../../src/openreceive-checkout.component.ts","../../src/openreceive-angular-checkout-component.ts"],"sourcesContent":["/**\n * Applying a wrapper binding to a custom element, independent of Angular.\n *\n * Angular templates can only bind attribute names written out literally, so a\n * hand-transcribed `[attr.*]` list silently drops any attribute the shared\n * factory later adds. Driving attributes and listeners from the binding object\n * keeps Angular in step with the other wrappers by construction.\n */\n\nexport interface ElementBindings {\n readonly attributes?: Readonly<Record<string, string | undefined>>;\n readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;\n}\n\nexport interface ElementBindingTarget {\n getAttribute(name: string): string | null;\n setAttribute(name: string, value: string): void;\n removeAttribute(name: string): void;\n addEventListener(name: string, listener: (event: Event) => void): void;\n removeEventListener(name: string, listener: (event: Event) => void): void;\n}\n\nexport type AttachedListeners = readonly (readonly [string, (event: Event) => void])[];\n\nexport interface AppliedElementBindings {\n readonly attributes: readonly string[];\n readonly listeners: AttachedListeners;\n}\n\nexport const EMPTY_APPLIED_ELEMENT_BINDINGS: AppliedElementBindings = {\n attributes: [],\n listeners: [],\n};\n\nexport function applyElementBindings(\n element: ElementBindingTarget,\n bindings: ElementBindings,\n applied: AppliedElementBindings,\n): AppliedElementBindings {\n return {\n attributes: syncAttributes(element, bindings.attributes ?? {}, applied.attributes),\n listeners: syncListeners(element, bindings.listeners ?? {}, applied.listeners),\n };\n}\n\nexport function detachElementListeners(\n element: ElementBindingTarget,\n listeners: AttachedListeners,\n): void {\n for (const [name, handler] of listeners) element.removeEventListener(name, handler);\n}\n\nfunction syncAttributes(\n element: ElementBindingTarget,\n attributes: Readonly<Record<string, string | undefined>>,\n applied: readonly string[],\n): readonly string[] {\n for (const name of applied) {\n if (attributes[name] === undefined) element.removeAttribute(name);\n }\n const next: string[] = [];\n for (const [name, value] of Object.entries(attributes)) {\n if (value === undefined) continue;\n if (element.getAttribute(name) !== value) element.setAttribute(name, value);\n next.push(name);\n }\n return next;\n}\n\nfunction syncListeners(\n element: ElementBindingTarget,\n listeners: Readonly<Record<string, ((event: Event) => void) | undefined>>,\n attached: AttachedListeners,\n): AttachedListeners {\n const next = Object.entries(listeners).flatMap(([name, handler]) =>\n handler === undefined ? [] : [[name, handler] as const],\n );\n const unchanged =\n next.length === attached.length &&\n next.every(([name, handler], index) => {\n const current = attached[index];\n return current !== undefined && current[0] === name && current[1] === handler;\n });\n if (unchanged) return attached;\n detachElementListeners(element, attached);\n for (const [name, handler] of next) element.addEventListener(name, handler);\n return next;\n}\n","import {\n Directive,\n ElementRef,\n Input,\n NgZone,\n inject,\n type OnChanges,\n type OnDestroy,\n} from \"@angular/core\";\nimport {\n type AppliedElementBindings,\n EMPTY_APPLIED_ELEMENT_BINDINGS,\n type ElementBindings,\n applyElementBindings,\n detachElementListeners,\n} from \"./element-bindings\";\n\n/** Applies a wrapper binding's attributes and listeners to the element host. */\n@Directive({\n selector: \"[openreceiveElementBindings]\",\n standalone: true,\n})\nexport class ElementBindingsDirective implements OnChanges, OnDestroy {\n @Input(\"openreceiveElementBindings\") bindings: ElementBindings = {};\n\n private applied: AppliedElementBindings = EMPTY_APPLIED_ELEMENT_BINDINGS;\n // Zone-wrapped handlers are cached per original handler: the applier compares\n // identity to decide whether to re-attach, so a fresh wrapper each pass would\n // detach and re-add every listener on every change.\n private readonly zoneWrapped = new WeakMap<(event: Event) => void, (event: Event) => void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n\n ngOnChanges(): void {\n // Setting attributes restarts the element's poll/countdown timers. Applying them\n // outside Angular keeps those timers unpatched, so they never schedule a change\n // detection pass; the listeners below re-enter the zone for host callbacks.\n this.zone.runOutsideAngular(() => {\n this.applied = applyElementBindings(\n this.host.nativeElement,\n { ...this.bindings, listeners: this.zoneListeners(this.bindings.listeners) },\n this.applied,\n );\n });\n }\n\n ngOnDestroy(): void {\n detachElementListeners(this.host.nativeElement, this.applied.listeners);\n this.applied = EMPTY_APPLIED_ELEMENT_BINDINGS;\n }\n\n private zoneListeners(\n listeners: ElementBindings[\"listeners\"],\n ): Readonly<Record<string, ((event: Event) => void) | undefined>> {\n if (listeners === undefined) return {};\n const wrapped: Record<string, ((event: Event) => void) | undefined> = {};\n for (const [name, handler] of Object.entries(listeners)) {\n if (handler === undefined) continue;\n let entry = this.zoneWrapped.get(handler);\n if (entry === undefined) {\n entry = (event: Event) => this.zone.run(() => handler(event));\n this.zoneWrapped.set(handler, entry);\n }\n wrapped[name] = entry;\n }\n return wrapped;\n }\n}\n","import {\n ChangeDetectorRef,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n Input,\n NgZone,\n inject,\n type AfterViewInit,\n type OnChanges,\n} from \"@angular/core\";\nimport {\n type CheckoutSnapshot,\n type ThemePreference,\n type WrapperCheckoutShellBinding,\n type WrapperCheckoutShellOptions,\n createWrapperCheckoutShellBinding,\n defineElements,\n validateCheckoutProps,\n} from \"@openreceive/angular\";\nimport type { ElementBindings } from \"./element-bindings\";\nimport { ElementBindingsDirective } from \"./openreceive-element-bindings.directive\";\n\n@Component({\n selector: \"openreceive-angular-checkout\",\n standalone: true,\n imports: [ElementBindingsDirective],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <section [openreceiveElementBindings]=\"rootBindings\">\n @if (elementsReady && shell; as shell) {\n @if (shell.themeToggle) {\n <openreceive-theme-toggle\n [openreceiveElementBindings]=\"shell.themeToggle\"\n ></openreceive-theme-toggle>\n }\n <openreceive-checkout [openreceiveElementBindings]=\"shell.checkout\"></openreceive-checkout>\n }\n </section>\n `,\n})\nexport class CheckoutComponent implements AfterViewInit, OnChanges {\n // Prop names, defaults, and per-mode applicability are the shared contract in\n // docs/internal/wrapper-parity.md. These inputs RESTATE it because `@Input()`\n // is a decorator on a declared field: a type cannot generate fields, so they\n // cannot be derived from WrapperCheckoutComponentProps the way\n // Vue's defineProps and React's CheckoutProps are. The duplication is forced,\n // not neglected; tests/wrapper-parity.test.mjs is what keeps it in step.\n // Snapshot mode: bind a `checkout` to render it directly.\n // Create mode: omit `checkout` and bind `reference` (+ optional `prefix`); the underlying\n // <openreceive-checkout> element creates the checkout, then renders and polls itself.\n @Input() checkout?: CheckoutSnapshot | null;\n @Input() reference?: string;\n @Input() prefix?: string;\n @Input() paymentWizard?: boolean;\n @Input() decodeLinkUrl?: string;\n @Input() themeToggle?: boolean;\n @Input() defaultTheme?: ThemePreference;\n @Input() storageKey?: string;\n // Create mode only.\n @Input() metadata?: Record<string, unknown>;\n @Input() syncUrl?: boolean;\n @Input() resumePathPrefix?: string;\n @Input() routeReference?: string;\n @Input() onCopy?: (event: Event) => void;\n @Input() onOpenWallet?: (event: Event) => void;\n @Input() onState?: (event: Event) => void;\n @Input() onSettled?: (event: Event) => void;\n @Input() onProviderCopy?: (event: Event) => void;\n @Input() onStartOver?: (event: Event) => void;\n @Input() onError?: (event: Event) => void;\n @Input() options: WrapperCheckoutShellOptions = {};\n\n /**\n * The custom elements render only once this flips, and it flips inside\n * `runOutsideAngular`: the element starts poll and countdown timers in its\n * connected callback, and zone-patched timers would schedule a change-detection\n * pass on every tick for the lifetime of the checkout.\n */\n protected elementsReady = false;\n\n private readonly zone = inject(NgZone);\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n // Rebuilt on input changes only. A getter would rebuild the whole binding\n // (storage reads, matchMedia, fresh objects) on every change-detection pass.\n // Null until the first `ngOnChanges`: inputs are not set yet at construction,\n // so building (and validating) here would reject every instantiation.\n protected shellBinding: WrapperCheckoutShellBinding | null = null;\n\n // The shell root's attributes, driven by the same directive as the custom\n // elements: a hand-transcribed [attr.*] list would silently drop any root\n // attribute the shared factory later adds.\n protected rootBindings: ElementBindings = {};\n\n ngAfterViewInit(): void {\n // No-op during Angular Universal SSR: custom elements only exist in the\n // browser, and the element renders itself after hydration.\n if (globalThis.customElements === undefined || globalThis.HTMLElement === undefined) return;\n this.zone.runOutsideAngular(() => {\n defineElements();\n this.elementsReady = true;\n // Rebuild so the mounted shell carries the stored theme, not the deferred default.\n this.applyShell();\n this.changeDetector.detectChanges();\n });\n }\n\n ngOnChanges(): void {\n this.applyShell();\n }\n\n get shell(): WrapperCheckoutShellBinding | null {\n return this.shellBinding;\n }\n\n private applyShell(): void {\n this.shellBinding = this.buildShell();\n this.rootBindings = { attributes: this.shellBinding.rootAttributes };\n }\n\n private buildShell(): WrapperCheckoutShellBinding {\n validateCheckoutProps({\n framework: \"@openreceive/angular\",\n checkout: this.checkout,\n reference: this.reference,\n metadata: this.metadata,\n syncUrl: this.syncUrl,\n resumePathPrefix: this.resumePathPrefix,\n routeReference: this.routeReference,\n });\n const options: WrapperCheckoutShellOptions = {\n ...this.options,\n themeToggle: this.themeToggle ?? this.options.themeToggle ?? true,\n // Storage and matchMedia only exist in the browser: resolving the theme before\n // the elements mount would make a server-rendered shell disagree with hydration.\n deferThemeResolution: !this.elementsReady,\n ...(this.reference === undefined ? {} : { reference: this.reference }),\n ...(this.prefix === undefined ? {} : { prefix: this.prefix }),\n ...(this.paymentWizard === undefined ? {} : { paymentWizard: this.paymentWizard }),\n ...(this.decodeLinkUrl === undefined ? {} : { decodeLinkUrl: this.decodeLinkUrl }),\n ...(this.defaultTheme === undefined ? {} : { defaultTheme: this.defaultTheme }),\n ...(this.storageKey === undefined ? {} : { storageKey: this.storageKey }),\n ...(this.metadata === undefined ? {} : { metadata: this.metadata }),\n ...(this.syncUrl === undefined ? {} : { syncUrl: this.syncUrl }),\n ...(this.resumePathPrefix === undefined ? {} : { resumePathPrefix: this.resumePathPrefix }),\n ...(this.routeReference === undefined ? {} : { routeReference: this.routeReference }),\n ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),\n ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),\n ...(this.onState === undefined ? {} : { onState: this.onState }),\n ...(this.onSettled === undefined ? {} : { onSettled: this.onSettled }),\n ...(this.onProviderCopy === undefined ? {} : { onProviderCopy: this.onProviderCopy }),\n ...(this.onStartOver === undefined ? {} : { onStartOver: this.onStartOver }),\n ...(this.onError === undefined ? {} : { onError: this.onError }),\n };\n return createWrapperCheckoutShellBinding(this.checkout ?? null, options);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './openreceive-checkout.component';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;AAOG;AAsBI,MAAM,8BAA8B,GAA2B;AACpE,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,SAAS,EAAE,EAAE;CACd;SAEe,oBAAoB,CAClC,OAA6B,EAC7B,QAAyB,EACzB,OAA+B,EAAA;IAE/B,OAAO;AACL,QAAA,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,IAAI,EAAE,EAAE,O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AAE,IAAI;oBAChB,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;AACF,iBAAA;;sBAWE;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;ACtEH;;AAEG;;;;"}
@@ -0,0 +1,12 @@
1
+ export * from '@openreceive/elements/wrapper-shared';
2
+
3
+ // @openreceive/angular — thin wrapper over the OpenReceive checkout
4
+ // custom element. The component ships on the ./checkout-component subpath;
5
+ // the wrapper surface is implemented once in
6
+ // @openreceive/elements/wrapper-shared.
7
+ // tools/validate/check-public-api.mjs pins this surface.
8
+
9
+ /**
10
+ * Generated bundle index. Do not edit.
11
+ */
12
+ //# sourceMappingURL=openreceive-angular.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openreceive-angular.mjs","sources":["../../src/index.ts","../../src/openreceive-angular.ts"],"sourcesContent":["// @openreceive/angular — thin wrapper over the OpenReceive checkout\n// custom element. The component ships on the ./checkout-component subpath;\n// the wrapper surface is implemented once in\n// @openreceive/elements/wrapper-shared.\n// tools/validate/check-public-api.mjs pins this surface.\nexport * from \"@openreceive/elements/wrapper-shared\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;ACJA;;AAEG"}
@@ -0,0 +1,59 @@
1
+ import * as i0 from '@angular/core';
2
+ import { AfterViewInit, OnChanges } from '@angular/core';
3
+ import { CheckoutSnapshot, ThemePreference, WrapperCheckoutShellOptions, WrapperCheckoutShellBinding } from '@openreceive/angular';
4
+
5
+ /**
6
+ * Applying a wrapper binding to a custom element, independent of Angular.
7
+ *
8
+ * Angular templates can only bind attribute names written out literally, so a
9
+ * hand-transcribed `[attr.*]` list silently drops any attribute the shared
10
+ * factory later adds. Driving attributes and listeners from the binding object
11
+ * keeps Angular in step with the other wrappers by construction.
12
+ */
13
+ interface ElementBindings {
14
+ readonly attributes?: Readonly<Record<string, string | undefined>>;
15
+ readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;
16
+ }
17
+
18
+ declare class CheckoutComponent implements AfterViewInit, OnChanges {
19
+ checkout?: CheckoutSnapshot | null;
20
+ reference?: string;
21
+ prefix?: string;
22
+ paymentWizard?: boolean;
23
+ decodeLinkUrl?: string;
24
+ themeToggle?: boolean;
25
+ defaultTheme?: ThemePreference;
26
+ storageKey?: string;
27
+ metadata?: Record<string, unknown>;
28
+ syncUrl?: boolean;
29
+ resumePathPrefix?: string;
30
+ routeReference?: string;
31
+ onCopy?: (event: Event) => void;
32
+ onOpenWallet?: (event: Event) => void;
33
+ onState?: (event: Event) => void;
34
+ onSettled?: (event: Event) => void;
35
+ onProviderCopy?: (event: Event) => void;
36
+ onStartOver?: (event: Event) => void;
37
+ onError?: (event: Event) => void;
38
+ options: WrapperCheckoutShellOptions;
39
+ /**
40
+ * The custom elements render only once this flips, and it flips inside
41
+ * `runOutsideAngular`: the element starts poll and countdown timers in its
42
+ * connected callback, and zone-patched timers would schedule a change-detection
43
+ * pass on every tick for the lifetime of the checkout.
44
+ */
45
+ protected elementsReady: boolean;
46
+ private readonly zone;
47
+ private readonly changeDetector;
48
+ protected shellBinding: WrapperCheckoutShellBinding | null;
49
+ protected rootBindings: ElementBindings;
50
+ ngAfterViewInit(): void;
51
+ ngOnChanges(): void;
52
+ get shell(): WrapperCheckoutShellBinding | null;
53
+ private applyShell;
54
+ private buildShell;
55
+ static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutComponent, never>;
56
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutComponent, "openreceive-angular-checkout", never, { "checkout": { "alias": "checkout"; "required": false; }; "reference": { "alias": "reference"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "paymentWizard": { "alias": "paymentWizard"; "required": false; }; "decodeLinkUrl": { "alias": "decodeLinkUrl"; "required": false; }; "themeToggle": { "alias": "themeToggle"; "required": false; }; "defaultTheme": { "alias": "defaultTheme"; "required": false; }; "storageKey": { "alias": "storageKey"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; "syncUrl": { "alias": "syncUrl"; "required": false; }; "resumePathPrefix": { "alias": "resumePathPrefix"; "required": false; }; "routeReference": { "alias": "routeReference"; "required": false; }; "onCopy": { "alias": "onCopy"; "required": false; }; "onOpenWallet": { "alias": "onOpenWallet"; "required": false; }; "onState": { "alias": "onState"; "required": false; }; "onSettled": { "alias": "onSettled"; "required": false; }; "onProviderCopy": { "alias": "onProviderCopy"; "required": false; }; "onStartOver": { "alias": "onStartOver"; "required": false; }; "onError": { "alias": "onError"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, true, never>;
57
+ }
58
+
59
+ export { CheckoutComponent };
@@ -0,0 +1 @@
1
+ export * from '@openreceive/elements/wrapper-shared';
package/package.json CHANGED
@@ -1,28 +1,66 @@
1
1
  {
2
2
  "name": "@openreceive/angular",
3
- "version": "0.1.1",
3
+ "version": "0.2.2",
4
+ "description": "Angular wrapper for the OpenReceive checkout custom element.",
5
+ "keywords": [
6
+ "bitcoin",
7
+ "lightning",
8
+ "payments",
9
+ "nwc",
10
+ "bolt11",
11
+ "openreceive",
12
+ "angular",
13
+ "checkout"
14
+ ],
4
15
  "type": "module",
16
+ "sideEffects": [
17
+ "**/*.css"
18
+ ],
19
+ "main": "./dist/fesm2022/openreceive-angular.mjs",
20
+ "module": "./dist/fesm2022/openreceive-angular.mjs",
21
+ "types": "./dist/types/openreceive-angular.d.ts",
5
22
  "dependencies": {
6
- "@openreceive/browser": "0.1.1",
7
- "@openreceive/elements": "0.1.1"
23
+ "@openreceive/browser": "0.2.2",
24
+ "@openreceive/elements": "0.2.2"
8
25
  },
9
26
  "peerDependencies": {
10
27
  "@angular/core": ">=17.0.0"
11
28
  },
12
- "peerDependenciesMeta": {
13
- "@angular/core": {
14
- "optional": true
15
- }
16
- },
17
29
  "exports": {
18
- ".": "./dist/index.js",
19
- "./checkout-component": "./dist/openreceive-checkout.component.mjs",
30
+ ".": {
31
+ "types": "./dist/types/openreceive-angular.d.ts",
32
+ "default": "./dist/fesm2022/openreceive-angular.mjs"
33
+ },
34
+ "./checkout-component": {
35
+ "types": "./dist/types/openreceive-angular-checkout-component.d.ts",
36
+ "default": "./dist/fesm2022/openreceive-angular-checkout-component.mjs"
37
+ },
20
38
  "./styles.css": "./dist/styles.css"
21
39
  },
22
- "types": "./dist/index.d.ts",
23
40
  "files": [
24
41
  "dist",
25
42
  "README.md",
26
43
  "LICENSE"
27
- ]
28
- }
44
+ ],
45
+ "scripts": {
46
+ "build": "ng-packagr -p ng-package.json -c tsconfig.lib.json && node ../../../tools/package/copy-static.mjs src dist styles.css && node -e \"const{rmSync}=require('node:fs');for(const p of['dist/package.json','dist/.npmignore','dist/checkout-component/package.json'])rmSync(p,{force:true})\"",
47
+ "prepack": "npm run build"
48
+ },
49
+ "license": "MIT",
50
+ "author": "OpenReceive <info@openreceive.org>",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/openreceive/openreceive.git",
54
+ "directory": "packages/js/angular"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/openreceive/openreceive/issues"
58
+ },
59
+ "homepage": "https://openreceive.org",
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "engines": {
64
+ "node": ">=22"
65
+ }
66
+ }
package/dist/index.d.ts DELETED
@@ -1,39 +0,0 @@
1
- import { OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME, type CreateCheckoutShellOptions, type CheckoutElementAttributeOptions, type CheckoutElementAttributes, type CheckoutElementEventHandlers, type CheckoutElementListeners, type CheckoutController, type CheckoutControllerOptions, type CheckoutShellElements, type CheckoutShellOptions, type CheckoutSnapshot, type OpenReceiveStoredThemeModelOptions, type OpenReceiveThemeModel, type OpenReceiveThemeModelOptions, type OpenReceiveThemePreference, type OpenReceiveThemeToggleElementAttributeOptions, type OpenReceiveThemeToggleElementAttributes } from "@openreceive/browser/internal";
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 OpenReceiveAngularCheckoutBindingOptions extends CheckoutElementAttributeOptions, CheckoutElementEventHandlers {
8
- }
9
- export interface OpenReceiveAngularCheckoutBinding {
10
- readonly selector: typeof OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME;
11
- readonly attributes: CheckoutElementAttributes;
12
- readonly events: CheckoutElementListeners;
13
- }
14
- export interface OpenReceiveAngularThemeToggleBinding {
15
- readonly selector: typeof OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME;
16
- readonly attributes: OpenReceiveThemeToggleElementAttributes;
17
- }
18
- export interface OpenReceiveAngularCheckoutShellBinding {
19
- readonly theme: OpenReceiveThemeModel;
20
- readonly rootAttributes: OpenReceiveThemeModel["attributes"];
21
- readonly checkout: OpenReceiveAngularCheckoutBinding;
22
- readonly themeToggle: OpenReceiveAngularThemeToggleBinding;
23
- }
24
- export interface OpenReceiveAngularCheckoutComponentOptions extends CheckoutShellOptions {
25
- readonly defineElementsOptions?: DefineOpenReceiveElementsOptions;
26
- }
27
- export interface OpenReceiveAngularCheckoutComponentModel extends OpenReceiveAngularCheckoutShellBinding {
28
- readonly componentName: "Checkout";
29
- readonly defineElements: typeof defineOpenReceiveElements;
30
- readonly defineElementsOptions?: DefineOpenReceiveElementsOptions;
31
- }
32
- export declare function createOpenReceiveAngularCheckoutBinding(snapshot: CheckoutSnapshot, options?: OpenReceiveAngularCheckoutBindingOptions): OpenReceiveAngularCheckoutBinding;
33
- export declare function createOpenReceiveAngularThemeBinding(theme: OpenReceiveThemePreference, options?: OpenReceiveThemeModelOptions): OpenReceiveThemeModel;
34
- export declare function createOpenReceiveAngularStoredThemeBinding(options?: OpenReceiveStoredThemeModelOptions): OpenReceiveThemeModel;
35
- export declare function createOpenReceiveAngularThemeToggleBinding(options?: OpenReceiveThemeToggleElementAttributeOptions): OpenReceiveAngularThemeToggleBinding;
36
- export declare function createOpenReceiveAngularCheckoutShellBinding(snapshot: CheckoutSnapshot, options?: CheckoutShellOptions): OpenReceiveAngularCheckoutShellBinding;
37
- export declare function createOpenReceiveAngularCheckoutComponentModel(snapshot: CheckoutSnapshot, options?: OpenReceiveAngularCheckoutComponentOptions): OpenReceiveAngularCheckoutComponentModel;
38
- export declare function createOpenReceiveAngularCheckoutController(options: CheckoutControllerOptions): CheckoutController;
39
- export declare function createOpenReceiveAngularCheckoutShell(snapshot: CheckoutSnapshot, options?: CreateCheckoutShellOptions): CheckoutShellElements;
package/dist/index.js DELETED
@@ -1,55 +0,0 @@
1
- import { OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME, createCheckoutController, createCheckoutShell, createCheckoutShellModel, createCheckoutElementAttributes, createCheckoutElementListeners, createOpenReceiveStoredThemeModel, createOpenReceiveThemeModel, createOpenReceiveThemeToggleElementAttributes } from "@openreceive/browser/internal";
2
- import { defineOpenReceiveElements } 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 { defineOpenReceiveElements } from "@openreceive/elements";
5
- export function createOpenReceiveAngularCheckoutBinding(snapshot, options = {}) {
6
- return {
7
- selector: OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME,
8
- attributes: createCheckoutElementAttributes(snapshot, options),
9
- events: createCheckoutElementListeners(options)
10
- };
11
- }
12
- export function createOpenReceiveAngularThemeBinding(theme, options = {}) {
13
- return createOpenReceiveThemeModel(theme, options);
14
- }
15
- export function createOpenReceiveAngularStoredThemeBinding(options = {}) {
16
- return createOpenReceiveStoredThemeModel(options);
17
- }
18
- export function createOpenReceiveAngularThemeToggleBinding(options = {}) {
19
- return {
20
- selector: OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME,
21
- attributes: createOpenReceiveThemeToggleElementAttributes(options)
22
- };
23
- }
24
- export function createOpenReceiveAngularCheckoutShellBinding(snapshot, options = {}) {
25
- const shell = createCheckoutShellModel(snapshot, options);
26
- return {
27
- theme: shell.theme,
28
- rootAttributes: shell.rootAttributes,
29
- checkout: {
30
- selector: shell.checkout.tagName,
31
- attributes: shell.checkout.attributes,
32
- events: shell.checkout.listeners
33
- },
34
- themeToggle: {
35
- selector: shell.themeToggle.tagName,
36
- attributes: shell.themeToggle.attributes
37
- }
38
- };
39
- }
40
- export function createOpenReceiveAngularCheckoutComponentModel(snapshot, options = {}) {
41
- const { defineElementsOptions, ...shellOptions } = options;
42
- const shell = createOpenReceiveAngularCheckoutShellBinding(snapshot, shellOptions);
43
- return {
44
- componentName: "Checkout",
45
- defineElements: defineOpenReceiveElements,
46
- defineElementsOptions,
47
- ...shell
48
- };
49
- }
50
- export function createOpenReceiveAngularCheckoutController(options) {
51
- return createCheckoutController(options);
52
- }
53
- export function createOpenReceiveAngularCheckoutShell(snapshot, options = {}) {
54
- return createCheckoutShell(snapshot, options);
55
- }
@@ -1,79 +0,0 @@
1
- import { Component, CUSTOM_ELEMENTS_SCHEMA, Input } from "@angular/core";
2
- import {
3
- OPENRECEIVE_CHECKOUT_ELEMENT_EVENTS,
4
- createOpenReceiveAngularCheckoutShellBinding,
5
- defineOpenReceiveElements
6
- } from "./index.js";
7
-
8
- export class CheckoutComponent {
9
- snapshot;
10
- options = {};
11
-
12
- ngOnInit() {
13
- defineOpenReceiveElements();
14
- }
15
-
16
- get shell() {
17
- return createOpenReceiveAngularCheckoutShellBinding(
18
- this.snapshot,
19
- this.options
20
- );
21
- }
22
-
23
- get rootAttributes() {
24
- return this.shell.rootAttributes;
25
- }
26
-
27
- get checkoutAttributes() {
28
- return this.shell.checkout.attributes;
29
- }
30
-
31
- get themeToggleAttributes() {
32
- return this.shell.themeToggle.attributes;
33
- }
34
-
35
- onCheckoutEvent(eventName, event) {
36
- this.shell.checkout.events[eventName]?.(event);
37
- }
38
- }
39
-
40
- Input({ required: true })(CheckoutComponent.prototype, "snapshot");
41
- Input()(CheckoutComponent.prototype, "options");
42
-
43
- Component({
44
- selector: "openreceive-angular-checkout",
45
- standalone: true,
46
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
47
- template: `
48
- <section
49
- [attr.data-theme]="rootAttributes['data-theme']"
50
- [attr.data-openreceive-theme]="rootAttributes['data-openreceive-theme']"
51
- >
52
- <openreceive-theme-toggle
53
- [attr.root-selector]="themeToggleAttributes['root-selector']"
54
- [attr.checkout-selector]="themeToggleAttributes['checkout-selector']"
55
- [attr.default-theme]="themeToggleAttributes['default-theme']"
56
- [attr.storage-key]="themeToggleAttributes['storage-key']"
57
- ></openreceive-theme-toggle>
58
- <openreceive-checkout
59
- [attr.invoice-id]="checkoutAttributes['invoice-id']"
60
- [attr.invoice]="checkoutAttributes.invoice"
61
- [attr.payment-hash]="checkoutAttributes['payment-hash']"
62
- [attr.amount-msats]="checkoutAttributes['amount-msats']"
63
- [attr.status]="checkoutAttributes.status"
64
- [attr.expires-at]="checkoutAttributes['expires-at']"
65
- [attr.lookup-url]="checkoutAttributes['lookup-url']"
66
- [attr.theme]="checkoutAttributes.theme"
67
- [attr.payment-wizard]="checkoutAttributes['payment-wizard']"
68
- (openreceive-copy)="onCheckoutEvent(openReceiveEvents.copy, $event)"
69
- (openreceive-open-wallet)="onCheckoutEvent(openReceiveEvents.openWallet, $event)"
70
- (openreceive-state)="onCheckoutEvent(openReceiveEvents.state, $event)"
71
- (openreceive-settled)="onCheckoutEvent(openReceiveEvents.settled, $event)"
72
- (openreceive-error)="onCheckoutEvent(openReceiveEvents.error, $event)"
73
- (openreceive-provider-copy)="onCheckoutEvent(openReceiveEvents.providerCopy, $event)"
74
- ></openreceive-checkout>
75
- </section>
76
- `
77
- })(CheckoutComponent);
78
-
79
- CheckoutComponent.prototype.openReceiveEvents = OPENRECEIVE_CHECKOUT_ELEMENT_EVENTS;