@openreceive/angular 0.2.4 → 0.3.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.
@@ -121,6 +121,7 @@ class CheckoutComponent {
121
121
  prefix;
122
122
  paymentWizard;
123
123
  decodeLinkUrl;
124
+ assetBaseUrl;
124
125
  themeToggle;
125
126
  defaultTheme;
126
127
  storageKey;
@@ -129,6 +130,7 @@ class CheckoutComponent {
129
130
  syncUrl;
130
131
  resumePathPrefix;
131
132
  routeReference;
133
+ resumable;
132
134
  onCopy;
133
135
  onOpenWallet;
134
136
  onState;
@@ -198,12 +200,14 @@ class CheckoutComponent {
198
200
  ...(this.prefix === undefined ? {} : { prefix: this.prefix }),
199
201
  ...(this.paymentWizard === undefined ? {} : { paymentWizard: this.paymentWizard }),
200
202
  ...(this.decodeLinkUrl === undefined ? {} : { decodeLinkUrl: this.decodeLinkUrl }),
203
+ ...(this.assetBaseUrl === undefined ? {} : { assetBaseUrl: this.assetBaseUrl }),
201
204
  ...(this.defaultTheme === undefined ? {} : { defaultTheme: this.defaultTheme }),
202
205
  ...(this.storageKey === undefined ? {} : { storageKey: this.storageKey }),
203
206
  ...(this.metadata === undefined ? {} : { metadata: this.metadata }),
204
207
  ...(this.syncUrl === undefined ? {} : { syncUrl: this.syncUrl }),
205
208
  ...(this.resumePathPrefix === undefined ? {} : { resumePathPrefix: this.resumePathPrefix }),
206
209
  ...(this.routeReference === undefined ? {} : { routeReference: this.routeReference }),
210
+ ...(this.resumable === undefined ? {} : { resumable: this.resumable }),
207
211
  ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),
208
212
  ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),
209
213
  ...(this.onState === undefined ? {} : { onState: this.onState }),
@@ -215,7 +219,7 @@ class CheckoutComponent {
215
219
  return createWrapperCheckoutShellBinding(this.checkout ?? null, options);
216
220
  }
217
221
  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: `
222
+ 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", assetBaseUrl: "assetBaseUrl", themeToggle: "themeToggle", defaultTheme: "defaultTheme", storageKey: "storageKey", metadata: "metadata", syncUrl: "syncUrl", resumePathPrefix: "resumePathPrefix", routeReference: "routeReference", resumable: "resumable", onCopy: "onCopy", onOpenWallet: "onOpenWallet", onState: "onState", onSettled: "onSettled", onProviderCopy: "onProviderCopy", onStartOver: "onStartOver", onError: "onError", options: "options" }, usesOnChanges: true, ngImport: i0, template: `
219
223
  <section [openreceiveElementBindings]="rootBindings">
220
224
  @if (elementsReady && shell; as shell) {
221
225
  @if (shell.themeToggle) {
@@ -258,6 +262,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImpor
258
262
  type: Input
259
263
  }], decodeLinkUrl: [{
260
264
  type: Input
265
+ }], assetBaseUrl: [{
266
+ type: Input
261
267
  }], themeToggle: [{
262
268
  type: Input
263
269
  }], defaultTheme: [{
@@ -272,6 +278,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImpor
272
278
  type: Input
273
279
  }], routeReference: [{
274
280
  type: Input
281
+ }], resumable: [{
282
+ type: Input
275
283
  }], onCopy: [{
276
284
  type: Input
277
285
  }], onOpenWallet: [{
@@ -1 +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,OAAO,CAAC,UAAU,CAAC;AAClF,QAAA,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC;KAC/E;AACH;AAEM,SAAU,sBAAsB,CACpC,OAA6B,EAC7B,SAA4B,EAAA;AAE5B,IAAA,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,SAAS;AAAE,QAAA,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC;AACrF;AAEA,SAAS,cAAc,CACrB,OAA6B,EAC7B,UAAwD,EACxD,OAA0B,EAAA;AAE1B,IAAA,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;AAC1B,QAAA,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,SAAS;AAAE,Y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AAA,QAAA,EAAA,UAAA,EAAA,OAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,QAAA,EAAA,YAAA,EAAA,cAAA,EAAA,OAAA,EAAA,SAAA,EAAA,SAAA,EAAA,WAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAblB;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAbS,wBAAwB,EAAA,QAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,CAAA,4BAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAevB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAlB7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,UAAU,EAAE,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;;;;"}
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() assetBaseUrl?: 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() resumable?: boolean;\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.assetBaseUrl === undefined ? {} : { assetBaseUrl: this.assetBaseUrl }),\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.resumable === undefined ? {} : { resumable: this.resumable }),\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,OAAO,CAAC,UAAU,CAAC;AAClF,QAAA,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC;KAC/E;AACH;AAEM,SAAU,sBAAsB,CACpC,OAA6B,EAC7B,SAA4B,EAAA;AAE5B,IAAA,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,SAAS;AAAE,QAAA,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC;AACrF;AAEA,SAAS,cAAc,CACrB,OAA6B,EAC7B,UAAwD,EACxD,OAA0B,EAAA;AAE1B,IAAA,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;AAC1B,QAAA,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,SAAS;AAAE,YAAA,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;IACnE;IACA,MAAM,IAAI,GAAa,EAAE;AACzB,IAAA,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACtD,IAAI,KAAK,KAAK,SAAS;YAAE;AACzB,QAAA,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,KAAK;AA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AAA,EAAA,UAAA,EAAA,OAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,WAAA,EAAA,MAAA,EAAA,QAAA,EAAA,YAAA,EAAA,cAAA,EAAA,OAAA,EAAA,SAAA,EAAA,SAAA,EAAA,WAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAblB;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAbS,wBAAwB,EAAA,QAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,CAAA,4BAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAevB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAlB7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,UAAU,EAAE,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;;sBACA;;sBAEA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;ACxEH;;AAEG;;;;"}
@@ -21,6 +21,7 @@ declare class CheckoutComponent implements AfterViewInit, OnChanges {
21
21
  prefix?: string;
22
22
  paymentWizard?: boolean;
23
23
  decodeLinkUrl?: string;
24
+ assetBaseUrl?: string;
24
25
  themeToggle?: boolean;
25
26
  defaultTheme?: ThemePreference;
26
27
  storageKey?: string;
@@ -28,6 +29,7 @@ declare class CheckoutComponent implements AfterViewInit, OnChanges {
28
29
  syncUrl?: boolean;
29
30
  resumePathPrefix?: string;
30
31
  routeReference?: string;
32
+ resumable?: boolean;
31
33
  onCopy?: (event: Event) => void;
32
34
  onOpenWallet?: (event: Event) => void;
33
35
  onState?: (event: Event) => void;
@@ -53,7 +55,7 @@ declare class CheckoutComponent implements AfterViewInit, OnChanges {
53
55
  private applyShell;
54
56
  private buildShell;
55
57
  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>;
58
+ 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; }; "assetBaseUrl": { "alias": "assetBaseUrl"; "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; }; "resumable": { "alias": "resumable"; "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
59
  }
58
60
 
59
61
  export { CheckoutComponent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openreceive/angular",
3
- "version": "0.2.4",
3
+ "version": "0.3.1",
4
4
  "description": "Angular wrapper for the OpenReceive checkout custom element.",
5
5
  "keywords": [
6
6
  "bitcoin",
@@ -20,8 +20,8 @@
20
20
  "module": "./dist/fesm2022/openreceive-angular.mjs",
21
21
  "types": "./dist/types/openreceive-angular.d.ts",
22
22
  "dependencies": {
23
- "@openreceive/browser": "0.2.4",
24
- "@openreceive/elements": "0.2.4"
23
+ "@openreceive/browser": "0.3.1",
24
+ "@openreceive/elements": "0.3.1"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@angular/core": ">=17.0.0"