@dxos/plugin-simple-layout 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6

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 (246) hide show
  1. package/dist/lib/browser/index.mjs +44 -64
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +44 -63
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/SimpleLayoutPlugin.d.ts +1 -1
  8. package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
  9. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  10. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  11. package/dist/types/src/capabilities/index.d.ts +21 -6
  12. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  13. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  14. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  15. package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +1 -1
  16. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  17. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  18. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  19. package/dist/types/src/capabilities/{spotlight-dismiss/spotlight-dismiss.d.ts → spotlight-dismiss.d.ts} +1 -1
  20. package/dist/types/src/capabilities/spotlight-dismiss.d.ts.map +1 -0
  21. package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +2 -2
  22. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  23. package/dist/types/src/capabilities/url-handler.d.ts +12 -0
  24. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
  25. package/dist/types/src/components/ContentError.stories.d.ts +26 -21
  26. package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
  27. package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts +19 -0
  28. package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts.map +1 -0
  29. package/dist/types/src/components/DebugOverlay/index.d.ts +2 -0
  30. package/dist/types/src/components/DebugOverlay/index.d.ts.map +1 -0
  31. package/dist/types/src/components/Home/Home.d.ts.map +1 -1
  32. package/dist/types/src/components/Loading/Loading.d.ts +3 -0
  33. package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
  34. package/dist/types/src/components/{ContentLoading.stories.d.ts → Loading/Loading.stories.d.ts} +1 -1
  35. package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
  36. package/dist/types/src/components/Loading/index.d.ts +2 -0
  37. package/dist/types/src/components/Loading/index.d.ts.map +1 -0
  38. package/dist/types/src/components/MobileLayout/MobileLayout.d.ts +35 -0
  39. package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -0
  40. package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts +7 -0
  41. package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -0
  42. package/dist/types/src/components/MobileLayout/index.d.ts +2 -0
  43. package/dist/types/src/components/MobileLayout/index.d.ts.map +1 -0
  44. package/dist/types/src/components/NavBranch/NavBranch.d.ts +11 -0
  45. package/dist/types/src/components/NavBranch/NavBranch.d.ts.map +1 -0
  46. package/dist/types/src/components/NavBranch/index.d.ts +2 -0
  47. package/dist/types/src/components/NavBranch/index.d.ts.map +1 -0
  48. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  49. package/dist/types/src/components/SimpleLayout/AppBar.d.ts +28 -0
  50. package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -0
  51. package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +54 -0
  52. package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -0
  53. package/dist/types/src/components/SimpleLayout/Drawer.d.ts +1 -1
  54. package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -1
  55. package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
  56. package/dist/types/src/components/SimpleLayout/NavBar.d.ts +17 -8
  57. package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
  58. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +35 -25
  59. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
  60. package/dist/types/src/components/SimpleLayout/SimpleLayout.d.ts.map +1 -1
  61. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts +26 -25
  62. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
  63. package/dist/types/src/components/SimpleLayout/index.d.ts +3 -0
  64. package/dist/types/src/components/SimpleLayout/index.d.ts.map +1 -1
  65. package/dist/types/src/components/hooks.d.ts +4 -2
  66. package/dist/types/src/components/hooks.d.ts.map +1 -1
  67. package/dist/types/src/components/index.d.ts +4 -2
  68. package/dist/types/src/components/index.d.ts.map +1 -1
  69. package/dist/types/src/hooks/actions.d.ts +19 -0
  70. package/dist/types/src/hooks/actions.d.ts.map +1 -0
  71. package/dist/types/src/hooks/index.d.ts +4 -0
  72. package/dist/types/src/hooks/index.d.ts.map +1 -1
  73. package/dist/types/src/hooks/useAppBarProps.d.ts +7 -0
  74. package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -0
  75. package/dist/types/src/hooks/useCompanions.d.ts +5 -1
  76. package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
  77. package/dist/types/src/hooks/useDrawerActions.d.ts +13 -0
  78. package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -0
  79. package/dist/types/src/hooks/useNavbarActions.d.ts +14 -0
  80. package/dist/types/src/hooks/useNavbarActions.d.ts.map +1 -0
  81. package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
  82. package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
  83. package/dist/types/src/operations/close.d.ts +5 -0
  84. package/dist/types/src/operations/close.d.ts.map +1 -0
  85. package/dist/types/src/operations/index.d.ts +3 -0
  86. package/dist/types/src/operations/index.d.ts.map +1 -0
  87. package/dist/types/src/operations/open.d.ts +5 -0
  88. package/dist/types/src/operations/open.d.ts.map +1 -0
  89. package/dist/types/src/operations/revert-workspace.d.ts +5 -0
  90. package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
  91. package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
  92. package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
  93. package/dist/types/src/operations/set.d.ts +5 -0
  94. package/dist/types/src/operations/set.d.ts.map +1 -0
  95. package/dist/types/src/operations/state-access.d.ts +8 -0
  96. package/dist/types/src/operations/state-access.d.ts.map +1 -0
  97. package/dist/types/src/operations/switch-workspace.d.ts +5 -0
  98. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
  99. package/dist/types/src/operations/update-complementary.d.ts +5 -0
  100. package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
  101. package/dist/types/src/operations/update-dialog.d.ts +5 -0
  102. package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
  103. package/dist/types/src/operations/update-popover.d.ts +5 -0
  104. package/dist/types/src/operations/update-popover.d.ts.map +1 -0
  105. package/dist/types/src/operations/update-sidebar.d.ts +5 -0
  106. package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
  107. package/dist/types/src/translations.d.ts +26 -19
  108. package/dist/types/src/translations.d.ts.map +1 -1
  109. package/dist/types/src/types/capabilities.d.ts +7 -6
  110. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  111. package/dist/types/src/types/events.d.ts.map +1 -1
  112. package/dist/types/tsconfig.tsbuildinfo +1 -1
  113. package/package.json +46 -30
  114. package/src/SimpleLayoutPlugin.ts +24 -13
  115. package/src/capabilities/app-graph-builder.ts +21 -0
  116. package/src/capabilities/index.ts +13 -6
  117. package/src/capabilities/operation-handler.ts +14 -0
  118. package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +4 -4
  119. package/src/capabilities/react-surface.tsx +51 -0
  120. package/src/capabilities/{spotlight-dismiss/spotlight-dismiss.ts → spotlight-dismiss.ts} +2 -2
  121. package/src/capabilities/{state/state.tsx → state.tsx} +6 -5
  122. package/src/capabilities/url-handler.ts +161 -0
  123. package/src/components/ContentError.stories.tsx +8 -7
  124. package/src/components/DebugOverlay/DebugOverlay.tsx +96 -0
  125. package/src/components/DebugOverlay/index.ts +5 -0
  126. package/src/components/Dialog/Dialog.tsx +6 -6
  127. package/src/components/Home/Home.tsx +50 -43
  128. package/src/components/{ContentLoading.stories.tsx → Loading/Loading.stories.tsx} +5 -5
  129. package/src/components/{ContentLoading.tsx → Loading/Loading.tsx} +2 -2
  130. package/src/components/Loading/index.ts +5 -0
  131. package/src/components/MobileLayout/MobileLayout.stories.tsx +133 -0
  132. package/src/components/MobileLayout/MobileLayout.tsx +374 -0
  133. package/src/components/MobileLayout/index.ts +5 -0
  134. package/src/components/NavBranch/NavBranch.tsx +127 -0
  135. package/src/components/{Workspace → NavBranch}/index.ts +1 -1
  136. package/src/components/Popover/Popover.tsx +9 -9
  137. package/src/components/SimpleLayout/AppBar.stories.tsx +144 -0
  138. package/src/components/SimpleLayout/AppBar.tsx +93 -0
  139. package/src/components/SimpleLayout/Drawer.tsx +27 -82
  140. package/src/components/SimpleLayout/Main.tsx +40 -34
  141. package/src/components/SimpleLayout/NavBar.stories.tsx +131 -23
  142. package/src/components/SimpleLayout/NavBar.tsx +18 -51
  143. package/src/components/SimpleLayout/SimpleLayout.stories.tsx +45 -57
  144. package/src/components/SimpleLayout/SimpleLayout.tsx +40 -22
  145. package/src/components/SimpleLayout/index.ts +3 -0
  146. package/src/components/hooks.ts +9 -9
  147. package/src/components/index.ts +4 -2
  148. package/src/hooks/actions.ts +84 -0
  149. package/src/hooks/index.ts +4 -0
  150. package/src/hooks/useAppBarProps.ts +115 -0
  151. package/src/hooks/useCompanions.ts +8 -5
  152. package/src/hooks/useDrawerActions.ts +100 -0
  153. package/src/hooks/useNavbarActions.ts +87 -0
  154. package/src/hooks/useSimpleLayoutState.ts +5 -5
  155. package/src/meta.ts +1 -1
  156. package/src/operations/close.ts +34 -0
  157. package/src/operations/index.ts +16 -0
  158. package/src/operations/open.ts +63 -0
  159. package/src/operations/revert-workspace.ts +22 -0
  160. package/src/operations/set-layout-mode.ts +12 -0
  161. package/src/operations/set.ts +23 -0
  162. package/src/operations/state-access.ts +19 -0
  163. package/src/operations/switch-workspace.ts +26 -0
  164. package/src/operations/update-complementary.ts +35 -0
  165. package/src/operations/update-dialog.ts +28 -0
  166. package/src/operations/update-popover.ts +35 -0
  167. package/src/operations/update-sidebar.ts +12 -0
  168. package/src/translations.ts +21 -19
  169. package/src/types/capabilities.ts +12 -8
  170. package/src/types/events.ts +3 -2
  171. package/dist/lib/browser/chunk-LR3EE3VB.mjs +0 -789
  172. package/dist/lib/browser/chunk-LR3EE3VB.mjs.map +0 -7
  173. package/dist/lib/browser/chunk-P77G4YTR.mjs +0 -29
  174. package/dist/lib/browser/chunk-P77G4YTR.mjs.map +0 -7
  175. package/dist/lib/browser/operation-resolver-775UYAC2.mjs +0 -203
  176. package/dist/lib/browser/operation-resolver-775UYAC2.mjs.map +0 -7
  177. package/dist/lib/browser/react-root-KM55OMGJ.mjs +0 -21
  178. package/dist/lib/browser/react-root-KM55OMGJ.mjs.map +0 -7
  179. package/dist/lib/browser/react-surface-BABGAWGY.mjs +0 -39
  180. package/dist/lib/browser/react-surface-BABGAWGY.mjs.map +0 -7
  181. package/dist/lib/browser/spotlight-dismiss-VSNOPETH.mjs +0 -66
  182. package/dist/lib/browser/spotlight-dismiss-VSNOPETH.mjs.map +0 -7
  183. package/dist/lib/browser/state-OUFTC2KV.mjs +0 -47
  184. package/dist/lib/browser/state-OUFTC2KV.mjs.map +0 -7
  185. package/dist/lib/browser/url-handler-DOUFQIAC.mjs +0 -54
  186. package/dist/lib/browser/url-handler-DOUFQIAC.mjs.map +0 -7
  187. package/dist/lib/node-esm/chunk-F5TEKVJG.mjs +0 -31
  188. package/dist/lib/node-esm/chunk-F5TEKVJG.mjs.map +0 -7
  189. package/dist/lib/node-esm/chunk-HB2B3LLG.mjs +0 -790
  190. package/dist/lib/node-esm/chunk-HB2B3LLG.mjs.map +0 -7
  191. package/dist/lib/node-esm/operation-resolver-LDNYS3DI.mjs +0 -204
  192. package/dist/lib/node-esm/operation-resolver-LDNYS3DI.mjs.map +0 -7
  193. package/dist/lib/node-esm/react-root-36UYFEEB.mjs +0 -22
  194. package/dist/lib/node-esm/react-root-36UYFEEB.mjs.map +0 -7
  195. package/dist/lib/node-esm/react-surface-CGHFVWU3.mjs +0 -40
  196. package/dist/lib/node-esm/react-surface-CGHFVWU3.mjs.map +0 -7
  197. package/dist/lib/node-esm/spotlight-dismiss-L5PCWIJG.mjs +0 -68
  198. package/dist/lib/node-esm/spotlight-dismiss-L5PCWIJG.mjs.map +0 -7
  199. package/dist/lib/node-esm/state-Q2ZA26W5.mjs +0 -48
  200. package/dist/lib/node-esm/state-Q2ZA26W5.mjs.map +0 -7
  201. package/dist/lib/node-esm/url-handler-DVAZZEUO.mjs +0 -55
  202. package/dist/lib/node-esm/url-handler-DVAZZEUO.mjs.map +0 -7
  203. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  204. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  205. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  206. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  207. package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
  208. package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
  209. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
  210. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  211. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  212. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  213. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  214. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +0 -3
  215. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +0 -1
  216. package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +0 -1
  217. package/dist/types/src/capabilities/state/index.d.ts +0 -13
  218. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  219. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  220. package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
  221. package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
  222. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +0 -10
  223. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +0 -1
  224. package/dist/types/src/components/ContentError.d.ts +0 -5
  225. package/dist/types/src/components/ContentError.d.ts.map +0 -1
  226. package/dist/types/src/components/ContentLoading.d.ts +0 -3
  227. package/dist/types/src/components/ContentLoading.d.ts.map +0 -1
  228. package/dist/types/src/components/ContentLoading.stories.d.ts.map +0 -1
  229. package/dist/types/src/components/SimpleLayout/Banner.d.ts +0 -8
  230. package/dist/types/src/components/SimpleLayout/Banner.d.ts.map +0 -1
  231. package/dist/types/src/components/Workspace/Workspace.d.ts +0 -9
  232. package/dist/types/src/components/Workspace/Workspace.d.ts.map +0 -1
  233. package/dist/types/src/components/Workspace/index.d.ts +0 -2
  234. package/dist/types/src/components/Workspace/index.d.ts.map +0 -1
  235. package/src/capabilities/operation-resolver/index.ts +0 -10
  236. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -215
  237. package/src/capabilities/react-root/index.ts +0 -7
  238. package/src/capabilities/react-surface/index.ts +0 -7
  239. package/src/capabilities/react-surface/react-surface.tsx +0 -40
  240. package/src/capabilities/spotlight-dismiss/index.ts +0 -7
  241. package/src/capabilities/state/index.ts +0 -9
  242. package/src/capabilities/url-handler/index.ts +0 -7
  243. package/src/capabilities/url-handler/url-handler.ts +0 -80
  244. package/src/components/ContentError.tsx +0 -23
  245. package/src/components/SimpleLayout/Banner.tsx +0 -113
  246. package/src/components/Workspace/Workspace.tsx +0 -115
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/state/state.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { type SimpleLayoutState } from '../../types';\nimport { SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';\n\nconst defaultState: SimpleLayoutState = {\n dialogOpen: false,\n workspace: Node.RootId,\n previousWorkspace: Node.RootId,\n history: [],\n isPopover: false,\n companionVariant: undefined,\n drawerState: 'closed',\n};\n\nexport type SimpleLayoutStateOptions = {\n initialState?: Partial<SimpleLayoutState>;\n};\n\nexport default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions = {}) =>\n Effect.sync(() => {\n const stateAtom = Atom.make<SimpleLayoutState>({ ...defaultState, ...initialState });\n\n const layoutAtom = Atom.make((get): Common.Capability.Layout => {\n const state = get(stateAtom);\n return {\n mode: 'simple',\n dialogOpen: state.dialogOpen,\n sidebarOpen: false,\n complementarySidebarOpen: false,\n workspace: state.workspace,\n active: state.active ? [state.active] : [],\n inactive: [],\n scrollIntoView: undefined,\n };\n });\n\n return [\n Capability.contributes(SimpleLayoutStateCapability, stateAtom),\n Capability.contributes(Common.Capability.Layout, layoutAtom),\n ];\n }),\n);\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,YAAY;AAKrB,IAAMC,eAAkC;EACtCC,YAAY;EACZC,WAAWC,KAAKC;EAChBC,mBAAmBF,KAAKC;EACxBE,SAAS,CAAA;EACTC,WAAW;EACXC,kBAAkBC;EAClBC,aAAa;AACf;AAMA,IAAA,gBAAeC,WAAWC,WAAW,CAAC,EAAEC,aAAY,IAA+B,CAAC,MAC3EC,YAAK,MAAA;AACV,QAAMC,YAAYC,KAAKC,KAAwB;IAAE,GAAGjB;IAAc,GAAGa;EAAa,CAAA;AAElF,QAAMK,aAAaF,KAAKC,KAAK,CAACE,QAAAA;AAC5B,UAAMC,QAAQD,IAAIJ,SAAAA;AAClB,WAAO;MACLM,MAAM;MACNpB,YAAYmB,MAAMnB;MAClBqB,aAAa;MACbC,0BAA0B;MAC1BrB,WAAWkB,MAAMlB;MACjBsB,QAAQJ,MAAMI,SAAS;QAACJ,MAAMI;UAAU,CAAA;MACxCC,UAAU,CAAA;MACVC,gBAAgBjB;IAClB;EACF,CAAA;AAEA,SAAO;IACLE,WAAWgB,YAAYC,mBAA6Bb,SAAAA;IACpDJ,WAAWgB,YAAYE,OAAOlB,WAAWmB,QAAQZ,UAAAA;;AAErD,CAAA,CAAA;",
6
- "names": ["Atom", "Effect", "Capability", "Common", "Node", "defaultState", "dialogOpen", "workspace", "Node", "RootId", "previousWorkspace", "history", "isPopover", "companionVariant", "undefined", "drawerState", "Capability", "makeModule", "initialState", "sync", "stateAtom", "Atom", "make", "layoutAtom", "get", "state", "mode", "sidebarOpen", "complementarySidebarOpen", "active", "inactive", "scrollIntoView", "contributes", "SimpleLayoutStateCapability", "Common", "Layout"]
7
- }
@@ -1,55 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- SimpleLayoutState
4
- } from "./chunk-F5TEKVJG.mjs";
5
-
6
- // src/capabilities/url-handler/url-handler.ts
7
- import * as Effect from "effect/Effect";
8
- import { Capability, Common } from "@dxos/app-framework";
9
- import { Node } from "@dxos/plugin-graph";
10
- var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
11
- const { invokeSync } = yield* Capability.get(Common.Capability.OperationInvoker);
12
- const handleNavigation = () => {
13
- const pathname = window.location.pathname;
14
- const [_, nextWorkspace, nextActive] = pathname.split("/");
15
- const targetWorkspace = !nextWorkspace || nextWorkspace === "root" ? Node.RootId : nextWorkspace;
16
- invokeSync(Common.LayoutOperation.SwitchWorkspace, {
17
- subject: targetWorkspace
18
- });
19
- if (nextActive) {
20
- invokeSync(Common.LayoutOperation.Open, {
21
- subject: [
22
- nextActive
23
- ]
24
- });
25
- }
26
- };
27
- yield* Effect.sync(() => handleNavigation());
28
- window.addEventListener("popstate", handleNavigation);
29
- let lastWorkspace;
30
- let lastActive;
31
- const unsubscribe = yield* Common.Capability.subscribeAtom(SimpleLayoutState, (state) => {
32
- const { workspace, active } = state;
33
- if (workspace !== lastWorkspace || active !== lastActive) {
34
- lastWorkspace = workspace;
35
- lastActive = active;
36
- let path;
37
- if (workspace === Node.RootId) {
38
- path = active ? `/${Node.RootId}/${active}` : "/";
39
- } else {
40
- path = active ? `/${workspace}/${active}` : `/${workspace}`;
41
- }
42
- if (window.location.pathname !== path) {
43
- history.pushState(null, "", `${path}${window.location.search}`);
44
- }
45
- }
46
- });
47
- return Capability.contributes(Common.Capability.Null, null, () => Effect.sync(() => {
48
- window.removeEventListener("popstate", handleNavigation);
49
- unsubscribe();
50
- }));
51
- }));
52
- export {
53
- url_handler_default as default
54
- };
55
- //# sourceMappingURL=url-handler-DVAZZEUO.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/url-handler/url-handler.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';\n\n/**\n * URL handler for simple layout that syncs browser URL with layout state.\n * URL format: /{workspace} or /{workspace}/{active}\n * Root is represented as / or /root.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { invokeSync } = yield* Capability.get(Common.Capability.OperationInvoker);\n\n /**\n * Handle navigation events (initial load and popstate).\n * Parses URL and updates state accordingly.\n */\n const handleNavigation = () => {\n const pathname = window.location.pathname;\n\n // Parse URL segments: /{workspace}/{active}\n const [_, nextWorkspace, nextActive] = pathname.split('/');\n\n // Determine target workspace (empty or 'root' means Node.RootId).\n const targetWorkspace = !nextWorkspace || nextWorkspace === 'root' ? Node.RootId : nextWorkspace;\n\n // Navigate via operations (they will update state accordingly).\n invokeSync(Common.LayoutOperation.SwitchWorkspace, { subject: targetWorkspace });\n if (nextActive) {\n invokeSync(Common.LayoutOperation.Open, { subject: [nextActive] });\n }\n };\n\n // Handle initial URL and listen for browser navigation.\n yield* Effect.sync(() => handleNavigation());\n window.addEventListener('popstate', handleNavigation);\n\n // Subscribe to state changes to update the URL.\n let lastWorkspace: string | undefined;\n let lastActive: string | undefined;\n const unsubscribe = yield* Common.Capability.subscribeAtom(\n SimpleLayoutStateCapability,\n (state: SimpleLayoutState) => {\n const { workspace, active } = state;\n\n // Only update URL if relevant state changed.\n if (workspace !== lastWorkspace || active !== lastActive) {\n lastWorkspace = workspace;\n lastActive = active;\n\n // Build path: root is represented as /, other workspaces as /{workspace}.\n let path: string;\n if (workspace === Node.RootId) {\n path = active ? `/${Node.RootId}/${active}` : '/';\n } else {\n path = active ? `/${workspace}/${active}` : `/${workspace}`;\n }\n\n if (window.location.pathname !== path) {\n history.pushState(null, '', `${path}${window.location.search}`);\n }\n }\n },\n );\n\n return Capability.contributes(Common.Capability.Null, null, () =>\n Effect.sync(() => {\n window.removeEventListener('popstate', handleNavigation);\n unsubscribe();\n }),\n );\n }),\n);\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,YAAY;AASrB,IAAA,sBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAM,EAAEC,WAAU,IAAK,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,gBAAgB;AAM/E,QAAMC,mBAAmB,MAAA;AACvB,UAAMC,WAAWC,OAAOC,SAASF;AAGjC,UAAM,CAACG,GAAGC,eAAeC,UAAAA,IAAcL,SAASM,MAAM,GAAA;AAGtD,UAAMC,kBAAkB,CAACH,iBAAiBA,kBAAkB,SAASI,KAAKC,SAASL;AAGnFT,eAAWE,OAAOa,gBAAgBC,iBAAiB;MAAEC,SAASL;IAAgB,CAAA;AAC9E,QAAIF,YAAY;AACdV,iBAAWE,OAAOa,gBAAgBG,MAAM;QAAED,SAAS;UAACP;;MAAY,CAAA;IAClE;EACF;AAGA,SAAcS,YAAK,MAAMf,iBAAAA,CAAAA;AACzBE,SAAOc,iBAAiB,YAAYhB,gBAAAA;AAGpC,MAAIiB;AACJ,MAAIC;AACJ,QAAMC,cAAc,OAAOrB,OAAOL,WAAW2B,cAC3CC,mBACA,CAACC,UAAAA;AACC,UAAM,EAAEC,WAAWC,OAAM,IAAKF;AAG9B,QAAIC,cAAcN,iBAAiBO,WAAWN,YAAY;AACxDD,sBAAgBM;AAChBL,mBAAaM;AAGb,UAAIC;AACJ,UAAIF,cAAcd,KAAKC,QAAQ;AAC7Be,eAAOD,SAAS,IAAIf,KAAKC,MAAM,IAAIc,MAAAA,KAAW;MAChD,OAAO;AACLC,eAAOD,SAAS,IAAID,SAAAA,IAAaC,MAAAA,KAAW,IAAID,SAAAA;MAClD;AAEA,UAAIrB,OAAOC,SAASF,aAAawB,MAAM;AACrCC,gBAAQC,UAAU,MAAM,IAAI,GAAGF,IAAAA,GAAOvB,OAAOC,SAASyB,MAAM,EAAE;MAChE;IACF;EACF,CAAA;AAGF,SAAOnC,WAAWoC,YAAY/B,OAAOL,WAAWqC,MAAM,MAAM,MACnDf,YAAK,MAAA;AACVb,WAAO6B,oBAAoB,YAAY/B,gBAAAA;AACvCmB,gBAAAA;EACF,CAAA,CAAA;AAEJ,CAAA,CAAA;",
6
- "names": ["Effect", "Capability", "Common", "Node", "Capability", "makeModule", "fnUntraced", "invokeSync", "get", "Common", "OperationInvoker", "handleNavigation", "pathname", "window", "location", "_", "nextWorkspace", "nextActive", "split", "targetWorkspace", "Node", "RootId", "LayoutOperation", "SwitchWorkspace", "subject", "Open", "sync", "addEventListener", "lastWorkspace", "lastActive", "unsubscribe", "subscribeAtom", "SimpleLayoutStateCapability", "state", "workspace", "active", "path", "history", "pushState", "search", "contributes", "Null", "removeEventListener"]
7
- }
@@ -1,3 +0,0 @@
1
- import { type Capability } from '@dxos/app-framework';
2
- export declare const OperationResolver: Capability.LazyCapability;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAA6B,MAAM,qBAAqB,CAAC;AAEjF,eAAO,MAAM,iBAAiB,EAAE,UAAU,CAAC,cAG1C,CAAC"}
@@ -1,5 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { Capability, Common } from '@dxos/app-framework';
3
- declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.OperationResolver[]>>, Error, Capability.Service>;
4
- export default _default;
5
- //# sourceMappingURL=operation-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"operation-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/operation-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AAezD,wBAiME"}
@@ -1,6 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const ReactRoot: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<Readonly<{
3
- id: string;
4
- root: import("react").FC<import("react").PropsWithChildren>;
5
- }>>>, Error>;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-root/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,SAAS;;;YAA6D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-root.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-root/react-root.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;;;;;AAKzD,wBASE"}
@@ -1,3 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Common").Capability.ReactSurface>>, Error>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,sJAAmE,CAAC"}
@@ -1,5 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { Capability, Common } from '@dxos/app-framework';
3
- declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.ReactSurface>>, never, never>;
4
- export default _default;
5
- //# sourceMappingURL=react-surface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/react-surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AAazD,wBAmBE"}
@@ -1,3 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const SpotlightDismiss: Capability.LazyCapability<import("./spotlight-dismiss").SpotlightDismissOptions, [] | Capability.Capability<Capability.InterfaceDef<null>>, Error>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/spotlight-dismiss/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,oJAA2E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"spotlight-dismiss.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/spotlight-dismiss/spotlight-dismiss.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAoBzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;;GAIG;;AACH,wBA8CE"}
@@ -1,13 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const State: Capability.LazyCapability<import("./state").SimpleLayoutStateOptions, [Capability.Capability<Capability.InterfaceDef<import("@effect-atom/atom/Atom").Writable<import("../../types").SimpleLayoutState, import("../../types").SimpleLayoutState>>>, Capability.Capability<Capability.InterfaceDef<import("@effect-atom/atom/Atom").Atom<Readonly<{
3
- mode: string;
4
- dialogOpen: boolean;
5
- sidebarOpen: boolean;
6
- complementarySidebarOpen: boolean;
7
- workspace: string;
8
- active: string[];
9
- inactive: string[];
10
- scrollIntoView: string | undefined;
11
- }>>>>], Error>;
12
- export type { SimpleLayoutStateOptions } from './state';
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/state/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,KAAK;;;;;;;;;cAAoD,CAAC;AAEvE,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/state/state.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAarD,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC3C,CAAC;;;;;;;;;;;AAEF,wBAuBE"}
@@ -1,3 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const UrlHandler: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<null>>, Error>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/url-handler/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,UAAU,8FAA+D,CAAC"}
@@ -1,10 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { Capability } from '@dxos/app-framework';
3
- /**
4
- * URL handler for simple layout that syncs browser URL with layout state.
5
- * URL format: /{workspace} or /{workspace}/{active}
6
- * Root is represented as / or /root.
7
- */
8
- declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>>, Error, Capability.Service>;
9
- export default _default;
10
- //# sourceMappingURL=url-handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url-handler.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/url-handler/url-handler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAKzD;;;;GAIG;;AACH,wBA+DE"}
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const ContentError: ({ error }: {
3
- error?: Error;
4
- }) => React.JSX.Element;
5
- //# sourceMappingURL=ContentError.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentError.d.ts","sourceRoot":"","sources":["../../../../src/components/ContentError.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,eAAO,MAAM,YAAY,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,sBAUxD,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const ContentLoading: () => React.JSX.Element;
3
- //# sourceMappingURL=ContentLoading.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentLoading.d.ts","sourceRoot":"","sources":["../../../../src/components/ContentLoading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,cAAc,yBAE1B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentLoading.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ContentLoading.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMjE,QAAA,MAAM,IAAI;;;;;;;CAO6B,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { Node } from '@dxos/plugin-graph';
3
- import { type ThemedClassName } from '@dxos/react-ui';
4
- export type BannerProps = ThemedClassName<{
5
- node?: Node.Node;
6
- }>;
7
- export declare const Banner: ({ node, classNames }: BannerProps) => React.JSX.Element | null;
8
- //# sourceMappingURL=Banner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../../../src/components/SimpleLayout/Banner.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAI9D,OAAO,EAAS,IAAI,EAA+B,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAuB,KAAK,eAAe,EAA8C,MAAM,gBAAgB,CAAC;AAkBvH,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;IACxC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,MAAM,GAAI,sBAAsB,WAAW,6BAiFvD,CAAC"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export type WorkspaceProps = {
3
- id: string;
4
- };
5
- /**
6
- *
7
- */
8
- export declare const Workspace: ({ id }: WorkspaceProps) => React.JSX.Element;
9
- //# sourceMappingURL=Workspace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Workspace.d.ts","sourceRoot":"","sources":["../../../../../src/components/Workspace/Workspace.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAa9D,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,SAAS,GAAI,QAAQ,cAAc,sBA+B/C,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './Workspace';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Workspace/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
@@ -1,10 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { type Capability, Capability as Capability$ } from '@dxos/app-framework';
6
-
7
- export const OperationResolver: Capability.LazyCapability = Capability$.lazy(
8
- 'OperationResolver',
9
- () => import('./operation-resolver'),
10
- );
@@ -1,215 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { Capability, Common } from '@dxos/app-framework';
8
- import { Operation, OperationResolver } from '@dxos/operation';
9
- import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
10
-
11
- import { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';
12
-
13
- /** Maximum number of items to keep in navigation history. */
14
- const MAX_HISTORY_LENGTH = 50;
15
-
16
- /** Parse entry ID to extract primary ID and variant. */
17
- const parseEntryId = (entryId: string) => {
18
- const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR);
19
- return { id, variant };
20
- };
21
-
22
- export default Capability.makeModule(
23
- Effect.fnUntraced(function* () {
24
- const registry = yield* Capability.get(Common.Capability.AtomRegistry);
25
- const stateAtom = yield* Capability.get(SimpleLayoutStateCapability);
26
-
27
- const getState = () => registry.get(stateAtom);
28
- const updateState = (fn: (current: SimpleLayoutState) => SimpleLayoutState) => {
29
- registry.set(stateAtom, fn(getState()));
30
- };
31
-
32
- return Capability.contributes(Common.Capability.OperationResolver, [
33
- //
34
- // SetLayoutMode
35
- //
36
- // TODO(burdon): No-op for to fix startup bug?
37
- OperationResolver.make({
38
- operation: Common.LayoutOperation.SetLayoutMode,
39
- handler: Effect.fnUntraced(function* () {}),
40
- }),
41
-
42
- //
43
- // UpdateSidebar - No-op for simple layout.
44
- //
45
- OperationResolver.make({
46
- operation: Common.LayoutOperation.UpdateSidebar,
47
- handler: () => Effect.void,
48
- }),
49
-
50
- //
51
- // UpdateComplementary - Controls companion drawer.
52
- //
53
- OperationResolver.make({
54
- operation: Common.LayoutOperation.UpdateComplementary,
55
- handler: Effect.fnUntraced(function* (input) {
56
- if (input.state === 'closed') {
57
- updateState((state) => ({
58
- ...state,
59
- drawerState: 'closed',
60
- }));
61
- }
62
- }),
63
- }),
64
-
65
- //
66
- // UpdateDialog
67
- //
68
- OperationResolver.make({
69
- operation: Common.LayoutOperation.UpdateDialog,
70
- handler: Effect.fnUntraced(function* (input) {
71
- updateState((state) => ({
72
- ...state,
73
- dialogOpen: input.state ?? Boolean(input.subject),
74
- dialogType: input.type ?? 'default',
75
- dialogBlockAlign: input.blockAlign ?? 'center',
76
- dialogOverlayClasses: input.overlayClasses,
77
- dialogOverlayStyle: input.overlayStyle,
78
- dialogContent: input.subject ? { component: input.subject, props: input.props } : undefined,
79
- }));
80
- }),
81
- }),
82
-
83
- //
84
- // UpdatePopover
85
- //
86
- OperationResolver.make({
87
- operation: Common.LayoutOperation.UpdatePopover,
88
- handler: Effect.fnUntraced(function* (input) {
89
- updateState((state) => ({
90
- ...state,
91
- popoverOpen: input.state ?? Boolean(input.subject),
92
- popoverKind: input.kind ?? 'base',
93
- popoverTitle: input.kind === 'card' ? input.title : undefined,
94
- popoverContent:
95
- typeof input.subject === 'string'
96
- ? { component: input.subject, props: input.props }
97
- : input.subject
98
- ? { subject: input.subject }
99
- : undefined,
100
- popoverSide: input.side,
101
- popoverVariant: input.variant,
102
- popoverAnchor: input.variant === 'virtual' ? input.anchor : state.popoverAnchor,
103
- popoverAnchorId: input.variant !== 'virtual' ? input.anchorId : state.popoverAnchorId,
104
- }));
105
- }),
106
- }),
107
-
108
- //
109
- // SwitchWorkspace
110
- //
111
- OperationResolver.make({
112
- operation: Common.LayoutOperation.SwitchWorkspace,
113
- handler: Effect.fnUntraced(function* (input) {
114
- updateState((state) => ({
115
- ...state,
116
- // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
117
- // Ideally this should be worked into the data model in a generic way.
118
- previousWorkspace: !state.workspace.startsWith('!') ? state.workspace : state.previousWorkspace,
119
- workspace: input.subject,
120
- active: undefined,
121
- // Clear history when switching workspaces.
122
- history: [],
123
- }));
124
- }),
125
- }),
126
-
127
- //
128
- // RevertWorkspace
129
- //
130
- OperationResolver.make({
131
- operation: Common.LayoutOperation.RevertWorkspace,
132
- handler: Effect.fnUntraced(function* () {
133
- const state = getState();
134
- yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, {
135
- subject: state.previousWorkspace,
136
- });
137
- }),
138
- }),
139
-
140
- //
141
- // Open
142
- //
143
- OperationResolver.make({
144
- operation: Common.LayoutOperation.Open,
145
- handler: Effect.fnUntraced(function* (input) {
146
- const id = input.subject[0];
147
- const { variant } = parseEntryId(id);
148
-
149
- if (variant) {
150
- // It's a companion - store the variant preference and open drawer.
151
- updateState((state) => ({
152
- ...state,
153
- companionVariant: variant,
154
- // Open drawer if closed, otherwise preserve current state (expanded/full).
155
- drawerState: state.drawerState === 'closed' || !state.drawerState ? 'expanded' : state.drawerState,
156
- }));
157
- } else {
158
- // Regular navigation - update active and history.
159
- updateState((state) => {
160
- // Push current active to history if it exists.
161
- const newHistory = state.active ? [...state.history, state.active] : state.history;
162
- // Limit history length to prevent memory issues.
163
- const trimmedHistory =
164
- newHistory.length > MAX_HISTORY_LENGTH ? newHistory.slice(-MAX_HISTORY_LENGTH) : newHistory;
165
- return {
166
- ...state,
167
- active: id,
168
- history: trimmedHistory,
169
- };
170
- });
171
- }
172
- }),
173
- }),
174
-
175
- //
176
- // Close
177
- //
178
- OperationResolver.make({
179
- operation: Common.LayoutOperation.Close,
180
- handler: Effect.fnUntraced(function* () {
181
- updateState((state) => {
182
- // Pop from history if available.
183
- if (state.history.length > 0) {
184
- const newHistory = [...state.history];
185
- const previousActive = newHistory.pop();
186
- return {
187
- ...state,
188
- active: previousActive,
189
- history: newHistory,
190
- };
191
- }
192
- // No history, just clear active.
193
- return {
194
- ...state,
195
- active: undefined,
196
- };
197
- });
198
- }),
199
- }),
200
-
201
- //
202
- // Set
203
- //
204
- OperationResolver.make({
205
- operation: Common.LayoutOperation.Set,
206
- handler: Effect.fnUntraced(function* (input) {
207
- updateState((state) => ({
208
- ...state,
209
- active: input.subject[0],
210
- }));
211
- }),
212
- }),
213
- ]);
214
- }),
215
- );
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const ReactRoot = Capability.lazy('ReactRoot', () => import('./react-root'));
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -1,40 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
- import React from 'react';
7
-
8
- import { Capability, Common } from '@dxos/app-framework';
9
- import { Node } from '@dxos/plugin-graph';
10
-
11
- import { Home, Workspace } from '../../components';
12
- import { meta } from '../../meta';
13
-
14
- type SurfaceData = {
15
- attendableId: string;
16
- properties: Record<string, any>;
17
- };
18
-
19
- const ALLOWED_DISPOSITIONS = ['workspace', 'user-account', 'pin-end'];
20
-
21
- export default Capability.makeModule(() =>
22
- Effect.succeed(
23
- Capability.contributes(Common.Capability.ReactSurface, [
24
- Common.createSurface({
25
- id: `${meta.id}/home`,
26
- role: 'article',
27
- filter: (data): data is SurfaceData => data.attendableId === Node.RootId,
28
- component: () => <Home />,
29
- }),
30
- Common.createSurface({
31
- id: `${meta.id}/workspace-article`,
32
- role: 'article',
33
- position: 'fallback',
34
- filter: (data): data is SurfaceData =>
35
- ALLOWED_DISPOSITIONS.includes((data.properties as Record<string, any>)?.disposition),
36
- component: ({ data }) => <Workspace id={data.attendableId} />,
37
- }),
38
- ]),
39
- ),
40
- );
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const SpotlightDismiss = Capability.lazy('SpotlightDismiss', () => import('./spotlight-dismiss'));
@@ -1,9 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const State = Capability.lazy('State', () => import('./state'));
8
-
9
- export type { SimpleLayoutStateOptions } from './state';
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const UrlHandler = Capability.lazy('UrlHandler', () => import('./url-handler'));