@olenbetong/synergi-react 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/{src/components → es/chrome}/AppMenu/AppMenu.css +648 -648
  2. package/es/{components → chrome}/AppMenu/AppMenu.d.ts +17 -8
  3. package/es/chrome/AppMenu/AppMenu.js +145 -0
  4. package/es/chrome/AppMenu/AppMenuColorScheme.d.ts +2 -0
  5. package/es/chrome/AppMenu/AppMenuColorScheme.js +18 -0
  6. package/es/chrome/AppMenu/AppMenuFavoriteButton.d.ts +18 -0
  7. package/es/chrome/AppMenu/AppMenuFavoriteButton.js +11 -0
  8. package/es/chrome/AppMenu/AppMenuHeader.d.ts +24 -0
  9. package/es/chrome/AppMenu/AppMenuHeader.js +18 -0
  10. package/es/chrome/AppMenu/AppMenuList.d.ts +18 -0
  11. package/es/chrome/AppMenu/AppMenuList.js +39 -0
  12. package/es/chrome/AppMenu/AppMenuRail.d.ts +26 -0
  13. package/es/chrome/AppMenu/AppMenuRail.js +30 -0
  14. package/es/chrome/AppMenu/icons.d.ts +15 -0
  15. package/es/chrome/AppMenu/icons.js +13 -0
  16. package/es/chrome/AppMenu/index.d.ts +12 -0
  17. package/es/{components → chrome}/AppMenu/index.js +5 -0
  18. package/es/chrome/AppMenu/menuEntries.d.ts +51 -0
  19. package/es/chrome/AppMenu/menuEntries.js +93 -0
  20. package/es/{components → chrome}/AppMenu/types.d.ts +10 -0
  21. package/es/chrome/AppMenu/useFavorites.d.ts +13 -0
  22. package/es/chrome/AppMenu/useFavorites.js +28 -0
  23. package/es/{components → chrome}/AppMenu/useRovingTabIndex.d.ts +4 -0
  24. package/es/{components → chrome}/AppMenu/useRovingTabIndex.js +12 -1
  25. package/es/{components → chrome}/AppShell/index.js +23 -2
  26. package/es/colorScheme.d.ts +17 -0
  27. package/es/colorScheme.js +54 -0
  28. package/es/components/PageBanner/index.d.ts +1 -1
  29. package/es/index.d.ts +3 -2
  30. package/es/index.js +3 -2
  31. package/package.json +2 -2
  32. package/{es/components → src/chrome}/AppMenu/AppMenu.css +129 -2
  33. package/src/{components → chrome}/AppMenu/AppMenu.tsx +285 -285
  34. package/src/{components → chrome}/AppMenu/AppMenuColorScheme.tsx +42 -41
  35. package/src/{components → chrome}/AppMenu/AppMenuFavoriteButton.tsx +47 -47
  36. package/src/{components → chrome}/AppMenu/AppMenuHeader.tsx +79 -79
  37. package/src/{components → chrome}/AppMenu/AppMenuList.tsx +89 -89
  38. package/src/{components → chrome}/AppMenu/AppMenuRail.tsx +117 -117
  39. package/src/{components → chrome}/AppMenu/icons.tsx +76 -76
  40. package/src/{components → chrome}/AppMenu/index.ts +17 -17
  41. package/src/{components → chrome}/AppMenu/menuEntries.ts +128 -128
  42. package/src/{components → chrome}/AppMenu/types.ts +45 -45
  43. package/src/{components → chrome}/AppMenu/useFavorites.ts +40 -40
  44. package/src/{components → chrome}/AppMenu/useRovingTabIndex.ts +130 -130
  45. package/src/{components → chrome}/AppShell/index.tsx +287 -287
  46. package/src/colorScheme.ts +81 -81
  47. package/src/components/ImageEditor/ImageEditor.tsx +1 -1
  48. package/src/components/ImageEditor/index.ts +2 -0
  49. package/src/components/ImageEditor/plugins/zoomPlugin/ZoomControls.tsx +7 -8
  50. package/src/components/LinkedCardList/index.scss +93 -93
  51. package/src/components/PageBanner/index.tsx +5 -4
  52. package/src/components/ProgressBar/index.scss +94 -94
  53. package/src/elements/ElementDamage/DamageFormButtons.tsx +2 -2
  54. package/src/elements/ElementDamage/TransportElementSelect.tsx +1 -1
  55. package/src/elements/index.ts +5 -0
  56. package/src/index.ts +70 -61
  57. package/es/components/AppMenu/AppMenu.js +0 -223
  58. package/es/components/AppMenu/index.d.ts +0 -6
  59. /package/es/{components → chrome}/AppMenu/AppMenuToggle.d.ts +0 -0
  60. /package/es/{components → chrome}/AppMenu/AppMenuToggle.js +0 -0
  61. /package/es/{components → chrome}/AppMenu/AppMenuUserMenu.d.ts +0 -0
  62. /package/es/{components → chrome}/AppMenu/AppMenuUserMenu.js +0 -0
  63. /package/es/{components → chrome}/AppMenu/developerCategories.d.ts +0 -0
  64. /package/es/{components → chrome}/AppMenu/developerCategories.js +0 -0
  65. /package/es/{components → chrome}/AppMenu/types.js +0 -0
  66. /package/es/{components → chrome}/AppMenu/useServiceWorkerUpdate.d.ts +0 -0
  67. /package/es/{components → chrome}/AppMenu/useServiceWorkerUpdate.js +0 -0
  68. /package/es/{components → chrome}/AppShell/index.d.ts +0 -0
  69. /package/src/{components → chrome}/AppMenu/AppMenuToggle.tsx +0 -0
  70. /package/src/{components → chrome}/AppMenu/AppMenuUserMenu.tsx +0 -0
  71. /package/src/{components → chrome}/AppMenu/developerCategories.ts +0 -0
  72. /package/src/{components → chrome}/AppMenu/useServiceWorkerUpdate.ts +0 -0
package/src/index.ts CHANGED
@@ -1,61 +1,70 @@
1
- export {
2
- AppMenu,
3
- type AppMenuArticle,
4
- type AppMenuCategory,
5
- AppMenuColorScheme,
6
- type AppMenuLink,
7
- type AppMenuLinkGroup,
8
- type AppMenuProps,
9
- AppMenuToggle,
10
- type AppMenuToggleProps,
11
- type AppMenuUser,
12
- AppMenuUserMenu,
13
- type AppMenuUserMenuProps,
14
- createDeveloperCategories,
15
- defaultUserMenuItems,
16
- type DeveloperCategoryOptions,
17
- useServiceWorkerUpdate,
18
- } from "./components/AppMenu/index.js";
19
- export { AppShell, type AppShellProps } from "./components/AppShell/index.js";
20
- export { Checkbox, type CheckboxProps } from "./components/Checkbox/index.js";
21
- export {
22
- COLOR_SCHEME_CHANGE_EVENT,
23
- type ColorSchemePreference,
24
- getColorSchemePreference,
25
- setColorSchemePreference,
26
- useColorSchemePreference,
27
- } from "./colorScheme.js";
28
- export { CardColumn, CardDetail, CardLabel, CardStep, CardStepList, ColorCard } from "./components/ColorCard/index.js";
29
- export { DateNavigator } from "./components/DateNavigator/index.js";
30
- export * from "./components/FilePond.js";
31
- export * from "./components/ImageEditor/index.js";
32
- export { Card, LinkedList, LinkedListItem } from "./components/LinkedCardList/index.js";
33
- export { MergeProgressDialog, type MergeProgressDialogProps } from "./components/MergeProgressDialog/index.js";
34
- export {
35
- BannerImage as PageBannerImage,
36
- type BannerImageProps,
37
- PageBanner,
38
- type PageBannerProps,
39
- Tab as PageBannerTab,
40
- TabList as PageBannerTabList,
41
- type TabListProps as PageBannerTabListProps,
42
- type TabProps as PageBannerTabProps,
43
- Title as PageBannerTitle,
44
- type TitleProps as PageBannerTitleProps,
45
- } from "./components/PageBanner/index.js";
46
- export * from "./components/PdfViewer/index.js";
47
- export { Portal } from "./components/Portal/index.js";
48
- export {
49
- ToolbarBreadcrumbs,
50
- ToolbarPortal,
51
- type BreadcrumbItem,
52
- type ToolbarBreadcrumbsProps,
53
- type ToolbarPortalProps,
54
- type ToolbarPortalSlot,
55
- } from "./components/Toolbar/index.js";
56
- export { ProgressBar } from "./components/ProgressBar/index.js";
57
- export { Sidebar, type SidebarProps } from "./components/Sidebar/index.js";
58
- export { Spinner, type SpinnerProps } from "./components/Spinner/index.js";
59
- export { SplitContainer, type SplitContainerProps } from "./components/SplitContainer/index.js";
60
- export { ValueToggleGroup, type ValueToggleGroupProps } from "./components/ValueToggleGroup/index.js";
61
- export { useTranslation } from "./useTranslation/index.js";
1
+ export {
2
+ AppMenu,
3
+ type AppMenuArticle,
4
+ type AppMenuCategory,
5
+ AppMenuColorScheme,
6
+ AppMenuFavoriteButton,
7
+ type AppMenuFavoriteButtonProps,
8
+ AppMenuHeader,
9
+ type AppMenuHeaderProps,
10
+ type AppMenuLink,
11
+ type AppMenuLinkGroup,
12
+ AppMenuList,
13
+ type AppMenuListProps,
14
+ type AppMenuProps,
15
+ AppMenuRail,
16
+ type AppMenuRailProps,
17
+ type AppMenuSelection,
18
+ AppMenuToggle,
19
+ type AppMenuToggleProps,
20
+ type AppMenuUser,
21
+ AppMenuUserMenu,
22
+ type AppMenuUserMenuProps,
23
+ createDeveloperCategories,
24
+ defaultUserMenuItems,
25
+ type DeveloperCategoryOptions,
26
+ useServiceWorkerUpdate,
27
+ } from "./chrome/AppMenu/index.js";
28
+ export { AppShell, type AppShellProps } from "./chrome/AppShell/index.js";
29
+ export { Checkbox, type CheckboxProps } from "./components/Checkbox/index.js";
30
+ export {
31
+ COLOR_SCHEME_CHANGE_EVENT,
32
+ type ColorSchemePreference,
33
+ getColorSchemePreference,
34
+ setColorSchemePreference,
35
+ useColorSchemePreference,
36
+ } from "./colorScheme.js";
37
+ export { CardColumn, CardDetail, CardLabel, CardStep, CardStepList, ColorCard } from "./components/ColorCard/index.js";
38
+ export { DateNavigator } from "./components/DateNavigator/index.js";
39
+ export * from "./components/FilePond.js";
40
+ export * from "./components/ImageEditor/index.js";
41
+ export { Card, LinkedList, LinkedListItem } from "./components/LinkedCardList/index.js";
42
+ export { MergeProgressDialog, type MergeProgressDialogProps } from "./components/MergeProgressDialog/index.js";
43
+ export {
44
+ BannerImage as PageBannerImage,
45
+ type BannerImageProps,
46
+ PageBanner,
47
+ type PageBannerProps,
48
+ Tab as PageBannerTab,
49
+ TabList as PageBannerTabList,
50
+ type TabListProps as PageBannerTabListProps,
51
+ type TabProps as PageBannerTabProps,
52
+ Title as PageBannerTitle,
53
+ type TitleProps as PageBannerTitleProps,
54
+ } from "./components/PageBanner/index.js";
55
+ export * from "./components/PdfViewer/index.js";
56
+ export { Portal } from "./components/Portal/index.js";
57
+ export {
58
+ ToolbarBreadcrumbs,
59
+ ToolbarPortal,
60
+ type BreadcrumbItem,
61
+ type ToolbarBreadcrumbsProps,
62
+ type ToolbarPortalProps,
63
+ type ToolbarPortalSlot,
64
+ } from "./components/Toolbar/index.js";
65
+ export { ProgressBar } from "./components/ProgressBar/index.js";
66
+ export { Sidebar, type SidebarProps } from "./components/Sidebar/index.js";
67
+ export { Spinner, type SpinnerProps } from "./components/Spinner/index.js";
68
+ export { SplitContainer, type SplitContainerProps } from "./components/SplitContainer/index.js";
69
+ export { ValueToggleGroup, type ValueToggleGroupProps } from "./components/ValueToggleGroup/index.js";
70
+ export { useTranslation } from "./useTranslation/index.js";
@@ -1,223 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./AppMenu.css";
3
- import { getLocalizedString } from "@olenbetong/appframe-core";
4
- import { useData, useLoading } from "@olenbetong/appframe-react";
5
- import clsx from "clsx";
6
- import { Fragment, useEffect, useMemo, useRef, useState } from "react";
7
- import { AppMenuUserMenu } from "./AppMenuUserMenu.js";
8
- import { useRovingTabIndex } from "./useRovingTabIndex.js";
9
- /** Sentinel group key for apps that have no MenuGroup set. */
10
- const UNGROUPED = "\u0000ungrouped";
11
- /** Strip version suffixes (`my-app.0000012`) from an ArticleId. */
12
- function stripVersionSuffix(articleId) {
13
- return articleId.replace(/\.\d+$/, "");
14
- }
15
- /**
16
- * Normalize the raw article rows into a deduplicated, sorted list of apps.
17
- *
18
- * `aviw_WebShared_Articles` contains one row per published article version, so
19
- * the same app can appear dozens of times. Deduplicating on the version-less
20
- * ArticleId guarantees a single entry per app even if the data object's where
21
- * clause is relaxed.
22
- */
23
- function toAppEntries(articles) {
24
- let byId = new Map();
25
- for (let article of articles) {
26
- let id = stripVersionSuffix(article.ArticleId);
27
- if (byId.has(id))
28
- continue;
29
- byId.set(id, {
30
- id,
31
- title: article.Title?.trim() || id,
32
- group: article.MenuGroup?.trim() || UNGROUPED,
33
- href: `/${article.Path?.trim() || id}`,
34
- });
35
- }
36
- return [...byId.values()].sort((a, b) => a.title.localeCompare(b.title));
37
- }
38
- /** Group entries by group key. Ungrouped apps are always listed last. */
39
- function groupEntries(entries) {
40
- let map = new Map();
41
- for (let entry of entries) {
42
- let list = map.get(entry.group);
43
- if (!list) {
44
- list = [];
45
- map.set(entry.group, list);
46
- }
47
- list.push(entry);
48
- }
49
- return [...map.entries()].sort(([a], [b]) => {
50
- if (a === b)
51
- return 0;
52
- if (a === UNGROUPED)
53
- return 1;
54
- if (b === UNGROUPED)
55
- return -1;
56
- return a.localeCompare(b);
57
- });
58
- }
59
- /** Drop entries that don't match the search term, then empty groups. */
60
- function filterCategory(category, term) {
61
- if (!term)
62
- return category;
63
- let groups = category.groups
64
- .map((group) => ({ ...group, items: group.items.filter((item) => item.label.toLowerCase().includes(term)) }))
65
- .filter((group) => group.items.length > 0);
66
- return { ...category, groups };
67
- }
68
- function countItems(category) {
69
- return category.groups.reduce((total, group) => total + group.items.length, 0);
70
- }
71
- /** Split the categories into their rail sections, preserving the given order. */
72
- function toRailSections(categories) {
73
- let sections = new Map();
74
- for (let category of categories) {
75
- let key = category.section ?? "";
76
- let list = sections.get(key);
77
- if (!list) {
78
- list = [];
79
- sections.set(key, list);
80
- }
81
- list.push(category);
82
- }
83
- return [...sections.entries()];
84
- }
85
- /**
86
- * Two pane application menu. The left rail holds a local search field and the
87
- * list of app categories (`MenuGroup`); the right pane lists the apps in the
88
- * selected category, or every app when no category is selected.
89
- *
90
- * On narrow viewports only one pane is visible at a time, defaulting to the app
91
- * list, with a button to switch to the category list.
92
- */
93
- export function AppMenu({ dataObject, open, onClose, categories = [], userDataObject, userMenuItems, userSubtitle, hasUpdate = false, onInstallUpdate, id, className, }) {
94
- let dialogRef = useRef(null);
95
- let searchRef = useRef(null);
96
- let [search, setSearch] = useState("");
97
- let [selection, setSelection] = useState(null);
98
- let [mobilePane, setMobilePane] = useState("apps");
99
- let [hasLoaded, setHasLoaded] = useState(false);
100
- let isLoading = useLoading(dataObject);
101
- let articles = useData(dataObject);
102
- // Sync the native dialog with the `open` prop. Using showModal() puts the
103
- // dialog in the top layer so it renders above the toolbar and page content.
104
- useEffect(() => {
105
- let dialog = dialogRef.current;
106
- if (!dialog)
107
- return;
108
- if (open && !dialog.open) {
109
- dialog.showModal();
110
- requestAnimationFrame(() => searchRef.current?.focus());
111
- }
112
- else if (!open && dialog.open) {
113
- dialog.close();
114
- }
115
- }, [open]);
116
- // Reset transient state whenever the menu is closed.
117
- useEffect(() => {
118
- if (!open) {
119
- setSearch("");
120
- setSelection(null);
121
- setMobilePane("apps");
122
- }
123
- }, [open]);
124
- // Load the app list the first time the menu is opened.
125
- useEffect(() => {
126
- if (open && !hasLoaded) {
127
- setHasLoaded(true);
128
- dataObject.refreshDataSource();
129
- userDataObject?.refreshDataSource();
130
- }
131
- }, [open, hasLoaded, dataObject, userDataObject]);
132
- let entries = useMemo(() => toAppEntries(articles), [articles]);
133
- let term = search.trim().toLowerCase();
134
- let searchMatches = useMemo(() => {
135
- if (!term)
136
- return entries;
137
- return entries.filter((entry) => entry.title.toLowerCase().includes(term) || entry.id.toLowerCase().includes(term));
138
- }, [entries, term]);
139
- let groups = useMemo(() => groupEntries(searchMatches), [searchMatches]);
140
- let visibleCategories = useMemo(() => categories.map((category) => filterCategory(category, term)).filter((category) => countItems(category) > 0), [categories, term]);
141
- // A selection that no longer has matches falls back to "all apps" so the pane
142
- // never ends up empty while results exist elsewhere.
143
- let activeSelection = null;
144
- if (selection?.type === "group" && groups.some(([group]) => group === selection.key))
145
- activeSelection = selection;
146
- else if (selection?.type === "category" && visibleCategories.some((category) => category.id === selection.id)) {
147
- activeSelection = selection;
148
- }
149
- let activeCategoryId = activeSelection?.type === "category" ? activeSelection.id : null;
150
- let activeCategory = visibleCategories.find((category) => category.id === activeCategoryId);
151
- let activeGroupKey = activeSelection?.type === "group" ? activeSelection.key : null;
152
- // Everything the right hand pane renders, normalized to titled link groups.
153
- let paneGroups = useMemo(() => {
154
- if (activeCategory)
155
- return activeCategory.groups;
156
- return groups
157
- .filter(([group]) => activeGroupKey === null || group === activeGroupKey)
158
- .map(([group, items]) => ({
159
- title: group === UNGROUPED ? getLocalizedString("Other") : group,
160
- items: items.map((entry) => ({ label: entry.title, href: entry.href })),
161
- }));
162
- }, [activeCategory, activeGroupKey, groups]);
163
- let paneItemCount = paneGroups.reduce((total, group) => total + group.items.length, 0);
164
- let hasApps = searchMatches.length > 0;
165
- // The rail and the app list are each a single tab stop; arrow keys move
166
- // focus within them.
167
- let railSections = useMemo(() => toRailSections(visibleCategories), [visibleCategories]);
168
- let groupRoving = useRovingTabIndex(groups.length + 1 + visibleCategories.length);
169
- let appRoving = useRovingTabIndex(paneItemCount, { columns: true });
170
- let categoryIndex = groups.length;
171
- let itemIndex = -1;
172
- function groupLabel(group) {
173
- return group === UNGROUPED ? getLocalizedString("Other") : group;
174
- }
175
- function select(next) {
176
- setSelection(next);
177
- setMobilePane("apps");
178
- }
179
- function isSelected(next) {
180
- if (next.type === "group")
181
- return activeGroupKey === next.key;
182
- return activeCategoryId === next.id;
183
- }
184
- function renderItem(item, index) {
185
- let props = {
186
- className: "ob-app-menu__link",
187
- ...item.attributes,
188
- ...appRoving.getItemProps(index),
189
- };
190
- function activate() {
191
- item.onClick?.();
192
- if (!item.keepOpen)
193
- onClose();
194
- }
195
- return item.href ? (_jsx("a", { ...props, href: item.href, target: item.target, rel: item.rel, onClick: activate, children: item.label })) : (_jsx("button", { ...props, type: "button", onClick: activate, children: item.label }));
196
- }
197
- return (_jsx("dialog", { ref: dialogRef, id: id, className: clsx("ob-app-menu", className), "aria-label": getLocalizedString("Applications"), "data-pane": mobilePane, onCancel: (event) => {
198
- // Let React own the open state instead of the browser's default close.
199
- event.preventDefault();
200
- onClose();
201
- }, onKeyDown: (event) => {
202
- // A `type="search"` input consumes Escape to clear itself, so the
203
- // dialog's own cancel event never fires when the search has focus.
204
- if (event.key === "Escape") {
205
- event.preventDefault();
206
- onClose();
207
- }
208
- }, onClick: (event) => {
209
- // Clicks on the dialog element itself are backdrop clicks; anything
210
- // inside the menu is caught by the inner wrapper below.
211
- if (event.target === dialogRef.current)
212
- onClose();
213
- }, children: _jsxs("div", { className: "ob-app-menu__panel", children: [_jsxs("div", { className: "ob-app-menu__rail", children: [_jsx("div", { className: "ds-search ob-app-menu__search", "data-size": "sm", children: _jsx("input", { ref: searchRef, className: "ds-input", type: "search", value: search, onChange: (event) => setSearch(event.target.value), placeholder: getLocalizedString("Search applications"), "aria-label": getLocalizedString("Search applications"), autoComplete: "off" }) }), _jsxs("nav", { className: "ob-app-menu__groups", "aria-label": getLocalizedString("Categories"), onKeyDown: groupRoving.onKeyDown, children: [_jsxs("button", { type: "button", className: "ob-app-menu__group-button", "aria-current": activeSelection === null ? "true" : undefined, onClick: () => select(null), ...groupRoving.getItemProps(0), children: [_jsx("span", { children: getLocalizedString("All applications") }), _jsx("span", { className: "ob-app-menu__count", children: searchMatches.length })] }), groups.map(([group, items], index) => (_jsxs("button", { type: "button", className: "ob-app-menu__group-button", "aria-current": isSelected({ type: "group", key: group }) ? "true" : undefined, onClick: () => select({ type: "group", key: group }), ...groupRoving.getItemProps(index + 1), children: [_jsx("span", { children: groupLabel(group) }), _jsx("span", { className: "ob-app-menu__count", children: items.length })] }, group))), railSections.map(([section, sectionCategories]) => (_jsxs(Fragment, { children: [section && _jsx("h2", { className: "ob-app-menu__rail-heading", children: section }), sectionCategories.map((category) => {
214
- // The rail tab stops are "All applications", then the app
215
- // groups, then the categories, in that order.
216
- categoryIndex += 1;
217
- let railIndex = categoryIndex;
218
- return (_jsxs("button", { type: "button", className: "ob-app-menu__group-button", "aria-current": isSelected({ type: "category", id: category.id }) ? "true" : undefined, onClick: () => select({ type: "category", id: category.id }), ...groupRoving.getItemProps(railIndex), children: [_jsx("span", { children: category.label }), _jsx("span", { className: "ob-app-menu__count", children: countItems(category) })] }, category.id));
219
- })] }, section || "\u0000default")))] })] }), _jsxs("div", { className: "ob-app-menu__content", children: [isLoading && !hasApps && !activeCategory && (_jsx("p", { className: "ob-app-menu__message", children: getLocalizedString("Loading...") })), !isLoading && paneItemCount === 0 && (_jsx("p", { className: "ob-app-menu__message", children: getLocalizedString("No applications found") })), paneItemCount > 0 && (_jsx("div", { className: "ob-app-menu__columns", onKeyDown: appRoving.onKeyDown, children: paneGroups.map((group, groupIdx) => (_jsxs("section", { className: "ob-app-menu__group", children: [group.title && _jsx("h2", { className: "ob-app-menu__group-title", children: group.title }), _jsx("ul", { className: "ob-app-menu__list", children: group.items.map((item) => {
220
- itemIndex += 1;
221
- return _jsx("li", { children: renderItem(item, itemIndex) }, item.href ?? item.label);
222
- }) })] }, group.title ?? groupIdx))) })), _jsxs("div", { className: "ob-app-menu__content-header", children: [_jsx("button", { type: "button", className: "ob-app-menu__pane-toggle", onClick: () => setMobilePane(mobilePane === "apps" ? "groups" : "apps"), children: mobilePane === "apps" ? getLocalizedString("Categories") : getLocalizedString("Applications") }), hasUpdate && (_jsxs("button", { type: "button", className: "ob-app-menu__update", "aria-label": getLocalizedString("Install update and reload"), onClick: onInstallUpdate, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", focusable: "false", width: "18", height: "18", children: _jsx("path", { d: "M12 4a8 8 0 0 1 7.5 5.2.75.75 0 1 1-1.4.5A6.5 6.5 0 0 0 6.2 9.25H8.5a.75.75 0 0 1 0 1.5H4.75A.75.75 0 0 1 4 10V6.25a.75.75 0 0 1 1.5 0v1.86A8 8 0 0 1 12 4m-7.6 9.55a.75.75 0 0 1 .95.45A6.5 6.5 0 0 0 17.8 14.75H15.5a.75.75 0 0 1 0-1.5h3.75a.75.75 0 0 1 .75.75V17.75a.75.75 0 0 1-1.5 0v-1.86A8 8 0 0 1 4.5 14.5a.75.75 0 0 1 .45-.95z" }) }), _jsx("span", { className: "ob-app-menu__update-label", children: getLocalizedString("Install update and reload") })] })), userDataObject && (_jsx(AppMenuUserMenu, { dataObject: userDataObject, items: userMenuItems, subtitle: userSubtitle })), _jsx("button", { type: "button", className: "ob-app-menu__close", "aria-label": getLocalizedString("Close"), onClick: onClose, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", focusable: "false", width: "20", height: "20", children: _jsx("path", { d: "M6.53 5.47a.75.75 0 0 0-1.06 1.06L10.94 12l-5.47 5.47a.75.75 0 1 0 1.06 1.06L12 13.06l5.47 5.47a.75.75 0 1 0 1.06-1.06L13.06 12l5.47-5.47a.75.75 0 0 0-1.06-1.06L12 10.94z" }) }) })] })] })] }) }));
223
- }
@@ -1,6 +0,0 @@
1
- export { AppMenu, type AppMenuArticle, type AppMenuProps } from "./AppMenu.js";
2
- export { AppMenuToggle, type AppMenuToggleProps } from "./AppMenuToggle.js";
3
- export { AppMenuUserMenu, type AppMenuUser, type AppMenuUserMenuProps, defaultUserMenuItems, } from "./AppMenuUserMenu.js";
4
- export { createDeveloperCategories, type DeveloperCategoryOptions } from "./developerCategories.js";
5
- export type { AppMenuCategory, AppMenuLink, AppMenuLinkGroup } from "./types.js";
6
- export { useServiceWorkerUpdate } from "./useServiceWorkerUpdate.js";
File without changes
File without changes