@the-portland-company/shell 0.102.1 → 0.102.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/CHANGELOG.md +8 -0
- package/dist/app-chrome.cjs +18 -2
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +11 -2
- package/dist/app-chrome.d.ts +11 -2
- package/dist/app-chrome.js +18 -3
- package/dist/app-chrome.js.map +1 -1
- package/dist/{index-C8yIX2wg.d.ts → index-BTYiaHqq.d.ts} +1 -1
- package/dist/{index-BOxLJAUi.d.cts → index-DTFEH6Tk.d.cts} +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/native.d.cts +1 -1
- package/dist/native.d.ts +1 -1
- package/package.json +1 -1
package/dist/app-chrome.d.cts
CHANGED
|
@@ -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, z as NavIcon, N as NavItem, D as NavBreadcrumb, E as StandardNavMode, G as NavLinkComponent, I as NavChromeFetcher, J as NavMode, L as NavUserMenu, M as NavOrgOption, i as NotificationsAdapter, O as
|
|
3
|
+
import { S as StandardNavIconKey, z as NavIcon, N as NavItem, D as NavBreadcrumb, E as StandardNavMode, G as NavLinkComponent, I as NavChromeFetcher, J as NavMode, L as NavUserMenu, M as NavOrgOption, i as NotificationsAdapter, O as ChromeOrgSummary, Q as NavFooterLink, U as NavFooter, W as NavDisplayMode } from './index-DTFEH6Tk.cjs';
|
|
4
4
|
import './theme-preference.cjs';
|
|
5
5
|
import './brand-favicon.cjs';
|
|
6
6
|
|
|
@@ -482,6 +482,15 @@ type TokenOrgState = {
|
|
|
482
482
|
/** Called when the IdP refuses a switch (403 not a member, 401 no session). */
|
|
483
483
|
onSwitchError?: (err: unknown) => void;
|
|
484
484
|
};
|
|
485
|
+
/**
|
|
486
|
+
* Fill each app-supplied switcher row's missing branding (Brand Kit icon,
|
|
487
|
+
* Primary logo, brand color) from the chrome `/api/orgs` list, matched by org
|
|
488
|
+
* id. The app's own non-empty values win, and rows are never added, removed
|
|
489
|
+
* or reordered: the app's list stays the source of membership. Without a
|
|
490
|
+
* chrome list (still loading, or the read failed) the app's rows are returned
|
|
491
|
+
* as they are.
|
|
492
|
+
*/
|
|
493
|
+
declare function fillOrgBranding<T extends NavOrgOption>(rows: T[], chrome: ChromeOrgSummary[] | null | undefined): T[];
|
|
485
494
|
type ChromeDevNotesConfig = {
|
|
486
495
|
/** Override the DevNotes API base (default: `${proxyBasePath}/devnotes`). */
|
|
487
496
|
basePath?: string;
|
|
@@ -620,4 +629,4 @@ type UseChromeModeArg = ModeId | {
|
|
|
620
629
|
*/
|
|
621
630
|
declare function useChromeMode(arg?: UseChromeModeArg): NavMode;
|
|
622
631
|
|
|
623
|
-
export { type BootPhase, type BootProgress, type BootStageId, type ChromeDevNotesConfig, type ChromeIdentity, ChromeTopBarActions, type ControlledOrgState, LoadingScreen, MODE_SEARCH_PLACEHOLDER, POLITOGY_APPS, PolitogyAppChrome, PolitogyAppFrame, type PolitogyAppKey, type PolitogyAppMode, type PolitogyAppSession, type PolitogyBuildMeta, type PolitogyFrameData, type PolitogyFrameGrant, type PolitogyGrantedFrame, type ResolvedIdentity, type TokenOrgState, deriveBreadcrumbs, footerLinks, looksLikeEmail, modeLandingHref, orgSwitchLanding, relationshipSearchHref, resolveIdentity, standardNavIcons, useChromeFooter, useChromeIdentity, useChromeMode, useChromeState, useChromeUserMenu, useIsSuperAdmin };
|
|
632
|
+
export { type BootPhase, type BootProgress, type BootStageId, type ChromeDevNotesConfig, type ChromeIdentity, ChromeTopBarActions, type ControlledOrgState, LoadingScreen, MODE_SEARCH_PLACEHOLDER, POLITOGY_APPS, PolitogyAppChrome, PolitogyAppFrame, type PolitogyAppKey, type PolitogyAppMode, type PolitogyAppSession, type PolitogyBuildMeta, type PolitogyFrameData, type PolitogyFrameGrant, type PolitogyGrantedFrame, type ResolvedIdentity, type TokenOrgState, deriveBreadcrumbs, fillOrgBranding, footerLinks, looksLikeEmail, modeLandingHref, orgSwitchLanding, relationshipSearchHref, resolveIdentity, standardNavIcons, useChromeFooter, useChromeIdentity, useChromeMode, useChromeState, useChromeUserMenu, useIsSuperAdmin };
|
package/dist/app-chrome.d.ts
CHANGED
|
@@ -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, z as NavIcon, N as NavItem, D as NavBreadcrumb, E as StandardNavMode, G as NavLinkComponent, I as NavChromeFetcher, J as NavMode, L as NavUserMenu, M as NavOrgOption, i as NotificationsAdapter, O as
|
|
3
|
+
import { S as StandardNavIconKey, z as NavIcon, N as NavItem, D as NavBreadcrumb, E as StandardNavMode, G as NavLinkComponent, I as NavChromeFetcher, J as NavMode, L as NavUserMenu, M as NavOrgOption, i as NotificationsAdapter, O as ChromeOrgSummary, Q as NavFooterLink, U as NavFooter, W as NavDisplayMode } from './index-BTYiaHqq.js';
|
|
4
4
|
import './theme-preference.js';
|
|
5
5
|
import './brand-favicon.js';
|
|
6
6
|
|
|
@@ -482,6 +482,15 @@ type TokenOrgState = {
|
|
|
482
482
|
/** Called when the IdP refuses a switch (403 not a member, 401 no session). */
|
|
483
483
|
onSwitchError?: (err: unknown) => void;
|
|
484
484
|
};
|
|
485
|
+
/**
|
|
486
|
+
* Fill each app-supplied switcher row's missing branding (Brand Kit icon,
|
|
487
|
+
* Primary logo, brand color) from the chrome `/api/orgs` list, matched by org
|
|
488
|
+
* id. The app's own non-empty values win, and rows are never added, removed
|
|
489
|
+
* or reordered: the app's list stays the source of membership. Without a
|
|
490
|
+
* chrome list (still loading, or the read failed) the app's rows are returned
|
|
491
|
+
* as they are.
|
|
492
|
+
*/
|
|
493
|
+
declare function fillOrgBranding<T extends NavOrgOption>(rows: T[], chrome: ChromeOrgSummary[] | null | undefined): T[];
|
|
485
494
|
type ChromeDevNotesConfig = {
|
|
486
495
|
/** Override the DevNotes API base (default: `${proxyBasePath}/devnotes`). */
|
|
487
496
|
basePath?: string;
|
|
@@ -620,4 +629,4 @@ type UseChromeModeArg = ModeId | {
|
|
|
620
629
|
*/
|
|
621
630
|
declare function useChromeMode(arg?: UseChromeModeArg): NavMode;
|
|
622
631
|
|
|
623
|
-
export { type BootPhase, type BootProgress, type BootStageId, type ChromeDevNotesConfig, type ChromeIdentity, ChromeTopBarActions, type ControlledOrgState, LoadingScreen, MODE_SEARCH_PLACEHOLDER, POLITOGY_APPS, PolitogyAppChrome, PolitogyAppFrame, type PolitogyAppKey, type PolitogyAppMode, type PolitogyAppSession, type PolitogyBuildMeta, type PolitogyFrameData, type PolitogyFrameGrant, type PolitogyGrantedFrame, type ResolvedIdentity, type TokenOrgState, deriveBreadcrumbs, footerLinks, looksLikeEmail, modeLandingHref, orgSwitchLanding, relationshipSearchHref, resolveIdentity, standardNavIcons, useChromeFooter, useChromeIdentity, useChromeMode, useChromeState, useChromeUserMenu, useIsSuperAdmin };
|
|
632
|
+
export { type BootPhase, type BootProgress, type BootStageId, type ChromeDevNotesConfig, type ChromeIdentity, ChromeTopBarActions, type ControlledOrgState, LoadingScreen, MODE_SEARCH_PLACEHOLDER, POLITOGY_APPS, PolitogyAppChrome, PolitogyAppFrame, type PolitogyAppKey, type PolitogyAppMode, type PolitogyAppSession, type PolitogyBuildMeta, type PolitogyFrameData, type PolitogyFrameGrant, type PolitogyGrantedFrame, type ResolvedIdentity, type TokenOrgState, deriveBreadcrumbs, fillOrgBranding, footerLinks, looksLikeEmail, modeLandingHref, orgSwitchLanding, relationshipSearchHref, resolveIdentity, standardNavIcons, useChromeFooter, useChromeIdentity, useChromeMode, useChromeState, useChromeUserMenu, useIsSuperAdmin };
|
package/dist/app-chrome.js
CHANGED
|
@@ -949,12 +949,27 @@ var ChromeStateContext = createContext(null);
|
|
|
949
949
|
function useChromeState() {
|
|
950
950
|
return useContext(ChromeStateContext);
|
|
951
951
|
}
|
|
952
|
+
function fillOrgBranding(rows, chrome) {
|
|
953
|
+
if (!chrome?.length) return rows;
|
|
954
|
+
const byId = new Map(chrome.map((o) => [o.id, o]));
|
|
955
|
+
return rows.map((row) => {
|
|
956
|
+
const c = byId.get(row.id);
|
|
957
|
+
if (!c) return row;
|
|
958
|
+
return {
|
|
959
|
+
...row,
|
|
960
|
+
iconUrl: row.iconUrl || c.iconUrl || null,
|
|
961
|
+
logoUrl: row.logoUrl || c.logoUrl || null,
|
|
962
|
+
brandColor: row.brandColor || c.brandColor || null
|
|
963
|
+
};
|
|
964
|
+
});
|
|
965
|
+
}
|
|
952
966
|
function TokenChromeStateProvider({
|
|
953
967
|
tokenOrg,
|
|
954
968
|
children
|
|
955
969
|
}) {
|
|
970
|
+
const needsBranding = !!tokenOrg.orgs?.some((o) => o.iconUrl === void 0);
|
|
956
971
|
const { orgs: fetchedOrgs, loading: orgsFetching, error: orgsError } = useChromeOrgs({
|
|
957
|
-
enabled: !tokenOrg.orgs
|
|
972
|
+
enabled: !tokenOrg.orgs || needsBranding
|
|
958
973
|
});
|
|
959
974
|
const [navDisplay, setNavDisplayState] = useState(NAV_DISPLAY_DEFAULT);
|
|
960
975
|
const [pendingOrg, setPendingOrg] = useState(null);
|
|
@@ -965,7 +980,7 @@ function TokenChromeStateProvider({
|
|
|
965
980
|
setNavDisplayState(resolveNavDisplay());
|
|
966
981
|
}, []);
|
|
967
982
|
const orgs = useMemo(
|
|
968
|
-
() => tokenOrg.orgs ?? (fetchedOrgs ?? []).map((o) => ({
|
|
983
|
+
() => (tokenOrg.orgs ? fillOrgBranding(tokenOrg.orgs, fetchedOrgs) : null) ?? (fetchedOrgs ?? []).map((o) => ({
|
|
969
984
|
id: o.id,
|
|
970
985
|
name: o.name,
|
|
971
986
|
logoUrl: o.logoUrl,
|
|
@@ -1634,6 +1649,6 @@ function useChromeMode(arg = {}) {
|
|
|
1634
1649
|
};
|
|
1635
1650
|
}
|
|
1636
1651
|
|
|
1637
|
-
export { ChromeTopBarActions, LoadingScreen, MODE_SEARCH_PLACEHOLDER, POLITOGY_APPS, PolitogyAppChrome, PolitogyAppFrame, deriveBreadcrumbs, footerLinks, looksLikeEmail, modeLandingHref, orgSwitchLanding, relationshipSearchHref, resolveIdentity, useChromeFooter, useChromeIdentity, useChromeMode, useChromeState, useChromeUserMenu, useIsSuperAdmin };
|
|
1652
|
+
export { ChromeTopBarActions, LoadingScreen, MODE_SEARCH_PLACEHOLDER, POLITOGY_APPS, PolitogyAppChrome, PolitogyAppFrame, deriveBreadcrumbs, fillOrgBranding, footerLinks, looksLikeEmail, modeLandingHref, orgSwitchLanding, relationshipSearchHref, resolveIdentity, useChromeFooter, useChromeIdentity, useChromeMode, useChromeState, useChromeUserMenu, useIsSuperAdmin };
|
|
1638
1653
|
//# sourceMappingURL=app-chrome.js.map
|
|
1639
1654
|
//# sourceMappingURL=app-chrome.js.map
|