@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.d.cts CHANGED
@@ -162,11 +162,35 @@ declare function useThemePreference(): {
162
162
  };
163
163
 
164
164
  /**
165
- * Icon slots used by the standard menu. The shell stays icon-library-agnostic:
165
+ * Icon slots used by the standard menus. The shell stays icon-library-agnostic:
166
166
  * callers map each key to their own icon components (lucide, react-icons, …).
167
167
  * A missing key simply renders that row without an icon.
168
168
  */
169
- type StandardNavIconKey = 'home' | 'users' | 'mail' | 'messageSquare' | 'layout' | 'activity' | 'lifeBuoy' | 'grid' | 'list' | 'upload' | 'edit' | 'fileText' | 'send' | 'clock' | 'user' | 'barChart' | 'briefcase' | 'settings' | 'creditCard' | 'dollarSign' | 'share';
169
+ type StandardNavIconKey = 'home' | 'users' | 'mail' | 'messageSquare' | 'layout' | 'activity' | 'lifeBuoy' | 'grid' | 'list' | 'upload' | 'edit' | 'fileText' | 'send' | 'clock' | 'user' | 'barChart' | 'briefcase' | 'settings' | 'creditCard' | 'dollarSign' | 'share' | 'phone' | 'map' | 'mapPin' | 'target' | 'flag';
170
+ /** The operating Mode whose nav tree to build. Defaults to `relationship`. */
171
+ type StandardNavMode = 'relationship' | 'campaign' | 'petition';
172
+ /**
173
+ * Per-feature availability for the Campaign tree. Campaign Mode ships its apps
174
+ * incrementally: a disabled feature is omitted from the nav entirely (rather
175
+ * than rendered as a dead/disabled row), and its flag flips to `true` in a
176
+ * later patch release as the app goes live. Dashboard and Voter Contact are
177
+ * core-hosted and always present, so they carry no flag.
178
+ */
179
+ interface CampaignFeatureAvailability {
180
+ a2p: boolean;
181
+ phonebank: boolean;
182
+ canvass: boolean;
183
+ signs: boolean;
184
+ tribes: boolean;
185
+ polling: boolean;
186
+ }
187
+ /**
188
+ * Launch state at this shell version: Polling Engine (polls app) and Tribes
189
+ * (Contacts app) are live; A2P, Phone Banking, Field Canvassing and Sign
190
+ * Mapping are not yet deployed and stay hidden until their patch release flips
191
+ * the flag.
192
+ */
193
+ declare const CAMPAIGN_FEATURE_AVAILABILITY: CampaignFeatureAvailability;
170
194
  interface StandardNavOptions {
171
195
  /** VRM core origin, e.g. "https://app.politogyvrm.com". Trailing slash OK. */
172
196
  coreBaseUrl: string;
@@ -177,6 +201,7 @@ interface StandardNavOptions {
177
201
  * (NOT absolutized) so the owning app nests its own routes; `href` (also
178
202
  * verbatim) feeds active-detection for the group header. When omitted, the
179
203
  * item carries VRM core's own contacts sub-pages as absolute links.
204
+ * (Relationship tree only.)
180
205
  */
181
206
  contactsItem?: {
182
207
  href?: string;
@@ -185,17 +210,35 @@ interface StandardNavOptions {
185
210
  /**
186
211
  * The trailing "Support" row. VRM core opens its SupportRequestModal here;
187
212
  * other apps supply their own handler (`onClick`) or a link (`href`).
188
- * Omitted or `false` → no Support row.
213
+ * Omitted or `false` → no Support row. Appended to every mode's tree.
189
214
  */
190
215
  supportItem?: {
191
216
  onClick?: () => void;
192
217
  href?: string;
193
218
  } | false;
219
+ /**
220
+ * Which mode's tree to build. Default `relationship`, whose output is
221
+ * byte-for-byte what this function produced before modes existed.
222
+ */
223
+ mode?: StandardNavMode;
224
+ /**
225
+ * Active organization id. Cross-app links in the Campaign/Petition trees
226
+ * carry it as `?org=<last6>` — the same convention the Mode switcher and My
227
+ * Account menu use — so the destination app opens on the same org. The
228
+ * Relationship tree ignores this (its links never carried an org).
229
+ */
230
+ activeOrgId?: string | null;
231
+ /**
232
+ * Per-feature Campaign availability overrides, merged over
233
+ * `CAMPAIGN_FEATURE_AVAILABILITY`. Only meaningful for the Campaign tree.
234
+ */
235
+ campaignAvailability?: Partial<CampaignFeatureAvailability>;
194
236
  }
195
237
  /**
196
- * Build the standard Politogy VRM menu (relationship mode), in the exact order
197
- * and wording the main app renders it. See `StandardNavOptions` for the two
198
- * app-specific hooks (`contactsItem`, `supportItem`).
238
+ * Build the standard Politogy VRM menu for the given `mode` (default
239
+ * `relationship`), in the exact order and wording the main app renders it. See
240
+ * `StandardNavOptions` for the app-specific hooks (`contactsItem`,
241
+ * `supportItem`) and the Campaign inputs (`activeOrgId`, `campaignAvailability`).
199
242
  */
200
243
  declare function standardPolitogyNav(opts: StandardNavOptions): NavItem[];
201
244
 
@@ -518,4 +561,4 @@ type NavAppShellProps = {
518
561
  };
519
562
  declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
520
563
 
521
- export { type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, type StandardNavIconKey, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
564
+ export { CAMPAIGN_FEATURE_AVAILABILITY, type CampaignFeatureAvailability, type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, type StandardNavIconKey, type StandardNavMode, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
package/dist/native.d.ts CHANGED
@@ -162,11 +162,35 @@ declare function useThemePreference(): {
162
162
  };
163
163
 
164
164
  /**
165
- * Icon slots used by the standard menu. The shell stays icon-library-agnostic:
165
+ * Icon slots used by the standard menus. The shell stays icon-library-agnostic:
166
166
  * callers map each key to their own icon components (lucide, react-icons, …).
167
167
  * A missing key simply renders that row without an icon.
168
168
  */
169
- type StandardNavIconKey = 'home' | 'users' | 'mail' | 'messageSquare' | 'layout' | 'activity' | 'lifeBuoy' | 'grid' | 'list' | 'upload' | 'edit' | 'fileText' | 'send' | 'clock' | 'user' | 'barChart' | 'briefcase' | 'settings' | 'creditCard' | 'dollarSign' | 'share';
169
+ type StandardNavIconKey = 'home' | 'users' | 'mail' | 'messageSquare' | 'layout' | 'activity' | 'lifeBuoy' | 'grid' | 'list' | 'upload' | 'edit' | 'fileText' | 'send' | 'clock' | 'user' | 'barChart' | 'briefcase' | 'settings' | 'creditCard' | 'dollarSign' | 'share' | 'phone' | 'map' | 'mapPin' | 'target' | 'flag';
170
+ /** The operating Mode whose nav tree to build. Defaults to `relationship`. */
171
+ type StandardNavMode = 'relationship' | 'campaign' | 'petition';
172
+ /**
173
+ * Per-feature availability for the Campaign tree. Campaign Mode ships its apps
174
+ * incrementally: a disabled feature is omitted from the nav entirely (rather
175
+ * than rendered as a dead/disabled row), and its flag flips to `true` in a
176
+ * later patch release as the app goes live. Dashboard and Voter Contact are
177
+ * core-hosted and always present, so they carry no flag.
178
+ */
179
+ interface CampaignFeatureAvailability {
180
+ a2p: boolean;
181
+ phonebank: boolean;
182
+ canvass: boolean;
183
+ signs: boolean;
184
+ tribes: boolean;
185
+ polling: boolean;
186
+ }
187
+ /**
188
+ * Launch state at this shell version: Polling Engine (polls app) and Tribes
189
+ * (Contacts app) are live; A2P, Phone Banking, Field Canvassing and Sign
190
+ * Mapping are not yet deployed and stay hidden until their patch release flips
191
+ * the flag.
192
+ */
193
+ declare const CAMPAIGN_FEATURE_AVAILABILITY: CampaignFeatureAvailability;
170
194
  interface StandardNavOptions {
171
195
  /** VRM core origin, e.g. "https://app.politogyvrm.com". Trailing slash OK. */
172
196
  coreBaseUrl: string;
@@ -177,6 +201,7 @@ interface StandardNavOptions {
177
201
  * (NOT absolutized) so the owning app nests its own routes; `href` (also
178
202
  * verbatim) feeds active-detection for the group header. When omitted, the
179
203
  * item carries VRM core's own contacts sub-pages as absolute links.
204
+ * (Relationship tree only.)
180
205
  */
181
206
  contactsItem?: {
182
207
  href?: string;
@@ -185,17 +210,35 @@ interface StandardNavOptions {
185
210
  /**
186
211
  * The trailing "Support" row. VRM core opens its SupportRequestModal here;
187
212
  * other apps supply their own handler (`onClick`) or a link (`href`).
188
- * Omitted or `false` → no Support row.
213
+ * Omitted or `false` → no Support row. Appended to every mode's tree.
189
214
  */
190
215
  supportItem?: {
191
216
  onClick?: () => void;
192
217
  href?: string;
193
218
  } | false;
219
+ /**
220
+ * Which mode's tree to build. Default `relationship`, whose output is
221
+ * byte-for-byte what this function produced before modes existed.
222
+ */
223
+ mode?: StandardNavMode;
224
+ /**
225
+ * Active organization id. Cross-app links in the Campaign/Petition trees
226
+ * carry it as `?org=<last6>` — the same convention the Mode switcher and My
227
+ * Account menu use — so the destination app opens on the same org. The
228
+ * Relationship tree ignores this (its links never carried an org).
229
+ */
230
+ activeOrgId?: string | null;
231
+ /**
232
+ * Per-feature Campaign availability overrides, merged over
233
+ * `CAMPAIGN_FEATURE_AVAILABILITY`. Only meaningful for the Campaign tree.
234
+ */
235
+ campaignAvailability?: Partial<CampaignFeatureAvailability>;
194
236
  }
195
237
  /**
196
- * Build the standard Politogy VRM menu (relationship mode), in the exact order
197
- * and wording the main app renders it. See `StandardNavOptions` for the two
198
- * app-specific hooks (`contactsItem`, `supportItem`).
238
+ * Build the standard Politogy VRM menu for the given `mode` (default
239
+ * `relationship`), in the exact order and wording the main app renders it. See
240
+ * `StandardNavOptions` for the app-specific hooks (`contactsItem`,
241
+ * `supportItem`) and the Campaign inputs (`activeOrgId`, `campaignAvailability`).
199
242
  */
200
243
  declare function standardPolitogyNav(opts: StandardNavOptions): NavItem[];
201
244
 
@@ -518,4 +561,4 @@ type NavAppShellProps = {
518
561
  };
519
562
  declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
520
563
 
521
- export { type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, type StandardNavIconKey, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
564
+ export { CAMPAIGN_FEATURE_AVAILABILITY, type CampaignFeatureAvailability, type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, type StandardNavIconKey, type StandardNavMode, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
package/dist/native.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- export { FuelAction, NavAppShell, NavBetaBanner, NavChromeProvider, NavDisplayAction, NavSidebar, NavTabStrip, NavThemeControl, NavTopBar, NotificationsAction, SupportAction, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference } from './chunk-QL5BWYN5.js';
2
+ export { CAMPAIGN_FEATURE_AVAILABILITY, FuelAction, NavAppShell, NavBetaBanner, NavChromeProvider, NavDisplayAction, NavSidebar, NavTabStrip, NavThemeControl, NavTopBar, NotificationsAction, SupportAction, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference } from './chunk-FF6RDQY7.js';
3
3
  import './chunk-NV6WHTEZ.js';
4
4
  import './chunk-LL7RCJQN.js';
5
5
  //# sourceMappingURL=native.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-portland-company/shell",
3
- "version": "0.30.0",
3
+ "version": "0.32.0",
4
4
  "description": "Shared chrome (header, sidebar, footer, theme, auth) for politogy apps. Drop into any Vite SPA to inherit the politogy look and signed-in user.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,