@the-portland-company/shell 0.58.0 → 0.60.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
  "use client";
2
2
  import { broadcastLogout, watchLogout } from './chunk-LL6LSJAH.js';
3
- import { clearBetaBannerDismissal, standardPolitogyNav, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SpecOverlayAction, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-BV2QF7NY.js';
3
+ import { clearBetaBannerDismissal, standardPolitogyNav, isNavItemActive, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SpecOverlayAction, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-AZB46QJH.js';
4
4
  import './chunk-U4RZPZET.js';
5
5
  import { NAV_DISPLAY_DEFAULT, resolveNavDisplay, isNavDisplayPreference, writeNavDisplayCookie, writeNavDisplayLocal, NAV_DISPLAY_STORAGE_KEY, readNavDisplayCookie } from './chunk-6UHJV2FH.js';
6
6
  import { resolveActiveOrg, isOrgId, writeActiveOrgCookie, ACTIVE_ORG_QUERY_PARAM, readActiveOrgCookie } from './chunk-W2HITMV5.js';
@@ -678,6 +678,21 @@ function FrameBody({
678
678
  [data?.contactsItem, data?.petitionsItem, navMode, activeOrgId]
679
679
  );
680
680
  const navItems = core?.nav ?? derivedNavItems;
681
+ const navIsActive = useMemo(() => {
682
+ const childHrefs = /* @__PURE__ */ new Map();
683
+ for (const item of navItems) {
684
+ if (!item.href || !item.children?.length) continue;
685
+ const hrefs = [];
686
+ for (const child of item.children) {
687
+ if (child.href) hrefs.push(child.href);
688
+ for (const leaf of child.children ?? []) {
689
+ if (leaf.href) hrefs.push(leaf.href);
690
+ }
691
+ }
692
+ childHrefs.set(item.href, hrefs);
693
+ }
694
+ return (pathname2, href) => isNavItemActive(pathname2, href) || (childHrefs.get(href) ?? []).some((h) => isNavItemActive(pathname2, h));
695
+ }, [navItems]);
681
696
  const derivedBreadcrumbs = useMemo(
682
697
  () => deriveBreadcrumbs(navItems, pathname, { search, origin: meta.origin }),
683
698
  [navItems, pathname, search, meta.origin]
@@ -710,6 +725,7 @@ function FrameBody({
710
725
  // (which strips children) would leave one childless parent row —
711
726
  // flat apps ignore the stripping.
712
727
  items: navDisplay === "tabs" && meta.navShape !== "flat" ? navItems.map(({ children: _sub, ...item }) => item) : navItems,
728
+ isActive: navIsActive,
713
729
  flatten: meta.navShape === "flat"
714
730
  },
715
731
  // The app's own workspace is NOT the organization — it is a per-app