@the-portland-company/shell 0.43.0 → 0.44.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.
@@ -2484,15 +2484,39 @@ var BETA_BANNER_DEFAULTS = {
2484
2484
  linkLabel: "You can click here to see the Terms & Conditions for Beta users.",
2485
2485
  href: "https://app.politogyvrm.com/beta-terms-and-conditions"
2486
2486
  };
2487
- function NavBetaBanner({ text, linkLabel, href }) {
2487
+ var BETA_BANNER_DISMISS_KEY = "politogy_beta_banner_dismissed";
2488
+ function clearBetaBannerDismissal() {
2489
+ if (typeof window === "undefined") return;
2490
+ try {
2491
+ window.sessionStorage.removeItem(BETA_BANNER_DISMISS_KEY);
2492
+ } catch {
2493
+ }
2494
+ }
2495
+ function NavBetaBanner({ text, linkLabel, href, dismissible = true }) {
2488
2496
  const body = text ?? BETA_BANNER_DEFAULTS.text;
2489
2497
  const label = linkLabel ?? BETA_BANNER_DEFAULTS.linkLabel;
2490
2498
  const target = href ?? BETA_BANNER_DEFAULTS.href;
2499
+ const [dismissed, setDismissed] = react.useState(false);
2500
+ react.useEffect(() => {
2501
+ if (!dismissible) return;
2502
+ try {
2503
+ if (window.sessionStorage.getItem(BETA_BANNER_DISMISS_KEY) === "1") setDismissed(true);
2504
+ } catch {
2505
+ }
2506
+ }, [dismissible]);
2507
+ if (dismissible && dismissed) return null;
2508
+ const onDismiss = () => {
2509
+ setDismissed(true);
2510
+ try {
2511
+ window.sessionStorage.setItem(BETA_BANNER_DISMISS_KEY, "1");
2512
+ } catch {
2513
+ }
2514
+ };
2491
2515
  return /* @__PURE__ */ jsxRuntime.jsxs(
2492
2516
  "div",
2493
2517
  {
2494
2518
  role: "note",
2495
- className: "w-full px-4 py-2 text-center text-sm",
2519
+ className: "relative w-full px-10 py-2 text-center text-sm",
2496
2520
  style: {
2497
2521
  // Amber warning fill, matching the "10DLC Registration Required" notice
2498
2522
  // (HITL 2026-07-29). This used to fall through to `--color-accent`, the
@@ -2514,7 +2538,19 @@ function NavBetaBanner({ text, linkLabel, href }) {
2514
2538
  style: { color: "var(--beta-banner-text, #1A202C)" },
2515
2539
  children: label
2516
2540
  }
2517
- )
2541
+ ),
2542
+ dismissible ? /* @__PURE__ */ jsxRuntime.jsx(
2543
+ "button",
2544
+ {
2545
+ type: "button",
2546
+ onClick: onDismiss,
2547
+ "aria-label": "Dismiss this notice",
2548
+ title: "Dismiss",
2549
+ className: "absolute right-2 top-1/2 -translate-y-1/2 flex h-6 w-6 items-center justify-center rounded text-base leading-none opacity-70 hover:opacity-100",
2550
+ style: { color: "var(--beta-banner-text, #1A202C)" },
2551
+ children: "\xD7"
2552
+ }
2553
+ ) : null
2518
2554
  ]
2519
2555
  }
2520
2556
  );
@@ -2900,6 +2936,7 @@ function FrameBody({
2900
2936
  const signingOutRef = react.useRef(false);
2901
2937
  const handleSignOut = react.useCallback(() => {
2902
2938
  signingOutRef.current = true;
2939
+ clearBetaBannerDismissal();
2903
2940
  broadcastLogout();
2904
2941
  signOutRef.current();
2905
2942
  window.location.assign(signOutUrl);
@@ -2924,6 +2961,7 @@ function FrameBody({
2924
2961
  // already on record for every tab.
2925
2962
  watchLogout(() => {
2926
2963
  if (signingOutRef.current) return;
2964
+ clearBetaBannerDismissal();
2927
2965
  window.location.assign(signOutUrl);
2928
2966
  })
2929
2967
  ),
@@ -3156,10 +3194,14 @@ function ChromeStateProvider({
3156
3194
  orgReconciled.current = true;
3157
3195
  return;
3158
3196
  }
3159
- if (memberOrgsRef.current.length === 0) return;
3197
+ if (!orgs && !orgsError) return;
3160
3198
  orgReconciled.current = true;
3161
- applyExternalOrg(pref ?? null);
3162
- }, [chromeMe.me, orgs, controlledOrg, applyExternalOrg]);
3199
+ const members = [...orgs ?? [], ...controlledOrg?.orgs ?? []];
3200
+ if (!members.some((o) => o.id === pref)) return;
3201
+ const controlled = controlledOrgRef.current;
3202
+ if (controlled) (controlled.onExternalSwitch ?? controlled.onSwitch)(pref);
3203
+ else setOrgIdState(pref);
3204
+ }, [chromeMe.me, orgs, orgsError, controlledOrg]);
3163
3205
  const setOrgId = react.useCallback((id) => {
3164
3206
  setOrgIdState(id);
3165
3207
  try {
@@ -3238,7 +3280,7 @@ function ChromeStateProvider({
3238
3280
  } catch {
3239
3281
  }
3240
3282
  const known = chromeMe.me?.activeOrg ?? null;
3241
- if (chromeMe.me && activeOrgId !== known && activeOrgId !== lastPatchedOrg.current) {
3283
+ if (orgReconciled.current && chromeMe.me && activeOrgId !== known && activeOrgId !== lastPatchedOrg.current) {
3242
3284
  lastPatchedOrg.current = activeOrgId;
3243
3285
  chromeFetch?.("me/preferences", {
3244
3286
  method: "PATCH",