@multiplatform.one/backoffice 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +310 -0
- package/dist/cjs/chrome/BackofficeAwesomebar.cjs +95 -0
- package/dist/cjs/chrome/BackofficeAwesomebar.native.js +106 -0
- package/dist/cjs/chrome/BackofficeAwesomebar.native.js.map +1 -0
- package/dist/cjs/chrome/CommandPalette.cjs +453 -0
- package/dist/cjs/chrome/CommandPalette.native.js +505 -0
- package/dist/cjs/chrome/CommandPalette.native.js.map +1 -0
- package/dist/cjs/chrome/HelpMenu.cjs +131 -0
- package/dist/cjs/chrome/HelpMenu.native.js +145 -0
- package/dist/cjs/chrome/HelpMenu.native.js.map +1 -0
- package/dist/cjs/chrome/NotificationsButton.cjs +112 -0
- package/dist/cjs/chrome/NotificationsButton.native.js +115 -0
- package/dist/cjs/chrome/NotificationsButton.native.js.map +1 -0
- package/dist/cjs/chrome/UserMenu.cjs +158 -0
- package/dist/cjs/chrome/UserMenu.native.js +186 -0
- package/dist/cjs/chrome/UserMenu.native.js.map +1 -0
- package/dist/cjs/chrome/awesomebar-data.cjs +173 -0
- package/dist/cjs/chrome/awesomebar-data.native.js +233 -0
- package/dist/cjs/chrome/awesomebar-data.native.js.map +1 -0
- package/dist/cjs/chrome/command-palette-model.cjs +208 -0
- package/dist/cjs/chrome/command-palette-model.native.js +301 -0
- package/dist/cjs/chrome/command-palette-model.native.js.map +1 -0
- package/dist/cjs/chrome/help-about-dialog.cjs +136 -0
- package/dist/cjs/chrome/help-about-dialog.native.js +146 -0
- package/dist/cjs/chrome/help-about-dialog.native.js.map +1 -0
- package/dist/cjs/chrome/help-shortcuts-dialog.cjs +155 -0
- package/dist/cjs/chrome/help-shortcuts-dialog.native.js +168 -0
- package/dist/cjs/chrome/help-shortcuts-dialog.native.js.map +1 -0
- package/dist/cjs/chrome/notifications-data.cjs +190 -0
- package/dist/cjs/chrome/notifications-data.native.js +271 -0
- package/dist/cjs/chrome/notifications-data.native.js.map +1 -0
- package/dist/cjs/chrome/notifications-panel.cjs +171 -0
- package/dist/cjs/chrome/notifications-panel.native.js +189 -0
- package/dist/cjs/chrome/notifications-panel.native.js.map +1 -0
- package/dist/cjs/chrome/notifications-utils.cjs +43 -0
- package/dist/cjs/chrome/notifications-utils.native.js +46 -0
- package/dist/cjs/chrome/notifications-utils.native.js.map +1 -0
- package/dist/cjs/chrome/shortcuts.cjs +58 -0
- package/dist/cjs/chrome/shortcuts.native.js +72 -0
- package/dist/cjs/chrome/shortcuts.native.js.map +1 -0
- package/dist/cjs/chrome/user-session.cjs +100 -0
- package/dist/cjs/chrome/user-session.native.js +120 -0
- package/dist/cjs/chrome/user-session.native.js.map +1 -0
- package/dist/cjs/config/BackofficeProvider.cjs +164 -0
- package/dist/cjs/config/BackofficeProvider.native.js +217 -0
- package/dist/cjs/config/BackofficeProvider.native.js.map +1 -0
- package/dist/cjs/config/capabilities.cjs +123 -0
- package/dist/cjs/config/capabilities.native.js +155 -0
- package/dist/cjs/config/capabilities.native.js.map +1 -0
- package/dist/cjs/config/events.cjs +18 -0
- package/dist/cjs/config/events.native.js +21 -0
- package/dist/cjs/config/events.native.js.map +1 -0
- package/dist/cjs/config/slots.cjs +18 -0
- package/dist/cjs/config/slots.native.js +21 -0
- package/dist/cjs/config/slots.native.js.map +1 -0
- package/dist/cjs/i18n/en.cjs +101 -0
- package/dist/cjs/i18n/en.native.js +104 -0
- package/dist/cjs/i18n/en.native.js.map +1 -0
- package/dist/cjs/i18n/index.cjs +77 -0
- package/dist/cjs/i18n/index.native.js +102 -0
- package/dist/cjs/i18n/index.native.js.map +1 -0
- package/dist/cjs/index.cjs +109 -0
- package/dist/cjs/index.native.js +112 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/navigation/navigator.cjs +144 -0
- package/dist/cjs/navigation/navigator.native.js +307 -0
- package/dist/cjs/navigation/navigator.native.js.map +1 -0
- package/dist/cjs/navigation/paths.cjs +103 -0
- package/dist/cjs/navigation/paths.native.js +143 -0
- package/dist/cjs/navigation/paths.native.js.map +1 -0
- package/dist/cjs/oneAdapter/index.cjs +53 -0
- package/dist/cjs/oneAdapter/index.native.js +64 -0
- package/dist/cjs/oneAdapter/index.native.js.map +1 -0
- package/dist/cjs/shared/useFrappeApp.cjs +56 -0
- package/dist/cjs/shared/useFrappeApp.native.js +60 -0
- package/dist/cjs/shared/useFrappeApp.native.js.map +1 -0
- package/dist/cjs/shell/BackofficeShell.cjs +194 -0
- package/dist/cjs/shell/BackofficeShell.native.js +223 -0
- package/dist/cjs/shell/BackofficeShell.native.js.map +1 -0
- package/dist/cjs/shell/WorkspaceSidebar.cjs +115 -0
- package/dist/cjs/shell/WorkspaceSidebar.native.js +143 -0
- package/dist/cjs/shell/WorkspaceSidebar.native.js.map +1 -0
- package/dist/cjs/shell/useWorkspaces.cjs +131 -0
- package/dist/cjs/shell/useWorkspaces.native.js +173 -0
- package/dist/cjs/shell/useWorkspaces.native.js.map +1 -0
- package/dist/cjs/shell/workspaceIcons.cjs +64 -0
- package/dist/cjs/shell/workspaceIcons.native.js +67 -0
- package/dist/cjs/shell/workspaceIcons.native.js.map +1 -0
- package/dist/esm/chrome/BackofficeAwesomebar.mjs +70 -0
- package/dist/esm/chrome/BackofficeAwesomebar.mjs.map +1 -0
- package/dist/esm/chrome/BackofficeAwesomebar.native.js +78 -0
- package/dist/esm/chrome/BackofficeAwesomebar.native.js.map +1 -0
- package/dist/esm/chrome/CommandPalette.mjs +428 -0
- package/dist/esm/chrome/CommandPalette.mjs.map +1 -0
- package/dist/esm/chrome/CommandPalette.native.js +477 -0
- package/dist/esm/chrome/CommandPalette.native.js.map +1 -0
- package/dist/esm/chrome/HelpMenu.mjs +106 -0
- package/dist/esm/chrome/HelpMenu.mjs.map +1 -0
- package/dist/esm/chrome/HelpMenu.native.js +117 -0
- package/dist/esm/chrome/HelpMenu.native.js.map +1 -0
- package/dist/esm/chrome/NotificationsButton.mjs +87 -0
- package/dist/esm/chrome/NotificationsButton.mjs.map +1 -0
- package/dist/esm/chrome/NotificationsButton.native.js +87 -0
- package/dist/esm/chrome/NotificationsButton.native.js.map +1 -0
- package/dist/esm/chrome/UserMenu.mjs +133 -0
- package/dist/esm/chrome/UserMenu.mjs.map +1 -0
- package/dist/esm/chrome/UserMenu.native.js +147 -0
- package/dist/esm/chrome/UserMenu.native.js.map +1 -0
- package/dist/esm/chrome/awesomebar-data.mjs +144 -0
- package/dist/esm/chrome/awesomebar-data.mjs.map +1 -0
- package/dist/esm/chrome/awesomebar-data.native.js +190 -0
- package/dist/esm/chrome/awesomebar-data.native.js.map +1 -0
- package/dist/esm/chrome/command-palette-model.mjs +183 -0
- package/dist/esm/chrome/command-palette-model.mjs.map +1 -0
- package/dist/esm/chrome/command-palette-model.native.js +273 -0
- package/dist/esm/chrome/command-palette-model.native.js.map +1 -0
- package/dist/esm/chrome/help-about-dialog.mjs +111 -0
- package/dist/esm/chrome/help-about-dialog.mjs.map +1 -0
- package/dist/esm/chrome/help-about-dialog.native.js +118 -0
- package/dist/esm/chrome/help-about-dialog.native.js.map +1 -0
- package/dist/esm/chrome/help-shortcuts-dialog.mjs +130 -0
- package/dist/esm/chrome/help-shortcuts-dialog.mjs.map +1 -0
- package/dist/esm/chrome/help-shortcuts-dialog.native.js +140 -0
- package/dist/esm/chrome/help-shortcuts-dialog.native.js.map +1 -0
- package/dist/esm/chrome/notifications-data.mjs +165 -0
- package/dist/esm/chrome/notifications-data.mjs.map +1 -0
- package/dist/esm/chrome/notifications-data.native.js +232 -0
- package/dist/esm/chrome/notifications-data.native.js.map +1 -0
- package/dist/esm/chrome/notifications-panel.mjs +146 -0
- package/dist/esm/chrome/notifications-panel.mjs.map +1 -0
- package/dist/esm/chrome/notifications-panel.native.js +161 -0
- package/dist/esm/chrome/notifications-panel.native.js.map +1 -0
- package/dist/esm/chrome/notifications-utils.mjs +17 -0
- package/dist/esm/chrome/notifications-utils.mjs.map +1 -0
- package/dist/esm/chrome/notifications-utils.native.js +17 -0
- package/dist/esm/chrome/notifications-utils.native.js.map +1 -0
- package/dist/esm/chrome/shortcuts.mjs +33 -0
- package/dist/esm/chrome/shortcuts.mjs.map +1 -0
- package/dist/esm/chrome/shortcuts.native.js +44 -0
- package/dist/esm/chrome/shortcuts.native.js.map +1 -0
- package/dist/esm/chrome/user-session.mjs +73 -0
- package/dist/esm/chrome/user-session.mjs.map +1 -0
- package/dist/esm/chrome/user-session.native.js +79 -0
- package/dist/esm/chrome/user-session.native.js.map +1 -0
- package/dist/esm/config/BackofficeProvider.mjs +132 -0
- package/dist/esm/config/BackofficeProvider.mjs.map +1 -0
- package/dist/esm/config/BackofficeProvider.native.js +171 -0
- package/dist/esm/config/BackofficeProvider.native.js.map +1 -0
- package/dist/esm/config/capabilities.mjs +97 -0
- package/dist/esm/config/capabilities.mjs.map +1 -0
- package/dist/esm/config/capabilities.native.js +126 -0
- package/dist/esm/config/capabilities.native.js.map +1 -0
- package/dist/esm/config/events.mjs +2 -0
- package/dist/esm/config/events.mjs.map +1 -0
- package/dist/esm/config/events.native.js +2 -0
- package/dist/esm/config/events.native.js.map +1 -0
- package/dist/esm/config/slots.mjs +2 -0
- package/dist/esm/config/slots.mjs.map +1 -0
- package/dist/esm/config/slots.native.js +2 -0
- package/dist/esm/config/slots.native.js.map +1 -0
- package/dist/esm/i18n/en.mjs +76 -0
- package/dist/esm/i18n/en.mjs.map +1 -0
- package/dist/esm/i18n/en.native.js +76 -0
- package/dist/esm/i18n/en.native.js.map +1 -0
- package/dist/esm/i18n/index.mjs +40 -0
- package/dist/esm/i18n/index.mjs.map +1 -0
- package/dist/esm/i18n/index.native.js +62 -0
- package/dist/esm/i18n/index.native.js.map +1 -0
- package/dist/esm/index.mjs +26 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +26 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/navigation/navigator.mjs +115 -0
- package/dist/esm/navigation/navigator.mjs.map +1 -0
- package/dist/esm/navigation/navigator.native.js +275 -0
- package/dist/esm/navigation/navigator.native.js.map +1 -0
- package/dist/esm/navigation/paths.mjs +66 -0
- package/dist/esm/navigation/paths.mjs.map +1 -0
- package/dist/esm/navigation/paths.native.js +103 -0
- package/dist/esm/navigation/paths.native.js.map +1 -0
- package/dist/esm/oneAdapter/index.mjs +28 -0
- package/dist/esm/oneAdapter/index.mjs.map +1 -0
- package/dist/esm/oneAdapter/index.native.js +36 -0
- package/dist/esm/oneAdapter/index.native.js.map +1 -0
- package/dist/esm/shared/useFrappeApp.mjs +31 -0
- package/dist/esm/shared/useFrappeApp.mjs.map +1 -0
- package/dist/esm/shared/useFrappeApp.native.js +32 -0
- package/dist/esm/shared/useFrappeApp.native.js.map +1 -0
- package/dist/esm/shell/BackofficeShell.mjs +169 -0
- package/dist/esm/shell/BackofficeShell.mjs.map +1 -0
- package/dist/esm/shell/BackofficeShell.native.js +195 -0
- package/dist/esm/shell/BackofficeShell.native.js.map +1 -0
- package/dist/esm/shell/WorkspaceSidebar.mjs +89 -0
- package/dist/esm/shell/WorkspaceSidebar.mjs.map +1 -0
- package/dist/esm/shell/WorkspaceSidebar.native.js +114 -0
- package/dist/esm/shell/WorkspaceSidebar.native.js.map +1 -0
- package/dist/esm/shell/useWorkspaces.mjs +104 -0
- package/dist/esm/shell/useWorkspaces.mjs.map +1 -0
- package/dist/esm/shell/useWorkspaces.native.js +143 -0
- package/dist/esm/shell/useWorkspaces.native.js.map +1 -0
- package/dist/esm/shell/workspaceIcons.mjs +39 -0
- package/dist/esm/shell/workspaceIcons.mjs.map +1 -0
- package/dist/esm/shell/workspaceIcons.native.js +39 -0
- package/dist/esm/shell/workspaceIcons.native.js.map +1 -0
- package/dist/jsx/chrome/BackofficeAwesomebar.mjs +70 -0
- package/dist/jsx/chrome/BackofficeAwesomebar.mjs.map +1 -0
- package/dist/jsx/chrome/BackofficeAwesomebar.native.js +106 -0
- package/dist/jsx/chrome/BackofficeAwesomebar.native.js.map +1 -0
- package/dist/jsx/chrome/CommandPalette.mjs +428 -0
- package/dist/jsx/chrome/CommandPalette.mjs.map +1 -0
- package/dist/jsx/chrome/CommandPalette.native.js +505 -0
- package/dist/jsx/chrome/CommandPalette.native.js.map +1 -0
- package/dist/jsx/chrome/HelpMenu.mjs +106 -0
- package/dist/jsx/chrome/HelpMenu.mjs.map +1 -0
- package/dist/jsx/chrome/HelpMenu.native.js +145 -0
- package/dist/jsx/chrome/HelpMenu.native.js.map +1 -0
- package/dist/jsx/chrome/NotificationsButton.mjs +87 -0
- package/dist/jsx/chrome/NotificationsButton.mjs.map +1 -0
- package/dist/jsx/chrome/NotificationsButton.native.js +115 -0
- package/dist/jsx/chrome/NotificationsButton.native.js.map +1 -0
- package/dist/jsx/chrome/UserMenu.mjs +133 -0
- package/dist/jsx/chrome/UserMenu.mjs.map +1 -0
- package/dist/jsx/chrome/UserMenu.native.js +186 -0
- package/dist/jsx/chrome/UserMenu.native.js.map +1 -0
- package/dist/jsx/chrome/awesomebar-data.mjs +144 -0
- package/dist/jsx/chrome/awesomebar-data.mjs.map +1 -0
- package/dist/jsx/chrome/awesomebar-data.native.js +233 -0
- package/dist/jsx/chrome/awesomebar-data.native.js.map +1 -0
- package/dist/jsx/chrome/command-palette-model.mjs +183 -0
- package/dist/jsx/chrome/command-palette-model.mjs.map +1 -0
- package/dist/jsx/chrome/command-palette-model.native.js +301 -0
- package/dist/jsx/chrome/command-palette-model.native.js.map +1 -0
- package/dist/jsx/chrome/help-about-dialog.mjs +111 -0
- package/dist/jsx/chrome/help-about-dialog.mjs.map +1 -0
- package/dist/jsx/chrome/help-about-dialog.native.js +146 -0
- package/dist/jsx/chrome/help-about-dialog.native.js.map +1 -0
- package/dist/jsx/chrome/help-shortcuts-dialog.mjs +130 -0
- package/dist/jsx/chrome/help-shortcuts-dialog.mjs.map +1 -0
- package/dist/jsx/chrome/help-shortcuts-dialog.native.js +168 -0
- package/dist/jsx/chrome/help-shortcuts-dialog.native.js.map +1 -0
- package/dist/jsx/chrome/notifications-data.mjs +165 -0
- package/dist/jsx/chrome/notifications-data.mjs.map +1 -0
- package/dist/jsx/chrome/notifications-data.native.js +271 -0
- package/dist/jsx/chrome/notifications-data.native.js.map +1 -0
- package/dist/jsx/chrome/notifications-panel.mjs +146 -0
- package/dist/jsx/chrome/notifications-panel.mjs.map +1 -0
- package/dist/jsx/chrome/notifications-panel.native.js +189 -0
- package/dist/jsx/chrome/notifications-panel.native.js.map +1 -0
- package/dist/jsx/chrome/notifications-utils.mjs +17 -0
- package/dist/jsx/chrome/notifications-utils.mjs.map +1 -0
- package/dist/jsx/chrome/notifications-utils.native.js +46 -0
- package/dist/jsx/chrome/notifications-utils.native.js.map +1 -0
- package/dist/jsx/chrome/shortcuts.mjs +33 -0
- package/dist/jsx/chrome/shortcuts.mjs.map +1 -0
- package/dist/jsx/chrome/shortcuts.native.js +72 -0
- package/dist/jsx/chrome/shortcuts.native.js.map +1 -0
- package/dist/jsx/chrome/user-session.mjs +73 -0
- package/dist/jsx/chrome/user-session.mjs.map +1 -0
- package/dist/jsx/chrome/user-session.native.js +120 -0
- package/dist/jsx/chrome/user-session.native.js.map +1 -0
- package/dist/jsx/config/BackofficeProvider.mjs +132 -0
- package/dist/jsx/config/BackofficeProvider.mjs.map +1 -0
- package/dist/jsx/config/BackofficeProvider.native.js +217 -0
- package/dist/jsx/config/BackofficeProvider.native.js.map +1 -0
- package/dist/jsx/config/capabilities.mjs +97 -0
- package/dist/jsx/config/capabilities.mjs.map +1 -0
- package/dist/jsx/config/capabilities.native.js +155 -0
- package/dist/jsx/config/capabilities.native.js.map +1 -0
- package/dist/jsx/config/events.mjs +2 -0
- package/dist/jsx/config/events.mjs.map +1 -0
- package/dist/jsx/config/events.native.js +21 -0
- package/dist/jsx/config/events.native.js.map +1 -0
- package/dist/jsx/config/slots.mjs +2 -0
- package/dist/jsx/config/slots.mjs.map +1 -0
- package/dist/jsx/config/slots.native.js +21 -0
- package/dist/jsx/config/slots.native.js.map +1 -0
- package/dist/jsx/i18n/en.mjs +76 -0
- package/dist/jsx/i18n/en.mjs.map +1 -0
- package/dist/jsx/i18n/en.native.js +104 -0
- package/dist/jsx/i18n/en.native.js.map +1 -0
- package/dist/jsx/i18n/index.mjs +40 -0
- package/dist/jsx/i18n/index.mjs.map +1 -0
- package/dist/jsx/i18n/index.native.js +102 -0
- package/dist/jsx/i18n/index.native.js.map +1 -0
- package/dist/jsx/index.js +26 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/index.mjs +26 -0
- package/dist/jsx/index.mjs.map +1 -0
- package/dist/jsx/index.native.js +112 -0
- package/dist/jsx/index.native.js.map +1 -0
- package/dist/jsx/navigation/navigator.mjs +115 -0
- package/dist/jsx/navigation/navigator.mjs.map +1 -0
- package/dist/jsx/navigation/navigator.native.js +307 -0
- package/dist/jsx/navigation/navigator.native.js.map +1 -0
- package/dist/jsx/navigation/paths.mjs +66 -0
- package/dist/jsx/navigation/paths.mjs.map +1 -0
- package/dist/jsx/navigation/paths.native.js +143 -0
- package/dist/jsx/navigation/paths.native.js.map +1 -0
- package/dist/jsx/oneAdapter/index.mjs +28 -0
- package/dist/jsx/oneAdapter/index.mjs.map +1 -0
- package/dist/jsx/oneAdapter/index.native.js +64 -0
- package/dist/jsx/oneAdapter/index.native.js.map +1 -0
- package/dist/jsx/shared/useFrappeApp.mjs +31 -0
- package/dist/jsx/shared/useFrappeApp.mjs.map +1 -0
- package/dist/jsx/shared/useFrappeApp.native.js +60 -0
- package/dist/jsx/shared/useFrappeApp.native.js.map +1 -0
- package/dist/jsx/shell/BackofficeShell.mjs +169 -0
- package/dist/jsx/shell/BackofficeShell.mjs.map +1 -0
- package/dist/jsx/shell/BackofficeShell.native.js +223 -0
- package/dist/jsx/shell/BackofficeShell.native.js.map +1 -0
- package/dist/jsx/shell/WorkspaceSidebar.mjs +89 -0
- package/dist/jsx/shell/WorkspaceSidebar.mjs.map +1 -0
- package/dist/jsx/shell/WorkspaceSidebar.native.js +143 -0
- package/dist/jsx/shell/WorkspaceSidebar.native.js.map +1 -0
- package/dist/jsx/shell/useWorkspaces.mjs +104 -0
- package/dist/jsx/shell/useWorkspaces.mjs.map +1 -0
- package/dist/jsx/shell/useWorkspaces.native.js +173 -0
- package/dist/jsx/shell/useWorkspaces.native.js.map +1 -0
- package/dist/jsx/shell/workspaceIcons.mjs +39 -0
- package/dist/jsx/shell/workspaceIcons.mjs.map +1 -0
- package/dist/jsx/shell/workspaceIcons.native.js +67 -0
- package/dist/jsx/shell/workspaceIcons.native.js.map +1 -0
- package/package.json +123 -0
- package/src/chrome/BackofficeAwesomebar.tsx +89 -0
- package/src/chrome/CommandPalette.spec.tsx +252 -0
- package/src/chrome/CommandPalette.tsx +520 -0
- package/src/chrome/HelpMenu.tsx +119 -0
- package/src/chrome/NotificationsButton.tsx +87 -0
- package/src/chrome/UserMenu.tsx +173 -0
- package/src/chrome/awesomebar-data.tsx +252 -0
- package/src/chrome/command-palette-model.ts +291 -0
- package/src/chrome/help-about-dialog.tsx +130 -0
- package/src/chrome/help-shortcuts-dialog.tsx +144 -0
- package/src/chrome/notifications-data.tsx +287 -0
- package/src/chrome/notifications-panel.tsx +175 -0
- package/src/chrome/notifications-utils.tsx +44 -0
- package/src/chrome/shortcuts.ts +53 -0
- package/src/chrome/user-session.tsx +116 -0
- package/src/config/BackofficeProvider.spec.tsx +126 -0
- package/src/config/BackofficeProvider.tsx +315 -0
- package/src/config/capabilities.ts +172 -0
- package/src/config/events.ts +19 -0
- package/src/config/slots.ts +28 -0
- package/src/i18n/en.ts +83 -0
- package/src/i18n/index.ts +69 -0
- package/src/index.ts +150 -0
- package/src/navigation/navigator.spec.ts +106 -0
- package/src/navigation/navigator.ts +209 -0
- package/src/navigation/paths.ts +146 -0
- package/src/oneAdapter/index.tsx +61 -0
- package/src/shared/useFrappeApp.ts +39 -0
- package/src/shell/BackofficeShell.tsx +222 -0
- package/src/shell/WorkspaceSidebar.tsx +119 -0
- package/src/shell/useWorkspaces.ts +202 -0
- package/src/shell/workspaceIcons.ts +76 -0
- package/types/chrome/BackofficeAwesomebar.d.ts +12 -0
- package/types/chrome/BackofficeAwesomebar.d.ts.map +1 -0
- package/types/chrome/CommandPalette.d.ts +6 -0
- package/types/chrome/CommandPalette.d.ts.map +1 -0
- package/types/chrome/HelpMenu.d.ts +2 -0
- package/types/chrome/HelpMenu.d.ts.map +1 -0
- package/types/chrome/NotificationsButton.d.ts +2 -0
- package/types/chrome/NotificationsButton.d.ts.map +1 -0
- package/types/chrome/UserMenu.d.ts +6 -0
- package/types/chrome/UserMenu.d.ts.map +1 -0
- package/types/chrome/awesomebar-data.d.ts +52 -0
- package/types/chrome/awesomebar-data.d.ts.map +1 -0
- package/types/chrome/command-palette-model.d.ts +47 -0
- package/types/chrome/command-palette-model.d.ts.map +1 -0
- package/types/chrome/help-about-dialog.d.ts +12 -0
- package/types/chrome/help-about-dialog.d.ts.map +1 -0
- package/types/chrome/help-shortcuts-dialog.d.ts +6 -0
- package/types/chrome/help-shortcuts-dialog.d.ts.map +1 -0
- package/types/chrome/notifications-data.d.ts +34 -0
- package/types/chrome/notifications-data.d.ts.map +1 -0
- package/types/chrome/notifications-panel.d.ts +11 -0
- package/types/chrome/notifications-panel.d.ts.map +1 -0
- package/types/chrome/notifications-utils.d.ts +21 -0
- package/types/chrome/notifications-utils.d.ts.map +1 -0
- package/types/chrome/shortcuts.d.ts +6 -0
- package/types/chrome/shortcuts.d.ts.map +1 -0
- package/types/chrome/user-session.d.ts +19 -0
- package/types/chrome/user-session.d.ts.map +1 -0
- package/types/config/BackofficeProvider.d.ts +128 -0
- package/types/config/BackofficeProvider.d.ts.map +1 -0
- package/types/config/capabilities.d.ts +109 -0
- package/types/config/capabilities.d.ts.map +1 -0
- package/types/config/events.d.ts +39 -0
- package/types/config/events.d.ts.map +1 -0
- package/types/config/slots.d.ts +32 -0
- package/types/config/slots.d.ts.map +1 -0
- package/types/i18n/en.d.ts +83 -0
- package/types/i18n/en.d.ts.map +1 -0
- package/types/i18n/index.d.ts +27 -0
- package/types/i18n/index.d.ts.map +1 -0
- package/types/index.d.ts +55 -0
- package/types/index.d.ts.map +1 -0
- package/types/navigation/navigator.d.ts +98 -0
- package/types/navigation/navigator.d.ts.map +1 -0
- package/types/navigation/paths.d.ts +60 -0
- package/types/navigation/paths.d.ts.map +1 -0
- package/types/oneAdapter/index.d.ts +8 -0
- package/types/oneAdapter/index.d.ts.map +1 -0
- package/types/shared/useFrappeApp.d.ts +10 -0
- package/types/shared/useFrappeApp.d.ts.map +1 -0
- package/types/shell/BackofficeShell.d.ts +10 -0
- package/types/shell/BackofficeShell.d.ts.map +1 -0
- package/types/shell/WorkspaceSidebar.d.ts +9 -0
- package/types/shell/WorkspaceSidebar.d.ts.map +1 -0
- package/types/shell/useWorkspaces.d.ts +43 -0
- package/types/shell/useWorkspaces.d.ts.map +1 -0
- package/types/shell/workspaceIcons.d.ts +9 -0
- package/types/shell/workspaceIcons.d.ts.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@multiplatform.one/backoffice",
|
|
3
|
+
"version": "6.3.0",
|
|
4
|
+
"description": "Embeddable Frappe desk recreation (backoffice) for the multiplatform.one stack",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"backoffice",
|
|
7
|
+
"cross-platform",
|
|
8
|
+
"desk",
|
|
9
|
+
"frappe",
|
|
10
|
+
"multiplatform",
|
|
11
|
+
"react",
|
|
12
|
+
"react-native",
|
|
13
|
+
"tamagui",
|
|
14
|
+
"ui-components"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://multiplatform.one",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://gitlab.com/bitspur/multiplatform.one/multiplatform.one/issues",
|
|
19
|
+
"email": "support@risserlabs.com"
|
|
20
|
+
},
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
|
+
"author": "BitSpur <support@risserlabs.com> (https://risserlabs.com)",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://gitlab.com/bitspur/frappe/multiplatform.one.git",
|
|
26
|
+
"directory": "public/backoffice"
|
|
27
|
+
},
|
|
28
|
+
"source": "src/index.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"src",
|
|
32
|
+
"types",
|
|
33
|
+
"!types/.tsbuildinfo"
|
|
34
|
+
],
|
|
35
|
+
"sideEffects": [
|
|
36
|
+
"**/*.css"
|
|
37
|
+
],
|
|
38
|
+
"main": "src/index.ts",
|
|
39
|
+
"module": "src/index.ts",
|
|
40
|
+
"types": "types/index.d.ts",
|
|
41
|
+
"exports": {
|
|
42
|
+
"./package.json": "./package.json",
|
|
43
|
+
"./src/*": "./src/*",
|
|
44
|
+
".": {
|
|
45
|
+
"source": "./src/index.ts",
|
|
46
|
+
"types": "./types/index.d.ts",
|
|
47
|
+
"react-native": {
|
|
48
|
+
"types": "./types/index.d.ts",
|
|
49
|
+
"import": "./dist/esm/index.native.js",
|
|
50
|
+
"require": "./dist/cjs/index.native.js"
|
|
51
|
+
},
|
|
52
|
+
"import": "./dist/esm/index.mjs",
|
|
53
|
+
"require": "./dist/cjs/index.cjs",
|
|
54
|
+
"default": "./dist/esm/index.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./one-adapter": {
|
|
57
|
+
"source": "./src/oneAdapter/index.tsx",
|
|
58
|
+
"types": "./types/oneAdapter/index.d.ts",
|
|
59
|
+
"react-native": {
|
|
60
|
+
"types": "./types/oneAdapter/index.d.ts",
|
|
61
|
+
"import": "./dist/esm/oneAdapter/index.native.js",
|
|
62
|
+
"require": "./dist/cjs/oneAdapter/index.native.js"
|
|
63
|
+
},
|
|
64
|
+
"import": "./dist/esm/oneAdapter/index.mjs",
|
|
65
|
+
"require": "./dist/cjs/oneAdapter/index.cjs",
|
|
66
|
+
"default": "./dist/esm/oneAdapter/index.mjs"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
74
|
+
"tamagui": "2.0.0-rc.41",
|
|
75
|
+
"@multiplatform.one/components": "6.3.0",
|
|
76
|
+
"@multiplatform.one/frappe-ui": "6.3.0",
|
|
77
|
+
"@multiplatform.one/frappe": "6.3.0",
|
|
78
|
+
"@multiplatform.one/i18n": "6.3.0",
|
|
79
|
+
"@multiplatform.one/table": "6.3.0",
|
|
80
|
+
"@multiplatform.one/forms": "6.3.0",
|
|
81
|
+
"@multiplatform.one/platform": "6.3.0",
|
|
82
|
+
"@multiplatform.one/theme": "6.3.0",
|
|
83
|
+
"@multiplatform.one/store": "6.3.0"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@tamagui/build": "2.0.0-rc.41",
|
|
87
|
+
"@testing-library/react": "^16.3.2",
|
|
88
|
+
"@types/react": "~19.2.14",
|
|
89
|
+
"@types/react-dom": "^19.2.3",
|
|
90
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
91
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
92
|
+
"i18next": "^25.10.10",
|
|
93
|
+
"one": "^1.16.5",
|
|
94
|
+
"react": "19.2.5",
|
|
95
|
+
"react-dom": "19.2.5",
|
|
96
|
+
"react-i18next": "^16.6.6",
|
|
97
|
+
"vitest": "^4.1.5",
|
|
98
|
+
"@multiplatform.one/config": "6.3.0",
|
|
99
|
+
"@multiplatform.one/test-utils": "6.3.0"
|
|
100
|
+
},
|
|
101
|
+
"peerDependencies": {
|
|
102
|
+
"i18next": "^25.0.0",
|
|
103
|
+
"one": "^1.4.10",
|
|
104
|
+
"react": "^19.1.0",
|
|
105
|
+
"react-dom": "^19.1.0",
|
|
106
|
+
"react-i18next": ">=14",
|
|
107
|
+
"react-native": ">=0.83.0"
|
|
108
|
+
},
|
|
109
|
+
"peerDependenciesMeta": {
|
|
110
|
+
"one": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
113
|
+
"react-native": {
|
|
114
|
+
"optional": true
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"module:jsx": "dist/jsx",
|
|
118
|
+
"scripts": {
|
|
119
|
+
"build": "rm -rf dist types 2>/dev/null && tamagui-build --ts-project ./tsconfig.build.json --exclude '\\.spec\\.|\\.test\\.|\\.stories\\.'",
|
|
120
|
+
"test": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=text --coverage.reporter=lcov --coverage.reporter=html",
|
|
121
|
+
"typecheck": "tsc --noEmit"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// The navbar search affordance for the backoffice desk chrome. Since MOD-01
|
|
2
|
+
// the results surface is a first-class command palette (CommandPalette):
|
|
3
|
+
// this component renders the TRIGGER — a search-input-styled button with the
|
|
4
|
+
// platform shortcut hint — and mounts the palette. The shell's global
|
|
5
|
+
// shortcuts (Mod+K / Mod+G, chrome/shortcuts.ts) land here through
|
|
6
|
+
// `focusRef` and open the same palette.
|
|
7
|
+
//
|
|
8
|
+
// The old input-anchored dropdown (unusable at phone widths — clamped to the
|
|
9
|
+
// ~110px input) is gone; the palette presents as a centered overlay ≥sm and
|
|
10
|
+
// a full-height sheet <sm, both fed by one section model
|
|
11
|
+
// (chrome/command-palette-model.ts).
|
|
12
|
+
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
13
|
+
import { Button, SizableText, Text, XStack, isWeb } from "@multiplatform.one/components";
|
|
14
|
+
import { useLayoutSizeClass } from "@multiplatform.one/theme";
|
|
15
|
+
import type { Ref } from "react";
|
|
16
|
+
import { useImperativeHandle, useState } from "react";
|
|
17
|
+
import { useTranslation } from "react-i18next";
|
|
18
|
+
import { BACKOFFICE_I18N_NAMESPACE } from "../i18n";
|
|
19
|
+
import { CommandPalette } from "./CommandPalette";
|
|
20
|
+
|
|
21
|
+
/** Imperative surface for the shell's global shortcuts (Mod+K / Mod+G). */
|
|
22
|
+
export interface BackofficeAwesomebarHandle {
|
|
23
|
+
/** Open the command palette (focus lands in its search input on web). */
|
|
24
|
+
focus: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface BackofficeAwesomebarProps {
|
|
28
|
+
/** Populated for the shell so useBackofficeShortcuts can open the palette. */
|
|
29
|
+
focusRef?: Ref<BackofficeAwesomebarHandle>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Platform modifier label; SSR/native-safe (defaults to "Ctrl"). */
|
|
33
|
+
function getModLabel(): string {
|
|
34
|
+
if (
|
|
35
|
+
typeof navigator !== "undefined" &&
|
|
36
|
+
/Mac|iPhone|iPad|iPod/i.test(String(navigator.platform ?? ""))
|
|
37
|
+
) {
|
|
38
|
+
return "\u2318";
|
|
39
|
+
}
|
|
40
|
+
return "Ctrl";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function BackofficeAwesomebar({ focusRef }: BackofficeAwesomebarProps = {}) {
|
|
44
|
+
const { t } = useTranslation(BACKOFFICE_I18N_NAMESPACE);
|
|
45
|
+
const isCompact = useLayoutSizeClass() === "compact";
|
|
46
|
+
const [open, setOpen] = useState(false);
|
|
47
|
+
|
|
48
|
+
useImperativeHandle(focusRef, () => ({ focus: () => setOpen(true) }), []);
|
|
49
|
+
|
|
50
|
+
const label = t("awesomebar.triggerLabel", "Search");
|
|
51
|
+
const showShortcutHint = isWeb && !isCompact;
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<Button
|
|
56
|
+
size="$3"
|
|
57
|
+
flex={1}
|
|
58
|
+
minWidth={0}
|
|
59
|
+
justifyContent="flex-start"
|
|
60
|
+
aria-label={label}
|
|
61
|
+
aria-haspopup="dialog"
|
|
62
|
+
aria-expanded={open}
|
|
63
|
+
onPress={() => setOpen(true)}
|
|
64
|
+
data-testid="backoffice-awesomebar"
|
|
65
|
+
>
|
|
66
|
+
<MagnifyingGlassIcon size={16} />
|
|
67
|
+
<Text flex={1} minWidth={0} numberOfLines={1} textAlign="left" color="$color10">
|
|
68
|
+
{label}
|
|
69
|
+
</Text>
|
|
70
|
+
{showShortcutHint && (
|
|
71
|
+
<XStack
|
|
72
|
+
borderWidth={1}
|
|
73
|
+
borderColor="$borderColor"
|
|
74
|
+
backgroundColor="$color2"
|
|
75
|
+
borderRadius="$2"
|
|
76
|
+
paddingHorizontal="$1.5"
|
|
77
|
+
flexShrink={0}
|
|
78
|
+
aria-hidden
|
|
79
|
+
>
|
|
80
|
+
<SizableText size="$1" fontWeight="600" color="$color11">
|
|
81
|
+
{`${getModLabel()} K`}
|
|
82
|
+
</SizableText>
|
|
83
|
+
</XStack>
|
|
84
|
+
)}
|
|
85
|
+
</Button>
|
|
86
|
+
<CommandPalette open={open} onOpenChange={setOpen} />
|
|
87
|
+
</>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InMemoryFixtureProvider } from "@multiplatform.one/frappe";
|
|
3
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
4
|
+
import { fireEvent, screen, waitFor, within } from "@testing-library/react";
|
|
5
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
6
|
+
import { createMemoryNavigator } from "../navigation/navigator";
|
|
7
|
+
import { BackofficeShell } from "../shell/BackofficeShell";
|
|
8
|
+
import { BackofficeProvider, type BackofficeProviderProps } from "../config/BackofficeProvider";
|
|
9
|
+
import type { RecentItem } from "./awesomebar-data";
|
|
10
|
+
|
|
11
|
+
// The shared desk recents store rides @multiplatform.one/store, which the
|
|
12
|
+
// vitest module graph duplicates (inlined vs externalized resolutions), so a
|
|
13
|
+
// spec-side storage write never reaches the copy the palette reads. Stub the
|
|
14
|
+
// read seam instead; the store round-trip is covered by the store package.
|
|
15
|
+
const recentsSeed: { items: RecentItem[] } = { items: [] };
|
|
16
|
+
vi.mock("./awesomebar-data", async (importOriginal) => {
|
|
17
|
+
const actual = await importOriginal<typeof import("./awesomebar-data")>();
|
|
18
|
+
return { ...actual, readRecentItems: async () => recentsSeed.items };
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Unique host per spec file: the awesomebar catalog cache is module-global
|
|
22
|
+
// and keyed by baseURL, so sharing a host with other spec files would leak
|
|
23
|
+
// their fixture catalogs in here.
|
|
24
|
+
const MOCK_HOST = "https://backoffice-palette.mock.test";
|
|
25
|
+
|
|
26
|
+
const makeFixtures = () =>
|
|
27
|
+
new InMemoryFixtureProvider({
|
|
28
|
+
DocType: [
|
|
29
|
+
{ name: "ToDo", doctype: "DocType" },
|
|
30
|
+
{ name: "ToDo Template", doctype: "DocType" },
|
|
31
|
+
{ name: "Note", doctype: "DocType" },
|
|
32
|
+
{ name: "User", doctype: "DocType" },
|
|
33
|
+
],
|
|
34
|
+
Workspace: [
|
|
35
|
+
{
|
|
36
|
+
name: "todos",
|
|
37
|
+
doctype: "Workspace",
|
|
38
|
+
title: "Todos",
|
|
39
|
+
icon: "tool",
|
|
40
|
+
parent_page: "",
|
|
41
|
+
public: 1,
|
|
42
|
+
for_user: "",
|
|
43
|
+
sequence_id: 1,
|
|
44
|
+
module: "Automation",
|
|
45
|
+
is_hidden: 0,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
"Notification Log": [],
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const GLOBAL_SEARCH_HITS = [
|
|
52
|
+
{
|
|
53
|
+
doctype: "ToDo",
|
|
54
|
+
name: "TD-0001",
|
|
55
|
+
content: "Description: pay the rent ||| Status: Open",
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
function stubFetch() {
|
|
60
|
+
const fetchMock = vi.fn(async (input: RequestInfo | URL) => {
|
|
61
|
+
const url =
|
|
62
|
+
typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
|
|
63
|
+
if (url.includes("frappe.utils.global_search.search")) {
|
|
64
|
+
return new Response(JSON.stringify({ message: GLOBAL_SEARCH_HITS }), {
|
|
65
|
+
status: 200,
|
|
66
|
+
headers: { "Content-Type": "application/json" },
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return new Response(JSON.stringify({}), {
|
|
70
|
+
status: 404,
|
|
71
|
+
headers: { "Content-Type": "application/json" },
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
vi.stubGlobal("fetch", fetchMock);
|
|
75
|
+
return fetchMock;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function renderShell(props: Partial<BackofficeProviderProps> = {}) {
|
|
79
|
+
const navigation = props.navigation ?? createMemoryNavigator("/backoffice");
|
|
80
|
+
return {
|
|
81
|
+
navigation,
|
|
82
|
+
...renderWithProviders(
|
|
83
|
+
<BackofficeProvider
|
|
84
|
+
frappe={{ baseURL: MOCK_HOST, fixtures: makeFixtures() }}
|
|
85
|
+
navigation={navigation}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
<BackofficeShell>
|
|
89
|
+
<div>page body</div>
|
|
90
|
+
</BackofficeShell>
|
|
91
|
+
</BackofficeProvider>,
|
|
92
|
+
),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Open the palette through the navbar trigger and return its search input. */
|
|
97
|
+
async function openPalette() {
|
|
98
|
+
fireEvent.click(screen.getByTestId("backoffice-awesomebar"));
|
|
99
|
+
const palette = await screen.findByTestId("backoffice-command-palette");
|
|
100
|
+
const input = palette.querySelector("input");
|
|
101
|
+
if (!input) throw new Error("palette input not found");
|
|
102
|
+
return { palette, input };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
beforeEach(() => {
|
|
106
|
+
stubFetch();
|
|
107
|
+
recentsSeed.items = [{ label: "My ToDo", path: "/backoffice/todo/x" }];
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
afterEach(() => {
|
|
111
|
+
vi.unstubAllGlobals();
|
|
112
|
+
recentsSeed.items = [];
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe("CommandPalette sections", () => {
|
|
116
|
+
it("composes sections in order: recents → actions → navigation → documents", async () => {
|
|
117
|
+
renderShell();
|
|
118
|
+
const { input } = await openPalette();
|
|
119
|
+
|
|
120
|
+
fireEvent.change(input, { target: { value: "todo" } });
|
|
121
|
+
|
|
122
|
+
// Documents arrive after the 300ms debounce + stubbed RPC.
|
|
123
|
+
await waitFor(
|
|
124
|
+
() => expect(screen.getByTestId("backoffice-palette-section-documents")).toBeTruthy(),
|
|
125
|
+
{ timeout: 3000 },
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
const sectionNodes = Array.from(
|
|
129
|
+
document.querySelectorAll('[data-testid^="backoffice-palette-section-"]'),
|
|
130
|
+
).map((node) => node.getAttribute("data-testid"));
|
|
131
|
+
expect(sectionNodes).toEqual([
|
|
132
|
+
"backoffice-palette-section-recents",
|
|
133
|
+
"backoffice-palette-section-actions",
|
|
134
|
+
"backoffice-palette-section-navigation",
|
|
135
|
+
"backoffice-palette-section-documents",
|
|
136
|
+
]);
|
|
137
|
+
|
|
138
|
+
// Recents: the stored visit matching the query.
|
|
139
|
+
const recents = screen.getByTestId("backoffice-palette-section-recents");
|
|
140
|
+
expect(within(recents).getByText("My ToDo")).toBeTruthy();
|
|
141
|
+
|
|
142
|
+
// Actions: contextual commands for the top doctype match.
|
|
143
|
+
const actions = screen.getByTestId("backoffice-palette-section-actions");
|
|
144
|
+
expect(within(actions).getByText("New ToDo")).toBeTruthy();
|
|
145
|
+
expect(within(actions).getByText("ToDo List")).toBeTruthy();
|
|
146
|
+
|
|
147
|
+
// Navigation: matching workspace + further doctype matches.
|
|
148
|
+
const navigation = screen.getByTestId("backoffice-palette-section-navigation");
|
|
149
|
+
expect(within(navigation).getByText("Todos")).toBeTruthy();
|
|
150
|
+
expect(within(navigation).getByText("ToDo Template")).toBeTruthy();
|
|
151
|
+
|
|
152
|
+
// Documents: global-search hit with its doctype badge + snippet.
|
|
153
|
+
const documents = screen.getByTestId("backoffice-palette-section-documents");
|
|
154
|
+
expect(within(documents).getByText("TD-0001")).toBeTruthy();
|
|
155
|
+
expect(within(documents).getByText(/pay the rent/)).toBeTruthy();
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("empty query shows recents only (skip empty sections, hint when no recents)", async () => {
|
|
159
|
+
renderShell();
|
|
160
|
+
await openPalette();
|
|
161
|
+
|
|
162
|
+
expect(await screen.findByTestId("backoffice-palette-section-recents")).toBeTruthy();
|
|
163
|
+
expect(screen.queryByTestId("backoffice-palette-section-actions")).toBeNull();
|
|
164
|
+
expect(screen.queryByTestId("backoffice-palette-section-navigation")).toBeNull();
|
|
165
|
+
expect(screen.queryByTestId("backoffice-palette-section-documents")).toBeNull();
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
describe("CommandPalette keyboard", () => {
|
|
170
|
+
it("arrows move the roving highlight and Enter navigates via the navigator", async () => {
|
|
171
|
+
const { navigation } = renderShell();
|
|
172
|
+
const { input } = await openPalette();
|
|
173
|
+
|
|
174
|
+
fireEvent.change(input, { target: { value: "note" } });
|
|
175
|
+
|
|
176
|
+
// Actions for the top match render synchronously from the catalog.
|
|
177
|
+
await waitFor(() => expect(screen.getByText("New Note")).toBeTruthy());
|
|
178
|
+
|
|
179
|
+
// items[0] = "New Note"; ArrowDown → items[1] = "Note List".
|
|
180
|
+
fireEvent.keyDown(input, { key: "ArrowDown" });
|
|
181
|
+
await waitFor(() =>
|
|
182
|
+
expect(screen.getByText("Note List").closest('[role="option"]')).toBeTruthy(),
|
|
183
|
+
);
|
|
184
|
+
fireEvent.keyDown(input, { key: "Enter" });
|
|
185
|
+
|
|
186
|
+
expect(navigation.getLocation().path).toBe("/backoffice/note");
|
|
187
|
+
// COMMIT class: the pick closed the palette.
|
|
188
|
+
await waitFor(() => expect(screen.queryByTestId("backoffice-command-palette")).toBeNull());
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it("Escape closes the palette and returns focus to the trigger (D-22)", async () => {
|
|
192
|
+
renderShell();
|
|
193
|
+
const trigger = screen.getByTestId("backoffice-awesomebar");
|
|
194
|
+
(trigger as HTMLElement).focus();
|
|
195
|
+
const { input } = await openPalette();
|
|
196
|
+
|
|
197
|
+
fireEvent.keyDown(input, { key: "Escape" });
|
|
198
|
+
|
|
199
|
+
await waitFor(() => expect(screen.queryByTestId("backoffice-command-palette")).toBeNull());
|
|
200
|
+
await waitFor(() => expect(document.activeElement).toBe(trigger));
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
describe("CommandPalette capability + scoping", () => {
|
|
205
|
+
it("awesomebar capability off → no trigger and the palette never mounts", async () => {
|
|
206
|
+
renderShell({ capabilities: { awesomebar: false } });
|
|
207
|
+
|
|
208
|
+
expect(screen.queryByTestId("backoffice-awesomebar")).toBeNull();
|
|
209
|
+
|
|
210
|
+
// The shell shortcut (Mod+K) is not wired when the capability is off.
|
|
211
|
+
fireEvent.keyDown(document.body, { key: "k", ctrlKey: true });
|
|
212
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
213
|
+
expect(screen.queryByTestId("backoffice-command-palette")).toBeNull();
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
it("Mod+K opens the palette when the capability is on", async () => {
|
|
217
|
+
renderShell();
|
|
218
|
+
|
|
219
|
+
fireEvent.keyDown(document.body, { key: "k", ctrlKey: true });
|
|
220
|
+
|
|
221
|
+
expect(await screen.findByTestId("backoffice-command-palette")).toBeTruthy();
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("doctype deny scoping removes actions, navigation rows, and document hits", async () => {
|
|
225
|
+
const fetchMock = globalThis.fetch as ReturnType<typeof vi.fn>;
|
|
226
|
+
renderShell({ doctypes: { deny: ["ToDo"] } });
|
|
227
|
+
const { input } = await openPalette();
|
|
228
|
+
|
|
229
|
+
fireEvent.change(input, { target: { value: "todo" } });
|
|
230
|
+
|
|
231
|
+
// Top allowed match becomes "ToDo Template" — its commands render…
|
|
232
|
+
await waitFor(() => expect(screen.getByText("New ToDo Template")).toBeTruthy());
|
|
233
|
+
// …while the denied doctype's exact commands never do.
|
|
234
|
+
expect(screen.queryByText("New ToDo")).toBeNull();
|
|
235
|
+
expect(screen.queryByText("ToDo List")).toBeNull();
|
|
236
|
+
|
|
237
|
+
// Wait for the debounced global search to settle, then assert the ToDo
|
|
238
|
+
// document hit was scoped out.
|
|
239
|
+
await waitFor(
|
|
240
|
+
() =>
|
|
241
|
+
expect(
|
|
242
|
+
fetchMock.mock.calls.some((call) =>
|
|
243
|
+
String(call[0]).includes("frappe.utils.global_search.search"),
|
|
244
|
+
),
|
|
245
|
+
).toBe(true),
|
|
246
|
+
{ timeout: 3000 },
|
|
247
|
+
);
|
|
248
|
+
await waitFor(() => expect(screen.queryByText("Searching…")).toBeNull(), { timeout: 3000 });
|
|
249
|
+
expect(screen.queryByText("TD-0001")).toBeNull();
|
|
250
|
+
expect(screen.queryByTestId("backoffice-palette-section-documents")).toBeNull();
|
|
251
|
+
});
|
|
252
|
+
});
|