@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
|
@@ -0,0 +1,144 @@
|
|
|
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 navigator_exports = {};
|
|
24
|
+
__export(navigator_exports, {
|
|
25
|
+
ControlledNavigator: () => ControlledNavigator,
|
|
26
|
+
MemoryNavigator: () => MemoryNavigator,
|
|
27
|
+
createMemoryNavigator: () => createMemoryNavigator,
|
|
28
|
+
createNoopNavigator: () => createNoopNavigator,
|
|
29
|
+
parseBackofficeHref: () => parseBackofficeHref
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(navigator_exports);
|
|
32
|
+
function parseQuery(query) {
|
|
33
|
+
const params = {};
|
|
34
|
+
if (!query) return params;
|
|
35
|
+
for (const pair of query.split("&")) {
|
|
36
|
+
if (!pair) continue;
|
|
37
|
+
const eq = pair.indexOf("=");
|
|
38
|
+
const rawKey = eq === -1 ? pair : pair.slice(0, eq);
|
|
39
|
+
const rawValue = eq === -1 ? "" : pair.slice(eq + 1);
|
|
40
|
+
let key = rawKey;
|
|
41
|
+
let value = rawValue;
|
|
42
|
+
try {
|
|
43
|
+
key = decodeURIComponent(rawKey);
|
|
44
|
+
value = decodeURIComponent(rawValue);
|
|
45
|
+
} catch {}
|
|
46
|
+
const prev = params[key];
|
|
47
|
+
if (prev === void 0) params[key] = value;else if (Array.isArray(prev)) prev.push(value);else params[key] = [prev, value];
|
|
48
|
+
}
|
|
49
|
+
return params;
|
|
50
|
+
}
|
|
51
|
+
function parseBackofficeHref(href) {
|
|
52
|
+
const queryIndex = href.indexOf("?");
|
|
53
|
+
const path = queryIndex === -1 ? href : href.slice(0, queryIndex);
|
|
54
|
+
const query = queryIndex === -1 ? void 0 : href.slice(queryIndex + 1);
|
|
55
|
+
return {
|
|
56
|
+
path: path || "/",
|
|
57
|
+
params: parseQuery(query)
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
class SubscribableNavigator {
|
|
61
|
+
listeners = /* @__PURE__ */new Set();
|
|
62
|
+
location;
|
|
63
|
+
constructor(initialLocation) {
|
|
64
|
+
this.location = initialLocation;
|
|
65
|
+
}
|
|
66
|
+
getLocation = () => this.location;
|
|
67
|
+
subscribe = listener => {
|
|
68
|
+
this.listeners.add(listener);
|
|
69
|
+
return () => this.listeners.delete(listener);
|
|
70
|
+
};
|
|
71
|
+
setLocationInternal(next) {
|
|
72
|
+
if (next.path === this.location.path && next.params === this.location.params) return;
|
|
73
|
+
this.location = next;
|
|
74
|
+
for (const listener of this.listeners) listener();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
class MemoryNavigator extends SubscribableNavigator {
|
|
78
|
+
stack;
|
|
79
|
+
constructor(initialPath = "/backoffice") {
|
|
80
|
+
const initial = parseBackofficeHref(initialPath);
|
|
81
|
+
super(initial);
|
|
82
|
+
this.stack = [initial];
|
|
83
|
+
}
|
|
84
|
+
/** History entries, oldest first (test introspection). */
|
|
85
|
+
get entries() {
|
|
86
|
+
return this.stack;
|
|
87
|
+
}
|
|
88
|
+
navigate = path => {
|
|
89
|
+
const next = parseBackofficeHref(path);
|
|
90
|
+
this.stack.push(next);
|
|
91
|
+
this.setLocationInternal(next);
|
|
92
|
+
};
|
|
93
|
+
replace = path => {
|
|
94
|
+
const next = parseBackofficeHref(path);
|
|
95
|
+
this.stack[this.stack.length - 1] = next;
|
|
96
|
+
this.setLocationInternal(next);
|
|
97
|
+
};
|
|
98
|
+
back = () => {
|
|
99
|
+
if (this.stack.length <= 1) return;
|
|
100
|
+
this.stack.pop();
|
|
101
|
+
const top = this.stack[this.stack.length - 1];
|
|
102
|
+
if (top) this.setLocationInternal(top);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function createMemoryNavigator(initialPath = "/backoffice") {
|
|
106
|
+
return new MemoryNavigator(initialPath);
|
|
107
|
+
}
|
|
108
|
+
class ControlledNavigator extends SubscribableNavigator {
|
|
109
|
+
handlers;
|
|
110
|
+
constructor(handlers, initialLocation) {
|
|
111
|
+
super(initialLocation ?? {
|
|
112
|
+
path: "/",
|
|
113
|
+
params: {}
|
|
114
|
+
});
|
|
115
|
+
this.handlers = handlers;
|
|
116
|
+
}
|
|
117
|
+
/** Swap the forwarding callbacks (adapters keep them fresh per render). */
|
|
118
|
+
setHandlers(handlers) {
|
|
119
|
+
this.handlers = handlers;
|
|
120
|
+
}
|
|
121
|
+
/** Mirror the host router's current location into the navigator. */
|
|
122
|
+
setLocation(next) {
|
|
123
|
+
this.setLocationInternal(next);
|
|
124
|
+
}
|
|
125
|
+
navigate = path => {
|
|
126
|
+
this.handlers.navigate(path);
|
|
127
|
+
};
|
|
128
|
+
replace = path => {
|
|
129
|
+
this.handlers.replace(path);
|
|
130
|
+
};
|
|
131
|
+
back = () => {
|
|
132
|
+
this.handlers.back();
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function createNoopNavigator(initialPath = "/backoffice") {
|
|
136
|
+
const location = parseBackofficeHref(initialPath);
|
|
137
|
+
return {
|
|
138
|
+
navigate: () => {},
|
|
139
|
+
replace: () => {},
|
|
140
|
+
back: () => {},
|
|
141
|
+
getLocation: () => location,
|
|
142
|
+
subscribe: () => () => {}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var navigator_exports = {};
|
|
26
|
+
__export(navigator_exports, {
|
|
27
|
+
ControlledNavigator: () => ControlledNavigator,
|
|
28
|
+
MemoryNavigator: () => MemoryNavigator,
|
|
29
|
+
createMemoryNavigator: () => createMemoryNavigator,
|
|
30
|
+
createNoopNavigator: () => createNoopNavigator,
|
|
31
|
+
parseBackofficeHref: () => parseBackofficeHref
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(navigator_exports);
|
|
34
|
+
function _assert_this_initialized(self) {
|
|
35
|
+
if (self === void 0) {
|
|
36
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
37
|
+
}
|
|
38
|
+
return self;
|
|
39
|
+
}
|
|
40
|
+
function _call_super(_this, derived, args) {
|
|
41
|
+
derived = _get_prototype_of(derived);
|
|
42
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
43
|
+
}
|
|
44
|
+
function _class_call_check(instance, Constructor) {
|
|
45
|
+
if (!(instance instanceof Constructor)) {
|
|
46
|
+
throw new TypeError("Cannot call a class as a function");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function _defineProperties(target, props) {
|
|
50
|
+
for (var i = 0; i < props.length; i++) {
|
|
51
|
+
var descriptor = props[i];
|
|
52
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
53
|
+
descriptor.configurable = true;
|
|
54
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
55
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
59
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
60
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
61
|
+
return Constructor;
|
|
62
|
+
}
|
|
63
|
+
function _define_property(obj, key, value) {
|
|
64
|
+
if (key in obj) {
|
|
65
|
+
Object.defineProperty(obj, key, {
|
|
66
|
+
value,
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
obj[key] = value;
|
|
73
|
+
}
|
|
74
|
+
return obj;
|
|
75
|
+
}
|
|
76
|
+
function _get_prototype_of(o) {
|
|
77
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {
|
|
78
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
79
|
+
};
|
|
80
|
+
return _get_prototype_of(o);
|
|
81
|
+
}
|
|
82
|
+
function _inherits(subClass, superClass) {
|
|
83
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
84
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
85
|
+
}
|
|
86
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
87
|
+
constructor: {
|
|
88
|
+
value: subClass,
|
|
89
|
+
writable: true,
|
|
90
|
+
configurable: true
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
94
|
+
}
|
|
95
|
+
function _possible_constructor_return(self, call) {
|
|
96
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
97
|
+
return call;
|
|
98
|
+
}
|
|
99
|
+
return _assert_this_initialized(self);
|
|
100
|
+
}
|
|
101
|
+
function _set_prototype_of(o, p) {
|
|
102
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {
|
|
103
|
+
o2.__proto__ = p2;
|
|
104
|
+
return o2;
|
|
105
|
+
};
|
|
106
|
+
return _set_prototype_of(o, p);
|
|
107
|
+
}
|
|
108
|
+
function _type_of(obj) {
|
|
109
|
+
"@swc/helpers - typeof";
|
|
110
|
+
|
|
111
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
112
|
+
}
|
|
113
|
+
function _is_native_reflect_construct() {
|
|
114
|
+
try {
|
|
115
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
116
|
+
} catch (_) {}
|
|
117
|
+
return (_is_native_reflect_construct = function () {
|
|
118
|
+
return !!result;
|
|
119
|
+
})();
|
|
120
|
+
}
|
|
121
|
+
function parseQuery(query) {
|
|
122
|
+
var params = {};
|
|
123
|
+
if (!query) return params;
|
|
124
|
+
var _iteratorNormalCompletion = true,
|
|
125
|
+
_didIteratorError = false,
|
|
126
|
+
_iteratorError = void 0;
|
|
127
|
+
try {
|
|
128
|
+
for (var _iterator = query.split("&")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
129
|
+
var pair = _step.value;
|
|
130
|
+
if (!pair) continue;
|
|
131
|
+
var eq = pair.indexOf("=");
|
|
132
|
+
var rawKey = eq === -1 ? pair : pair.slice(0, eq);
|
|
133
|
+
var rawValue = eq === -1 ? "" : pair.slice(eq + 1);
|
|
134
|
+
var key = rawKey;
|
|
135
|
+
var value = rawValue;
|
|
136
|
+
try {
|
|
137
|
+
key = decodeURIComponent(rawKey);
|
|
138
|
+
value = decodeURIComponent(rawValue);
|
|
139
|
+
} catch (unused) {}
|
|
140
|
+
var prev = params[key];
|
|
141
|
+
if (prev === void 0) params[key] = value;else if (Array.isArray(prev)) prev.push(value);else params[key] = [prev, value];
|
|
142
|
+
}
|
|
143
|
+
} catch (err) {
|
|
144
|
+
_didIteratorError = true;
|
|
145
|
+
_iteratorError = err;
|
|
146
|
+
} finally {
|
|
147
|
+
try {
|
|
148
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
149
|
+
_iterator.return();
|
|
150
|
+
}
|
|
151
|
+
} finally {
|
|
152
|
+
if (_didIteratorError) {
|
|
153
|
+
throw _iteratorError;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return params;
|
|
158
|
+
}
|
|
159
|
+
function parseBackofficeHref(href) {
|
|
160
|
+
var queryIndex = href.indexOf("?");
|
|
161
|
+
var path = queryIndex === -1 ? href : href.slice(0, queryIndex);
|
|
162
|
+
var query = queryIndex === -1 ? void 0 : href.slice(queryIndex + 1);
|
|
163
|
+
return {
|
|
164
|
+
path: path || "/",
|
|
165
|
+
params: parseQuery(query)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
var SubscribableNavigator = /* @__PURE__ */function () {
|
|
169
|
+
"use strict";
|
|
170
|
+
|
|
171
|
+
function SubscribableNavigator2(initialLocation) {
|
|
172
|
+
var _this = this;
|
|
173
|
+
_class_call_check(this, SubscribableNavigator2);
|
|
174
|
+
_define_property(this, "listeners", /* @__PURE__ */new Set());
|
|
175
|
+
_define_property(this, "location", void 0);
|
|
176
|
+
_define_property(this, "getLocation", function () {
|
|
177
|
+
return _this.location;
|
|
178
|
+
});
|
|
179
|
+
_define_property(this, "subscribe", function (listener) {
|
|
180
|
+
_this.listeners.add(listener);
|
|
181
|
+
return function () {
|
|
182
|
+
return _this.listeners.delete(listener);
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
this.location = initialLocation;
|
|
186
|
+
}
|
|
187
|
+
_create_class(SubscribableNavigator2, [{
|
|
188
|
+
key: "setLocationInternal",
|
|
189
|
+
value: function setLocationInternal(next) {
|
|
190
|
+
if (next.path === this.location.path && next.params === this.location.params) return;
|
|
191
|
+
this.location = next;
|
|
192
|
+
var _iteratorNormalCompletion = true,
|
|
193
|
+
_didIteratorError = false,
|
|
194
|
+
_iteratorError = void 0;
|
|
195
|
+
try {
|
|
196
|
+
for (var _iterator = this.listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
197
|
+
var listener = _step.value;
|
|
198
|
+
listener();
|
|
199
|
+
}
|
|
200
|
+
} catch (err) {
|
|
201
|
+
_didIteratorError = true;
|
|
202
|
+
_iteratorError = err;
|
|
203
|
+
} finally {
|
|
204
|
+
try {
|
|
205
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
206
|
+
_iterator.return();
|
|
207
|
+
}
|
|
208
|
+
} finally {
|
|
209
|
+
if (_didIteratorError) {
|
|
210
|
+
throw _iteratorError;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}]);
|
|
216
|
+
return SubscribableNavigator2;
|
|
217
|
+
}();
|
|
218
|
+
var MemoryNavigator = /* @__PURE__ */function (SubscribableNavigator2) {
|
|
219
|
+
"use strict";
|
|
220
|
+
|
|
221
|
+
_inherits(MemoryNavigator2, SubscribableNavigator2);
|
|
222
|
+
function MemoryNavigator2() {
|
|
223
|
+
var initialPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "/backoffice";
|
|
224
|
+
_class_call_check(this, MemoryNavigator2);
|
|
225
|
+
var _this;
|
|
226
|
+
var initial = parseBackofficeHref(initialPath);
|
|
227
|
+
_this = _call_super(this, MemoryNavigator2, [initial]), _define_property(_this, "stack", void 0), _define_property(_this, "navigate", function (path) {
|
|
228
|
+
var next = parseBackofficeHref(path);
|
|
229
|
+
_this.stack.push(next);
|
|
230
|
+
_this.setLocationInternal(next);
|
|
231
|
+
}), _define_property(_this, "replace", function (path) {
|
|
232
|
+
var next = parseBackofficeHref(path);
|
|
233
|
+
_this.stack[_this.stack.length - 1] = next;
|
|
234
|
+
_this.setLocationInternal(next);
|
|
235
|
+
}), _define_property(_this, "back", function () {
|
|
236
|
+
if (_this.stack.length <= 1) return;
|
|
237
|
+
_this.stack.pop();
|
|
238
|
+
var top = _this.stack[_this.stack.length - 1];
|
|
239
|
+
if (top) _this.setLocationInternal(top);
|
|
240
|
+
});
|
|
241
|
+
_this.stack = [initial];
|
|
242
|
+
return _this;
|
|
243
|
+
}
|
|
244
|
+
_create_class(MemoryNavigator2, [{
|
|
245
|
+
key: "entries",
|
|
246
|
+
get: (/** History entries, oldest first (test introspection). */
|
|
247
|
+
function get() {
|
|
248
|
+
return this.stack;
|
|
249
|
+
})
|
|
250
|
+
}]);
|
|
251
|
+
return MemoryNavigator2;
|
|
252
|
+
}(SubscribableNavigator);
|
|
253
|
+
function createMemoryNavigator() {
|
|
254
|
+
var initialPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "/backoffice";
|
|
255
|
+
return new MemoryNavigator(initialPath);
|
|
256
|
+
}
|
|
257
|
+
var ControlledNavigator = /* @__PURE__ */function (SubscribableNavigator2) {
|
|
258
|
+
"use strict";
|
|
259
|
+
|
|
260
|
+
_inherits(ControlledNavigator2, SubscribableNavigator2);
|
|
261
|
+
function ControlledNavigator2(handlers, initialLocation) {
|
|
262
|
+
_class_call_check(this, ControlledNavigator2);
|
|
263
|
+
var _this;
|
|
264
|
+
_this = _call_super(this, ControlledNavigator2, [initialLocation !== null && initialLocation !== void 0 ? initialLocation : {
|
|
265
|
+
path: "/",
|
|
266
|
+
params: {}
|
|
267
|
+
}]), _define_property(_this, "handlers", void 0), _define_property(_this, "navigate", function (path) {
|
|
268
|
+
_this.handlers.navigate(path);
|
|
269
|
+
}), _define_property(_this, "replace", function (path) {
|
|
270
|
+
_this.handlers.replace(path);
|
|
271
|
+
}), _define_property(_this, "back", function () {
|
|
272
|
+
_this.handlers.back();
|
|
273
|
+
});
|
|
274
|
+
_this.handlers = handlers;
|
|
275
|
+
return _this;
|
|
276
|
+
}
|
|
277
|
+
_create_class(ControlledNavigator2, [{
|
|
278
|
+
/** Swap the forwarding callbacks (adapters keep them fresh per render). */
|
|
279
|
+
key: "setHandlers",
|
|
280
|
+
value: function setHandlers(handlers) {
|
|
281
|
+
this.handlers = handlers;
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
/** Mirror the host router's current location into the navigator. */
|
|
285
|
+
key: "setLocation",
|
|
286
|
+
value: function setLocation(next) {
|
|
287
|
+
this.setLocationInternal(next);
|
|
288
|
+
}
|
|
289
|
+
}]);
|
|
290
|
+
return ControlledNavigator2;
|
|
291
|
+
}(SubscribableNavigator);
|
|
292
|
+
function createNoopNavigator() {
|
|
293
|
+
var initialPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "/backoffice";
|
|
294
|
+
var location = parseBackofficeHref(initialPath);
|
|
295
|
+
return {
|
|
296
|
+
navigate: function navigate() {},
|
|
297
|
+
replace: function replace() {},
|
|
298
|
+
back: function back() {},
|
|
299
|
+
getLocation: function getLocation() {
|
|
300
|
+
return location;
|
|
301
|
+
},
|
|
302
|
+
subscribe: function subscribe() {
|
|
303
|
+
return function () {};
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
//# sourceMappingURL=navigator.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","navigator_exports","__export","ControlledNavigator","MemoryNavigator","createMemoryNavigator","createNoopNavigator","parseBackofficeHref","module","exports","_assert_this_initialized","self","ReferenceError","_call_super","_this","derived","args","_get_prototype_of","_possible_constructor_return","_is_native_reflect_construct","Reflect","construct","constructor","apply","_class_call_check","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_create_class","protoProps","staticProps","prototype","_define_property","obj","o","setPrototypeOf","getPrototypeOf","o2","__proto__","_inherits","subClass","superClass","create","_set_prototype_of","call","_type_of","p","p2","Symbol","result","Boolean","valueOf","_","parseQuery","query","params","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","split","iterator","_step","next","done","pair","eq","indexOf","rawKey","slice","rawValue","decodeURIComponent","unused","prev","Array","isArray","push"],"sources":["../../../src/navigation/navigator.ts"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
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 paths_exports = {};
|
|
24
|
+
__export(paths_exports, {
|
|
25
|
+
BACKOFFICE_BASE: () => BACKOFFICE_BASE,
|
|
26
|
+
BACKOFFICE_VIEWS: () => BACKOFFICE_VIEWS,
|
|
27
|
+
createBackofficePaths: () => createBackofficePaths,
|
|
28
|
+
formPath: () => formPath,
|
|
29
|
+
homePath: () => homePath,
|
|
30
|
+
isBackofficeView: () => isBackofficeView,
|
|
31
|
+
listPath: () => listPath,
|
|
32
|
+
newDocPath: () => newDocPath,
|
|
33
|
+
parseDocDefaults: () => parseDocDefaults,
|
|
34
|
+
slugToDisplayName: () => slugToDisplayName,
|
|
35
|
+
toSlug: () => toSlug,
|
|
36
|
+
viewPath: () => viewPath,
|
|
37
|
+
workspacePath: () => workspacePath
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(paths_exports);
|
|
40
|
+
const BACKOFFICE_BASE = "/backoffice";
|
|
41
|
+
const BACKOFFICE_VIEWS = ["list", "report", "kanban", "calendar", "tree", "image", "dashboard"];
|
|
42
|
+
function isBackofficeView(value) {
|
|
43
|
+
return BACKOFFICE_VIEWS.includes(value);
|
|
44
|
+
}
|
|
45
|
+
function toSlug(name) {
|
|
46
|
+
return name.toLowerCase().replace(/ /g, "-");
|
|
47
|
+
}
|
|
48
|
+
function slugToDisplayName(slug) {
|
|
49
|
+
return slug.replace(/-/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
50
|
+
}
|
|
51
|
+
function parseDocDefaults(raw) {
|
|
52
|
+
if (!raw) return void 0;
|
|
53
|
+
const candidates = [raw];
|
|
54
|
+
try {
|
|
55
|
+
const decoded = decodeURIComponent(raw);
|
|
56
|
+
if (decoded !== raw) candidates.push(decoded);
|
|
57
|
+
} catch {}
|
|
58
|
+
for (const candidate of candidates) {
|
|
59
|
+
try {
|
|
60
|
+
const parsed = JSON.parse(candidate);
|
|
61
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
62
|
+
return parsed;
|
|
63
|
+
}
|
|
64
|
+
} catch {}
|
|
65
|
+
}
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
function createBackofficePaths(basePath = BACKOFFICE_BASE) {
|
|
69
|
+
const base = basePath.replace(/\/+$/, "") || "/";
|
|
70
|
+
const prefix = base === "/" ? "" : base;
|
|
71
|
+
return {
|
|
72
|
+
base,
|
|
73
|
+
home: () => base,
|
|
74
|
+
workspace: workspaceName => `${prefix}/${toSlug(workspaceName)}`,
|
|
75
|
+
list: doctype => `${prefix}/${toSlug(doctype)}`,
|
|
76
|
+
view: (doctype, view) => view === "list" ? `${prefix}/${toSlug(doctype)}` : `${prefix}/${toSlug(doctype)}/view/${view}`,
|
|
77
|
+
newDoc: (doctype, defaults) => {
|
|
78
|
+
const path = `${prefix}/${toSlug(doctype)}/new`;
|
|
79
|
+
if (!defaults || Object.keys(defaults).length === 0) return path;
|
|
80
|
+
return `${path}?d=${encodeURIComponent(JSON.stringify(defaults))}`;
|
|
81
|
+
},
|
|
82
|
+
form: (doctype, name) => `${prefix}/${toSlug(doctype)}/${encodeURIComponent(name)}`
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const defaultPaths = createBackofficePaths(BACKOFFICE_BASE);
|
|
86
|
+
function homePath() {
|
|
87
|
+
return defaultPaths.home();
|
|
88
|
+
}
|
|
89
|
+
function workspacePath(workspaceName) {
|
|
90
|
+
return defaultPaths.workspace(workspaceName);
|
|
91
|
+
}
|
|
92
|
+
function listPath(doctype) {
|
|
93
|
+
return defaultPaths.list(doctype);
|
|
94
|
+
}
|
|
95
|
+
function viewPath(doctype, view) {
|
|
96
|
+
return defaultPaths.view(doctype, view);
|
|
97
|
+
}
|
|
98
|
+
function newDocPath(doctype, defaults) {
|
|
99
|
+
return defaultPaths.newDoc(doctype, defaults);
|
|
100
|
+
}
|
|
101
|
+
function formPath(doctype, name) {
|
|
102
|
+
return defaultPaths.form(doctype, name);
|
|
103
|
+
}
|