@aglyn/aglyn 1.0.0-beta.277 → 1.0.0-beta.283

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.
Files changed (95) hide show
  1. package/package.json +11 -11
  2. package/src/lib/app-utils/account-preferences.d.ts +146 -11
  3. package/src/lib/app-utils/account-preferences.js +266 -18
  4. package/src/lib/app-utils/account-preferences.js.map +1 -1
  5. package/src/lib/app-utils/activity-presenter.js +2 -26
  6. package/src/lib/app-utils/activity-presenter.js.map +1 -1
  7. package/src/lib/app-utils/activity-type-labels.d.ts +18 -0
  8. package/src/lib/app-utils/activity-type-labels.js +46 -0
  9. package/src/lib/app-utils/activity-type-labels.js.map +1 -0
  10. package/src/lib/app-utils/artifact-provenance.d.ts +3 -1
  11. package/src/lib/app-utils/artifact-provenance.js.map +1 -1
  12. package/src/lib/app-utils/bundle-intent.d.ts +37 -0
  13. package/src/lib/app-utils/bundle-intent.js +47 -3
  14. package/src/lib/app-utils/bundle-intent.js.map +1 -1
  15. package/src/lib/app-utils/compose-reusable-components.d.ts +17 -1
  16. package/src/lib/app-utils/compose-reusable-components.js +80 -5
  17. package/src/lib/app-utils/compose-reusable-components.js.map +1 -1
  18. package/src/lib/app-utils/docs-help-sections.generated.js +13 -1
  19. package/src/lib/app-utils/docs-help-sections.generated.js.map +1 -1
  20. package/src/lib/app-utils/docs-help.generated.d.ts +23 -11
  21. package/src/lib/app-utils/docs-help.generated.js +64 -7
  22. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  23. package/src/lib/app-utils/docs-index.generated.js +359 -51
  24. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  25. package/src/lib/app-utils/error-beacon.d.ts +19 -0
  26. package/src/lib/app-utils/error-beacon.js +28 -0
  27. package/src/lib/app-utils/error-beacon.js.map +1 -1
  28. package/src/lib/app-utils/health-report.d.ts +3 -2
  29. package/src/lib/app-utils/health-report.js +22 -2
  30. package/src/lib/app-utils/health-report.js.map +1 -1
  31. package/src/lib/app-utils/native-nav.d.ts +39 -4
  32. package/src/lib/app-utils/native-nav.js +69 -3
  33. package/src/lib/app-utils/native-nav.js.map +1 -1
  34. package/src/lib/app-utils/native-themes.d.ts +28 -17
  35. package/src/lib/app-utils/native-themes.js +123 -45
  36. package/src/lib/app-utils/native-themes.js.map +1 -1
  37. package/src/lib/app-utils/operator-alerts.js +4 -2
  38. package/src/lib/app-utils/operator-alerts.js.map +1 -1
  39. package/src/lib/app-utils/org-permission-editor.d.ts +75 -0
  40. package/src/lib/app-utils/org-permission-editor.js +124 -0
  41. package/src/lib/app-utils/org-permission-editor.js.map +1 -0
  42. package/src/lib/app-utils/org-permissions.d.ts +36 -0
  43. package/src/lib/app-utils/org-permissions.js +78 -26
  44. package/src/lib/app-utils/org-permissions.js.map +1 -1
  45. package/src/lib/app-utils/org-role-grants.d.ts +59 -9
  46. package/src/lib/app-utils/org-role-grants.js +97 -10
  47. package/src/lib/app-utils/org-role-grants.js.map +1 -1
  48. package/src/lib/app-utils/plan-entitlements.d.ts +13 -0
  49. package/src/lib/app-utils/plan-entitlements.js +22 -0
  50. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  51. package/src/lib/app-utils/release-flags.d.ts +52 -1
  52. package/src/lib/app-utils/release-flags.js +68 -2
  53. package/src/lib/app-utils/release-flags.js.map +1 -1
  54. package/src/lib/app-utils/reusable-component-keys.d.ts +13 -0
  55. package/src/lib/app-utils/reusable-component-keys.js +12 -0
  56. package/src/lib/app-utils/reusable-component-keys.js.map +1 -1
  57. package/src/lib/app-utils/screen-analytics-aggregate.d.ts +34 -0
  58. package/src/lib/app-utils/screen-analytics-aggregate.js +37 -0
  59. package/src/lib/app-utils/screen-analytics-aggregate.js.map +1 -1
  60. package/src/lib/app-utils/site-care.d.ts +35 -0
  61. package/src/lib/app-utils/site-care.js +48 -0
  62. package/src/lib/app-utils/site-care.js.map +1 -1
  63. package/src/lib/app-utils/site-font-pairings.d.ts +59 -0
  64. package/src/lib/app-utils/site-font-pairings.js +514 -0
  65. package/src/lib/app-utils/site-font-pairings.js.map +1 -0
  66. package/src/lib/app-utils/site-starter.d.ts +136 -0
  67. package/src/lib/app-utils/site-starter.js +116 -0
  68. package/src/lib/app-utils/site-starter.js.map +1 -0
  69. package/src/lib/app-utils/stock-photos/stock-photo-picker-server.d.ts +95 -0
  70. package/src/lib/app-utils/stock-photos/stock-photo-picker-server.js +333 -0
  71. package/src/lib/app-utils/stock-photos/stock-photo-picker-server.js.map +1 -0
  72. package/src/lib/app-utils/stock-photos/stock-photo-picker.d.ts +188 -0
  73. package/src/lib/app-utils/stock-photos/stock-photo-picker.js +193 -0
  74. package/src/lib/app-utils/stock-photos/stock-photo-picker.js.map +1 -0
  75. package/src/lib/plugin-manager/feature-plugins.d.ts +32 -0
  76. package/src/lib/plugin-manager/feature-plugins.js +12 -0
  77. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  78. package/src/lib/plugin-manager/first-party-plugins.generated.js +27 -1
  79. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  80. package/src/lib/plugin-manager/plugin-entitlements.d.ts +37 -0
  81. package/src/lib/plugin-manager/plugin-entitlements.js +84 -2
  82. package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -1
  83. package/src/lib/plugin-manager/plugin-media-ingest.d.ts +15 -0
  84. package/src/lib/plugin-manager/plugin-media-ingest.js.map +1 -1
  85. package/src/lib/plugin-manager/plugin-permissions.d.ts +7 -0
  86. package/src/lib/plugin-manager/plugin-permissions.js.map +1 -1
  87. package/src/lib/plugin-manager/plugin-product-catalog.d.ts +12 -0
  88. package/src/lib/plugin-manager/plugin-product-catalog.js.map +1 -1
  89. package/src/lib/plugin-manager/plugin-site-starters.d.ts +73 -0
  90. package/src/lib/plugin-manager/plugin-site-starters.js +30 -0
  91. package/src/lib/plugin-manager/plugin-site-starters.js.map +1 -0
  92. package/src/lib/plugin-manager/plugin-sitemap-sections.d.ts +8 -1
  93. package/src/lib/plugin-manager/plugin-sitemap-sections.js.map +1 -1
  94. package/src/lib/plugin-manager/stock-photo-provider.d.ts +12 -0
  95. package/src/lib/plugin-manager/stock-photo-provider.js.map +1 -1
@@ -21,7 +21,7 @@
21
21
  * sidebar for the whole workspace, the sidebar inside one site, and the two
22
22
  * settings modes (the workspace's, and the site's, which merges the
23
23
  * console's Setup and Admin). Zach chose the site's groups on 2026-10-18:
24
- * an Overview row, Starred, Website, Sell, Customers, More, Site settings.
24
+ * an Analytics row, Starred, Website, Sell, Customers, More, Site settings.
25
25
  *
26
26
  * Every row names:
27
27
  * - the console's word for it (`label`), held to the console by
@@ -33,7 +33,7 @@
33
33
  * - the plugin it belongs to, so it hides when that plugin is off for the
34
34
  * workspace or the site.
35
35
  *
36
- * The core's own rows (Home, Overview, Sites, Pages, Media, the settings
36
+ * The core's own rows (Home, Analytics, Sites, Pages, Media, the settings
37
37
  * modes) are here; a plugin's rows are its own, in
38
38
  * `libs/plugins/<plugin>/src/lib/native-nav.ts` (`NATIVE_NAV_ROWS`), placed
39
39
  * into a list's group by `order` (docs/PACKAGES.md rule 3: the core never
@@ -65,7 +65,7 @@ export interface NativeNavIcon {
65
65
  * - `hostAdminSection`, `orgSettingsSection`, `teamSection`,
66
66
  * `billingSection`: a section of those hubs, by its `Route` name;
67
67
  * - `consoleWidget`: a plugin's card, as `{slot}/{widgetId}`;
68
- * - `shell`: a place the app's shell owns (Home, Overview's page, the
68
+ * - `shell`: a place the app's shell owns (Home, Analytics' page, the
69
69
  * settings modes), whose console twin is the page named in `id`;
70
70
  * - `nativeOnly`: a native screen the console has no page for.
71
71
  */
@@ -101,7 +101,7 @@ export interface NativeNavRow {
101
101
  label: string;
102
102
  /**
103
103
  * The console's word when the native label is a decision of its own
104
- * (Overview for the site's analytics, Zach 2026-10-18).
104
+ * (a row the apps name differently from the console).
105
105
  */
106
106
  consoleLabel?: string;
107
107
  icon: NativeNavIcon;
@@ -263,3 +263,38 @@ export interface ResolvedNavList {
263
263
  * dropped, except the starred group, which the shell fills.
264
264
  */
265
265
  export declare function resolveNavList(manifest: NativeNavManifest, listId: NativeNavListId, enabledPluginIds: readonly string[], hostAdmin: boolean): ResolvedNavList;
266
+ /**
267
+ * A group's heading on the phone's Home where it differs from the sidebar's.
268
+ * Nothing on the phone reads "More", so the sidebar's More
269
+ * group is headed Tools there.
270
+ */
271
+ export declare const PHONE_HOME_GROUP_LABELS: Record<string, string>;
272
+ /** The heading of the phone Home's last group: inside a site, and for the whole workspace. */
273
+ export declare const PHONE_HOME_SITE_GROUP_LABEL = "Site & workspace";
274
+ export declare const PHONE_HOME_WORKSPACE_GROUP_LABEL = "Settings";
275
+ /** The Team tile's word: the console's tab for Members, Custom roles and Recent activity. */
276
+ export declare const PHONE_HOME_TEAM_LABEL = "Team";
277
+ /** The tile that opens Workspace settings on the phone's Home. */
278
+ export declare const WORKSPACE_SETTINGS_ROW: NativeNavRow;
279
+ /** One group of tiles on the phone's Home. */
280
+ export interface PhoneHomeGroup {
281
+ id: string;
282
+ /** Absent for a group drawn without a heading. */
283
+ label?: string;
284
+ rows: NativeNavRow[];
285
+ }
286
+ /**
287
+ * The phone's Home: every area of the scope as the same
288
+ * tile, in the sidebar's own groups, then the scope's own places last
289
+ * (Overview and Site settings in a site; Team and Workspace settings
290
+ * everywhere). Nothing is ranked above anything else and nothing sits behind
291
+ * a More.
292
+ *
293
+ * `list` is the scope's everyday list as the app shows it (`resolveNavList`
294
+ * trimmed to the build's screens), `team` the workspace settings' Members row
295
+ * when the person may open it, and `ownerName` heads the whole workspace's
296
+ * areas, whose group has no heading of its own.
297
+ */
298
+ export declare function phoneHomeGroups(list: ResolvedNavList, team: NativeNavRow | null, ownerName: string): PhoneHomeGroup[];
299
+ /** Whether a Home tile may go in the tab bar: an area, never Home itself or a settings mode. */
300
+ export declare function isTabPinnable(row: Pick<NativeNavRow, 'screen'>): boolean;
@@ -20,7 +20,7 @@
20
20
  * sidebar for the whole workspace, the sidebar inside one site, and the two
21
21
  * settings modes (the workspace's, and the site's, which merges the
22
22
  * console's Setup and Admin). Zach chose the site's groups on 2026-10-18:
23
- * an Overview row, Starred, Website, Sell, Customers, More, Site settings.
23
+ * an Analytics row, Starred, Website, Sell, Customers, More, Site settings.
24
24
  *
25
25
  * Every row names:
26
26
  * - the console's word for it (`label`), held to the console by
@@ -32,7 +32,7 @@
32
32
  * - the plugin it belongs to, so it hides when that plugin is off for the
33
33
  * workspace or the site.
34
34
  *
35
- * The core's own rows (Home, Overview, Sites, Pages, Media, the settings
35
+ * The core's own rows (Home, Analytics, Sites, Pages, Media, the settings
36
36
  * modes) are here; a plugin's rows are its own, in
37
37
  * `libs/plugins/<plugin>/src/lib/native-nav.ts` (`NATIVE_NAV_ROWS`), placed
38
38
  * into a list's group by `order` (docs/PACKAGES.md rule 3: the core never
@@ -164,7 +164,8 @@ const SITE = {
164
164
  HOME_ROW,
165
165
  {
166
166
  id: 'overview',
167
- label: 'Overview',
167
+ // "Analytics", the console's own word: "Overview" read as a second Home (AGL-4011).
168
+ label: 'Analytics',
168
169
  consoleLabel: 'Analytics',
169
170
  icon: ICONS.overview,
170
171
  screen: 'shell.analytics',
@@ -737,5 +738,70 @@ export const NATIVE_CREATE_PLAN_REASON = "Your plan doesn't include this. See th
737
738
  groups
738
739
  });
739
740
  }
741
+ // ── The phone's Home (AGL-4006) ─────────────────────────────────────────────
742
+ /**
743
+ * A group's heading on the phone's Home where it differs from the sidebar's.
744
+ * Nothing on the phone reads "More", so the sidebar's More
745
+ * group is headed Tools there.
746
+ */ export const PHONE_HOME_GROUP_LABELS = {
747
+ more: 'Tools'
748
+ };
749
+ /** The heading of the phone Home's last group: inside a site, and for the whole workspace. */ export const PHONE_HOME_SITE_GROUP_LABEL = 'Site & workspace';
750
+ export const PHONE_HOME_WORKSPACE_GROUP_LABEL = 'Settings';
751
+ /** The Team tile's word: the console's tab for Members, Custom roles and Recent activity. */ export const PHONE_HOME_TEAM_LABEL = 'Team';
752
+ /** The tile that opens Workspace settings on the phone's Home. */ export const WORKSPACE_SETTINGS_ROW = {
753
+ id: 'workspaceSettings',
754
+ label: 'Workspace settings',
755
+ icon: ICONS.profile,
756
+ screen: 'shell.workspaceSettings',
757
+ console: ref('shell', 'workspaceSettings')
758
+ };
759
+ /**
760
+ * The phone's Home: every area of the scope as the same
761
+ * tile, in the sidebar's own groups, then the scope's own places last
762
+ * (Overview and Site settings in a site; Team and Workspace settings
763
+ * everywhere). Nothing is ranked above anything else and nothing sits behind
764
+ * a More.
765
+ *
766
+ * `list` is the scope's everyday list as the app shows it (`resolveNavList`
767
+ * trimmed to the build's screens), `team` the workspace settings' Members row
768
+ * when the person may open it, and `ownerName` heads the whole workspace's
769
+ * areas, whose group has no heading of its own.
770
+ */ export function phoneHomeGroups(list, team, ownerName) {
771
+ const inSite = list.id === 'site';
772
+ const own = [];
773
+ const groups = [];
774
+ for (const group of list.groups){
775
+ var _ref, _PHONE_HOME_GROUP_LABELS_group_id;
776
+ if (group.dynamic) continue;
777
+ const rows = group.rows.filter((row)=>row.screen !== 'shell.home');
778
+ if (group.id === 'top' || group.id === 'settings') {
779
+ own.push(...rows);
780
+ continue;
781
+ }
782
+ if (!rows.length) continue;
783
+ const label = (_ref = (_PHONE_HOME_GROUP_LABELS_group_id = PHONE_HOME_GROUP_LABELS[group.id]) != null ? _PHONE_HOME_GROUP_LABELS_group_id : group.label) != null ? _ref : ownerName || undefined;
784
+ groups.push(_extends({
785
+ id: group.id
786
+ }, label ? {
787
+ label
788
+ } : {}, {
789
+ rows
790
+ }));
791
+ }
792
+ if (team) own.push(_extends({}, team, {
793
+ label: PHONE_HOME_TEAM_LABEL
794
+ }));
795
+ own.push(WORKSPACE_SETTINGS_ROW);
796
+ groups.push({
797
+ id: 'scope',
798
+ label: inSite ? PHONE_HOME_SITE_GROUP_LABEL : PHONE_HOME_WORKSPACE_GROUP_LABEL,
799
+ rows: own
800
+ });
801
+ return groups;
802
+ }
803
+ /** Whether a Home tile may go in the tab bar: an area, never Home itself or a settings mode. */ export function isTabPinnable(row) {
804
+ return row.screen !== 'shell.home' && row.screen !== 'shell.workspaceSettings' && row.screen !== 'shell.siteSettings';
805
+ }
740
806
 
741
807
  //# sourceMappingURL=native-nav.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/native-nav.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * THE NATIVE APPS' NAVIGATION, AS DATA (AGL-3943).\n *\n * One manifest both shells draw (docs/mobile/native-navigation.md): the\n * sidebar for the whole workspace, the sidebar inside one site, and the two\n * settings modes (the workspace's, and the site's, which merges the\n * console's Setup and Admin). Zach chose the site's groups on 2026-10-18:\n * an Overview row, Starred, Website, Sell, Customers, More, Site settings.\n *\n * Every row names:\n * - the console's word for it (`label`), held to the console by\n * `apps/console/specs/native-nav-manifest.spec.ts`, which reads the\n * console's own tabs, sections and plugin declarations;\n * - one icon per idea, an SF Symbol and a Material Symbol;\n * - the native screen it opens (a plugin's declared screen, a core screen\n * spec, a site platform screen or a `shell.*` destination);\n * - the plugin it belongs to, so it hides when that plugin is off for the\n * workspace or the site.\n *\n * The core's own rows (Home, Overview, Sites, Pages, Media, the settings\n * modes) are here; a plugin's rows are its own, in\n * `libs/plugins/<plugin>/src/lib/native-nav.ts` (`NATIVE_NAV_ROWS`), placed\n * into a list's group by `order` (docs/PACKAGES.md rule 3: the core never\n * names a plugin). `generate:native-contracts` assembles the two\n * (`assembleNativeNav`) into the manifest the apps read,\n * `ContractValues.nativeNavManifest`.\n *\n * NO IMPORTS, on purpose: the native apps read this through the generated\n * contracts, so it must stay a plain module.\n */\n\n/** A list the shells draw. */\nexport type NativeNavListId = 'workspace' | 'site' | 'workspaceSettings' | 'siteSettings'\n\n/** One icon per idea: the same row draws the same picture in both scopes. */\nexport interface NativeNavIcon {\n /** An SF Symbol name. */\n apple: string\n /** A Material Symbol name, as `AglynIcons.named` takes it. */\n android: string\n}\n\n/**\n * Where a row's console twin lives:\n * - `orgTab` / `hostTab`: a console tab, by its id (`org-nav-tabs.ts`,\n * `host-nav-tabs.ts`);\n * - `orgPluginTab` / `hostPluginTab`: a plugin's `orgNavItems` / `navItems`\n * entry, by its href;\n * - `orgPluginSection` / `hostPluginSection`: a section of a plugin's hub, as\n * `{href}/{sectionId}`;\n * - `setupSection`: a site's Setup section, by its id (`setup-sections.ts`);\n * - `hostAdminSection`, `orgSettingsSection`, `teamSection`,\n * `billingSection`: a section of those hubs, by its `Route` name;\n * - `consoleWidget`: a plugin's card, as `{slot}/{widgetId}`;\n * - `shell`: a place the app's shell owns (Home, Overview's page, the\n * settings modes), whose console twin is the page named in `id`;\n * - `nativeOnly`: a native screen the console has no page for.\n */\nexport type NativeNavConsoleSurface =\n | 'orgTab'\n | 'hostTab'\n | 'orgPluginTab'\n | 'hostPluginTab'\n | 'orgPluginSection'\n | 'hostPluginSection'\n | 'setupSection'\n | 'hostAdminSection'\n | 'orgSettingsSection'\n | 'teamSection'\n | 'billingSection'\n | 'consoleWidget'\n | 'shell'\n | 'nativeOnly'\n\nexport interface NativeNavConsoleRef {\n surface: NativeNavConsoleSurface\n id: string\n}\n\n/** A section inside a row's area, as the console's section rail lists it. */\nexport interface NativeNavSection {\n id: string\n label: string\n screen: string\n params?: Record<string, string>\n /** Set only when the section belongs to another plugin than its row's. */\n pluginId?: string\n /** The help docs page for it; its row's, unless the console names its own. */\n docs?: string\n console: NativeNavConsoleRef\n}\n\n/** An action the area offers from its title bar (Scan stock, New product). */\nexport interface NativeNavAction {\n id: string\n label: string\n icon: NativeNavIcon\n screen: string\n params?: Record<string, string>\n}\n\nexport interface NativeNavRow {\n /** The idea's id: the same in every list that shows it (`media`). */\n id: string\n /** The console's word. */\n label: string\n /**\n * The console's word when the native label is a decision of its own\n * (Overview for the site's analytics, Zach 2026-10-18).\n */\n consoleLabel?: string\n icon: NativeNavIcon\n /** The native screen the row opens. */\n screen: string\n params?: Record<string, string>\n /** The plugin the row belongs to: off for the workspace or site, the row hides. */\n pluginId?: string\n /** Only a site admin sees the row, as only they see the console's Admin tab. */\n requiresHostAdmin?: boolean\n /** A settings row's one line, in the words the screens already use. */\n description?: string\n /** Search words besides the label, so typing \"billing\" finds Plan. */\n keywords?: string[]\n /** Where the row sits in its group, ascending; a plugin's row is placed by it. */\n order?: number\n /**\n * The help docs page for the place, as the console's own help names it\n * (its `docsTopic` and `docsAnchor`, or the page's `help` prop): a docs-site\n * path with its anchor, e.g. `/content-and-data/crm/overview#at-the-organization-level`.\n * The apps open it in the in-app browser, on the docs origin.\n */\n docs?: string\n sections?: NativeNavSection[]\n actions?: NativeNavAction[]\n console: NativeNavConsoleRef\n}\n\nexport interface NativeNavGroup {\n id: string\n /** The heading; absent for a group drawn without one. */\n label?: string\n /** Folded at rest unless it holds the screen in use, remembered per device. */\n foldable: boolean\n /** `starred`: the person's starred items for this scope, drawn by the shell. */\n dynamic?: 'starred'\n rows: NativeNavRow[]\n}\n\nexport interface NativeNavList {\n id: NativeNavListId\n /** The settings mode's title, after its owner's name (\"Juniper Street Co. settings\"). */\n title?: string\n groups: NativeNavGroup[]\n}\n\n/** A console place no row holds, and where the apps put it instead. */\nexport interface NativeNavElsewhere {\n console: NativeNavConsoleRef\n where: string\n}\n\n/** A plugin's row, and the list and group it goes in. */\nexport interface NativeNavContribution {\n list: NativeNavListId\n /** A group of that list, by id. */\n group: string\n row: NativeNavRow\n}\n\n/** Where the Create new menu is offered: the whole workspace, or one site. */\nexport type NativeNavCreateScope = 'workspace' | 'site'\n\n/**\n * One item of the Create new menu (\"+\" on the rail, the center tab on\n * phones): what the console offers to create from that scope, opening the\n * area's own create form.\n */\nexport interface NativeNavCreateItem {\n id: string\n /** The thing made, in the console's words (\"Draft order\", \"Service\"). */\n label: string\n icon: NativeNavIcon\n /** The native screen the item opens, with `params` that open its create form. */\n screen: string\n params?: Record<string, string>\n /** The plugin it belongs to: off for the workspace or site, the item is not offered. */\n pluginId?: string\n /** Only a site admin is offered it. */\n requiresHostAdmin?: boolean\n /** The workspace permission the console's create action asks for (`hosts.create`, `data.manage`). */\n permission?: string\n /** The site roles that may make it, as the rules hold them (`canWriteHostContent`). */\n hostRoles?: string[]\n /** The plan feature it needs; without it the item is shown blocked, with `blockedReason`. */\n planFeature?: string\n /** Why it is blocked when the plan lacks `planFeature`; the default reason otherwise. */\n blockedReason?: string\n /** Where it sits in the menu, ascending. */\n order?: number\n /** Where the console offers the same create action. */\n console: NativeNavConsoleRef\n}\n\n/** One scope's Create new menu. */\nexport interface NativeNavCreateList {\n scope: NativeNavCreateScope\n items: NativeNavCreateItem[]\n}\n\n/** A plugin's Create new item, and the scope that offers it. */\nexport interface NativeNavCreateContribution {\n scope: NativeNavCreateScope\n item: NativeNavCreateItem\n}\n\nexport interface NativeNavManifest {\n lists: NativeNavList[]\n /** The Create new menu per scope (AGL-3943). */\n create?: NativeNavCreateList[]\n /** Destinations the shells own, which no plugin registers. */\n shellScreens: string[]\n elsewhere: NativeNavElsewhere[]\n}\n\n/** The shells' own destinations. */\nexport const NATIVE_NAV_SHELL_SCREENS: readonly string[] = [\n 'shell.home',\n 'shell.analytics',\n 'shell.workspaceSettings',\n 'shell.siteSettings',\n]\n\n/** An icon pair, for the rows here and in the plugins. */\nexport const nativeNavIcon = (apple: string, android: string): NativeNavIcon => ({ apple, android })\n\n/** A console reference, for the rows here and in the plugins. */\nexport const nativeNavRef = (surface: NativeNavConsoleSurface, id: string): NativeNavConsoleRef => ({\n surface,\n id,\n})\n\n/** A section of a plugin hub, at the scope its row stands in. */\nexport function nativeNavHubSection(\n scope: 'org' | 'host',\n href: string,\n id: string,\n label: string,\n screen: string,\n extra: Partial<Pick<NativeNavSection, 'params' | 'pluginId'>> = {},\n): NativeNavSection {\n return {\n id,\n label,\n screen,\n ...extra,\n console: nativeNavRef(scope === 'org' ? 'orgPluginSection' : 'hostPluginSection', `${href}/${id}`),\n }\n}\n\nconst icon = nativeNavIcon\nconst ref = nativeNavRef\n\nconst ICONS = {\n home: icon('house', 'home'),\n overview: icon('chart.bar', 'bar_chart'),\n sites: icon('globe', 'public'),\n pages: icon('doc.text', 'description'),\n media: icon('photo.on.rectangle', 'photo_library'),\n settings: icon('gearshape', 'settings'),\n emails: icon('envelope', 'mail'),\n members: icon('person.2', 'group'),\n roles: icon('person.badge.key', 'admin_panel_settings'),\n activity: icon('clock.arrow.circlepath', 'history'),\n plan: icon('creditcard', 'credit_card'),\n usage: icon('gauge.with.dots.needle.33percent', 'data_usage'),\n invoices: icon('doc.plaintext', 'receipt_long'),\n billingSettings: icon('slider.horizontal.3', 'tune'),\n plugins: icon('puzzlepiece.extension', 'extension'),\n branding: icon('paintbrush', 'brush'),\n sso: icon('key.viewfinder', 'vpn_key'),\n profile: icon('building.2', 'apartment'),\n apiKeys: icon('key', 'key'),\n integrations: icon('point.3.connected.trianglepath.dotted', 'hub'),\n privacy: icon('hand.raised', 'privacy_tip'),\n holds: icon('exclamationmark.triangle', 'warning'),\n importExport: icon('arrow.up.arrow.down', 'sync'),\n ownership: icon('person.crop.circle.badge.checkmark', 'manage_accounts'),\n delete: icon('trash', 'delete_forever'),\n details: icon('info.circle', 'info'),\n business: icon('briefcase', 'business'),\n seo: icon('magnifyingglass', 'travel_explore'),\n tracking: icon('chart.line.uptrend.xyaxis', 'query_stats'),\n theme: icon('paintpalette', 'palette'),\n domain: icon('link', 'domain'),\n security: icon('lock', 'security'),\n errorPages: icon('exclamationmark.circle', 'error_outline'),\n backup: icon('square.and.arrow.down', 'backup'),\n} as const\n\nconst HOME_ROW: NativeNavRow = {\n id: 'home',\n label: 'Home',\n icon: ICONS.home,\n screen: 'shell.home',\n order: 10,\n console: ref('shell', 'home'),\n}\n\nconst WORKSPACE: NativeNavList = {\n id: 'workspace',\n groups: [\n { id: 'top', foldable: false, rows: [HOME_ROW] },\n { id: 'starred', label: 'Starred', foldable: true, dynamic: 'starred', rows: [] },\n {\n id: 'workspace',\n foldable: false,\n rows: [\n {\n id: 'sites',\n label: 'Sites',\n icon: ICONS.sites,\n screen: 'site.sites',\n order: 10,\n docs: '/getting-started/console-tour#the-sites-list',\n console: ref('orgTab', 'nav-tab-org-sites'),\n },\n {\n id: 'media',\n label: 'Media',\n icon: ICONS.media,\n screen: 'site.media',\n order: 90,\n console: ref('orgTab', 'nav-tab-org-media'),\n },\n ],\n },\n ],\n}\n\nconst SITE: NativeNavList = {\n id: 'site',\n groups: [\n {\n id: 'top',\n foldable: false,\n rows: [\n HOME_ROW,\n {\n id: 'overview',\n label: 'Overview',\n consoleLabel: 'Analytics',\n icon: ICONS.overview,\n screen: 'shell.analytics',\n order: 20,\n keywords: ['analytics', 'traffic', 'visitors'],\n console: ref('hostTab', 'nav-tab-analytics'),\n },\n ],\n },\n { id: 'starred', label: 'Starred', foldable: true, dynamic: 'starred', rows: [] },\n {\n id: 'website',\n label: 'Website',\n foldable: true,\n rows: [\n {\n id: 'pages',\n label: 'Pages',\n icon: ICONS.pages,\n screen: 'site.pages',\n order: 10,\n sections: [\n { id: 'pages', label: 'Pages', screen: 'site.pages', console: ref('hostTab', 'nav-tab-screens') },\n { id: 'components', label: 'Components', screen: 'site.components', console: ref('hostTab', 'nav-tab-components') },\n { id: 'layouts', label: 'Layouts', screen: 'site.layouts', console: ref('hostTab', 'nav-tab-layouts') },\n { id: 'templates', label: 'Templates', screen: 'site.templates', console: ref('hostTab', 'nav-tab-templates') },\n { id: 'content', label: 'Content', screen: 'site.content', console: ref('hostTab', 'nav-tab-content') },\n ],\n console: ref('hostTab', 'nav-tab-screens'),\n },\n {\n id: 'media',\n label: 'Media',\n icon: ICONS.media,\n screen: 'site.media',\n order: 20,\n console: ref('hostTab', 'nav-tab-media'),\n },\n ],\n },\n { id: 'sell', label: 'Sell', foldable: true, rows: [] },\n { id: 'customers', label: 'Customers', foldable: true, rows: [] },\n { id: 'more', label: 'More', foldable: true, rows: [] },\n {\n id: 'settings',\n foldable: false,\n rows: [\n {\n id: 'siteSettings',\n label: 'Site settings',\n icon: ICONS.settings,\n screen: 'shell.siteSettings',\n order: 10,\n console: ref('shell', 'siteSettings'),\n },\n ],\n },\n ],\n}\n\n/** Each row's place, in the order written. */\nconst ordered = (rows: NativeNavRow[]): NativeNavRow[] =>\n rows.map((row, index) => ({ ...row, order: row.order ?? (index + 1) * 10 }))\n\n/** The help page each settings hub's `help` prop names, the rows' docs. */\nconst HUB_DOCS: Partial<Record<NativeNavConsoleSurface, string>> = {\n teamSection: '/workspace-and-billing/teams-and-roles/overview#team-page',\n billingSection: '/workspace-and-billing/billing-and-plans/overview#billing-page',\n orgSettingsSection: '/getting-started/console-tour#organization-settings',\n hostAdminSection: '/getting-started/create-a-site#site-admin',\n}\n\nconst setupRow = (\n id: string,\n label: string,\n rowIcon: NativeNavIcon,\n description: string,\n keywords?: string[],\n): NativeNavRow => ({\n id,\n label,\n icon: rowIcon,\n screen: id === 'theme' ? 'site.theme' : 'site.setup',\n ...(id === 'theme' ? {} : { params: { section: id } }),\n description,\n ...(keywords ? { keywords } : {}),\n console: ref('setupSection', id),\n})\n\nconst adminRow = (\n id: string,\n label: string,\n rowIcon: NativeNavIcon,\n screen: string,\n route: string,\n): NativeNavRow => ({\n id,\n label,\n icon: rowIcon,\n screen,\n requiresHostAdmin: true,\n docs: HUB_DOCS.hostAdminSection,\n console: ref('hostAdminSection', route),\n})\n\nconst settingsRow = (\n surface: NativeNavConsoleSurface,\n id: string,\n label: string,\n rowIcon: NativeNavIcon,\n screen: string,\n route: string,\n extra: Partial<Pick<NativeNavRow, 'keywords' | 'order'>> = {},\n): NativeNavRow => ({\n id,\n label,\n icon: rowIcon,\n screen,\n ...extra,\n ...(HUB_DOCS[surface] ? { docs: HUB_DOCS[surface] } : {}),\n console: ref(surface, route),\n})\n\nconst WORKSPACE_SETTINGS: NativeNavList = {\n id: 'workspaceSettings',\n title: 'settings',\n groups: [\n {\n id: 'team',\n label: 'Team',\n foldable: false,\n rows: ordered([\n settingsRow('teamSection', 'members', 'Members', ICONS.members, 'core.team', 'MANAGE_TEAM_MEMBERS', { keywords: ['team', 'invite', 'people'] }),\n settingsRow('teamSection', 'roles', 'Custom roles', ICONS.roles, 'core.team.roles', 'MANAGE_TEAM_ROLES', { keywords: ['permissions'] }),\n settingsRow('teamSection', 'activity', 'Recent activity', ICONS.activity, 'core.team.activity', 'MANAGE_TEAM_ACTIVITY', { keywords: ['audit log'] }),\n ]),\n },\n {\n id: 'billing',\n label: 'Billing',\n foldable: false,\n rows: [\n settingsRow('billingSection', 'plan', 'Plan', ICONS.plan, 'core.billing', 'MANAGE_BILLING', { order: 10, keywords: ['billing', 'upgrade', 'subscription'] }),\n settingsRow('billingSection', 'usage', 'Usage', ICONS.usage, 'core.billing.usage', 'MANAGE_BILLING_USAGE', { order: 20, keywords: ['billing', 'limits'] }),\n settingsRow('billingSection', 'invoices', 'Invoices', ICONS.invoices, 'core.billing.invoices', 'MANAGE_BILLING_INVOICES', { order: 40, keywords: ['billing', 'receipts'] }),\n settingsRow('billingSection', 'billingSettings', 'Settings', ICONS.billingSettings, 'core.billing.settings', 'MANAGE_BILLING_SETTINGS', { order: 50, keywords: ['billing', 'payment method', 'tax'] }),\n ],\n },\n {\n id: 'workspace',\n label: 'Workspace',\n foldable: false,\n rows: ordered([\n settingsRow('orgTab', 'plugins', 'Plugins', ICONS.plugins, 'core.plugins', 'nav-tab-org-plugins'),\n settingsRow('orgSettingsSection', 'branding', 'Branding', ICONS.branding, 'core.settings.branding', 'ORG_SETTINGS_BRANDING', { keywords: ['white label', 'logo', 'colors'] }),\n settingsRow('orgSettingsSection', 'sso', 'Single sign-on', ICONS.sso, 'core.settings.sso', 'ORG_SETTINGS_SSO', { keywords: ['sso', 'saml'] }),\n settingsRow('orgSettingsSection', 'profile', 'Profile', ICONS.profile, 'core.settings.profile', 'ORG_SETTINGS_PROFILE'),\n settingsRow('orgSettingsSection', 'apiKeys', 'API keys', ICONS.apiKeys, 'core.settings.apiKeys', 'ORG_SETTINGS_API_KEYS'),\n settingsRow('orgSettingsSection', 'integrations', 'Integrations', ICONS.integrations, 'core.settings.integrations', 'ORG_SETTINGS_INTEGRATIONS'),\n settingsRow('orgSettingsSection', 'general', 'General', ICONS.settings, 'core.settings.general', 'ORG_SETTINGS_GENERAL', { keywords: ['name', 'address'] }),\n ]),\n },\n {\n id: 'data',\n label: 'Data & compliance',\n foldable: false,\n rows: ordered([\n settingsRow('orgSettingsSection', 'privacy', 'Privacy', ICONS.privacy, 'core.settings.privacy', 'ORG_SETTINGS_PRIVACY', { keywords: ['gdpr', 'erase'] }),\n settingsRow('orgSettingsSection', 'holds', 'Holds & reviews', ICONS.holds, 'core.settings.holds', 'ORG_SETTINGS_HOLDS'),\n settingsRow('orgSettingsSection', 'importExport', 'Import & export', ICONS.importExport, 'core.settings.data', 'ORG_SETTINGS_DATA', { keywords: ['csv', 'export'] }),\n ]),\n },\n {\n id: 'danger',\n label: 'Danger zone',\n foldable: false,\n rows: ordered([\n settingsRow('orgSettingsSection', 'ownership', 'Ownership', ICONS.ownership, 'core.settings.ownership', 'ORG_SETTINGS_OWNERSHIP', { keywords: ['transfer'] }),\n settingsRow('orgSettingsSection', 'delete', 'Delete', ICONS.delete, 'core.settings.delete', 'ORG_SETTINGS_DELETE'),\n ]),\n },\n ],\n}\n\nconst SITE_SETTINGS: NativeNavList = {\n id: 'siteSettings',\n title: 'settings',\n groups: [\n {\n id: 'people',\n foldable: false,\n rows: ordered([\n {\n id: 'users',\n label: 'Users',\n icon: ICONS.members,\n screen: 'core.site.users',\n keywords: ['team', 'collaborators'],\n console: ref('hostTab', 'nav-tab-users'),\n },\n ]),\n },\n {\n id: 'setup',\n label: 'Setup',\n foldable: false,\n rows: ordered([\n setupRow('details', 'Basic details', ICONS.details, 'Logo, business details, layout and languages'),\n setupRow('business', 'Business profile', ICONS.business, 'What the business is, for everything that writes about it'),\n setupRow('seo', 'SEO', ICONS.seo, 'Search title, social image, business profile and verification', ['search']),\n setupRow('tracking', 'Tracking', ICONS.tracking, 'Analytics, ad tags and the consent banner', ['cookies', 'pixels']),\n setupRow('theme', 'Theme', ICONS.theme, 'Colors, font, shape and your saved themes', ['colors', 'fonts']),\n setupRow('emails', 'Emails', ICONS.emails, 'The emails your site sends to customers'),\n setupRow('integrations', 'Integrations', ICONS.integrations, 'Email platforms, Zapier, live chat and the other tools your site connects to'),\n ]),\n },\n {\n id: 'admin',\n label: 'Admin',\n foldable: false,\n rows: ordered([\n adminRow('general', 'General', ICONS.settings, 'core.site.general', 'HOST_ADMIN_GENERAL'),\n adminRow('plugins', 'Plugins', ICONS.plugins, 'core.site.plugins', 'HOST_ADMIN_PLUGINS'),\n adminRow('domain', 'Custom Domain', ICONS.domain, 'core.site.domain', 'HOST_ADMIN_DOMAIN'),\n adminRow('security', 'Security', ICONS.security, 'core.site.security', 'HOST_ADMIN_SECURITY'),\n adminRow('errorPages', 'Error pages', ICONS.errorPages, 'core.site.errorPages', 'HOST_ADMIN_ERROR_PAGES'),\n adminRow('activity', 'Activity', ICONS.activity, 'core.site.activity', 'HOST_ADMIN_ACTIVITY'),\n adminRow('backup', 'Backup & template', ICONS.backup, 'core.site.backup', 'HOST_ADMIN_BACKUP'),\n adminRow('danger', 'Danger zone', ICONS.delete, 'core.site.delete', 'HOST_ADMIN_DANGER'),\n ]),\n },\n ],\n}\n\nconst CREATE: NativeNavCreateList[] = [\n {\n scope: 'workspace',\n items: [\n {\n id: 'site',\n label: 'Site',\n icon: ICONS.sites,\n screen: 'site.sites',\n params: { new: '1' },\n permission: 'hosts.create',\n order: 10,\n console: ref('orgTab', 'nav-tab-org-sites'),\n },\n ],\n },\n {\n scope: 'site',\n items: [\n {\n id: 'page',\n label: 'Page',\n icon: ICONS.pages,\n screen: 'site.pages',\n params: { new: '1' },\n hostRoles: ['admin', 'editor', 'author'],\n order: 10,\n console: ref('hostTab', 'nav-tab-screens'),\n },\n ],\n },\n]\n\n/**\n * The core's half of the manifest: every list and group, and the core's own\n * rows. The manifest the apps read (`ContractValues.nativeNavManifest`) is\n * this with each plugin's `NATIVE_NAV_ROWS` placed by `assembleNativeNav`.\n */\nexport const NATIVE_NAV_MANIFEST: NativeNavManifest = {\n lists: [WORKSPACE, SITE, WORKSPACE_SETTINGS, SITE_SETTINGS],\n create: CREATE,\n shellScreens: [...NATIVE_NAV_SHELL_SCREENS],\n elsewhere: [\n { console: ref('hostTab', 'nav-tab-dashboard'), where: 'Home, inside the site (shell.home)' },\n { console: ref('hostTab', 'nav-tab-setup'), where: 'Site settings → Setup' },\n { console: ref('hostTab', 'nav-tab-admin'), where: 'Site settings → Admin' },\n { console: ref('orgTab', 'nav-tab-org-team'), where: 'Workspace settings → Team' },\n { console: ref('orgTab', 'nav-tab-org-billing'), where: 'Workspace settings → Billing' },\n { console: ref('orgTab', 'nav-tab-org-settings'), where: 'Workspace settings' },\n { console: ref('orgTab', 'nav-tab-org-support'), where: 'Help menu → Contact support (core.support)' },\n ],\n}\n\n/**\n * The manifest with the plugins' rows placed: each into its list's group by\n * `order` (a tie keeps the core's row first, then registration order). A row\n * naming a list or group the core does not have is refused by name, so a\n * plugin cannot quietly invent a group.\n */\nexport function assembleNativeNav(\n core: NativeNavManifest,\n contributions: readonly NativeNavContribution[],\n elsewhere: readonly NativeNavElsewhere[] = [],\n creates: readonly NativeNavCreateContribution[] = [],\n): NativeNavManifest {\n const byOrder = <T extends { order?: number }>(entries: T[]): T[] =>\n entries\n .map((entry, index) => ({ entry, index }))\n .sort((a, b) => (a.entry.order ?? 0) - (b.entry.order ?? 0) || a.index - b.index)\n .map(({ entry }) => entry)\n const lists = core.lists.map((list) => ({\n ...list,\n groups: list.groups.map((group) => ({ ...group, rows: [...group.rows] })),\n }))\n for (const { list: listId, group: groupId, row } of contributions) {\n const group = lists.find((list) => list.id === listId)?.groups.find((entry) => entry.id === groupId)\n if (!group || group.dynamic) {\n throw new Error(`native nav: ${row.id} names ${listId}/${groupId}, which is not a group of rows`)\n }\n if (group.rows.some((entry) => entry.id === row.id)) {\n throw new Error(`native nav: ${listId}/${groupId} holds ${row.id} twice`)\n }\n group.rows.push(row)\n }\n for (const list of lists) {\n for (const group of list.groups) {\n // A section is helped by its row's page unless the console names its own.\n group.rows = byOrder(group.rows).map((row) =>\n row.docs && row.sections\n ? { ...row, sections: row.sections.map((section) => (section.docs ? section : { ...section, docs: row.docs })) }\n : row,\n )\n }\n }\n const create = (core.create ?? []).map((entry) => ({ ...entry, items: [...entry.items] }))\n for (const { scope, item } of creates) {\n const target = create.find((entry) => entry.scope === scope)\n if (!target) throw new Error(`native nav: create item ${item.id} names ${scope}, which has no menu`)\n if (target.items.some((entry) => entry.id === item.id)) {\n throw new Error(`native nav: the ${scope} create menu holds ${item.id} twice`)\n }\n target.items.push(item)\n }\n return {\n ...core,\n lists,\n create: create.map((entry) => ({ ...entry, items: byOrder(entry.items) })),\n elsewhere: [...core.elsewhere, ...elsewhere],\n }\n}\n\n/** What a Create new item that cannot be used says, when its own reason does not apply. */\nexport const NATIVE_CREATE_PERMISSION_REASON =\n \"Your role can't create this here. Ask an owner or admin of the workspace.\"\nexport const NATIVE_CREATE_SITE_ROLE_REASON = \"Your role on this site can't create this. Ask a site admin.\"\nexport const NATIVE_CREATE_PLAN_REASON = \"Your plan doesn't include this. See the plans in Billing.\"\n\n/** A Create new item as one scope offers it. */\nexport interface ResolvedCreateItem extends NativeNavCreateItem {\n /** Shown, but disabled with `reason`: a prerequisite stands between the person and it. */\n blocked: boolean\n reason?: string\n}\n\n/**\n * The Create new menu for the workspace or site in hand. An item of a plugin\n * that is off is not offered, nor an admin-only item to a non-admin. One the\n * person may not use is SHOWN, disabled with its reason (prerequisites are\n * shown, never hidden): a permission or site role they lack, then a plan\n * feature the workspace lacks. `permissions` and `features` are the\n * workspace's resolved answers (an absent key is not held); `hostRole` is\n * the person's role on the site, null at the workspace.\n */\nexport function resolveCreateList(\n manifest: NativeNavManifest,\n scope: NativeNavCreateScope,\n enabledPluginIds: readonly string[],\n permissions: Readonly<Record<string, boolean>>,\n features: Readonly<Record<string, boolean>>,\n hostRole: string | null,\n): ResolvedCreateItem[] {\n const on = new Set(enabledPluginIds)\n const items = manifest.create?.find((entry) => entry.scope === scope)?.items ?? []\n return items\n .filter((item) => (!item.pluginId || on.has(item.pluginId)) && (!item.requiresHostAdmin || hostRole === 'admin'))\n .map((item): ResolvedCreateItem => {\n if (item.permission && permissions[item.permission] !== true) {\n return { ...item, blocked: true, reason: NATIVE_CREATE_PERMISSION_REASON }\n }\n if (item.hostRoles && !item.hostRoles.includes(hostRole ?? '')) {\n return { ...item, blocked: true, reason: NATIVE_CREATE_SITE_ROLE_REASON }\n }\n if (item.planFeature && features[item.planFeature] !== true) {\n return { ...item, blocked: true, reason: item.blockedReason ?? NATIVE_CREATE_PLAN_REASON }\n }\n return { ...item, blocked: false }\n })\n}\n\n/** A list as one scope shows it: rows for plugins that are off, or admin rows for a non-admin, left out. */\nexport interface ResolvedNavList {\n id: NativeNavListId\n title?: string\n groups: NativeNavGroup[]\n}\n\n/**\n * One list for the workspace or site in hand, from the assembled manifest\n * (`ContractValues.nativeNavManifest`). `enabledPluginIds` is the site's\n * effective set (`resolveHostEnabledPlugins`) in site scope and the\n * workspace's (`resolveEnabledPlugins`) otherwise. A section of another\n * plugin than its row's hides with that plugin. A group left with no rows is\n * dropped, except the starred group, which the shell fills.\n */\nexport function resolveNavList(\n manifest: NativeNavManifest,\n listId: NativeNavListId,\n enabledPluginIds: readonly string[],\n hostAdmin: boolean,\n): ResolvedNavList {\n const list = manifest.lists.find((entry) => entry.id === listId)\n if (!list) return { id: listId, groups: [] }\n const on = new Set(enabledPluginIds)\n const shows = (pluginId?: string) => !pluginId || on.has(pluginId)\n const groups: NativeNavGroup[] = []\n for (const group of list.groups) {\n const rows = group.rows\n .filter((row) => shows(row.pluginId) && (hostAdmin || !row.requiresHostAdmin))\n .map((row) =>\n row.sections\n ? { ...row, sections: row.sections.filter((section) => shows(section.pluginId)) }\n : row,\n )\n if (!rows.length && !group.dynamic) continue\n groups.push({ ...group, rows })\n }\n return { id: list.id, ...(list.title ? { title: list.title } : {}), groups }\n}\n"],"names":["NATIVE_NAV_SHELL_SCREENS","nativeNavIcon","apple","android","nativeNavRef","surface","id","nativeNavHubSection","scope","href","label","screen","extra","console","icon","ref","ICONS","home","overview","sites","pages","media","settings","emails","members","roles","activity","plan","usage","invoices","billingSettings","plugins","branding","sso","profile","apiKeys","integrations","privacy","holds","importExport","ownership","delete","details","business","seo","tracking","theme","domain","security","errorPages","backup","HOME_ROW","order","WORKSPACE","groups","foldable","rows","dynamic","docs","SITE","consoleLabel","keywords","sections","ordered","map","row","index","HUB_DOCS","teamSection","billingSection","orgSettingsSection","hostAdminSection","setupRow","rowIcon","description","params","section","adminRow","route","requiresHostAdmin","settingsRow","WORKSPACE_SETTINGS","title","SITE_SETTINGS","CREATE","items","new","permission","hostRoles","NATIVE_NAV_MANIFEST","lists","create","shellScreens","elsewhere","where","assembleNativeNav","core","contributions","creates","byOrder","entries","entry","sort","a","b","list","group","listId","groupId","find","Error","some","push","item","target","NATIVE_CREATE_PERMISSION_REASON","NATIVE_CREATE_SITE_ROLE_REASON","NATIVE_CREATE_PLAN_REASON","resolveCreateList","manifest","enabledPluginIds","permissions","features","hostRole","on","Set","filter","pluginId","has","blocked","reason","includes","planFeature","blockedReason","resolveNavList","hostAdmin","shows","length"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GAED,4BAA4B;AAiM5B,kCAAkC,GAClC,OAAO,MAAMA,2BAA8C;IACzD;IACA;IACA;IACA;CACD,CAAA;AAED,wDAAwD,GACxD,OAAO,MAAMC,gBAAgB,CAACC,O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ACnCe,SAAkB;IAElB,MAAM9B,OAAOc,SAAS7B,KAAK,CAACmB,IAAI,CAAC,CAACR,QAAUA,MAAM/F,EAAE,KAAKqG;IACzD,IAAI,CAACF,MAAM,OAAO;QAAEnG,IAAIqG;QAAQrD,QAAQ,EAAE;IAAC;IAC3C,MAAMsE,KAAK,IAAIC,IAAIL;IACnB,MAAMgB,QAAQ,CAACT,WAAsB,CAACA,YAAYH,GAAGI,GAAG,CAACD;IACzD,MAAMzE,SAA2B,EAAE;IACnC,KAAK,MAAMoD,SAASD,KAAKnD,MAAM,CAAE;QAC/B,MAAME,OAAOkD,MAAMlD,IAAI,CACpBsE,MAAM,CAAC,CAAC7D,MAAQuE,MAAMvE,IAAI8D,QAAQ,KAAMQ,CAAAA,aAAa,CAACtE,IAAIc,iBAAiB,AAAD,GAC1Ef,GAAG,CAAC,CAACC,MACJA,IAAIH,QAAQ,GACR,aAAKG;gBAAKH,UAAUG,IAAIH,QAAQ,CAACgE,MAAM,CAAC,CAAClD,UAAY4D,MAAM5D,QAAQmD,QAAQ;iBAC3E9D;QAER,IAAI,CAACT,KAAKiF,MAAM,IAAI,CAAC/B,MAAMjD,OAAO,EAAE;QACpCH,OAAO0D,IAAI,CAAC,aAAKN;YAAOlD;;IAC1B;IACA,OAAO;QAAElD,IAAImG,KAAKnG,EAAE;OAAMmG,KAAKvB,KAAK,GAAG;QAAEA,OAAOuB,KAAKvB,KAAK;IAAC,IAAI,CAAC;QAAI5B;;AACtE"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/native-nav.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * THE NATIVE APPS' NAVIGATION, AS DATA (AGL-3943).\n *\n * One manifest both shells draw (docs/mobile/native-navigation.md): the\n * sidebar for the whole workspace, the sidebar inside one site, and the two\n * settings modes (the workspace's, and the site's, which merges the\n * console's Setup and Admin). Zach chose the site's groups on 2026-10-18:\n * an Analytics row, Starred, Website, Sell, Customers, More, Site settings.\n *\n * Every row names:\n * - the console's word for it (`label`), held to the console by\n * `apps/console/specs/native-nav-manifest.spec.ts`, which reads the\n * console's own tabs, sections and plugin declarations;\n * - one icon per idea, an SF Symbol and a Material Symbol;\n * - the native screen it opens (a plugin's declared screen, a core screen\n * spec, a site platform screen or a `shell.*` destination);\n * - the plugin it belongs to, so it hides when that plugin is off for the\n * workspace or the site.\n *\n * The core's own rows (Home, Analytics, Sites, Pages, Media, the settings\n * modes) are here; a plugin's rows are its own, in\n * `libs/plugins/<plugin>/src/lib/native-nav.ts` (`NATIVE_NAV_ROWS`), placed\n * into a list's group by `order` (docs/PACKAGES.md rule 3: the core never\n * names a plugin). `generate:native-contracts` assembles the two\n * (`assembleNativeNav`) into the manifest the apps read,\n * `ContractValues.nativeNavManifest`.\n *\n * NO IMPORTS, on purpose: the native apps read this through the generated\n * contracts, so it must stay a plain module.\n */\n\n/** A list the shells draw. */\nexport type NativeNavListId = 'workspace' | 'site' | 'workspaceSettings' | 'siteSettings'\n\n/** One icon per idea: the same row draws the same picture in both scopes. */\nexport interface NativeNavIcon {\n /** An SF Symbol name. */\n apple: string\n /** A Material Symbol name, as `AglynIcons.named` takes it. */\n android: string\n}\n\n/**\n * Where a row's console twin lives:\n * - `orgTab` / `hostTab`: a console tab, by its id (`org-nav-tabs.ts`,\n * `host-nav-tabs.ts`);\n * - `orgPluginTab` / `hostPluginTab`: a plugin's `orgNavItems` / `navItems`\n * entry, by its href;\n * - `orgPluginSection` / `hostPluginSection`: a section of a plugin's hub, as\n * `{href}/{sectionId}`;\n * - `setupSection`: a site's Setup section, by its id (`setup-sections.ts`);\n * - `hostAdminSection`, `orgSettingsSection`, `teamSection`,\n * `billingSection`: a section of those hubs, by its `Route` name;\n * - `consoleWidget`: a plugin's card, as `{slot}/{widgetId}`;\n * - `shell`: a place the app's shell owns (Home, Analytics' page, the\n * settings modes), whose console twin is the page named in `id`;\n * - `nativeOnly`: a native screen the console has no page for.\n */\nexport type NativeNavConsoleSurface =\n | 'orgTab'\n | 'hostTab'\n | 'orgPluginTab'\n | 'hostPluginTab'\n | 'orgPluginSection'\n | 'hostPluginSection'\n | 'setupSection'\n | 'hostAdminSection'\n | 'orgSettingsSection'\n | 'teamSection'\n | 'billingSection'\n | 'consoleWidget'\n | 'shell'\n | 'nativeOnly'\n\nexport interface NativeNavConsoleRef {\n surface: NativeNavConsoleSurface\n id: string\n}\n\n/** A section inside a row's area, as the console's section rail lists it. */\nexport interface NativeNavSection {\n id: string\n label: string\n screen: string\n params?: Record<string, string>\n /** Set only when the section belongs to another plugin than its row's. */\n pluginId?: string\n /** The help docs page for it; its row's, unless the console names its own. */\n docs?: string\n console: NativeNavConsoleRef\n}\n\n/** An action the area offers from its title bar (Scan stock, New product). */\nexport interface NativeNavAction {\n id: string\n label: string\n icon: NativeNavIcon\n screen: string\n params?: Record<string, string>\n}\n\nexport interface NativeNavRow {\n /** The idea's id: the same in every list that shows it (`media`). */\n id: string\n /** The console's word. */\n label: string\n /**\n * The console's word when the native label is a decision of its own\n * (a row the apps name differently from the console).\n */\n consoleLabel?: string\n icon: NativeNavIcon\n /** The native screen the row opens. */\n screen: string\n params?: Record<string, string>\n /** The plugin the row belongs to: off for the workspace or site, the row hides. */\n pluginId?: string\n /** Only a site admin sees the row, as only they see the console's Admin tab. */\n requiresHostAdmin?: boolean\n /** A settings row's one line, in the words the screens already use. */\n description?: string\n /** Search words besides the label, so typing \"billing\" finds Plan. */\n keywords?: string[]\n /** Where the row sits in its group, ascending; a plugin's row is placed by it. */\n order?: number\n /**\n * The help docs page for the place, as the console's own help names it\n * (its `docsTopic` and `docsAnchor`, or the page's `help` prop): a docs-site\n * path with its anchor, e.g. `/content-and-data/crm/overview#at-the-organization-level`.\n * The apps open it in the in-app browser, on the docs origin.\n */\n docs?: string\n sections?: NativeNavSection[]\n actions?: NativeNavAction[]\n console: NativeNavConsoleRef\n}\n\nexport interface NativeNavGroup {\n id: string\n /** The heading; absent for a group drawn without one. */\n label?: string\n /** Folded at rest unless it holds the screen in use, remembered per device. */\n foldable: boolean\n /** `starred`: the person's starred items for this scope, drawn by the shell. */\n dynamic?: 'starred'\n rows: NativeNavRow[]\n}\n\nexport interface NativeNavList {\n id: NativeNavListId\n /** The settings mode's title, after its owner's name (\"Juniper Street Co. settings\"). */\n title?: string\n groups: NativeNavGroup[]\n}\n\n/** A console place no row holds, and where the apps put it instead. */\nexport interface NativeNavElsewhere {\n console: NativeNavConsoleRef\n where: string\n}\n\n/** A plugin's row, and the list and group it goes in. */\nexport interface NativeNavContribution {\n list: NativeNavListId\n /** A group of that list, by id. */\n group: string\n row: NativeNavRow\n}\n\n/** Where the Create new menu is offered: the whole workspace, or one site. */\nexport type NativeNavCreateScope = 'workspace' | 'site'\n\n/**\n * One item of the Create new menu (\"+\" on the rail, the center tab on\n * phones): what the console offers to create from that scope, opening the\n * area's own create form.\n */\nexport interface NativeNavCreateItem {\n id: string\n /** The thing made, in the console's words (\"Draft order\", \"Service\"). */\n label: string\n icon: NativeNavIcon\n /** The native screen the item opens, with `params` that open its create form. */\n screen: string\n params?: Record<string, string>\n /** The plugin it belongs to: off for the workspace or site, the item is not offered. */\n pluginId?: string\n /** Only a site admin is offered it. */\n requiresHostAdmin?: boolean\n /** The workspace permission the console's create action asks for (`hosts.create`, `data.manage`). */\n permission?: string\n /** The site roles that may make it, as the rules hold them (`canWriteHostContent`). */\n hostRoles?: string[]\n /** The plan feature it needs; without it the item is shown blocked, with `blockedReason`. */\n planFeature?: string\n /** Why it is blocked when the plan lacks `planFeature`; the default reason otherwise. */\n blockedReason?: string\n /** Where it sits in the menu, ascending. */\n order?: number\n /** Where the console offers the same create action. */\n console: NativeNavConsoleRef\n}\n\n/** One scope's Create new menu. */\nexport interface NativeNavCreateList {\n scope: NativeNavCreateScope\n items: NativeNavCreateItem[]\n}\n\n/** A plugin's Create new item, and the scope that offers it. */\nexport interface NativeNavCreateContribution {\n scope: NativeNavCreateScope\n item: NativeNavCreateItem\n}\n\nexport interface NativeNavManifest {\n lists: NativeNavList[]\n /** The Create new menu per scope (AGL-3943). */\n create?: NativeNavCreateList[]\n /** Destinations the shells own, which no plugin registers. */\n shellScreens: string[]\n elsewhere: NativeNavElsewhere[]\n}\n\n/** The shells' own destinations. */\nexport const NATIVE_NAV_SHELL_SCREENS: readonly string[] = [\n 'shell.home',\n 'shell.analytics',\n 'shell.workspaceSettings',\n 'shell.siteSettings',\n]\n\n/** An icon pair, for the rows here and in the plugins. */\nexport const nativeNavIcon = (apple: string, android: string): NativeNavIcon => ({ apple, android })\n\n/** A console reference, for the rows here and in the plugins. */\nexport const nativeNavRef = (surface: NativeNavConsoleSurface, id: string): NativeNavConsoleRef => ({\n surface,\n id,\n})\n\n/** A section of a plugin hub, at the scope its row stands in. */\nexport function nativeNavHubSection(\n scope: 'org' | 'host',\n href: string,\n id: string,\n label: string,\n screen: string,\n extra: Partial<Pick<NativeNavSection, 'params' | 'pluginId'>> = {},\n): NativeNavSection {\n return {\n id,\n label,\n screen,\n ...extra,\n console: nativeNavRef(scope === 'org' ? 'orgPluginSection' : 'hostPluginSection', `${href}/${id}`),\n }\n}\n\nconst icon = nativeNavIcon\nconst ref = nativeNavRef\n\nconst ICONS = {\n home: icon('house', 'home'),\n overview: icon('chart.bar', 'bar_chart'),\n sites: icon('globe', 'public'),\n pages: icon('doc.text', 'description'),\n media: icon('photo.on.rectangle', 'photo_library'),\n settings: icon('gearshape', 'settings'),\n emails: icon('envelope', 'mail'),\n members: icon('person.2', 'group'),\n roles: icon('person.badge.key', 'admin_panel_settings'),\n activity: icon('clock.arrow.circlepath', 'history'),\n plan: icon('creditcard', 'credit_card'),\n usage: icon('gauge.with.dots.needle.33percent', 'data_usage'),\n invoices: icon('doc.plaintext', 'receipt_long'),\n billingSettings: icon('slider.horizontal.3', 'tune'),\n plugins: icon('puzzlepiece.extension', 'extension'),\n branding: icon('paintbrush', 'brush'),\n sso: icon('key.viewfinder', 'vpn_key'),\n profile: icon('building.2', 'apartment'),\n apiKeys: icon('key', 'key'),\n integrations: icon('point.3.connected.trianglepath.dotted', 'hub'),\n privacy: icon('hand.raised', 'privacy_tip'),\n holds: icon('exclamationmark.triangle', 'warning'),\n importExport: icon('arrow.up.arrow.down', 'sync'),\n ownership: icon('person.crop.circle.badge.checkmark', 'manage_accounts'),\n delete: icon('trash', 'delete_forever'),\n details: icon('info.circle', 'info'),\n business: icon('briefcase', 'business'),\n seo: icon('magnifyingglass', 'travel_explore'),\n tracking: icon('chart.line.uptrend.xyaxis', 'query_stats'),\n theme: icon('paintpalette', 'palette'),\n domain: icon('link', 'domain'),\n security: icon('lock', 'security'),\n errorPages: icon('exclamationmark.circle', 'error_outline'),\n backup: icon('square.and.arrow.down', 'backup'),\n} as const\n\nconst HOME_ROW: NativeNavRow = {\n id: 'home',\n label: 'Home',\n icon: ICONS.home,\n screen: 'shell.home',\n order: 10,\n console: ref('shell', 'home'),\n}\n\nconst WORKSPACE: NativeNavList = {\n id: 'workspace',\n groups: [\n { id: 'top', foldable: false, rows: [HOME_ROW] },\n { id: 'starred', label: 'Starred', foldable: true, dynamic: 'starred', rows: [] },\n {\n id: 'workspace',\n foldable: false,\n rows: [\n {\n id: 'sites',\n label: 'Sites',\n icon: ICONS.sites,\n screen: 'site.sites',\n order: 10,\n docs: '/getting-started/console-tour#the-sites-list',\n console: ref('orgTab', 'nav-tab-org-sites'),\n },\n {\n id: 'media',\n label: 'Media',\n icon: ICONS.media,\n screen: 'site.media',\n order: 90,\n console: ref('orgTab', 'nav-tab-org-media'),\n },\n ],\n },\n ],\n}\n\nconst SITE: NativeNavList = {\n id: 'site',\n groups: [\n {\n id: 'top',\n foldable: false,\n rows: [\n HOME_ROW,\n {\n id: 'overview',\n // \"Analytics\", the console's own word: \"Overview\" read as a second Home (AGL-4011).\n label: 'Analytics',\n consoleLabel: 'Analytics',\n icon: ICONS.overview,\n screen: 'shell.analytics',\n order: 20,\n keywords: ['analytics', 'traffic', 'visitors'],\n console: ref('hostTab', 'nav-tab-analytics'),\n },\n ],\n },\n { id: 'starred', label: 'Starred', foldable: true, dynamic: 'starred', rows: [] },\n {\n id: 'website',\n label: 'Website',\n foldable: true,\n rows: [\n {\n id: 'pages',\n label: 'Pages',\n icon: ICONS.pages,\n screen: 'site.pages',\n order: 10,\n sections: [\n { id: 'pages', label: 'Pages', screen: 'site.pages', console: ref('hostTab', 'nav-tab-screens') },\n { id: 'components', label: 'Components', screen: 'site.components', console: ref('hostTab', 'nav-tab-components') },\n { id: 'layouts', label: 'Layouts', screen: 'site.layouts', console: ref('hostTab', 'nav-tab-layouts') },\n { id: 'templates', label: 'Templates', screen: 'site.templates', console: ref('hostTab', 'nav-tab-templates') },\n { id: 'content', label: 'Content', screen: 'site.content', console: ref('hostTab', 'nav-tab-content') },\n ],\n console: ref('hostTab', 'nav-tab-screens'),\n },\n {\n id: 'media',\n label: 'Media',\n icon: ICONS.media,\n screen: 'site.media',\n order: 20,\n console: ref('hostTab', 'nav-tab-media'),\n },\n ],\n },\n { id: 'sell', label: 'Sell', foldable: true, rows: [] },\n { id: 'customers', label: 'Customers', foldable: true, rows: [] },\n { id: 'more', label: 'More', foldable: true, rows: [] },\n {\n id: 'settings',\n foldable: false,\n rows: [\n {\n id: 'siteSettings',\n label: 'Site settings',\n icon: ICONS.settings,\n screen: 'shell.siteSettings',\n order: 10,\n console: ref('shell', 'siteSettings'),\n },\n ],\n },\n ],\n}\n\n/** Each row's place, in the order written. */\nconst ordered = (rows: NativeNavRow[]): NativeNavRow[] =>\n rows.map((row, index) => ({ ...row, order: row.order ?? (index + 1) * 10 }))\n\n/** The help page each settings hub's `help` prop names, the rows' docs. */\nconst HUB_DOCS: Partial<Record<NativeNavConsoleSurface, string>> = {\n teamSection: '/workspace-and-billing/teams-and-roles/overview#team-page',\n billingSection: '/workspace-and-billing/billing-and-plans/overview#billing-page',\n orgSettingsSection: '/getting-started/console-tour#organization-settings',\n hostAdminSection: '/getting-started/create-a-site#site-admin',\n}\n\nconst setupRow = (\n id: string,\n label: string,\n rowIcon: NativeNavIcon,\n description: string,\n keywords?: string[],\n): NativeNavRow => ({\n id,\n label,\n icon: rowIcon,\n screen: id === 'theme' ? 'site.theme' : 'site.setup',\n ...(id === 'theme' ? {} : { params: { section: id } }),\n description,\n ...(keywords ? { keywords } : {}),\n console: ref('setupSection', id),\n})\n\nconst adminRow = (\n id: string,\n label: string,\n rowIcon: NativeNavIcon,\n screen: string,\n route: string,\n): NativeNavRow => ({\n id,\n label,\n icon: rowIcon,\n screen,\n requiresHostAdmin: true,\n docs: HUB_DOCS.hostAdminSection,\n console: ref('hostAdminSection', route),\n})\n\nconst settingsRow = (\n surface: NativeNavConsoleSurface,\n id: string,\n label: string,\n rowIcon: NativeNavIcon,\n screen: string,\n route: string,\n extra: Partial<Pick<NativeNavRow, 'keywords' | 'order'>> = {},\n): NativeNavRow => ({\n id,\n label,\n icon: rowIcon,\n screen,\n ...extra,\n ...(HUB_DOCS[surface] ? { docs: HUB_DOCS[surface] } : {}),\n console: ref(surface, route),\n})\n\nconst WORKSPACE_SETTINGS: NativeNavList = {\n id: 'workspaceSettings',\n title: 'settings',\n groups: [\n {\n id: 'team',\n label: 'Team',\n foldable: false,\n rows: ordered([\n settingsRow('teamSection', 'members', 'Members', ICONS.members, 'core.team', 'MANAGE_TEAM_MEMBERS', { keywords: ['team', 'invite', 'people'] }),\n settingsRow('teamSection', 'roles', 'Custom roles', ICONS.roles, 'core.team.roles', 'MANAGE_TEAM_ROLES', { keywords: ['permissions'] }),\n settingsRow('teamSection', 'activity', 'Recent activity', ICONS.activity, 'core.team.activity', 'MANAGE_TEAM_ACTIVITY', { keywords: ['audit log'] }),\n ]),\n },\n {\n id: 'billing',\n label: 'Billing',\n foldable: false,\n rows: [\n settingsRow('billingSection', 'plan', 'Plan', ICONS.plan, 'core.billing', 'MANAGE_BILLING', { order: 10, keywords: ['billing', 'upgrade', 'subscription'] }),\n settingsRow('billingSection', 'usage', 'Usage', ICONS.usage, 'core.billing.usage', 'MANAGE_BILLING_USAGE', { order: 20, keywords: ['billing', 'limits'] }),\n settingsRow('billingSection', 'invoices', 'Invoices', ICONS.invoices, 'core.billing.invoices', 'MANAGE_BILLING_INVOICES', { order: 40, keywords: ['billing', 'receipts'] }),\n settingsRow('billingSection', 'billingSettings', 'Settings', ICONS.billingSettings, 'core.billing.settings', 'MANAGE_BILLING_SETTINGS', { order: 50, keywords: ['billing', 'payment method', 'tax'] }),\n ],\n },\n {\n id: 'workspace',\n label: 'Workspace',\n foldable: false,\n rows: ordered([\n settingsRow('orgTab', 'plugins', 'Plugins', ICONS.plugins, 'core.plugins', 'nav-tab-org-plugins'),\n settingsRow('orgSettingsSection', 'branding', 'Branding', ICONS.branding, 'core.settings.branding', 'ORG_SETTINGS_BRANDING', { keywords: ['white label', 'logo', 'colors'] }),\n settingsRow('orgSettingsSection', 'sso', 'Single sign-on', ICONS.sso, 'core.settings.sso', 'ORG_SETTINGS_SSO', { keywords: ['sso', 'saml'] }),\n settingsRow('orgSettingsSection', 'profile', 'Profile', ICONS.profile, 'core.settings.profile', 'ORG_SETTINGS_PROFILE'),\n settingsRow('orgSettingsSection', 'apiKeys', 'API keys', ICONS.apiKeys, 'core.settings.apiKeys', 'ORG_SETTINGS_API_KEYS'),\n settingsRow('orgSettingsSection', 'integrations', 'Integrations', ICONS.integrations, 'core.settings.integrations', 'ORG_SETTINGS_INTEGRATIONS'),\n settingsRow('orgSettingsSection', 'general', 'General', ICONS.settings, 'core.settings.general', 'ORG_SETTINGS_GENERAL', { keywords: ['name', 'address'] }),\n ]),\n },\n {\n id: 'data',\n label: 'Data & compliance',\n foldable: false,\n rows: ordered([\n settingsRow('orgSettingsSection', 'privacy', 'Privacy', ICONS.privacy, 'core.settings.privacy', 'ORG_SETTINGS_PRIVACY', { keywords: ['gdpr', 'erase'] }),\n settingsRow('orgSettingsSection', 'holds', 'Holds & reviews', ICONS.holds, 'core.settings.holds', 'ORG_SETTINGS_HOLDS'),\n settingsRow('orgSettingsSection', 'importExport', 'Import & export', ICONS.importExport, 'core.settings.data', 'ORG_SETTINGS_DATA', { keywords: ['csv', 'export'] }),\n ]),\n },\n {\n id: 'danger',\n label: 'Danger zone',\n foldable: false,\n rows: ordered([\n settingsRow('orgSettingsSection', 'ownership', 'Ownership', ICONS.ownership, 'core.settings.ownership', 'ORG_SETTINGS_OWNERSHIP', { keywords: ['transfer'] }),\n settingsRow('orgSettingsSection', 'delete', 'Delete', ICONS.delete, 'core.settings.delete', 'ORG_SETTINGS_DELETE'),\n ]),\n },\n ],\n}\n\nconst SITE_SETTINGS: NativeNavList = {\n id: 'siteSettings',\n title: 'settings',\n groups: [\n {\n id: 'people',\n foldable: false,\n rows: ordered([\n {\n id: 'users',\n label: 'Users',\n icon: ICONS.members,\n screen: 'core.site.users',\n keywords: ['team', 'collaborators'],\n console: ref('hostTab', 'nav-tab-users'),\n },\n ]),\n },\n {\n id: 'setup',\n label: 'Setup',\n foldable: false,\n rows: ordered([\n setupRow('details', 'Basic details', ICONS.details, 'Logo, business details, layout and languages'),\n setupRow('business', 'Business profile', ICONS.business, 'What the business is, for everything that writes about it'),\n setupRow('seo', 'SEO', ICONS.seo, 'Search title, social image, business profile and verification', ['search']),\n setupRow('tracking', 'Tracking', ICONS.tracking, 'Analytics, ad tags and the consent banner', ['cookies', 'pixels']),\n setupRow('theme', 'Theme', ICONS.theme, 'Colors, font, shape and your saved themes', ['colors', 'fonts']),\n setupRow('emails', 'Emails', ICONS.emails, 'The emails your site sends to customers'),\n setupRow('integrations', 'Integrations', ICONS.integrations, 'Email platforms, Zapier, live chat and the other tools your site connects to'),\n ]),\n },\n {\n id: 'admin',\n label: 'Admin',\n foldable: false,\n rows: ordered([\n adminRow('general', 'General', ICONS.settings, 'core.site.general', 'HOST_ADMIN_GENERAL'),\n adminRow('plugins', 'Plugins', ICONS.plugins, 'core.site.plugins', 'HOST_ADMIN_PLUGINS'),\n adminRow('domain', 'Custom Domain', ICONS.domain, 'core.site.domain', 'HOST_ADMIN_DOMAIN'),\n adminRow('security', 'Security', ICONS.security, 'core.site.security', 'HOST_ADMIN_SECURITY'),\n adminRow('errorPages', 'Error pages', ICONS.errorPages, 'core.site.errorPages', 'HOST_ADMIN_ERROR_PAGES'),\n adminRow('activity', 'Activity', ICONS.activity, 'core.site.activity', 'HOST_ADMIN_ACTIVITY'),\n adminRow('backup', 'Backup & template', ICONS.backup, 'core.site.backup', 'HOST_ADMIN_BACKUP'),\n adminRow('danger', 'Danger zone', ICONS.delete, 'core.site.delete', 'HOST_ADMIN_DANGER'),\n ]),\n },\n ],\n}\n\nconst CREATE: NativeNavCreateList[] = [\n {\n scope: 'workspace',\n items: [\n {\n id: 'site',\n label: 'Site',\n icon: ICONS.sites,\n screen: 'site.sites',\n params: { new: '1' },\n permission: 'hosts.create',\n order: 10,\n console: ref('orgTab', 'nav-tab-org-sites'),\n },\n ],\n },\n {\n scope: 'site',\n items: [\n {\n id: 'page',\n label: 'Page',\n icon: ICONS.pages,\n screen: 'site.pages',\n params: { new: '1' },\n hostRoles: ['admin', 'editor', 'author'],\n order: 10,\n console: ref('hostTab', 'nav-tab-screens'),\n },\n ],\n },\n]\n\n/**\n * The core's half of the manifest: every list and group, and the core's own\n * rows. The manifest the apps read (`ContractValues.nativeNavManifest`) is\n * this with each plugin's `NATIVE_NAV_ROWS` placed by `assembleNativeNav`.\n */\nexport const NATIVE_NAV_MANIFEST: NativeNavManifest = {\n lists: [WORKSPACE, SITE, WORKSPACE_SETTINGS, SITE_SETTINGS],\n create: CREATE,\n shellScreens: [...NATIVE_NAV_SHELL_SCREENS],\n elsewhere: [\n { console: ref('hostTab', 'nav-tab-dashboard'), where: 'Home, inside the site (shell.home)' },\n { console: ref('hostTab', 'nav-tab-setup'), where: 'Site settings → Setup' },\n { console: ref('hostTab', 'nav-tab-admin'), where: 'Site settings → Admin' },\n { console: ref('orgTab', 'nav-tab-org-team'), where: 'Workspace settings → Team' },\n { console: ref('orgTab', 'nav-tab-org-billing'), where: 'Workspace settings → Billing' },\n { console: ref('orgTab', 'nav-tab-org-settings'), where: 'Workspace settings' },\n { console: ref('orgTab', 'nav-tab-org-support'), where: 'Help menu → Contact support (core.support)' },\n ],\n}\n\n/**\n * The manifest with the plugins' rows placed: each into its list's group by\n * `order` (a tie keeps the core's row first, then registration order). A row\n * naming a list or group the core does not have is refused by name, so a\n * plugin cannot quietly invent a group.\n */\nexport function assembleNativeNav(\n core: NativeNavManifest,\n contributions: readonly NativeNavContribution[],\n elsewhere: readonly NativeNavElsewhere[] = [],\n creates: readonly NativeNavCreateContribution[] = [],\n): NativeNavManifest {\n const byOrder = <T extends { order?: number }>(entries: T[]): T[] =>\n entries\n .map((entry, index) => ({ entry, index }))\n .sort((a, b) => (a.entry.order ?? 0) - (b.entry.order ?? 0) || a.index - b.index)\n .map(({ entry }) => entry)\n const lists = core.lists.map((list) => ({\n ...list,\n groups: list.groups.map((group) => ({ ...group, rows: [...group.rows] })),\n }))\n for (const { list: listId, group: groupId, row } of contributions) {\n const group = lists.find((list) => list.id === listId)?.groups.find((entry) => entry.id === groupId)\n if (!group || group.dynamic) {\n throw new Error(`native nav: ${row.id} names ${listId}/${groupId}, which is not a group of rows`)\n }\n if (group.rows.some((entry) => entry.id === row.id)) {\n throw new Error(`native nav: ${listId}/${groupId} holds ${row.id} twice`)\n }\n group.rows.push(row)\n }\n for (const list of lists) {\n for (const group of list.groups) {\n // A section is helped by its row's page unless the console names its own.\n group.rows = byOrder(group.rows).map((row) =>\n row.docs && row.sections\n ? { ...row, sections: row.sections.map((section) => (section.docs ? section : { ...section, docs: row.docs })) }\n : row,\n )\n }\n }\n const create = (core.create ?? []).map((entry) => ({ ...entry, items: [...entry.items] }))\n for (const { scope, item } of creates) {\n const target = create.find((entry) => entry.scope === scope)\n if (!target) throw new Error(`native nav: create item ${item.id} names ${scope}, which has no menu`)\n if (target.items.some((entry) => entry.id === item.id)) {\n throw new Error(`native nav: the ${scope} create menu holds ${item.id} twice`)\n }\n target.items.push(item)\n }\n return {\n ...core,\n lists,\n create: create.map((entry) => ({ ...entry, items: byOrder(entry.items) })),\n elsewhere: [...core.elsewhere, ...elsewhere],\n }\n}\n\n/** What a Create new item that cannot be used says, when its own reason does not apply. */\nexport const NATIVE_CREATE_PERMISSION_REASON =\n \"Your role can't create this here. Ask an owner or admin of the workspace.\"\nexport const NATIVE_CREATE_SITE_ROLE_REASON = \"Your role on this site can't create this. Ask a site admin.\"\nexport const NATIVE_CREATE_PLAN_REASON = \"Your plan doesn't include this. See the plans in Billing.\"\n\n/** A Create new item as one scope offers it. */\nexport interface ResolvedCreateItem extends NativeNavCreateItem {\n /** Shown, but disabled with `reason`: a prerequisite stands between the person and it. */\n blocked: boolean\n reason?: string\n}\n\n/**\n * The Create new menu for the workspace or site in hand. An item of a plugin\n * that is off is not offered, nor an admin-only item to a non-admin. One the\n * person may not use is SHOWN, disabled with its reason (prerequisites are\n * shown, never hidden): a permission or site role they lack, then a plan\n * feature the workspace lacks. `permissions` and `features` are the\n * workspace's resolved answers (an absent key is not held); `hostRole` is\n * the person's role on the site, null at the workspace.\n */\nexport function resolveCreateList(\n manifest: NativeNavManifest,\n scope: NativeNavCreateScope,\n enabledPluginIds: readonly string[],\n permissions: Readonly<Record<string, boolean>>,\n features: Readonly<Record<string, boolean>>,\n hostRole: string | null,\n): ResolvedCreateItem[] {\n const on = new Set(enabledPluginIds)\n const items = manifest.create?.find((entry) => entry.scope === scope)?.items ?? []\n return items\n .filter((item) => (!item.pluginId || on.has(item.pluginId)) && (!item.requiresHostAdmin || hostRole === 'admin'))\n .map((item): ResolvedCreateItem => {\n if (item.permission && permissions[item.permission] !== true) {\n return { ...item, blocked: true, reason: NATIVE_CREATE_PERMISSION_REASON }\n }\n if (item.hostRoles && !item.hostRoles.includes(hostRole ?? '')) {\n return { ...item, blocked: true, reason: NATIVE_CREATE_SITE_ROLE_REASON }\n }\n if (item.planFeature && features[item.planFeature] !== true) {\n return { ...item, blocked: true, reason: item.blockedReason ?? NATIVE_CREATE_PLAN_REASON }\n }\n return { ...item, blocked: false }\n })\n}\n\n/** A list as one scope shows it: rows for plugins that are off, or admin rows for a non-admin, left out. */\nexport interface ResolvedNavList {\n id: NativeNavListId\n title?: string\n groups: NativeNavGroup[]\n}\n\n/**\n * One list for the workspace or site in hand, from the assembled manifest\n * (`ContractValues.nativeNavManifest`). `enabledPluginIds` is the site's\n * effective set (`resolveHostEnabledPlugins`) in site scope and the\n * workspace's (`resolveEnabledPlugins`) otherwise. A section of another\n * plugin than its row's hides with that plugin. A group left with no rows is\n * dropped, except the starred group, which the shell fills.\n */\nexport function resolveNavList(\n manifest: NativeNavManifest,\n listId: NativeNavListId,\n enabledPluginIds: readonly string[],\n hostAdmin: boolean,\n): ResolvedNavList {\n const list = manifest.lists.find((entry) => entry.id === listId)\n if (!list) return { id: listId, groups: [] }\n const on = new Set(enabledPluginIds)\n const shows = (pluginId?: string) => !pluginId || on.has(pluginId)\n const groups: NativeNavGroup[] = []\n for (const group of list.groups) {\n const rows = group.rows\n .filter((row) => shows(row.pluginId) && (hostAdmin || !row.requiresHostAdmin))\n .map((row) =>\n row.sections\n ? { ...row, sections: row.sections.filter((section) => shows(section.pluginId)) }\n : row,\n )\n if (!rows.length && !group.dynamic) continue\n groups.push({ ...group, rows })\n }\n return { id: list.id, ...(list.title ? { title: list.title } : {}), groups }\n}\n\n// ── The phone's Home (AGL-4006) ─────────────────────────────────────────────\n\n/**\n * A group's heading on the phone's Home where it differs from the sidebar's.\n * Nothing on the phone reads \"More\", so the sidebar's More\n * group is headed Tools there.\n */\nexport const PHONE_HOME_GROUP_LABELS: Record<string, string> = { more: 'Tools' }\n\n/** The heading of the phone Home's last group: inside a site, and for the whole workspace. */\nexport const PHONE_HOME_SITE_GROUP_LABEL = 'Site & workspace'\nexport const PHONE_HOME_WORKSPACE_GROUP_LABEL = 'Settings'\n\n/** The Team tile's word: the console's tab for Members, Custom roles and Recent activity. */\nexport const PHONE_HOME_TEAM_LABEL = 'Team'\n\n/** The tile that opens Workspace settings on the phone's Home. */\nexport const WORKSPACE_SETTINGS_ROW: NativeNavRow = {\n id: 'workspaceSettings',\n label: 'Workspace settings',\n icon: ICONS.profile,\n screen: 'shell.workspaceSettings',\n console: ref('shell', 'workspaceSettings'),\n}\n\n/** One group of tiles on the phone's Home. */\nexport interface PhoneHomeGroup {\n id: string\n /** Absent for a group drawn without a heading. */\n label?: string\n rows: NativeNavRow[]\n}\n\n/**\n * The phone's Home: every area of the scope as the same\n * tile, in the sidebar's own groups, then the scope's own places last\n * (Overview and Site settings in a site; Team and Workspace settings\n * everywhere). Nothing is ranked above anything else and nothing sits behind\n * a More.\n *\n * `list` is the scope's everyday list as the app shows it (`resolveNavList`\n * trimmed to the build's screens), `team` the workspace settings' Members row\n * when the person may open it, and `ownerName` heads the whole workspace's\n * areas, whose group has no heading of its own.\n */\nexport function phoneHomeGroups(\n list: ResolvedNavList,\n team: NativeNavRow | null,\n ownerName: string,\n): PhoneHomeGroup[] {\n const inSite = list.id === 'site'\n const own: NativeNavRow[] = []\n const groups: PhoneHomeGroup[] = []\n for (const group of list.groups) {\n if (group.dynamic) continue\n const rows = group.rows.filter((row) => row.screen !== 'shell.home')\n if (group.id === 'top' || group.id === 'settings') {\n own.push(...rows)\n continue\n }\n if (!rows.length) continue\n const label = PHONE_HOME_GROUP_LABELS[group.id] ?? group.label ?? (ownerName || undefined)\n groups.push({ id: group.id, ...(label ? { label } : {}), rows })\n }\n if (team) own.push({ ...team, label: PHONE_HOME_TEAM_LABEL })\n own.push(WORKSPACE_SETTINGS_ROW)\n groups.push({\n id: 'scope',\n label: inSite ? PHONE_HOME_SITE_GROUP_LABEL : PHONE_HOME_WORKSPACE_GROUP_LABEL,\n rows: own,\n })\n return groups\n}\n\n/** Whether a Home tile may go in the tab bar: an area, never Home itself or a settings mode. */\nexport function isTabPinnable(row: Pick<NativeNavRow, 'screen'>): boolean {\n return (\n row.screen !== 'shell.home' &&\n row.screen !== 'shell.workspaceSettings' &&\n row.screen !== 'shell.siteSettings'\n )\n}\n"],"names":["NATIVE_NAV_SHELL_SCREENS","nativeNavIcon","apple","android","nativeNavRef","surface","id","nativeNavHubSection","scope","href","label","screen","extra","console","icon","ref","ICONS","home","overview","sites","pages","media","settings","emails","members","roles","activity","plan","usage","invoices","billingSettings","plugins","branding","sso","profile","apiKeys","integrations","privacy","holds","importExport","ownership","delete","details","business","seo","tracking","theme","domain","security","errorPages","backup","HOME_ROW","order","WORKSPACE","groups","foldable","rows","dynamic","docs","SITE","consoleLabel","keywords","sections","ordered","map","row","index","HUB_DOCS","teamSection","billingSection","orgSettingsSection","hostAdminSection","setupRow","rowIcon","description","params","section","adminRow","route","requiresHostAdmin","settingsRow","WORKSPACE_SETTINGS","title","SITE_SETTINGS","CREATE","items","new","permission","hostRoles","NATIVE_NAV_MANIFEST","lists","create","shellScreens","elsewhere","where","assembleNativeNav","core","contributions","creates","byOrder","entries","entry","sort","a","b","list","group","listId","groupId","find","Error","some","push","item","target","NATIVE_CREATE_PERMISSION_REASON","NATIVE_CREATE_SITE_ROLE_REASON","NATIVE_CREATE_PLAN_REASON","resolveCreateList","manifest","enabledPluginIds","permissions","features","hostRole","on","Set","filter","pluginId","has","blocked","reason","includes","planFeature","blockedReason","resolveNavList","hostAdmin","shows","length","PHONE_HOME_GROUP_LABELS","more","PHONE_HOME_SITE_GROUP_LABEL","PHONE_HOME_WORKSPACE_GROUP_LABEL","PHONE_HOME_TEAM_LABEL","WORKSPACE_SETTINGS_ROW","phoneHomeGroups","team","ownerName","inSite","own","undefined","isTabPinnable"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,G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9F;AACT;AAEA,8FAA8F,GAC9F,OAAO,SAASgG,cAAcrF,GAAiC;IAC7D,OACEA,IAAItD,MAAM,KAAK,gBACfsD,IAAItD,MAAM,KAAK,6BACfsD,IAAItD,MAAM,KAAK;AAEnB"}
@@ -30,7 +30,8 @@
30
30
  * - `THEME_ACCENTS`: the Accent modes Blue, Violet, Pink and Workspace
31
31
  * brand, exactly. `deriveAccent` returns them for their ring colors and
32
32
  * derives any other color (a picked accent, a workspace's brand) by rule.
33
- * - `THEME_ACCENT_SWATCHES`: the six swatches the Theme settings sheet shows.
33
+ * - `THEME_ACCENT_SWATCHES`: the five swatches the Theme settings sheet shows.
34
+ * - `THEME_RETIRED_ACCENTS`: retired blues, and the brand blue each reads as.
34
35
  * - `THEME_DENSITIES`: Comfortable and Compact.
35
36
  *
36
37
  * Contrast is WCAG 2's relative luminance, as `accessible-shade.ts` (the
@@ -213,28 +214,38 @@ export declare function deriveThemeFromPreview(preview: ThemePreview, darkRailSe
213
214
  };
214
215
  /** Every theme, in the order the Theme settings sheet lists them. */
215
216
  export declare const THEME_PALETTES: readonly ThemePalette[];
216
- /** The named accents, Figma's own values with their text shades. */
217
+ /** The Aglyn theme's grounds on a phone, light and dark (Figma Theme mode 223:0): see `PHONE_AGLYN_LIGHT`. */
218
+ export declare const THEME_PHONE_AGLYN: ThemeColorsPair;
219
+ /** The accent the phone's bold look belongs to: the brand blue, the Aglyn theme's own. */
220
+ export declare const THEME_PHONE_BOLD_ACCENT = "#00b0ff";
221
+ /** The named accents, Figma's own values with their text shades (their own where they name them). */
217
222
  export declare const THEME_ACCENTS: readonly ThemeNamedAccent[];
218
- /** The accent picker's swatches, in Figma's order. */
223
+ /**
224
+ * Blues the brand has retired (AGL-3990), and the color each now reads as. The
225
+ * picker's old "Brand blue" swatch was #0073AE; an accent an account saved
226
+ * from it (`appTheme.accent`) reads as the brand blue, #00B0FF.
227
+ */
228
+ export declare const THEME_RETIRED_ACCENTS: Readonly<Record<string, string>>;
229
+ /** The accent picker's swatches, in Figma's order. #00B0FF is the one brand blue (AGL-3990), so "Sky" went. */
219
230
  export declare const THEME_ACCENT_SWATCHES: readonly ThemeAccentSwatch[];
220
231
  /**
221
232
  * Every control's shade of one accent color (AGL-3950).
222
233
  *
223
- * A color one of Figma's Accent modes is drawn from (its ring) answers with
224
- * that mode exactly: Figma wins where it defines a value. Any other color is
225
- * derived:
234
+ * A retired blue (`THEME_RETIRED_ACCENTS`) reads as the color that replaced
235
+ * it. A color one of Figma's Accent modes is drawn from (its ring) answers
236
+ * with that mode exactly: Figma wins where it defines a value. Blue, the brand
237
+ * blue, is one of them, and wears the console's own pairing. Any other color
238
+ * is derived:
226
239
  *
227
- * 1. White text on the color already reads (4.5:1): the fill is the color,
228
- * `on` is white.
229
- * 2. The color carries white text only at the large-text bar (3:1 up to
230
- * 4.5:1) and near-black text reads on it at 4.5:1: the fill KEEPS the
231
- * brand color and `on` flips to near-black, the color's own hue at 8%
232
- * lightness. Darkening such a color far enough for white text moves it
233
- * visibly off the brand; this is Figma's Pink (#E040FB, 3.34:1). The 3:1
234
- * threshold is the one that sends Pink here and Blue (2.43:1) and the
235
- * workspace green (2.99:1) to rule 3, as Figma draws them.
236
- * 3. Otherwise the fill is the color darkened in 2% HSL-lightness steps until
237
- * white reaches 4.5:1, and `on` is white.
240
+ * 1. White text on the color reads at 3:1 or better: the fill is the color,
241
+ * `on` is white. Content on a filled control is always white (Zach,
242
+ * 2026-10-19: "Just like the web app the solid buttons should have white
243
+ * text"), and a brand color white reads on at the large-text bar keeps
244
+ * its own fill rather than moving off the brand, the console's own
245
+ * pairing; this is Figma's Pink (#E040FB, 3.34:1).
246
+ * 2. Otherwise the fill is the color darkened in 2% HSL-lightness steps until
247
+ * white reaches 4.5:1, and `on` is white. The 3:1 threshold is the one
248
+ * that sends the workspace green (2.99:1) here, as Figma draws it.
238
249
  *
239
250
  * hover and pressed are the fill 4% and 8% darker (HSL lightness), soft is
240
251
  * the color at 16% alpha, ring is the color, icon is the color darkened in 2%