@the-portland-company/shell 0.53.1 → 0.54.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/app-chrome.cjs +130 -6
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +19 -2
- package/dist/app-chrome.d.ts +19 -2
- package/dist/app-chrome.js +130 -6
- package/dist/app-chrome.js.map +1 -1
- package/package.json +1 -1
package/dist/app-chrome.cjs
CHANGED
|
@@ -3256,6 +3256,41 @@ function watchLogout(onLogout, options = {}) {
|
|
|
3256
3256
|
}
|
|
3257
3257
|
return cleanup;
|
|
3258
3258
|
}
|
|
3259
|
+
var BOOT_STAGE_TABLE = [
|
|
3260
|
+
{ id: "s0_session", weight: 5, critical: true, waitsOn: "Politogy ID session resolution" },
|
|
3261
|
+
{ id: "s1_org", weight: 10, critical: true, waitsOn: "Chrome API /api/chrome/me + orgs" },
|
|
3262
|
+
{ id: "s2_uvp_connect", weight: 10, critical: true, waitsOn: "UVP data layer connection" },
|
|
3263
|
+
{ id: "s3_district", weight: 5, critical: true, waitsOn: "uvp_geo_entitlements / uvp_boundaries scope" },
|
|
3264
|
+
{ id: "s4_universe", weight: 25, critical: true, waitsOn: "UVP universe load + total count" },
|
|
3265
|
+
{ id: "s5_layers", weight: 15, critical: false, waitsOn: "UVP enrichment layer joins" },
|
|
3266
|
+
{ id: "s6_verified", weight: 10, critical: false, waitsOn: "VRM Verified tier computation" },
|
|
3267
|
+
{ id: "s7_tribes", weight: 10, critical: false, waitsOn: "Tribes member_count + Hot Tribes warm-up" },
|
|
3268
|
+
{ id: "s8_intelligence", weight: 5, critical: false, waitsOn: "Mode intelligence signals (Polling/Relationship/Petition)" },
|
|
3269
|
+
{ id: "s9_shell", weight: 5, critical: true, waitsOn: "Shell paint-ready handoff" }
|
|
3270
|
+
];
|
|
3271
|
+
var BOOT_STAGE_ORDER = BOOT_STAGE_TABLE.map((s) => s.id);
|
|
3272
|
+
var BOOT_STAGE_WEIGHTS = Object.fromEntries(
|
|
3273
|
+
BOOT_STAGE_TABLE.map((s) => [s.id, s.weight])
|
|
3274
|
+
);
|
|
3275
|
+
function computeWeightedPct(args) {
|
|
3276
|
+
const skipped = new Set(args.skippedStageIds ?? []);
|
|
3277
|
+
const applicable = BOOT_STAGE_ORDER.filter((id) => !skipped.has(id));
|
|
3278
|
+
const applicableWeightTotal = applicable.reduce((sum, id) => sum + BOOT_STAGE_WEIGHTS[id], 0);
|
|
3279
|
+
if (applicableWeightTotal <= 0) return 100;
|
|
3280
|
+
const redistributionFactor = 100 / applicableWeightTotal;
|
|
3281
|
+
const completed = new Set(args.completedStageIds);
|
|
3282
|
+
let pct = 0;
|
|
3283
|
+
for (const id of applicable) {
|
|
3284
|
+
const effectiveWeight = BOOT_STAGE_WEIGHTS[id] * redistributionFactor;
|
|
3285
|
+
if (completed.has(id)) {
|
|
3286
|
+
pct += effectiveWeight;
|
|
3287
|
+
} else if (id === args.currentStageId) {
|
|
3288
|
+
const progress = Math.min(1, Math.max(0, args.currentStageProgress ?? 0));
|
|
3289
|
+
pct += effectiveWeight * progress;
|
|
3290
|
+
}
|
|
3291
|
+
}
|
|
3292
|
+
return Math.min(100, pct);
|
|
3293
|
+
}
|
|
3259
3294
|
var SYNTHETIC_STAGES = [
|
|
3260
3295
|
{ pct: 20, label: "Connecting to your organization\u2026" },
|
|
3261
3296
|
{ pct: 100, label: "Ready." }
|
|
@@ -3334,7 +3369,25 @@ function LoadingScreen({
|
|
|
3334
3369
|
phase: syntheticReady ? "done" : "booting"
|
|
3335
3370
|
};
|
|
3336
3371
|
}, [syntheticReady]);
|
|
3337
|
-
const
|
|
3372
|
+
const weightedPct = react.useMemo(() => {
|
|
3373
|
+
if (!bootProgress) return void 0;
|
|
3374
|
+
if (typeof bootProgress.pct === "number") return bootProgress.pct;
|
|
3375
|
+
if (!bootProgress.completedStageIds && !bootProgress.skippedStageIds) return void 0;
|
|
3376
|
+
return computeWeightedPct({
|
|
3377
|
+
completedStageIds: bootProgress.completedStageIds ?? [],
|
|
3378
|
+
skippedStageIds: bootProgress.skippedStageIds,
|
|
3379
|
+
currentStageId: bootProgress.stageId,
|
|
3380
|
+
currentStageProgress: bootProgress.currentStageProgress
|
|
3381
|
+
});
|
|
3382
|
+
}, [
|
|
3383
|
+
bootProgress,
|
|
3384
|
+
bootProgress?.pct,
|
|
3385
|
+
bootProgress?.completedStageIds,
|
|
3386
|
+
bootProgress?.skippedStageIds,
|
|
3387
|
+
bootProgress?.stageId,
|
|
3388
|
+
bootProgress?.currentStageProgress
|
|
3389
|
+
]);
|
|
3390
|
+
const pct = weightedPct ?? synthetic.pct;
|
|
3338
3391
|
const rawLabel = bootProgress?.label ?? synthetic.label;
|
|
3339
3392
|
const phase = bootProgress?.phase ?? synthetic.phase;
|
|
3340
3393
|
const isFinal = phase === "done" && pct >= 100;
|
|
@@ -3457,11 +3510,82 @@ function LoadingScreen({
|
|
|
3457
3510
|
children: announced
|
|
3458
3511
|
}
|
|
3459
3512
|
),
|
|
3460
|
-
isError && (bootProgress?.onRetry || bootProgress?.onSignOut) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3513
|
+
isError && (bootProgress?.onRetry || bootProgress?.onSignOut) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3514
|
+
"div",
|
|
3515
|
+
{
|
|
3516
|
+
style: {
|
|
3517
|
+
marginTop: "1.25rem",
|
|
3518
|
+
display: "flex",
|
|
3519
|
+
flexDirection: "column",
|
|
3520
|
+
gap: "0.75rem",
|
|
3521
|
+
alignItems: "center"
|
|
3522
|
+
},
|
|
3523
|
+
children: [
|
|
3524
|
+
bootProgress?.onRetry && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3525
|
+
"button",
|
|
3526
|
+
{
|
|
3527
|
+
type: "button",
|
|
3528
|
+
onClick: bootProgress.onRetry,
|
|
3529
|
+
style: {
|
|
3530
|
+
height: 40,
|
|
3531
|
+
padding: "0 1.25rem",
|
|
3532
|
+
borderRadius: "var(--radius-md, 8px)",
|
|
3533
|
+
border: "none",
|
|
3534
|
+
background: "var(--color-race-red, #dc2626)",
|
|
3535
|
+
color: "#fff",
|
|
3536
|
+
fontFamily: "var(--font-sans, ui-sans-serif, system-ui, sans-serif)",
|
|
3537
|
+
fontSize: "0.875rem",
|
|
3538
|
+
fontWeight: 600,
|
|
3539
|
+
cursor: "pointer"
|
|
3540
|
+
},
|
|
3541
|
+
children: "Retry"
|
|
3542
|
+
}
|
|
3543
|
+
),
|
|
3544
|
+
bootProgress?.onSignOut && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3545
|
+
"button",
|
|
3546
|
+
{
|
|
3547
|
+
type: "button",
|
|
3548
|
+
onClick: bootProgress.onSignOut,
|
|
3549
|
+
style: {
|
|
3550
|
+
height: "auto",
|
|
3551
|
+
padding: 0,
|
|
3552
|
+
border: "none",
|
|
3553
|
+
background: "transparent",
|
|
3554
|
+
color: "rgba(255,255,255,0.38)",
|
|
3555
|
+
fontFamily: "var(--font-sans, ui-sans-serif, system-ui, sans-serif)",
|
|
3556
|
+
fontSize: "12.5px",
|
|
3557
|
+
textDecoration: "underline",
|
|
3558
|
+
cursor: "pointer"
|
|
3559
|
+
},
|
|
3560
|
+
children: "Sign out"
|
|
3561
|
+
}
|
|
3562
|
+
)
|
|
3563
|
+
]
|
|
3564
|
+
}
|
|
3565
|
+
)
|
|
3566
|
+
] }),
|
|
3567
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3568
|
+
"div",
|
|
3569
|
+
{
|
|
3570
|
+
style: {
|
|
3571
|
+
position: "absolute",
|
|
3572
|
+
left: 0,
|
|
3573
|
+
right: 0,
|
|
3574
|
+
bottom: 0,
|
|
3575
|
+
display: "flex",
|
|
3576
|
+
alignItems: "center",
|
|
3577
|
+
justifyContent: "space-between",
|
|
3578
|
+
padding: "0 32px 30px",
|
|
3579
|
+
fontFamily: "var(--font-sans, ui-sans-serif, system-ui, sans-serif)",
|
|
3580
|
+
fontSize: "12.5px",
|
|
3581
|
+
color: "rgba(255,255,255,0.38)"
|
|
3582
|
+
},
|
|
3583
|
+
children: [
|
|
3584
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Politogy VRM. Built for the long game." }),
|
|
3585
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: "var(--font-mono, ui-monospace, monospace)", letterSpacing: "0.04em" }, children: (bootProgress?.version ?? "v\u2014") + " \xB7 " + (bootProgress?.region ?? "\u2014") })
|
|
3586
|
+
]
|
|
3587
|
+
}
|
|
3588
|
+
)
|
|
3465
3589
|
]
|
|
3466
3590
|
}
|
|
3467
3591
|
);
|