@the-portland-company/shell 0.102.3 → 0.104.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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.103.0
2
+
3
+ There are no subscription levels (Pricing & Metering §4/§14; tiers removed everywhere 2026-11-17, Ben).
4
+
5
+ - **`NavUser.tier` removed.** The top bar and account menu no longer show "tier · role" under the user's name; they show the email, else the role, else "member", as before. Contacts' `/api/me` stopped returning `tier` (politogy-contacts#481) and the apps stopped passing it.
6
+ - **Breaking (type only):** an app that still passes `tier` in its `NavUser` object gets a TypeScript excess-property error on upgrade. Drop the key.
7
+
1
8
  ## 0.102.3
2
9
 
3
10
  No app code change. Release lane fix only: the Publish workflow's last step ("Verify the published version resolves") now waits up to 10 minutes for npm to list the new version, instead of 2. npm has been taking 97-188 s to list a version since 2026-11-14, so releases 0.101.0-0.102.1 showed a false red although they were on npm. The step still fails, and prints npm's answer, when a version truly never appears.
@@ -1916,9 +1916,17 @@ var APP_POLLS_CHILDREN = [
1916
1916
  { label: "Command Center", icon: "grid", href: "https://polls.politogyvrm.com/" },
1917
1917
  { label: "New Poll", icon: "edit", href: "https://polls.politogyvrm.com/polls/new" }
1918
1918
  ];
1919
+ var CTAS_ORIGIN = "https://ctas.politogyvrm.com";
1920
+ var ctaRecordTabs = (...tabs) => tabs.map((t) => `${CTAS_ORIGIN}/cta?tab=${t}`);
1919
1921
  var APP_CTAS_CHILDREN = [
1920
- { label: "CTAs", icon: "list", href: "https://ctas.politogyvrm.com/" },
1921
- { label: "Canvas", icon: "edit", href: "https://ctas.politogyvrm.com/?tab=canvas" }
1922
+ {
1923
+ label: "Calls to action",
1924
+ icon: "list",
1925
+ href: `${CTAS_ORIGIN}/?tab=ctas`,
1926
+ activeOn: ctaRecordTabs("builder", "placement", "audience", "experiments")
1927
+ },
1928
+ { label: "Performance", icon: "barChart", href: `${CTAS_ORIGIN}/?tab=analytics`, activeOn: ctaRecordTabs("performance") },
1929
+ { label: "Settings", icon: "settings", href: `${CTAS_ORIGIN}/?tab=site-keys`, activeOn: ctaRecordTabs("settings") }
1922
1930
  ];
1923
1931
  var APP_A2P_CHILDREN = [
1924
1932
  { label: "Dashboard", icon: "grid", path: "dashboard" },
@@ -2034,7 +2042,10 @@ function standardPolitogyNav(opts) {
2034
2042
  label: "Calls to action",
2035
2043
  icon: icon("mousePointerClick"),
2036
2044
  href: withOrg("https://ctas.politogyvrm.com/"),
2037
- children: APP_CTAS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: withOrg(c.href) }))
2045
+ // Every page on the CTAs host belongs to this row (§11.3), including
2046
+ // an open CTA at /cta/<id>.
2047
+ activeOn: [`${CTAS_ORIGIN}/`],
2048
+ children: APP_CTAS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: withOrg(c.href), activeOn: c.activeOn }))
2038
2049
  },
2039
2050
  {
2040
2051
  label: "Forms",
@@ -2177,6 +2188,36 @@ function isNavItemActive(pathname, href) {
2177
2188
  if (targetPath === "/") return pathname === "/";
2178
2189
  return pathname === targetPath || pathname.startsWith(`${targetPath}/`);
2179
2190
  }
2191
+ function isUnderNavPattern(pathname, pattern) {
2192
+ let targetPath = pattern;
2193
+ let targetSearch = "";
2194
+ if (/^https?:\/\//i.test(pattern)) {
2195
+ if (typeof window === "undefined") return false;
2196
+ try {
2197
+ const u = new URL(pattern);
2198
+ if (u.host !== window.location.host) return false;
2199
+ targetPath = u.pathname;
2200
+ targetSearch = u.search;
2201
+ } catch {
2202
+ return false;
2203
+ }
2204
+ } else {
2205
+ const qi = pattern.indexOf("?");
2206
+ if (qi >= 0) {
2207
+ targetPath = pattern.slice(0, qi) || "/";
2208
+ targetSearch = pattern.slice(qi);
2209
+ }
2210
+ }
2211
+ const underPath = targetPath === "/" || pathname === targetPath || pathname.startsWith(`${targetPath.replace(/\/$/, "")}/`);
2212
+ if (!underPath) return false;
2213
+ const want = new URLSearchParams(targetSearch);
2214
+ for (const k of ACTIVE_IGNORED_PARAMS) want.delete(k);
2215
+ if (Array.from(want).length === 0) return true;
2216
+ if (typeof window === "undefined") return false;
2217
+ const have = new URLSearchParams(window.location.search);
2218
+ for (const [k, v] of want) if (have.get(k) !== v) return false;
2219
+ return true;
2220
+ }
2180
2221
  function groupKeyOf(item, index) {
2181
2222
  return item.href ?? `nav-group-${index}-${item.label}`;
2182
2223
  }
@@ -3027,7 +3068,7 @@ function NavTopBar({
3027
3068
  const hasRealName = rawName.length > 0 && !rawName.includes("@");
3028
3069
  const displayName = hasRealName ? formatFirstLast(rawName) : user?.email ?? "Signed in";
3029
3070
  const initials = (hasRealName ? rawName : user?.email ?? "P").slice(0, 2).toUpperCase();
3030
- const secondary = hasRealName ? user?.email || [user?.tier, user?.role].filter(Boolean).join(" \xB7 ") || "member" : [user?.tier, user?.role].filter(Boolean).join(" \xB7 ") || "member";
3071
+ const secondary = hasRealName ? user?.email || user?.role || "member" : user?.role || "member";
3031
3072
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sticky top-0 z-20", children: [
3032
3073
  /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex min-w-0 h-[var(--topbar-height,60px)] items-center justify-between gap-[8px] md:gap-[14px] border-b border-[color:var(--line)] bg-[color:var(--panel)] px-[var(--topbar-padding-x,20px)]", children: [
3033
3074
  onOpenNav ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -3288,7 +3329,7 @@ function NavSidebarUserCard({
3288
3329
  const hasRealName = rawName.length > 0 && !rawName.includes("@");
3289
3330
  const displayName = hasRealName ? shortUserName(rawName) : user.email ?? "Signed in";
3290
3331
  const initials = hasRealName ? rawName.split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0]).join("").toUpperCase() : (user.email ?? "P").slice(0, 2).toUpperCase();
3291
- const secondary = hasRealName ? user.email || [user.tier, user.role].filter(Boolean).join(" \xB7 ") || "member" : [user.tier, user.role].filter(Boolean).join(" \xB7 ") || "member";
3332
+ const secondary = hasRealName ? user.email || user.role || "member" : user.role || "member";
3292
3333
  const rc = useRailCollapse();
3293
3334
  return /* @__PURE__ */ jsxRuntime.jsxs("details", { "data-nav-details": true, className: "group/acct relative", children: [
3294
3335
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4586,18 +4627,33 @@ function FrameBody({
4586
4627
  const navItems = core?.nav ?? derivedNavItems;
4587
4628
  const navIsActive = react.useMemo(() => {
4588
4629
  const childHrefs = /* @__PURE__ */ new Map();
4630
+ const extra = /* @__PURE__ */ new Map();
4631
+ const addExtra = (href, pats) => {
4632
+ if (!pats?.length) return;
4633
+ extra.set(href, [...extra.get(href) ?? [], ...pats]);
4634
+ };
4589
4635
  for (const item of navItems) {
4590
- if (!item.href || !item.children?.length) continue;
4636
+ if (!item.href) continue;
4637
+ addExtra(item.href, item.activeOn);
4638
+ if (!item.children?.length) continue;
4591
4639
  const hrefs = [];
4592
4640
  for (const child of item.children) {
4593
- if (child.href) hrefs.push(child.href);
4641
+ if (child.href) {
4642
+ hrefs.push(child.href);
4643
+ addExtra(child.href, child.activeOn);
4644
+ }
4645
+ addExtra(item.href, child.activeOn);
4594
4646
  for (const leaf of child.children ?? []) {
4595
- if (leaf.href) hrefs.push(leaf.href);
4647
+ if (leaf.href) {
4648
+ hrefs.push(leaf.href);
4649
+ addExtra(leaf.href, leaf.activeOn);
4650
+ }
4651
+ addExtra(item.href, leaf.activeOn);
4596
4652
  }
4597
4653
  }
4598
4654
  childHrefs.set(item.href, hrefs);
4599
4655
  }
4600
- return (pathname2, href) => isNavItemActive(pathname2, href) || (childHrefs.get(href) ?? []).some((h) => isNavItemActive(pathname2, h));
4656
+ return (pathname2, href) => isNavItemActive(pathname2, href) || (childHrefs.get(href) ?? []).some((h) => isNavItemActive(pathname2, h)) || (extra.get(href) ?? []).some((p) => isUnderNavPattern(pathname2, p));
4601
4657
  }, [navItems]);
4602
4658
  const derivedBreadcrumbs = react.useMemo(
4603
4659
  () => deriveBreadcrumbs(navItems, pathname, { search, origin: meta.origin }),