@the-portland-company/shell 0.43.1 → 0.45.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
  ),
@@ -3057,6 +3095,15 @@ var standardNavIcons = {
3057
3095
  var ORG_STORAGE_KEY = "vrm.activeOrg";
3058
3096
  var MODE_STORAGE_KEY = "vrm.activeMode";
3059
3097
  var CORE_BASE_URL = "https://app.politogyvrm.com";
3098
+ var CORE_BASE_URL_STAGING = "https://staging-app.politogyvrm.com";
3099
+ function getCoreBaseUrl() {
3100
+ if (typeof window !== "undefined") {
3101
+ if (window.location.hostname.toLowerCase().includes("staging")) {
3102
+ return CORE_BASE_URL_STAGING;
3103
+ }
3104
+ }
3105
+ return CORE_BASE_URL;
3106
+ }
3060
3107
  var ChromeStateContext = react.createContext(null);
3061
3108
  function useChromeState() {
3062
3109
  return react.useContext(ChromeStateContext);
@@ -3402,13 +3449,14 @@ function useChromeUserMenu({
3402
3449
  const theme = useThemePreference();
3403
3450
  const activeOrg = state?.orgs.find((o) => o.id === state.orgId) ?? null;
3404
3451
  const orgSuffix = activeOrg ? `?org=${activeOrg.id}` : "";
3452
+ const coreBase = getCoreBaseUrl();
3405
3453
  return {
3406
3454
  // My Profile is global — NOT org-suffixed (main-app ShellChromeBridge).
3407
- myProfileHref: `${CORE_BASE_URL}/my-profile`,
3408
- organizationSettingsHref: `${CORE_BASE_URL}/organization-settings${orgSuffix}`,
3455
+ myProfileHref: `${coreBase}/my-profile`,
3456
+ organizationSettingsHref: `${coreBase}/organization-settings${orgSuffix}`,
3409
3457
  roles: (state?.orgs ?? []).filter((o) => o.rawRole || o.role).map((o) => ({ role: o.rawRole ?? o.role, orgName: o.name })),
3410
3458
  accounts: [{ id: userId, name: userName, email, avatarUrl: null, active: true }],
3411
- addAccountHref: `${CORE_BASE_URL}/my-profile#accounts`,
3459
+ addAccountHref: `${coreBase}/my-profile#accounts`,
3412
3460
  theme: { value: theme.value, onChange: theme.setValue }
3413
3461
  };
3414
3462
  }
@@ -3481,9 +3529,10 @@ function useChromeMode(arg = {}) {
3481
3529
  localStorage.setItem(MODE_STORAGE_KEY, id);
3482
3530
  } catch {
3483
3531
  }
3484
- const sep = def.href.includes("?") ? "&" : "?";
3532
+ const href = def.href.replace(CORE_BASE_URL, getCoreBaseUrl());
3533
+ const sep = href.includes("?") ? "&" : "?";
3485
3534
  window.location.assign(
3486
- def.orgQuery && suffix ? `${def.href}${sep}${suffix.slice(1)}` : def.href
3535
+ def.orgQuery && suffix ? `${href}${sep}${suffix.slice(1)}` : href
3487
3536
  );
3488
3537
  } : void 0
3489
3538
  };