@le-space/ui 0.3.21 → 0.3.22
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 +72 -2
- package/shared/index.d.ts +1 -1
- package/shared/index.js +1 -1
- package/svelte/SponsorRelayFab.svelte +44 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.22",
|
|
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.22",
|
|
40
|
+
"@le-space/core": "0.3.22",
|
|
41
41
|
"viem": "^2.38.5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
package/react/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
|
|
|
39
39
|
var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
|
|
40
40
|
|
|
41
41
|
// src/shared/package-version.ts
|
|
42
|
-
var UI_PACKAGE_VERSION = "0.3.
|
|
42
|
+
var UI_PACKAGE_VERSION = "0.3.22";
|
|
43
43
|
|
|
44
44
|
// src/shared/format.ts
|
|
45
45
|
function shortHash(value, head = 8, tail = 6) {
|
|
@@ -4200,6 +4200,12 @@ function progressBadgeLabel(stage) {
|
|
|
4200
4200
|
}
|
|
4201
4201
|
}
|
|
4202
4202
|
var COMPLETED_PROGRESS_VISIBLE_MS = 12e3;
|
|
4203
|
+
var POLLING_STAGES = /* @__PURE__ */ new Set([
|
|
4204
|
+
"waiting-for-aleph",
|
|
4205
|
+
"deployment-confirmed",
|
|
4206
|
+
"publishing-bootstrap",
|
|
4207
|
+
"refreshing-instances"
|
|
4208
|
+
]);
|
|
4203
4209
|
function isDeploymentProgressVisible(state) {
|
|
4204
4210
|
const stage = state.deploymentProgress.stage;
|
|
4205
4211
|
if (stage === "idle") {
|
|
@@ -4213,6 +4219,21 @@ function isDeploymentProgressVisible(state) {
|
|
|
4213
4219
|
}
|
|
4214
4220
|
return true;
|
|
4215
4221
|
}
|
|
4222
|
+
function pollingIndicator(state) {
|
|
4223
|
+
if (state.busy.refreshing) {
|
|
4224
|
+
return {
|
|
4225
|
+
label: "Checking relay state",
|
|
4226
|
+
detail: state.statusText || "Refreshing relay sponsor data from Aleph and the selected CRN."
|
|
4227
|
+
};
|
|
4228
|
+
}
|
|
4229
|
+
if (!POLLING_STAGES.has(state.deploymentProgress.stage)) {
|
|
4230
|
+
return null;
|
|
4231
|
+
}
|
|
4232
|
+
return {
|
|
4233
|
+
label: state.deploymentProgress.label || "Polling relay state",
|
|
4234
|
+
detail: state.deploymentProgress.detail || state.statusText || "Waiting for the next confirmed relay state from Aleph."
|
|
4235
|
+
};
|
|
4236
|
+
}
|
|
4216
4237
|
function launcherIndicator(state) {
|
|
4217
4238
|
if (state.deploymentProgress.stage !== "idle" && state.deploymentProgress.stage !== "completed") {
|
|
4218
4239
|
return {
|
|
@@ -4354,6 +4375,7 @@ function SponsorRelayFab(props) {
|
|
|
4354
4375
|
}, [launcherMode]);
|
|
4355
4376
|
const progressActive = state.deploymentProgress.stage !== "idle" && state.deploymentProgress.stage !== "completed" && state.deploymentProgress.stage !== "error";
|
|
4356
4377
|
const deploymentProgressVisible = isDeploymentProgressVisible(state);
|
|
4378
|
+
const pollingState = pollingIndicator(state);
|
|
4357
4379
|
const pulseScale = progressActive ? 1.03 : hovered ? 1.015 : 1;
|
|
4358
4380
|
const pulseShadow = progressActive ? `0 0 0 4px ${progressToneColor(indicator.tone)}22, 0 12px 28px rgba(15, 23, 42, 0.22)` : successFlash ? `0 0 0 5px rgba(55, 214, 122, 0.22), 0 14px 32px rgba(55, 214, 122, 0.22)` : launcherMode === "inline" ? hovered ? "var(--le-space-sponsor-relay-launcher-hover-shadow, 0 14px 30px rgba(79, 70, 229, 0.28))" : "var(--le-space-sponsor-relay-launcher-shadow, 0 10px 24px rgba(99, 102, 241, 0.22))" : void 0;
|
|
4359
4381
|
const inlineButtonBackground = themedLauncherBackground;
|
|
@@ -4374,6 +4396,7 @@ function SponsorRelayFab(props) {
|
|
|
4374
4396
|
};
|
|
4375
4397
|
const launcherLabel = launcherMode === "inline" && compactInlineLabel ? "Relay" : "Sponsor Relay";
|
|
4376
4398
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4399
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes leSpaceRelayPulse { 0%, 100% { transform: scale(1); opacity: 0.74; } 50% { transform: scale(1.22); opacity: 1; } }` }),
|
|
4377
4400
|
/* @__PURE__ */ jsxs(
|
|
4378
4401
|
"button",
|
|
4379
4402
|
{
|
|
@@ -4468,7 +4491,8 @@ function SponsorRelayFab(props) {
|
|
|
4468
4491
|
background: progressToneColor(indicator.tone),
|
|
4469
4492
|
boxShadow: `0 0 0 ${progressActive ? "4px" : "3px"} ${progressToneColor(indicator.tone)}22`,
|
|
4470
4493
|
transform: `scale(${progressActive ? 1.12 : successFlash ? 1.18 : 1})`,
|
|
4471
|
-
transition: "transform 180ms ease, box-shadow 220ms ease"
|
|
4494
|
+
transition: "transform 180ms ease, box-shadow 220ms ease",
|
|
4495
|
+
animation: pollingState ? "leSpaceRelayPulse 1.6s ease-in-out infinite" : void 0
|
|
4472
4496
|
}
|
|
4473
4497
|
}
|
|
4474
4498
|
),
|
|
@@ -4550,6 +4574,52 @@ function SponsorRelayFab(props) {
|
|
|
4550
4574
|
),
|
|
4551
4575
|
/* @__PURE__ */ jsx("p", { style: { color: "#9fb2ca" }, children: state.statusText }),
|
|
4552
4576
|
state.errorText ? /* @__PURE__ */ jsx("p", { style: { color: "#ffd9d9" }, children: state.errorText }) : null,
|
|
4577
|
+
pollingState ? /* @__PURE__ */ jsxs(
|
|
4578
|
+
"div",
|
|
4579
|
+
{
|
|
4580
|
+
"aria-live": "polite",
|
|
4581
|
+
style: {
|
|
4582
|
+
marginTop: "0.25rem",
|
|
4583
|
+
marginBottom: "0.8rem",
|
|
4584
|
+
padding: "0.7rem 0.8rem",
|
|
4585
|
+
borderRadius: "1rem",
|
|
4586
|
+
border: "1px solid rgba(125, 211, 252, 0.18)",
|
|
4587
|
+
background: "linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.05))",
|
|
4588
|
+
display: "grid",
|
|
4589
|
+
gap: "0.28rem"
|
|
4590
|
+
},
|
|
4591
|
+
children: [
|
|
4592
|
+
/* @__PURE__ */ jsxs(
|
|
4593
|
+
"div",
|
|
4594
|
+
{
|
|
4595
|
+
style: {
|
|
4596
|
+
display: "inline-flex",
|
|
4597
|
+
alignItems: "center",
|
|
4598
|
+
gap: "0.45rem"
|
|
4599
|
+
},
|
|
4600
|
+
children: [
|
|
4601
|
+
/* @__PURE__ */ jsx(
|
|
4602
|
+
"span",
|
|
4603
|
+
{
|
|
4604
|
+
"aria-hidden": "true",
|
|
4605
|
+
style: {
|
|
4606
|
+
width: "0.62rem",
|
|
4607
|
+
height: "0.62rem",
|
|
4608
|
+
borderRadius: "999px",
|
|
4609
|
+
background: progressToneColor("info"),
|
|
4610
|
+
boxShadow: `0 0 0 3px ${progressToneColor("info")}22`,
|
|
4611
|
+
animation: "leSpaceRelayPulse 1.6s ease-in-out infinite"
|
|
4612
|
+
}
|
|
4613
|
+
}
|
|
4614
|
+
),
|
|
4615
|
+
/* @__PURE__ */ jsx("strong", { style: { fontSize: "0.88rem" }, children: pollingState.label })
|
|
4616
|
+
]
|
|
4617
|
+
}
|
|
4618
|
+
),
|
|
4619
|
+
/* @__PURE__ */ jsx("small", { style: { color: "#9fb2ca", lineHeight: 1.35 }, children: pollingState.detail })
|
|
4620
|
+
]
|
|
4621
|
+
}
|
|
4622
|
+
) : null,
|
|
4553
4623
|
deploymentProgressVisible ? /* @__PURE__ */ jsxs(
|
|
4554
4624
|
"div",
|
|
4555
4625
|
{
|
package/shared/index.d.ts
CHANGED
|
@@ -304,7 +304,7 @@ declare const STALE_INSTANCE_ALLOCATION_COOLDOWN_MS: number;
|
|
|
304
304
|
declare const RECENT_INSTANCE_RUNTIME_GRACE_MS: number;
|
|
305
305
|
declare const DEPLOYMENT_PENDING_WARNING_MS: number;
|
|
306
306
|
|
|
307
|
-
declare const UI_PACKAGE_VERSION = "0.3.
|
|
307
|
+
declare const UI_PACKAGE_VERSION = "0.3.22";
|
|
308
308
|
|
|
309
309
|
interface RootfsRequiredPortForward {
|
|
310
310
|
port: number;
|
package/shared/index.js
CHANGED
|
@@ -38,7 +38,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
|
|
|
38
38
|
var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
|
|
39
39
|
|
|
40
40
|
// src/shared/package-version.ts
|
|
41
|
-
var UI_PACKAGE_VERSION = "0.3.
|
|
41
|
+
var UI_PACKAGE_VERSION = "0.3.22";
|
|
42
42
|
|
|
43
43
|
// src/shared/format.ts
|
|
44
44
|
function shortHash(value, head = 8, tail = 6) {
|
|
@@ -42,6 +42,15 @@ export let apiHost = undefined
|
|
|
42
42
|
const versionLabel = resolvedVersion.trim()
|
|
43
43
|
? (resolvedVersion.trim().startsWith('v') ? resolvedVersion.trim() : `v${resolvedVersion.trim()}`)
|
|
44
44
|
: ''
|
|
45
|
+
const pollingStages = new Set(['waiting-for-aleph', 'deployment-confirmed', 'publishing-bootstrap', 'refreshing-instances'])
|
|
46
|
+
|
|
47
|
+
$: pollingActive = state.busy.refreshing || pollingStages.has(state.deploymentProgress.stage)
|
|
48
|
+
$: pollingLabel = state.busy.refreshing
|
|
49
|
+
? 'Checking relay state'
|
|
50
|
+
: (state.deploymentProgress.label || 'Polling relay state')
|
|
51
|
+
$: pollingDetail = state.busy.refreshing
|
|
52
|
+
? (state.statusText || 'Refreshing relay sponsor data from Aleph and the selected CRN.')
|
|
53
|
+
: (state.deploymentProgress.detail || state.statusText || 'Waiting for the next confirmed relay state from Aleph.')
|
|
45
54
|
|
|
46
55
|
onMount(async () => {
|
|
47
56
|
const unsubscribe = controller.subscribe((next) => {
|
|
@@ -113,6 +122,16 @@ export let apiHost = undefined
|
|
|
113
122
|
{/if}
|
|
114
123
|
<p class="status-text">{state.statusText}</p>
|
|
115
124
|
|
|
125
|
+
{#if pollingActive}
|
|
126
|
+
<div class="polling-row" aria-live="polite">
|
|
127
|
+
<div class="polling-head">
|
|
128
|
+
<StatusLed tone="idle" pulse={true} />
|
|
129
|
+
<strong>{pollingLabel}</strong>
|
|
130
|
+
</div>
|
|
131
|
+
<small>{pollingDetail}</small>
|
|
132
|
+
</div>
|
|
133
|
+
{/if}
|
|
134
|
+
|
|
116
135
|
<div class="grid">
|
|
117
136
|
<label class="field">
|
|
118
137
|
<span>Instance Name</span>
|
|
@@ -319,6 +338,31 @@ export let apiHost = undefined
|
|
|
319
338
|
justify-content: space-between;
|
|
320
339
|
}
|
|
321
340
|
|
|
341
|
+
.polling-row {
|
|
342
|
+
display: grid;
|
|
343
|
+
gap: 0.28rem;
|
|
344
|
+
margin: 0.25rem 0 0.8rem;
|
|
345
|
+
padding: 0.7rem 0.85rem;
|
|
346
|
+
border-radius: 1rem;
|
|
347
|
+
background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.05));
|
|
348
|
+
border: 1px solid rgba(125, 211, 252, 0.18);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.polling-head {
|
|
352
|
+
display: inline-flex;
|
|
353
|
+
align-items: center;
|
|
354
|
+
gap: 0.45rem;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.polling-row strong {
|
|
358
|
+
font-size: 0.88rem;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.polling-row small {
|
|
362
|
+
color: var(--relay-text-dim);
|
|
363
|
+
line-height: 1.35;
|
|
364
|
+
}
|
|
365
|
+
|
|
322
366
|
.eyebrow,
|
|
323
367
|
.mini-label,
|
|
324
368
|
.field span,
|