@openreceive/angular 0.4.31 → 0.4.32

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.
@@ -68,7 +68,7 @@ var ElementBindingsDirective = class ElementBindingsDirective {
68
68
  }
69
69
  static ɵfac = i0.ɵɵngDeclareFactory({
70
70
  minVersion: "12.0.0",
71
- version: "22.2.2",
71
+ version: "22.2.4",
72
72
  ngImport: i0,
73
73
  type: ElementBindingsDirective,
74
74
  deps: [],
@@ -76,7 +76,7 @@ var ElementBindingsDirective = class ElementBindingsDirective {
76
76
  });
77
77
  static ɵdir = i0.ɵɵngDeclareDirective({
78
78
  minVersion: "14.0.0",
79
- version: "22.2.2",
79
+ version: "22.2.4",
80
80
  type: ElementBindingsDirective,
81
81
  isStandalone: true,
82
82
  selector: "[openreceiveElementBindings]",
@@ -87,7 +87,7 @@ var ElementBindingsDirective = class ElementBindingsDirective {
87
87
  };
88
88
  i0.ɵɵngDeclareClassMetadata({
89
89
  minVersion: "12.0.0",
90
- version: "22.2.2",
90
+ version: "22.2.4",
91
91
  ngImport: i0,
92
92
  type: ElementBindingsDirective,
93
93
  decorators: [{
@@ -193,7 +193,7 @@ var CheckoutComponent = class CheckoutComponent {
193
193
  }
194
194
  static ɵfac = i0.ɵɵngDeclareFactory({
195
195
  minVersion: "12.0.0",
196
- version: "22.2.2",
196
+ version: "22.2.4",
197
197
  ngImport: i0,
198
198
  type: CheckoutComponent,
199
199
  deps: [],
@@ -201,7 +201,7 @@ var CheckoutComponent = class CheckoutComponent {
201
201
  });
202
202
  static ɵcmp = i0.ɵɵngDeclareComponent({
203
203
  minVersion: "17.0.0",
204
- version: "22.2.2",
204
+ version: "22.2.4",
205
205
  type: CheckoutComponent,
206
206
  isStandalone: true,
207
207
  selector: "openreceive-angular-checkout",
@@ -256,7 +256,7 @@ var CheckoutComponent = class CheckoutComponent {
256
256
  };
257
257
  i0.ɵɵngDeclareClassMetadata({
258
258
  minVersion: "12.0.0",
259
- version: "22.2.2",
259
+ version: "22.2.4",
260
260
  ngImport: i0,
261
261
  type: CheckoutComponent,
262
262
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"openreceive-angular-checkout-component.mjs","names":[],"sources":["../../src/element-bindings.ts","../../src/openreceive-element-bindings.directive.ts","../../src/openreceive-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 type AfterViewInit,\n ChangeDetectorRef,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n Input,\n inject,\n NgZone,\n type OnChanges,\n} from \"@angular/core\";\nimport {\n type CheckoutSnapshot,\n createWrapperCheckoutShellBinding,\n defineElements,\n type ThemePreference,\n validateCheckoutProps,\n type WrapperCheckoutShellBinding,\n type WrapperCheckoutShellOptions,\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() csrfHeader?: 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() resumePaymentHash?: string;\n @Input() resumePaymentRail?: \"lightning\" | \"swap\";\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 resumePaymentHash: this.resumePaymentHash,\n resumePaymentRail: this.resumePaymentRail,\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.csrfHeader === undefined ? {} : { csrfHeader: this.csrfHeader }),\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.resumePaymentHash === undefined\n ? {}\n : { resumePaymentHash: this.resumePaymentHash }),\n ...(this.resumePaymentRail === undefined\n ? {}\n : { resumePaymentRail: this.resumePaymentRail }),\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"],"mappings":";;;AA6BA,MAAa,iCAAyD;CACpE,YAAY,CAAA;CACZ,WAAW,CAAA;AACZ;AAED,SAAgB,qBACd,SACA,UACA,SAA+B;CAE/B,OAAO;EACL,YAAY,eAAe,SAAS,SAAS,cAAc,CAAA,GAAI,QAAQ,UAAU;EACjF,WAAW,cAAc,SAAS,SAAS,aAAa,CAAA,GAAI,QAAQ,SAAS;CAC9E;AACH;AAEA,SAAgB,uBACd,SACA,WAA4B;CAE5B,KAAK,MAAM,CAAC,MAAM,YAAY,WAAW,QAAQ,oBAAoB,MAAM,OAAO;AACpF;AAEA,SAAS,eACP,SACA,YACA,SAA0B;CAE1B,KAAK,MAAM,QAAQ,SACjB,IAAI,WAAW,UAAU,QAAW,QAAQ,gBAAgB,IAAI;CAElE,MAAM,OAAiB,CAAA;CACvB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,GAAG;EACtD,IAAI,UAAU,QAAW;EACzB,IAAI,QAAQ,aAAa,IAAI,MAAM,OAAO,QAAQ,aAAa,MAAM,KAAK;E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A,EAAA,MAAA,MAAA,CAAA"}
1
+ {"version":3,"file":"openreceive-angular-checkout-component.mjs","names":[],"sources":["../../src/element-bindings.ts","../../src/openreceive-element-bindings.directive.ts","../../src/openreceive-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 type AfterViewInit,\n ChangeDetectorRef,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n Input,\n inject,\n NgZone,\n type OnChanges,\n} from \"@angular/core\";\nimport {\n type CheckoutSnapshot,\n createWrapperCheckoutShellBinding,\n defineElements,\n type ThemePreference,\n validateCheckoutProps,\n type WrapperCheckoutShellBinding,\n type WrapperCheckoutShellOptions,\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() csrfHeader?: 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() resumePaymentHash?: string;\n @Input() resumePaymentRail?: \"lightning\" | \"swap\";\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 resumePaymentHash: this.resumePaymentHash,\n resumePaymentRail: this.resumePaymentRail,\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.csrfHeader === undefined ? {} : { csrfHeader: this.csrfHeader }),\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.resumePaymentHash === undefined\n ? {}\n : { resumePaymentHash: this.resumePaymentHash }),\n ...(this.resumePaymentRail === undefined\n ? {}\n : { resumePaymentRail: this.resumePaymentRail }),\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"],"mappings":";;;AA6BA,MAAa,iCAAyD;CACpE,YAAY,CAAA;CACZ,WAAW,CAAA;AACZ;AAED,SAAgB,qBACd,SACA,UACA,SAA+B;CAE/B,OAAO;EACL,YAAY,eAAe,SAAS,SAAS,cAAc,CAAA,GAAI,QAAQ,UAAU;EACjF,WAAW,cAAc,SAAS,SAAS,aAAa,CAAA,GAAI,QAAQ,SAAS;CAC9E;AACH;AAEA,SAAgB,uBACd,SACA,WAA4B;CAE5B,KAAK,MAAM,CAAC,MAAM,YAAY,WAAW,QAAQ,oBAAoB,MAAM,OAAO;AACpF;AAEA,SAAS,eACP,SACA,YACA,SAA0B;CAE1B,KAAK,MAAM,QAAQ,SACjB,IAAI,WAAW,UAAU,QAAW,QAAQ,gBAAgB,IAAI;CAElE,MAAM,OAAiB,CAAA;CACvB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,GAAG;EACtD,IAAI,UAAU,QAAW;EACzB,IAAI,QAAQ,aAAa,IAAI,MAAM,OAAO,QAAQ,aAAa,MAAM,KAAK;EAC1E,KAAK,KAAK,IAAI;CAChB;CACA,OAAO;AACT;AAEA,SAAS,cACP,SACA,W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AA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EAlB7B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,YAAY;GACZ,SAAS,CAAC,wBAAwB;GAClC,SAAS,CAAC,sBAAsB;GAChC,UAAU;;;;;;;;;;;;EAYX,CAAA;;;E,aAWE,MAAA,M;E,cACA,MAAA,M;E,WACA,MAAA,M;E,eACA,MAAA,M;E,kBACA,MAAA,M;E,kBACA,MAAA,M;E,gBACA,MAAA,M;E,iBACA,MAAA,M;E,eACA,MAAA,M;E,aAEA,MAAA,M;E,YACA,MAAA,M;E,qBACA,MAAA,M;E,mBACA,MAAA,M;E,sBACA,MAAA,M;E,sBACA,MAAA,M;E,cACA,MAAA,M;E,WACA,MAAA,M;E,iBACA,MAAA,M;E,YACA,MAAA,M;E,cACA,MAAA,M;E,mBACA,MAAA,M;E,gBACA,MAAA,M;E,YACA,MAAA,M;E,YACA,MAAA,M"}
@@ -13,21 +13,6 @@ interface ElementBindings {
13
13
  readonly attributes?: Readonly<Record<string, string | undefined>>;
14
14
  readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;
15
15
  }
16
- interface ElementBindingTarget {
17
- getAttribute(name: string): string | null;
18
- setAttribute(name: string, value: string): void;
19
- removeAttribute(name: string): void;
20
- addEventListener(name: string, listener: (event: Event) => void): void;
21
- removeEventListener(name: string, listener: (event: Event) => void): void;
22
- }
23
- type AttachedListeners = readonly (readonly [string, (event: Event) => void])[];
24
- interface AppliedElementBindings {
25
- readonly attributes: readonly string[];
26
- readonly listeners: AttachedListeners;
27
- }
28
- declare const EMPTY_APPLIED_ELEMENT_BINDINGS: AppliedElementBindings;
29
- declare function applyElementBindings(element: ElementBindingTarget, bindings: ElementBindings, applied: AppliedElementBindings): AppliedElementBindings;
30
- declare function detachElementListeners(element: ElementBindingTarget, listeners: AttachedListeners): void;
31
16
  export declare class CheckoutComponent implements AfterViewInit, OnChanges {
32
17
  checkout?: CheckoutSnapshot | null;
33
18
  reference?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openreceive/angular",
3
- "version": "0.4.31",
3
+ "version": "0.4.32",
4
4
  "description": "Angular component for Bitcoin Lightning checkout and optional USDT, USDC, SOL and ETH swaps.",
5
5
  "keywords": [
6
6
  "bitcoin",
@@ -26,8 +26,8 @@
26
26
  "module": "./dist/fesm2022/openreceive-angular.mjs",
27
27
  "types": "./dist/types/openreceive-angular.d.ts",
28
28
  "dependencies": {
29
- "@openreceive/browser": "0.4.31",
30
- "@openreceive/elements": "0.4.31"
29
+ "@openreceive/browser": "0.4.32",
30
+ "@openreceive/elements": "0.4.32"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@angular/core": ">=17.0.0"