@the-portland-company/shell 0.84.0 → 0.86.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.
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { S as StandardNavIconKey, f as NavIcon, N as NavItem, g as NavBreadcrumb, h as StandardNavMode, i as NavLinkComponent, j as NavChromeFetcher, k as NavMode, l as NavUserMenu, m as NavOrgOption, b as NotificationsAdapter, o as NavFooterLink, p as NavFooter, q as NavDisplayMode } from './index--q40spnY.cjs';
3
+ import { S as StandardNavIconKey, f as NavIcon, N as NavItem, g as NavBreadcrumb, h as StandardNavMode, i as NavLinkComponent, j as NavChromeFetcher, k as NavMode, l as NavUserMenu, m as NavOrgOption, b as NotificationsAdapter, o as NavFooterLink, p as NavFooter, q as NavDisplayMode } from './index-bfbWLC7_.cjs';
4
4
  import './theme-preference.cjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { S as StandardNavIconKey, f as NavIcon, N as NavItem, g as NavBreadcrumb, h as StandardNavMode, i as NavLinkComponent, j as NavChromeFetcher, k as NavMode, l as NavUserMenu, m as NavOrgOption, b as NotificationsAdapter, o as NavFooterLink, p as NavFooter, q as NavDisplayMode } from './index-C4ob05Pc.js';
3
+ import { S as StandardNavIconKey, f as NavIcon, N as NavItem, g as NavBreadcrumb, h as StandardNavMode, i as NavLinkComponent, j as NavChromeFetcher, k as NavMode, l as NavUserMenu, m as NavOrgOption, b as NotificationsAdapter, o as NavFooterLink, p as NavFooter, q as NavDisplayMode } from './index-C31E7M9l.js';
4
4
  import './theme-preference.js';
5
5
 
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { broadcastLogout, watchLogout } from './chunk-LL6LSJAH.js';
3
- import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell } from './chunk-QS3Z4N73.js';
4
- export { standardNavIcons } from './chunk-QS3Z4N73.js';
3
+ import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell } from './chunk-3JOLELB4.js';
4
+ export { standardNavIcons } from './chunk-3JOLELB4.js';
5
5
  import { warnDeprecated, NavChromeProvider, TopBarWidgetSlot, FuelAction, SpecOverlayAction, NotificationsAction, SupportAction, useChromeMe, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-PRZP2SB6.js';
6
6
  import './chunk-BHRVZPZ7.js';
7
7
  import { NAV_DISPLAY_DEFAULT, resolveNavDisplay, writeNavDisplayLocal, writeNavDisplayCookie, isNavDisplayPreference, NAV_DISPLAY_STORAGE_KEY, readNavDisplayCookie } from './chunk-7YVJ7HQG.js';
@@ -520,10 +520,19 @@ var CORE_APP = "vrm";
520
520
  var DEFAULT_SIGN_OUT_URL = "/auth/signout";
521
521
  var POLITOGY_APPS = {
522
522
  vrm: { title: "Politogy VRM", origin: "https://app.politogyvrm.com", storagePrefix: "vrm" },
523
+ // Contacts, Forms, Surveys and CTAs are Relationship rows only (Specs/
524
+ // Left-Navigation §9.1; Campaign has none of them, §9.2), so they are
525
+ // PINNED to Relationship like the Dashboard below. Left unscoped, the mode
526
+ // switcher and rail colour took the user's last mode choice while the rows
527
+ // stayed Relationship: after picking Campaign, Contacts drew the red
528
+ // "Campaign mode" rail around Relationship rows, even after a reload
529
+ // (measured 2026-10-16 on We need Steve; §11.1 "the rail never shows a mix
530
+ // of two modes").
523
531
  contacts: {
524
532
  title: "Contacts",
525
533
  origin: "https://contacts.politogyvrm.com",
526
534
  storagePrefix: "contacts",
535
+ mode: "relationship",
527
536
  pageTitle: false
528
537
  },
529
538
  // 'title' for forms/surveys/polls/ctas for the same reason as petitions
@@ -532,11 +541,11 @@ var POLITOGY_APPS = {
532
541
  // page header falls back to the static registry title forever, so the
533
542
  // designed "<mode> mode" eyebrow + H2 + subtitle block never gets the real
534
543
  // per-page title an app passes it (UI-Platform → Page header).
535
- forms: { title: "Forms", origin: "https://forms.politogyvrm.com", storagePrefix: "forms", grants: ["title"] },
536
- surveys: { title: "Surveys", origin: "https://surveys.politogyvrm.com", storagePrefix: "surveys", grants: ["title"] },
544
+ forms: { title: "Forms", origin: "https://forms.politogyvrm.com", storagePrefix: "forms", mode: "relationship", grants: ["title"] },
545
+ surveys: { title: "Surveys", origin: "https://surveys.politogyvrm.com", storagePrefix: "surveys", mode: "relationship", grants: ["title"] },
537
546
  // Specs/Left-Navigation §9.2: Polling is a Campaign row (Research).
538
547
  polls: { title: "Polls", origin: "https://polls.politogyvrm.com", storagePrefix: "polls", mode: "campaign", grants: ["title"] },
539
- ctas: { title: "CTAs", origin: "https://ctas.politogyvrm.com", storagePrefix: "ctas", grants: ["title"] },
548
+ ctas: { title: "CTAs", origin: "https://ctas.politogyvrm.com", storagePrefix: "ctas", mode: "relationship", grants: ["title"] },
540
549
  // V2 apps that replace retired app.politogyvrm.com pages (Reference/
541
550
  // UI-Platform v42 "Retirement of app.politogyvrm.com"). Dashboard is the
542
551
  // Relationship Dashboard, the Relationship Mode landing page, and nothing
@@ -760,7 +769,7 @@ function FrameBody({
760
769
  const coreOrgs = chrome?.orgs ?? [];
761
770
  const activeCoreOrg = coreOrgs.find((o) => o.id === chrome?.orgId) ?? null;
762
771
  const navDisplay = chrome?.navDisplay ?? "both";
763
- const navMode = appMode ?? "relationship";
772
+ const navMode = appMode ?? (app !== CORE_APP && isStandardNavMode(mode.id) ? mode.id : "relationship");
764
773
  const activeOrgId = chrome?.orgId ?? null;
765
774
  const derivedNavItems = useMemo(
766
775
  () => standardPolitogyNav({
@@ -803,7 +812,7 @@ function FrameBody({
803
812
  {
804
813
  visible: bootVisible,
805
814
  bootProgress,
806
- syntheticReady: (appReady ?? chromeResolved) && !chrome?.orgPending,
815
+ syntheticReady: (appReady ?? chromeResolved) && !chrome?.orgPending && (appMode !== void 0 || mode.resolved !== false),
807
816
  onExitComplete: () => setBootVisible(false)
808
817
  },
809
818
  bootGeneration
@@ -1523,6 +1532,7 @@ function useChromeMode(arg = {}) {
1523
1532
  const orgId = ctx?.orgId ?? null;
1524
1533
  const orgPending = ctx?.orgPending ?? false;
1525
1534
  const [entitled, setEntitled] = useState(null);
1535
+ const [settledOrgId, setSettledOrgId] = useState(null);
1526
1536
  const [selectedModeId, setSelectedModeId] = useState(null);
1527
1537
  useEffect(() => {
1528
1538
  try {
@@ -1537,6 +1547,7 @@ function useChromeMode(arg = {}) {
1537
1547
  const bootMe = me;
1538
1548
  if (bootMe && bootMe.account === orgId && bootMe.modes !== void 0) {
1539
1549
  setEntitled(bootMe.modes ?? null);
1550
+ setSettledOrgId(orgId);
1540
1551
  return;
1541
1552
  }
1542
1553
  let cancelled = false;
@@ -1544,7 +1555,9 @@ function useChromeMode(arg = {}) {
1544
1555
  if (cancelled) return;
1545
1556
  const modes = data?.modes ?? null;
1546
1557
  setEntitled(modes);
1558
+ setSettledOrgId(orgId);
1547
1559
  }).catch(() => {
1560
+ if (!cancelled) setSettledOrgId(orgId);
1548
1561
  });
1549
1562
  return () => {
1550
1563
  cancelled = true;
@@ -1558,6 +1571,9 @@ function useChromeMode(arg = {}) {
1558
1571
  id: current.id,
1559
1572
  label: current.label,
1560
1573
  icon: current.icon,
1574
+ // A registry pin is final at once; otherwise the mode is final when the
1575
+ // active org's Modes are in (or nothing can be read: no chrome or no org).
1576
+ resolved: Boolean(pinned) || !dedupedFetch || !orgId || settledOrgId === orgId && !orgPending,
1561
1577
  // Left-Navigation §7 / Reference/UI-Platform: always the row of three icon
1562
1578
  // buttons. A mode the organization does not hold is shown dimmed and not
1563
1579
  // selectable, never hidden. Before entitlements land only the current mode