@inttegro/angular 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Inttegro
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/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # `@inttegro/angular`
2
+
3
+ Angular adapter for Inttegro hosted workflows. The component automatically uses
4
+ `@inttegro/js` to load the executable runtime from Inttegro's fixed origin; it
5
+ does not bundle the payment-collection runtime.
6
+
7
+ ```ts
8
+ import { CheckoutComponent } from '@inttegro/angular'
9
+
10
+ @Component({
11
+ imports: [CheckoutComponent],
12
+ template:
13
+ '<inttegro-checkout [orderId]="orderId" (completed)="onCompleted()" />',
14
+ })
15
+ export class PaymentPage {}
16
+ ```
@@ -0,0 +1,185 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, ViewChild, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { loadInttegro } from '@inttegro/js';
4
+
5
+ /**
6
+ * Standalone Angular component that embeds Inttegro-hosted Checkout.
7
+ *
8
+ * Add the component to a host component's `imports` array. It loads the hosted
9
+ * runtime after its view initializes, creates one controller, and destroys that
10
+ * controller with the Angular view. Changing `orderId`, `timeout`, or `title`
11
+ * replaces the controller; changing `appearance` or `locale` updates it in
12
+ * place.
13
+ *
14
+ * Keep this component mounted while a payment attempt or confirmation is
15
+ * pending. The successful `completed` output is suitable for navigation, but
16
+ * fulfillment must use server-retrieved Order state or a signed webhook.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * @Component({
21
+ * standalone: true,
22
+ * imports: [CheckoutComponent],
23
+ * template: `
24
+ * <inttegro-checkout
25
+ * [orderId]="orderId"
26
+ * [appearance]="{ theme: 'system' }"
27
+ * (completed)="onCompleted()"
28
+ * (error)="onError($event)"
29
+ * />
30
+ * `,
31
+ * })
32
+ * export class PaymentPage {
33
+ * orderId = input.required<string>()
34
+ * onCompleted(): void { location.assign('/orders/complete') }
35
+ * onError(error: CheckoutErrorEvent | Error): void {
36
+ * reportCheckoutError(error)
37
+ * }
38
+ * }
39
+ * ```
40
+ *
41
+ * @category Angular
42
+ */
43
+ class CheckoutComponent {
44
+ constructor() {
45
+ /** Client-safe reference for the finalized Order being paid. */
46
+ this.orderId = '';
47
+ /** Emitted after Checkout reports its successful terminal state. */
48
+ this.completed = new EventEmitter();
49
+ /** Emitted for loader/mount failures and sanitized hosted errors. */
50
+ this.error = new EventEmitter();
51
+ /** Emitted for every sanitized hosted Checkout lifecycle event. */
52
+ this.event = new EventEmitter();
53
+ /** Emitted once the iframe is interactive. */
54
+ this.ready = new EventEmitter();
55
+ this.viewReady = false;
56
+ this.generation = 0;
57
+ }
58
+ ngAfterViewInit() {
59
+ this.viewReady = true;
60
+ void this.mountCheckout();
61
+ }
62
+ ngOnChanges(changes) {
63
+ if (!this.viewReady)
64
+ return;
65
+ if (changes['orderId'] || changes['timeout'] || changes['title']) {
66
+ void this.mountCheckout();
67
+ return;
68
+ }
69
+ if (changes['appearance'] || changes['locale']) {
70
+ this.checkout?.update(definedOptions({ appearance: this.appearance, locale: this.locale }));
71
+ }
72
+ }
73
+ ngOnDestroy() {
74
+ this.destroyCheckout();
75
+ }
76
+ /**
77
+ * Moves focus into hosted Checkout when its controller is ready.
78
+ * Before initialization or after teardown this method safely does nothing.
79
+ */
80
+ focus() {
81
+ this.checkout?.focus();
82
+ }
83
+ /**
84
+ * Applies a new locale or color scheme when a controller exists.
85
+ * Prefer binding `appearance` and `locale` for declarative Angular views.
86
+ */
87
+ update(options) {
88
+ this.checkout?.update(options);
89
+ }
90
+ async mountCheckout() {
91
+ if (!this.container)
92
+ return;
93
+ this.destroyCheckout();
94
+ const generation = this.generation;
95
+ const target = this.container.nativeElement;
96
+ try {
97
+ const inttegro = await loadInttegro();
98
+ if (generation !== this.generation || !inttegro)
99
+ return;
100
+ const checkout = inttegro.createCheckout(definedOptions({
101
+ appearance: this.appearance,
102
+ locale: this.locale,
103
+ orderId: this.orderId,
104
+ timeout: this.timeout,
105
+ title: this.title,
106
+ }));
107
+ if (generation !== this.generation) {
108
+ checkout.destroy();
109
+ return;
110
+ }
111
+ this.checkout = checkout;
112
+ this.unsubscribe = checkout.onEvent((event) => {
113
+ this.event.emit(event);
114
+ if (event.type === 'ready')
115
+ this.ready.emit(event);
116
+ if (event.type === 'completed')
117
+ this.completed.emit(event);
118
+ if (event.type === 'error')
119
+ this.error.emit(event);
120
+ });
121
+ await checkout.mount(target);
122
+ }
123
+ catch (error) {
124
+ if (generation !== this.generation)
125
+ return;
126
+ this.error.emit(error instanceof Error ? error : new Error('Checkout failed to load.'));
127
+ }
128
+ }
129
+ destroyCheckout() {
130
+ this.generation += 1;
131
+ this.unsubscribe?.();
132
+ this.unsubscribe = undefined;
133
+ this.checkout?.destroy();
134
+ this.checkout = undefined;
135
+ }
136
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CheckoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
137
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.5", type: CheckoutComponent, isStandalone: true, selector: "inttegro-checkout", inputs: { appearance: "appearance", locale: "locale", orderId: "orderId", timeout: "timeout", title: "title" }, outputs: { completed: "completed", error: "error", event: "event", ready: "ready" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #container></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
138
+ }
139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CheckoutComponent, decorators: [{
140
+ type: Component,
141
+ args: [{
142
+ selector: 'inttegro-checkout',
143
+ standalone: true,
144
+ template: '<div #container></div>',
145
+ changeDetection: ChangeDetectionStrategy.OnPush,
146
+ }]
147
+ }], propDecorators: { appearance: [{
148
+ type: Input
149
+ }], locale: [{
150
+ type: Input
151
+ }], orderId: [{
152
+ type: Input,
153
+ args: [{ required: true }]
154
+ }], timeout: [{
155
+ type: Input
156
+ }], title: [{
157
+ type: Input
158
+ }], completed: [{
159
+ type: Output
160
+ }], error: [{
161
+ type: Output
162
+ }], event: [{
163
+ type: Output
164
+ }], ready: [{
165
+ type: Output
166
+ }], container: [{
167
+ type: ViewChild,
168
+ args: ['container', { static: true }]
169
+ }] } });
170
+ function definedOptions(options) {
171
+ return Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined));
172
+ }
173
+
174
+ /**
175
+ * Angular standalone component adapter for Inttegro-hosted Checkout.
176
+ *
177
+ * @module @inttegro/angular
178
+ */
179
+
180
+ /**
181
+ * Generated bundle index. Do not edit.
182
+ */
183
+
184
+ export { CheckoutComponent };
185
+ //# sourceMappingURL=inttegro-angular.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inttegro-angular.mjs","sources":["../../src/lib/checkout.component.ts","../../src/public-api.ts","../../src/inttegro-angular.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n type AfterViewInit,\n type OnChanges,\n type OnDestroy,\n type SimpleChanges,\n} from '@angular/core'\nimport {\n loadInttegro,\n type CheckoutAppearance,\n type CheckoutController,\n type CheckoutErrorEvent,\n type CheckoutEvent,\n type CheckoutUpdateOptions,\n} from '@inttegro/js'\n\n/**\n * Standalone Angular component that embeds Inttegro-hosted Checkout.\n *\n * Add the component to a host component's `imports` array. It loads the hosted\n * runtime after its view initializes, creates one controller, and destroys that\n * controller with the Angular view. Changing `orderId`, `timeout`, or `title`\n * replaces the controller; changing `appearance` or `locale` updates it in\n * place.\n *\n * Keep this component mounted while a payment attempt or confirmation is\n * pending. The successful `completed` output is suitable for navigation, but\n * fulfillment must use server-retrieved Order state or a signed webhook.\n *\n * @example\n * ```ts\n * @Component({\n * standalone: true,\n * imports: [CheckoutComponent],\n * template: `\n * <inttegro-checkout\n * [orderId]=\"orderId\"\n * [appearance]=\"{ theme: 'system' }\"\n * (completed)=\"onCompleted()\"\n * (error)=\"onError($event)\"\n * />\n * `,\n * })\n * export class PaymentPage {\n * orderId = input.required<string>()\n * onCompleted(): void { location.assign('/orders/complete') }\n * onError(error: CheckoutErrorEvent | Error): void {\n * reportCheckoutError(error)\n * }\n * }\n * ```\n *\n * @category Angular\n */\n@Component({\n selector: 'inttegro-checkout',\n standalone: true,\n template: '<div #container></div>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CheckoutComponent implements AfterViewInit, OnChanges, OnDestroy {\n /** Initial and reactive theme preference for hosted Checkout. */\n @Input() appearance?: CheckoutAppearance\n /** Initial and reactive BCP 47 locale preference. */\n @Input() locale?: string\n /** Client-safe reference for the finalized Order being paid. */\n @Input({ required: true }) orderId = ''\n /** Mount timeout from 1,000–60,000 ms; defaults to 15,000 ms. */\n @Input() timeout?: number\n /** Accessible iframe title; defaults to `Checkout`. */\n @Input() title?: string\n\n /** Emitted after Checkout reports its successful terminal state. */\n @Output() readonly completed = new EventEmitter<\n Extract<CheckoutEvent, { type: 'completed' }>\n >()\n /** Emitted for loader/mount failures and sanitized hosted errors. */\n @Output() readonly error = new EventEmitter<CheckoutErrorEvent | Error>()\n /** Emitted for every sanitized hosted Checkout lifecycle event. */\n @Output() readonly event = new EventEmitter<CheckoutEvent>()\n /** Emitted once the iframe is interactive. */\n @Output() readonly ready = new EventEmitter<\n Extract<CheckoutEvent, { type: 'ready' }>\n >()\n\n @ViewChild('container', { static: true })\n private container?: ElementRef<HTMLDivElement>\n\n private checkout: CheckoutController | undefined\n private unsubscribe: (() => void) | undefined\n private viewReady = false\n private generation = 0\n\n ngAfterViewInit(): void {\n this.viewReady = true\n void this.mountCheckout()\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.viewReady) return\n\n if (changes['orderId'] || changes['timeout'] || changes['title']) {\n void this.mountCheckout()\n return\n }\n\n if (changes['appearance'] || changes['locale']) {\n this.checkout?.update(\n definedOptions({ appearance: this.appearance, locale: this.locale }),\n )\n }\n }\n\n ngOnDestroy(): void {\n this.destroyCheckout()\n }\n\n /**\n * Moves focus into hosted Checkout when its controller is ready.\n * Before initialization or after teardown this method safely does nothing.\n */\n focus(): void {\n this.checkout?.focus()\n }\n\n /**\n * Applies a new locale or color scheme when a controller exists.\n * Prefer binding `appearance` and `locale` for declarative Angular views.\n */\n update(options: CheckoutUpdateOptions): void {\n this.checkout?.update(options)\n }\n\n private async mountCheckout(): Promise<void> {\n if (!this.container) return\n this.destroyCheckout()\n const generation = this.generation\n const target = this.container.nativeElement\n\n try {\n const inttegro = await loadInttegro()\n if (generation !== this.generation || !inttegro) return\n const checkout = inttegro.createCheckout(\n definedOptions({\n appearance: this.appearance,\n locale: this.locale,\n orderId: this.orderId,\n timeout: this.timeout,\n title: this.title,\n }),\n )\n if (generation !== this.generation) {\n checkout.destroy()\n return\n }\n this.checkout = checkout\n this.unsubscribe = checkout.onEvent((event) => {\n this.event.emit(event)\n if (event.type === 'ready') this.ready.emit(event)\n if (event.type === 'completed') this.completed.emit(event)\n if (event.type === 'error') this.error.emit(event)\n })\n await checkout.mount(target)\n } catch (error) {\n if (generation !== this.generation) return\n this.error.emit(\n error instanceof Error ? error : new Error('Checkout failed to load.'),\n )\n }\n }\n\n private destroyCheckout(): void {\n this.generation += 1\n this.unsubscribe?.()\n this.unsubscribe = undefined\n this.checkout?.destroy()\n this.checkout = undefined\n }\n}\n\nfunction definedOptions<Value extends object>(options: Value): Value {\n return Object.fromEntries(\n Object.entries(options).filter(([, value]) => value !== undefined),\n ) as Value\n}\n","/**\n * Angular standalone component adapter for Inttegro-hosted Checkout.\n *\n * @module @inttegro/angular\n */\nexport { CheckoutComponent } from './lib/checkout.component'\nexport type {\n CheckoutAppearance,\n CheckoutErrorEvent,\n CheckoutEvent,\n CheckoutTheme,\n} from '@inttegro/js'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;MAOU,iBAAiB,CAAA;AAN9B,IAAA,WAAA,GAAA;;QAY6B,IAAA,CAAA,OAAO,GAAG,EAAE;;AAOpB,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAE5C;;AAEgB,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAA8B;;AAEtD,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAAiB;;AAEzC,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAExC;QAOK,IAAA,CAAA,SAAS,GAAG,KAAK;QACjB,IAAA,CAAA,UAAU,GAAG,CAAC;AAuFvB,IAAA;IArFC,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI;A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ows",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=18"
8
+ },
9
+ "dependencies": {
10
+ "@inttegro/js": "0.1.0",
11
+ "tslib": "^2.8.1"
12
+ },
13
+ "peerDependencies": {
14
+ "@angular/common": ">=18 <23",
15
+ "@angular/core": ">=18 <23"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/zebodotdev/js.git",
20
+ "directory": "packages/angular"
21
+ },
22
+ "homepage": "https://studio.inttegro.com/web/angular",
23
+ "author": "Inttegro Eng <engineering@inttegro.com> (https://inttegro.com)",
24
+ "license": "MIT",
25
+ "publishConfig": {
26
+ "access": "public",
27
+ "provenance": true
28
+ },
29
+ "typedocOptions": {
30
+ "entryPoints": [
31
+ "src/public-api.ts"
32
+ ]
33
+ },
34
+ "module": "fesm2022/inttegro-angular.mjs",
35
+ "typings": "types/inttegro-angular.d.ts",
36
+ "exports": {
37
+ "./package.json": {
38
+ "default": "./package.json"
39
+ },
40
+ ".": {
41
+ "types": "./types/inttegro-angular.d.ts",
42
+ "default": "./fesm2022/inttegro-angular.mjs"
43
+ }
44
+ },
45
+ "sideEffects": false
46
+ }
@@ -0,0 +1,89 @@
1
+ import * as _inttegro_js from '@inttegro/js';
2
+ import { CheckoutAppearance, CheckoutErrorEvent, CheckoutEvent, CheckoutUpdateOptions } from '@inttegro/js';
3
+ export { CheckoutAppearance, CheckoutErrorEvent, CheckoutEvent, CheckoutTheme } from '@inttegro/js';
4
+ import * as i0 from '@angular/core';
5
+ import { AfterViewInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges } from '@angular/core';
6
+
7
+ /**
8
+ * Standalone Angular component that embeds Inttegro-hosted Checkout.
9
+ *
10
+ * Add the component to a host component's `imports` array. It loads the hosted
11
+ * runtime after its view initializes, creates one controller, and destroys that
12
+ * controller with the Angular view. Changing `orderId`, `timeout`, or `title`
13
+ * replaces the controller; changing `appearance` or `locale` updates it in
14
+ * place.
15
+ *
16
+ * Keep this component mounted while a payment attempt or confirmation is
17
+ * pending. The successful `completed` output is suitable for navigation, but
18
+ * fulfillment must use server-retrieved Order state or a signed webhook.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * @Component({
23
+ * standalone: true,
24
+ * imports: [CheckoutComponent],
25
+ * template: `
26
+ * <inttegro-checkout
27
+ * [orderId]="orderId"
28
+ * [appearance]="{ theme: 'system' }"
29
+ * (completed)="onCompleted()"
30
+ * (error)="onError($event)"
31
+ * />
32
+ * `,
33
+ * })
34
+ * export class PaymentPage {
35
+ * orderId = input.required<string>()
36
+ * onCompleted(): void { location.assign('/orders/complete') }
37
+ * onError(error: CheckoutErrorEvent | Error): void {
38
+ * reportCheckoutError(error)
39
+ * }
40
+ * }
41
+ * ```
42
+ *
43
+ * @category Angular
44
+ */
45
+ declare class CheckoutComponent implements AfterViewInit, OnChanges, OnDestroy {
46
+ /** Initial and reactive theme preference for hosted Checkout. */
47
+ appearance?: CheckoutAppearance;
48
+ /** Initial and reactive BCP 47 locale preference. */
49
+ locale?: string;
50
+ /** Client-safe reference for the finalized Order being paid. */
51
+ orderId: string;
52
+ /** Mount timeout from 1,000–60,000 ms; defaults to 15,000 ms. */
53
+ timeout?: number;
54
+ /** Accessible iframe title; defaults to `Checkout`. */
55
+ title?: string;
56
+ /** Emitted after Checkout reports its successful terminal state. */
57
+ readonly completed: EventEmitter<_inttegro_js.CheckoutCompletedEvent>;
58
+ /** Emitted for loader/mount failures and sanitized hosted errors. */
59
+ readonly error: EventEmitter<CheckoutErrorEvent | Error>;
60
+ /** Emitted for every sanitized hosted Checkout lifecycle event. */
61
+ readonly event: EventEmitter<CheckoutEvent>;
62
+ /** Emitted once the iframe is interactive. */
63
+ readonly ready: EventEmitter<_inttegro_js.CheckoutReadyEvent>;
64
+ private container?;
65
+ private checkout;
66
+ private unsubscribe;
67
+ private viewReady;
68
+ private generation;
69
+ ngAfterViewInit(): void;
70
+ ngOnChanges(changes: SimpleChanges): void;
71
+ ngOnDestroy(): void;
72
+ /**
73
+ * Moves focus into hosted Checkout when its controller is ready.
74
+ * Before initialization or after teardown this method safely does nothing.
75
+ */
76
+ focus(): void;
77
+ /**
78
+ * Applies a new locale or color scheme when a controller exists.
79
+ * Prefer binding `appearance` and `locale` for declarative Angular views.
80
+ */
81
+ update(options: CheckoutUpdateOptions): void;
82
+ private mountCheckout;
83
+ private destroyCheckout;
84
+ static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutComponent, never>;
85
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutComponent, "inttegro-checkout", never, { "appearance": { "alias": "appearance"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "orderId": { "alias": "orderId"; "required": true; }; "timeout": { "alias": "timeout"; "required": false; }; "title": { "alias": "title"; "required": false; }; }, { "completed": "completed"; "error": "error"; "event": "event"; "ready": "ready"; }, never, never, true, never>;
86
+ }
87
+
88
+ export { CheckoutComponent };
89
+ //# sourceMappingURL=inttegro-angular.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inttegro-angular.d.ts","sources":["../../src/lib/checkout.component.ts"],"mappings":";;;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACH,cAMa,iBAAkB,YAAW,aAAa,EAAE,SAAS,EAAE,SAAS;;iBAErD,kBAAkB;;;;AAIb;;;;;;wBAOC,YAAA,CAAA,YAAA,CAAA,sBAAA;;oBAIJ,YAAA,CAAA,kBAAA,GAAA,KAAA;;oBAEA,YAAA,CAAA,aAAA;;oBAEA,YAAA,CAAA,YAAA,CAAA,kBAAA;;;;;;AAYxB;AAKA,yBAAqB,aAAa;AAelC;AAIA;;;AAGG;AACH;AAIA;;;AAGG;AACH,oBAAgB,qBAAqB;;AA0CrC;yCA/GW,iBAAiB;2CAAjB,iBAAiB;AAsH7B;;","names":[]}