@le-space/ui 0.1.53 → 0.1.55
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/package.json +15 -4
- package/react/index.d.ts +17 -0
- package/react/index.js +849 -110
- package/shared/index.d.ts +27 -1
- package/shared/index.js +264 -7
package/package.json
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"description": "Floating Aleph sponsor relay UI components for Svelte and React.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"shared",
|
|
9
|
+
"react",
|
|
10
|
+
"svelte",
|
|
11
|
+
"styles.css",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
7
14
|
"main": "./shared/index.js",
|
|
8
15
|
"types": "./shared/index.d.ts",
|
|
9
16
|
"exports": {
|
|
10
17
|
".": {
|
|
11
18
|
"types": "./shared/index.d.ts",
|
|
12
|
-
"import": "./shared/index.js"
|
|
19
|
+
"import": "./shared/index.js",
|
|
20
|
+
"default": "./shared/index.js"
|
|
13
21
|
},
|
|
14
22
|
"./shared": {
|
|
15
23
|
"types": "./shared/index.d.ts",
|
|
16
|
-
"import": "./shared/index.js"
|
|
24
|
+
"import": "./shared/index.js",
|
|
25
|
+
"default": "./shared/index.js"
|
|
17
26
|
},
|
|
18
27
|
"./react": {
|
|
19
28
|
"types": "./react/index.d.ts",
|
|
20
|
-
"import": "./react/index.js"
|
|
29
|
+
"import": "./react/index.js",
|
|
30
|
+
"default": "./react/index.js"
|
|
21
31
|
},
|
|
22
32
|
"./svelte": "./svelte/index.js",
|
|
23
33
|
"./styles.css": "./styles.css"
|
|
@@ -26,6 +36,7 @@
|
|
|
26
36
|
"access": "public"
|
|
27
37
|
},
|
|
28
38
|
"dependencies": {
|
|
39
|
+
"@noble/hashes": "^1.8.0",
|
|
29
40
|
"@le-space/browser": "0.1.52",
|
|
30
41
|
"@le-space/core": "0.1.52"
|
|
31
42
|
},
|
package/react/index.d.ts
CHANGED
|
@@ -174,6 +174,19 @@ interface RootfsResolution {
|
|
|
174
174
|
gatewayError?: string | null;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
type DeploymentProgressStage = 'idle' | 'validating' | 'loading-manifest' | 'verifying-rootfs' | 'loading-pricing' | 'loading-balance' | 'selecting-crn' | 'building-message' | 'signing-message' | 'broadcasting' | 'waiting-for-aleph' | 'deployment-confirmed' | 'deployment-rejected' | 'building-delete-message' | 'signing-delete-message' | 'broadcasting-delete' | 'delete-completed' | 'refreshing-instances' | 'completed' | 'error';
|
|
178
|
+
interface DeploymentProgressEvent {
|
|
179
|
+
stage: DeploymentProgressStage;
|
|
180
|
+
label: string;
|
|
181
|
+
progress: number;
|
|
182
|
+
status: 'info' | 'success' | 'warning' | 'error';
|
|
183
|
+
itemHash?: string | null;
|
|
184
|
+
detail?: string | null;
|
|
185
|
+
error?: string | null;
|
|
186
|
+
timestamp: number;
|
|
187
|
+
}
|
|
188
|
+
type DeploymentProgressListener = (event: DeploymentProgressEvent) => void;
|
|
189
|
+
|
|
177
190
|
type SponsorRelayHealthTone = 'ok' | 'caution' | 'error' | 'idle';
|
|
178
191
|
interface SponsorRelayProps {
|
|
179
192
|
libp2p?: unknown;
|
|
@@ -270,6 +283,7 @@ interface SponsorRelayState {
|
|
|
270
283
|
instances: CompactInstanceRecord[];
|
|
271
284
|
relayPing: RelayPingState;
|
|
272
285
|
lastDeploymentHash: string | null;
|
|
286
|
+
deploymentProgress: DeploymentProgressEvent;
|
|
273
287
|
}
|
|
274
288
|
type SponsorRelaySubscriber = (state: SponsorRelayState) => void;
|
|
275
289
|
|
|
@@ -281,11 +295,14 @@ declare class SponsorRelayController {
|
|
|
281
295
|
private pingTimer;
|
|
282
296
|
private stopWalletWatch;
|
|
283
297
|
private props;
|
|
298
|
+
private progressEmitter;
|
|
284
299
|
constructor(props?: SponsorRelayProps);
|
|
300
|
+
subscribeToDeploymentProgress(listener: DeploymentProgressListener): () => void;
|
|
285
301
|
subscribe(subscriber: SponsorRelaySubscriber): () => void;
|
|
286
302
|
getState(): SponsorRelayState;
|
|
287
303
|
private emit;
|
|
288
304
|
private patch;
|
|
305
|
+
private emitProgress;
|
|
289
306
|
init(): Promise<void>;
|
|
290
307
|
destroy(): void;
|
|
291
308
|
setOpen(open: boolean): void;
|