@the-portland-company/shell 0.96.2 → 0.97.1

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,5 +1,5 @@
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-537NZZVP.js';
2
+ import { PageHeaderView, BreadcrumbBarView, resolveOrgLogoUrl, topBarIconButtonClass, TopBarTooltip, TopBarPanelArrow, NavThemeControl, NAV_DISPLAY_OPTIONS, useTopBarIconSlotGlyph, resolveBrandGlyph, TOPBAR_GLYPH_SIZE, resolveTabGlyph, warnDeprecated, SpeculationRulesScript } from './chunk-XPTC47TY.js';
3
3
  import { readRailPreference, writeRailPreference } from './chunk-7YVJ7HQG.js';
4
4
  import { createContext, useRef, useEffect, useMemo, useState, Fragment as Fragment$1, useContext } from 'react';
5
5
  import clsx from 'clsx';
@@ -241,13 +241,14 @@ function standardPolitogyNav(opts) {
241
241
  });
242
242
  };
243
243
  const accountRows = () => [
244
- { kind: "section", label: "Account" },
244
+ { kind: "section", label: "Account", railHidden: true },
245
245
  // My Profile moved to the Politogy ID account app (auth.politogyvrm.com)
246
246
  // with the retirement of app.politogyvrm.com.
247
- { label: "My profile", icon: icon("circleUser"), href: withOrg(`${AUTH_ORIGIN}my-profile`) },
247
+ { label: "My profile", icon: icon("circleUser"), href: withOrg(`${AUTH_ORIGIN}my-profile`), railHidden: true },
248
248
  {
249
249
  label: "Organization settings",
250
250
  icon: icon("settings"),
251
+ railHidden: true,
251
252
  // Organization settings moved to the standalone Settings app
252
253
  // (settings.politogyvrm.com, Specs/Organization-Settings v12).
253
254
  href: withOrg(`${SETTINGS_ORIGIN}organization-settings`),
@@ -483,6 +484,33 @@ function shortEnvLabel(label) {
483
484
  if (l === "development") return "dev";
484
485
  return l;
485
486
  }
487
+ function buildLineParts(meta) {
488
+ const version = meta.version ? `v${meta.version.replace(/^v/, "")}` : null;
489
+ const parsed = meta.commitDate ? new Date(meta.commitDate) : null;
490
+ const date = parsed && !Number.isNaN(parsed.getTime()) ? parsed.toLocaleDateString(void 0, { month: "short", day: "numeric" }) : null;
491
+ const line = [version, date].filter(Boolean).join(" \xB7 ");
492
+ const detail = [
493
+ meta.envLabel ? shortEnvLabel(meta.envLabel) : null,
494
+ meta.commit ? meta.commit.slice(0, 12) : null,
495
+ version,
496
+ date,
497
+ meta.commitAuthor ? meta.commitAuthor.split(/\s+/)[0] : null
498
+ ].filter(Boolean).join(" | ");
499
+ return { line, detail };
500
+ }
501
+ function ShellBuildLine({ footer, hidden }) {
502
+ const { line, detail } = buildLineParts(footer);
503
+ if (!line && !detail) return null;
504
+ return /* @__PURE__ */ jsx(
505
+ "div",
506
+ {
507
+ "data-shell-meta": true,
508
+ title: detail,
509
+ className: `mt-1.5 truncate text-center font-[family-name:var(--font-mono,ui-monospace,monospace)] text-[10px] leading-[1.2] text-[color:var(--sidebar-row-text,rgba(255,255,255,0.66))] ${hidden}`,
510
+ children: line || detail
511
+ }
512
+ );
513
+ }
486
514
  function envChipClasses(label) {
487
515
  const l = label.toLowerCase();
488
516
  if (l === "production" || l === "prod")
@@ -904,7 +932,7 @@ function NavSidebar({
904
932
  ] }),
905
933
  /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col overflow-y-auto px-[10px] py-3", children: /* @__PURE__ */ jsxs("nav", { className: "flex flex-col gap-0.5", children: [
906
934
  nav.groupLabel ? /* @__PURE__ */ jsx("p", { className: `${NAV_EYEBROW_CLASS} px-2 pb-1.5 pt-1 ${rc("max-md:hidden")}`, children: nav.groupLabel }) : null,
907
- nav.items.map((item, idx) => {
935
+ nav.items.filter((item) => !item.railHidden).map((item, idx) => {
908
936
  if (item.kind === "section") {
909
937
  return /* @__PURE__ */ jsx(
910
938
  NavSectionRow,
@@ -985,31 +1013,7 @@ function NavSidebar({
985
1013
  }
986
1014
  )
987
1015
  ] }, l.label)) }) : null,
988
- footer.envLabel || footer.commit || footer.version ? /* @__PURE__ */ jsxs(
989
- "div",
990
- {
991
- "data-shell-meta": true,
992
- className: `mt-1.5 flex flex-col items-center gap-0.5 font-[family-name:var(--font-mono,ui-monospace,monospace)] text-[11px] text-[color:var(--sidebar-meta-text,rgba(255,255,255,0.72))] ${rc("max-md:hidden")}`,
993
- children: [
994
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5", children: [
995
- footer.envLabel ? shortEnvLabel(footer.envLabel) : null,
996
- footer.commit ? footer.commit.slice(-4) : null,
997
- footer.version ? `v${footer.version.replace(/^v/, "")}` : null
998
- ].filter((v) => Boolean(v)).map((v, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
999
- i > 0 ? /* @__PURE__ */ jsx("span", { children: "|" }) : null,
1000
- /* @__PURE__ */ jsx("span", { children: v })
1001
- ] }, i)) }),
1002
- footer.commitDate || footer.commitAuthor ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1003
- footer.commitDate ? /* @__PURE__ */ jsx("span", { children: new Date(footer.commitDate).toLocaleDateString(void 0, {
1004
- month: "short",
1005
- day: "numeric"
1006
- }) }) : null,
1007
- footer.commitDate && footer.commitAuthor ? /* @__PURE__ */ jsx("span", { children: "|" }) : null,
1008
- footer.commitAuthor ? /* @__PURE__ */ jsx("span", { children: footer.commitAuthor.split(/\s+/)[0] }) : null
1009
- ] }) : null
1010
- ]
1011
- }
1012
- ) : null
1016
+ footer.envLabel || footer.commit || footer.version ? /* @__PURE__ */ jsx(ShellBuildLine, { footer, hidden: rc("max-md:hidden") }) : null
1013
1017
  ] }) : null
1014
1018
  ]
1015
1019
  }
@@ -2029,6 +2033,6 @@ function NavAppShell({
2029
2033
  );
2030
2034
  }
2031
2035
 
2032
- export { BETA_BANNER_DISMISS_KEY, BreadcrumbBar, CAMPAIGN_FEATURE_AVAILABILITY, NavAppShell, NavBetaBanner, NavSidebar, NavTabStrip, NavTopBar, PageHeader, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, shortEnvLabel, shortUserName, standardNavIcons, standardPolitogyNav };
2033
- //# sourceMappingURL=chunk-SKXBGQ33.js.map
2034
- //# sourceMappingURL=chunk-SKXBGQ33.js.map
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-5IRZD6GF.js.map
2038
+ //# sourceMappingURL=chunk-5IRZD6GF.js.map