@the-portland-company/shell 0.35.2 → 0.35.3

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
  "use client";
2
- import { standardPolitogyNav, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-HCJVMFLL.js';
2
+ import { standardPolitogyNav, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-HZXYGEEA.js';
3
3
  import './chunk-LL7RCJQN.js';
4
4
  import { createContext, useMemo, useContext, useState, useEffect, useCallback } from 'react';
5
5
  import { DevNotesMenu, createDevNotesClient, DevNotesProvider, DevNotesTaskListModal, DevNotesOverlay } from '@the-portland-company/devnotes';
@@ -1192,10 +1192,10 @@ function useThemePreference() {
1192
1192
 
1193
1193
  // src/native/standardNav.ts
1194
1194
  var CAMPAIGN_FEATURE_AVAILABILITY = {
1195
- a2p: false,
1196
- phonebank: false,
1197
- canvass: false,
1198
- signs: false,
1195
+ a2p: true,
1196
+ phonebank: true,
1197
+ canvass: true,
1198
+ signs: true,
1199
1199
  tribes: true,
1200
1200
  polling: true
1201
1201
  };
@@ -1264,6 +1264,32 @@ var APP_POLLS_CHILDREN = [
1264
1264
  { label: "Command Center", icon: "grid", href: "https://polls.politogyvrm.com/" },
1265
1265
  { label: "New Poll", icon: "edit", href: "https://polls.politogyvrm.com/polls/new" }
1266
1266
  ];
1267
+ var APP_A2P_CHILDREN = [
1268
+ { label: "Dashboard", icon: "grid", path: "dashboard" },
1269
+ { label: "Compose", icon: "edit", path: "compose" },
1270
+ { label: "Recipients", icon: "user", path: "recipients" },
1271
+ { label: "Tech Check", icon: "activity", path: "tech-check" },
1272
+ { label: "Status", icon: "clock", path: "status" },
1273
+ { label: "Conversations", icon: "messageSquare", path: "conversations" }
1274
+ ];
1275
+ var APP_PHONEBANK_CHILDREN = [
1276
+ { label: "Dashboard", icon: "grid", path: "" },
1277
+ { label: "Campaigns", icon: "phone", path: "campaigns" },
1278
+ { label: "Inbound", icon: "messageSquare", path: "inbound" },
1279
+ { label: "Reports", icon: "barChart", path: "reports" }
1280
+ ];
1281
+ var APP_CANVASS_CHILDREN = [
1282
+ { label: "Dashboard", icon: "grid", path: "" },
1283
+ { label: "Campaigns", icon: "target", path: "campaigns" },
1284
+ { label: "Canvassers", icon: "users", path: "canvassers" }
1285
+ ];
1286
+ var APP_SIGNS_CHILDREN = [
1287
+ { label: "Map", icon: "map", path: "" },
1288
+ { label: "Placements", icon: "list", path: "placements" },
1289
+ { label: "Review Queue", icon: "fileText", path: "review" },
1290
+ { label: "Recovery", icon: "flag", path: "recovery" },
1291
+ { label: "Reports", icon: "barChart", path: "reports" }
1292
+ ];
1267
1293
  function standardPolitogyNav(opts) {
1268
1294
  const base = opts.coreBaseUrl.replace(/\/+$/, "");
1269
1295
  const abs = (path) => `${base}${path.startsWith("/") ? path : `/${path}`}`;
@@ -1337,13 +1363,45 @@ function standardPolitogyNav(opts) {
1337
1363
  ...CAMPAIGN_FEATURE_AVAILABILITY,
1338
1364
  ...opts.campaignAvailability
1339
1365
  };
1366
+ const appLeaves = (origin, children) => {
1367
+ const base2 = origin.replace(/\/+$/, "");
1368
+ return children.map((c) => ({
1369
+ label: c.label,
1370
+ icon: icon(c.icon),
1371
+ href: withOrg(c.path ? `${base2}/${c.path}` : `${base2}/`)
1372
+ }));
1373
+ };
1340
1374
  const rows = [
1341
1375
  { label: "Dashboard", icon: icon("home"), href: withOrg(abs("/campaign/dashboard")) },
1342
1376
  { label: "Voter Contact", icon: icon("target"), href: withOrg(abs("/campaign/campaigns")) },
1343
- { label: "A2P", icon: icon("messageSquare"), href: withOrg(A2P_ORIGIN), flag: "a2p" },
1344
- { label: "Phone Banking", icon: icon("phone"), href: withOrg(PHONEBANK_ORIGIN), flag: "phonebank" },
1345
- { label: "Field Canvassing", icon: icon("map"), href: withOrg(CANVASS_ORIGIN), flag: "canvass" },
1346
- { label: "Sign Mapping", icon: icon("mapPin"), href: withOrg(SIGNS_ORIGIN), flag: "signs" },
1377
+ {
1378
+ label: "A2P",
1379
+ icon: icon("messageSquare"),
1380
+ href: withOrg(A2P_ORIGIN),
1381
+ children: appLeaves(A2P_ORIGIN, APP_A2P_CHILDREN),
1382
+ flag: "a2p"
1383
+ },
1384
+ {
1385
+ label: "Phone Banking",
1386
+ icon: icon("phone"),
1387
+ href: withOrg(PHONEBANK_ORIGIN),
1388
+ children: appLeaves(PHONEBANK_ORIGIN, APP_PHONEBANK_CHILDREN),
1389
+ flag: "phonebank"
1390
+ },
1391
+ {
1392
+ label: "Field Canvassing",
1393
+ icon: icon("map"),
1394
+ href: withOrg(CANVASS_ORIGIN),
1395
+ children: appLeaves(CANVASS_ORIGIN, APP_CANVASS_CHILDREN),
1396
+ flag: "canvass"
1397
+ },
1398
+ {
1399
+ label: "Sign Mapping",
1400
+ icon: icon("mapPin"),
1401
+ href: withOrg(SIGNS_ORIGIN),
1402
+ children: appLeaves(SIGNS_ORIGIN, APP_SIGNS_CHILDREN),
1403
+ flag: "signs"
1404
+ },
1347
1405
  { label: "Tribes", icon: icon("users"), href: withOrg(CONTACTS_TRIBES), flag: "tribes" },
1348
1406
  { label: "Polling Engine", icon: icon("barChart"), href: withOrg(POLLS_ORIGIN), flag: "polling" }
1349
1407
  ];
@@ -1366,6 +1424,7 @@ function standardPolitogyNav(opts) {
1366
1424
  }
1367
1425
  var safeHref = (h) => h && /^(https?:|mailto:|tel:|\/|#|\.)/i.test(h.trim()) ? h : "#";
1368
1426
  var DefaultLink = ({ href, children, ...rest }) => /* @__PURE__ */ jsx("a", { href: safeHref(href), ...rest, children });
1427
+ var ACTIVE_IGNORED_PARAMS = /* @__PURE__ */ new Set(["org"]);
1369
1428
  function isNavItemActive(pathname, href) {
1370
1429
  let targetPath = href;
1371
1430
  let targetSearch = "";
@@ -1386,10 +1445,11 @@ function isNavItemActive(pathname, href) {
1386
1445
  targetSearch = href.slice(qi);
1387
1446
  }
1388
1447
  }
1389
- if (targetSearch) {
1448
+ const want = new URLSearchParams(targetSearch);
1449
+ for (const k of ACTIVE_IGNORED_PARAMS) want.delete(k);
1450
+ if (Array.from(want).length > 0) {
1390
1451
  if (typeof window === "undefined") return false;
1391
1452
  if (pathname !== targetPath) return false;
1392
- const want = new URLSearchParams(targetSearch);
1393
1453
  const have = new URLSearchParams(window.location.search);
1394
1454
  for (const [k, v] of want) if (have.get(k) !== v) return false;
1395
1455
  return true;
@@ -2429,5 +2489,5 @@ function NavAppShell({
2429
2489
  }
2430
2490
 
2431
2491
  export { CAMPAIGN_FEATURE_AVAILABILITY, CORE_APP_ORIGIN, CORE_BILLING_PATH, FuelAction, NavAppShell, NavBetaBanner, NavChromeProvider, NavDisplayAction, NavSidebar, NavTabStrip, NavThemeControl, NavTopBar, NotificationsAction, SupportAction, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
2432
- //# sourceMappingURL=chunk-HCJVMFLL.js.map
2433
- //# sourceMappingURL=chunk-HCJVMFLL.js.map
2492
+ //# sourceMappingURL=chunk-HZXYGEEA.js.map
2493
+ //# sourceMappingURL=chunk-HZXYGEEA.js.map