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