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

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 (167) hide show
  1. package/dist/lib/browser/{chunk-P77G4YTR.mjs → chunk-7VLT3S46.mjs} +3 -3
  2. package/dist/lib/browser/chunk-7VLT3S46.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-TMZNLVT2.mjs +1170 -0
  4. package/dist/lib/browser/chunk-TMZNLVT2.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +20 -19
  6. package/dist/lib/browser/index.mjs.map +3 -3
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/{operation-resolver-775UYAC2.mjs → operation-resolver-BYRIQOQT.mjs} +30 -28
  9. package/dist/lib/browser/operation-resolver-BYRIQOQT.mjs.map +7 -0
  10. package/dist/lib/browser/{react-root-KM55OMGJ.mjs → react-root-MMB575WY.mjs} +5 -5
  11. package/dist/lib/browser/react-root-MMB575WY.mjs.map +7 -0
  12. package/dist/lib/browser/{react-surface-BABGAWGY.mjs → react-surface-M6CURANW.mjs} +10 -8
  13. package/dist/lib/browser/react-surface-M6CURANW.mjs.map +7 -0
  14. package/dist/lib/browser/{spotlight-dismiss-VSNOPETH.mjs → spotlight-dismiss-67PHYS5B.mjs} +3 -3
  15. package/dist/lib/browser/spotlight-dismiss-67PHYS5B.mjs.map +7 -0
  16. package/dist/lib/browser/{state-OUFTC2KV.mjs → state-A3PGDWWZ.mjs} +5 -4
  17. package/dist/lib/browser/state-A3PGDWWZ.mjs.map +7 -0
  18. package/dist/lib/browser/url-handler-HTIUY6WL.mjs +152 -0
  19. package/dist/lib/browser/url-handler-HTIUY6WL.mjs.map +7 -0
  20. package/dist/lib/node-esm/chunk-FLOYBAHE.mjs +1171 -0
  21. package/dist/lib/node-esm/chunk-FLOYBAHE.mjs.map +7 -0
  22. package/dist/lib/node-esm/{chunk-F5TEKVJG.mjs → chunk-VIDE5UMB.mjs} +3 -3
  23. package/dist/lib/node-esm/chunk-VIDE5UMB.mjs.map +7 -0
  24. package/dist/lib/node-esm/index.mjs +20 -19
  25. package/dist/lib/node-esm/index.mjs.map +3 -3
  26. package/dist/lib/node-esm/meta.json +1 -1
  27. package/dist/lib/node-esm/{operation-resolver-LDNYS3DI.mjs → operation-resolver-BDTFNCS2.mjs} +30 -28
  28. package/dist/lib/node-esm/operation-resolver-BDTFNCS2.mjs.map +7 -0
  29. package/dist/lib/node-esm/{react-root-36UYFEEB.mjs → react-root-ENZKVSY4.mjs} +5 -5
  30. package/dist/lib/node-esm/react-root-ENZKVSY4.mjs.map +7 -0
  31. package/dist/lib/node-esm/{react-surface-CGHFVWU3.mjs → react-surface-ITVNQYLG.mjs} +10 -8
  32. package/dist/lib/node-esm/react-surface-ITVNQYLG.mjs.map +7 -0
  33. package/dist/lib/node-esm/{spotlight-dismiss-L5PCWIJG.mjs → spotlight-dismiss-RMLRZUVY.mjs} +3 -3
  34. package/dist/lib/node-esm/spotlight-dismiss-RMLRZUVY.mjs.map +7 -0
  35. package/dist/lib/node-esm/{state-Q2ZA26W5.mjs → state-ZCFZTTPL.mjs} +5 -4
  36. package/dist/lib/node-esm/state-ZCFZTTPL.mjs.map +7 -0
  37. package/dist/lib/node-esm/url-handler-WBVVKVPC.mjs +153 -0
  38. package/dist/lib/node-esm/url-handler-WBVVKVPC.mjs.map +7 -0
  39. package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
  40. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
  41. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
  42. package/dist/types/src/capabilities/react-root/react-root.d.ts +1 -1
  43. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -1
  44. package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
  45. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
  46. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
  47. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
  48. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +1 -1
  49. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +1 -1
  50. package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts +1 -1
  51. package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +1 -1
  52. package/dist/types/src/capabilities/state/index.d.ts +1 -1
  53. package/dist/types/src/capabilities/state/state.d.ts +1 -1
  54. package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +3 -1
  56. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
  57. package/dist/types/src/components/ContentError.stories.d.ts +1 -3
  58. package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
  59. package/dist/types/src/components/Home/Home.d.ts.map +1 -1
  60. package/dist/types/src/components/MobileLayout/MobileLayout.d.ts +35 -0
  61. package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -0
  62. package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts +7 -0
  63. package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -0
  64. package/dist/types/src/components/MobileLayout/index.d.ts +2 -0
  65. package/dist/types/src/components/MobileLayout/index.d.ts.map +1 -0
  66. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  67. package/dist/types/src/components/SimpleLayout/AppBar.d.ts +26 -0
  68. package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -0
  69. package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +47 -0
  70. package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -0
  71. package/dist/types/src/components/SimpleLayout/Drawer.d.ts +1 -1
  72. package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -1
  73. package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
  74. package/dist/types/src/components/SimpleLayout/NavBar.d.ts +10 -3
  75. package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
  76. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +4 -4
  77. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
  78. package/dist/types/src/components/SimpleLayout/SimpleLayout.d.ts.map +1 -1
  79. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
  80. package/dist/types/src/components/SimpleLayout/index.d.ts +3 -0
  81. package/dist/types/src/components/SimpleLayout/index.d.ts.map +1 -1
  82. package/dist/types/src/components/Workspace/Workspace.d.ts +3 -1
  83. package/dist/types/src/components/Workspace/Workspace.d.ts.map +1 -1
  84. package/dist/types/src/components/index.d.ts +1 -0
  85. package/dist/types/src/components/index.d.ts.map +1 -1
  86. package/dist/types/src/hooks/actions.d.ts +20 -0
  87. package/dist/types/src/hooks/actions.d.ts.map +1 -0
  88. package/dist/types/src/hooks/index.d.ts +4 -0
  89. package/dist/types/src/hooks/index.d.ts.map +1 -1
  90. package/dist/types/src/hooks/useAppBarProps.d.ts +7 -0
  91. package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -0
  92. package/dist/types/src/hooks/useCompanions.d.ts +5 -1
  93. package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
  94. package/dist/types/src/hooks/useDrawerActions.d.ts +13 -0
  95. package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -0
  96. package/dist/types/src/hooks/useNavbarActions.d.ts +14 -0
  97. package/dist/types/src/hooks/useNavbarActions.d.ts.map +1 -0
  98. package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
  99. package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
  100. package/dist/types/src/types/capabilities.d.ts +7 -6
  101. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  102. package/dist/types/src/types/events.d.ts.map +1 -1
  103. package/dist/types/tsconfig.tsbuildinfo +1 -1
  104. package/package.json +36 -30
  105. package/src/SimpleLayoutPlugin.ts +10 -9
  106. package/src/capabilities/operation-resolver/operation-resolver.ts +24 -22
  107. package/src/capabilities/react-root/react-root.tsx +2 -2
  108. package/src/capabilities/react-surface/react-surface.tsx +6 -5
  109. package/src/capabilities/spotlight-dismiss/spotlight-dismiss.ts +2 -2
  110. package/src/capabilities/state/state.tsx +4 -3
  111. package/src/capabilities/url-handler/url-handler.ts +111 -34
  112. package/src/components/ContentError.stories.tsx +8 -7
  113. package/src/components/ContentLoading.stories.tsx +2 -2
  114. package/src/components/ContentLoading.tsx +1 -1
  115. package/src/components/Dialog/Dialog.tsx +5 -5
  116. package/src/components/Home/Home.tsx +41 -33
  117. package/src/components/MobileLayout/MobileLayout.stories.tsx +129 -0
  118. package/src/components/MobileLayout/MobileLayout.tsx +305 -0
  119. package/src/components/MobileLayout/index.ts +5 -0
  120. package/src/components/Popover/Popover.tsx +17 -7
  121. package/src/components/SimpleLayout/AppBar.stories.tsx +144 -0
  122. package/src/components/SimpleLayout/AppBar.tsx +94 -0
  123. package/src/components/SimpleLayout/Drawer.tsx +22 -68
  124. package/src/components/SimpleLayout/Main.tsx +40 -29
  125. package/src/components/SimpleLayout/NavBar.stories.tsx +131 -23
  126. package/src/components/SimpleLayout/NavBar.tsx +15 -47
  127. package/src/components/SimpleLayout/SimpleLayout.stories.tsx +20 -11
  128. package/src/components/SimpleLayout/SimpleLayout.tsx +38 -19
  129. package/src/components/SimpleLayout/index.ts +3 -0
  130. package/src/components/Workspace/Workspace.tsx +34 -24
  131. package/src/components/hooks.ts +4 -4
  132. package/src/components/index.ts +1 -0
  133. package/src/hooks/actions.ts +85 -0
  134. package/src/hooks/index.ts +4 -0
  135. package/src/hooks/useAppBarProps.ts +116 -0
  136. package/src/hooks/useCompanions.ts +8 -5
  137. package/src/hooks/useDrawerActions.ts +98 -0
  138. package/src/hooks/useNavbarActions.ts +86 -0
  139. package/src/hooks/useSimpleLayoutState.ts +5 -5
  140. package/src/types/capabilities.ts +10 -6
  141. package/src/types/events.ts +3 -2
  142. package/dist/lib/browser/chunk-LR3EE3VB.mjs +0 -789
  143. package/dist/lib/browser/chunk-LR3EE3VB.mjs.map +0 -7
  144. package/dist/lib/browser/chunk-P77G4YTR.mjs.map +0 -7
  145. package/dist/lib/browser/operation-resolver-775UYAC2.mjs.map +0 -7
  146. package/dist/lib/browser/react-root-KM55OMGJ.mjs.map +0 -7
  147. package/dist/lib/browser/react-surface-BABGAWGY.mjs.map +0 -7
  148. package/dist/lib/browser/spotlight-dismiss-VSNOPETH.mjs.map +0 -7
  149. package/dist/lib/browser/state-OUFTC2KV.mjs.map +0 -7
  150. package/dist/lib/browser/url-handler-DOUFQIAC.mjs +0 -54
  151. package/dist/lib/browser/url-handler-DOUFQIAC.mjs.map +0 -7
  152. package/dist/lib/node-esm/chunk-F5TEKVJG.mjs.map +0 -7
  153. package/dist/lib/node-esm/chunk-HB2B3LLG.mjs +0 -790
  154. package/dist/lib/node-esm/chunk-HB2B3LLG.mjs.map +0 -7
  155. package/dist/lib/node-esm/operation-resolver-LDNYS3DI.mjs.map +0 -7
  156. package/dist/lib/node-esm/react-root-36UYFEEB.mjs.map +0 -7
  157. package/dist/lib/node-esm/react-surface-CGHFVWU3.mjs.map +0 -7
  158. package/dist/lib/node-esm/spotlight-dismiss-L5PCWIJG.mjs.map +0 -7
  159. package/dist/lib/node-esm/state-Q2ZA26W5.mjs.map +0 -7
  160. package/dist/lib/node-esm/url-handler-DVAZZEUO.mjs +0 -55
  161. package/dist/lib/node-esm/url-handler-DVAZZEUO.mjs.map +0 -7
  162. package/dist/types/src/components/ContentError.d.ts +0 -5
  163. package/dist/types/src/components/ContentError.d.ts.map +0 -1
  164. package/dist/types/src/components/SimpleLayout/Banner.d.ts +0 -8
  165. package/dist/types/src/components/SimpleLayout/Banner.d.ts.map +0 -1
  166. package/src/components/ContentError.tsx +0 -23
  167. package/src/components/SimpleLayout/Banner.tsx +0 -113
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-simple-layout",
3
- "version": "0.8.4-main.bc674ce",
3
+ "version": "0.8.4-main.c85a9c8dae",
4
4
  "description": "Simple layout plugin for minimal UI contexts like popover windows.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -15,9 +15,9 @@
15
15
  "exports": {
16
16
  ".": {
17
17
  "source": "./src/index.ts",
18
- "types": "./dist/types/src/index.d.ts",
19
18
  "browser": "./dist/lib/browser/index.mjs",
20
- "node": "./dist/lib/node-esm/index.mjs"
19
+ "node": "./dist/lib/node-esm/index.mjs",
20
+ "types": "./dist/types/src/index.d.ts"
21
21
  }
22
22
  },
23
23
  "types": "dist/types/src/index.d.ts",
@@ -26,44 +26,50 @@
26
26
  "src"
27
27
  ],
28
28
  "dependencies": {
29
- "@effect-atom/atom": "^0.4.13",
30
- "@effect-atom/atom-react": "^0.4.6",
29
+ "@effect-atom/atom": "^0.5.1",
30
+ "@effect-atom/atom-react": "^0.5.0",
31
31
  "@radix-ui/react-context": "1.1.1",
32
- "@dxos/app-framework": "0.8.4-main.bc674ce",
33
- "@dxos/log": "0.8.4-main.bc674ce",
34
- "@dxos/operation": "0.8.4-main.bc674ce",
35
- "@dxos/react-ui-attention": "0.8.4-main.bc674ce",
36
- "@dxos/plugin-graph": "0.8.4-main.bc674ce",
37
- "@dxos/react-ui-menu": "0.8.4-main.bc674ce",
38
- "@dxos/react-ui-searchlist": "0.8.4-main.bc674ce",
39
- "@dxos/react-ui-mosaic": "0.8.4-main.bc674ce",
40
- "@dxos/react-ui-stack": "0.8.4-main.bc674ce",
41
- "@dxos/schema": "0.8.4-main.bc674ce",
42
- "@dxos/util": "0.8.4-main.bc674ce"
32
+ "@tauri-apps/plugin-deep-link": "^2.2.0",
33
+ "@tauri-apps/plugin-haptics": "^2.3.2",
34
+ "@dxos/async": "0.8.4-main.c85a9c8dae",
35
+ "@dxos/echo": "0.8.4-main.c85a9c8dae",
36
+ "@dxos/app-framework": "0.8.4-main.c85a9c8dae",
37
+ "@dxos/log": "0.8.4-main.c85a9c8dae",
38
+ "@dxos/plugin-graph": "0.8.4-main.c85a9c8dae",
39
+ "@dxos/operation": "0.8.4-main.c85a9c8dae",
40
+ "@dxos/react-ui-attention": "0.8.4-main.c85a9c8dae",
41
+ "@dxos/react-ui-menu": "0.8.4-main.c85a9c8dae",
42
+ "@dxos/react-ui-searchlist": "0.8.4-main.c85a9c8dae",
43
+ "@dxos/react-ui-mosaic": "0.8.4-main.c85a9c8dae",
44
+ "@dxos/react-ui-stack": "0.8.4-main.c85a9c8dae",
45
+ "@dxos/schema": "0.8.4-main.c85a9c8dae",
46
+ "@dxos/app-toolkit": "0.8.4-main.c85a9c8dae",
47
+ "@dxos/util": "0.8.4-main.c85a9c8dae"
43
48
  },
44
49
  "devDependencies": {
45
50
  "@types/react": "~19.2.7",
46
51
  "@types/react-dom": "~19.2.3",
47
- "effect": "3.19.11",
52
+ "effect": "3.19.16",
48
53
  "react": "~19.2.3",
49
54
  "react-dom": "~19.2.3",
50
- "vite": "7.1.9",
51
- "@dxos/plugin-client": "0.8.4-main.bc674ce",
52
- "@dxos/plugin-preview": "0.8.4-main.bc674ce",
53
- "@dxos/plugin-search": "0.8.4-main.bc674ce",
54
- "@dxos/plugin-space": "0.8.4-main.bc674ce",
55
- "@dxos/plugin-testing": "0.8.4-main.bc674ce",
56
- "@dxos/react-ui": "0.8.4-main.bc674ce",
57
- "@dxos/ui-theme": "0.8.4-main.bc674ce",
58
- "@dxos/schema": "0.8.4-main.bc674ce",
59
- "@dxos/storybook-utils": "0.8.4-main.bc674ce"
55
+ "vite": "^7.1.11",
56
+ "@dxos/plugin-client": "0.8.4-main.c85a9c8dae",
57
+ "@dxos/plugin-search": "0.8.4-main.c85a9c8dae",
58
+ "@dxos/app-graph": "0.8.4-main.c85a9c8dae",
59
+ "@dxos/plugin-space": "0.8.4-main.c85a9c8dae",
60
+ "@dxos/plugin-testing": "0.8.4-main.c85a9c8dae",
61
+ "@dxos/react-ui": "0.8.4-main.c85a9c8dae",
62
+ "@dxos/plugin-preview": "0.8.4-main.c85a9c8dae",
63
+ "@dxos/storybook-utils": "0.8.4-main.c85a9c8dae",
64
+ "@dxos/schema": "0.8.4-main.c85a9c8dae",
65
+ "@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
60
66
  },
61
67
  "peerDependencies": {
62
- "effect": "3.19.11",
68
+ "effect": "3.19.16",
63
69
  "react": "~19.2.3",
64
70
  "react-dom": "~19.2.3",
65
- "@dxos/react-ui": "0.8.4-main.bc674ce",
66
- "@dxos/ui-theme": "0.8.4-main.bc674ce"
71
+ "@dxos/ui-theme": "0.8.4-main.c85a9c8dae",
72
+ "@dxos/react-ui": "0.8.4-main.c85a9c8dae"
67
73
  },
68
74
  "publishConfig": {
69
75
  "access": "public"
@@ -2,7 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { ActivationEvent, Capability, Common, Plugin } from '@dxos/app-framework';
5
+ import { ActivationEvent, ActivationEvents, Capability, Plugin } from '@dxos/app-framework';
6
+ import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
6
7
 
7
8
  import { OperationResolver, ReactRoot, ReactSurface, SpotlightDismiss, State, UrlHandler } from './capabilities';
8
9
  import { meta } from './meta';
@@ -15,33 +16,33 @@ export type SimpleLayoutPluginOptions = {
15
16
  };
16
17
 
17
18
  export const SimpleLayoutPlugin = Plugin.define<SimpleLayoutPluginOptions>(meta).pipe(
19
+ AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
20
+ AppPlugin.addTranslationsModule({ translations }),
18
21
  Plugin.addModule(({ isPopover = false }) => ({
19
22
  id: Capability.getModuleTag(State),
20
- activatesOn: Common.ActivationEvent.Startup,
21
- activatesAfter: [SimpleLayoutEvents.StateReady, Common.ActivationEvent.LayoutReady],
23
+ activatesOn: ActivationEvents.Startup,
24
+ activatesAfter: [SimpleLayoutEvents.StateReady, AppActivationEvents.LayoutReady],
22
25
  activate: () => State({ initialState: { isPopover } }),
23
26
  })),
24
27
  Plugin.addModule(({ isPopover = false }) => ({
25
28
  id: Capability.getModuleTag(SpotlightDismiss),
26
- activatesOn: Common.ActivationEvent.Startup,
29
+ activatesOn: ActivationEvents.Startup,
27
30
  activate: () => SpotlightDismiss({ isPopover }),
28
31
  })),
29
32
  Plugin.addModule({
30
33
  id: Capability.getModuleTag(ReactRoot),
31
- activatesOn: Common.ActivationEvent.Startup,
34
+ activatesOn: ActivationEvents.Startup,
32
35
  activate: ReactRoot,
33
36
  }),
34
37
  Plugin.addModule({
35
38
  id: Capability.getModuleTag(ReactSurface),
36
- activatesOn: Common.ActivationEvent.Startup,
39
+ activatesOn: ActivationEvents.Startup,
37
40
  activate: ReactSurface,
38
41
  }),
39
42
  Plugin.addModule({
40
43
  id: Capability.getModuleTag(UrlHandler),
41
- activatesOn: ActivationEvent.allOf(Common.ActivationEvent.OperationInvokerReady, SimpleLayoutEvents.StateReady),
44
+ activatesOn: ActivationEvent.allOf(ActivationEvents.OperationInvokerReady, SimpleLayoutEvents.StateReady),
42
45
  activate: UrlHandler,
43
46
  }),
44
- Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
45
- Common.Plugin.addTranslationsModule({ translations }),
46
47
  Plugin.make,
47
48
  );
@@ -4,7 +4,8 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Capability, Common } from '@dxos/app-framework';
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
9
  import { Operation, OperationResolver } from '@dxos/operation';
9
10
  import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
10
11
 
@@ -21,7 +22,7 @@ const parseEntryId = (entryId: string) => {
21
22
 
22
23
  export default Capability.makeModule(
23
24
  Effect.fnUntraced(function* () {
24
- const registry = yield* Capability.get(Common.Capability.AtomRegistry);
25
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
25
26
  const stateAtom = yield* Capability.get(SimpleLayoutStateCapability);
26
27
 
27
28
  const getState = () => registry.get(stateAtom);
@@ -29,13 +30,13 @@ export default Capability.makeModule(
29
30
  registry.set(stateAtom, fn(getState()));
30
31
  };
31
32
 
32
- return Capability.contributes(Common.Capability.OperationResolver, [
33
+ return Capability.contributes(Capabilities.OperationResolver, [
33
34
  //
34
35
  // SetLayoutMode
35
36
  //
36
37
  // TODO(burdon): No-op for to fix startup bug?
37
38
  OperationResolver.make({
38
- operation: Common.LayoutOperation.SetLayoutMode,
39
+ operation: LayoutOperation.SetLayoutMode,
39
40
  handler: Effect.fnUntraced(function* () {}),
40
41
  }),
41
42
 
@@ -43,7 +44,7 @@ export default Capability.makeModule(
43
44
  // UpdateSidebar - No-op for simple layout.
44
45
  //
45
46
  OperationResolver.make({
46
- operation: Common.LayoutOperation.UpdateSidebar,
47
+ operation: LayoutOperation.UpdateSidebar,
47
48
  handler: () => Effect.void,
48
49
  }),
49
50
 
@@ -51,7 +52,7 @@ export default Capability.makeModule(
51
52
  // UpdateComplementary - Controls companion drawer.
52
53
  //
53
54
  OperationResolver.make({
54
- operation: Common.LayoutOperation.UpdateComplementary,
55
+ operation: LayoutOperation.UpdateComplementary,
55
56
  handler: Effect.fnUntraced(function* (input) {
56
57
  if (input.state === 'closed') {
57
58
  updateState((state) => ({
@@ -66,7 +67,7 @@ export default Capability.makeModule(
66
67
  // UpdateDialog
67
68
  //
68
69
  OperationResolver.make({
69
- operation: Common.LayoutOperation.UpdateDialog,
70
+ operation: LayoutOperation.UpdateDialog,
70
71
  handler: Effect.fnUntraced(function* (input) {
71
72
  updateState((state) => ({
72
73
  ...state,
@@ -84,7 +85,7 @@ export default Capability.makeModule(
84
85
  // UpdatePopover
85
86
  //
86
87
  OperationResolver.make({
87
- operation: Common.LayoutOperation.UpdatePopover,
88
+ operation: LayoutOperation.UpdatePopover,
88
89
  handler: Effect.fnUntraced(function* (input) {
89
90
  updateState((state) => ({
90
91
  ...state,
@@ -109,7 +110,7 @@ export default Capability.makeModule(
109
110
  // SwitchWorkspace
110
111
  //
111
112
  OperationResolver.make({
112
- operation: Common.LayoutOperation.SwitchWorkspace,
113
+ operation: LayoutOperation.SwitchWorkspace,
113
114
  handler: Effect.fnUntraced(function* (input) {
114
115
  updateState((state) => ({
115
116
  ...state,
@@ -128,10 +129,10 @@ export default Capability.makeModule(
128
129
  // RevertWorkspace
129
130
  //
130
131
  OperationResolver.make({
131
- operation: Common.LayoutOperation.RevertWorkspace,
132
+ operation: LayoutOperation.RevertWorkspace,
132
133
  handler: Effect.fnUntraced(function* () {
133
134
  const state = getState();
134
- yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, {
135
+ yield* Operation.invoke(LayoutOperation.SwitchWorkspace, {
135
136
  subject: state.previousWorkspace,
136
137
  });
137
138
  }),
@@ -141,25 +142,26 @@ export default Capability.makeModule(
141
142
  // Open
142
143
  //
143
144
  OperationResolver.make({
144
- operation: Common.LayoutOperation.Open,
145
+ operation: LayoutOperation.Open,
145
146
  handler: Effect.fnUntraced(function* (input) {
146
147
  const id = input.subject[0];
147
- const { variant } = parseEntryId(id);
148
+ const { id: primaryId, variant } = parseEntryId(id);
149
+ const state = getState();
148
150
 
149
- if (variant) {
150
- // It's a companion - store the variant preference and open drawer.
151
+ // Only treat as companion when opening a variant of the current workspace/active (e.g. object~comments).
152
+ // IDs like settings~spaceId are alternate-tree nodes and should navigate main content, not open the drawer.
153
+ // TODO(wittjosiah): Factor out the change-companion operation from deck to a common layout operation.
154
+ const isCompanionOfCurrent = variant && (primaryId === state.workspace || primaryId === state.active);
155
+ if (isCompanionOfCurrent) {
151
156
  updateState((state) => ({
152
157
  ...state,
153
158
  companionVariant: variant,
154
- // Open drawer if closed, otherwise preserve current state (expanded/full).
155
- drawerState: state.drawerState === 'closed' || !state.drawerState ? 'expanded' : state.drawerState,
159
+ drawerState: state.drawerState === 'closed' || !state.drawerState ? 'open' : state.drawerState,
156
160
  }));
157
161
  } else {
158
- // Regular navigation - update active and history.
162
+ // Regular navigation - update active and history (use full id for alternate-tree nodes).
159
163
  updateState((state) => {
160
- // Push current active to history if it exists.
161
164
  const newHistory = state.active ? [...state.history, state.active] : state.history;
162
- // Limit history length to prevent memory issues.
163
165
  const trimmedHistory =
164
166
  newHistory.length > MAX_HISTORY_LENGTH ? newHistory.slice(-MAX_HISTORY_LENGTH) : newHistory;
165
167
  return {
@@ -176,7 +178,7 @@ export default Capability.makeModule(
176
178
  // Close
177
179
  //
178
180
  OperationResolver.make({
179
- operation: Common.LayoutOperation.Close,
181
+ operation: LayoutOperation.Close,
180
182
  handler: Effect.fnUntraced(function* () {
181
183
  updateState((state) => {
182
184
  // Pop from history if available.
@@ -202,7 +204,7 @@ export default Capability.makeModule(
202
204
  // Set
203
205
  //
204
206
  OperationResolver.make({
205
- operation: Common.LayoutOperation.Set,
207
+ operation: LayoutOperation.Set,
206
208
  handler: Effect.fnUntraced(function* (input) {
207
209
  updateState((state) => ({
208
210
  ...state,
@@ -5,14 +5,14 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
  import React from 'react';
7
7
 
8
- import { Capability, Common } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
9
 
10
10
  import { SimpleLayout } from '../../components';
11
11
  import { meta } from '../../meta';
12
12
 
13
13
  export default Capability.makeModule(() =>
14
14
  Effect.succeed(
15
- Capability.contributes(Common.Capability.ReactRoot, {
15
+ Capability.contributes(Capabilities.ReactRoot, {
16
16
  id: meta.id,
17
17
  root: () => {
18
18
  return <SimpleLayout />;
@@ -5,7 +5,8 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
  import React from 'react';
7
7
 
8
- import { Capability, Common } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
9
10
  import { Node } from '@dxos/plugin-graph';
10
11
 
11
12
  import { Home, Workspace } from '../../components';
@@ -16,18 +17,18 @@ type SurfaceData = {
16
17
  properties: Record<string, any>;
17
18
  };
18
19
 
19
- const ALLOWED_DISPOSITIONS = ['workspace', 'user-account', 'pin-end'];
20
+ const ALLOWED_DISPOSITIONS = ['workspace', 'user-account', 'pin-end', 'alternate-tree'];
20
21
 
21
22
  export default Capability.makeModule(() =>
22
23
  Effect.succeed(
23
- Capability.contributes(Common.Capability.ReactSurface, [
24
- Common.createSurface({
24
+ Capability.contributes(Capabilities.ReactSurface, [
25
+ Surface.create({
25
26
  id: `${meta.id}/home`,
26
27
  role: 'article',
27
28
  filter: (data): data is SurfaceData => data.attendableId === Node.RootId,
28
29
  component: () => <Home />,
29
30
  }),
30
- Common.createSurface({
31
+ Surface.create({
31
32
  id: `${meta.id}/workspace-article`,
32
33
  role: 'article',
33
34
  position: 'fallback',
@@ -7,7 +7,7 @@
7
7
 
8
8
  import * as Effect from 'effect/Effect';
9
9
 
10
- import { Capability, Common } from '@dxos/app-framework';
10
+ import { Capabilities, Capability } from '@dxos/app-framework';
11
11
  import { log } from '@dxos/log';
12
12
  import { isTauri } from '@dxos/util';
13
13
 
@@ -76,7 +76,7 @@ export default Capability.makeModule(({ isPopover = false }: SpotlightDismissOpt
76
76
  };
77
77
  window.addEventListener('keydown', handleKeyDown);
78
78
 
79
- return Capability.contributes(Common.Capability.Null, null, () =>
79
+ return Capability.contributes(Capabilities.Null, null, () =>
80
80
  Effect.sync(() => {
81
81
  focusCleanup?.();
82
82
  window.removeEventListener('keydown', handleKeyDown);
@@ -5,7 +5,8 @@
5
5
  import { Atom } from '@effect-atom/atom-react';
6
6
  import * as Effect from 'effect/Effect';
7
7
 
8
- import { Capability, Common } from '@dxos/app-framework';
8
+ import { Capability } from '@dxos/app-framework';
9
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
10
  import { Node } from '@dxos/plugin-graph';
10
11
 
11
12
  import { type SimpleLayoutState } from '../../types';
@@ -29,7 +30,7 @@ export default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions
29
30
  Effect.sync(() => {
30
31
  const stateAtom = Atom.make<SimpleLayoutState>({ ...defaultState, ...initialState });
31
32
 
32
- const layoutAtom = Atom.make((get): Common.Capability.Layout => {
33
+ const layoutAtom = Atom.make((get): AppCapabilities.Layout => {
33
34
  const state = get(stateAtom);
34
35
  return {
35
36
  mode: 'simple',
@@ -45,7 +46,7 @@ export default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions
45
46
 
46
47
  return [
47
48
  Capability.contributes(SimpleLayoutStateCapability, stateAtom),
48
- Capability.contributes(Common.Capability.Layout, layoutAtom),
49
+ Capability.contributes(AppCapabilities.Layout, layoutAtom),
49
50
  ];
50
51
  }),
51
52
  );
@@ -4,8 +4,11 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Capability, Common } from '@dxos/app-framework';
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { LayoutOperation } from '@dxos/app-toolkit';
9
+ import { log } from '@dxos/log';
8
10
  import { Node } from '@dxos/plugin-graph';
11
+ import { isTauri } from '@dxos/util';
9
12
 
10
13
  import { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';
11
14
 
@@ -13,17 +16,19 @@ import { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapabilit
13
16
  * URL handler for simple layout that syncs browser URL with layout state.
14
17
  * URL format: /{workspace} or /{workspace}/{active}
15
18
  * Root is represented as / or /root.
19
+ *
20
+ * On mobile Tauri, also listens for deep links via the deep-link plugin.
16
21
  */
17
22
  export default Capability.makeModule(
18
23
  Effect.fnUntraced(function* () {
19
- const { invokeSync } = yield* Capability.get(Common.Capability.OperationInvoker);
24
+ const { invokeSync } = yield* Capability.get(Capabilities.OperationInvoker);
20
25
 
21
26
  /**
22
- * Handle navigation events (initial load and popstate).
23
- * Parses URL and updates state accordingly.
27
+ * Handle navigation from a pathname.
28
+ * Parses path and updates state accordingly.
24
29
  */
25
- const handleNavigation = () => {
26
- const pathname = window.location.pathname;
30
+ const handlePathNavigation = (pathname: string) => {
31
+ log.info('[UrlHandler] Navigating to path', { pathname });
27
32
 
28
33
  // Parse URL segments: /{workspace}/{active}
29
34
  const [_, nextWorkspace, nextActive] = pathname.split('/');
@@ -32,49 +37,121 @@ export default Capability.makeModule(
32
37
  const targetWorkspace = !nextWorkspace || nextWorkspace === 'root' ? Node.RootId : nextWorkspace;
33
38
 
34
39
  // Navigate via operations (they will update state accordingly).
35
- invokeSync(Common.LayoutOperation.SwitchWorkspace, { subject: targetWorkspace });
40
+ invokeSync(LayoutOperation.SwitchWorkspace, { subject: targetWorkspace });
36
41
  if (nextActive) {
37
- invokeSync(Common.LayoutOperation.Open, { subject: [nextActive] });
42
+ invokeSync(LayoutOperation.Open, { subject: [nextActive] });
38
43
  }
39
44
  };
40
45
 
46
+ const onNavigation = handleNavigation(handlePathNavigation);
47
+
41
48
  // Handle initial URL and listen for browser navigation.
42
- yield* Effect.sync(() => handleNavigation());
43
- window.addEventListener('popstate', handleNavigation);
49
+ yield* Effect.sync(() => onNavigation());
50
+ window.addEventListener('popstate', onNavigation);
51
+
52
+ // Set up deep link listener for mobile Tauri.
53
+ let unlistenDeepLink: (() => void) | undefined;
54
+ if (isTauri()) {
55
+ yield* Effect.tryPromise({
56
+ try: async () => {
57
+ const { getCurrent, onOpenUrl } = await import('@tauri-apps/plugin-deep-link');
58
+
59
+ // Check if app was launched via deep link (cold start).
60
+ const launchUrls = await getCurrent();
61
+ if (launchUrls && launchUrls.length > 0) {
62
+ log.info('[UrlHandler] App launched with deep links', { urls: launchUrls });
63
+ for (const url of launchUrls) {
64
+ handleDeepLink(url, handlePathNavigation);
65
+ }
66
+ }
67
+
68
+ // Listen for deep links while app is running.
69
+ unlistenDeepLink = await onOpenUrl((urls) => {
70
+ log.info('[UrlHandler] Deep links received', { urls });
71
+ for (const url of urls) {
72
+ handleDeepLink(url, handlePathNavigation);
73
+ }
74
+ });
75
+
76
+ log.info('[UrlHandler] Deep link listener initialized');
77
+ },
78
+ catch: (error) => {
79
+ log.warn('[UrlHandler] Failed to initialize deep link listener', { error });
80
+ return error;
81
+ },
82
+ }).pipe(Effect.catchAll(() => Effect.void));
83
+ }
44
84
 
45
85
  // Subscribe to state changes to update the URL.
46
86
  let lastWorkspace: string | undefined;
47
87
  let lastActive: string | undefined;
48
- const unsubscribe = yield* Common.Capability.subscribeAtom(
49
- SimpleLayoutStateCapability,
50
- (state: SimpleLayoutState) => {
51
- const { workspace, active } = state;
52
-
53
- // Only update URL if relevant state changed.
54
- if (workspace !== lastWorkspace || active !== lastActive) {
55
- lastWorkspace = workspace;
56
- lastActive = active;
57
-
58
- // Build path: root is represented as /, other workspaces as /{workspace}.
59
- let path: string;
60
- if (workspace === Node.RootId) {
61
- path = active ? `/${Node.RootId}/${active}` : '/';
62
- } else {
63
- path = active ? `/${workspace}/${active}` : `/${workspace}`;
64
- }
88
+ const unsubscribe = yield* Capabilities.subscribeAtom(SimpleLayoutStateCapability, (state: SimpleLayoutState) => {
89
+ const { workspace, active } = state;
65
90
 
66
- if (window.location.pathname !== path) {
67
- history.pushState(null, '', `${path}${window.location.search}`);
68
- }
91
+ // Only update URL if relevant state changed.
92
+ if (workspace !== lastWorkspace || active !== lastActive) {
93
+ lastWorkspace = workspace;
94
+ lastActive = active;
95
+
96
+ const path = pathFromState(workspace, active);
97
+ if (window.location.pathname !== path) {
98
+ history.pushState(null, '', `${path}${window.location.search}`);
69
99
  }
70
- },
71
- );
100
+ }
101
+ });
72
102
 
73
- return Capability.contributes(Common.Capability.Null, null, () =>
103
+ return Capability.contributes(Capabilities.Null, null, () =>
74
104
  Effect.sync(() => {
75
- window.removeEventListener('popstate', handleNavigation);
105
+ window.removeEventListener('popstate', onNavigation);
76
106
  unsubscribe();
107
+ unlistenDeepLink?.();
77
108
  }),
78
109
  );
79
110
  }),
80
111
  );
112
+
113
+ // TODO(wittjosiah): Instead of hardcoding redirect paths, we should either:
114
+ // 1. Validate that the workspace exists in the graph before navigating.
115
+ // 2. Implement more structured routing with explicit route definitions.
116
+ /**
117
+ * Check if a path is a special redirect path that shouldn't be navigated to.
118
+ * These paths are handled by other systems (e.g., OAuth).
119
+ */
120
+ const isRedirectPath = (pathname: string): boolean => pathname.startsWith('/redirect/');
121
+
122
+ /**
123
+ * Build pathname from layout state. Root workspace is / or /root/{active}.
124
+ */
125
+ const pathFromState = (workspace: string, active: string | undefined): string =>
126
+ workspace === Node.RootId
127
+ ? active
128
+ ? `/${Node.RootId}/${active}`
129
+ : '/'
130
+ : active
131
+ ? `/${workspace}/${active}`
132
+ : `/${workspace}`;
133
+
134
+ /**
135
+ * Returns a handler for navigation events (initial load and popstate) that navigates to current pathname.
136
+ */
137
+ const handleNavigation =
138
+ (navigate: (pathname: string) => void): (() => void) =>
139
+ () =>
140
+ navigate(window.location.pathname);
141
+
142
+ /**
143
+ * Handle deep link URL from Tauri. Parses the URL and calls navigate unless it's a redirect path.
144
+ */
145
+ const handleDeepLink = (urlString: string, navigate: (pathname: string) => void): void => {
146
+ log.info('[UrlHandler] Deep link received', { url: urlString });
147
+ try {
148
+ const url = new URL(urlString);
149
+ if (isRedirectPath(url.pathname)) {
150
+ log.info('[UrlHandler] Skipping redirect path (handled elsewhere)', { pathname: url.pathname });
151
+ return;
152
+ }
153
+ navigate(url.pathname);
154
+ } catch (error) {
155
+ log.warn('[UrlHandler] Failed to parse deep link URL', { urlString, error });
156
+ }
157
+ };
@@ -4,28 +4,29 @@
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
 
7
+ import { ErrorFallback } from '@dxos/react-ui';
7
8
  import { withTheme } from '@dxos/react-ui/testing';
8
9
 
9
10
  import { translations } from '../translations';
10
11
 
11
- import { ContentError } from './ContentError';
12
-
13
12
  const meta = {
14
- title: 'plugins/plugin-simple-layout/ContentError',
15
- component: ContentError,
16
- decorators: [withTheme],
13
+ title: 'plugins/plugin-simple-layout/components/ErrorFallback',
14
+ component: ErrorFallback,
15
+ decorators: [withTheme()],
17
16
  parameters: {
18
17
  layout: 'centered',
19
18
  translations,
20
19
  },
21
- } satisfies Meta<typeof ContentError>;
20
+ } satisfies Meta<typeof ErrorFallback>;
22
21
 
23
22
  export default meta;
24
23
 
25
24
  type Story = StoryObj<typeof meta>;
26
25
 
27
26
  export const Default: Story = {
28
- args: {},
27
+ args: {
28
+ error: new Error('An unexpected error occurred'),
29
+ },
29
30
  };
30
31
 
31
32
  export const WithError: Story = {
@@ -9,9 +9,9 @@ import { withTheme } from '@dxos/react-ui/testing';
9
9
  import { ContentLoading } from './ContentLoading';
10
10
 
11
11
  const meta = {
12
- title: 'plugins/plugin-simple-layout/ContentLoading',
12
+ title: 'plugins/plugin-simple-layout/components/ContentLoading',
13
13
  component: ContentLoading,
14
- decorators: [withTheme],
14
+ decorators: [withTheme()],
15
15
  parameters: {
16
16
  layout: 'centered',
17
17
  },
@@ -6,5 +6,5 @@ import React from 'react';
6
6
 
7
7
  // TODO(burdon): Show skeleton: https://github.com/dxos/dxos/issues/8259
8
8
  export const ContentLoading = () => {
9
- return <div role='none' className='grid place-items-center attention-surface' />;
9
+ return <div role='none' className='grid place-items-center dx-attention-surface' />;
10
10
  };