@canton-network/core-wallet-ui-components 0.5.0 → 0.6.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/dist/components/AppHeader.d.ts +12 -3
- package/dist/components/AppHeader.d.ts.map +1 -1
- package/dist/components/AppLayout.d.ts +3 -3
- package/dist/components/AppLayout.d.ts.map +1 -1
- package/dist/components/Discovery.d.ts +7 -1
- package/dist/components/Discovery.d.ts.map +1 -1
- package/dist/components/NetworkForm.d.ts +3 -3
- package/dist/components/NetworkForm.d.ts.map +1 -1
- package/dist/components/NetworkTable.d.ts +3 -3
- package/dist/components/NetworkTable.d.ts.map +1 -1
- package/dist/index.css +5 -0
- package/dist/index.d.ts +2 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1357 -83
- package/dist/internal/BaseElement.d.ts +10 -0
- package/dist/internal/BaseElement.d.ts.map +1 -0
- package/dist/styles/index.d.ts +4 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/windows/popup.d.ts +5 -1
- package/dist/windows/popup.d.ts.map +1 -1
- package/package.json +12 -9
- package/themes/default.css +6 -0
- package/dist/components/AppHeader.js +0 -73
- package/dist/components/AppLayout.js +0 -87
- package/dist/components/Configuration.d.ts +0 -5
- package/dist/components/Configuration.d.ts.map +0 -1
- package/dist/components/Configuration.js +0 -24
- package/dist/components/Discovery.js +0 -148
- package/dist/components/NetworkForm.js +0 -164
- package/dist/components/NetworkTable.js +0 -67
- package/dist/scripts/copy-css.d.ts +0 -2
- package/dist/scripts/copy-css.d.ts.map +0 -1
- package/dist/scripts/copy-css.js +0 -4
- package/dist/themes/default.css +0 -46
- package/dist/themes/styles.d.ts +0 -2
- package/dist/themes/styles.d.ts.map +0 -1
- package/dist/themes/styles.js +0 -75
- package/dist/windows/discovery.js +0 -32
- package/dist/windows/popup.js +0 -64
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
-
};
|
|
9
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
|
-
};
|
|
12
|
-
import { LitElement, html } from 'lit';
|
|
13
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
14
|
-
import { styles } from '../themes/styles.js';
|
|
15
|
-
let NetworkTable = class NetworkTable extends LitElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.networks = [];
|
|
19
|
-
}
|
|
20
|
-
static { this.styles = [styles]; }
|
|
21
|
-
render() {
|
|
22
|
-
console.log('rendering with networks ' + JSON.stringify(this.networks));
|
|
23
|
-
return html `
|
|
24
|
-
<table>
|
|
25
|
-
<thead>
|
|
26
|
-
<tr>
|
|
27
|
-
<th>Name</th>
|
|
28
|
-
<th>ID</th>
|
|
29
|
-
<th>Description</th>
|
|
30
|
-
<th>Auth type</th>
|
|
31
|
-
<th>Synchronizer ID</th>
|
|
32
|
-
<th>Actions</th>
|
|
33
|
-
</tr>
|
|
34
|
-
</thead>
|
|
35
|
-
<tbody>
|
|
36
|
-
${this.networks.map((net) => html `
|
|
37
|
-
<tr>
|
|
38
|
-
<td>${net.name}</td>
|
|
39
|
-
<td>${net.chainId}</td>
|
|
40
|
-
<td>${net.description}</td>
|
|
41
|
-
<td>${net.auth.type}</td>
|
|
42
|
-
<td>${net.synchronizerId}</td>
|
|
43
|
-
<td class="actions">
|
|
44
|
-
<button>Update</button>
|
|
45
|
-
<button
|
|
46
|
-
@click=${() => this.dispatchEvent(new CustomEvent('delete', {
|
|
47
|
-
detail: net,
|
|
48
|
-
}))}
|
|
49
|
-
>
|
|
50
|
-
Delete
|
|
51
|
-
</button>
|
|
52
|
-
</td>
|
|
53
|
-
</tr>
|
|
54
|
-
`)}
|
|
55
|
-
</tbody>
|
|
56
|
-
</table>
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
__decorate([
|
|
61
|
-
property({ type: Array }),
|
|
62
|
-
__metadata("design:type", Array)
|
|
63
|
-
], NetworkTable.prototype, "networks", void 0);
|
|
64
|
-
NetworkTable = __decorate([
|
|
65
|
-
customElement('network-table')
|
|
66
|
-
], NetworkTable);
|
|
67
|
-
export { NetworkTable };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy-css.d.ts","sourceRoot":"","sources":["../../src/scripts/copy-css.ts"],"names":[],"mappings":""}
|
package/dist/scripts/copy-css.js
DELETED
package/dist/themes/default.css
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
:root,
|
|
2
|
-
:host {
|
|
3
|
-
--splice-wk-background-color: snow;
|
|
4
|
-
--splice-wk-text-color: rgba(0, 0, 0, 0.65);
|
|
5
|
-
--splice-wk-font-family: sans-serif;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.hidden {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|
|
11
|
-
.header {
|
|
12
|
-
background-color: #f8f9fa;
|
|
13
|
-
padding: 10px;
|
|
14
|
-
border-bottom: 1px solid #dee2e6;
|
|
15
|
-
}
|
|
16
|
-
.header h2 {
|
|
17
|
-
margin: 0;
|
|
18
|
-
font-size: 1.25rem;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
}
|
|
22
|
-
.header img {
|
|
23
|
-
margin-right: 10px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.header .logo-box {
|
|
27
|
-
display: inline-block;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.container {
|
|
32
|
-
padding: 20px;
|
|
33
|
-
}
|
|
34
|
-
.btn-primary,
|
|
35
|
-
.btn-success {
|
|
36
|
-
background-color: #007bff;
|
|
37
|
-
border-color: #007bff;
|
|
38
|
-
}
|
|
39
|
-
.btn-outline-secondary {
|
|
40
|
-
border-color: #6c757d;
|
|
41
|
-
color: #6c757d;
|
|
42
|
-
}
|
|
43
|
-
.btn-outline-secondary:hover {
|
|
44
|
-
background-color: #6c757d;
|
|
45
|
-
color: #fff;
|
|
46
|
-
}
|
package/dist/themes/styles.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/themes/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,yBAuElB,CAAA"}
|
package/dist/themes/styles.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { css } from 'lit';
|
|
4
|
-
export const styles = css `
|
|
5
|
-
.table-wrapper {
|
|
6
|
-
max-height: 300px;
|
|
7
|
-
overflow-y: auto;
|
|
8
|
-
border: 1px solid var(--splice-wk-border-color, #ccc);
|
|
9
|
-
border-radius: 4px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
table {
|
|
13
|
-
width: 100%;
|
|
14
|
-
border-collapse: collapse;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
thead th {
|
|
18
|
-
position: sticky;
|
|
19
|
-
top: 0;
|
|
20
|
-
z-index: 1;
|
|
21
|
-
text-align: left;
|
|
22
|
-
padding: 8px 12px;
|
|
23
|
-
border-bottom: 1px solid var(--splice-wk-border-color, #ccc);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
tbody td {
|
|
27
|
-
padding: 8px 12px;
|
|
28
|
-
border-bottom: 1px solid var(--splice-wk-border-color, #ccc);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
tr:nth-child(even) {
|
|
32
|
-
background-color: var(--splice-wk-background-color, none);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.actions button {
|
|
36
|
-
margin-right: 4px;
|
|
37
|
-
font-size: 0.8rem;
|
|
38
|
-
padding: 4px 8px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.modal {
|
|
42
|
-
position: fixed;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.modal-content {
|
|
49
|
-
background: var(--splice-wk-background-color, none);
|
|
50
|
-
padding: 1.5rem;
|
|
51
|
-
border-radius: 8px;
|
|
52
|
-
width: 400px;
|
|
53
|
-
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.form {
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
gap: 10px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
input,
|
|
63
|
-
select {
|
|
64
|
-
padding: 6px;
|
|
65
|
-
font-size: 1rem;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.buttons {
|
|
69
|
-
display: flex;
|
|
70
|
-
justify-content: flex-end;
|
|
71
|
-
margin-top: 1rem;
|
|
72
|
-
gap: 0.5rem;
|
|
73
|
-
margin-bottom: 1.5rem;
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { Discovery } from '../components/Discovery.js';
|
|
4
|
-
import { popup } from './popup.js';
|
|
5
|
-
export async function discover() {
|
|
6
|
-
const win = await popup(Discovery, {
|
|
7
|
-
title: 'Wallet Discovery',
|
|
8
|
-
target: 'wallet-discovery',
|
|
9
|
-
});
|
|
10
|
-
return new Promise((resolve, reject) => {
|
|
11
|
-
let response = undefined;
|
|
12
|
-
win.addEventListener('beforeunload', () => {
|
|
13
|
-
if (response === undefined) {
|
|
14
|
-
console.log('Wallet discovery window closed by user');
|
|
15
|
-
reject('User closed the wallet discovery window');
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
const handler = (event) => {
|
|
19
|
-
if (event.origin === window.location.origin &&
|
|
20
|
-
typeof event.data.walletType === 'string') {
|
|
21
|
-
response = event.data;
|
|
22
|
-
resolve({
|
|
23
|
-
url: event.data.url,
|
|
24
|
-
walletType: event.data.walletType,
|
|
25
|
-
});
|
|
26
|
-
window.removeEventListener('message', handler);
|
|
27
|
-
win.close();
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
window.addEventListener('message', handler);
|
|
31
|
-
});
|
|
32
|
-
}
|
package/dist/windows/popup.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import styles from '../themes/default.css?inline';
|
|
4
|
-
export function popup(component, options) {
|
|
5
|
-
const { title = 'Custom Popup', target = 'wallet-popup', width = 400, height = 500, screenX = 200, screenY = 200, } = options || {};
|
|
6
|
-
const html = `<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<title>${title}</title>
|
|
10
|
-
<style>
|
|
11
|
-
html, body {
|
|
12
|
-
margin: 0;
|
|
13
|
-
padding: 0;
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
body {
|
|
19
|
-
display: flex;
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
22
|
-
<style>${styles}</style>
|
|
23
|
-
</head>
|
|
24
|
-
<body>
|
|
25
|
-
</body>
|
|
26
|
-
|
|
27
|
-
<script>
|
|
28
|
-
customElements.define('popup-content', ${component})
|
|
29
|
-
|
|
30
|
-
const root = document.getElementsByTagName('body')[0]
|
|
31
|
-
|
|
32
|
-
const content = document.createElement('popup-content')
|
|
33
|
-
content.setAttribute('style', 'width: 100%; height: 100%;')
|
|
34
|
-
|
|
35
|
-
root.appendChild(content)
|
|
36
|
-
</script>
|
|
37
|
-
</html>`;
|
|
38
|
-
const url = URL.createObjectURL(new Blob([html], { type: 'text/html' }));
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
const win = window.open(url, target, `width=${width},height=${height},screenX=${screenX},screenY=${screenY}`);
|
|
41
|
-
if (win) {
|
|
42
|
-
win.addEventListener('beforeunload', () => {
|
|
43
|
-
URL.revokeObjectURL(url); // clean up the URL object to prevent memory leaks
|
|
44
|
-
});
|
|
45
|
-
resolve(win);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
reject(new Error('Failed to open popup window.'));
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
export function popupHref(url, options) {
|
|
53
|
-
const { target = 'wallet-popup', width = 400, height = 500, screenX = 200, screenY = 200, } = options || {};
|
|
54
|
-
return new Promise((resolve, reject) => {
|
|
55
|
-
const win = window.open(url, target, `width=${width},height=${height},screenX=${screenX},screenY=${screenY}`);
|
|
56
|
-
if (win) {
|
|
57
|
-
win.focus();
|
|
58
|
-
resolve(win);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
reject(new Error('Failed to open popup window.'));
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|