@tesouro/embedded-components-react 0.11.30 → 0.11.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.
- package/README.md +1 -0
- package/dist/index.d.ts +18 -3
- package/dist/lib/CreditCardsWidget.d.ts +18 -3
- package/dist/lib/DebitCardsWidget.d.ts +14 -0
- package/dist/lib/WidgetSuite.d.ts +18 -3
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/CardsWidget.js +69 -66
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -539,6 +539,7 @@ Lists an organization's **debit** cards one page at a time, with a "Show my card
|
|
|
539
539
|
| `createCardLabels` | `PartialDeep<CreateCardWidgetLabels>` | English labels | Label overrides forwarded into the built-in create sheet. |
|
|
540
540
|
| `createCardFeatureLabels` | toast / untitled-funding overrides | English labels | Overrides the create sheet's toasts, untitled funding-account fallback and pending-activation success copy. |
|
|
541
541
|
| `onCreateCard` | `() => void` | `undefined` | Your own Create card handler. When supplied, the built-in sheet doesn't open. |
|
|
542
|
+
| `initialView` | `'create'` | `undefined` | Opens the built-in create sheet once on arrival, when Create card would open it. Ignored when `onCreateCard` is supplied. |
|
|
542
543
|
| `headerStart` | `ReactNode` | `undefined` | Your markup for the start of the header row, beside Create card. Put your heading here; you choose the element and level. |
|
|
543
544
|
| `onActivateCard` | `(cardId: string) => void` | `undefined` | Called when a row's Activate button is clicked. Omit it and the button isn't rendered. |
|
|
544
545
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3342,6 +3342,20 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
3342
3342
|
* nothing.
|
|
3343
3343
|
*/
|
|
3344
3344
|
onCreateCard?: () => void;
|
|
3345
|
+
/**
|
|
3346
|
+
* Arrival prop (EMBD-6962): `'create'` lands the reader on the built-in
|
|
3347
|
+
* create sheet instead of the bare list, e.g. from a dashboard "Issue card"
|
|
3348
|
+
* shortcut. Same name and shape as `ReceivablesWidget.initialView`
|
|
3349
|
+
* (EMBD-4184), the other "open on the create form" arrival in the package.
|
|
3350
|
+
*
|
|
3351
|
+
* Read once, when the token's scopes first resolve: the sheet opens only if
|
|
3352
|
+
* the built-in flow is available then (debit, `canCreateCard`, and no host
|
|
3353
|
+
* `onCreateCard`); otherwise the list shows as usual. Closing the sheet
|
|
3354
|
+
* returns to the list and nothing reopens it, and a later change to this
|
|
3355
|
+
* prop is ignored. It is not a controlled value: the widget reads no router,
|
|
3356
|
+
* so a host mirroring it into the URL should clear that param itself.
|
|
3357
|
+
*/
|
|
3358
|
+
initialView?: 'create';
|
|
3345
3359
|
/**
|
|
3346
3360
|
* Your own markup for the start of the list's header row, beside Create card,
|
|
3347
3361
|
* typically the heading you would otherwise render above the widget. The
|
|
@@ -3369,13 +3383,14 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
3369
3383
|
/**
|
|
3370
3384
|
* Derived from the internal props rather than restated, so the two cannot drift.
|
|
3371
3385
|
*
|
|
3372
|
-
*
|
|
3373
|
-
* props
|
|
3386
|
+
* Five omissions, not one. `cardProgram` is pinned below. The four create-sheet
|
|
3387
|
+
* props (`initialView` among them, since it only ever opens that sheet) are
|
|
3388
|
+
* debit-only: the built-in sheet issues against `POST /credit-cards`'s
|
|
3374
3389
|
* sibling and `CreateCardWidget` covers debit alone, so credit's Create card
|
|
3375
3390
|
* needs a host `onCreateCard` or the button hides. That was prose in the doc; the
|
|
3376
3391
|
* type says it here.
|
|
3377
3392
|
*/
|
|
3378
|
-
type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc' | 'createCardLabels' | 'createCardFeatureLabels'>;
|
|
3393
|
+
type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc' | 'createCardLabels' | 'createCardFeatureLabels' | 'initialView'>;
|
|
3379
3394
|
/**
|
|
3380
3395
|
* One page of an organization's **credit** cards, with a scope-gated Show my
|
|
3381
3396
|
* cards toggle and per-row Activate affordance. Selecting a row opens that
|
|
@@ -1389,6 +1389,20 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
1389
1389
|
* nothing.
|
|
1390
1390
|
*/
|
|
1391
1391
|
onCreateCard?: () => void;
|
|
1392
|
+
/**
|
|
1393
|
+
* Arrival prop (EMBD-6962): `'create'` lands the reader on the built-in
|
|
1394
|
+
* create sheet instead of the bare list, e.g. from a dashboard "Issue card"
|
|
1395
|
+
* shortcut. Same name and shape as `ReceivablesWidget.initialView`
|
|
1396
|
+
* (EMBD-4184), the other "open on the create form" arrival in the package.
|
|
1397
|
+
*
|
|
1398
|
+
* Read once, when the token's scopes first resolve: the sheet opens only if
|
|
1399
|
+
* the built-in flow is available then (debit, `canCreateCard`, and no host
|
|
1400
|
+
* `onCreateCard`); otherwise the list shows as usual. Closing the sheet
|
|
1401
|
+
* returns to the list and nothing reopens it, and a later change to this
|
|
1402
|
+
* prop is ignored. It is not a controlled value: the widget reads no router,
|
|
1403
|
+
* so a host mirroring it into the URL should clear that param itself.
|
|
1404
|
+
*/
|
|
1405
|
+
initialView?: 'create';
|
|
1392
1406
|
/**
|
|
1393
1407
|
* Your own markup for the start of the list's header row, beside Create card,
|
|
1394
1408
|
* typically the heading you would otherwise render above the widget. The
|
|
@@ -1416,13 +1430,14 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
1416
1430
|
/**
|
|
1417
1431
|
* Derived from the internal props rather than restated, so the two cannot drift.
|
|
1418
1432
|
*
|
|
1419
|
-
*
|
|
1420
|
-
* props
|
|
1433
|
+
* Five omissions, not one. `cardProgram` is pinned below. The four create-sheet
|
|
1434
|
+
* props (`initialView` among them, since it only ever opens that sheet) are
|
|
1435
|
+
* debit-only: the built-in sheet issues against `POST /credit-cards`'s
|
|
1421
1436
|
* sibling and `CreateCardWidget` covers debit alone, so credit's Create card
|
|
1422
1437
|
* needs a host `onCreateCard` or the button hides. That was prose in the doc; the
|
|
1423
1438
|
* type says it here.
|
|
1424
1439
|
*/
|
|
1425
|
-
type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc' | 'createCardLabels' | 'createCardFeatureLabels'>;
|
|
1440
|
+
type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc' | 'createCardLabels' | 'createCardFeatureLabels' | 'initialView'>;
|
|
1426
1441
|
/**
|
|
1427
1442
|
* One page of an organization's **credit** cards, with a scope-gated Show my
|
|
1428
1443
|
* cards toggle and per-row Activate affordance. Selecting a row opens that
|
|
@@ -1389,6 +1389,20 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
1389
1389
|
* nothing.
|
|
1390
1390
|
*/
|
|
1391
1391
|
onCreateCard?: () => void;
|
|
1392
|
+
/**
|
|
1393
|
+
* Arrival prop (EMBD-6962): `'create'` lands the reader on the built-in
|
|
1394
|
+
* create sheet instead of the bare list, e.g. from a dashboard "Issue card"
|
|
1395
|
+
* shortcut. Same name and shape as `ReceivablesWidget.initialView`
|
|
1396
|
+
* (EMBD-4184), the other "open on the create form" arrival in the package.
|
|
1397
|
+
*
|
|
1398
|
+
* Read once, when the token's scopes first resolve: the sheet opens only if
|
|
1399
|
+
* the built-in flow is available then (debit, `canCreateCard`, and no host
|
|
1400
|
+
* `onCreateCard`); otherwise the list shows as usual. Closing the sheet
|
|
1401
|
+
* returns to the list and nothing reopens it, and a later change to this
|
|
1402
|
+
* prop is ignored. It is not a controlled value: the widget reads no router,
|
|
1403
|
+
* so a host mirroring it into the URL should clear that param itself.
|
|
1404
|
+
*/
|
|
1405
|
+
initialView?: 'create';
|
|
1392
1406
|
/**
|
|
1393
1407
|
* Your own markup for the start of the list's header row, beside Create card,
|
|
1394
1408
|
* typically the heading you would otherwise render above the widget. The
|
|
@@ -2324,6 +2324,20 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
2324
2324
|
* nothing.
|
|
2325
2325
|
*/
|
|
2326
2326
|
onCreateCard?: () => void;
|
|
2327
|
+
/**
|
|
2328
|
+
* Arrival prop (EMBD-6962): `'create'` lands the reader on the built-in
|
|
2329
|
+
* create sheet instead of the bare list, e.g. from a dashboard "Issue card"
|
|
2330
|
+
* shortcut. Same name and shape as `ReceivablesWidget.initialView`
|
|
2331
|
+
* (EMBD-4184), the other "open on the create form" arrival in the package.
|
|
2332
|
+
*
|
|
2333
|
+
* Read once, when the token's scopes first resolve: the sheet opens only if
|
|
2334
|
+
* the built-in flow is available then (debit, `canCreateCard`, and no host
|
|
2335
|
+
* `onCreateCard`); otherwise the list shows as usual. Closing the sheet
|
|
2336
|
+
* returns to the list and nothing reopens it, and a later change to this
|
|
2337
|
+
* prop is ignored. It is not a controlled value: the widget reads no router,
|
|
2338
|
+
* so a host mirroring it into the URL should clear that param itself.
|
|
2339
|
+
*/
|
|
2340
|
+
initialView?: 'create';
|
|
2327
2341
|
/**
|
|
2328
2342
|
* Your own markup for the start of the list's header row, beside Create card,
|
|
2329
2343
|
* typically the heading you would otherwise render above the widget. The
|
|
@@ -2351,13 +2365,14 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
2351
2365
|
/**
|
|
2352
2366
|
* Derived from the internal props rather than restated, so the two cannot drift.
|
|
2353
2367
|
*
|
|
2354
|
-
*
|
|
2355
|
-
* props
|
|
2368
|
+
* Five omissions, not one. `cardProgram` is pinned below. The four create-sheet
|
|
2369
|
+
* props (`initialView` among them, since it only ever opens that sheet) are
|
|
2370
|
+
* debit-only: the built-in sheet issues against `POST /credit-cards`'s
|
|
2356
2371
|
* sibling and `CreateCardWidget` covers debit alone, so credit's Create card
|
|
2357
2372
|
* needs a host `onCreateCard` or the button hides. That was prose in the doc; the
|
|
2358
2373
|
* type says it here.
|
|
2359
2374
|
*/
|
|
2360
|
-
type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc' | 'createCardLabels' | 'createCardFeatureLabels'>;
|
|
2375
|
+
type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc' | 'createCardLabels' | 'createCardFeatureLabels' | 'initialView'>;
|
|
2361
2376
|
|
|
2362
2377
|
/**
|
|
2363
2378
|
* Derived from the internal props rather than restated, so the two cannot drift.
|
package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/CardsWidget.js
CHANGED
|
@@ -3,81 +3,84 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { WidgetProvider as e } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
6
|
+
import { useWidgetConfig as t, useWidgetInitStaleForToken as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
6
7
|
import "../../../../shared/feature/dist/index.js";
|
|
7
|
-
import { WIDGET_NAME as
|
|
8
|
-
import { cardsListDetailsSheetTestIds as
|
|
9
|
-
import { resolveCardsListLabels as
|
|
10
|
-
import { CardsList as
|
|
11
|
-
import { CardsListDetailsSheet as
|
|
8
|
+
import { WIDGET_NAME as r } from "./analytics/events.js";
|
|
9
|
+
import { cardsListDetailsSheetTestIds as i, cardsListTestIds as a } from "./testIds.js";
|
|
10
|
+
import { resolveCardsListLabels as o } from "../../../ui/dist/lib/CardsList/labels.js";
|
|
11
|
+
import { CardsList as s } from "../../../ui/dist/lib/CardsList/CardsList.js";
|
|
12
|
+
import { CardsListDetailsSheet as c } from "../../../ui/dist/lib/CardsList/CardsListDetailsSheet.js";
|
|
12
13
|
import "../../../ui/dist/index.js";
|
|
13
|
-
import { useCardsWidget as
|
|
14
|
-
import { CardDetailsWidget as
|
|
14
|
+
import { useCardsWidget as l } from "./useCardsWidget.js";
|
|
15
|
+
import { CardDetailsWidget as u } from "../../../../card-details-widget/feature/dist/lib/CardDetailsWidget.js";
|
|
15
16
|
import "../../../../card-details-widget/feature/dist/index.js";
|
|
16
|
-
import { CreateCardWidget as
|
|
17
|
+
import { CreateCardWidget as d } from "../../../create-card/feature/dist/index8.js";
|
|
17
18
|
import "../../../create-card/feature/dist/index.js";
|
|
18
|
-
import { useCallback as
|
|
19
|
-
import { Fragment as
|
|
19
|
+
import { useCallback as f, useMemo as p, useState as m } from "react";
|
|
20
|
+
import { Fragment as ee, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
20
21
|
// ../../libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/CardsWidget.js
|
|
21
|
-
function
|
|
22
|
-
let {
|
|
22
|
+
function _({ cardProgram: e, pagination: r, defaultPagination: _, onPaginationChange: v, labels: y, featureLabels: b, selectedCardId: x, defaultSelectedCardId: S, onSelectedCardIdChange: C, cardDetailsLabels: w, cardDetailsFeatureLabels: T, cardDetailsActivateLabels: E, bankLogoSrc: D, bankLogoAlt: O, cardArtSrc: k, createCardLabels: A, createCardFeatureLabels: te, onCreateCard: ne, initialView: re, onActivateCard: j, headerStart: M }) {
|
|
23
|
+
let { initResponse: N } = t(), P = n(), { selectedCardId: F, onSelectCard: I, onCreateCardClick: L, canCreateCard: R, canReadCards: z, ...B } = l({
|
|
23
24
|
cardProgram: e,
|
|
24
|
-
pagination:
|
|
25
|
-
defaultPagination:
|
|
26
|
-
onPaginationChange:
|
|
27
|
-
featureLabels:
|
|
28
|
-
selectedCardId:
|
|
29
|
-
defaultSelectedCardId:
|
|
30
|
-
onSelectedCardIdChange:
|
|
31
|
-
onCreateCard:
|
|
32
|
-
onActivateCard:
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
pagination: r,
|
|
26
|
+
defaultPagination: _,
|
|
27
|
+
onPaginationChange: v,
|
|
28
|
+
featureLabels: b,
|
|
29
|
+
selectedCardId: x,
|
|
30
|
+
defaultSelectedCardId: S,
|
|
31
|
+
onSelectedCardIdChange: C,
|
|
32
|
+
onCreateCard: ne,
|
|
33
|
+
onActivateCard: j
|
|
34
|
+
}), V = p(() => o(y), [y]), [H, U] = m(!1), [W, G] = m(0), [K, q] = m(F), [J, Y] = m(null), [ie, ae] = m(re === "create"), oe = f(() => {
|
|
35
|
+
F !== null && I(null), G((e) => e + 1), U(!0);
|
|
36
|
+
}, [F, I]), X = f(() => {
|
|
37
|
+
U(!1), F !== null && I(null);
|
|
38
|
+
}, [F, I]), se = f((e) => {
|
|
39
|
+
U(!1), I(e);
|
|
40
|
+
}, [I]), Z = e === "debit" && !!R && L === void 0;
|
|
41
|
+
ie && N && !P && (ae(!1), Z && F === null && (G((e) => e + 1), U(!0)));
|
|
42
|
+
let Q = H && F === null && Z;
|
|
43
|
+
H && (F !== null || !Z) && U(!1), Q ? J !== "create" && Y("create") : F !== null && (J !== "details" && Y("details"), F !== K && q(F));
|
|
44
|
+
let $ = J === "create", ce = F !== null || Q;
|
|
45
|
+
return /* @__PURE__ */ g(ee, { children: [/* @__PURE__ */ h(s, {
|
|
46
|
+
...B,
|
|
47
|
+
canCreateCard: R,
|
|
48
|
+
onCreateCardClick: L ?? oe,
|
|
49
|
+
headerStart: M,
|
|
50
|
+
labels: V,
|
|
51
|
+
testIds: a
|
|
52
|
+
}), /* @__PURE__ */ h(c, {
|
|
53
|
+
isOpen: ce,
|
|
54
|
+
labels: $ ? V.createSheet : V.detailsSheet,
|
|
52
55
|
contentClassName: $ ? "ttw:overflow-hidden ttw:p-0 ttw:min-h-0" : void 0,
|
|
53
|
-
onClose:
|
|
54
|
-
testIds:
|
|
55
|
-
children: $ && Z ? /* @__PURE__ */
|
|
56
|
-
cardArtSrc:
|
|
57
|
-
labels:
|
|
58
|
-
featureLabels:
|
|
59
|
-
onClose:
|
|
60
|
-
onCancel:
|
|
61
|
-
onViewCard:
|
|
56
|
+
onClose: X,
|
|
57
|
+
testIds: i,
|
|
58
|
+
children: $ && Z ? /* @__PURE__ */ h(d, {
|
|
59
|
+
cardArtSrc: k ?? "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='190' viewBox='0 0 300 190'><rect width='300' height='190' rx='16' fill='%23334155'/><rect x='28' y='64' width='44' height='34' rx='6' fill='%2364748b'/></svg>",
|
|
60
|
+
labels: A,
|
|
61
|
+
featureLabels: te,
|
|
62
|
+
onClose: X,
|
|
63
|
+
onCancel: X,
|
|
64
|
+
onViewCard: z ? se : void 0,
|
|
62
65
|
className: "ttw:min-h-0 ttw:flex-1"
|
|
63
|
-
},
|
|
64
|
-
cardId:
|
|
66
|
+
}, W) : K === null ? null : /* @__PURE__ */ h(u, {
|
|
67
|
+
cardId: K,
|
|
65
68
|
cardProgram: e,
|
|
66
|
-
labels:
|
|
67
|
-
activateLabels:
|
|
68
|
-
featureLabels:
|
|
69
|
-
cardArtSrc:
|
|
70
|
-
bankLogoSrc:
|
|
71
|
-
bankLogoAlt:
|
|
72
|
-
onClose:
|
|
73
|
-
},
|
|
69
|
+
labels: w,
|
|
70
|
+
activateLabels: E,
|
|
71
|
+
featureLabels: T,
|
|
72
|
+
cardArtSrc: k,
|
|
73
|
+
bankLogoSrc: D,
|
|
74
|
+
bankLogoAlt: O,
|
|
75
|
+
onClose: X
|
|
76
|
+
}, K)
|
|
74
77
|
})] });
|
|
75
78
|
}
|
|
76
|
-
function
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
widgetName:
|
|
79
|
-
baseUrl:
|
|
80
|
-
widgetToken:
|
|
79
|
+
function v({ baseUrl: t, widgetToken: n, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
|
|
80
|
+
return /* @__PURE__ */ h(e, {
|
|
81
|
+
widgetName: r,
|
|
82
|
+
baseUrl: t,
|
|
83
|
+
widgetToken: n,
|
|
81
84
|
organizationId: i,
|
|
82
85
|
configClient: a,
|
|
83
86
|
gatewayRouting: o,
|
|
@@ -88,7 +91,7 @@ function _({ baseUrl: n, widgetToken: r, organizationId: i, configClient: a, gat
|
|
|
88
91
|
analytics: d,
|
|
89
92
|
disclosuresAcceptance: f,
|
|
90
93
|
providerLabels: p,
|
|
91
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ h(_, { ...m })
|
|
92
95
|
});
|
|
93
96
|
}
|
|
94
|
-
export {
|
|
97
|
+
export { v as CardsWidget, v as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.32", n = "a9d57b99d1e871ddd534b30f87ab4b6a1ebd3a9d", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|