@the-portland-company/shell 0.99.1 → 0.101.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.
- package/CHANGELOG.md +18 -0
- package/dist/app-chrome.cjs +97 -15
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +1 -1
- package/dist/app-chrome.d.ts +1 -1
- package/dist/app-chrome.js +3 -3
- package/dist/{chunk-YMCWLO2L.js → chunk-EERGSGWO.js} +75 -5
- package/dist/chunk-EERGSGWO.js.map +1 -0
- package/dist/{chunk-PQQLCUNO.js → chunk-TESY263C.js} +26 -10
- package/dist/chunk-TESY263C.js.map +1 -0
- package/dist/{index-DhrhpBVm.d.cts → index-CDAqcrTk.d.cts} +24 -1
- package/dist/{index-Di9AyVsU.d.ts → index-xHtlaOSK.d.ts} +24 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/native.cjs +98 -7
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +1 -1
- package/dist/native.d.ts +1 -1
- package/dist/native.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-PQQLCUNO.js.map +0 -1
- package/dist/chunk-YMCWLO2L.js.map +0 -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 NavFooterLink, Q as NavFooter, U as NavDisplayMode } from './index-
|
|
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 NavFooterLink, Q as NavFooter, U as NavDisplayMode } from './index-CDAqcrTk.cjs';
|
|
4
4
|
import './theme-preference.cjs';
|
|
5
5
|
import './brand-favicon.cjs';
|
|
6
6
|
|
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 NavFooterLink, Q as NavFooter, U as NavDisplayMode } from './index-
|
|
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 NavFooterLink, Q as NavFooter, U as NavDisplayMode } from './index-xHtlaOSK.js';
|
|
4
4
|
import './theme-preference.js';
|
|
5
5
|
import './brand-favicon.js';
|
|
6
6
|
|
package/dist/app-chrome.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { broadcastLogout, watchLogout } from './chunk-LL6LSJAH.js';
|
|
3
3
|
import { writeUrlState } from './chunk-GVQKZI5X.js';
|
|
4
|
-
import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell } from './chunk-
|
|
5
|
-
export { standardNavIcons } from './chunk-
|
|
4
|
+
import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell } from './chunk-EERGSGWO.js';
|
|
5
|
+
export { standardNavIcons } from './chunk-EERGSGWO.js';
|
|
6
6
|
import { orgIdTail, ORG_ID_QUERY_PARAM, settingsBaseUrl, authBaseUrl, readOrgSelectorFromUrl, matchOrgSelector, syncOrgIdInUrl, isOrgId, switchActiveOrg, ACTIVE_ORG_QUERY_PARAM, writeActiveOrgCookie, resolveActiveOrg, readActiveOrgCookie } from './chunk-5LO5W7W5.js';
|
|
7
|
-
import { warnDeprecated, NavChromeProvider, FuelAction, NotificationsAction, OrganizationSettingsAction, MyProfileAction, useChromeMe, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-
|
|
7
|
+
import { warnDeprecated, NavChromeProvider, FuelAction, NotificationsAction, OrganizationSettingsAction, MyProfileAction, useChromeMe, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-TESY263C.js';
|
|
8
8
|
import './chunk-BHRVZPZ7.js';
|
|
9
9
|
import { NAV_DISPLAY_DEFAULT, resolveNavDisplay, writeNavDisplayLocal, writeNavDisplayCookie, isNavDisplayPreference, NAV_DISPLAY_STORAGE_KEY, readNavDisplayCookie } from './chunk-7YVJ7HQG.js';
|
|
10
10
|
import { useBrandAssets, BrandFavicon } from './chunk-Q5DTPY5N.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { orgIdTail, authBaseUrl } from './chunk-5LO5W7W5.js';
|
|
2
|
-
import { PageHeaderView, BreadcrumbBarView, resolveOrgLogoUrl, topBarIconButtonClass, TopBarTooltip, TopBarPanelArrow, NavThemeControl, NAV_DISPLAY_OPTIONS, useTopBarIconSlotGlyph, resolveBrandGlyph, TOPBAR_GLYPH_SIZE, resolveTabGlyph, warnDeprecated, SpeculationRulesScript } from './chunk-
|
|
2
|
+
import { PageHeaderView, BreadcrumbBarView, resolveOrgLogoUrl, topBarIconButtonClass, TopBarTooltip, TopBarPanelArrow, NavThemeControl, NAV_DISPLAY_OPTIONS, useTopBarIconSlotGlyph, resolveBrandGlyph, TOPBAR_GLYPH_SIZE, resolveTabGlyph, warnDeprecated, SpeculationRulesScript } from './chunk-TESY263C.js';
|
|
3
3
|
import { readRailPreference, writeRailPreference } from './chunk-7YVJ7HQG.js';
|
|
4
|
-
import { createContext,
|
|
4
|
+
import { createContext, useEffect, useRef, useMemo, useState, Fragment as Fragment$1, useLayoutEffect, useContext } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { LuSignpost, LuDoorOpen, LuChartNoAxesColumn, LuLandmark, LuCrosshair, LuCircleUser, LuClipboardList, LuMousePointerClick, LuUsersRound, LuLayoutDashboard, LuFlag, LuTarget, LuMapPin, LuMap, LuPhone, LuShare2, LuDollarSign, LuCreditCard, LuSettings, LuBriefcase, LuChartColumn, LuUser, LuClock, LuSend, LuFileText, LuPencil, LuUpload, LuList, LuLayoutGrid, LuLifeBuoy, LuActivity, LuMessageSquare, LuMail, LuUsers, LuHouse } from 'react-icons/lu';
|
|
@@ -54,6 +54,75 @@ function shouldShowOrgFilter(count) {
|
|
|
54
54
|
function normalize(s) {
|
|
55
55
|
return s.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().trim();
|
|
56
56
|
}
|
|
57
|
+
var PAGE_KEYS = ["mode", "page", "tab"];
|
|
58
|
+
function pageIdentityOf(pathname, search) {
|
|
59
|
+
const params = new URLSearchParams(search.startsWith("?") ? search.slice(1) : search);
|
|
60
|
+
const path = pathname.length > 1 ? pathname.replace(/\/+$/, "") : pathname;
|
|
61
|
+
return {
|
|
62
|
+
pathname: path || "/",
|
|
63
|
+
mode: params.get("mode") || null,
|
|
64
|
+
page: params.get("page") || null,
|
|
65
|
+
tab: params.get("tab") || null
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function isNewPage(prev, next) {
|
|
69
|
+
if (prev.pathname !== next.pathname) return true;
|
|
70
|
+
return PAGE_KEYS.some((k) => prev[k] !== null && next[k] !== prev[k]);
|
|
71
|
+
}
|
|
72
|
+
function scrollWindowToTop() {
|
|
73
|
+
if (window.scrollX === 0 && window.scrollY === 0) return;
|
|
74
|
+
try {
|
|
75
|
+
window.scrollTo({ top: 0, left: 0, behavior: "instant" });
|
|
76
|
+
} catch {
|
|
77
|
+
window.scrollTo(0, 0);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
var lastIdentity = null;
|
|
81
|
+
var listeners = 0;
|
|
82
|
+
var detach = null;
|
|
83
|
+
function currentIdentity() {
|
|
84
|
+
return pageIdentityOf(window.location.pathname, window.location.search);
|
|
85
|
+
}
|
|
86
|
+
function check(traverse = false) {
|
|
87
|
+
const next = currentIdentity();
|
|
88
|
+
const prev = lastIdentity;
|
|
89
|
+
lastIdentity = next;
|
|
90
|
+
if (!prev || traverse) return;
|
|
91
|
+
if (!isNewPage(prev, next)) return;
|
|
92
|
+
if (window.location.hash) return;
|
|
93
|
+
scrollWindowToTop();
|
|
94
|
+
}
|
|
95
|
+
function attach() {
|
|
96
|
+
const nav = window.navigation;
|
|
97
|
+
if (nav && typeof nav.addEventListener === "function") {
|
|
98
|
+
const onEntryChange = (e) => {
|
|
99
|
+
check(e.navigationType === "traverse");
|
|
100
|
+
};
|
|
101
|
+
nav.addEventListener("currententrychange", onEntryChange);
|
|
102
|
+
return () => nav.removeEventListener("currententrychange", onEntryChange);
|
|
103
|
+
}
|
|
104
|
+
const onPopState = () => check(true);
|
|
105
|
+
window.addEventListener("popstate", onPopState);
|
|
106
|
+
return () => window.removeEventListener("popstate", onPopState);
|
|
107
|
+
}
|
|
108
|
+
var useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
109
|
+
function useScrollToTopOnNewPage() {
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (listeners === 0) detach = attach();
|
|
112
|
+
listeners += 1;
|
|
113
|
+
return () => {
|
|
114
|
+
listeners -= 1;
|
|
115
|
+
if (listeners === 0) {
|
|
116
|
+
detach?.();
|
|
117
|
+
detach = null;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}, []);
|
|
121
|
+
useIsoLayoutEffect(() => {
|
|
122
|
+
if (lastIdentity) check();
|
|
123
|
+
else lastIdentity = currentIdentity();
|
|
124
|
+
});
|
|
125
|
+
}
|
|
57
126
|
function PageHeader(props) {
|
|
58
127
|
return /* @__PURE__ */ jsx(PageHeaderView, { ...props });
|
|
59
128
|
}
|
|
@@ -1945,6 +2014,7 @@ function NavAppShell({
|
|
|
1945
2014
|
children
|
|
1946
2015
|
}) {
|
|
1947
2016
|
useCloseNavDetailsOnOutsideClick();
|
|
2017
|
+
useScrollToTopOnNewPage();
|
|
1948
2018
|
if (contentWrapper === "bare") {
|
|
1949
2019
|
warnDeprecated(
|
|
1950
2020
|
"contentWrapper",
|
|
@@ -2033,6 +2103,6 @@ function NavAppShell({
|
|
|
2033
2103
|
);
|
|
2034
2104
|
}
|
|
2035
2105
|
|
|
2036
|
-
export { BETA_BANNER_DISMISS_KEY, BreadcrumbBar, CAMPAIGN_FEATURE_AVAILABILITY, NavAppShell, NavBetaBanner, NavSidebar, NavTabStrip, NavTopBar, PageHeader, buildLineParts, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, shortEnvLabel, shortUserName, standardNavIcons, standardPolitogyNav };
|
|
2037
|
-
//# sourceMappingURL=chunk-
|
|
2038
|
-
//# sourceMappingURL=chunk-
|
|
2106
|
+
export { BETA_BANNER_DISMISS_KEY, BreadcrumbBar, CAMPAIGN_FEATURE_AVAILABILITY, NavAppShell, NavBetaBanner, NavSidebar, NavTabStrip, NavTopBar, PageHeader, buildLineParts, clearBetaBannerDismissal, envChipClasses, isNavItemActive, isNewPage, modeIdFromLabel, pageIdentityOf, shortEnvLabel, shortUserName, standardNavIcons, standardPolitogyNav, useScrollToTopOnNewPage };
|
|
2107
|
+
//# sourceMappingURL=chunk-EERGSGWO.js.map
|
|
2108
|
+
//# sourceMappingURL=chunk-EERGSGWO.js.map
|