@canton-network/core-wallet-ui-components 1.18.0 → 1.19.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/README.md +11 -0
- package/dist/components/api-key-card.d.ts.map +1 -1
- package/dist/components/api-key-form.d.ts.map +1 -1
- package/dist/components/app-header.d.ts +3 -0
- package/dist/components/app-header.d.ts.map +1 -1
- package/dist/components/app-layout.d.ts +2 -0
- package/dist/components/app-layout.d.ts.map +1 -1
- package/dist/components/auth-editor.d.ts +2 -0
- package/dist/components/auth-editor.d.ts.map +1 -1
- package/dist/components/back-link.d.ts.map +1 -1
- package/dist/components/copy-button.d.ts.map +1 -1
- package/dist/components/custom-toast.d.ts.map +1 -1
- package/dist/components/error-page.d.ts.map +1 -1
- package/dist/components/form-input.d.ts.map +1 -1
- package/dist/components/idp-card.d.ts.map +1 -1
- package/dist/components/idp-form.d.ts.map +1 -1
- package/dist/components/loading-state.d.ts.map +1 -1
- package/dist/components/login-form.d.ts.map +1 -1
- package/dist/components/message-detail.d.ts.map +1 -1
- package/dist/components/network-card.d.ts.map +1 -1
- package/dist/components/network-form.d.ts.map +1 -1
- package/dist/components/not-found.d.ts.map +1 -1
- package/dist/components/page-header.d.ts +14 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/pagination.d.ts +1 -0
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/components/transaction-card.d.ts.map +1 -1
- package/dist/components/transaction-detail.d.ts.map +1 -1
- package/dist/components/wallet-card.d.ts +1 -0
- package/dist/components/wallet-card.d.ts.map +1 -1
- package/dist/components/wallet-create-form.d.ts.map +1 -1
- package/dist/components/wallet-edit-form.d.ts +1 -0
- package/dist/components/wallet-edit-form.d.ts.map +1 -1
- package/dist/components/wallet-list.d.ts +18 -0
- package/dist/components/wallet-list.d.ts.map +1 -0
- package/dist/components/wallets-sync.d.ts +14 -7
- package/dist/components/wallets-sync.d.ts.map +1 -1
- package/dist/date-time.d.ts +14 -0
- package/dist/date-time.d.ts.map +1 -0
- package/dist/error-toast-By8cEMjq.cjs +4002 -0
- package/dist/error-toast-By8cEMjq.cjs.map +1 -0
- package/dist/error-toast-DQZ4SB72.js +17335 -0
- package/dist/error-toast-DQZ4SB72.js.map +1 -0
- package/dist/index.cjs +709 -4616
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1528 -16563
- package/dist/index.js.map +1 -1
- package/dist/internal/activity-render.d.ts +6 -1
- package/dist/internal/activity-render.d.ts.map +1 -1
- package/dist/internal/activity-utils.d.ts +0 -1
- package/dist/internal/activity-utils.d.ts.map +1 -1
- package/dist/internal/base-element.d.ts.map +1 -1
- package/dist/logic/index.cjs +1 -0
- package/dist/logic/index.d.ts +2 -0
- package/dist/logic/index.d.ts.map +1 -0
- package/dist/logic/index.js +1 -0
- package/dist/logic/parties.d.ts +59 -0
- package/dist/logic/parties.d.ts.map +1 -0
- package/dist/parties-B5mhMShF.js +111 -0
- package/dist/parties-B5mhMShF.js.map +1 -0
- package/dist/parties-DTtG9UJI.cjs +2 -0
- package/dist/parties-DTtG9UJI.cjs.map +1 -0
- package/dist/react/components/ApiKeyCard.d.ts +5 -7
- package/dist/react/components/ApiKeyCard.d.ts.map +1 -1
- package/dist/react/components/ApiKeyForm.d.ts +5 -7
- package/dist/react/components/ApiKeyForm.d.ts.map +1 -1
- package/dist/react/components/AppHeader.d.ts +6 -29
- package/dist/react/components/AppHeader.d.ts.map +1 -1
- package/dist/react/components/CardDetailRow.d.ts +1 -1
- package/dist/react/components/CardDetailRow.d.ts.map +1 -1
- package/dist/react/components/ErrorPage.d.ts +6 -9
- package/dist/react/components/ErrorPage.d.ts.map +1 -1
- package/dist/react/components/IdpCard.d.ts +7 -8
- package/dist/react/components/IdpCard.d.ts.map +1 -1
- package/dist/react/components/IdpForm.d.ts +8 -18
- package/dist/react/components/IdpForm.d.ts.map +1 -1
- package/dist/react/components/LoginForm.d.ts +6 -29
- package/dist/react/components/LoginForm.d.ts.map +1 -1
- package/dist/react/components/MessageDetail.d.ts +6 -26
- package/dist/react/components/MessageDetail.d.ts.map +1 -1
- package/dist/react/components/NetworkCard.d.ts +7 -12
- package/dist/react/components/NetworkCard.d.ts.map +1 -1
- package/dist/react/components/NetworkForm.d.ts +7 -16
- package/dist/react/components/NetworkForm.d.ts.map +1 -1
- package/dist/react/components/NotFound.d.ts +3 -0
- package/dist/react/components/NotFound.d.ts.map +1 -0
- package/dist/react/components/PageHeader.d.ts +3 -0
- package/dist/react/components/PageHeader.d.ts.map +1 -0
- package/dist/react/components/Pagination.d.ts +5 -12
- package/dist/react/components/Pagination.d.ts.map +1 -1
- package/dist/react/components/TransactionCard.d.ts +5 -16
- package/dist/react/components/TransactionCard.d.ts.map +1 -1
- package/dist/react/components/TransactionDetail.d.ts +6 -28
- package/dist/react/components/TransactionDetail.d.ts.map +1 -1
- package/dist/react/components/WalletCard.d.ts +8 -20
- package/dist/react/components/WalletCard.d.ts.map +1 -1
- package/dist/react/components/WalletCreateForm.d.ts +7 -34
- package/dist/react/components/WalletCreateForm.d.ts.map +1 -1
- package/dist/react/components/WalletEditForm.d.ts +7 -34
- package/dist/react/components/WalletEditForm.d.ts.map +1 -1
- package/dist/react/components/WalletList.d.ts +9 -0
- package/dist/react/components/WalletList.d.ts.map +1 -0
- package/dist/react/components/WalletsSync.d.ts +5 -12
- package/dist/react/components/WalletsSync.d.ts.map +1 -1
- package/dist/react/index.cjs +2 -10
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +228 -1808
- package/dist/react/index.js.map +1 -1
- package/dist/routing.d.ts +1 -1
- package/dist/routing.d.ts.map +1 -1
- package/package.json +17 -10
- package/themes/default.css +125 -74
- package/dist/activity-utils-CmKMEsoq.cjs +0 -4
- package/dist/activity-utils-CmKMEsoq.cjs.map +0 -1
- package/dist/activity-utils-DI0OIiL2.js +0 -1744
- package/dist/activity-utils-DI0OIiL2.js.map +0 -1
- package/dist/react/components/AuthEditor.d.ts +0 -21
- package/dist/react/components/AuthEditor.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkCard.d.ts","sourceRoot":"","sources":["../../../src/react/components/NetworkCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NetworkCard.d.ts","sourceRoot":"","sources":["../../../src/react/components/NetworkCard.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,WAAW,IAAI,kBAAkB,EACjC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC9B,MAAM,kCAAkC,CAAA;AAEzC,eAAO,MAAM,WAAW;qBAKqB,SAAS,CAAC,sBAAsB,CAAC;cAChD,SAAS,CAAC,sBAAsB,CAAC;cACjC,SAAS,CAAC,sBAAsB,CAAC;EAE7D,CAAA"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/** Called with the entered network when the form is submitted */
|
|
9
|
-
onSave: (network: Network) => void;
|
|
10
|
-
/** Reviewing only. Called when "Delete Network" is clicked, with the `network` prop. The delete section is hidden when omitted */
|
|
11
|
-
onDelete?: (network: Network) => void;
|
|
12
|
-
/** Reviewing only. Called when Cancel is clicked. The button is hidden when omitted */
|
|
13
|
-
onCancel?: () => void;
|
|
14
|
-
}
|
|
15
|
-
export declare const NetworkForm: ({ network: reviewedNetwork, onSave, onDelete, onCancel, }: NetworkFormProps) => import('react').JSX.Element;
|
|
16
|
-
export {};
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { NetworkForm as NetworkFormElement, NetworkEditCancelEvent, NetworkEditSaveEvent, NetworkDeleteEvent } from '../../components/network-form.js';
|
|
3
|
+
export declare const NetworkForm: import('@lit/react').ReactWebComponent<NetworkFormElement, {
|
|
4
|
+
onNetworkEditCancel: EventName<NetworkEditCancelEvent>;
|
|
5
|
+
onNetworkEditSave: EventName<NetworkEditSaveEvent>;
|
|
6
|
+
onNetworkDelete: EventName<NetworkDeleteEvent>;
|
|
7
|
+
}>;
|
|
17
8
|
//# sourceMappingURL=NetworkForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkForm.d.ts","sourceRoot":"","sources":["../../../src/react/components/NetworkForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NetworkForm.d.ts","sourceRoot":"","sources":["../../../src/react/components/NetworkForm.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,WAAW,IAAI,kBAAkB,EACjC,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAC1B,MAAM,kCAAkC,CAAA;AAEzC,eAAO,MAAM,WAAW;yBAMa,SAAS,CAAC,sBAAsB,CAAC;uBAEnC,SAAS,CAAC,oBAAoB,CAAC;qBACrB,SAAS,CAAC,kBAAkB,CAAC;EAExE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotFound.d.ts","sourceRoot":"","sources":["../../../src/react/components/NotFound.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE3E,eAAO,MAAM,QAAQ,6DAInB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../src/react/components/PageHeader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAErF,eAAO,MAAM,UAAU,iEAIrB,CAAA"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** Current 1-based page. Out-of-range values are clamped for display. @default 1 */
|
|
7
|
-
page?: number;
|
|
8
|
-
/** Called with the requested 1-based page when Previous/Next is clicked */
|
|
9
|
-
onPageChange: (page: number) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const Pagination: ({ total, pageSize, page, onPageChange, }: PaginationProps) => import('react').JSX.Element;
|
|
12
|
-
export {};
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { WgPagination as WgPaginationElement, PageChangeEvent } from '../../components/pagination.js';
|
|
3
|
+
export declare const Pagination: import('@lit/react').ReactWebComponent<WgPaginationElement, {
|
|
4
|
+
onPageChange: EventName<PageChangeEvent>;
|
|
5
|
+
}>;
|
|
13
6
|
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/react/components/Pagination.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/react/components/Pagination.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,YAAY,IAAI,mBAAmB,EACnC,KAAK,eAAe,EACvB,MAAM,gCAAgC,CAAA;AAEvC,eAAO,MAAM,UAAU;kBAKgB,SAAS,CAAC,eAAe,CAAC;EAE/D,CAAA"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** e.g. 'pending', 'signed', 'executed', 'failed'. Shown as a coloured badge */
|
|
7
|
-
status: string;
|
|
8
|
-
parsed?: ParsedTransactionInfo | null;
|
|
9
|
-
createdAt?: string | null;
|
|
10
|
-
/** Disables the card, e.g. while the list is being refreshed */
|
|
11
|
-
loading?: boolean;
|
|
12
|
-
/** Called when the card is clicked */
|
|
13
|
-
onReview: (transactionId: string, commandId: string) => void;
|
|
14
|
-
}
|
|
15
|
-
export declare const TransactionCard: ({ transactionId, commandId, externalTxId, status, parsed, createdAt, loading, onReview, }: TransactionCardProps) => import('react').JSX.Element;
|
|
16
|
-
export {};
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { WgTransactionCard as WgTransactionCardElement, TransactionCardReviewEvent } from '../../components/transaction-card.js';
|
|
3
|
+
export declare const TransactionCard: import('@lit/react').ReactWebComponent<WgTransactionCardElement, {
|
|
4
|
+
onTransactionReview: EventName<TransactionCardReviewEvent>;
|
|
5
|
+
}>;
|
|
17
6
|
//# sourceMappingURL=TransactionCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionCard.d.ts","sourceRoot":"","sources":["../../../src/react/components/TransactionCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransactionCard.d.ts","sourceRoot":"","sources":["../../../src/react/components/TransactionCard.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,iBAAiB,IAAI,wBAAwB,EAC7C,KAAK,0BAA0B,EAClC,MAAM,sCAAsC,CAAA;AAE7C,eAAO,MAAM,eAAe;yBAMQ,SAAS,CAAC,0BAA0B,CAAC;EAEvE,CAAA"}
|
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
txHash?: string;
|
|
8
|
-
parsed?: ParsedTransactionInfo | null;
|
|
9
|
-
createdAt?: string | null;
|
|
10
|
-
/** Shows a "Back" link to this URL. The link is hidden when omitted */
|
|
11
|
-
backHref?: string;
|
|
12
|
-
/** Shows progress on "Approve" and disables both buttons @default false */
|
|
13
|
-
approving?: boolean;
|
|
14
|
-
/** Shows progress on "Reject" and disables both buttons @default false */
|
|
15
|
-
rejecting?: boolean;
|
|
16
|
-
/** Shows progress on "Approve" and disables it. "Reject" stays available, so a transaction can still be turned down while it is signed @default false */
|
|
17
|
-
signing?: boolean;
|
|
18
|
-
/** The last submit of a signed transaction failed: "Approve" becomes "Retry submit" @default false */
|
|
19
|
-
submitFailed?: boolean;
|
|
20
|
-
/** Disables both buttons, whatever the status @default false */
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/** Called when "Approve" (or "Retry submit") is clicked */
|
|
23
|
-
onApprove: (commandId: string) => void;
|
|
24
|
-
/** Called when "Reject" is clicked. The button is hidden when omitted */
|
|
25
|
-
onReject?: (commandId: string) => void;
|
|
26
|
-
}
|
|
27
|
-
export declare const TransactionDetail: ({ commandId, externalTxId, status, txHash, parsed, createdAt, backHref, approving, rejecting, signing, submitFailed, disabled, onApprove, onReject, }: TransactionDetailProps) => import('react').JSX.Element;
|
|
28
|
-
export {};
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { WgTransactionDetail as WgTransactionDetailElement, TransactionApproveEvent, TransactionDeleteEvent } from '../../components/transaction-detail.js';
|
|
3
|
+
export declare const TransactionDetail: import('@lit/react').ReactWebComponent<WgTransactionDetailElement, {
|
|
4
|
+
onTransactionApprove: EventName<TransactionApproveEvent>;
|
|
5
|
+
onTransactionDelete: EventName<TransactionDeleteEvent>;
|
|
6
|
+
}>;
|
|
29
7
|
//# sourceMappingURL=TransactionDetail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDetail.d.ts","sourceRoot":"","sources":["../../../src/react/components/TransactionDetail.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"TransactionDetail.d.ts","sourceRoot":"","sources":["../../../src/react/components/TransactionDetail.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,mBAAmB,IAAI,0BAA0B,EACjD,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC9B,MAAM,wCAAwC,CAAA;AAE/C,eAAO,MAAM,iBAAiB;0BAMO,SAAS,CAAC,uBAAuB,CAAC;yBAEnC,SAAS,CAAC,sBAAsB,CAAC;EAEnE,CAAA"}
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
onAllocate?: (wallet: Wallet) => void;
|
|
10
|
-
/** Called when "Set as primary" is clicked (verified, non-primary, enabled wallets). The button is hidden when omitted */
|
|
11
|
-
onSetPrimary?: (wallet: Wallet) => void;
|
|
12
|
-
/** Called when "Edit" is clicked (verified wallets). The button is hidden when omitted */
|
|
13
|
-
onEdit?: (wallet: Wallet) => void;
|
|
14
|
-
/** Called when the select button is clicked. When set, it replaces all other actions and the badge */
|
|
15
|
-
onSelect?: (wallet: Wallet) => void;
|
|
16
|
-
/** Label of the select button @default 'Select' */
|
|
17
|
-
selectLabel?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const WalletCard: ({ wallet, verified, loading, onAllocate, onSetPrimary, onEdit, onSelect, selectLabel, }: WalletCardProps) => import('react').JSX.Element;
|
|
20
|
-
export {};
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { WgWalletCard as WgWalletCardElement, WalletSetPrimaryEvent, WalletCardEditEvent, WalletAllocateEvent, WalletCardSelectEvent } from '../../components/wallet-card.js';
|
|
3
|
+
export declare const WalletCard: import('@lit/react').ReactWebComponent<WgWalletCardElement, {
|
|
4
|
+
onWalletSetPrimary: EventName<WalletSetPrimaryEvent>;
|
|
5
|
+
onWalletEdit: EventName<WalletCardEditEvent>;
|
|
6
|
+
onWalletAllocate: EventName<WalletAllocateEvent>;
|
|
7
|
+
onWalletSelect: EventName<WalletCardSelectEvent>;
|
|
8
|
+
}>;
|
|
21
9
|
//# sourceMappingURL=WalletCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletCard.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"WalletCard.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletCard.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,YAAY,IAAI,mBAAmB,EACnC,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC7B,MAAM,iCAAiC,CAAA;AAExC,eAAO,MAAM,UAAU;wBAMa,SAAS,CAAC,qBAAqB,CAAC;kBAC7B,SAAS,CAAC,mBAAmB,CAAC;sBACtB,SAAS,CAAC,mBAAmB,CAAC;oBAClC,SAAS,CAAC,qBAAqB,CAAC;EAEzE,CAAA"}
|
|
@@ -1,35 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* The keys offered for `keySigningProviders`: load them when
|
|
9
|
-
* `onSigningProviderChange` reports such a provider. `undefined` while they
|
|
10
|
-
* are loading, which disables the form once one of those providers is selected
|
|
11
|
-
*/
|
|
12
|
-
publicKeys?: Key[] | undefined;
|
|
13
|
-
/** The selected signing provider. Pass it, together with `onSigningProviderChange`, to control the selection; without it the form keeps its own */
|
|
14
|
-
selectedSigningProvider?: string;
|
|
15
|
-
/** Offers the "Set as primary wallet" checkbox @default true */
|
|
16
|
-
showPrimary?: boolean;
|
|
17
|
-
/** Disables the form and shows `submittingLabel` and `submittingMessage` @default false */
|
|
18
|
-
submitting?: boolean;
|
|
19
|
-
/** @default 'Add' */
|
|
20
|
-
submitLabel?: string;
|
|
21
|
-
/** @default 'Adding...' */
|
|
22
|
-
submittingLabel?: string;
|
|
23
|
-
/** @default 'Creating party, please wait...' */
|
|
24
|
-
submittingMessage?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Called when the form is submitted. `keyName` is the name of the chosen
|
|
27
|
-
* key, for the signing providers that have keys
|
|
28
|
-
*/
|
|
29
|
-
onCreate: (partyHint: PartyHint, signingProviderId: SigningProviderId, primary: boolean, keyName?: KeyName) => void;
|
|
30
|
-
/** Called when another signing provider is chosen */
|
|
31
|
-
onSigningProviderChange?: (signingProviderId: SigningProviderId) => void;
|
|
32
|
-
}
|
|
33
|
-
export declare const WalletCreateForm: ({ signingProviders, keySigningProviders, publicKeys, selectedSigningProvider, showPrimary, submitting, submitLabel, submittingLabel, submittingMessage, onCreate, onSigningProviderChange, }: WalletCreateFormProps) => import('react').JSX.Element;
|
|
34
|
-
export {};
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { WgWalletCreateForm as WgWalletCreateFormElement, WalletCreateEvent } from '../../components/wallet-create-form.js';
|
|
3
|
+
import { SigningProviderChangeEvent } from '../../components/wallet-form.js';
|
|
4
|
+
export declare const WalletCreateForm: import('@lit/react').ReactWebComponent<WgWalletCreateFormElement, {
|
|
5
|
+
onWalletCreate: EventName<WalletCreateEvent>;
|
|
6
|
+
onSigningProviderChange: EventName<SigningProviderChangeEvent>;
|
|
7
|
+
}>;
|
|
35
8
|
//# sourceMappingURL=WalletCreateForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletCreateForm.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletCreateForm.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"WalletCreateForm.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletCreateForm.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,kBAAkB,IAAI,yBAAyB,EAC/C,KAAK,iBAAiB,EACzB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAEjF,eAAO,MAAM,gBAAgB;oBAKc,SAAS,CAAC,iBAAiB,CAAC;6BAE9B,SAAS,CAAC,0BAA0B,CAAC;EAE5E,CAAA"}
|
|
@@ -1,35 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
disabledSigningProviders?: string[];
|
|
9
|
-
/**
|
|
10
|
-
* The keys of the selected signing provider: load them when
|
|
11
|
-
* `onSigningProviderChange` reports a provider. `undefined` while they are
|
|
12
|
-
* loading, which shows progress and disables submitting. Pass `[]` when
|
|
13
|
-
* the provider has none
|
|
14
|
-
*/
|
|
15
|
-
publicKeys?: Key[] | undefined;
|
|
16
|
-
/** The selected signing provider. The form follows it whenever it changes, and keeps its own choice in between */
|
|
17
|
-
selectedSigningProvider?: string;
|
|
18
|
-
/** The selected public key. The form follows it whenever it changes, and keeps its own choice in between */
|
|
19
|
-
selectedPublicKey?: string;
|
|
20
|
-
/** Disables the form and shows `submittingLabel` and `submittingMessage` @default false */
|
|
21
|
-
submitting?: boolean;
|
|
22
|
-
/** @default 'Edit' */
|
|
23
|
-
submitLabel?: string;
|
|
24
|
-
/** @default 'Editing...' */
|
|
25
|
-
submittingLabel?: string;
|
|
26
|
-
/** @default 'Editing party, please wait...' */
|
|
27
|
-
submittingMessage?: string;
|
|
28
|
-
/** Called when the form is submitted with a signing provider and one of its public keys */
|
|
29
|
-
onEdit: (partyId: string, signingProviderId: SigningProviderId, publicKey: Key['publicKey']) => void;
|
|
30
|
-
/** Called when another signing provider is chosen */
|
|
31
|
-
onSigningProviderChange?: (signingProviderId: SigningProviderId) => void;
|
|
32
|
-
}
|
|
33
|
-
export declare const WalletEditForm: ({ partyId, signingProviders, disabledSigningProviders, publicKeys, selectedSigningProvider, selectedPublicKey, submitting, submitLabel, submittingLabel, submittingMessage, onEdit, onSigningProviderChange, }: WalletEditFormProps) => import('react').JSX.Element;
|
|
34
|
-
export {};
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { WgWalletEditForm as WgWalletEditFormElement, WalletEditEvent } from '../../components/wallet-edit-form.js';
|
|
3
|
+
import { SigningProviderChangeEvent } from '../../components/wallet-form.js';
|
|
4
|
+
export declare const WalletEditForm: import('@lit/react').ReactWebComponent<WgWalletEditFormElement, {
|
|
5
|
+
onWalletEdit: EventName<WalletEditEvent>;
|
|
6
|
+
onSigningProviderChange: EventName<SigningProviderChangeEvent>;
|
|
7
|
+
}>;
|
|
35
8
|
//# sourceMappingURL=WalletEditForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletEditForm.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletEditForm.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"WalletEditForm.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletEditForm.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,gBAAgB,IAAI,uBAAuB,EAC3C,KAAK,eAAe,EACvB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAEjF,eAAO,MAAM,cAAc;kBAKY,SAAS,CAAC,eAAe,CAAC;6BAExB,SAAS,CAAC,0BAA0B,CAAC;EAE5E,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { WgWalletList as WgWalletListElement } from '../../components/wallet-list.js';
|
|
3
|
+
import { WalletAllocateEvent, WalletCardEditEvent, WalletSetPrimaryEvent } from '../../components/wallet-card.js';
|
|
4
|
+
export declare const WalletList: import('@lit/react').ReactWebComponent<WgWalletListElement, {
|
|
5
|
+
onWalletAllocate: EventName<WalletAllocateEvent>;
|
|
6
|
+
onWalletEdit: EventName<WalletCardEditEvent>;
|
|
7
|
+
onWalletSetPrimary: EventName<WalletSetPrimaryEvent>;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=WalletList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletList.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletList.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrF,OAAO,KAAK,EACR,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,iCAAiC,CAAA;AAExC,eAAO,MAAM,UAAU;sBAKwB,SAAS,CAAC,mBAAmB,CAAC;kBACtC,SAAS,CAAC,mBAAmB,CAAC;wBAEjC,SAAS,CAAC,qBAAqB,CAAC;EAElE,CAAA"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** Disables the button, e.g. while there is no API client yet */
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
/** Called when the button is clicked; the caller does the sync, shows its result and refreshes the wallets */
|
|
9
|
-
onSync: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const WalletsSync: ({ syncNeeded, syncing, disabled, onSync, }: WalletsSyncProps) => import('react').JSX.Element;
|
|
12
|
-
export {};
|
|
1
|
+
import { EventName } from '@lit/react';
|
|
2
|
+
import { WgWalletsSync as WgWalletsSyncElement, WalletsSyncEvent } from '../../components/wallets-sync.js';
|
|
3
|
+
export declare const WalletsSync: import('@lit/react').ReactWebComponent<WgWalletsSyncElement, {
|
|
4
|
+
onWalletsSync: EventName<WalletsSyncEvent>;
|
|
5
|
+
}>;
|
|
13
6
|
//# sourceMappingURL=WalletsSync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletsSync.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletsSync.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WalletsSync.d.ts","sourceRoot":"","sources":["../../../src/react/components/WalletsSync.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EACH,aAAa,IAAI,oBAAoB,EACrC,KAAK,gBAAgB,EACxB,MAAM,kCAAkC,CAAA;AAEzC,eAAO,MAAM,WAAW;mBAKiB,SAAS,CAAC,gBAAgB,CAAC;EAElE,CAAA"}
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../activity-utils-CmKMEsoq.cjs");let t=require("@mui/material"),n=require("react/jsx-runtime"),r=require("react"),i=require("@mui/icons-material/Menu");i=e.d(i,1);let a=require("@mui/icons-material/ContentCopy");a=e.d(a,1);let o=require("@mui/icons-material/ChevronLeft");o=e.d(o,1);let s=require("@mui/icons-material/WarningAmber");s=e.d(s,1);let c=require("@mui/icons-material/ArrowBack");c=e.d(c,1);let l=require("@mui/icons-material/Refresh");l=e.d(l,1);let u=require("@mui/material/styles"),d=require("@mui/icons-material/ArrowForward");d=e.d(d,1);let f=require("@mui/icons-material/ExpandMore");f=e.d(f,1);var p=({label:e,value:r,title:i=typeof r==`string`?r:void 0,muted:a=!1,action:o})=>{let s=typeof r==`string`;return(0,n.jsxs)(t.Box,{sx:{display:`flex`,alignItems:`center`,gap:2,minWidth:0,minHeight:40},children:[(0,n.jsx)(t.Typography,{variant:`body2`,noWrap:!0,sx:{fontWeight:`bold`,flexShrink:0,minWidth:`8rem`},children:e}),(0,n.jsx)(t.Typography,{variant:`body2`,component:`div`,noWrap:s,title:s?i:void 0,color:a?`text.secondary`:`text.primary`,sx:{flex:1,minWidth:0,textAlign:`right`,...!s&&{display:`flex`,flexWrap:`wrap`,alignItems:`center`,justifyContent:`flex-end`,gap:.5}},children:r}),o&&(0,n.jsx)(t.Box,{sx:{position:`relative`,zIndex:1,flexShrink:0},children:o})]})},m=({apiKey:e,onRevoke:r})=>(0,n.jsxs)(t.Card,{children:[(0,n.jsxs)(t.CardContent,{children:[(0,n.jsx)(t.Typography,{variant:`body1`,sx:{mb:2,fontWeight:`bold`},children:e.name}),(0,n.jsxs)(t.Stack,{spacing:1,children:[(0,n.jsx)(p,{label:`ID`,value:e.id}),(0,n.jsx)(p,{label:`Created At`,value:e.createdAt})]})]}),(0,n.jsx)(t.Divider,{}),(0,n.jsx)(t.CardActions,{children:(0,n.jsx)(t.Button,{color:`error`,onClick:()=>r(e),children:`Revoke`})})]}),h=()=>(0,n.jsx)(t.CircularProgress,{size:16,color:`inherit`,"aria-hidden":`true`}),g=({onApprove:e,onReject:r,approveLabel:i=`Approve`,approving:a=!1,rejecting:o=!1,signing:s=!1,disabled:c=!1})=>(0,n.jsxs)(t.Stack,{direction:`row`,spacing:2,children:[r&&(0,n.jsx)(t.Button,{variant:`outlined`,color:`error`,fullWidth:!0,disabled:c||a||o,startIcon:o?(0,n.jsx)(h,{}):void 0,onClick:r,children:`Reject`}),(0,n.jsx)(t.Button,{variant:`contained`,fullWidth:!0,disabled:c||a||o||s,startIcon:a||s?(0,n.jsx)(h,{}):void 0,onClick:e,children:i})]}),_=({onGenerate:e})=>{let[i,a]=(0,r.useState)(``);return(0,n.jsxs)(t.Box,{component:`form`,onSubmit:t=>{t.preventDefault(),e({name:i})},sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,n.jsx)(t.Stack,{spacing:2,children:(0,n.jsx)(t.TextField,{label:`Name`,required:!0,fullWidth:!0,value:i,onChange:e=>a(e.target.value)})}),(0,n.jsx)(t.Box,{sx:{mt:`auto`,pt:3},children:(0,n.jsx)(t.Button,{type:`submit`,variant:`contained`,fullWidth:!0,children:`Generate`})})]})},v=({online:e})=>(0,n.jsx)(t.Box,{sx:{display:`inline-block`,flexShrink:0,width:`10px`,height:`10px`,borderRadius:`50%`,bgcolor:e?`success.main`:`text.disabled`}}),y=[{label:`Parties`,href:`/parties/`},{label:`Activities`,href:`/activities/`},{label:`Networks`,href:`/networks/`},{label:`API Keys`,href:`/api-keys/`},{label:`Identity Providers`,href:`/identity-providers/`}],b=({iconSrc:o=e.l,networkName:s=`No network connected`,networkConnected:c=!1,dappApiUrl:l,homeHref:u=`/`,navItems:d,onLogout:f,onDappApiUrlCopy:p})=>{let[m,h]=(0,r.useState)(null),g=!!m,_=(0,r.useId)(),y=()=>h(null),b=(0,t.useTheme)().components?.MuiButtonBase?.defaultProps?.LinkComponent??`a`;return(0,n.jsxs)(t.AppBar,{position:`sticky`,color:`default`,children:[(0,n.jsxs)(t.Toolbar,{sx:{display:`grid`,gridTemplateColumns:`minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr)`,alignItems:`center`,gap:1},children:[(0,n.jsx)(t.IconButton,{href:u,"aria-label":`Go to home`,sx:{justifySelf:`start`,p:.5},children:(0,n.jsx)(t.Box,{component:`img`,src:o,alt:``,sx:{height:30,display:`block`}})}),(0,n.jsxs)(t.Box,{title:s,"data-testid":`network-status-${c?`connected`:`disconnected`}`,sx:{display:`flex`,alignItems:`center`,gap:1,minWidth:0,maxWidth:`min(52vw, 420px)`},children:[(0,n.jsx)(v,{online:c}),(0,n.jsx)(t.Typography,{variant:`subtitle1`,noWrap:!0,children:s})]}),(0,n.jsx)(t.IconButton,{"aria-label":`menu`,"aria-controls":g?_:void 0,"aria-haspopup":`true`,"aria-expanded":g?`true`:void 0,onClick:e=>h(e.currentTarget),sx:{justifySelf:`end`},children:(0,n.jsx)(i.default,{})})]}),(0,n.jsxs)(t.Menu,{id:_,anchorEl:m,open:g,onClose:y,children:[d.map(({label:e,href:r})=>(0,n.jsx)(t.MenuItem,{component:b,href:r,onClick:y,children:e},r)),p&&(0,n.jsxs)(t.MenuItem,{title:l||`Copy dApp API URL`,"aria-label":l?`Copy dApp API URL: ${l}`:`Copy dApp API URL`,onClick:()=>{y(),p()},children:[(0,n.jsx)(t.ListItemText,{children:`Dapp API URL`}),(0,n.jsx)(t.ListItemIcon,{sx:{justifyContent:`flex-end`},children:(0,n.jsx)(a.default,{fontSize:`small`})})]}),(0,n.jsx)(t.Divider,{}),(0,n.jsx)(t.MenuItem,{onClick:()=>{y(),f()},children:`Logout`})]})]})},x=[`authorization_code`,`client_credentials`,`self_signed`,`self_issued`],S=e=>typeof e?.method==`string`,C=e=>{switch(e){case`authorization_code`:return{method:e,clientId:``,audience:``,scope:``};case`client_credentials`:return{method:e,clientId:``,audience:``,scope:``,clientSecret:``};case`self_issued`:return{method:e,audience:``,scope:``};case`self_signed`:return{method:e,clientId:``,audience:``,scope:``,issuer:``,clientSecret:``}}},w=e=>e?`********`:`(not set)`,T=e=>{let t=[{key:`Method`,value:e.method},{key:`Audience`,value:e.audience??``},{key:`Scope`,value:e.scope??``}];return`clientId`in e&&t.splice(1,0,{key:`Client Id`,value:e.clientId??``}),`issuer`in e&&t.push({key:`Issuer`,value:e.issuer??``}),`clientSecret`in e&&t.push({key:`Client Secret`,value:w(e.clientSecret)}),e.method===`client_credentials`&&e.identityProviderId&&t.push({key:`Identity Provider Id`,value:e.identityProviderId}),t},E=(e,t)=>{let n=`clientId`in e?e.clientId:``,r=e.audience??``,i=e.scope??``;switch(t){case`authorization_code`:return{method:t,clientId:n,audience:r,scope:i};case`self_signed`:return{method:t,clientId:n,audience:r,scope:i,issuer:e.issuer??``,clientSecret:e.clientSecret??``};case`self_issued`:return{method:t,audience:r,scope:i};case`client_credentials`:return{method:t,...e.method===`client_credentials`&&e.identityProviderId?{identityProviderId:e.identityProviderId}:{},clientId:n,audience:r,scope:i,clientSecret:e.clientSecret??``};default:throw Error(`Unsupported auth method: ${String(t)}`)}},D=({label:e,testId:r,value:i,onChange:a,required:o=!1,placeholder:s,helperText:c})=>(0,n.jsx)(t.TextField,{label:e,required:o,fullWidth:!0,value:i,placeholder:s,helperText:c,onChange:e=>a(e.target.value),slotProps:{htmlInput:{"data-test-id":r}}}),O=({auth:e,onChange:i,allowedMethods:a=x,optional:o=!1,label:s=`auth`})=>{let c=`No ${s} configured.`,l=`${s.charAt(0).toUpperCase()}${s.slice(1)} will be removed after submitting this form.`,[u,d]=(0,r.useState)(()=>o?S(e)?`view`:`none`:`edit`),[f,p]=(0,r.useState)(),[m,h]=(0,r.useState)(``),g=()=>{h(``),d(`add`)},_=()=>{e&&p(structuredClone(e)),h(``),d(`edit`)},v=()=>{e&&p(structuredClone(e)),i(void 0),d(`pending-remove`)},y=()=>{f?(i(structuredClone(f)),d(`view`)):d(o?`none`:`edit`)},b=()=>{f?(i(structuredClone(f)),d(`view`)):(i(void 0),d(o?`none`:`edit`)),h(``)},w=(0,n.jsxs)(t.Stack,{spacing:1,"data-test-id":`auth-editor-empty-state`,children:[(0,n.jsx)(t.Typography,{variant:`body2`,color:`text.secondary`,"data-test-id":`auth-editor-empty-text`,children:c}),(0,n.jsx)(t.Box,{children:(0,n.jsx)(t.Button,{size:`small`,"data-test-id":`auth-editor-add-button`,onClick:g,children:`Add`})})]});if(u===`none`)return w;if(u===`pending-remove`)return(0,n.jsxs)(t.Stack,{spacing:1,"data-test-id":`auth-editor-pending-remove-state`,children:[(0,n.jsx)(t.Alert,{severity:`warning`,"data-test-id":`auth-editor-pending-remove-text`,children:l}),(0,n.jsx)(t.Box,{children:(0,n.jsx)(t.Button,{size:`small`,"data-test-id":`auth-editor-cancel-remove-button`,onClick:y,children:`Cancel`})})]});if(u===`view`&&S(e))return(0,n.jsxs)(t.Stack,{spacing:1,"data-test-id":`auth-editor-view-state`,children:[(0,n.jsx)(t.Box,{component:`dl`,"data-test-id":`auth-editor-summary-list`,sx:{m:0},children:T(e).map(e=>(0,n.jsxs)(t.Box,{"data-test-id":`auth-editor-summary-row`,sx:{display:`flex`,gap:2,minHeight:32,alignItems:`center`},children:[(0,n.jsx)(t.Typography,{component:`dt`,variant:`body2`,noWrap:!0,sx:{fontWeight:`bold`,flexShrink:0,minWidth:`8rem`},children:e.key}),(0,n.jsx)(t.Typography,{component:`dd`,variant:`body2`,noWrap:!0,title:e.value,sx:{m:0,flex:1,minWidth:0,textAlign:`right`},children:e.value})]},e.key))}),(0,n.jsxs)(t.Stack,{direction:`row`,spacing:1,children:[(0,n.jsx)(t.Button,{size:`small`,"data-test-id":`auth-editor-edit-button`,onClick:_,children:`Edit`}),(0,n.jsx)(t.Button,{size:`small`,color:`error`,"data-test-id":`auth-editor-remove-button`,onClick:v,children:`Remove`})]})]});let O=S(e)?e:C(a[0]??`authorization_code`),k=O.method,A=e=>i({...O,...e}),j=f&&`clientSecret`in f?f.clientSecret:void 0,M=`clientSecret`in O?O.clientSecret:void 0,N=m.trim()===``&&u!==`add`&&(typeof M==`string`&&M!==``||typeof j==`string`&&j.length>0),P=e=>{h(e);let t;t=e.trim()===``?u===`add`?``:typeof j==`string`?j:M??``:e,A({clientSecret:t})},F=e=>{let t=e.trim(),{identityProviderId:n,...r}=O;i(t?{...r,identityProviderId:t}:r)},I=`clientId`in O&&(0,n.jsx)(D,{label:`Client Id`,testId:`auth-editor-client-id-input`,required:!0,value:O.clientId??``,onChange:e=>A({clientId:e})}),L=(0,n.jsx)(D,{label:`Client Secret`,testId:`auth-editor-client-secret-input`,required:!N,value:m,placeholder:N?`********`:``,helperText:N?(0,n.jsx)(`span`,{"data-test-id":`auth-editor-secret-help`,children:`Current secret is hidden. Enter a new value to replace it.`}):void 0,onChange:P});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.Stack,{spacing:2,"data-test-id":`auth-editor-edit-state`,children:[(0,n.jsxs)(t.TextField,{select:!0,label:`Method`,required:!0,fullWidth:!0,value:k,onChange:e=>i(E(O,e.target.value)),slotProps:{select:{native:!0},htmlInput:{"data-test-id":`auth-editor-method-select`}},children:[!a.includes(k)&&(0,n.jsx)(`option`,{value:k,disabled:!0,children:k}),a.map(e=>(0,n.jsx)(`option`,{value:e,children:e},e))]}),(0,n.jsx)(D,{label:`Audience`,testId:`auth-editor-audience-input`,required:!0,value:O.audience??``,onChange:e=>A({audience:e})}),(0,n.jsx)(D,{label:`Scope`,testId:`auth-editor-scope-input`,required:!0,value:O.scope??``,onChange:e=>A({scope:e})}),k===`authorization_code`&&I,k===`client_credentials`&&(0,n.jsxs)(n.Fragment,{children:[I,(0,n.jsx)(D,{label:`Identity Provider Id Override`,testId:`auth-editor-identity-provider-id-input`,value:O.identityProviderId??``,helperText:`Optional. Uses the network identity provider when empty.`,onChange:F}),L]}),k===`self_signed`&&(0,n.jsxs)(n.Fragment,{children:[I,(0,n.jsx)(D,{label:`Issuer`,testId:`auth-editor-issuer-input`,required:!0,value:O.issuer??``,onChange:e=>A({issuer:e})}),L]}),![`authorization_code`,`client_credentials`,`self_signed`,`self_issued`].includes(k)&&(0,n.jsxs)(t.Alert,{severity:`warning`,"data-test-id":`auth-editor-unsupported-method-warning`,children:[`Unsupported auth method "`,k,`". Select a supported method to continue.`]})]}),o&&(0,n.jsx)(t.Box,{sx:{mt:1},children:(0,n.jsx)(t.Button,{size:`small`,"data-test-id":`auth-editor-cancel-edit-button`,onClick:b,children:`Cancel`})})]})},k=({label:e=`Back`,href:r,onClick:i})=>(0,n.jsx)(t.Button,{color:`inherit`,size:`small`,startIcon:(0,n.jsx)(o.default,{}),...r===void 0?{onClick:i}:{href:r},children:e}),A=e.c([`core`,`wallet-ui-components/react`]),j=({onCopy:e,value:i,label:o=`Copy to clipboard`})=>{let[s,c]=(0,r.useState)(!1),l=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>()=>clearTimeout(l.current),[]),(0,n.jsx)(t.Tooltip,{title:s?`Copied`:o,children:(0,n.jsx)(t.IconButton,{"aria-label":o,onClick:async t=>{if(t.stopPropagation(),i)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(i);else throw Error(`Browser does not support clipboard functionality.`);e!==void 0&&e(i),clearTimeout(l.current),l.current=setTimeout(()=>c(!1),1200),c(!0)}catch(e){A.getChild(`CopyButton`).error(`Unable to copy value`,{error:e})}},children:(0,n.jsx)(a.default,{color:s?`success`:`inherit`})})})},M=({mode:e,title:r=`Something went wrong`,message:i=`An unexpected error occurred while loading this page.`,onAction:a})=>(0,n.jsx)(t.Paper,{children:(0,n.jsxs)(t.Stack,{sx:{justifyContent:`center`,alignItems:`center`,p:4},children:[(0,n.jsx)(t.Box,{children:(0,n.jsx)(s.default,{color:`error`})}),(0,n.jsxs)(t.Box,{children:[(0,n.jsx)(t.Typography,{variant:`h5`,component:`h1`,children:r}),(0,n.jsx)(t.Typography,{variant:`body1`,children:i})]}),(0,n.jsx)(t.Box,{sx:{mt:4},children:(0,n.jsx)(t.Button,{variant:`contained`,color:`primary`,startIcon:e===`back`?(0,n.jsx)(c.default,{}):(0,n.jsx)(l.default,{}),onClick:a,children:e===`back`?`Back`:`Refresh`})})]})}),N=({idp:e,onReview:r})=>{let i=`configUrl`in e?e.configUrl:``;return(0,n.jsx)(t.Card,{component:`article`,"data-testid":`idp-card`,variant:`outlined`,sx:{position:`relative`,...r&&{"&:hover":{borderColor:`primary.main`,boxShadow:2}}},children:(0,n.jsxs)(t.CardContent,{children:[(0,n.jsx)(t.Box,{sx:{mb:1},children:r?(0,n.jsx)(t.Link,{component:`button`,type:`button`,variant:`body1`,color:`inherit`,underline:`none`,onClick:()=>r(e),sx:{fontWeight:`bold`,textAlign:`left`,position:`static`,"&::after":{content:`""`,position:`absolute`,inset:0,cursor:`pointer`}},children:e.id}):(0,n.jsx)(t.Typography,{variant:`body1`,sx:{fontWeight:`bold`},children:e.id})}),(0,n.jsxs)(t.Stack,{spacing:.5,children:[(0,n.jsx)(p,{label:`Type`,value:e.type}),`issuer`in e&&(0,n.jsx)(p,{label:`Issuer`,value:e.issuer,action:(0,n.jsx)(j,{value:e.issuer,label:`Copy issuer URL`})}),i&&(0,n.jsx)(p,{label:`Config URL`,value:i,action:(0,n.jsx)(j,{value:i,label:`Copy config URL`})})]})]})})},P={id:``,type:`oauth`,issuer:``,configUrl:``},F=e=>`issuer`in e?e.issuer:``,I=e=>`configUrl`in e?e.configUrl:``,L=({idp:e,loading:i=!1,onSave:a,onDelete:o,onCancel:s})=>{let c=e??P,[l,u]=(0,r.useState)(c.id),[d,f]=(0,r.useState)(c.type),[p,m]=(0,r.useState)(F(c)),[h,g]=(0,r.useState)(I(c)),[_,v]=(0,r.useState)(``),[y,b]=(0,r.useState)(e);return e!==y&&(b(e),u(c.id),f(c.type),m(F(c)),g(I(c)),v(``)),(0,n.jsxs)(t.Box,{component:`form`,onSubmit:e=>{if(e.preventDefault(),!l||d!==`self_issued`&&!p||d===`oauth`&&!h)v(`Please fill in all required fields`);else switch(v(``),d){case`oauth`:a({id:l,type:d,issuer:p,configUrl:h});break;case`self_signed`:a({id:l,type:d,issuer:p});break;case`self_issued`:a({id:l,type:d})}},sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,n.jsxs)(t.Stack,{spacing:2,children:[(0,n.jsx)(t.TextField,{id:`idp-id`,label:`ID`,required:!0,fullWidth:!0,placeholder:`Enter the identity provider ID`,helperText:`A unique identifier for the identity provider`,disabled:i,value:l,onChange:e=>u(e.target.value)}),(0,n.jsxs)(t.TextField,{id:`idp-type`,select:!0,label:`Type`,required:!0,fullWidth:!0,disabled:i,value:d,onChange:e=>f(e.target.value),slotProps:{select:{native:!0}},children:[(0,n.jsx)(`option`,{value:`oauth`,children:`oauth`}),(0,n.jsx)(`option`,{value:`self_signed`,children:`self_signed`}),(0,n.jsx)(`option`,{value:`self_issued`,children:`self_issued`})]}),d!==`self_issued`&&(0,n.jsx)(t.TextField,{id:`idp-issuer`,label:`Issuer URL`,required:!0,fullWidth:!0,placeholder:`Enter the issuer URL`,disabled:i,value:p,onChange:e=>m(e.target.value)}),d===`oauth`&&(0,n.jsx)(t.TextField,{id:`idp-config-url`,label:`Config URL`,required:!0,fullWidth:!0,placeholder:`Enter the configuration URL`,disabled:i,value:h,onChange:e=>g(e.target.value)})]}),_&&(0,n.jsx)(t.Alert,{severity:`error`,sx:{mt:2},children:_}),e?(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsxs)(t.Box,{sx:{mt:4},children:[(0,n.jsx)(t.Divider,{sx:{mb:3}}),(0,n.jsx)(t.Typography,{variant:`subtitle1`,component:`h2`,sx:{fontWeight:`bold`,mb:1},children:`Delete identity provider`}),(0,n.jsx)(t.Typography,{variant:`body2`,color:`text.secondary`,sx:{mb:2},children:`You will not be able to undo the change once you delete this Identity Provider.`}),(0,n.jsx)(t.Button,{variant:`outlined`,color:`error`,onClick:()=>o(e),children:`Delete identity provider`})]}),(0,n.jsxs)(t.Stack,{direction:`row`,spacing:2,sx:{mt:3},children:[s&&(0,n.jsx)(t.Button,{variant:`outlined`,color:`inherit`,fullWidth:!0,onClick:s,children:`Cancel`}),(0,n.jsx)(t.Button,{type:`submit`,variant:`contained`,fullWidth:!0,disabled:i,children:`Update`})]})]}):(0,n.jsx)(t.Box,{sx:{mt:`auto`,pt:3},children:(0,n.jsx)(t.Button,{type:`submit`,variant:`contained`,fullWidth:!0,disabled:i,children:`Add`})})]})},R=u.keyframes`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../error-toast-By8cEMjq.cjs");let t=require("react");t=e.Lt(t,1);let n=require("@lit/react"),r=require("@mui/material"),i=require("react/jsx-runtime"),a=require("@mui/icons-material/ChevronLeft");a=e.Lt(a,1);let o=require("@mui/icons-material/ContentCopy");o=e.Lt(o,1);let s=require("@mui/material/styles");var c=(0,n.createComponent)({tagName:`api-key-card`,elementClass:e.Mt,react:t.default,events:{onRevoke:`revoke`}}),l=()=>(0,i.jsx)(r.CircularProgress,{size:16,color:`inherit`,"aria-hidden":`true`}),u=({onApprove:e,onReject:t,approveLabel:n=`Approve`,approving:a=!1,rejecting:o=!1,signing:s=!1,disabled:c=!1})=>(0,i.jsxs)(r.Stack,{direction:`row`,spacing:2,children:[t&&(0,i.jsx)(r.Button,{variant:`outlined`,color:`error`,fullWidth:!0,disabled:c||a||o,startIcon:o?(0,i.jsx)(l,{}):void 0,onClick:t,children:`Reject`}),(0,i.jsx)(r.Button,{variant:`contained`,fullWidth:!0,disabled:c||a||o||s,startIcon:a||s?(0,i.jsx)(l,{}):void 0,onClick:e,children:n})]}),d=(0,n.createComponent)({tagName:`api-key-form`,elementClass:e.At,react:t.default,events:{onApiKeyGenerate:`api-key-generate`}}),f=(0,n.createComponent)({tagName:`app-header`,elementClass:e.vt,react:t.default,events:{onLogout:`logout`,onCopyDappApiUrl:`copy-dapp-api-url`}}),p=({label:e=`Back`,href:t,onClick:n})=>(0,i.jsx)(r.Button,{color:`inherit`,size:`small`,startIcon:(0,i.jsx)(a.default,{}),...t===void 0?{onClick:n}:{href:t},children:e}),m=({label:e,value:t,title:n=typeof t==`string`?t:void 0,muted:a=!1,action:o})=>{let s=typeof t==`string`;return(0,i.jsxs)(r.Box,{sx:{display:`flex`,alignItems:`center`,gap:2,minWidth:0,minHeight:40},children:[(0,i.jsx)(r.Typography,{variant:`body2`,noWrap:!0,sx:{fontWeight:`bold`,flexShrink:0,minWidth:`8rem`},children:e}),(0,i.jsx)(r.Typography,{variant:`body2`,component:`div`,noWrap:s,title:s?n:void 0,color:a?`text.secondary`:`text.primary`,sx:{flex:1,minWidth:0,textAlign:`right`,...!s&&{display:`flex`,flexWrap:`wrap`,alignItems:`center`,justifyContent:`flex-end`,gap:.5}},children:t}),o&&(0,i.jsx)(r.Box,{sx:{position:`relative`,zIndex:1,flexShrink:0},children:o})]})},h=e.j([`core`,`wallet-ui-components/react`]),g=({onCopy:e,value:n,label:a=`Copy to clipboard`})=>{let[s,c]=(0,t.useState)(!1),l=(0,t.useRef)(void 0);return(0,t.useEffect)(()=>()=>clearTimeout(l.current),[]),(0,i.jsx)(r.Tooltip,{title:s?`Copied`:a,children:(0,i.jsx)(r.IconButton,{"aria-label":a,onClick:async t=>{if(t.stopPropagation(),n)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(n);else throw Error(`Browser does not support clipboard functionality.`);e!==void 0&&e(n),clearTimeout(l.current),l.current=setTimeout(()=>c(!1),1200),c(!0)}catch(e){h.getChild(`CopyButton`).error(`Unable to copy value`,{error:e})}},children:(0,i.jsx)(o.default,{color:s?`success`:`inherit`})})})},_=(0,n.createComponent)({tagName:`wg-error-page`,elementClass:e.ft,react:t.default,events:{onErrorBack:`error-back`,onErrorRefresh:`error-refresh`}}),v=(0,n.createComponent)({tagName:`idp-card`,elementClass:e.ot,react:t.default,events:{onIdpReview:`idp-review`,onDelete:`delete`,onUpdate:`update`}}),y=(0,n.createComponent)({tagName:`idp-form`,elementClass:e.nt,react:t.default,events:{onIdpFormSave:`idp-form-save`,onIdpFormDelete:`idp-form-delete`,onIdpFormCancel:`idp-form-cancel`,onIdpFormBack:`idp-form-back`}}),b=s.keyframes`
|
|
2
2
|
0%, 80%, 100% {
|
|
3
3
|
transform: scale(0.7);
|
|
4
4
|
opacity: 0.4;
|
|
@@ -7,13 +7,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
7
7
|
transform: scale(1);
|
|
8
8
|
opacity: 1;
|
|
9
9
|
}
|
|
10
|
-
`,ee=({text:e=`Loading`})=>(0,n.jsxs)(t.Stack,{role:`status`,"aria-live":`polite`,spacing:2,sx:{minHeight:180,justifyContent:`center`,alignItems:`center`,p:3},children:[(0,n.jsx)(t.Stack,{direction:`row`,spacing:1,"aria-hidden":`true`,children:[0,1,2].map(e=>(0,n.jsx)(t.Box,{sx:{width:8,height:8,borderRadius:`50%`,bgcolor:`primary.main`,animation:`${R} 1s infinite ease-in-out`,animationDelay:`${e*.15}s`,"@media (prefers-reduced-motion: reduce)":{animation:`none`}}},e))}),(0,n.jsx)(t.Typography,{variant:`body1`,color:`text.secondary`,children:e})]}),z=e=>e.authMethod!==`client_credentials`,B=({networks:i,idps:a,loading:o=!1,connecting:s=!1,message:c=null,onConnect:l})=>{let[u,d]=(0,r.useState)(),[f,p]=(0,r.useState)(null),[m,h]=(0,r.useState)(``),[g,_]=(0,r.useState)(``),[v,y]=(0,r.useState)(null),[b,x]=(0,r.useState)(null),S=i.find(e=>e.id===u),C=u===null?null:S&&z(S)?S:i.find(z)??null,w=a.find(e=>e.id===C?.identityProviderId)??null,T=w?.type===`self_issued`||C?.authMethod===`self_issued`,E=!T&&w?.type===`self_signed`,D=v?{type:`error`,text:v}:c&&c!==b?c:null,O=e=>{d(e===``?null:e),p(null),y(null),x(c)};return(0,n.jsxs)(t.Box,{component:`form`,onSubmit:e=>{e.preventDefault(),y(null),x(c),C?w?w.type===`self_signed`?l(C,w,f||C.clientId,m):w.type===`self_issued`?l(C,w,void 0,void 0,g.trim()):l(C,w):y(`Identity provider misconfigured for this network.`):y(`Please select a network before connecting.`)},sx:{minHeight:`100dvh`,display:`flex`,flexDirection:`column`},children:[(0,n.jsx)(t.Box,{sx:{height:44,display:`flex`,alignItems:`center`,px:2,borderBottom:1,borderColor:`divider`},children:(0,n.jsx)(`img`,{src:e.l,alt:`Canton logo`,width:24,height:24,style:{objectFit:`contain`}})}),(0,n.jsxs)(t.Stack,{spacing:2,sx:{flex:1,px:2,pt:2},children:[(0,n.jsx)(t.Typography,{variant:`h5`,component:`h1`,sx:{fontWeight:`bold`},children:`Wallet Gateway`}),(0,n.jsxs)(t.TextField,{select:!0,fullWidth:!0,label:`Select a network`,value:C?.id??``,disabled:o||s,onChange:e=>O(e.target.value),slotProps:{select:{native:!0},inputLabel:{shrink:!0}},children:[(0,n.jsx)(`option`,{value:``,children:`Select network`}),i.map(e=>(0,n.jsx)(`option`,{value:e.id,disabled:!z(e),children:e.name},e.id))]}),T&&(0,n.jsx)(t.TextField,{fullWidth:!0,required:!0,label:`Username`,autoComplete:`username`,value:g,disabled:s,onChange:e=>_(e.target.value)}),E&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.TextField,{fullWidth:!0,label:`Client ID`,autoComplete:`username`,value:f??C?.clientId??``,disabled:s,onChange:e=>p(e.target.value)}),(0,n.jsx)(t.TextField,{fullWidth:!0,label:`Client Secret`,type:`password`,autoComplete:`current-password`,value:m,disabled:s,onChange:e=>h(e.target.value)})]}),D?(0,n.jsx)(t.Alert,{severity:D.type,children:D.text}):(0,n.jsx)(t.Typography,{variant:`body2`,color:`text.secondary`,children:o?`Loading networks...`:C?`Selected: ${C.name}`:`Choose a network to continue.`})]}),(0,n.jsx)(t.Box,{sx:{p:2},children:(0,n.jsx)(t.Button,{type:`submit`,variant:`contained`,size:`large`,fullWidth:!0,disabled:o||s||!C,children:s?`Connecting…`:`Connect`})})]})},te=({messageId:r,message:i,status:a,origin:o=null,externalTxId:s=null,backHref:c,approving:l=!1,rejecting:u=!1,signing:d=!1,disabled:f=!1,onApprove:m,onReject:h})=>(0,n.jsxs)(t.Stack,{spacing:2,children:[(0,n.jsxs)(t.Stack,{direction:`row`,sx:{alignItems:`center`,justifyContent:`space-between`},children:[(0,n.jsx)(t.Typography,{variant:`h5`,component:`h1`,children:`Message Details`}),c&&(0,n.jsx)(k,{href:c})]}),(0,n.jsxs)(t.Stack,{spacing:.5,children:[(0,n.jsx)(p,{label:`Status`,value:(0,n.jsx)(t.Chip,{"data-testid":`activity-status`,label:e.a(a),color:e.i(a),size:`small`})}),o&&(0,n.jsx)(p,{label:`Requested by`,value:o}),s&&(0,n.jsx)(p,{label:`External transaction ID`,value:s,action:(0,n.jsx)(j,{value:s,label:`Copy external transaction ID`})}),(0,n.jsxs)(t.Box,{children:[(0,n.jsx)(t.Typography,{variant:`body2`,component:`h2`,sx:{fontWeight:`bold`,py:1},children:`Message`}),(0,n.jsx)(t.Box,{component:`pre`,sx:{m:0,p:1.5,overflow:`auto`,whiteSpace:`pre-wrap`,bgcolor:`action.hover`,borderRadius:1,fontSize:`0.8125rem`},children:i})]})]}),a===`pending`&&(0,n.jsx)(g,{approving:l,rejecting:u,signing:d,disabled:f,onApprove:()=>m(r),onReject:h&&(()=>h(r))})]}),ne=({network:e,activeSession:r=!1,accessToken:i=``,onReview:a})=>{let o=e.synchronizerId??``;return(0,n.jsx)(t.Card,{component:`article`,"data-testid":`network-card`,variant:`outlined`,sx:{position:`relative`,...a&&{"&:hover":{borderColor:`primary.main`,boxShadow:2}}},children:(0,n.jsxs)(t.CardContent,{children:[(0,n.jsxs)(t.Stack,{direction:`row`,spacing:1,sx:{alignItems:`center`,mb:1},children:[a?(0,n.jsx)(t.Link,{component:`button`,type:`button`,variant:`body1`,color:`inherit`,underline:`none`,onClick:()=>a(e),sx:{fontWeight:`bold`,textAlign:`left`,position:`static`,"&::after":{content:`""`,position:`absolute`,inset:0,cursor:`pointer`}},children:e.name}):(0,n.jsx)(t.Typography,{variant:`body1`,sx:{fontWeight:`bold`},children:e.name}),r&&(0,n.jsx)(t.Chip,{label:`CONNECTED`,color:`success`,size:`small`})]}),(0,n.jsxs)(t.Stack,{spacing:.5,children:[(0,n.jsx)(p,{label:`ID`,value:e.id}),r&&(0,n.jsx)(p,{label:`Access Token`,value:`[private]`,muted:!0,action:(0,n.jsx)(j,{value:i,label:`Copy access token`})}),(0,n.jsx)(p,{label:`Auth`,value:e.authMethod}),o&&(0,n.jsx)(p,{label:`Synchronizer`,value:o,action:(0,n.jsx)(j,{value:o,label:`Copy synchronizer ID`})}),e.identityProviderId&&(0,n.jsx)(p,{label:`Identity provider`,value:e.identityProviderId})]})]})})},V=(0,r.memo)(O),H=[`client_credentials`],U={id:``,name:``,description:``,identityProviderId:``,ledgerApi:``,auth:{method:`authorization_code`,audience:``,scope:``,clientId:``}},W=e=>{try{return new URL(e),!0}catch{return!1}},G=e=>({synchronizerId:!e.synchronizerId||e.synchronizerId.includes(`::`)&&e.synchronizerId.length>=10?void 0:`Must contain "::" and be at least 10 characters`,ledgerApi:W(e.ledgerApi)?void 0:`Must be a valid URL`}),K=({title:e,children:i})=>{let a=(0,r.useId)();return(0,n.jsxs)(t.Box,{component:`section`,"aria-labelledby":a,children:[(0,n.jsx)(t.Typography,{id:a,variant:`subtitle1`,component:`h3`,sx:{fontWeight:`bold`,mb:1},children:e}),i]})},q=({network:e,onSave:i,onDelete:a,onCancel:o})=>{let s=e??U,[c,l]=(0,r.useState)(s),[u,d]=(0,r.useState)(e),[f,p]=(0,r.useState)(0),[m,h]=(0,r.useState)(!1);e!==u&&(d(e),l(s),p(e=>e+1),h(!1));let g=m?G(c):{synchronizerId:void 0,ledgerApi:void 0},_=Object.values(g).some(Boolean),v=e=>l(t=>({...t,...e})),y=(0,r.useCallback)(e=>{e&&l(t=>({...t,auth:e}))},[]),b=(0,r.useCallback)((e,t)=>l(n=>{let r={...n};return delete r[e],t?{...r,[e]:t}:r}),[]),x=(0,r.useCallback)(e=>b(`adminAuth`,e),[b]),S=(0,r.useCallback)(e=>b(`serviceAccountAuth`,e),[b]);return(0,n.jsxs)(t.Box,{component:`form`,onSubmit:e=>{e.preventDefault(),h(!0),!Object.values(G(c)).some(Boolean)&&i(c)},sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,n.jsxs)(t.Stack,{spacing:2,children:[(0,n.jsx)(t.TextField,{label:`Network Id`,required:!0,fullWidth:!0,helperText:`A unique identifier for the network`,value:c.id,onChange:e=>v({id:e.target.value})}),(0,n.jsx)(t.TextField,{label:`Name`,required:!0,fullWidth:!0,value:c.name,onChange:e=>v({name:e.target.value})}),(0,n.jsx)(t.TextField,{label:`Description`,required:!0,fullWidth:!0,value:c.description,onChange:e=>v({description:e.target.value})}),(0,n.jsx)(t.TextField,{label:`Synchronizer Id`,fullWidth:!0,error:!!g.synchronizerId,helperText:g.synchronizerId,value:c.synchronizerId??``,onChange:e=>{let t={...c};e.target.value?t.synchronizerId=e.target.value:delete t.synchronizerId,l(t)}}),(0,n.jsx)(t.TextField,{label:`Identity Provider Id`,required:!0,fullWidth:!0,value:c.identityProviderId,onChange:e=>v({identityProviderId:e.target.value})}),(0,n.jsx)(t.TextField,{label:`Ledger API Base Url`,required:!0,fullWidth:!0,error:!!g.ledgerApi,helperText:g.ledgerApi,value:c.ledgerApi,onChange:e=>v({ledgerApi:e.target.value})}),(0,n.jsx)(K,{title:`Configure user auth`,children:(0,n.jsx)(V,{auth:c.auth,onChange:y},f)}),(0,n.jsx)(K,{title:`Configure admin auth`,children:(0,n.jsx)(V,{auth:c.adminAuth,optional:!0,label:`admin auth`,onChange:x},f)}),(0,n.jsx)(K,{title:`Configure service account auth`,children:(0,n.jsx)(V,{auth:c.serviceAccountAuth,allowedMethods:H,optional:!0,label:`service account auth`,onChange:S},f)})]}),_&&(0,n.jsx)(t.Alert,{severity:`error`,sx:{mt:2},children:`Invalid network data, please ensure all fields are set correctly`}),e?(0,n.jsxs)(n.Fragment,{children:[a&&(0,n.jsxs)(t.Box,{sx:{mt:4},children:[(0,n.jsx)(t.Divider,{sx:{mb:3}}),(0,n.jsx)(t.Typography,{variant:`subtitle1`,component:`h2`,sx:{fontWeight:`bold`,mb:1},children:`Delete network`}),(0,n.jsx)(t.Typography,{variant:`body2`,color:`text.secondary`,sx:{mb:2},children:`You will not be able to undo the change once you delete this network.`}),(0,n.jsx)(t.Button,{variant:`outlined`,color:`error`,onClick:()=>a(e),children:`Delete Network`})]}),(0,n.jsxs)(t.Stack,{direction:`row`,spacing:2,sx:{mt:3},children:[o&&(0,n.jsx)(t.Button,{variant:`outlined`,color:`inherit`,fullWidth:!0,onClick:o,children:`Cancel`}),(0,n.jsx)(t.Button,{type:`submit`,variant:`contained`,fullWidth:!0,"data-test-id":`update-network-button`,children:`Update`})]})]}):(0,n.jsx)(t.Box,{sx:{mt:`auto`,pt:3},children:(0,n.jsx)(t.Button,{type:`submit`,variant:`contained`,fullWidth:!0,"data-test-id":`add-network-button`,children:`Add`})})]})},re=({total:e,pageSize:r=5,page:i=1,onPageChange:a})=>{let o=Math.max(r,1),s=Math.max(1,Math.ceil(e/o)),l=Math.min(Math.max(i,1),s),u=e>0?(l-1)*o+1:0,f=e>0?Math.min(u+o-1,e):0;return(0,n.jsxs)(t.Stack,{component:`nav`,"aria-label":`Pagination`,direction:`row`,spacing:1,sx:{alignItems:`center`,display:`inline-flex`},children:[(0,n.jsx)(t.IconButton,{size:`small`,"aria-label":`Previous page`,disabled:l<=1,onClick:()=>a(l-1),children:(0,n.jsx)(c.default,{fontSize:`small`})}),(0,n.jsxs)(t.Typography,{variant:`body2`,component:`span`,children:[u,`-`,f,` of `,e]}),(0,n.jsx)(t.IconButton,{size:`small`,"aria-label":`Next page`,disabled:l>=s,onClick:()=>a(l+1),children:(0,n.jsx)(d.default,{fontSize:`small`})})]})},J=({signingProviders:e,value:r,onChange:i,disabled:a=!1,disabledProviders:o=[]})=>{let s=e===void 0,c=e?.length===0;return(0,n.jsxs)(t.TextField,{id:`signing-provider-id`,select:!0,label:`Signing Provider`,required:!0,fullWidth:!0,value:r,disabled:a||s||c,onChange:e=>i(e.target.value),slotProps:{select:{native:!0},inputLabel:{shrink:!0}},children:[(0,n.jsx)(`option`,{value:``,disabled:!0,children:s?`Loading signing providers...`:c?`No signing providers available`:`Select signing provider`}),e?.map(e=>(0,n.jsx)(`option`,{value:e,disabled:o.includes(e),children:e},e))]})},Y=({title:e,message:i,type:a=`error`,buttonText:o=`Dismiss notification`,autoHideDuration:s,onExited:c})=>{let[l,u]=(0,r.useState)(!0);return(0,n.jsx)(t.Snackbar,{open:l,autoHideDuration:s,onClose:(e,t)=>{t!==`clickaway`&&u(!1)},slotProps:{transition:{onExited:()=>c?.()}},sx:{position:`static`,pointerEvents:`auto`},children:(0,n.jsxs)(t.Alert,{role:a===`error`?`alert`:`status`,severity:a,closeText:o,onClose:()=>u(!1),sx:{width:`100%`},children:[(0,n.jsx)(t.AlertTitle,{children:e}),i]})})},ie=({transactionId:r,commandId:i,externalTxId:a=null,status:o,parsed:s=null,createdAt:c=null,loading:l=!1,onReview:u})=>{let d=e.o(s),f=e.n(s),m=e.t(c);return(0,n.jsx)(t.Card,{variant:`outlined`,"data-testid":`transaction-card`,children:(0,n.jsx)(t.CardActionArea,{disabled:l,"aria-label":`Open activity ${i}`,onClick:()=>u(r,i),children:(0,n.jsx)(t.CardContent,{children:(0,n.jsxs)(t.Stack,{spacing:.5,children:[(0,n.jsx)(p,{label:`Command ID`,value:i}),a&&(0,n.jsx)(p,{label:`External transaction ID`,value:a}),(0,n.jsx)(p,{label:`Status`,value:(0,n.jsx)(t.Chip,{"data-testid":`activity-status`,label:e.a(o),color:e.i(o),size:`small`})}),(0,n.jsx)(p,{label:`Action type`,value:d}),(0,n.jsx)(p,{label:`Created at`,value:m}),(0,n.jsx)(p,{label:`Amount`,value:f})]})})})})},X=({label:e,value:t,copyLabel:r})=>(0,n.jsx)(p,{label:e,value:t||`N/A`,action:t?(0,n.jsx)(j,{value:t,label:r}):void 0}),ae=({commandId:i,externalTxId:a=null,status:o,txHash:s,parsed:c=null,createdAt:l=null,backHref:u,approving:d=!1,rejecting:m=!1,signing:h=!1,submitFailed:_=!1,disabled:v=!1,onApprove:y,onReject:b})=>{let[x,S]=(0,r.useState)(!1),C=c?.signatories??[],w=c?.jsonString,T=o===`pending`||o===`signed`;return(0,n.jsxs)(t.Stack,{spacing:2,children:[(0,n.jsxs)(t.Stack,{direction:`row`,sx:{alignItems:`center`,justifyContent:`space-between`},children:[(0,n.jsx)(t.Typography,{variant:`h5`,component:`h1`,children:`Activity Details`}),u&&(0,n.jsx)(k,{href:u})]}),(0,n.jsxs)(t.Stack,{spacing:.5,children:[(0,n.jsx)(p,{label:`Status`,value:(0,n.jsx)(t.Chip,{"data-testid":`activity-status`,label:e.a(o),color:e.i(o),size:`small`})}),(0,n.jsx)(p,{label:`Action type`,value:e.o(c)}),(0,n.jsx)(p,{label:`Created at`,value:e.t(l)}),(0,n.jsx)(p,{label:`Signatories`,value:C.length?(0,n.jsx)(t.Stack,{spacing:.5,sx:{alignItems:`flex-end`},children:C.map(e=>(0,n.jsxs)(t.Stack,{direction:`row`,sx:{alignItems:`center`},children:[(0,n.jsx)(t.Typography,{variant:`body2`,noWrap:!0,title:e,children:e}),(0,n.jsx)(j,{value:e,label:`Copy signatory`})]},e))}):`N/A`}),(0,n.jsx)(X,{label:`Template`,value:c?.templateId,copyLabel:`Copy template`}),(0,n.jsx)(X,{label:`Command ID`,value:i,copyLabel:`Copy command ID`}),a&&(0,n.jsx)(X,{label:`External transaction ID`,value:a,copyLabel:`Copy external transaction ID`}),(0,n.jsx)(X,{label:`Transaction hash`,value:s,copyLabel:`Copy transaction hash`}),(0,n.jsxs)(t.Box,{children:[(0,n.jsxs)(t.Stack,{direction:`row`,sx:{alignItems:`center`,justifyContent:`space-between`},children:[(0,n.jsx)(t.Button,{color:`inherit`,"aria-expanded":x,endIcon:(0,n.jsx)(f.default,{sx:{transform:x?`rotate(180deg)`:`none`}}),onClick:()=>S(e=>!e),children:`Transaction JSON Object`}),w&&(0,n.jsx)(j,{value:w,label:`Copy transaction json object`})]}),(0,n.jsx)(t.Collapse,{in:x,unmountOnExit:!0,children:(0,n.jsx)(t.Box,{component:`pre`,sx:{m:0,p:1.5,overflow:`auto`,bgcolor:`action.hover`,borderRadius:1,fontSize:`0.8125rem`},children:w||`N/A`})})]})]}),T&&(0,n.jsx)(g,{approveLabel:o===`signed`&&_?`Retry submit`:`Approve`,approving:d,rejecting:m,signing:h,disabled:v,onApprove:()=>y(i),onReject:o===`pending`&&b?()=>b(i):void 0})]})},oe=[`CanActAs`,`CanReadAs`,`CanExecuteAs`],se=72,ce=24,le=e=>e.length>ce?`${e.slice(0,10)}...${e.slice(-10)}`:e,ue=({children:e})=>(0,n.jsx)(t.Typography,{variant:`body2`,noWrap:!0,sx:{fontWeight:`bold`,flexShrink:0,width:`8rem`},children:e}),de=({wallet:e,verified:r=!1,loading:i=!1,onAllocate:a,onSetPrimary:o,onEdit:s,onSelect:c,selectLabel:l=`Select`})=>{let u=new Set(e.rights),d=oe.filter(e=>u.has(e)),f=!!(e.reason&&(e.reason.length>se||e.reason.includes(`
|
|
11
|
-
`))),m=e.primary?(0,n.jsx)(t.Chip,{label:`PRIMARY`,color:`success`,size:`small`},`badge`):e.disabled?(0,n.jsx)(t.Chip,{label:`Disabled`,color:`error`,size:`small`},`badge`):null,h=[];c?h.push((0,n.jsx)(t.Button,{size:`small`,disabled:i,onClick:()=>c(e),children:l},`select`)):(h.push(m),r?(!e.primary&&!e.disabled&&o&&h.push((0,n.jsx)(t.Button,{size:`small`,disabled:i,onClick:()=>o(e),children:`Set as primary`},`set-primary`)),s&&h.push((0,n.jsx)(t.Button,{size:`small`,disabled:i,onClick:()=>s(e),children:`Edit`},`edit`))):a&&h.push((0,n.jsx)(t.Button,{size:`small`,variant:`outlined`,color:`inherit`,disabled:i||e.disabled===!0,onClick:()=>a(e),children:`Allocate party`},`allocate`)));let g=h.some(Boolean);return(0,n.jsxs)(t.Card,{component:`article`,variant:`outlined`,"data-testid":`wallet-card`,"party-id":e.partyId,sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,n.jsx)(t.CardContent,{sx:{flexGrow:1},children:(0,n.jsxs)(t.Stack,{spacing:.5,"data-test-external-tx-id":e.externalTxId??``,children:[(0,n.jsx)(p,{label:`Party hint`,value:e.hint||`-`,action:e.hint?(0,n.jsx)(j,{value:e.hint,label:`Copy party hint`}):void 0}),(0,n.jsx)(p,{label:`Party ID`,value:le(e.partyId),title:e.partyId,action:(0,n.jsx)(j,{value:e.partyId,label:`Copy party ID`})}),(0,n.jsx)(p,{label:`Signing provider`,value:e.signingProviderId}),e.reason&&(f?(0,n.jsxs)(t.Box,{sx:{minHeight:40,py:.5},children:[(0,n.jsx)(ue,{children:`Reason`}),(0,n.jsx)(t.Typography,{variant:`body2`,title:e.reason,sx:{whiteSpace:`pre-wrap`},children:e.reason})]}):(0,n.jsx)(p,{label:`Reason`,value:e.reason})),d.length>0&&(0,n.jsx)(p,{label:`Permissions`,value:d.map(e=>(0,n.jsx)(t.Chip,{label:e,size:`small`},e))})]})}),g&&(0,n.jsx)(t.CardActions,{sx:{justifyContent:`space-between`},children:h})]})},Z=({children:e,onSubmit:r,submitLabel:i,submittingLabel:a,submittingMessage:o,submitting:s=!1,loading:c=!1,submitDisabled:l=!1})=>{let u=s||c||l;return(0,n.jsxs)(t.Box,{component:`form`,onSubmit:e=>{e.preventDefault(),!u&&r()},sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,n.jsx)(t.Stack,{spacing:2,children:e}),(0,n.jsxs)(t.Stack,{spacing:1,sx:{mt:`auto`,pt:3},children:[(0,n.jsx)(t.Button,{type:`submit`,variant:`contained`,fullWidth:!0,disabled:u,startIcon:s?(0,n.jsx)(t.CircularProgress,{size:16,color:`inherit`,"aria-hidden":`true`}):void 0,children:s?a:i}),s&&(0,n.jsx)(t.Typography,{variant:`body2`,color:`text.secondary`,role:`status`,"aria-live":`polite`,children:o})]})]})},fe=({signingProviders:e,keySigningProviders:i=[],publicKeys:a,selectedSigningProvider:o,showPrimary:s=!0,submitting:c=!1,submitLabel:l=`Add`,submittingLabel:u=`Adding...`,submittingMessage:d=`Creating party, please wait...`,onCreate:f,onSigningProviderChange:p})=>{let[m,h]=(0,r.useState)(``),[g,_]=(0,r.useState)(``),[v,y]=(0,r.useState)(!1),[b,x]=(0,r.useState)(``),S=o??g,C=!!S&&i.includes(S),w=e?.length===0,T=c||e===void 0||C&&a===void 0;return(0,n.jsx)(t.Box,{"data-testid":`wallet-create-form`,sx:{height:`100%`},children:(0,n.jsxs)(Z,{submitLabel:l,submittingLabel:u,submittingMessage:d,submitting:c,loading:T,submitDisabled:w,onSubmit:()=>{if(T||w)return;let e=a?.find(e=>e.id===b)?.name;e?f(m,S,v,e):f(m,S,v)},children:[(0,n.jsx)(t.TextField,{id:`party-id-hint`,label:`Party ID Hint`,required:!0,fullWidth:!0,placeholder:`Enter the name of your wallet?`,disabled:c,value:m,onChange:e=>h(e.target.value)}),(0,n.jsx)(J,{signingProviders:e,value:S,onChange:e=>{_(e),x(``),p?.(e)},disabled:c}),C&&(0,n.jsxs)(t.TextField,{id:`vault-name`,select:!0,label:`Vault name`,required:!0,fullWidth:!0,disabled:T,value:b,onChange:e=>x(e.target.value),slotProps:{select:{native:!0},inputLabel:{shrink:!0}},children:[(0,n.jsx)(`option`,{value:``,disabled:!0,children:T?`Loading vaults...`:`Select vault name`}),a?.map(e=>(0,n.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),s&&(0,n.jsx)(t.FormControlLabel,{label:`Set as primary wallet`,control:(0,n.jsx)(t.Checkbox,{id:`primary`,checked:v,disabled:c,onChange:e=>y(e.target.checked)})})]})})},pe=({partyId:e,signingProviders:i,disabledSigningProviders:a=[],publicKeys:o,selectedSigningProvider:s,selectedPublicKey:c,submitting:l=!1,submitLabel:u=`Edit`,submittingLabel:d=`Editing...`,submittingMessage:f=`Editing party, please wait...`,onEdit:p,onSigningProviderChange:m})=>{let[h,g]=(0,r.useState)(s??``),[_,v]=(0,r.useState)(c??``),[y,b]=(0,r.useState)(s),[x,S]=(0,r.useState)(c);s!==y&&(b(s),g(s??``)),c!==x&&(S(c),v(c??``));let C=i?.length===0,w=o===void 0,T=a.includes(h),E=l||i===void 0;return(0,n.jsxs)(Z,{submitLabel:u,submittingLabel:d,submittingMessage:f,submitting:l,loading:E,submitDisabled:C||!h||T||w,onSubmit:()=>{!E&&_&&h&&p(e,h,_)},children:[(0,n.jsx)(t.TextField,{id:`party-id`,label:`Party ID`,fullWidth:!0,disabled:!0,value:e,slotProps:{htmlInput:{readOnly:!0}}}),(0,n.jsx)(J,{signingProviders:i,value:h,onChange:e=>{g(e),v(``),m?.(e)},disabled:l,disabledProviders:a}),(0,n.jsxs)(t.TextField,{id:`public-key-id`,select:!0,label:`Public Key`,required:!0,fullWidth:!0,disabled:l,value:T?``:_,onChange:e=>v(e.target.value),slotProps:{select:{native:!0},inputLabel:{shrink:!0},...w&&{input:{startAdornment:(0,n.jsx)(t.InputAdornment,{position:`start`,children:(0,n.jsx)(t.CircularProgress,{size:16,"aria-label":`Loading public keys`})})}}},children:[(0,n.jsx)(`option`,{value:``,disabled:!0,children:w?``:T?`Select different signing provider`:`Select public key`}),o?.map(e=>(0,n.jsxs)(`option`,{value:e.publicKey,children:[e.name,` (`,e.publicKey,`)`]},e.publicKey))]})]})},me=u.keyframes`
|
|
12
|
-
from {
|
|
13
|
-
transform: rotate(0deg);
|
|
14
|
-
}
|
|
15
|
-
to {
|
|
16
|
-
transform: rotate(360deg);
|
|
17
|
-
}
|
|
18
|
-
`,he=({syncNeeded:e=!1,syncing:r=!1,disabled:i=!1,onSync:a})=>{let o=r?`Syncing parties...`:e?`Refresh parties (changes available)`:`Refresh parties`;return(0,n.jsx)(t.Tooltip,{title:o,describeChild:!0,children:(0,n.jsx)(`span`,{children:(0,n.jsx)(t.IconButton,{size:`small`,"aria-label":o,color:e?`primary`:`default`,disabled:i||r,onClick:a,children:(0,n.jsx)(l.default,{fontSize:`small`,sx:r?{animation:`${me} 1s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:`none`}}:void 0})})})})},Q=(0,r.createContext)(null),ge=({children:e,autoHideDuration:i=5e3})=>{let[a,o]=(0,r.useState)([]),s=(0,r.useRef)(0),c=(0,r.useCallback)(e=>{o(t=>[...t,{...e,id:s.current++}])},[]),l=(0,r.useMemo)(()=>({showToast:c}),[c]);return(0,n.jsxs)(Q.Provider,{value:l,children:[e,a.length>0&&(0,n.jsx)(t.Stack,{spacing:1,sx:{position:`fixed`,right:{xs:16,sm:20},bottom:{xs:16,sm:20},zIndex:e=>e.zIndex.snackbar,width:{xs:`calc(100vw - 32px)`,sm:380},maxWidth:`calc(100vw - 32px)`,pointerEvents:`none`},children:a.map(({id:e,...t})=>(0,n.jsx)(Y,{...t,autoHideDuration:i,onExited:()=>o(t=>t.filter(t=>t.id!==e))},e))})]})},$=()=>{let e=(0,r.useContext)(Q);if(!e)throw Error(`useToast must be used within a ToastProvider`);return e},_e=()=>{let{showToast:t}=$();return(0,r.useCallback)((n,r)=>t({...e.s(n,r),type:`error`}),[t])};exports.ApiKeyCard=m,exports.ApiKeyForm=_,exports.AppHeader=b,exports.ApprovalActions=g,exports.AuthEditor=O,exports.BackLink=k,exports.CardDetailRow=p,exports.CopyButton=j,exports.ErrorPage=M,exports.IdpCard=N,exports.IdpForm=L,exports.LoadingState=ee,exports.LoginForm=B,exports.MessageDetail=te,exports.NetworkCard=ne,exports.NetworkForm=q,exports.Pagination=re,exports.SigningProviderSelect=J,exports.StatusDot=v,exports.Toast=Y,exports.ToastProvider=ge,exports.TransactionCard=ie,exports.TransactionDetail=ae,exports.WalletCard=de,exports.WalletCreateForm=fe,exports.WalletEditForm=pe,exports.WalletForm=Z,exports.WalletsSync=he,exports.defaultNavItems=y,exports.useErrorToast=_e,exports.useToast=$;
|
|
10
|
+
`,x=({text:e=`Loading`})=>(0,i.jsxs)(r.Stack,{role:`status`,"aria-live":`polite`,spacing:2,sx:{minHeight:180,justifyContent:`center`,alignItems:`center`,p:3},children:[(0,i.jsx)(r.Stack,{direction:`row`,spacing:1,"aria-hidden":`true`,children:[0,1,2].map(e=>(0,i.jsx)(r.Box,{sx:{width:8,height:8,borderRadius:`50%`,bgcolor:`primary.main`,animation:`${b} 1s infinite ease-in-out`,animationDelay:`${e*.15}s`,"@media (prefers-reduced-motion: reduce)":{animation:`none`}}},e))}),(0,i.jsx)(r.Typography,{variant:`body1`,color:`text.secondary`,children:e})]}),S=(0,n.createComponent)({tagName:`wg-login-form`,elementClass:e.f,react:t.default,events:{onLoginConnect:`login-connect`,onLoginBack:`login-back`}}),C=(0,n.createComponent)({tagName:`wg-message-detail`,elementClass:e.i,react:t.default,events:{onMessageApprove:`message-approve`,onMessageDelete:`message-delete`}}),w=(0,n.createComponent)({tagName:`network-card`,elementClass:e.Z,react:t.default,events:{onNetworkReview:`network-review`,onDelete:`delete`,onUpdate:`update`}}),T=(0,n.createComponent)({tagName:`network-form`,elementClass:e.A,react:t.default,events:{onNetworkEditCancel:`network-edit-cancel`,onNetworkEditSave:`network-edit-save`,onNetworkDelete:`network-delete`}}),E=(0,n.createComponent)({tagName:`not-found`,elementClass:e.E,react:t.default}),D=(0,n.createComponent)({tagName:`wg-page-header`,elementClass:e.lt,react:t.default}),O=(0,n.createComponent)({tagName:`wg-pagination`,elementClass:e.ct,react:t.default,events:{onPageChange:`page-change`}}),k=({signingProviders:e,value:t,onChange:n,disabled:a=!1,disabledProviders:o=[]})=>{let s=e===void 0,c=e?.length===0;return(0,i.jsxs)(r.TextField,{id:`signing-provider-id`,select:!0,label:`Signing Provider`,required:!0,fullWidth:!0,value:t,disabled:a||s||c,onChange:e=>n(e.target.value),slotProps:{select:{native:!0},inputLabel:{shrink:!0}},children:[(0,i.jsx)(`option`,{value:``,disabled:!0,children:s?`Loading signing providers...`:c?`No signing providers available`:`Select signing provider`}),e?.map(e=>(0,i.jsx)(`option`,{value:e,disabled:o.includes(e),children:e},e))]})},A=({title:e,message:n,type:a=`error`,buttonText:o=`Dismiss notification`,autoHideDuration:s,onExited:c})=>{let[l,u]=(0,t.useState)(!0);return(0,i.jsx)(r.Snackbar,{open:l,autoHideDuration:s,onClose:(e,t)=>{t!==`clickaway`&&u(!1)},slotProps:{transition:{onExited:()=>c?.()}},sx:{position:`static`,pointerEvents:`auto`},children:(0,i.jsxs)(r.Alert,{role:a===`error`?`alert`:`status`,severity:a,closeText:o,onClose:()=>u(!1),sx:{width:`100%`},children:[(0,i.jsx)(r.AlertTitle,{children:e}),n]})})},j=(0,n.createComponent)({tagName:`wg-transaction-card`,elementClass:e.l,react:t.default,events:{onTransactionReview:`transaction-review`}}),M=(0,n.createComponent)({tagName:`wg-transaction-detail`,elementClass:e.s,react:t.default,events:{onTransactionApprove:`transaction-approve`,onTransactionDelete:`transaction-delete`}}),N=(0,n.createComponent)({tagName:`wg-wallet-card`,elementClass:e.C,react:t.default,events:{onWalletSetPrimary:`wallet-set-primary`,onWalletEdit:`wallet-edit`,onWalletAllocate:`wallet-allocate`,onWalletSelect:`wallet-select`}}),P=(0,n.createComponent)({tagName:`wg-wallet-create-form`,elementClass:e.g,react:t.default,events:{onWalletCreate:`wallet-create`,onSigningProviderChange:`signing-provider-change`}}),F=(0,n.createComponent)({tagName:`wg-wallet-edit-form`,elementClass:e.m,react:t.default,events:{onWalletEdit:`wallet-edit`,onSigningProviderChange:`signing-provider-change`}}),I=({children:e,onSubmit:t,submitLabel:n,submittingLabel:a,submittingMessage:o,submitting:s=!1,loading:c=!1,submitDisabled:l=!1})=>{let u=s||c||l;return(0,i.jsxs)(r.Box,{component:`form`,onSubmit:e=>{e.preventDefault(),u||t()},sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,i.jsx)(r.Stack,{spacing:2,children:e}),(0,i.jsxs)(r.Stack,{spacing:1,sx:{mt:`auto`,pt:3},children:[(0,i.jsx)(r.Button,{type:`submit`,variant:`contained`,fullWidth:!0,disabled:u,startIcon:s?(0,i.jsx)(r.CircularProgress,{size:16,color:`inherit`,"aria-hidden":`true`}):void 0,children:s?a:n}),s&&(0,i.jsx)(r.Typography,{variant:`body2`,color:`text.secondary`,role:`status`,"aria-live":`polite`,children:o})]})]})},L=(0,n.createComponent)({tagName:`wg-wallet-list`,elementClass:e.v,react:t.default,events:{onWalletAllocate:`wallet-allocate`,onWalletEdit:`wallet-edit`,onWalletSetPrimary:`wallet-set-primary`}}),R=(0,n.createComponent)({tagName:`wg-wallets-sync`,elementClass:e.T,react:t.default,events:{onWalletsSync:`wallets-sync`}}),z=(0,t.createContext)(null),B=({children:e,autoHideDuration:n=5e3})=>{let[a,o]=(0,t.useState)([]),s=(0,t.useRef)(0),c=(0,t.useCallback)(e=>{o(t=>[...t,{...e,id:s.current++}])},[]),l=(0,t.useMemo)(()=>({showToast:c}),[c]);return(0,i.jsxs)(z.Provider,{value:l,children:[e,a.length>0&&(0,i.jsx)(r.Stack,{spacing:1,sx:{position:`fixed`,right:{xs:16,sm:20},bottom:{xs:16,sm:20},zIndex:e=>e.zIndex.snackbar,width:{xs:`calc(100vw - 32px)`,sm:380},maxWidth:`calc(100vw - 32px)`,pointerEvents:`none`},children:a.map(({id:e,...t})=>(0,i.jsx)(A,{...t,autoHideDuration:n,onExited:()=>o(t=>t.filter(t=>t.id!==e))},e))})]})},V=()=>{let e=(0,t.useContext)(z);if(!e)throw Error(`useToast must be used within a ToastProvider`);return e},H=()=>{let{showToast:n}=V();return(0,t.useCallback)((t,r)=>n({...e.t(t,r),type:`error`}),[n])};exports.ApiKeyCard=c,exports.ApiKeyForm=d,exports.AppHeader=f,exports.ApprovalActions=u,exports.BackLink=p,exports.CardDetailRow=m,exports.CopyButton=g,exports.ErrorPage=_,exports.IdpCard=v,exports.IdpForm=y,exports.LoadingState=x,exports.LoginForm=S,exports.MessageDetail=C,exports.NetworkCard=w,exports.NetworkForm=T,exports.NotFound=E,exports.PageHeader=D,exports.Pagination=O,exports.SigningProviderSelect=k,exports.Toast=A,exports.ToastProvider=B,exports.TransactionCard=j,exports.TransactionDetail=M,exports.WalletCard=N,exports.WalletCreateForm=P,exports.WalletEditForm=F,exports.WalletForm=I,exports.WalletList=L,exports.WalletsSync=R,exports.useErrorToast=H,exports.useToast=V;
|
|
19
11
|
//# sourceMappingURL=index.cjs.map
|