@aglyn/aglyn 1.0.0-beta.269 → 1.0.0-beta.271

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 (121) hide show
  1. package/package.json +11 -11
  2. package/src/lib/app-utils/account-preferences.d.ts +248 -0
  3. package/src/lib/app-utils/account-preferences.js +434 -0
  4. package/src/lib/app-utils/account-preferences.js.map +1 -0
  5. package/src/lib/app-utils/activity-labels.js +2 -0
  6. package/src/lib/app-utils/activity-labels.js.map +1 -1
  7. package/src/lib/app-utils/analytics-events.d.ts +13 -0
  8. package/src/lib/app-utils/analytics-events.js +2 -0
  9. package/src/lib/app-utils/analytics-events.js.map +1 -1
  10. package/src/lib/app-utils/append-only-history.d.ts +94 -0
  11. package/src/lib/app-utils/append-only-history.js +73 -0
  12. package/src/lib/app-utils/append-only-history.js.map +1 -0
  13. package/src/lib/app-utils/bundle-intent.d.ts +186 -0
  14. package/src/lib/app-utils/bundle-intent.js +386 -0
  15. package/src/lib/app-utils/bundle-intent.js.map +1 -0
  16. package/src/lib/app-utils/client-build.d.ts +204 -0
  17. package/src/lib/app-utils/client-build.js +237 -0
  18. package/src/lib/app-utils/client-build.js.map +1 -0
  19. package/src/lib/app-utils/console-routes.d.ts +4 -0
  20. package/src/lib/app-utils/console-routes.js +2 -0
  21. package/src/lib/app-utils/console-routes.js.map +1 -1
  22. package/src/lib/app-utils/country-options.d.ts +27 -0
  23. package/src/lib/app-utils/country-options.js +96 -0
  24. package/src/lib/app-utils/country-options.js.map +1 -0
  25. package/src/lib/app-utils/docs-help-sections.generated.js +7 -5
  26. package/src/lib/app-utils/docs-help-sections.generated.js.map +1 -1
  27. package/src/lib/app-utils/docs-help.generated.d.ts +11 -5
  28. package/src/lib/app-utils/docs-help.generated.js +22 -2
  29. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  30. package/src/lib/app-utils/docs-index.generated.js +116 -39
  31. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  32. package/src/lib/app-utils/margin-utilization.js +6 -4
  33. package/src/lib/app-utils/margin-utilization.js.map +1 -1
  34. package/src/lib/app-utils/media-filter.d.ts +26 -0
  35. package/src/lib/app-utils/media-filter.js +32 -0
  36. package/src/lib/app-utils/media-filter.js.map +1 -1
  37. package/src/lib/app-utils/mobile-push.d.ts +8 -0
  38. package/src/lib/app-utils/mobile-push.js +4 -1
  39. package/src/lib/app-utils/mobile-push.js.map +1 -1
  40. package/src/lib/app-utils/native-app-association.d.ts +3 -2
  41. package/src/lib/app-utils/native-app-association.js +4 -2
  42. package/src/lib/app-utils/native-app-association.js.map +1 -1
  43. package/src/lib/app-utils/native-nav.d.ts +265 -0
  44. package/src/lib/app-utils/native-nav.js +741 -0
  45. package/src/lib/app-utils/native-nav.js.map +1 -0
  46. package/src/lib/app-utils/native-themes.d.ts +249 -0
  47. package/src/lib/app-utils/native-themes.js +732 -0
  48. package/src/lib/app-utils/native-themes.js.map +1 -0
  49. package/src/lib/app-utils/notifications.d.ts +1 -1
  50. package/src/lib/app-utils/notifications.js +10 -0
  51. package/src/lib/app-utils/notifications.js.map +1 -1
  52. package/src/lib/app-utils/onboarding-deep-link.d.ts +36 -2
  53. package/src/lib/app-utils/onboarding-deep-link.js +48 -5
  54. package/src/lib/app-utils/onboarding-deep-link.js.map +1 -1
  55. package/src/lib/app-utils/one-box-search.d.ts +108 -0
  56. package/src/lib/app-utils/one-box-search.js +167 -0
  57. package/src/lib/app-utils/one-box-search.js.map +1 -0
  58. package/src/lib/app-utils/operator-alerts.js +21 -0
  59. package/src/lib/app-utils/operator-alerts.js.map +1 -1
  60. package/src/lib/app-utils/org-permissions.js +10 -61
  61. package/src/lib/app-utils/org-permissions.js.map +1 -1
  62. package/src/lib/app-utils/org-role-grants.d.ts +95 -0
  63. package/src/lib/app-utils/org-role-grants.js +193 -0
  64. package/src/lib/app-utils/org-role-grants.js.map +1 -0
  65. package/src/lib/app-utils/owner-approval-record.d.ts +102 -0
  66. package/src/lib/app-utils/owner-approval-record.js +148 -0
  67. package/src/lib/app-utils/owner-approval-record.js.map +1 -0
  68. package/src/lib/app-utils/plan-entitlements.d.ts +224 -68
  69. package/src/lib/app-utils/plan-entitlements.js +278 -61
  70. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  71. package/src/lib/app-utils/release-flags.d.ts +1 -1
  72. package/src/lib/app-utils/release-flags.js +10 -0
  73. package/src/lib/app-utils/release-flags.js.map +1 -1
  74. package/src/lib/app-utils/server.d.ts +4 -0
  75. package/src/lib/app-utils/server.js +7 -0
  76. package/src/lib/app-utils/server.js.map +1 -1
  77. package/src/lib/app-utils/site-care-project.d.ts +227 -0
  78. package/src/lib/app-utils/site-care-project.js +423 -0
  79. package/src/lib/app-utils/site-care-project.js.map +1 -0
  80. package/src/lib/app-utils/site-care.d.ts +268 -0
  81. package/src/lib/app-utils/site-care.js +283 -0
  82. package/src/lib/app-utils/site-care.js.map +1 -0
  83. package/src/lib/app-utils/tenant-dns-targets.d.ts +62 -0
  84. package/src/lib/app-utils/tenant-dns-targets.js +80 -0
  85. package/src/lib/app-utils/tenant-dns-targets.js.map +1 -0
  86. package/src/lib/app-utils/upgrade-proposal.d.ts +29 -4
  87. package/src/lib/app-utils/upgrade-proposal.js +60 -9
  88. package/src/lib/app-utils/upgrade-proposal.js.map +1 -1
  89. package/src/lib/foundation/definitions/org-billing.types.d.ts +54 -10
  90. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
  91. package/src/lib/foundation/definitions/organization.types.d.ts +3 -1
  92. package/src/lib/foundation/definitions/organization.types.js.map +1 -1
  93. package/src/lib/foundation/definitions/platform.types.d.ts +9 -0
  94. package/src/lib/foundation/definitions/platform.types.js.map +1 -1
  95. package/src/lib/foundation/index.d.ts +1 -1
  96. package/src/lib/foundation/index.js.map +1 -1
  97. package/src/lib/plugin-manager/feature-plugins.d.ts +86 -0
  98. package/src/lib/plugin-manager/feature-plugins.js +20 -0
  99. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  100. package/src/lib/plugin-manager/first-party-plugins.generated.js +22 -1
  101. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  102. package/src/lib/plugin-manager/plugin-ai-capabilities.d.ts +19 -0
  103. package/src/lib/plugin-manager/plugin-ai-capabilities.js.map +1 -1
  104. package/src/lib/plugin-manager/plugin-domain-events.d.ts +4 -3
  105. package/src/lib/plugin-manager/plugin-domain-events.js.map +1 -1
  106. package/src/lib/plugin-manager/plugin-domain-search.d.ts +81 -0
  107. package/src/lib/plugin-manager/plugin-domain-search.js +63 -0
  108. package/src/lib/plugin-manager/plugin-domain-search.js.map +1 -0
  109. package/src/lib/plugin-manager/plugin-entitlements.d.ts +23 -5
  110. package/src/lib/plugin-manager/plugin-entitlements.js +10 -0
  111. package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -1
  112. package/src/lib/plugin-manager/plugin-media-ingest.d.ts +25 -0
  113. package/src/lib/plugin-manager/plugin-media-ingest.js.map +1 -1
  114. package/src/lib/plugin-manager/plugin-search-sources.d.ts +85 -0
  115. package/src/lib/plugin-manager/plugin-search-sources.js +91 -0
  116. package/src/lib/plugin-manager/plugin-search-sources.js.map +1 -0
  117. package/src/lib/plugin-manager/plugin-services.js +6 -0
  118. package/src/lib/plugin-manager/plugin-services.js.map +1 -1
  119. package/src/lib/plugin-manager/purchase-gate-preclearance.d.ts +61 -0
  120. package/src/lib/plugin-manager/purchase-gate-preclearance.js +102 -0
  121. package/src/lib/plugin-manager/purchase-gate-preclearance.js.map +1 -0
@@ -0,0 +1,741 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * THE NATIVE APPS' NAVIGATION, AS DATA (AGL-3943).
18
+ *
19
+ * One manifest both shells draw (docs/mobile/native-navigation.md): the
20
+ * sidebar for the whole workspace, the sidebar inside one site, and the two
21
+ * settings modes (the workspace's, and the site's, which merges the
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.
24
+ *
25
+ * Every row names:
26
+ * - the console's word for it (`label`), held to the console by
27
+ * `apps/console/specs/native-nav-manifest.spec.ts`, which reads the
28
+ * console's own tabs, sections and plugin declarations;
29
+ * - one icon per idea, an SF Symbol and a Material Symbol;
30
+ * - the native screen it opens (a plugin's declared screen, a core screen
31
+ * spec, a site platform screen or a `shell.*` destination);
32
+ * - the plugin it belongs to, so it hides when that plugin is off for the
33
+ * workspace or the site.
34
+ *
35
+ * The core's own rows (Home, Overview, Sites, Pages, Media, the settings
36
+ * modes) are here; a plugin's rows are its own, in
37
+ * `libs/plugins/<plugin>/src/lib/native-nav.ts` (`NATIVE_NAV_ROWS`), placed
38
+ * into a list's group by `order` (docs/PACKAGES.md rule 3: the core never
39
+ * names a plugin). `generate:native-contracts` assembles the two
40
+ * (`assembleNativeNav`) into the manifest the apps read,
41
+ * `ContractValues.nativeNavManifest`.
42
+ *
43
+ * NO IMPORTS, on purpose: the native apps read this through the generated
44
+ * contracts, so it must stay a plain module.
45
+ */ /** A list the shells draw. */ import { _ as _extends } from "@swc/helpers/_/_extends";
46
+ /** The shells' own destinations. */ export const NATIVE_NAV_SHELL_SCREENS = [
47
+ 'shell.home',
48
+ 'shell.analytics',
49
+ 'shell.workspaceSettings',
50
+ 'shell.siteSettings'
51
+ ];
52
+ /** An icon pair, for the rows here and in the plugins. */ export const nativeNavIcon = (apple, android)=>({
53
+ apple,
54
+ android
55
+ });
56
+ /** A console reference, for the rows here and in the plugins. */ export const nativeNavRef = (surface, id)=>({
57
+ surface,
58
+ id
59
+ });
60
+ /** A section of a plugin hub, at the scope its row stands in. */ export function nativeNavHubSection(scope, href, id, label, screen, extra = {}) {
61
+ return _extends({
62
+ id,
63
+ label,
64
+ screen
65
+ }, extra, {
66
+ console: nativeNavRef(scope === 'org' ? 'orgPluginSection' : 'hostPluginSection', `${href}/${id}`)
67
+ });
68
+ }
69
+ const icon = nativeNavIcon;
70
+ const ref = nativeNavRef;
71
+ const ICONS = {
72
+ home: icon('house', 'home'),
73
+ overview: icon('chart.bar', 'bar_chart'),
74
+ sites: icon('globe', 'public'),
75
+ pages: icon('doc.text', 'description'),
76
+ media: icon('photo.on.rectangle', 'photo_library'),
77
+ settings: icon('gearshape', 'settings'),
78
+ emails: icon('envelope', 'mail'),
79
+ members: icon('person.2', 'group'),
80
+ roles: icon('person.badge.key', 'admin_panel_settings'),
81
+ activity: icon('clock.arrow.circlepath', 'history'),
82
+ plan: icon('creditcard', 'credit_card'),
83
+ usage: icon('gauge.with.dots.needle.33percent', 'data_usage'),
84
+ invoices: icon('doc.plaintext', 'receipt_long'),
85
+ billingSettings: icon('slider.horizontal.3', 'tune'),
86
+ plugins: icon('puzzlepiece.extension', 'extension'),
87
+ branding: icon('paintbrush', 'brush'),
88
+ sso: icon('key.viewfinder', 'vpn_key'),
89
+ profile: icon('building.2', 'apartment'),
90
+ apiKeys: icon('key', 'key'),
91
+ integrations: icon('point.3.connected.trianglepath.dotted', 'hub'),
92
+ privacy: icon('hand.raised', 'privacy_tip'),
93
+ holds: icon('exclamationmark.triangle', 'warning'),
94
+ importExport: icon('arrow.up.arrow.down', 'sync'),
95
+ ownership: icon('person.crop.circle.badge.checkmark', 'manage_accounts'),
96
+ delete: icon('trash', 'delete_forever'),
97
+ details: icon('info.circle', 'info'),
98
+ business: icon('briefcase', 'business'),
99
+ seo: icon('magnifyingglass', 'travel_explore'),
100
+ tracking: icon('chart.line.uptrend.xyaxis', 'query_stats'),
101
+ theme: icon('paintpalette', 'palette'),
102
+ domain: icon('link', 'domain'),
103
+ security: icon('lock', 'security'),
104
+ errorPages: icon('exclamationmark.circle', 'error_outline'),
105
+ backup: icon('square.and.arrow.down', 'backup')
106
+ };
107
+ const HOME_ROW = {
108
+ id: 'home',
109
+ label: 'Home',
110
+ icon: ICONS.home,
111
+ screen: 'shell.home',
112
+ order: 10,
113
+ console: ref('shell', 'home')
114
+ };
115
+ const WORKSPACE = {
116
+ id: 'workspace',
117
+ groups: [
118
+ {
119
+ id: 'top',
120
+ foldable: false,
121
+ rows: [
122
+ HOME_ROW
123
+ ]
124
+ },
125
+ {
126
+ id: 'starred',
127
+ label: 'Starred',
128
+ foldable: true,
129
+ dynamic: 'starred',
130
+ rows: []
131
+ },
132
+ {
133
+ id: 'workspace',
134
+ foldable: false,
135
+ rows: [
136
+ {
137
+ id: 'sites',
138
+ label: 'Sites',
139
+ icon: ICONS.sites,
140
+ screen: 'site.sites',
141
+ order: 10,
142
+ docs: '/getting-started/console-tour#the-sites-list',
143
+ console: ref('orgTab', 'nav-tab-org-sites')
144
+ },
145
+ {
146
+ id: 'media',
147
+ label: 'Media',
148
+ icon: ICONS.media,
149
+ screen: 'site.media',
150
+ order: 90,
151
+ console: ref('orgTab', 'nav-tab-org-media')
152
+ }
153
+ ]
154
+ }
155
+ ]
156
+ };
157
+ const SITE = {
158
+ id: 'site',
159
+ groups: [
160
+ {
161
+ id: 'top',
162
+ foldable: false,
163
+ rows: [
164
+ HOME_ROW,
165
+ {
166
+ id: 'overview',
167
+ label: 'Overview',
168
+ consoleLabel: 'Analytics',
169
+ icon: ICONS.overview,
170
+ screen: 'shell.analytics',
171
+ order: 20,
172
+ keywords: [
173
+ 'analytics',
174
+ 'traffic',
175
+ 'visitors'
176
+ ],
177
+ console: ref('hostTab', 'nav-tab-analytics')
178
+ }
179
+ ]
180
+ },
181
+ {
182
+ id: 'starred',
183
+ label: 'Starred',
184
+ foldable: true,
185
+ dynamic: 'starred',
186
+ rows: []
187
+ },
188
+ {
189
+ id: 'website',
190
+ label: 'Website',
191
+ foldable: true,
192
+ rows: [
193
+ {
194
+ id: 'pages',
195
+ label: 'Pages',
196
+ icon: ICONS.pages,
197
+ screen: 'site.pages',
198
+ order: 10,
199
+ sections: [
200
+ {
201
+ id: 'pages',
202
+ label: 'Pages',
203
+ screen: 'site.pages',
204
+ console: ref('hostTab', 'nav-tab-screens')
205
+ },
206
+ {
207
+ id: 'components',
208
+ label: 'Components',
209
+ screen: 'site.components',
210
+ console: ref('hostTab', 'nav-tab-components')
211
+ },
212
+ {
213
+ id: 'layouts',
214
+ label: 'Layouts',
215
+ screen: 'site.layouts',
216
+ console: ref('hostTab', 'nav-tab-layouts')
217
+ },
218
+ {
219
+ id: 'templates',
220
+ label: 'Templates',
221
+ screen: 'site.templates',
222
+ console: ref('hostTab', 'nav-tab-templates')
223
+ },
224
+ {
225
+ id: 'content',
226
+ label: 'Content',
227
+ screen: 'site.content',
228
+ console: ref('hostTab', 'nav-tab-content')
229
+ }
230
+ ],
231
+ console: ref('hostTab', 'nav-tab-screens')
232
+ },
233
+ {
234
+ id: 'media',
235
+ label: 'Media',
236
+ icon: ICONS.media,
237
+ screen: 'site.media',
238
+ order: 20,
239
+ console: ref('hostTab', 'nav-tab-media')
240
+ }
241
+ ]
242
+ },
243
+ {
244
+ id: 'sell',
245
+ label: 'Sell',
246
+ foldable: true,
247
+ rows: []
248
+ },
249
+ {
250
+ id: 'customers',
251
+ label: 'Customers',
252
+ foldable: true,
253
+ rows: []
254
+ },
255
+ {
256
+ id: 'more',
257
+ label: 'More',
258
+ foldable: true,
259
+ rows: []
260
+ },
261
+ {
262
+ id: 'settings',
263
+ foldable: false,
264
+ rows: [
265
+ {
266
+ id: 'siteSettings',
267
+ label: 'Site settings',
268
+ icon: ICONS.settings,
269
+ screen: 'shell.siteSettings',
270
+ order: 10,
271
+ console: ref('shell', 'siteSettings')
272
+ }
273
+ ]
274
+ }
275
+ ]
276
+ };
277
+ /** Each row's place, in the order written. */ const ordered = (rows)=>rows.map((row, index)=>{
278
+ var _row_order;
279
+ return _extends({}, row, {
280
+ order: (_row_order = row.order) != null ? _row_order : (index + 1) * 10
281
+ });
282
+ });
283
+ /** The help page each settings hub's `help` prop names, the rows' docs. */ const HUB_DOCS = {
284
+ teamSection: '/workspace-and-billing/teams-and-roles/overview#team-page',
285
+ billingSection: '/workspace-and-billing/billing-and-plans/overview#billing-page',
286
+ orgSettingsSection: '/getting-started/console-tour#organization-settings',
287
+ hostAdminSection: '/getting-started/create-a-site#site-admin'
288
+ };
289
+ const setupRow = (id, label, rowIcon, description, keywords)=>_extends({
290
+ id,
291
+ label,
292
+ icon: rowIcon,
293
+ screen: id === 'theme' ? 'site.theme' : 'site.setup'
294
+ }, id === 'theme' ? {} : {
295
+ params: {
296
+ section: id
297
+ }
298
+ }, {
299
+ description
300
+ }, keywords ? {
301
+ keywords
302
+ } : {}, {
303
+ console: ref('setupSection', id)
304
+ });
305
+ const adminRow = (id, label, rowIcon, screen, route)=>({
306
+ id,
307
+ label,
308
+ icon: rowIcon,
309
+ screen,
310
+ requiresHostAdmin: true,
311
+ docs: HUB_DOCS.hostAdminSection,
312
+ console: ref('hostAdminSection', route)
313
+ });
314
+ const settingsRow = (surface, id, label, rowIcon, screen, route, extra = {})=>_extends({
315
+ id,
316
+ label,
317
+ icon: rowIcon,
318
+ screen
319
+ }, extra, HUB_DOCS[surface] ? {
320
+ docs: HUB_DOCS[surface]
321
+ } : {}, {
322
+ console: ref(surface, route)
323
+ });
324
+ const WORKSPACE_SETTINGS = {
325
+ id: 'workspaceSettings',
326
+ title: 'settings',
327
+ groups: [
328
+ {
329
+ id: 'team',
330
+ label: 'Team',
331
+ foldable: false,
332
+ rows: ordered([
333
+ settingsRow('teamSection', 'members', 'Members', ICONS.members, 'core.team', 'MANAGE_TEAM_MEMBERS', {
334
+ keywords: [
335
+ 'team',
336
+ 'invite',
337
+ 'people'
338
+ ]
339
+ }),
340
+ settingsRow('teamSection', 'roles', 'Custom roles', ICONS.roles, 'core.team.roles', 'MANAGE_TEAM_ROLES', {
341
+ keywords: [
342
+ 'permissions'
343
+ ]
344
+ }),
345
+ settingsRow('teamSection', 'activity', 'Recent activity', ICONS.activity, 'core.team.activity', 'MANAGE_TEAM_ACTIVITY', {
346
+ keywords: [
347
+ 'audit log'
348
+ ]
349
+ })
350
+ ])
351
+ },
352
+ {
353
+ id: 'billing',
354
+ label: 'Billing',
355
+ foldable: false,
356
+ rows: [
357
+ settingsRow('billingSection', 'plan', 'Plan', ICONS.plan, 'core.billing', 'MANAGE_BILLING', {
358
+ order: 10,
359
+ keywords: [
360
+ 'billing',
361
+ 'upgrade',
362
+ 'subscription'
363
+ ]
364
+ }),
365
+ settingsRow('billingSection', 'usage', 'Usage', ICONS.usage, 'core.billing.usage', 'MANAGE_BILLING_USAGE', {
366
+ order: 20,
367
+ keywords: [
368
+ 'billing',
369
+ 'limits'
370
+ ]
371
+ }),
372
+ settingsRow('billingSection', 'invoices', 'Invoices', ICONS.invoices, 'core.billing.invoices', 'MANAGE_BILLING_INVOICES', {
373
+ order: 40,
374
+ keywords: [
375
+ 'billing',
376
+ 'receipts'
377
+ ]
378
+ }),
379
+ settingsRow('billingSection', 'billingSettings', 'Settings', ICONS.billingSettings, 'core.billing.settings', 'MANAGE_BILLING_SETTINGS', {
380
+ order: 50,
381
+ keywords: [
382
+ 'billing',
383
+ 'payment method',
384
+ 'tax'
385
+ ]
386
+ })
387
+ ]
388
+ },
389
+ {
390
+ id: 'workspace',
391
+ label: 'Workspace',
392
+ foldable: false,
393
+ rows: ordered([
394
+ settingsRow('orgTab', 'plugins', 'Plugins', ICONS.plugins, 'core.plugins', 'nav-tab-org-plugins'),
395
+ settingsRow('orgSettingsSection', 'branding', 'Branding', ICONS.branding, 'core.settings.branding', 'ORG_SETTINGS_BRANDING', {
396
+ keywords: [
397
+ 'white label',
398
+ 'logo',
399
+ 'colors'
400
+ ]
401
+ }),
402
+ settingsRow('orgSettingsSection', 'sso', 'Single sign-on', ICONS.sso, 'core.settings.sso', 'ORG_SETTINGS_SSO', {
403
+ keywords: [
404
+ 'sso',
405
+ 'saml'
406
+ ]
407
+ }),
408
+ settingsRow('orgSettingsSection', 'profile', 'Profile', ICONS.profile, 'core.settings.profile', 'ORG_SETTINGS_PROFILE'),
409
+ settingsRow('orgSettingsSection', 'apiKeys', 'API keys', ICONS.apiKeys, 'core.settings.apiKeys', 'ORG_SETTINGS_API_KEYS'),
410
+ settingsRow('orgSettingsSection', 'integrations', 'Integrations', ICONS.integrations, 'core.settings.integrations', 'ORG_SETTINGS_INTEGRATIONS'),
411
+ settingsRow('orgSettingsSection', 'general', 'General', ICONS.settings, 'core.settings.general', 'ORG_SETTINGS_GENERAL', {
412
+ keywords: [
413
+ 'name',
414
+ 'address'
415
+ ]
416
+ })
417
+ ])
418
+ },
419
+ {
420
+ id: 'data',
421
+ label: 'Data & compliance',
422
+ foldable: false,
423
+ rows: ordered([
424
+ settingsRow('orgSettingsSection', 'privacy', 'Privacy', ICONS.privacy, 'core.settings.privacy', 'ORG_SETTINGS_PRIVACY', {
425
+ keywords: [
426
+ 'gdpr',
427
+ 'erase'
428
+ ]
429
+ }),
430
+ settingsRow('orgSettingsSection', 'holds', 'Holds & reviews', ICONS.holds, 'core.settings.holds', 'ORG_SETTINGS_HOLDS'),
431
+ settingsRow('orgSettingsSection', 'importExport', 'Import & export', ICONS.importExport, 'core.settings.data', 'ORG_SETTINGS_DATA', {
432
+ keywords: [
433
+ 'csv',
434
+ 'export'
435
+ ]
436
+ })
437
+ ])
438
+ },
439
+ {
440
+ id: 'danger',
441
+ label: 'Danger zone',
442
+ foldable: false,
443
+ rows: ordered([
444
+ settingsRow('orgSettingsSection', 'ownership', 'Ownership', ICONS.ownership, 'core.settings.ownership', 'ORG_SETTINGS_OWNERSHIP', {
445
+ keywords: [
446
+ 'transfer'
447
+ ]
448
+ }),
449
+ settingsRow('orgSettingsSection', 'delete', 'Delete', ICONS.delete, 'core.settings.delete', 'ORG_SETTINGS_DELETE')
450
+ ])
451
+ }
452
+ ]
453
+ };
454
+ const SITE_SETTINGS = {
455
+ id: 'siteSettings',
456
+ title: 'settings',
457
+ groups: [
458
+ {
459
+ id: 'people',
460
+ foldable: false,
461
+ rows: ordered([
462
+ {
463
+ id: 'users',
464
+ label: 'Users',
465
+ icon: ICONS.members,
466
+ screen: 'core.site.users',
467
+ keywords: [
468
+ 'team',
469
+ 'collaborators'
470
+ ],
471
+ console: ref('hostTab', 'nav-tab-users')
472
+ }
473
+ ])
474
+ },
475
+ {
476
+ id: 'setup',
477
+ label: 'Setup',
478
+ foldable: false,
479
+ rows: ordered([
480
+ setupRow('details', 'Basic details', ICONS.details, 'Logo, business details, layout and languages'),
481
+ setupRow('business', 'Business profile', ICONS.business, 'What the business is, for everything that writes about it'),
482
+ setupRow('seo', 'SEO', ICONS.seo, 'Search title, social image, business profile and verification', [
483
+ 'search'
484
+ ]),
485
+ setupRow('tracking', 'Tracking', ICONS.tracking, 'Analytics, ad tags and the consent banner', [
486
+ 'cookies',
487
+ 'pixels'
488
+ ]),
489
+ setupRow('theme', 'Theme', ICONS.theme, 'Colors, font, shape and your saved themes', [
490
+ 'colors',
491
+ 'fonts'
492
+ ]),
493
+ setupRow('emails', 'Emails', ICONS.emails, 'The emails your site sends to customers'),
494
+ setupRow('integrations', 'Integrations', ICONS.integrations, 'Email platforms, Zapier, live chat and the other tools your site connects to')
495
+ ])
496
+ },
497
+ {
498
+ id: 'admin',
499
+ label: 'Admin',
500
+ foldable: false,
501
+ rows: ordered([
502
+ adminRow('general', 'General', ICONS.settings, 'core.site.general', 'HOST_ADMIN_GENERAL'),
503
+ adminRow('plugins', 'Plugins', ICONS.plugins, 'core.site.plugins', 'HOST_ADMIN_PLUGINS'),
504
+ adminRow('domain', 'Custom Domain', ICONS.domain, 'core.site.domain', 'HOST_ADMIN_DOMAIN'),
505
+ adminRow('security', 'Security', ICONS.security, 'core.site.security', 'HOST_ADMIN_SECURITY'),
506
+ adminRow('errorPages', 'Error pages', ICONS.errorPages, 'core.site.errorPages', 'HOST_ADMIN_ERROR_PAGES'),
507
+ adminRow('activity', 'Activity', ICONS.activity, 'core.site.activity', 'HOST_ADMIN_ACTIVITY'),
508
+ adminRow('backup', 'Backup & template', ICONS.backup, 'core.site.backup', 'HOST_ADMIN_BACKUP'),
509
+ adminRow('danger', 'Danger zone', ICONS.delete, 'core.site.delete', 'HOST_ADMIN_DANGER')
510
+ ])
511
+ }
512
+ ]
513
+ };
514
+ const CREATE = [
515
+ {
516
+ scope: 'workspace',
517
+ items: [
518
+ {
519
+ id: 'site',
520
+ label: 'Site',
521
+ icon: ICONS.sites,
522
+ screen: 'site.sites',
523
+ params: {
524
+ new: '1'
525
+ },
526
+ permission: 'hosts.create',
527
+ order: 10,
528
+ console: ref('orgTab', 'nav-tab-org-sites')
529
+ }
530
+ ]
531
+ },
532
+ {
533
+ scope: 'site',
534
+ items: [
535
+ {
536
+ id: 'page',
537
+ label: 'Page',
538
+ icon: ICONS.pages,
539
+ screen: 'site.pages',
540
+ params: {
541
+ new: '1'
542
+ },
543
+ hostRoles: [
544
+ 'admin',
545
+ 'editor',
546
+ 'author'
547
+ ],
548
+ order: 10,
549
+ console: ref('hostTab', 'nav-tab-screens')
550
+ }
551
+ ]
552
+ }
553
+ ];
554
+ /**
555
+ * The core's half of the manifest: every list and group, and the core's own
556
+ * rows. The manifest the apps read (`ContractValues.nativeNavManifest`) is
557
+ * this with each plugin's `NATIVE_NAV_ROWS` placed by `assembleNativeNav`.
558
+ */ export const NATIVE_NAV_MANIFEST = {
559
+ lists: [
560
+ WORKSPACE,
561
+ SITE,
562
+ WORKSPACE_SETTINGS,
563
+ SITE_SETTINGS
564
+ ],
565
+ create: CREATE,
566
+ shellScreens: [
567
+ ...NATIVE_NAV_SHELL_SCREENS
568
+ ],
569
+ elsewhere: [
570
+ {
571
+ console: ref('hostTab', 'nav-tab-dashboard'),
572
+ where: 'Home, inside the site (shell.home)'
573
+ },
574
+ {
575
+ console: ref('hostTab', 'nav-tab-setup'),
576
+ where: 'Site settings → Setup'
577
+ },
578
+ {
579
+ console: ref('hostTab', 'nav-tab-admin'),
580
+ where: 'Site settings → Admin'
581
+ },
582
+ {
583
+ console: ref('orgTab', 'nav-tab-org-team'),
584
+ where: 'Workspace settings → Team'
585
+ },
586
+ {
587
+ console: ref('orgTab', 'nav-tab-org-billing'),
588
+ where: 'Workspace settings → Billing'
589
+ },
590
+ {
591
+ console: ref('orgTab', 'nav-tab-org-settings'),
592
+ where: 'Workspace settings'
593
+ },
594
+ {
595
+ console: ref('orgTab', 'nav-tab-org-support'),
596
+ where: 'Help menu → Contact support (core.support)'
597
+ }
598
+ ]
599
+ };
600
+ /**
601
+ * The manifest with the plugins' rows placed: each into its list's group by
602
+ * `order` (a tie keeps the core's row first, then registration order). A row
603
+ * naming a list or group the core does not have is refused by name, so a
604
+ * plugin cannot quietly invent a group.
605
+ */ export function assembleNativeNav(core, contributions, elsewhere = [], creates = []) {
606
+ var _core_create;
607
+ const byOrder = (entries)=>entries.map((entry, index)=>({
608
+ entry,
609
+ index
610
+ })).sort((a, b)=>{
611
+ var _a_entry_order, _b_entry_order;
612
+ return ((_a_entry_order = a.entry.order) != null ? _a_entry_order : 0) - ((_b_entry_order = b.entry.order) != null ? _b_entry_order : 0) || a.index - b.index;
613
+ }).map(({ entry })=>entry);
614
+ const lists = core.lists.map((list)=>_extends({}, list, {
615
+ groups: list.groups.map((group)=>_extends({}, group, {
616
+ rows: [
617
+ ...group.rows
618
+ ]
619
+ }))
620
+ }));
621
+ for (const { list: listId, group: groupId, row } of contributions){
622
+ var _lists_find;
623
+ const group = (_lists_find = lists.find((list)=>list.id === listId)) == null ? void 0 : _lists_find.groups.find((entry)=>entry.id === groupId);
624
+ if (!group || group.dynamic) {
625
+ throw new Error(`native nav: ${row.id} names ${listId}/${groupId}, which is not a group of rows`);
626
+ }
627
+ if (group.rows.some((entry)=>entry.id === row.id)) {
628
+ throw new Error(`native nav: ${listId}/${groupId} holds ${row.id} twice`);
629
+ }
630
+ group.rows.push(row);
631
+ }
632
+ for (const list of lists){
633
+ for (const group of list.groups){
634
+ // A section is helped by its row's page unless the console names its own.
635
+ group.rows = byOrder(group.rows).map((row)=>row.docs && row.sections ? _extends({}, row, {
636
+ sections: row.sections.map((section)=>section.docs ? section : _extends({}, section, {
637
+ docs: row.docs
638
+ }))
639
+ }) : row);
640
+ }
641
+ }
642
+ const create = ((_core_create = core.create) != null ? _core_create : []).map((entry)=>_extends({}, entry, {
643
+ items: [
644
+ ...entry.items
645
+ ]
646
+ }));
647
+ for (const { scope, item } of creates){
648
+ const target = create.find((entry)=>entry.scope === scope);
649
+ if (!target) throw new Error(`native nav: create item ${item.id} names ${scope}, which has no menu`);
650
+ if (target.items.some((entry)=>entry.id === item.id)) {
651
+ throw new Error(`native nav: the ${scope} create menu holds ${item.id} twice`);
652
+ }
653
+ target.items.push(item);
654
+ }
655
+ return _extends({}, core, {
656
+ lists,
657
+ create: create.map((entry)=>_extends({}, entry, {
658
+ items: byOrder(entry.items)
659
+ })),
660
+ elsewhere: [
661
+ ...core.elsewhere,
662
+ ...elsewhere
663
+ ]
664
+ });
665
+ }
666
+ /** What a Create new item that cannot be used says, when its own reason does not apply. */ export const NATIVE_CREATE_PERMISSION_REASON = "Your role can't create this here. Ask an owner or admin of the workspace.";
667
+ export const NATIVE_CREATE_SITE_ROLE_REASON = "Your role on this site can't create this. Ask a site admin.";
668
+ export const NATIVE_CREATE_PLAN_REASON = "Your plan doesn't include this. See the plans in Billing.";
669
+ /**
670
+ * The Create new menu for the workspace or site in hand. An item of a plugin
671
+ * that is off is not offered, nor an admin-only item to a non-admin. One the
672
+ * person may not use is SHOWN, disabled with its reason (prerequisites are
673
+ * shown, never hidden): a permission or site role they lack, then a plan
674
+ * feature the workspace lacks. `permissions` and `features` are the
675
+ * workspace's resolved answers (an absent key is not held); `hostRole` is
676
+ * the person's role on the site, null at the workspace.
677
+ */ export function resolveCreateList(manifest, scope, enabledPluginIds, permissions, features, hostRole) {
678
+ var _ref;
679
+ var _manifest_create_find, _manifest_create;
680
+ const on = new Set(enabledPluginIds);
681
+ const items = (_ref = (_manifest_create = manifest.create) == null ? void 0 : (_manifest_create_find = _manifest_create.find((entry)=>entry.scope === scope)) == null ? void 0 : _manifest_create_find.items) != null ? _ref : [];
682
+ return items.filter((item)=>(!item.pluginId || on.has(item.pluginId)) && (!item.requiresHostAdmin || hostRole === 'admin')).map((item)=>{
683
+ if (item.permission && permissions[item.permission] !== true) {
684
+ return _extends({}, item, {
685
+ blocked: true,
686
+ reason: NATIVE_CREATE_PERMISSION_REASON
687
+ });
688
+ }
689
+ if (item.hostRoles && !item.hostRoles.includes(hostRole != null ? hostRole : '')) {
690
+ return _extends({}, item, {
691
+ blocked: true,
692
+ reason: NATIVE_CREATE_SITE_ROLE_REASON
693
+ });
694
+ }
695
+ if (item.planFeature && features[item.planFeature] !== true) {
696
+ var _item_blockedReason;
697
+ return _extends({}, item, {
698
+ blocked: true,
699
+ reason: (_item_blockedReason = item.blockedReason) != null ? _item_blockedReason : NATIVE_CREATE_PLAN_REASON
700
+ });
701
+ }
702
+ return _extends({}, item, {
703
+ blocked: false
704
+ });
705
+ });
706
+ }
707
+ /**
708
+ * One list for the workspace or site in hand, from the assembled manifest
709
+ * (`ContractValues.nativeNavManifest`). `enabledPluginIds` is the site's
710
+ * effective set (`resolveHostEnabledPlugins`) in site scope and the
711
+ * workspace's (`resolveEnabledPlugins`) otherwise. A section of another
712
+ * plugin than its row's hides with that plugin. A group left with no rows is
713
+ * dropped, except the starred group, which the shell fills.
714
+ */ export function resolveNavList(manifest, listId, enabledPluginIds, hostAdmin) {
715
+ const list = manifest.lists.find((entry)=>entry.id === listId);
716
+ if (!list) return {
717
+ id: listId,
718
+ groups: []
719
+ };
720
+ const on = new Set(enabledPluginIds);
721
+ const shows = (pluginId)=>!pluginId || on.has(pluginId);
722
+ const groups = [];
723
+ for (const group of list.groups){
724
+ const rows = group.rows.filter((row)=>shows(row.pluginId) && (hostAdmin || !row.requiresHostAdmin)).map((row)=>row.sections ? _extends({}, row, {
725
+ sections: row.sections.filter((section)=>shows(section.pluginId))
726
+ }) : row);
727
+ if (!rows.length && !group.dynamic) continue;
728
+ groups.push(_extends({}, group, {
729
+ rows
730
+ }));
731
+ }
732
+ return _extends({
733
+ id: list.id
734
+ }, list.title ? {
735
+ title: list.title
736
+ } : {}, {
737
+ groups
738
+ });
739
+ }
740
+
741
+ //# sourceMappingURL=native-nav.js.map