@panneau/app 5.0.0-alpha.4 → 5.0.0-alpha.5

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 (103) hide show
  1. package/README.md +32 -5
  2. package/dist/Panneau.css +19 -0
  3. package/dist/Panneau.d.ts +7 -1
  4. package/dist/Panneau.d.ts.map +1 -1
  5. package/dist/Panneau.js +137 -30
  6. package/dist/Panneau.js.map +1 -1
  7. package/dist/Panneau.module.js +12 -0
  8. package/dist/Panneau.module.js.map +1 -0
  9. package/dist/Shell.d.ts +8 -3
  10. package/dist/Shell.d.ts.map +1 -1
  11. package/dist/Shell.js +272 -114
  12. package/dist/Shell.js.map +1 -1
  13. package/dist/createPanneauApp.d.ts +3 -0
  14. package/dist/createPanneauApp.d.ts.map +1 -1
  15. package/dist/createPanneauApp.js.map +1 -1
  16. package/dist/cx.d.ts +3 -0
  17. package/dist/cx.d.ts.map +1 -0
  18. package/dist/cx.js +9 -0
  19. package/dist/cx.js.map +1 -0
  20. package/dist/documentTitle.d.ts +10 -0
  21. package/dist/documentTitle.d.ts.map +1 -0
  22. package/dist/documentTitle.js +49 -0
  23. package/dist/documentTitle.js.map +1 -0
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +2 -1
  27. package/dist/location.d.ts +13 -1
  28. package/dist/location.d.ts.map +1 -1
  29. package/dist/location.js +55 -48
  30. package/dist/location.js.map +1 -1
  31. package/dist/navigation.d.ts +53 -0
  32. package/dist/navigation.d.ts.map +1 -0
  33. package/dist/navigation.js +117 -0
  34. package/dist/navigation.js.map +1 -0
  35. package/dist/pages/HomePage.d.ts +11 -0
  36. package/dist/pages/HomePage.d.ts.map +1 -0
  37. package/dist/pages/HomePage.js +111 -0
  38. package/dist/pages/HomePage.js.map +1 -0
  39. package/dist/pages/ItemPanel.css +164 -0
  40. package/dist/pages/ItemPanel.d.ts +17 -0
  41. package/dist/pages/ItemPanel.d.ts.map +1 -0
  42. package/dist/pages/ItemPanel.js +370 -0
  43. package/dist/pages/ItemPanel.js.map +1 -0
  44. package/dist/pages/ItemPanel.module.js +34 -0
  45. package/dist/pages/ItemPanel.module.js.map +1 -0
  46. package/dist/pages/ItemPreview.d.ts +15 -0
  47. package/dist/pages/ItemPreview.d.ts.map +1 -0
  48. package/dist/pages/ItemPreview.js +179 -0
  49. package/dist/pages/ItemPreview.js.map +1 -0
  50. package/dist/pages/NotFoundPage.d.ts +6 -0
  51. package/dist/pages/NotFoundPage.d.ts.map +1 -0
  52. package/dist/pages/NotFoundPage.js +93 -0
  53. package/dist/pages/NotFoundPage.js.map +1 -0
  54. package/dist/pages/PageHeader.d.ts +21 -0
  55. package/dist/pages/PageHeader.d.ts.map +1 -0
  56. package/dist/pages/PageHeader.js +86 -0
  57. package/dist/pages/PageHeader.js.map +1 -0
  58. package/dist/pages/ResourceFormPage.d.ts +15 -0
  59. package/dist/pages/ResourceFormPage.d.ts.map +1 -0
  60. package/dist/pages/ResourceFormPage.js +204 -0
  61. package/dist/pages/ResourceFormPage.js.map +1 -0
  62. package/dist/pages/ResourceListPage.d.ts +15 -0
  63. package/dist/pages/ResourceListPage.d.ts.map +1 -0
  64. package/dist/pages/ResourceListPage.js +101 -0
  65. package/dist/pages/ResourceListPage.js.map +1 -0
  66. package/dist/pages/itemTitle.d.ts +7 -0
  67. package/dist/pages/itemTitle.d.ts.map +1 -0
  68. package/dist/pages/itemTitle.js +18 -0
  69. package/dist/pages/itemTitle.js.map +1 -0
  70. package/dist/pages/pages.css +162 -0
  71. package/dist/pages/pages.module.js +40 -0
  72. package/dist/pages/pages.module.js.map +1 -0
  73. package/dist/preferences.d.ts +6 -0
  74. package/dist/preferences.d.ts.map +1 -0
  75. package/dist/preferences.js +53 -0
  76. package/dist/preferences.js.map +1 -0
  77. package/dist/recentItems.d.ts +15 -0
  78. package/dist/recentItems.d.ts.map +1 -0
  79. package/dist/recentItems.js +70 -0
  80. package/dist/recentItems.js.map +1 -0
  81. package/dist/shell/AppLayout.css +189 -0
  82. package/dist/shell/AppLayout.d.ts +22 -0
  83. package/dist/shell/AppLayout.d.ts.map +1 -0
  84. package/dist/shell/AppLayout.js +365 -0
  85. package/dist/shell/AppLayout.js.map +1 -0
  86. package/dist/shell/AppLayout.module.js +36 -0
  87. package/dist/shell/AppLayout.module.js.map +1 -0
  88. package/dist/shell/GoTo.d.ts +20 -0
  89. package/dist/shell/GoTo.d.ts.map +1 -0
  90. package/dist/shell/GoTo.js +370 -0
  91. package/dist/shell/GoTo.js.map +1 -0
  92. package/dist/shell/Sidebar.css +313 -0
  93. package/dist/shell/Sidebar.d.ts +29 -0
  94. package/dist/shell/Sidebar.d.ts.map +1 -0
  95. package/dist/shell/Sidebar.js +225 -0
  96. package/dist/shell/Sidebar.js.map +1 -0
  97. package/dist/shell/Sidebar.module.js +60 -0
  98. package/dist/shell/Sidebar.module.js.map +1 -0
  99. package/dist/shell/tokens.d.ts +23 -0
  100. package/dist/shell/tokens.d.ts.map +1 -0
  101. package/dist/shell/tokens.js +75 -0
  102. package/dist/shell/tokens.js.map +1 -0
  103. package/package.json +15 -6
@@ -0,0 +1,370 @@
1
+ import { routePath } from "../routes.js";
2
+ import { capitalize, getNavigation } from "../navigation.js";
3
+ import { readRecentItems, useRecentScope } from "../recentItems.js";
4
+ import { getItemTitle } from "../pages/itemTitle.js";
5
+ import { COLOR_SCHEMES } from "./Sidebar.js";
6
+ import { useEffect, useState } from "react";
7
+ import { c } from "react/compiler-runtime";
8
+ import { getCommands, getSearchableResources, resolveResource, usePlugins } from "@panneau/core";
9
+ import { isApiError } from "@panneau/data";
10
+ import { useSearch } from "@panneau/data/query";
11
+ import { appMessages } from "@panneau/intl";
12
+ import { CommandPalette, getNamedIcon, usePanneauIntl } from "@panneau/ui";
13
+ import { jsx } from "react/jsx-runtime";
14
+ import { Clock, File, House, Link2, List, Monitor, Moon, PanelLeftClose, PanelLeftOpen, Plus, Search, Sun, Terminal } from "lucide-react";
15
+ import { toText } from "@panneau/lists";
16
+ import { SEARCH_MAX_LIMIT, SEARCH_MIN_LENGTH, toSearchParams } from "@panneau/protocol/runtime";
17
+ //#region src/shell/GoTo.tsx
18
+ /** The pause after typing before the palette searches the server. */
19
+ var SEARCH_DELAY = 300;
20
+ var SCHEME_ICONS = {
21
+ light: Sun,
22
+ dark: Moon,
23
+ auto: Monitor
24
+ };
25
+ function navIcon(link) {
26
+ if (link.icon !== void 0) return getNamedIcon(link.icon);
27
+ switch (link.target.kind) {
28
+ case "home": return House;
29
+ case "resource": return List;
30
+ case "page": return File;
31
+ case "url": return Link2;
32
+ }
33
+ }
34
+ /** The URL of an item's image (`itemImage`): a URL, or a media with a thumbnail. */
35
+ function imageOf(item, resource) {
36
+ const value = resource.itemImage !== void 0 ? item[resource.itemImage] : void 0;
37
+ if (typeof value === "string") return value;
38
+ if (value !== null && typeof value === "object") {
39
+ const url = value.media?.thumbnailUrl ?? value.thumbnailUrl;
40
+ return typeof url === "string" ? url : void 0;
41
+ }
42
+ }
43
+ /**
44
+ * The "Go to…" palette of the app (decision 0029): recent items, navigation, "New {resource}",
45
+ * the commands of plugins, the app's actions, then the results of the server's search, grouped by
46
+ * resource. An item opens its edit form. "Search in" narrows the palette to the results of one
47
+ * resource, 20 of them, until Backspace in the empty field.
48
+ */
49
+ function GoTo(t0) {
50
+ const $ = c(54);
51
+ const { definition, basePath, isOpen, onOpenChange, sidebarCollapsed, onToggleSidebar, colorScheme, onColorSchemeChange } = t0;
52
+ const intl = usePanneauIntl();
53
+ const plugins = usePlugins();
54
+ const user = useRecentScope();
55
+ const [query, setQuery] = useState("");
56
+ const [debounced, setDebounced] = useState("");
57
+ const [scope, setScope] = useState(null);
58
+ const locale = definition.locale;
59
+ const searchable = getSearchableResources(definition);
60
+ const searchEnabled = definition.search?.enabled !== false && searchable.length > 0;
61
+ let t1;
62
+ let t2;
63
+ if ($[0] !== query) {
64
+ t1 = () => {
65
+ const timeout = window.setTimeout(() => setDebounced(query.trim()), SEARCH_DELAY);
66
+ return () => window.clearTimeout(timeout);
67
+ };
68
+ t2 = [query];
69
+ $[0] = query;
70
+ $[1] = t1;
71
+ $[2] = t2;
72
+ } else {
73
+ t1 = $[1];
74
+ t2 = $[2];
75
+ }
76
+ useEffect(t1, t2);
77
+ let t3;
78
+ if ($[3] !== definition.resources) {
79
+ t3 = (id) => definition.resources.find((resource) => resource.id === id);
80
+ $[3] = definition.resources;
81
+ $[4] = t3;
82
+ } else t3 = $[4];
83
+ const resourceOf = t3;
84
+ const scoped = scope !== null ? resourceOf(scope) ?? null : null;
85
+ const search = useSearch(debounced, {
86
+ enabled: isOpen && searchEnabled && debounced.length >= SEARCH_MIN_LENGTH,
87
+ ...scoped !== null && {
88
+ limit: SEARCH_MAX_LIMIT,
89
+ resources: [scoped.id]
90
+ }
91
+ });
92
+ let t4;
93
+ if ($[5] !== onOpenChange) {
94
+ t4 = (open) => {
95
+ if (!open) setScope(null);
96
+ onOpenChange(open);
97
+ };
98
+ $[5] = onOpenChange;
99
+ $[6] = t4;
100
+ } else t4 = $[6];
101
+ const changeOpen = t4;
102
+ let t5;
103
+ if ($[7] !== basePath) {
104
+ t5 = (resource_0, id_0) => routePath({
105
+ name: "resource.edit",
106
+ resource: resource_0,
107
+ id: id_0
108
+ }, basePath);
109
+ $[7] = basePath;
110
+ $[8] = t5;
111
+ } else t5 = $[8];
112
+ const editPath = t5;
113
+ let t6;
114
+ if ($[9] !== basePath || $[10] !== editPath || $[11] !== isOpen || $[12] !== locale || $[13] !== resourceOf || $[14] !== user) {
115
+ t6 = isOpen ? readRecentItems(basePath, user).flatMap((entry) => {
116
+ const resource_1 = resourceOf(entry.resource);
117
+ return resource_1 !== void 0 ? [{
118
+ id: `${entry.resource}:${entry.id}`,
119
+ label: entry.title,
120
+ description: capitalize(resource_1.label.singular, locale),
121
+ icon: resource_1.icon !== void 0 ? getNamedIcon(resource_1.icon) : Clock,
122
+ href: editPath(entry.resource, entry.id)
123
+ }] : [];
124
+ }) : [];
125
+ $[9] = basePath;
126
+ $[10] = editPath;
127
+ $[11] = isOpen;
128
+ $[12] = locale;
129
+ $[13] = resourceOf;
130
+ $[14] = user;
131
+ $[15] = t6;
132
+ } else t6 = $[15];
133
+ const recent = t6;
134
+ let t7;
135
+ if ($[16] !== intl) {
136
+ t7 = intl.formatMessage(appMessages.home);
137
+ $[16] = intl;
138
+ $[17] = t7;
139
+ } else t7 = $[17];
140
+ let t8;
141
+ if ($[18] !== basePath) {
142
+ t8 = routePath({ name: "home" }, basePath);
143
+ $[18] = basePath;
144
+ $[19] = t8;
145
+ } else t8 = $[19];
146
+ let t9;
147
+ if ($[20] !== t7 || $[21] !== t8) {
148
+ t9 = {
149
+ id: "home",
150
+ label: t7,
151
+ icon: House,
152
+ href: t8
153
+ };
154
+ $[20] = t7;
155
+ $[21] = t8;
156
+ $[22] = t9;
157
+ } else t9 = $[22];
158
+ let t10;
159
+ if ($[23] !== basePath || $[24] !== definition || $[25] !== t9) {
160
+ t10 = [t9, ...getNavigation(definition, basePath).flatMap(_temp).map(_temp2)];
161
+ $[23] = basePath;
162
+ $[24] = definition;
163
+ $[25] = t9;
164
+ $[26] = t10;
165
+ } else t10 = $[26];
166
+ const navigation = t10;
167
+ let t11;
168
+ if ($[27] !== basePath || $[28] !== definition.resources || $[29] !== intl) {
169
+ let t12;
170
+ if ($[31] !== basePath || $[32] !== intl) {
171
+ t12 = (resource_2) => resolveResource(resource_2).abilities.create ? [{
172
+ id: resource_2.id,
173
+ label: intl.formatMessage(appMessages.create, { resource: resource_2.label.singular }),
174
+ keywords: [resource_2.label.plural],
175
+ icon: Plus,
176
+ href: routePath({
177
+ name: "resource.create",
178
+ resource: resource_2.id
179
+ }, basePath)
180
+ }] : [];
181
+ $[31] = basePath;
182
+ $[32] = intl;
183
+ $[33] = t12;
184
+ } else t12 = $[33];
185
+ t11 = definition.resources.flatMap(t12);
186
+ $[27] = basePath;
187
+ $[28] = definition.resources;
188
+ $[29] = intl;
189
+ $[30] = t11;
190
+ } else t11 = $[30];
191
+ const create = t11;
192
+ const commandGroups = /* @__PURE__ */ new Map();
193
+ getCommands(plugins.commands, { definition }).forEach((command) => {
194
+ const group = command.group ?? intl.formatMessage(appMessages.groupCommands);
195
+ commandGroups.set(group, [...commandGroups.get(group) ?? [], {
196
+ id: command.id,
197
+ label: command.label,
198
+ description: command.description,
199
+ keywords: command.keywords,
200
+ icon: command.icon !== void 0 ? getNamedIcon(command.icon) : Terminal,
201
+ href: command.href,
202
+ onAction: command.perform
203
+ }]);
204
+ });
205
+ let t12;
206
+ if ($[34] !== intl || $[35] !== sidebarCollapsed) {
207
+ t12 = intl.formatMessage(sidebarCollapsed ? appMessages.expandSidebar : appMessages.collapseSidebar);
208
+ $[34] = intl;
209
+ $[35] = sidebarCollapsed;
210
+ $[36] = t12;
211
+ } else t12 = $[36];
212
+ const t13 = sidebarCollapsed ? PanelLeftOpen : PanelLeftClose;
213
+ let t14;
214
+ if ($[37] !== onToggleSidebar || $[38] !== t12 || $[39] !== t13) {
215
+ t14 = {
216
+ id: "sidebar",
217
+ label: t12,
218
+ icon: t13,
219
+ onAction: onToggleSidebar
220
+ };
221
+ $[37] = onToggleSidebar;
222
+ $[38] = t12;
223
+ $[39] = t13;
224
+ $[40] = t14;
225
+ } else t14 = $[40];
226
+ let t15;
227
+ if ($[41] !== colorScheme || $[42] !== intl || $[43] !== onColorSchemeChange || $[44] !== t14) {
228
+ let t16;
229
+ if ($[46] !== colorScheme) {
230
+ t16 = (scheme) => scheme !== colorScheme;
231
+ $[46] = colorScheme;
232
+ $[47] = t16;
233
+ } else t16 = $[47];
234
+ let t17;
235
+ if ($[48] !== intl || $[49] !== onColorSchemeChange) {
236
+ t17 = (scheme_0) => ({
237
+ id: `scheme-${scheme_0}`,
238
+ label: intl.formatMessage(appMessages.colorScheme, { scheme: scheme_0 }),
239
+ icon: SCHEME_ICONS[scheme_0],
240
+ onAction: () => onColorSchemeChange(scheme_0)
241
+ });
242
+ $[48] = intl;
243
+ $[49] = onColorSchemeChange;
244
+ $[50] = t17;
245
+ } else t17 = $[50];
246
+ t15 = [t14, ...COLOR_SCHEMES.filter(t16).map(t17)];
247
+ $[41] = colorScheme;
248
+ $[42] = intl;
249
+ $[43] = onColorSchemeChange;
250
+ $[44] = t14;
251
+ $[45] = t15;
252
+ } else t15 = $[45];
253
+ const actions = t15;
254
+ const searchIn = searchEnabled ? searchable.map((resource_3) => ({
255
+ id: resource_3.id,
256
+ label: capitalize(resource_3.label.plural, locale),
257
+ keywords: [resource_3.label.singular],
258
+ icon: resource_3.icon !== void 0 ? getNamedIcon(resource_3.icon) : Search,
259
+ keepsOpen: true,
260
+ onAction: () => {
261
+ setScope(resource_3.id);
262
+ setQuery("");
263
+ }
264
+ })) : [];
265
+ const searching = searchEnabled && query.trim().length >= SEARCH_MIN_LENGTH;
266
+ const results = searching ? (search.data?.data ?? []).flatMap((t16) => {
267
+ const { resource: id_1, items, total } = t16;
268
+ const resource_4 = resourceOf(id_1);
269
+ if (resource_4 === void 0 || scoped !== null && id_1 !== scoped.id) return [];
270
+ const subtitle = resource_4.itemSubtitle;
271
+ const icon = resource_4.icon !== void 0 ? getNamedIcon(resource_4.icon) : List;
272
+ const more = total !== void 0 && total > items.length ? [{
273
+ id: `${id_1}:all`,
274
+ label: intl.formatMessage(appMessages.seeAllResults, { count: total }),
275
+ icon: Search,
276
+ href: `${routePath({
277
+ name: "resource.index",
278
+ resource: id_1
279
+ }, basePath)}?${toSearchParams({ q: query.trim() })}`
280
+ }] : [];
281
+ return [{
282
+ id: `search-${id_1}`,
283
+ label: capitalize(resource_4.label.plural, locale),
284
+ matched: true,
285
+ items: [...items.map((item) => ({
286
+ id: item.id,
287
+ label: getItemTitle(item, resource_4.itemTitle, locale) ?? item.id,
288
+ description: subtitle !== void 0 ? toText(item[subtitle], locale) || void 0 : void 0,
289
+ imageUrl: imageOf(item, resource_4),
290
+ icon,
291
+ href: editPath(id_1, item.id)
292
+ })), ...more]
293
+ }];
294
+ }) : [];
295
+ const status = !searching ? scoped !== null ? intl.formatMessage(appMessages.searchMinLength, { count: SEARCH_MIN_LENGTH }) : void 0 : search.isError ? intl.formatMessage(isApiError(search.error) && search.error.status === 429 ? appMessages.searchRateLimited : appMessages.searchError) : search.isFetching || debounced !== query.trim() ? intl.formatMessage(appMessages.searching) : void 0;
296
+ const local = scoped === null ? [
297
+ {
298
+ id: "recent",
299
+ label: intl.formatMessage(appMessages.groupRecent),
300
+ items: recent
301
+ },
302
+ {
303
+ id: "navigation",
304
+ label: intl.formatMessage(appMessages.groupNavigation),
305
+ items: navigation
306
+ },
307
+ {
308
+ id: "create",
309
+ label: intl.formatMessage(appMessages.groupCreate),
310
+ items: create
311
+ },
312
+ ...[...commandGroups].map(_temp3),
313
+ {
314
+ id: "actions",
315
+ label: intl.formatMessage(appMessages.groupActions),
316
+ items: actions
317
+ },
318
+ {
319
+ id: "search-in",
320
+ label: intl.formatMessage(appMessages.groupSearchIn),
321
+ items: searchIn
322
+ }
323
+ ] : [];
324
+ let t17;
325
+ if ($[51] !== intl) {
326
+ t17 = intl.formatMessage(appMessages.goTo);
327
+ $[51] = intl;
328
+ $[52] = t17;
329
+ } else t17 = $[52];
330
+ let t18;
331
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
332
+ t18 = () => setScope(null);
333
+ $[53] = t18;
334
+ } else t18 = $[53];
335
+ return /* @__PURE__ */ jsx(CommandPalette, {
336
+ isOpen,
337
+ onOpenChange: changeOpen,
338
+ inputValue: query,
339
+ onInputChange: setQuery,
340
+ "aria-label": t17,
341
+ placeholder: scoped !== null ? intl.formatMessage(appMessages.searchPlaceholder) : void 0,
342
+ scope: scoped !== null ? capitalize(scoped.label.plural, locale) : null,
343
+ onScopeRemove: t18,
344
+ status,
345
+ groups: [...local, ...results]
346
+ });
347
+ }
348
+ function _temp3(t0) {
349
+ const [label, items_0] = t0;
350
+ return {
351
+ id: `commands-${label}`,
352
+ label,
353
+ items: items_0
354
+ };
355
+ }
356
+ function _temp2(link) {
357
+ return {
358
+ id: link.key,
359
+ label: link.label,
360
+ icon: navIcon(link),
361
+ href: link.href
362
+ };
363
+ }
364
+ function _temp(entry_0) {
365
+ return entry_0.type === "link" ? [entry_0] : entry_0.type === "group" ? entry_0.children : [];
366
+ }
367
+ //#endregion
368
+ export { GoTo };
369
+
370
+ //# sourceMappingURL=GoTo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoTo.js","names":["resource","id","scheme","isOpen","changeOpen","query","setQuery","status","items","entry","_c"],"sources":["../../src/shell/GoTo.tsx"],"sourcesContent":["import {\n Clock,\n File,\n House,\n Link2,\n List,\n Monitor,\n Moon,\n PanelLeftClose,\n PanelLeftOpen,\n Plus,\n Search,\n Sun,\n Terminal,\n} from 'lucide-react';\nimport { useEffect, useState } from 'react';\n\nimport { getCommands, getSearchableResources, resolveResource, usePlugins } from '@panneau/core';\nimport { isApiError } from '@panneau/data';\nimport { useSearch } from '@panneau/data/query';\nimport { appMessages } from '@panneau/intl';\nimport { toText } from '@panneau/lists';\nimport type { Definition, Item, Resource } from '@panneau/protocol';\nimport { SEARCH_MAX_LIMIT, SEARCH_MIN_LENGTH, toSearchParams } from '@panneau/protocol/runtime';\nimport {\n CommandPalette,\n type CommandPaletteGroup,\n type CommandPaletteItem,\n type IconComponent,\n getNamedIcon,\n usePanneauIntl,\n} from '@panneau/ui';\n\nimport { type NavLink, capitalize, getNavigation } from '../navigation';\nimport { getItemTitle } from '../pages/itemTitle';\nimport { readRecentItems, useRecentScope } from '../recentItems';\nimport { routePath } from '../routes';\nimport { COLOR_SCHEMES, type ColorSchemePreference } from './Sidebar';\n\n/** The pause after typing before the palette searches the server. */\nconst SEARCH_DELAY = 300;\n\nconst SCHEME_ICONS: Record<ColorSchemePreference, IconComponent> = {\n light: Sun,\n dark: Moon,\n auto: Monitor,\n};\n\nexport interface GoToProps {\n definition: Definition;\n basePath: string;\n isOpen: boolean;\n onOpenChange: (isOpen: boolean) => void;\n sidebarCollapsed: boolean;\n onToggleSidebar: () => void;\n colorScheme: ColorSchemePreference;\n onColorSchemeChange: (scheme: ColorSchemePreference) => void;\n}\n\nfunction navIcon(link: NavLink): IconComponent {\n if (link.icon !== undefined) {\n return getNamedIcon(link.icon);\n }\n switch (link.target.kind) {\n case 'home':\n return House;\n case 'resource':\n return List;\n case 'page':\n return File;\n case 'url':\n return Link2;\n }\n}\n\n/** The URL of an item's image (`itemImage`): a URL, or a media with a thumbnail. */\nfunction imageOf(item: Item, resource: Resource): string | undefined {\n const value = resource.itemImage !== undefined ? item[resource.itemImage] : undefined;\n if (typeof value === 'string') {\n return value;\n }\n if (value !== null && typeof value === 'object') {\n const media = (value as { media?: { thumbnailUrl?: unknown } }).media;\n const url =\n media?.thumbnailUrl ??\n (value as { thumbnailUrl?: unknown; url?: unknown }).thumbnailUrl;\n return typeof url === 'string' ? url : undefined;\n }\n return undefined;\n}\n\n/**\n * The \"Go to…\" palette of the app (decision 0029): recent items, navigation, \"New {resource}\",\n * the commands of plugins, the app's actions, then the results of the server's search, grouped by\n * resource. An item opens its edit form. \"Search in\" narrows the palette to the results of one\n * resource, 20 of them, until Backspace in the empty field.\n */\nexport function GoTo({\n definition,\n basePath,\n isOpen,\n onOpenChange,\n sidebarCollapsed,\n onToggleSidebar,\n colorScheme,\n onColorSchemeChange,\n}: GoToProps) {\n const intl = usePanneauIntl();\n const plugins = usePlugins();\n const user = useRecentScope();\n const [query, setQuery] = useState('');\n const [debounced, setDebounced] = useState('');\n // The resource the search is narrowed to\n const [scope, setScope] = useState<string | null>(null);\n const locale = definition.locale;\n const searchable = getSearchableResources(definition);\n const searchEnabled = definition.search?.enabled !== false && searchable.length > 0;\n\n useEffect(() => {\n const timeout = window.setTimeout(() => setDebounced(query.trim()), SEARCH_DELAY);\n return () => window.clearTimeout(timeout);\n }, [query]);\n\n const resourceOf = (id: string) => definition.resources.find((resource) => resource.id === id);\n const scoped = scope !== null ? (resourceOf(scope) ?? null) : null;\n const search = useSearch(debounced, {\n enabled: isOpen && searchEnabled && debounced.length >= SEARCH_MIN_LENGTH,\n ...(scoped !== null && { limit: SEARCH_MAX_LIMIT, resources: [scoped.id] }),\n });\n const changeOpen = (open: boolean) => {\n if (!open) {\n setScope(null);\n }\n onOpenChange(open);\n };\n const editPath = (resource: string, id: string) =>\n routePath({ name: 'resource.edit', resource, id }, basePath);\n\n const recent: CommandPaletteItem[] = isOpen\n ? readRecentItems(basePath, user).flatMap((entry) => {\n const resource = resourceOf(entry.resource);\n return resource !== undefined\n ? [\n {\n id: `${entry.resource}:${entry.id}`,\n label: entry.title,\n description: capitalize(resource.label.singular, locale),\n icon: resource.icon !== undefined ? getNamedIcon(resource.icon) : Clock,\n href: editPath(entry.resource, entry.id),\n },\n ]\n : [];\n })\n : [];\n\n const navigation: CommandPaletteItem[] = [\n {\n id: 'home',\n label: intl.formatMessage(appMessages.home),\n icon: House,\n href: routePath({ name: 'home' }, basePath),\n },\n ...getNavigation(definition, basePath)\n .flatMap((entry) =>\n entry.type === 'link' ? [entry] : entry.type === 'group' ? entry.children : [],\n )\n .map((link) => ({\n id: link.key,\n label: link.label,\n icon: navIcon(link),\n href: link.href,\n })),\n ];\n\n const create: CommandPaletteItem[] = definition.resources.flatMap((resource) =>\n resolveResource(resource).abilities.create\n ? [\n {\n id: resource.id,\n label: intl.formatMessage(appMessages.create, {\n resource: resource.label.singular,\n }),\n keywords: [resource.label.plural],\n icon: Plus,\n href: routePath({ name: 'resource.create', resource: resource.id }, basePath),\n },\n ]\n : [],\n );\n\n // The commands of plugins, in their own groups or in \"Commands\".\n const commandGroups = new Map<string, CommandPaletteItem[]>();\n getCommands(plugins.commands, { definition }).forEach((command) => {\n const group = command.group ?? intl.formatMessage(appMessages.groupCommands);\n commandGroups.set(group, [\n ...(commandGroups.get(group) ?? []),\n {\n id: command.id,\n label: command.label,\n description: command.description,\n keywords: command.keywords,\n icon: command.icon !== undefined ? getNamedIcon(command.icon) : Terminal,\n href: command.href,\n onAction: command.perform,\n },\n ]);\n });\n\n const actions: CommandPaletteItem[] = [\n {\n id: 'sidebar',\n label: intl.formatMessage(\n sidebarCollapsed ? appMessages.expandSidebar : appMessages.collapseSidebar,\n ),\n icon: sidebarCollapsed ? PanelLeftOpen : PanelLeftClose,\n onAction: onToggleSidebar,\n },\n ...COLOR_SCHEMES.filter((scheme) => scheme !== colorScheme).map((scheme) => ({\n id: `scheme-${scheme}`,\n label: intl.formatMessage(appMessages.colorScheme, { scheme }),\n icon: SCHEME_ICONS[scheme],\n onAction: () => onColorSchemeChange(scheme),\n })),\n ];\n\n const searchIn: CommandPaletteItem[] = searchEnabled\n ? searchable.map((resource) => ({\n id: resource.id,\n label: capitalize(resource.label.plural, locale),\n keywords: [resource.label.singular],\n icon: resource.icon !== undefined ? getNamedIcon(resource.icon) : Search,\n keepsOpen: true,\n onAction: () => {\n setScope(resource.id);\n setQuery('');\n },\n }))\n : [];\n\n const searching = searchEnabled && query.trim().length >= SEARCH_MIN_LENGTH;\n const results: CommandPaletteGroup[] = searching\n ? (search.data?.data ?? []).flatMap(({ resource: id, items, total }) => {\n const resource = resourceOf(id);\n if (resource === undefined || (scoped !== null && id !== scoped.id)) {\n return [];\n }\n const subtitle = resource.itemSubtitle;\n const icon = resource.icon !== undefined ? getNamedIcon(resource.icon) : List;\n // The list of the resource, searched, has every result\n const more: CommandPaletteItem[] =\n total !== undefined && total > items.length\n ? [\n {\n id: `${id}:all`,\n label: intl.formatMessage(appMessages.seeAllResults, {\n count: total,\n }),\n icon: Search,\n href: `${routePath({ name: 'resource.index', resource: id }, basePath)}?${toSearchParams({ q: query.trim() })}`,\n },\n ]\n : [];\n return [\n {\n id: `search-${id}`,\n label: capitalize(resource.label.plural, locale),\n matched: true,\n items: [\n ...items.map((item) => ({\n id: item.id,\n label: getItemTitle(item, resource.itemTitle, locale) ?? item.id,\n description:\n subtitle !== undefined\n ? toText(item[subtitle], locale) || undefined\n : undefined,\n imageUrl: imageOf(item, resource),\n icon,\n href: editPath(id, item.id),\n })),\n ...more,\n ],\n },\n ];\n })\n : [];\n\n const status = !searching\n ? scoped !== null\n ? intl.formatMessage(appMessages.searchMinLength, { count: SEARCH_MIN_LENGTH })\n : undefined\n : search.isError\n ? intl.formatMessage(\n isApiError(search.error) && search.error.status === 429\n ? appMessages.searchRateLimited\n : appMessages.searchError,\n )\n : search.isFetching || debounced !== query.trim()\n ? intl.formatMessage(appMessages.searching)\n : undefined;\n\n const local: CommandPaletteGroup[] =\n scoped === null\n ? [\n {\n id: 'recent',\n label: intl.formatMessage(appMessages.groupRecent),\n items: recent,\n },\n {\n id: 'navigation',\n label: intl.formatMessage(appMessages.groupNavigation),\n items: navigation,\n },\n {\n id: 'create',\n label: intl.formatMessage(appMessages.groupCreate),\n items: create,\n },\n ...[...commandGroups].map(([label, items]) => ({\n id: `commands-${label}`,\n label,\n items,\n })),\n {\n id: 'actions',\n label: intl.formatMessage(appMessages.groupActions),\n items: actions,\n },\n {\n id: 'search-in',\n label: intl.formatMessage(appMessages.groupSearchIn),\n items: searchIn,\n },\n ]\n : [];\n\n return (\n <CommandPalette\n isOpen={isOpen}\n onOpenChange={changeOpen}\n inputValue={query}\n onInputChange={setQuery}\n aria-label={intl.formatMessage(appMessages.goTo)}\n placeholder={\n scoped !== null ? intl.formatMessage(appMessages.searchPlaceholder) : undefined\n }\n scope={scoped !== null ? capitalize(scoped.label.plural, locale) : null}\n onScopeRemove={() => setScope(null)}\n status={status}\n groups={[...local, ...results]}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwCA,IAAM,eAAe;AAErB,IAAM,eAA6D;CAC/D,OAAO;CACP,MAAM;CACN,MAAM;AACV;AAaA,SAAS,QAAQ,MAA8B;CAC3C,IAAI,KAAK,SAAS,KAAA,GACd,OAAO,aAAa,KAAK,IAAI;CAEjC,QAAQ,KAAK,OAAO,MAApB;EACI,KAAK,QACD,OAAO;EACX,KAAK,YACD,OAAO;EACX,KAAK,QACD,OAAO;EACX,KAAK,OACD,OAAO;CACf;AACJ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