@the-portland-company/shell 0.76.0 → 0.76.2

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/native.d.cts CHANGED
@@ -113,6 +113,31 @@ type ChromeMe = {
113
113
  email?: string | null;
114
114
  phone?: string | null;
115
115
  };
116
+ /**
117
+ * A shared read cache scoped to one `<NavChromeProvider>` (one fetcher, one
118
+ * page boot). Every consumer of a given (path, orgId) pair within the TTL
119
+ * window awaits the SAME promise instead of firing its own request — this is
120
+ * what collapsed `/orgs` (2-4x), `/me` (2-3x) and `/notifications` (2-3x) per
121
+ * page load, 1-3.5s each, down to one call apiece (nav-latency-report.md
122
+ * Table 2). Keying by orgId means switching the active org is itself the
123
+ * invalidation: the new org gets a fresh key, never the previous org's cached
124
+ * value. A failed request is evicted immediately so the next consumer retries
125
+ * rather than replaying the same rejection for the rest of the TTL.
126
+ */
127
+ declare function createChromeFetchCache(getFetchJson: () => NavChromeFetcher): {
128
+ dedupedFetch: (path: string, init: Parameters<NavChromeFetcher>[1] | undefined, opts?: {
129
+ orgId?: string | null;
130
+ ttlMs?: number;
131
+ }) => Promise<unknown>;
132
+ invalidate: (path: string) => void;
133
+ };
134
+ type NavChromeContextValue = {
135
+ fetchJson: NavChromeFetcher;
136
+ dedupedFetch: ReturnType<typeof createChromeFetchCache>['dedupedFetch'];
137
+ invalidateChromeCache: ReturnType<typeof createChromeFetchCache>['invalidate'];
138
+ me: ChromeMe | null;
139
+ meLoaded: boolean;
140
+ };
116
141
  declare function NavChromeProvider({ fetchJson, children, }: {
117
142
  fetchJson: NavChromeFetcher;
118
143
  children: ReactNode;
@@ -122,6 +147,8 @@ declare function useChromeMe(): {
122
147
  me: ChromeMe | null;
123
148
  loaded: boolean;
124
149
  };
150
+ /** The provider's de-duped chrome read (null outside <NavChromeProvider>). */
151
+ declare function useNavChromeDedupedFetch(): NavChromeContextValue['dedupedFetch'] | null;
125
152
  /** The injected chrome fetcher (null outside <NavChromeProvider>). */
126
153
  declare function useNavChromeFetcher(): NavChromeFetcher | null;
127
154
  type FuelChannelStatus = {
@@ -899,4 +926,4 @@ type NavAppShellProps = {
899
926
  };
900
927
  declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, accountMenuPlacement, modeId, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
901
928
 
902
- export { BETA_BANNER_DISMISS_KEY, CAMPAIGN_FEATURE_AVAILABILITY, CORE_APP_ORIGIN, CORE_BILLING_PATH, type CampaignFeatureAvailability, type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationImport, type ChromeNotificationQuarantine, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FormColumn, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, SPECS_ORIGIN, SpecOverlayAction, type StandardNavIconKey, type StandardNavMode, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, resolveOrgLogoUrl, shortEnvLabel, shortUserName, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
929
+ export { BETA_BANNER_DISMISS_KEY, CAMPAIGN_FEATURE_AVAILABILITY, CORE_APP_ORIGIN, CORE_BILLING_PATH, type CampaignFeatureAvailability, type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationImport, type ChromeNotificationQuarantine, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FormColumn, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, SPECS_ORIGIN, SpecOverlayAction, type StandardNavIconKey, type StandardNavMode, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, resolveOrgLogoUrl, shortEnvLabel, shortUserName, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeDedupedFetch, useNavChromeFetcher, useThemePreference };
package/dist/native.d.ts CHANGED
@@ -113,6 +113,31 @@ type ChromeMe = {
113
113
  email?: string | null;
114
114
  phone?: string | null;
115
115
  };
116
+ /**
117
+ * A shared read cache scoped to one `<NavChromeProvider>` (one fetcher, one
118
+ * page boot). Every consumer of a given (path, orgId) pair within the TTL
119
+ * window awaits the SAME promise instead of firing its own request — this is
120
+ * what collapsed `/orgs` (2-4x), `/me` (2-3x) and `/notifications` (2-3x) per
121
+ * page load, 1-3.5s each, down to one call apiece (nav-latency-report.md
122
+ * Table 2). Keying by orgId means switching the active org is itself the
123
+ * invalidation: the new org gets a fresh key, never the previous org's cached
124
+ * value. A failed request is evicted immediately so the next consumer retries
125
+ * rather than replaying the same rejection for the rest of the TTL.
126
+ */
127
+ declare function createChromeFetchCache(getFetchJson: () => NavChromeFetcher): {
128
+ dedupedFetch: (path: string, init: Parameters<NavChromeFetcher>[1] | undefined, opts?: {
129
+ orgId?: string | null;
130
+ ttlMs?: number;
131
+ }) => Promise<unknown>;
132
+ invalidate: (path: string) => void;
133
+ };
134
+ type NavChromeContextValue = {
135
+ fetchJson: NavChromeFetcher;
136
+ dedupedFetch: ReturnType<typeof createChromeFetchCache>['dedupedFetch'];
137
+ invalidateChromeCache: ReturnType<typeof createChromeFetchCache>['invalidate'];
138
+ me: ChromeMe | null;
139
+ meLoaded: boolean;
140
+ };
116
141
  declare function NavChromeProvider({ fetchJson, children, }: {
117
142
  fetchJson: NavChromeFetcher;
118
143
  children: ReactNode;
@@ -122,6 +147,8 @@ declare function useChromeMe(): {
122
147
  me: ChromeMe | null;
123
148
  loaded: boolean;
124
149
  };
150
+ /** The provider's de-duped chrome read (null outside <NavChromeProvider>). */
151
+ declare function useNavChromeDedupedFetch(): NavChromeContextValue['dedupedFetch'] | null;
125
152
  /** The injected chrome fetcher (null outside <NavChromeProvider>). */
126
153
  declare function useNavChromeFetcher(): NavChromeFetcher | null;
127
154
  type FuelChannelStatus = {
@@ -899,4 +926,4 @@ type NavAppShellProps = {
899
926
  };
900
927
  declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, accountMenuPlacement, modeId, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
901
928
 
902
- export { BETA_BANNER_DISMISS_KEY, CAMPAIGN_FEATURE_AVAILABILITY, CORE_APP_ORIGIN, CORE_BILLING_PATH, type CampaignFeatureAvailability, type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationImport, type ChromeNotificationQuarantine, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FormColumn, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, SPECS_ORIGIN, SpecOverlayAction, type StandardNavIconKey, type StandardNavMode, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, resolveOrgLogoUrl, shortEnvLabel, shortUserName, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
929
+ export { BETA_BANNER_DISMISS_KEY, CAMPAIGN_FEATURE_AVAILABILITY, CORE_APP_ORIGIN, CORE_BILLING_PATH, type CampaignFeatureAvailability, type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationImport, type ChromeNotificationQuarantine, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FormColumn, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, SPECS_ORIGIN, SpecOverlayAction, type StandardNavIconKey, type StandardNavMode, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, resolveOrgLogoUrl, shortEnvLabel, shortUserName, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeDedupedFetch, useNavChromeFetcher, useThemePreference };
package/dist/native.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- export { BETA_BANNER_DISMISS_KEY, CAMPAIGN_FEATURE_AVAILABILITY, CORE_APP_ORIGIN, CORE_BILLING_PATH, FuelAction, NavAppShell, NavBetaBanner, NavChromeProvider, NavDisplayAction, NavSidebar, NavTabStrip, NavThemeControl, NavTopBar, NotificationsAction, SPECS_ORIGIN, SpecOverlayAction, SupportAction, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, resolveOrgLogoUrl, shortEnvLabel, shortUserName, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference } from './chunk-WHF6YW27.js';
2
+ export { BETA_BANNER_DISMISS_KEY, CAMPAIGN_FEATURE_AVAILABILITY, CORE_APP_ORIGIN, CORE_BILLING_PATH, FuelAction, NavAppShell, NavBetaBanner, NavChromeProvider, NavDisplayAction, NavSidebar, NavTabStrip, NavThemeControl, NavTopBar, NotificationsAction, SPECS_ORIGIN, SpecOverlayAction, SupportAction, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, resolveOrgLogoUrl, shortEnvLabel, shortUserName, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeDedupedFetch, useNavChromeFetcher, useThemePreference } from './chunk-6KX3DWBC.js';
3
3
  export { FormColumn } from './chunk-MY6G3LMN.js';
4
4
  import './chunk-BHRVZPZ7.js';
5
5
  import './chunk-7YVJ7HQG.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-portland-company/shell",
3
- "version": "0.76.0",
3
+ "version": "0.76.2",
4
4
  "description": "Shared chrome (header, sidebar, footer, theme, auth) for politogy apps. Drop into any Vite SPA to inherit the politogy look and signed-in user.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,