@the-portland-company/shell 0.30.0 → 0.32.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/dist/native.cjs CHANGED
@@ -820,6 +820,21 @@ function useThemePreference() {
820
820
  }
821
821
 
822
822
  // src/native/standardNav.ts
823
+ var CAMPAIGN_FEATURE_AVAILABILITY = {
824
+ a2p: false,
825
+ phonebank: false,
826
+ canvass: false,
827
+ signs: false,
828
+ tribes: true,
829
+ polling: true
830
+ };
831
+ var A2P_ORIGIN = "https://a2p.politogyvrm.com/";
832
+ var PHONEBANK_ORIGIN = "https://phonebank.politogyvrm.com/";
833
+ var CANVASS_ORIGIN = "https://canvass.politogyvrm.com/";
834
+ var SIGNS_ORIGIN = "https://signs.politogyvrm.com/";
835
+ var POLLS_ORIGIN = "https://polls.politogyvrm.com/";
836
+ var CONTACTS_TRIBES = "https://contacts.politogyvrm.com/tribes";
837
+ var PETITION_MODE_ORIGIN = "https://petition-mode.politogyvrm.com/";
823
838
  var CONTACTS_DEFAULT_CHILDREN = [
824
839
  { label: "Dashboard", icon: "grid", path: "/relationship/contacts/dashboard" },
825
840
  { label: "All Contacts", icon: "list", path: "/relationship/contacts/all" },
@@ -870,7 +885,9 @@ var APP_FORMS_CHILDREN = [
870
885
  { label: "Submissions", icon: "fileText", href: "https://forms.politogyvrm.com/?tab=submissions" }
871
886
  ];
872
887
  var APP_SURVEYS_CHILDREN = [
873
- { label: "Surveys", icon: "list", href: "https://surveys.politogyvrm.com/surveys" }
888
+ { label: "Surveys", icon: "list", href: "https://surveys.politogyvrm.com/surveys" },
889
+ { label: "Canvas", icon: "edit", href: "https://surveys.politogyvrm.com/surveys?view=canvas" },
890
+ { label: "Results", icon: "barChart", href: "https://surveys.politogyvrm.com/surveys?view=results" }
874
891
  ];
875
892
  var APP_POLLS_CHILDREN = [
876
893
  { label: "Command Center", icon: "grid", href: "https://polls.politogyvrm.com/" },
@@ -887,59 +904,85 @@ function standardPolitogyNav(opts) {
887
904
  href: abs(c.path),
888
905
  children: c.children ? leaves(c.children) : void 0
889
906
  }));
890
- const contacts = opts.contactsItem ? {
891
- label: "Contacts",
892
- icon: icon("users"),
893
- href: opts.contactsItem.href,
894
- children: opts.contactsItem.children
895
- } : {
896
- label: "Contacts",
897
- icon: icon("users"),
898
- href: abs("/relationship/contacts/dashboard"),
899
- children: leaves(CONTACTS_DEFAULT_CHILDREN)
907
+ const orgParam = opts.activeOrgId ? `org=${opts.activeOrgId.slice(-6)}` : "";
908
+ const withOrg = (url) => orgParam ? `${url}${url.includes("?") ? "&" : "?"}${orgParam}` : url;
909
+ const buildRelationship = () => {
910
+ const contacts = opts.contactsItem ? {
911
+ label: "Contacts",
912
+ icon: icon("users"),
913
+ href: opts.contactsItem.href,
914
+ children: opts.contactsItem.children
915
+ } : {
916
+ label: "Contacts",
917
+ icon: icon("users"),
918
+ href: abs("/relationship/contacts/dashboard"),
919
+ children: leaves(CONTACTS_DEFAULT_CHILDREN)
920
+ };
921
+ return [
922
+ { label: "Dashboard", icon: icon("home"), href: abs("/relationship/dashboard") },
923
+ contacts,
924
+ {
925
+ label: "Email Broadcast",
926
+ icon: icon("mail"),
927
+ href: abs("/relationship/email/dashboard"),
928
+ children: leaves(EMAIL_CHILDREN)
929
+ },
930
+ {
931
+ label: "SMS/MMS Blast",
932
+ icon: icon("messageSquare"),
933
+ href: abs("/relationship/sms-mms-blast/dashboard"),
934
+ children: leaves(SMS_CHILDREN)
935
+ },
936
+ // These two carry no top-level href in VRM core (parent row only toggles).
937
+ { label: "Calls to Action", icon: icon("layout"), children: leaves(CTA_CHILDREN) },
938
+ {
939
+ label: "Forms",
940
+ icon: icon("activity"),
941
+ href: "https://forms.politogyvrm.com/",
942
+ children: APP_FORMS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: c.href }))
943
+ },
944
+ {
945
+ label: "Surveys",
946
+ icon: icon("fileText"),
947
+ href: "https://surveys.politogyvrm.com/surveys",
948
+ children: APP_SURVEYS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: c.href }))
949
+ },
950
+ {
951
+ label: "Polls",
952
+ icon: icon("barChart"),
953
+ href: "https://polls.politogyvrm.com/",
954
+ children: APP_POLLS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: c.href }))
955
+ },
956
+ {
957
+ label: "Organization Settings",
958
+ icon: icon("briefcase"),
959
+ href: abs("/organization-settings"),
960
+ children: branches(ORG_SETTINGS_CHILDREN)
961
+ }
962
+ ];
900
963
  };
901
- const items = [
902
- { label: "Dashboard", icon: icon("home"), href: abs("/relationship/dashboard") },
903
- contacts,
904
- {
905
- label: "Email Broadcast",
906
- icon: icon("mail"),
907
- href: abs("/relationship/email/dashboard"),
908
- children: leaves(EMAIL_CHILDREN)
909
- },
910
- {
911
- label: "SMS/MMS Blast",
912
- icon: icon("messageSquare"),
913
- href: abs("/relationship/sms-mms-blast/dashboard"),
914
- children: leaves(SMS_CHILDREN)
915
- },
916
- // These two carry no top-level href in VRM core (parent row only toggles).
917
- { label: "Calls to Action", icon: icon("layout"), children: leaves(CTA_CHILDREN) },
918
- {
919
- label: "Forms",
920
- icon: icon("activity"),
921
- href: "https://forms.politogyvrm.com/",
922
- children: APP_FORMS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: c.href }))
923
- },
924
- {
925
- label: "Surveys",
926
- icon: icon("fileText"),
927
- href: "https://surveys.politogyvrm.com/surveys",
928
- children: APP_SURVEYS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: c.href }))
929
- },
930
- {
931
- label: "Polls",
932
- icon: icon("barChart"),
933
- href: "https://polls.politogyvrm.com/",
934
- children: APP_POLLS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: c.href }))
935
- },
936
- {
937
- label: "Organization Settings",
938
- icon: icon("briefcase"),
939
- href: abs("/organization-settings"),
940
- children: branches(ORG_SETTINGS_CHILDREN)
941
- }
964
+ const buildCampaign = () => {
965
+ const avail = {
966
+ ...CAMPAIGN_FEATURE_AVAILABILITY,
967
+ ...opts.campaignAvailability
968
+ };
969
+ const rows = [
970
+ { label: "Dashboard", icon: icon("home"), href: withOrg(abs("/campaign/dashboard")) },
971
+ { label: "Voter Contact", icon: icon("target"), href: withOrg(abs("/campaign/campaigns")) },
972
+ { label: "A2P", icon: icon("messageSquare"), href: withOrg(A2P_ORIGIN), flag: "a2p" },
973
+ { label: "Phone Banking", icon: icon("phone"), href: withOrg(PHONEBANK_ORIGIN), flag: "phonebank" },
974
+ { label: "Field Canvassing", icon: icon("map"), href: withOrg(CANVASS_ORIGIN), flag: "canvass" },
975
+ { label: "Sign Mapping", icon: icon("mapPin"), href: withOrg(SIGNS_ORIGIN), flag: "signs" },
976
+ { label: "Tribes", icon: icon("users"), href: withOrg(CONTACTS_TRIBES), flag: "tribes" },
977
+ { label: "Polling Engine", icon: icon("barChart"), href: withOrg(POLLS_ORIGIN), flag: "polling" }
978
+ ];
979
+ return rows.filter((r) => !r.flag || avail[r.flag]).map(({ flag: _flag, ...item }) => item);
980
+ };
981
+ const buildPetition = () => [
982
+ { label: "Dashboard", icon: icon("home"), href: withOrg(PETITION_MODE_ORIGIN) }
942
983
  ];
984
+ const mode = opts.mode ?? "relationship";
985
+ const items = mode === "campaign" ? buildCampaign() : mode === "petition" ? buildPetition() : buildRelationship();
943
986
  if (opts.supportItem) {
944
987
  items.push({
945
988
  label: "Support",
@@ -1938,9 +1981,12 @@ function NavBetaBanner({ text, linkLabel, href }) {
1938
1981
  role: "note",
1939
1982
  className: "w-full border-y px-4 py-2 text-center text-sm",
1940
1983
  style: {
1941
- background: "var(--beta-banner-bg)",
1942
- borderColor: "var(--beta-banner-border)",
1943
- color: "var(--beta-banner-text)"
1984
+ // Warning amber with a darker border + text (HITL 2026-07-23). The
1985
+ // --beta-banner-* tokens were never emitted, so the fallbacks are the
1986
+ // real values: amber-100 fill, amber-500 border, amber-900 text.
1987
+ background: "var(--beta-banner-bg, #FEF3C7)",
1988
+ borderColor: "var(--beta-banner-border, #F59E0B)",
1989
+ color: "var(--beta-banner-text, #78350F)"
1944
1990
  },
1945
1991
  children: [
1946
1992
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: body }),
@@ -1951,7 +1997,7 @@ function NavBetaBanner({ text, linkLabel, href }) {
1951
1997
  target: "_blank",
1952
1998
  rel: "noreferrer",
1953
1999
  className: "font-bold underline",
1954
- style: { color: "var(--beta-banner-text)" },
2000
+ style: { color: "var(--beta-banner-text, #78350F)" },
1955
2001
  children: label
1956
2002
  }
1957
2003
  )
@@ -1996,6 +2042,7 @@ function NavAppShell({
1996
2042
  ] });
1997
2043
  }
1998
2044
 
2045
+ exports.CAMPAIGN_FEATURE_AVAILABILITY = CAMPAIGN_FEATURE_AVAILABILITY;
1999
2046
  exports.FuelAction = FuelAction;
2000
2047
  exports.NavAppShell = NavAppShell;
2001
2048
  exports.NavBetaBanner = NavBetaBanner;