@le-space/ui 0.3.5 → 0.3.7
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 +3 -3
- package/react/index.js +68 -4
- package/shared/index.js +17 -2
- package/svelte/SponsorRelayFab.svelte +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Floating Aleph sponsor relay UI components for Svelte and React.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@le-space/browser": "0.3.
|
|
40
|
-
"@le-space/core": "0.3.
|
|
39
|
+
"@le-space/browser": "0.3.7",
|
|
40
|
+
"@le-space/core": "0.3.7",
|
|
41
41
|
"viem": "^2.38.5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
package/react/index.js
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
// src/react/SponsorRelayFab.tsx
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
+
// package.json
|
|
5
|
+
var package_default = {
|
|
6
|
+
name: "@le-space/ui",
|
|
7
|
+
version: "0.3.7",
|
|
8
|
+
description: "Floating Aleph sponsor relay UI components for Svelte and React.",
|
|
9
|
+
license: "MIT",
|
|
10
|
+
type: "module",
|
|
11
|
+
main: "./src/shared/index.ts",
|
|
12
|
+
types: "./src/shared/index.ts",
|
|
13
|
+
dependencies: {
|
|
14
|
+
"@le-space/browser": "workspace:*",
|
|
15
|
+
"@le-space/core": "workspace:*",
|
|
16
|
+
viem: "^2.38.5"
|
|
17
|
+
},
|
|
18
|
+
peerDependencies: {
|
|
19
|
+
react: ">=18",
|
|
20
|
+
"react-dom": ">=18",
|
|
21
|
+
svelte: ">=4"
|
|
22
|
+
},
|
|
23
|
+
devDependencies: {
|
|
24
|
+
"@types/react": "^18.3.27",
|
|
25
|
+
"@types/react-dom": "^18.3.7"
|
|
26
|
+
},
|
|
27
|
+
scripts: {
|
|
28
|
+
build: 'echo "ui build placeholder"',
|
|
29
|
+
"build:publish": "tsup src/shared/index.ts --format esm --dts --clean --tsconfig tsconfig.publish.json --out-dir dist/shared && tsup src/react/index.ts --format esm --dts --tsconfig tsconfig.publish.json --out-dir dist/react",
|
|
30
|
+
test: "pnpm run build:publish && node --test ./test/**/*.test.mjs",
|
|
31
|
+
lint: 'echo "ui lint placeholder"'
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
4
35
|
// src/shared/constants.ts
|
|
5
36
|
var DEFAULT_INSTANCE_NAME = "sponsor-relay";
|
|
6
37
|
var DEFAULT_MANIFEST_URL = "./rootfs-manifest.json";
|
|
@@ -2619,6 +2650,11 @@ function createDeploymentProgressEmitter() {
|
|
|
2619
2650
|
}
|
|
2620
2651
|
|
|
2621
2652
|
// src/shared/controller.ts
|
|
2653
|
+
function isConfirmedRelaySetupResult(value) {
|
|
2654
|
+
return Boolean(
|
|
2655
|
+
value && typeof value === "object" && "status" in value && value.status === "configured"
|
|
2656
|
+
);
|
|
2657
|
+
}
|
|
2622
2658
|
function defaultState(props = {}) {
|
|
2623
2659
|
return {
|
|
2624
2660
|
ready: false,
|
|
@@ -3091,7 +3127,7 @@ var SponsorRelayController = class {
|
|
|
3091
3127
|
if (!tcpPort || !wsPort) {
|
|
3092
3128
|
throw new Error("OrbitDB relay runtime is missing required mapped TCP/WS ports.");
|
|
3093
3129
|
}
|
|
3094
|
-
await configureOrbitdbRelaySetup2({
|
|
3130
|
+
const configureResult = await configureOrbitdbRelaySetup2({
|
|
3095
3131
|
hostIpv4: args.runtime.hostIpv4,
|
|
3096
3132
|
publicIpv6: args.runtime.ipv6,
|
|
3097
3133
|
setupPort,
|
|
@@ -3105,8 +3141,13 @@ var SponsorRelayController = class {
|
|
|
3105
3141
|
fetch: (url, init) => fetch(url, init),
|
|
3106
3142
|
timeoutMs: 18e4
|
|
3107
3143
|
});
|
|
3144
|
+
if (!isConfirmedRelaySetupResult(configureResult)) {
|
|
3145
|
+
throw new Error(
|
|
3146
|
+
`Relay guest configuration could not be confirmed at http://${args.runtime.hostIpv4}:${setupPort}/configure.`
|
|
3147
|
+
);
|
|
3148
|
+
}
|
|
3108
3149
|
} else {
|
|
3109
|
-
await configureUcGoPeer({
|
|
3150
|
+
const configureResult = await configureUcGoPeer({
|
|
3110
3151
|
hostIpv4: args.runtime.hostIpv4,
|
|
3111
3152
|
publicIpv6: args.runtime.ipv6,
|
|
3112
3153
|
setupPort,
|
|
@@ -3119,6 +3160,11 @@ var SponsorRelayController = class {
|
|
|
3119
3160
|
fetch: (url, init) => fetch(url, init),
|
|
3120
3161
|
timeoutMs: 18e4
|
|
3121
3162
|
});
|
|
3163
|
+
if (!isConfirmedRelaySetupResult(configureResult)) {
|
|
3164
|
+
throw new Error(
|
|
3165
|
+
`Relay guest configuration could not be confirmed at http://${args.runtime.hostIpv4}:${setupPort}/configure.`
|
|
3166
|
+
);
|
|
3167
|
+
}
|
|
3122
3168
|
}
|
|
3123
3169
|
this.emitProgress({
|
|
3124
3170
|
stage: "publishing-bootstrap",
|
|
@@ -4088,6 +4134,7 @@ function launcherIndicator(state) {
|
|
|
4088
4134
|
}
|
|
4089
4135
|
function SponsorRelayFab(props) {
|
|
4090
4136
|
const { controller, state } = useSponsorRelayController(props);
|
|
4137
|
+
const versionLabel = `v${package_default.version}`;
|
|
4091
4138
|
const launcherMode = props.launcherMode ?? "floating";
|
|
4092
4139
|
const indicator = launcherIndicator(state);
|
|
4093
4140
|
const [successFlash, setSuccessFlash] = React.useState(false);
|
|
@@ -4318,16 +4365,33 @@ function SponsorRelayFab(props) {
|
|
|
4318
4365
|
},
|
|
4319
4366
|
children: [
|
|
4320
4367
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
4321
|
-
/* @__PURE__ */
|
|
4368
|
+
/* @__PURE__ */ jsxs(
|
|
4322
4369
|
"div",
|
|
4323
4370
|
{
|
|
4324
4371
|
style: {
|
|
4372
|
+
display: "flex",
|
|
4373
|
+
alignItems: "center",
|
|
4374
|
+
gap: "0.45rem",
|
|
4325
4375
|
color: "#9fb2ca",
|
|
4326
4376
|
fontSize: "0.72rem",
|
|
4327
4377
|
textTransform: "uppercase",
|
|
4328
4378
|
letterSpacing: "0.08em"
|
|
4329
4379
|
},
|
|
4330
|
-
children:
|
|
4380
|
+
children: [
|
|
4381
|
+
/* @__PURE__ */ jsx("span", { children: "Aleph VM credit deployer" }),
|
|
4382
|
+
/* @__PURE__ */ jsx(
|
|
4383
|
+
"span",
|
|
4384
|
+
{
|
|
4385
|
+
style: {
|
|
4386
|
+
fontSize: "0.62rem",
|
|
4387
|
+
letterSpacing: "0.04em",
|
|
4388
|
+
textTransform: "none",
|
|
4389
|
+
color: "rgba(191, 219, 254, 0.82)"
|
|
4390
|
+
},
|
|
4391
|
+
children: versionLabel
|
|
4392
|
+
}
|
|
4393
|
+
)
|
|
4394
|
+
]
|
|
4331
4395
|
}
|
|
4332
4396
|
),
|
|
4333
4397
|
/* @__PURE__ */ jsx(
|
package/shared/index.js
CHANGED
|
@@ -2618,6 +2618,11 @@ function createDeploymentProgressEmitter() {
|
|
|
2618
2618
|
}
|
|
2619
2619
|
|
|
2620
2620
|
// src/shared/controller.ts
|
|
2621
|
+
function isConfirmedRelaySetupResult(value) {
|
|
2622
|
+
return Boolean(
|
|
2623
|
+
value && typeof value === "object" && "status" in value && value.status === "configured"
|
|
2624
|
+
);
|
|
2625
|
+
}
|
|
2621
2626
|
function defaultState(props = {}) {
|
|
2622
2627
|
return {
|
|
2623
2628
|
ready: false,
|
|
@@ -3090,7 +3095,7 @@ var SponsorRelayController = class {
|
|
|
3090
3095
|
if (!tcpPort || !wsPort) {
|
|
3091
3096
|
throw new Error("OrbitDB relay runtime is missing required mapped TCP/WS ports.");
|
|
3092
3097
|
}
|
|
3093
|
-
await configureOrbitdbRelaySetup2({
|
|
3098
|
+
const configureResult = await configureOrbitdbRelaySetup2({
|
|
3094
3099
|
hostIpv4: args.runtime.hostIpv4,
|
|
3095
3100
|
publicIpv6: args.runtime.ipv6,
|
|
3096
3101
|
setupPort,
|
|
@@ -3104,8 +3109,13 @@ var SponsorRelayController = class {
|
|
|
3104
3109
|
fetch: (url, init) => fetch(url, init),
|
|
3105
3110
|
timeoutMs: 18e4
|
|
3106
3111
|
});
|
|
3112
|
+
if (!isConfirmedRelaySetupResult(configureResult)) {
|
|
3113
|
+
throw new Error(
|
|
3114
|
+
`Relay guest configuration could not be confirmed at http://${args.runtime.hostIpv4}:${setupPort}/configure.`
|
|
3115
|
+
);
|
|
3116
|
+
}
|
|
3107
3117
|
} else {
|
|
3108
|
-
await configureUcGoPeer({
|
|
3118
|
+
const configureResult = await configureUcGoPeer({
|
|
3109
3119
|
hostIpv4: args.runtime.hostIpv4,
|
|
3110
3120
|
publicIpv6: args.runtime.ipv6,
|
|
3111
3121
|
setupPort,
|
|
@@ -3118,6 +3128,11 @@ var SponsorRelayController = class {
|
|
|
3118
3128
|
fetch: (url, init) => fetch(url, init),
|
|
3119
3129
|
timeoutMs: 18e4
|
|
3120
3130
|
});
|
|
3131
|
+
if (!isConfirmedRelaySetupResult(configureResult)) {
|
|
3132
|
+
throw new Error(
|
|
3133
|
+
`Relay guest configuration could not be confirmed at http://${args.runtime.hostIpv4}:${setupPort}/configure.`
|
|
3134
|
+
);
|
|
3135
|
+
}
|
|
3121
3136
|
}
|
|
3122
3137
|
this.emitProgress({
|
|
3123
3138
|
stage: "publishing-bootstrap",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { onDestroy, onMount } from 'svelte'
|
|
3
|
+
import packageJson from '../../package.json'
|
|
3
4
|
|
|
4
5
|
import { createSponsorRelayController, formatDateTime, formatNumber, formatTierSpecLabel, joinMappedPorts, joinRequiredPortForwards, shortHash } from '../shared/index'
|
|
5
6
|
import AccordionSection from './components/AccordionSection.svelte'
|
|
@@ -37,6 +38,7 @@ export let apiHost = undefined
|
|
|
37
38
|
})
|
|
38
39
|
|
|
39
40
|
let state = controller.getState()
|
|
41
|
+
const versionLabel = `v${packageJson.version}`
|
|
40
42
|
|
|
41
43
|
onMount(async () => {
|
|
42
44
|
const unsubscribe = controller.subscribe((next) => {
|
|
@@ -62,7 +64,7 @@ export let apiHost = undefined
|
|
|
62
64
|
<aside class="panel">
|
|
63
65
|
<div class="panel-head">
|
|
64
66
|
<div>
|
|
65
|
-
<p class="eyebrow">Aleph VM credit deployer</p>
|
|
67
|
+
<p class="eyebrow">Aleph VM credit deployer <span class="eyebrow-version">{versionLabel}</span></p>
|
|
66
68
|
<h2>Sponsor Relay</h2>
|
|
67
69
|
</div>
|
|
68
70
|
<button class="refresh" type="button" on:click={() => controller.refresh()} disabled={state.busy.refreshing}>
|
|
@@ -322,6 +324,13 @@ export let apiHost = undefined
|
|
|
322
324
|
letter-spacing: 0.08em;
|
|
323
325
|
}
|
|
324
326
|
|
|
327
|
+
.eyebrow-version {
|
|
328
|
+
font-size: 0.62rem;
|
|
329
|
+
letter-spacing: 0.04em;
|
|
330
|
+
text-transform: none;
|
|
331
|
+
color: rgba(191, 219, 254, 0.82);
|
|
332
|
+
}
|
|
333
|
+
|
|
325
334
|
h2,
|
|
326
335
|
h3,
|
|
327
336
|
strong {
|