@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/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2021 [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# @multiplatform.one/backoffice
|
|
2
|
+
|
|
3
|
+
An embeddable, cross-platform recreation of the Frappe Desk. Drop the whole
|
|
4
|
+
backoffice — shell chrome, workspaces, doctype lists, forms, views — into any
|
|
5
|
+
React app on the multiplatform.one stack, mounted at any URL prefix, behind
|
|
6
|
+
your own router, with flags for everything it shows and does.
|
|
7
|
+
|
|
8
|
+
Built on `@multiplatform.one/frappe` (live data client) and
|
|
9
|
+
`@multiplatform.one/frappe-ui` (doctype-aware components), rendering through
|
|
10
|
+
Tamagui — the same code runs on web, React Native, and the GTK/webview
|
|
11
|
+
targets the monorepo supports.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pnpm add @multiplatform.one/backoffice
|
|
17
|
+
# peers you likely already have:
|
|
18
|
+
pnpm add react react-dom react-i18next i18next
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`one` is an **optional** peer — only needed if you use the
|
|
22
|
+
`@multiplatform.one/backoffice/one-adapter` subpath.
|
|
23
|
+
|
|
24
|
+
## Concepts
|
|
25
|
+
|
|
26
|
+
Everything hangs off one component:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
<BackofficeProvider
|
|
30
|
+
frappe={…} ← Frappe connection (feeds FrappeProvider internally)
|
|
31
|
+
navigation={…} ← how the backoffice navigates (adapter, see below)
|
|
32
|
+
basePath={…} ← URL prefix it is mounted under (default "/backoffice")
|
|
33
|
+
capabilities={…} ← visibility/behavior flags (all default ON)
|
|
34
|
+
doctypes={…} ← allow/deny doctype scoping
|
|
35
|
+
slots={…} ← render-prop replacements for built-in chrome
|
|
36
|
+
onEvent={…} ← event bus (navigation, doc lifecycle, errors)
|
|
37
|
+
>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The backoffice never imports a router. It navigates through the
|
|
41
|
+
`BackofficeNavigator` you hand it — three methods and a subscribable
|
|
42
|
+
location:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
interface BackofficeNavigator {
|
|
46
|
+
navigate(path: string): void;
|
|
47
|
+
replace(path: string): void;
|
|
48
|
+
back(): void;
|
|
49
|
+
getLocation(): { path: string; params: Record<string, string | string[] | undefined> };
|
|
50
|
+
subscribe(listener: () => void): () => void;
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Minimal example (one screen)
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import {
|
|
58
|
+
BackofficeProvider,
|
|
59
|
+
BackofficeShell,
|
|
60
|
+
createMemoryNavigator,
|
|
61
|
+
} from "@multiplatform.one/backoffice";
|
|
62
|
+
|
|
63
|
+
const navigation = createMemoryNavigator("/backoffice");
|
|
64
|
+
|
|
65
|
+
export function App() {
|
|
66
|
+
return (
|
|
67
|
+
<BackofficeProvider frappe={{ baseURL: "https://mysite.frappe.cloud" }} navigation={navigation}>
|
|
68
|
+
<BackofficeShell>
|
|
69
|
+
<MyRoutedContent />
|
|
70
|
+
</BackofficeShell>
|
|
71
|
+
</BackofficeProvider>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Full shell in a One app
|
|
77
|
+
|
|
78
|
+
Routes stay thin files; the layout wires the adapter once:
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
// routes/backoffice/_layout.tsx
|
|
82
|
+
import { Slot } from "one";
|
|
83
|
+
import { BackofficeProvider, BackofficeShell } from "@multiplatform.one/backoffice";
|
|
84
|
+
import { useOneNavigator } from "@multiplatform.one/backoffice/one-adapter";
|
|
85
|
+
|
|
86
|
+
export default function BackofficeLayout() {
|
|
87
|
+
const navigation = useOneNavigator();
|
|
88
|
+
return (
|
|
89
|
+
<BackofficeProvider
|
|
90
|
+
frappe={{
|
|
91
|
+
baseURL: process.env.ONE_PUBLIC_FRAPPE_URL!,
|
|
92
|
+
socketPort: 9000,
|
|
93
|
+
auth: { useToken: true, token: "key:secret", type: "token" },
|
|
94
|
+
syncOptions: { persistKey: "backoffice", cdcInterval: 30_000 },
|
|
95
|
+
}}
|
|
96
|
+
navigation={navigation}
|
|
97
|
+
>
|
|
98
|
+
<BackofficeShell>
|
|
99
|
+
<Slot />
|
|
100
|
+
</BackofficeShell>
|
|
101
|
+
</BackofficeProvider>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Auth note: in cross-origin dev (app on one port, bench on another) the frappe
|
|
107
|
+
`sid` cookie never attaches — pass token `auth`. Same-origin deployments
|
|
108
|
+
behind a reverse proxy can omit `auth` and ride cookie auth.
|
|
109
|
+
|
|
110
|
+
## Navigation adapters
|
|
111
|
+
|
|
112
|
+
**One router** (subpath export, keeps the main entry router-free):
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import { useOneNavigator } from "@multiplatform.one/backoffice/one-adapter";
|
|
116
|
+
const navigation = useOneNavigator();
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Memory** (tests, Storybook, router-less embeddings):
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { createMemoryNavigator } from "@multiplatform.one/backoffice";
|
|
123
|
+
const navigation = createMemoryNavigator("/backoffice");
|
|
124
|
+
navigation.navigate("/backoffice/todo"); // full history stack, subscribable
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Anything else** — bridge your router with `ControlledNavigator`:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import { ControlledNavigator } from "@multiplatform.one/backoffice";
|
|
131
|
+
|
|
132
|
+
const navigation = new ControlledNavigator({
|
|
133
|
+
navigate: (path) => myRouter.push(path),
|
|
134
|
+
replace: (path) => myRouter.replace(path),
|
|
135
|
+
back: () => myRouter.back(),
|
|
136
|
+
});
|
|
137
|
+
// mirror your router's location back in (e.g. in a layout effect):
|
|
138
|
+
navigation.setLocation({ path: myRouter.pathname, params: myRouter.query });
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Mount anywhere: `basePath`
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
<BackofficeProvider basePath="/admin" …>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Every path the backoffice builds (sidebar workspaces, awesomebar commands,
|
|
148
|
+
notification links) is rebound to the prefix. Path helpers are available to
|
|
149
|
+
hosts too: `createBackofficePaths("/admin").form("ToDo", "abc")` →
|
|
150
|
+
`"/admin/todo/abc"`.
|
|
151
|
+
|
|
152
|
+
## Capability flags
|
|
153
|
+
|
|
154
|
+
All flags default **ON**; pass booleans or per-feature config objects:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
<BackofficeProvider
|
|
158
|
+
capabilities={{
|
|
159
|
+
notifications: false,
|
|
160
|
+
userMenu: { themeToggle: false, logout: false },
|
|
161
|
+
views: { allow: ["list", "report"] },
|
|
162
|
+
bulkActions: false,
|
|
163
|
+
}}
|
|
164
|
+
doctypes={{ allow: ["ToDo", "Note"] }} // or deny: […]
|
|
165
|
+
…
|
|
166
|
+
>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
| Flag | Gates | Config |
|
|
170
|
+
| --------------- | ----------------------------------------- | --------------------------------------------------------------------- |
|
|
171
|
+
| `awesomebar` | Global search / command bar in the navbar | `enabled` |
|
|
172
|
+
| `notifications` | Notification bell + panel | `enabled` |
|
|
173
|
+
| `userMenu` | Avatar menu | `enabled`, `themeToggle`, `logout` |
|
|
174
|
+
| `help` | Help menu (docs, shortcuts, about) | `enabled` |
|
|
175
|
+
| `sidebar` | Workspace sidebar (rail + drawer) | `enabled` |
|
|
176
|
+
| `quickEntry` | Quick-entry create dialogs | `enabled` |
|
|
177
|
+
| `views` | List views | `enabled`, `allow` (list/report/kanban/calendar/tree/image/dashboard) |
|
|
178
|
+
| `newDoc` | "New <doctype>" affordances | `enabled` |
|
|
179
|
+
| `bulkActions` | List multi-select action bar | `enabled` |
|
|
180
|
+
| `attachments` | Form sidebar attachments | `enabled` |
|
|
181
|
+
| `timeline` | Form activity timeline | `enabled` |
|
|
182
|
+
| `assignments` | Assignment surfaces | `enabled` |
|
|
183
|
+
| `tags` | Tag surfaces | `enabled` |
|
|
184
|
+
| `shares` | Document shares | `enabled` |
|
|
185
|
+
| `print` | Print affordances | `enabled` |
|
|
186
|
+
| `email` | Email / communication affordances | `enabled` |
|
|
187
|
+
|
|
188
|
+
`doctypes.allow` / `doctypes.deny` scope which doctypes are reachable
|
|
189
|
+
(awesomebar commands and document hits today; lists/links as surfaces land).
|
|
190
|
+
|
|
191
|
+
## Slots
|
|
192
|
+
|
|
193
|
+
Provider-level render props replace built-in chrome; everything else keeps
|
|
194
|
+
rendering:
|
|
195
|
+
|
|
196
|
+
| Slot | Replaces |
|
|
197
|
+
| ----------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
198
|
+
| `renderShellHeader({ defaultContent })` | Navbar content (wrap or rebuild; `defaultContent` is the built-in row) |
|
|
199
|
+
| `renderSidebarFooter()` | Appended under the workspace sidebar |
|
|
200
|
+
| `renderListEmpty({ doctype })` | List screen empty state |
|
|
201
|
+
| `renderFormHeader({ doctype, name, defaultContent })` | Document form header row |
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
slots={{
|
|
205
|
+
renderSidebarFooter: () => <MyEnvironmentBadge />,
|
|
206
|
+
renderShellHeader: ({ defaultContent }) => (
|
|
207
|
+
<>
|
|
208
|
+
{defaultContent}
|
|
209
|
+
<MyTenantSwitcher />
|
|
210
|
+
</>
|
|
211
|
+
),
|
|
212
|
+
}}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Events
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
<BackofficeProvider
|
|
219
|
+
onEvent={(event) => {
|
|
220
|
+
switch (event.type) {
|
|
221
|
+
case "navigate": // { path, mode: "push" | "replace" | "back" }
|
|
222
|
+
case "doc-opened": // { doctype, name }
|
|
223
|
+
case "doc-saved": // { doctype, name, isNew? }
|
|
224
|
+
case "doc-deleted":
|
|
225
|
+
case "error": // { error, context? }
|
|
226
|
+
}
|
|
227
|
+
}}
|
|
228
|
+
…
|
|
229
|
+
>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Custom fields and actions
|
|
233
|
+
|
|
234
|
+
```tsx
|
|
235
|
+
<BackofficeProvider
|
|
236
|
+
// merged into frappe-ui's field registry (fieldtype → renderer)
|
|
237
|
+
fields={{ Rating: MyRatingField }}
|
|
238
|
+
// extra toolbar actions (form + list surfaces)
|
|
239
|
+
actions={{
|
|
240
|
+
form: [{ id: "audit", label: "Audit", onPress: ({ doctype, name }) => … }],
|
|
241
|
+
}}
|
|
242
|
+
…
|
|
243
|
+
>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Theme toggle
|
|
247
|
+
|
|
248
|
+
The user menu's "Toggle Theme" needs a host adapter (the package does not own
|
|
249
|
+
your color-scheme store):
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
<BackofficeProvider
|
|
253
|
+
appearance={{ scheme, setScheme }} // e.g. from one's useUserScheme()
|
|
254
|
+
…
|
|
255
|
+
>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Without it the item renders disabled (some platforms have no scheme store).
|
|
259
|
+
|
|
260
|
+
## i18n
|
|
261
|
+
|
|
262
|
+
The package ships English translations under the **`backoffice`** namespace
|
|
263
|
+
and registers them on the global i18next instance at provider mount —
|
|
264
|
+
additive only (`deep: true, overwrite: false`), so your bundles win. If you
|
|
265
|
+
never initialize i18next, the provider brings up a minimal English-only
|
|
266
|
+
instance itself.
|
|
267
|
+
|
|
268
|
+
Override any key:
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
import i18next from "i18next";
|
|
272
|
+
|
|
273
|
+
i18next.addResourceBundle(
|
|
274
|
+
"en",
|
|
275
|
+
"backoffice",
|
|
276
|
+
{ shell: { title: "Acme Admin" }, userMenu: { logOut: "Sign out" } },
|
|
277
|
+
true, // deep
|
|
278
|
+
true, // overwrite the bundled defaults
|
|
279
|
+
);
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Ship another language the same way (`addResourceBundle("de", "backoffice", …)`).
|
|
283
|
+
Every built-in string also carries an inline English default, so a missing
|
|
284
|
+
bundle never renders raw keys.
|
|
285
|
+
|
|
286
|
+
## Testing your embedding
|
|
287
|
+
|
|
288
|
+
```tsx
|
|
289
|
+
import { render } from "@testing-library/react";
|
|
290
|
+
import {
|
|
291
|
+
BackofficeProvider,
|
|
292
|
+
BackofficeShell,
|
|
293
|
+
createMemoryNavigator,
|
|
294
|
+
} from "@multiplatform.one/backoffice";
|
|
295
|
+
import { InMemoryFixtureProvider } from "@multiplatform.one/frappe";
|
|
296
|
+
|
|
297
|
+
const navigation = createMemoryNavigator("/backoffice");
|
|
298
|
+
render(
|
|
299
|
+
<BackofficeProvider
|
|
300
|
+
frappe={{ baseURL: "https://mock.test", fixtures: new InMemoryFixtureProvider({ Workspace: […] }) }}
|
|
301
|
+
navigation={navigation}
|
|
302
|
+
>
|
|
303
|
+
<BackofficeShell>…</BackofficeShell>
|
|
304
|
+
</BackofficeProvider>,
|
|
305
|
+
);
|
|
306
|
+
navigation.navigate("/backoffice/todo");
|
|
307
|
+
expect(navigation.getLocation().path).toBe("/backoffice/todo");
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
`fixtures` swaps every network read for in-memory data — no bench needed.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var BackofficeAwesomebar_exports = {};
|
|
24
|
+
__export(BackofficeAwesomebar_exports, {
|
|
25
|
+
BackofficeAwesomebar: () => BackofficeAwesomebar
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(BackofficeAwesomebar_exports);
|
|
28
|
+
var import_react = require("@phosphor-icons/react");
|
|
29
|
+
var import_components = require("@multiplatform.one/components");
|
|
30
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
31
|
+
var import_react2 = require("react");
|
|
32
|
+
var import_react_i18next = require("react-i18next");
|
|
33
|
+
var import_i18n = require("../i18n/index.cjs");
|
|
34
|
+
var import_CommandPalette = require("./CommandPalette.cjs");
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
function getModLabel() {
|
|
37
|
+
if (typeof navigator !== "undefined" && /Mac|iPhone|iPad|iPod/i.test(String(navigator.platform ?? ""))) {
|
|
38
|
+
return "\u2318";
|
|
39
|
+
}
|
|
40
|
+
return "Ctrl";
|
|
41
|
+
}
|
|
42
|
+
function BackofficeAwesomebar({
|
|
43
|
+
focusRef
|
|
44
|
+
} = {}) {
|
|
45
|
+
const {
|
|
46
|
+
t
|
|
47
|
+
} = (0, import_react_i18next.useTranslation)(import_i18n.BACKOFFICE_I18N_NAMESPACE);
|
|
48
|
+
const isCompact = (0, import_theme.useLayoutSizeClass)() === "compact";
|
|
49
|
+
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
50
|
+
(0, import_react2.useImperativeHandle)(focusRef, () => ({
|
|
51
|
+
focus: () => setOpen(true)
|
|
52
|
+
}), []);
|
|
53
|
+
const label = t("awesomebar.triggerLabel", "Search");
|
|
54
|
+
const showShortcutHint = import_components.isWeb && !isCompact;
|
|
55
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
56
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_components.Button, {
|
|
57
|
+
size: "$3",
|
|
58
|
+
flex: 1,
|
|
59
|
+
minWidth: 0,
|
|
60
|
+
justifyContent: "flex-start",
|
|
61
|
+
"aria-label": label,
|
|
62
|
+
"aria-haspopup": "dialog",
|
|
63
|
+
"aria-expanded": open,
|
|
64
|
+
onPress: () => setOpen(true),
|
|
65
|
+
"data-testid": "backoffice-awesomebar",
|
|
66
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.MagnifyingGlassIcon, {
|
|
67
|
+
size: 16
|
|
68
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.Text, {
|
|
69
|
+
flex: 1,
|
|
70
|
+
minWidth: 0,
|
|
71
|
+
numberOfLines: 1,
|
|
72
|
+
textAlign: "left",
|
|
73
|
+
color: "$color10",
|
|
74
|
+
children: label
|
|
75
|
+
}), showShortcutHint && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.XStack, {
|
|
76
|
+
borderWidth: 1,
|
|
77
|
+
borderColor: "$borderColor",
|
|
78
|
+
backgroundColor: "$color2",
|
|
79
|
+
borderRadius: "$2",
|
|
80
|
+
paddingHorizontal: "$1.5",
|
|
81
|
+
flexShrink: 0,
|
|
82
|
+
"aria-hidden": true,
|
|
83
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.SizableText, {
|
|
84
|
+
size: "$1",
|
|
85
|
+
fontWeight: "600",
|
|
86
|
+
color: "$color11",
|
|
87
|
+
children: `${getModLabel()} K`
|
|
88
|
+
})
|
|
89
|
+
})]
|
|
90
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_CommandPalette.CommandPalette, {
|
|
91
|
+
open,
|
|
92
|
+
onOpenChange: setOpen
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
95
|
+
}
|