@dxos/plugin-simple-layout 0.8.4-main.52d7546f51 → 0.8.4-main.6fa680abb7

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 (119) hide show
  1. package/dist/lib/browser/{chunk-O3BQBYMW.mjs → chunk-MDPEKLKR.mjs} +181 -183
  2. package/dist/lib/browser/chunk-MDPEKLKR.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-7VLT3S46.mjs → chunk-MRR7PXSM.mjs} +3 -3
  4. package/dist/lib/browser/{chunk-7VLT3S46.mjs.map → chunk-MRR7PXSM.mjs.map} +1 -1
  5. package/dist/lib/browser/index.mjs +6 -6
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/browser/{operation-resolver-BYRIQOQT.mjs → operation-resolver-VTZ6HZ4B.mjs} +24 -35
  8. package/dist/lib/browser/operation-resolver-VTZ6HZ4B.mjs.map +7 -0
  9. package/dist/lib/browser/{react-root-GPTKI5H2.mjs → react-root-WVQYY2JA.mjs} +3 -3
  10. package/dist/lib/browser/{react-surface-LT5JJTPR.mjs → react-surface-VLBR37ED.mjs} +11 -8
  11. package/dist/lib/browser/{react-surface-LT5JJTPR.mjs.map → react-surface-VLBR37ED.mjs.map} +3 -3
  12. package/dist/lib/browser/{state-A3PGDWWZ.mjs → state-TXSMUWYI.mjs} +2 -2
  13. package/dist/lib/browser/{url-handler-HTIUY6WL.mjs → url-handler-RBRONH7S.mjs} +18 -19
  14. package/dist/lib/browser/url-handler-RBRONH7S.mjs.map +7 -0
  15. package/dist/lib/node-esm/{chunk-UAWM4B2S.mjs → chunk-DCKASLMP.mjs} +181 -183
  16. package/dist/lib/node-esm/chunk-DCKASLMP.mjs.map +7 -0
  17. package/dist/lib/node-esm/{chunk-VIDE5UMB.mjs → chunk-WMNTJ2MK.mjs} +3 -3
  18. package/dist/lib/node-esm/{chunk-VIDE5UMB.mjs.map → chunk-WMNTJ2MK.mjs.map} +1 -1
  19. package/dist/lib/node-esm/index.mjs +6 -6
  20. package/dist/lib/node-esm/meta.json +1 -1
  21. package/dist/lib/node-esm/{operation-resolver-BDTFNCS2.mjs → operation-resolver-R7CQ6ERU.mjs} +24 -35
  22. package/dist/lib/node-esm/operation-resolver-R7CQ6ERU.mjs.map +7 -0
  23. package/dist/lib/node-esm/{react-root-GRG2OAI2.mjs → react-root-XBNDM7BE.mjs} +3 -3
  24. package/dist/lib/node-esm/{react-surface-TCUSDIN2.mjs → react-surface-U5NHA367.mjs} +11 -8
  25. package/dist/lib/node-esm/{react-surface-TCUSDIN2.mjs.map → react-surface-U5NHA367.mjs.map} +3 -3
  26. package/dist/lib/node-esm/{state-ZCFZTTPL.mjs → state-JMX6FAG4.mjs} +2 -2
  27. package/dist/lib/node-esm/{url-handler-WBVVKVPC.mjs → url-handler-QSMCH3JB.mjs} +18 -19
  28. package/dist/lib/node-esm/url-handler-QSMCH3JB.mjs.map +7 -0
  29. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +1 -1
  30. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
  31. package/dist/types/src/capabilities/react-root/react-root.d.ts +1 -1
  32. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +1 -1
  33. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +1 -1
  35. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts +1 -1
  37. package/dist/types/src/capabilities/state/index.d.ts +1 -1
  38. package/dist/types/src/capabilities/state/state.d.ts +1 -1
  39. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +3 -3
  40. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
  41. package/dist/types/src/components/ContentError.stories.d.ts +1 -3
  42. package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
  43. package/dist/types/src/components/ContentLoading/ContentLoading.d.ts.map +1 -0
  44. package/dist/types/src/components/ContentLoading/ContentLoading.stories.d.ts.map +1 -0
  45. package/dist/types/src/components/ContentLoading/index.d.ts +2 -0
  46. package/dist/types/src/components/ContentLoading/index.d.ts.map +1 -0
  47. package/dist/types/src/components/Home/Home.d.ts.map +1 -1
  48. package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -1
  49. package/dist/types/src/components/NavBranch/NavBranch.d.ts +11 -0
  50. package/dist/types/src/components/NavBranch/NavBranch.d.ts.map +1 -0
  51. package/dist/types/src/components/NavBranch/index.d.ts +2 -0
  52. package/dist/types/src/components/NavBranch/index.d.ts.map +1 -0
  53. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  54. package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
  55. package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -1
  56. package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
  57. package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
  58. package/dist/types/src/components/hooks.d.ts +4 -2
  59. package/dist/types/src/components/hooks.d.ts.map +1 -1
  60. package/dist/types/src/components/index.d.ts +1 -1
  61. package/dist/types/src/hooks/actions.d.ts +3 -4
  62. package/dist/types/src/hooks/actions.d.ts.map +1 -1
  63. package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -1
  64. package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -1
  65. package/dist/types/src/hooks/useNavbarActions.d.ts.map +1 -1
  66. package/dist/types/tsconfig.tsbuildinfo +1 -1
  67. package/package.json +29 -28
  68. package/src/capabilities/operation-resolver/operation-resolver.ts +19 -34
  69. package/src/capabilities/react-surface/react-surface.tsx +8 -6
  70. package/src/capabilities/url-handler/url-handler.ts +11 -35
  71. package/src/components/ContentError.stories.tsx +7 -6
  72. package/src/components/{ContentLoading.stories.tsx → ContentLoading/ContentLoading.stories.tsx} +1 -1
  73. package/src/components/{ContentLoading.tsx → ContentLoading/ContentLoading.tsx} +1 -1
  74. package/src/components/ContentLoading/index.ts +5 -0
  75. package/src/components/Dialog/Dialog.tsx +3 -3
  76. package/src/components/Home/Home.tsx +30 -24
  77. package/src/components/MobileLayout/MobileLayout.stories.tsx +23 -19
  78. package/src/components/MobileLayout/MobileLayout.tsx +2 -2
  79. package/src/components/{Workspace/Workspace.tsx → NavBranch/NavBranch.tsx} +43 -32
  80. package/src/components/{Workspace → NavBranch}/index.ts +1 -1
  81. package/src/components/Popover/Popover.tsx +14 -4
  82. package/src/components/SimpleLayout/AppBar.stories.tsx +2 -2
  83. package/src/components/SimpleLayout/AppBar.tsx +14 -21
  84. package/src/components/SimpleLayout/Drawer.tsx +15 -21
  85. package/src/components/SimpleLayout/Main.tsx +11 -10
  86. package/src/components/SimpleLayout/NavBar.stories.tsx +8 -8
  87. package/src/components/SimpleLayout/NavBar.tsx +4 -10
  88. package/src/components/SimpleLayout/SimpleLayout.stories.tsx +2 -2
  89. package/src/components/SimpleLayout/SimpleLayout.tsx +1 -1
  90. package/src/components/hooks.ts +8 -8
  91. package/src/components/index.ts +1 -1
  92. package/src/hooks/actions.ts +15 -17
  93. package/src/hooks/useAppBarProps.ts +8 -5
  94. package/src/hooks/useCompanions.ts +1 -1
  95. package/src/hooks/useDrawerActions.ts +9 -7
  96. package/src/hooks/useNavbarActions.ts +10 -9
  97. package/src/meta.ts +1 -1
  98. package/src/types/capabilities.ts +1 -1
  99. package/dist/lib/browser/chunk-O3BQBYMW.mjs.map +0 -7
  100. package/dist/lib/browser/operation-resolver-BYRIQOQT.mjs.map +0 -7
  101. package/dist/lib/browser/url-handler-HTIUY6WL.mjs.map +0 -7
  102. package/dist/lib/node-esm/chunk-UAWM4B2S.mjs.map +0 -7
  103. package/dist/lib/node-esm/operation-resolver-BDTFNCS2.mjs.map +0 -7
  104. package/dist/lib/node-esm/url-handler-WBVVKVPC.mjs.map +0 -7
  105. package/dist/types/src/components/ContentError.d.ts +0 -5
  106. package/dist/types/src/components/ContentError.d.ts.map +0 -1
  107. package/dist/types/src/components/ContentLoading.d.ts.map +0 -1
  108. package/dist/types/src/components/ContentLoading.stories.d.ts.map +0 -1
  109. package/dist/types/src/components/Workspace/Workspace.d.ts +0 -11
  110. package/dist/types/src/components/Workspace/Workspace.d.ts.map +0 -1
  111. package/dist/types/src/components/Workspace/index.d.ts +0 -2
  112. package/dist/types/src/components/Workspace/index.d.ts.map +0 -1
  113. package/src/components/ContentError.tsx +0 -23
  114. /package/dist/lib/browser/{react-root-GPTKI5H2.mjs.map → react-root-WVQYY2JA.mjs.map} +0 -0
  115. /package/dist/lib/browser/{state-A3PGDWWZ.mjs.map → state-TXSMUWYI.mjs.map} +0 -0
  116. /package/dist/lib/node-esm/{react-root-GRG2OAI2.mjs.map → react-root-XBNDM7BE.mjs.map} +0 -0
  117. /package/dist/lib/node-esm/{state-ZCFZTTPL.mjs.map → state-JMX6FAG4.mjs.map} +0 -0
  118. /package/dist/types/src/components/{ContentLoading.d.ts → ContentLoading/ContentLoading.d.ts} +0 -0
  119. /package/dist/types/src/components/{ContentLoading.stories.d.ts → ContentLoading/ContentLoading.stories.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SimpleLayoutState,
3
3
  meta
4
- } from "./chunk-7VLT3S46.mjs";
4
+ } from "./chunk-MRR7PXSM.mjs";
5
5
 
6
6
  // src/components/Home/Home.tsx
7
7
  import React, { useCallback, useEffect as useEffect2, useMemo, useRef } from "react";
@@ -9,24 +9,25 @@ import { useOperationInvoker } from "@dxos/app-framework/ui";
9
9
  import { LayoutOperation } from "@dxos/app-toolkit";
10
10
  import { useAppGraph as useAppGraph2 } from "@dxos/app-toolkit/ui";
11
11
  import { Node, useConnections } from "@dxos/plugin-graph";
12
- import { Avatar, Icon, Layout, ScrollArea, Toolbar, toLocalizedString, useTranslation } from "@dxos/react-ui";
13
- import { Card, Mosaic } from "@dxos/react-ui-mosaic";
12
+ import { Avatar, Icon, Panel, ScrollArea, Toolbar, toLocalizedString, useTranslation } from "@dxos/react-ui";
13
+ import { Card } from "@dxos/react-ui";
14
+ import { Mosaic } from "@dxos/react-ui-mosaic";
14
15
  import { SearchList, useSearchListItem, useSearchListResults } from "@dxos/react-ui-searchlist";
15
16
  import { mx } from "@dxos/ui-theme";
16
17
  import { byPosition } from "@dxos/util";
17
18
 
18
19
  // src/components/hooks.ts
19
20
  import { useEffect } from "react";
21
+ import { expandAttendableId } from "@dxos/react-ui-attention";
20
22
  import { useAppGraph } from "@dxos/app-toolkit/ui";
21
23
  import { Graph } from "@dxos/plugin-graph";
22
- var useLoadDescendents = (nodeId) => {
24
+ var useExpandPath = (nodeId) => {
23
25
  const { graph } = useAppGraph();
24
26
  useEffect(() => {
25
27
  if (nodeId) {
26
- Graph.expand(graph, nodeId, "outbound");
27
- Graph.getConnections(graph, nodeId, "outbound").forEach((child) => {
28
- Graph.expand(graph, child.id, "outbound");
29
- });
28
+ for (const prefix of expandAttendableId(nodeId)) {
29
+ Graph.expand(graph, prefix, "child");
30
+ }
30
31
  }
31
32
  }, [
32
33
  nodeId,
@@ -40,7 +41,7 @@ var Home = (_) => {
40
41
  const userAccountItem = useItemsByDisposition("user-account")[0];
41
42
  const pinnedItems = useItemsByDisposition("pin-end", true);
42
43
  const workspaceItems = useItemsByDisposition("workspace");
43
- useLoadDescendents(Node.RootId);
44
+ useExpandPath(Node.RootId);
44
45
  const items = useMemo(() => [
45
46
  ...userAccountItem ? [
46
47
  userAccountItem
@@ -56,14 +57,16 @@ var Home = (_) => {
56
57
  items,
57
58
  extract: (node) => toLocalizedString(node.properties.label, t)
58
59
  });
59
- return /* @__PURE__ */ React.createElement(Layout.Main, {
60
- toolbar: true
61
- }, /* @__PURE__ */ React.createElement(SearchList.Root, {
60
+ return /* @__PURE__ */ React.createElement(SearchList.Root, {
62
61
  onSearch: handleSearch
62
+ }, /* @__PURE__ */ React.createElement(Panel.Root, null, /* @__PURE__ */ React.createElement(Panel.Toolbar, {
63
+ asChild: true
63
64
  }, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(SearchList.Input, {
64
65
  placeholder: t("search placeholder"),
65
66
  autoFocus: true
66
- })), /* @__PURE__ */ React.createElement(SearchList.Content, null, /* @__PURE__ */ React.createElement(Mosaic.Container, {
67
+ }))), /* @__PURE__ */ React.createElement(Panel.Content, {
68
+ asChild: true
69
+ }, /* @__PURE__ */ React.createElement(SearchList.Content, null, /* @__PURE__ */ React.createElement(Mosaic.Container, {
67
70
  asChild: true
68
71
  }, /* @__PURE__ */ React.createElement(ScrollArea.Root, {
69
72
  orientation: "vertical"
@@ -73,16 +76,17 @@ var Home = (_) => {
73
76
  items: results,
74
77
  getId: (node) => node.id,
75
78
  Tile: WorkspaceTile
76
- })))))));
79
+ }))))))));
77
80
  };
78
- var WorkspaceTile = ({ data }) => {
81
+ var WorkspaceTile = (props) => {
82
+ const data = props.data;
79
83
  const { t } = useTranslation(meta.id);
80
84
  const { invokePromise } = useOperationInvoker();
81
85
  const { selectedValue, registerItem, unregisterItem } = useSearchListItem();
82
86
  const name = toLocalizedString(data.properties.label, t);
83
87
  const isSelected = selectedValue === data.id;
84
88
  const cardRef = useRef(null);
85
- useLoadDescendents(data.id);
89
+ useExpandPath(data.id);
86
90
  const handleSelect = useCallback(() => invokePromise(LayoutOperation.SwitchWorkspace, {
87
91
  subject: data.id
88
92
  }), [
@@ -115,7 +119,7 @@ var WorkspaceTile = ({ data }) => {
115
119
  fullWidth: true,
116
120
  tabIndex: -1,
117
121
  "data-selected": isSelected,
118
- classNames: mx("dx-focus-ring", isSelected && "bg-hoverOverlay"),
122
+ classNames: mx("dx-focus-ring", isSelected && "bg-hover-overlay"),
119
123
  onClick: handleSelect,
120
124
  ref: cardRef
121
125
  }, /* @__PURE__ */ React.createElement(Card.Toolbar, {
@@ -136,13 +140,13 @@ var filterItems = (node, disposition) => {
136
140
  };
137
141
  var useItemsByDisposition = (disposition, sort = false) => {
138
142
  const { graph } = useAppGraph2();
139
- const connections = useConnections(graph, Node.RootId);
143
+ const connections = useConnections(graph, Node.RootId, "child");
140
144
  const filtered = connections.filter((node) => filterItems(node, disposition));
141
145
  return sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
142
146
  };
143
147
 
144
148
  // src/components/SimpleLayout/SimpleLayout.tsx
145
- import React12, { useEffect as useEffect6, useRef as useRef4, useState as useState3 } from "react";
149
+ import React11, { useEffect as useEffect6, useRef as useRef4, useState as useState3 } from "react";
146
150
  import { Splitter } from "@dxos/react-ui";
147
151
  import { Mosaic as Mosaic3 } from "@dxos/react-ui-mosaic";
148
152
 
@@ -178,9 +182,10 @@ var useAppBarProps = () => {
178
182
  const nodes = filtered;
179
183
  const edges = filtered.map((action) => ({
180
184
  source: "root",
181
- target: action.id
185
+ target: action.id,
186
+ relation: "child"
182
187
  }));
183
- const workspaceConnections = state2.workspace ? get(graph.connections(state2.workspace)) : [];
188
+ const workspaceConnections = state2.workspace ? get(graph.connections(state2.workspace, "child")) : [];
184
189
  const alternateTreeNode = workspaceConnections.find((node2) => node2.properties.disposition === "alternate-tree");
185
190
  if (alternateTreeNode && activeId2 !== alternateTreeNode.id) {
186
191
  const settingsAction = {
@@ -199,7 +204,8 @@ var useAppBarProps = () => {
199
204
  nodes.push(settingsAction);
200
205
  edges.push({
201
206
  source: "root",
202
- target: settingsAction.id
207
+ target: settingsAction.id,
208
+ relation: "child"
203
209
  });
204
210
  }
205
211
  return {
@@ -236,7 +242,7 @@ var useAppBarProps = () => {
236
242
  state.active,
237
243
  state.history.length
238
244
  ]);
239
- const popoverAnchorId = node && state.popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? state.popoverAnchorId : void 0;
245
+ const popoverAnchorId = node && state.popoverAnchorId === `${meta.id}:${node.id}` ? state.popoverAnchorId : void 0;
240
246
  return {
241
247
  title,
242
248
  actions: actionsAtom,
@@ -255,21 +261,20 @@ import { byPosition as byPosition3 } from "@dxos/util";
255
261
 
256
262
  // src/hooks/actions.ts
257
263
  import * as Effect2 from "effect/Effect";
258
- import { LayoutOperation as LayoutOperation3 } from "@dxos/app-toolkit";
264
+ import { getCompanionVariant } from "@dxos/app-toolkit";
259
265
  import { Node as Node3 } from "@dxos/plugin-graph";
260
- import { ATTENDABLE_PATH_SEPARATOR } from "@dxos/react-ui-attention";
261
266
  import { byPosition as byPosition2 } from "@dxos/util";
262
- var PLANK_COMPANION_TYPE = "dxos.org/plugin/deck/plank-companion";
267
+ var PLANK_COMPANION_TYPE = "org.dxos.plugin.deck.plank-companion";
263
268
  var createCompanionActions = (graph, stateAtom, get, config) => {
264
- const { idPrefix, selectedVariant, invokeSync } = config;
269
+ const { idPrefix, selectedVariant, updateState } = config;
265
270
  const state = get(stateAtom);
266
271
  const activeId = state.active ?? state.workspace;
267
- const activeConnections = activeId ? get(graph.connections(activeId)) : [];
272
+ const activeConnections = activeId ? get(graph.connections(activeId, "child")) : [];
268
273
  const companions = activeConnections.filter((node) => node.type === PLANK_COMPANION_TYPE).toSorted((a, b) => byPosition2(a.properties, b.properties));
269
274
  const nodes = [];
270
275
  const edges = [];
271
276
  companions.forEach((companion) => {
272
- const [, companionVariant] = companion.id.split(ATTENDABLE_PATH_SEPARATOR);
277
+ const companionVariant = getCompanionVariant(companion.id);
273
278
  const companionAction = {
274
279
  id: `${idPrefix}-companion-${companion.id}`,
275
280
  type: Node3.ActionType,
@@ -277,21 +282,24 @@ var createCompanionActions = (graph, stateAtom, get, config) => {
277
282
  icon: companion.properties.icon ?? "ph--placeholder--regular",
278
283
  label: companion.properties.label,
279
284
  iconOnly: true,
280
- // Conditionally add variant highlighting.
281
285
  ...selectedVariant !== void 0 && {
282
286
  variant: selectedVariant === companionVariant ? "primary" : "ghost"
283
287
  }
284
288
  },
285
- data: () => Effect2.sync(() => invokeSync(LayoutOperation3.Open, {
286
- subject: [
287
- companion.id
288
- ]
289
+ data: () => Effect2.sync(() => updateState((current) => {
290
+ const closing = current.companionVariant === companionVariant && current.drawerState !== "closed";
291
+ return {
292
+ ...current,
293
+ companionVariant: closing ? void 0 : companionVariant,
294
+ drawerState: closing ? "closed" : "open"
295
+ };
289
296
  }))
290
297
  };
291
298
  nodes.push(companionAction);
292
299
  edges.push({
293
300
  source: "root",
294
- target: companionAction.id
301
+ target: companionAction.id,
302
+ relation: "child"
295
303
  });
296
304
  });
297
305
  return {
@@ -303,7 +311,7 @@ var createCompanionActions = (graph, stateAtom, get, config) => {
303
311
  // src/hooks/useCompanions.ts
304
312
  var useCompanions = (nodeId) => {
305
313
  const { graph } = useAppGraph4();
306
- const nodes = useConnections2(graph, nodeId);
314
+ const nodes = useConnections2(graph, nodeId, "child");
307
315
  const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
308
316
  return useMemo3(() => companions.toSorted((a, b) => byPosition3(a.properties, b.properties)), [
309
317
  companions
@@ -313,19 +321,19 @@ var useCompanions = (nodeId) => {
313
321
  // src/hooks/useDrawerActions.ts
314
322
  import { Atom as Atom2 } from "@effect-atom/atom-react";
315
323
  import * as Effect3 from "effect/Effect";
316
- import { useMemo as useMemo6 } from "react";
317
- import { useCapability as useCapability3, useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/ui";
324
+ import { useMemo as useMemo7 } from "react";
325
+ import { useCapability as useCapability3 } from "@dxos/app-framework/ui";
318
326
  import { useAppGraph as useAppGraph7 } from "@dxos/app-toolkit/ui";
319
327
  import { Node as Node4, useActionRunner as useActionRunner2 } from "@dxos/plugin-graph";
320
- import { useTranslation as useTranslation7 } from "@dxos/react-ui";
328
+ import { useTranslation as useTranslation6 } from "@dxos/react-ui";
321
329
  import { createGapSeparator } from "@dxos/react-ui-menu";
322
330
 
323
- // src/components/ContentLoading.tsx
331
+ // src/components/ContentLoading/ContentLoading.tsx
324
332
  import React2 from "react";
325
333
  var ContentLoading = () => {
326
334
  return /* @__PURE__ */ React2.createElement("div", {
327
335
  role: "none",
328
- className: "grid place-items-center attention-surface"
336
+ className: "grid place-items-center dx-attention-surface"
329
337
  });
330
338
  };
331
339
 
@@ -354,7 +362,7 @@ var MobileLayoutRoot = /* @__PURE__ */ forwardRef(({ classNames, children, trans
354
362
  ...props,
355
363
  role: "none",
356
364
  style: {
357
- transition: `block-size ${transition}ms ease-out`,
365
+ transition: `h-size ${transition}ms ease-out`,
358
366
  blockSize: "calc(100vh - var(--kb-height, 0px))"
359
367
  },
360
368
  className: mx2("absolute top-0 left-0 right-0 flex flex-col", classNames),
@@ -370,7 +378,7 @@ var MobileLayoutPanel = /* @__PURE__ */ forwardRef(({ classNames, children, safe
370
378
  paddingTop: safe?.top ? "env(safe-area-inset-top)" : void 0,
371
379
  paddingBottom: safe?.bottom ? `calc((1 - var(--kb-open, 0)) * env(safe-area-inset-bottom))` : void 0
372
380
  },
373
- className: mx2("relative bs-full flex flex-col overflow-hidden", classNames),
381
+ className: mx2("relative h-full flex flex-col overflow-hidden", classNames),
374
382
  ref: forwardedRef
375
383
  }, children);
376
384
  });
@@ -510,8 +518,9 @@ var useIOSKeyboard = () => {
510
518
  import { createContext as createContext2 } from "@radix-ui/react-context";
511
519
  import React4, { useCallback as useCallback3, useEffect as useEffect4, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
512
520
  import { Surface } from "@dxos/app-framework/ui";
521
+ import { useObjectNavigate } from "@dxos/app-toolkit/ui";
513
522
  import { Popover, toLocalizedString as toLocalizedString3, useTranslation as useTranslation3 } from "@dxos/react-ui";
514
- import { Card as Card2 } from "@dxos/react-ui-mosaic";
523
+ import { Card as Card2 } from "@dxos/react-ui";
515
524
  var DEBOUNCE_DELAY = 40;
516
525
  var [LayoutPopoverProvider, useLayoutPopoverContext] = createContext2("LayoutPopover");
517
526
  var PopoverRoot = ({ children }) => {
@@ -548,10 +557,12 @@ var PopoverRoot = ({ children }) => {
548
557
  virtualRef
549
558
  }), children));
550
559
  };
560
+ var getPopoverSubject = (content) => content && typeof content === "object" && "subject" in content ? content.subject : content;
551
561
  var PopoverContent = () => {
552
562
  const { t } = useTranslation3(meta.id);
553
563
  const { state, updateState } = useSimpleLayoutState();
554
564
  const { setOpen } = useLayoutPopoverContext("PopoverContent");
565
+ const handleNavigate = useObjectNavigate(getPopoverSubject(state.popoverContent));
555
566
  const handleClose = useCallback3(() => {
556
567
  setOpen(false);
557
568
  updateState((s) => ({
@@ -598,8 +609,10 @@ var PopoverContent = () => {
598
609
  limit: 1
599
610
  }), state.popoverKind === "card" && /* @__PURE__ */ React4.createElement(Card2.Root, {
600
611
  border: false,
601
- classNames: "popover-card-max-width"
602
- }, /* @__PURE__ */ React4.createElement(Card2.Toolbar, null, /* @__PURE__ */ React4.createElement("span", null), state.popoverTitle ? /* @__PURE__ */ React4.createElement(Card2.Title, null, toLocalizedString3(state.popoverTitle, t)) : /* @__PURE__ */ React4.createElement("span", null), /* @__PURE__ */ React4.createElement(Card2.Close, {
612
+ classNames: "dx-card-popover"
613
+ }, /* @__PURE__ */ React4.createElement(Card2.Toolbar, null, /* @__PURE__ */ React4.createElement("span", null), state.popoverTitle ? /* @__PURE__ */ React4.createElement(Card2.Title, {
614
+ onClick: handleNavigate
615
+ }, toLocalizedString3(state.popoverTitle, t)) : /* @__PURE__ */ React4.createElement("span", null), /* @__PURE__ */ React4.createElement(Card2.CloseIconButton, {
603
616
  onClick: handleClose
604
617
  })), /* @__PURE__ */ React4.createElement(Surface.Surface, {
605
618
  role: "card--content",
@@ -612,7 +625,7 @@ var PopoverContent = () => {
612
625
  import { useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
613
626
  import React5, { Fragment } from "react";
614
627
  import { IconButton, Popover as Popover2, Toolbar as Toolbar2, useTranslation as useTranslation4 } from "@dxos/react-ui";
615
- import { DropdownMenu, MenuProvider, useMenuActions } from "@dxos/react-ui-menu";
628
+ import { Menu, useMenuActions } from "@dxos/react-ui-menu";
616
629
  import { mx as mx3, osTranslations } from "@dxos/ui-theme";
617
630
  var APP_BAR_NAME = "SimpleLayout.AppBar";
618
631
  var AppBar = ({ classNames, title, actions, showBackButton, popoverAnchorId, onAction, onBack }) => {
@@ -627,7 +640,7 @@ var AppBar = ({ classNames, title, actions, showBackButton, popoverAnchorId, onA
627
640
  const AnchorRoot = popoverAnchorId ? Popover2.Anchor : Fragment;
628
641
  return /* @__PURE__ */ React5.createElement(Toolbar2.Root, {
629
642
  role: "banner",
630
- classNames: mx3("grid grid-cols-[var(--rail-size)_1fr_var(--rail-size)] bs-[var(--rail-action)] items-center", "density-fine", classNames)
643
+ classNames: mx3("grid grid-cols-[var(--dx-rail-size)_1fr_var(--dx-rail-size)] items-center", "dx-density-fine", classNames)
631
644
  }, keyboardOpen ? /* @__PURE__ */ React5.createElement(IconButton, {
632
645
  variant: "ghost",
633
646
  icon: "ph--x--regular",
@@ -641,60 +654,44 @@ var AppBar = ({ classNames, title, actions, showBackButton, popoverAnchorId, onA
641
654
  onClick: onBack
642
655
  }) : /* @__PURE__ */ React5.createElement("div", null), /* @__PURE__ */ React5.createElement("h1", {
643
656
  className: "text-center truncate font-thin uppercase"
644
- }, displayTitle), hasActions ? /* @__PURE__ */ React5.createElement(AnchorRoot, null, /* @__PURE__ */ React5.createElement(MenuProvider, {
657
+ }, displayTitle), hasActions ? /* @__PURE__ */ React5.createElement(AnchorRoot, null, /* @__PURE__ */ React5.createElement(Menu.Root, {
645
658
  ...menu,
659
+ caller: meta.id,
646
660
  onAction
647
- }, /* @__PURE__ */ React5.createElement(DropdownMenu.Root, {
648
- caller: meta.id
649
- }, /* @__PURE__ */ React5.createElement(DropdownMenu.Trigger, {
661
+ }, /* @__PURE__ */ React5.createElement(Menu.Trigger, {
650
662
  asChild: true
651
663
  }, /* @__PURE__ */ React5.createElement(IconButton, {
652
664
  variant: "ghost",
653
665
  icon: "ph--dots-three-vertical--regular",
654
666
  iconOnly: true,
655
667
  label: t("actions menu label")
656
- }))))) : /* @__PURE__ */ React5.createElement("span", null));
668
+ })), /* @__PURE__ */ React5.createElement(Menu.Content, null))) : /* @__PURE__ */ React5.createElement("span", null));
657
669
  };
658
670
  AppBar.displayName = APP_BAR_NAME;
659
671
 
660
672
  // src/components/SimpleLayout/Main.tsx
661
- import React8, { useMemo as useMemo5 } from "react";
673
+ import React7, { useMemo as useMemo5 } from "react";
662
674
  import { Surface as Surface2 } from "@dxos/app-framework/ui";
663
675
  import { useAppGraph as useAppGraph5 } from "@dxos/app-toolkit/ui";
664
676
  import { useNode as useNode2 } from "@dxos/plugin-graph";
677
+ import { ErrorFallback } from "@dxos/react-ui";
665
678
  import { useAttentionAttributes } from "@dxos/react-ui-attention";
666
- import { mx as mx6 } from "@dxos/ui-theme";
667
-
668
- // src/components/ContentError.tsx
669
- import React6 from "react";
670
- import { useTranslation as useTranslation5 } from "@dxos/react-ui";
671
- import { descriptionMessage, mx as mx4 } from "@dxos/ui-theme";
672
- var ContentError = ({ error }) => {
673
- const { t } = useTranslation5(meta.id);
674
- const errorString = error?.toString() ?? "";
675
- return /* @__PURE__ */ React6.createElement("div", {
676
- role: "none",
677
- className: "grid place-items-center overflow-y-auto attention-surface"
678
- }, /* @__PURE__ */ React6.createElement("p", {
679
- role: "alert",
680
- className: mx4(descriptionMessage, "p-2 break-all rounded-sm")
681
- }, error ? errorString : t("error fallback message")));
682
- };
679
+ import { mx as mx5 } from "@dxos/ui-theme";
683
680
 
684
681
  // src/components/SimpleLayout/NavBar.tsx
685
- import React7 from "react";
686
- import { MenuProvider as MenuProvider2, ToolbarMenu, useMenuActions as useMenuActions2 } from "@dxos/react-ui-menu";
687
- import { mx as mx5 } from "@dxos/ui-theme";
682
+ import React6 from "react";
683
+ import { Menu as Menu2, useMenuActions as useMenuActions2 } from "@dxos/react-ui-menu";
684
+ import { mx as mx4 } from "@dxos/ui-theme";
688
685
  var NAVBAR_NAME = "SimpleLayout.NavBar";
689
686
  var NavBar = ({ classNames, actions, onAction }) => {
690
687
  const menu = useMenuActions2(actions);
691
- return /* @__PURE__ */ React7.createElement(MenuProvider2, {
688
+ return /* @__PURE__ */ React6.createElement(Menu2.Root, {
692
689
  ...menu,
693
- onAction,
694
- alwaysActive: true
695
- }, /* @__PURE__ */ React7.createElement(ToolbarMenu, {
690
+ alwaysActive: true,
691
+ onAction
692
+ }, /* @__PURE__ */ React6.createElement(Menu2.Toolbar, {
696
693
  density: "coarse",
697
- classNames: mx5(classNames)
694
+ classNames: mx4(classNames)
698
695
  }));
699
696
  };
700
697
  NavBar.displayName = NAVBAR_NAME;
@@ -708,7 +705,7 @@ var Main = () => {
708
705
  const { keyboardOpen } = useMobileLayout(MAIN_NAME);
709
706
  const { actions, onAction } = useNavbarActions();
710
707
  const appBarProps = useAppBarProps();
711
- const placeholder = useMemo5(() => /* @__PURE__ */ React8.createElement(ContentLoading, null), []);
708
+ const placeholder = useMemo5(() => /* @__PURE__ */ React7.createElement(ContentLoading, null), []);
712
709
  const { graph } = useAppGraph5();
713
710
  const node = useNode2(graph, id);
714
711
  const data = useMemo5(() => {
@@ -725,75 +722,82 @@ var Main = () => {
725
722
  node?.properties,
726
723
  state.popoverAnchorId
727
724
  ]);
728
- useLoadDescendents(id);
725
+ useExpandPath(id);
729
726
  const showNavBar = !keyboardOpen && !state.isPopover && state.drawerState === "closed";
730
- return /* @__PURE__ */ React8.createElement("div", {
727
+ return /* @__PURE__ */ React7.createElement("div", {
731
728
  role: "none",
732
- className: mx6("bs-full grid overflow-hidden bg-toolbarSurface", showNavBar ? "grid-rows-[var(--rail-action)_1fr_var(--toolbar-size)]" : "grid-rows-[var(--rail-action)_1fr]"),
729
+ className: mx5("h-full grid overflow-hidden bg-toolbar-surface", showNavBar ? "grid-rows-[var(--dx-rail-action)_1fr_var(--dx-toolbar-size)]" : "grid-rows-[var(--dx-rail-action)_1fr]"),
733
730
  ...attentionAttrs
734
- }, /* @__PURE__ */ React8.createElement(AppBar, appBarProps), /* @__PURE__ */ React8.createElement("article", {
735
- className: "bs-full overflow-hidden bg-baseSurface"
736
- }, /* @__PURE__ */ React8.createElement(Surface2.Surface, {
731
+ }, /* @__PURE__ */ React7.createElement(AppBar, appBarProps), /* @__PURE__ */ React7.createElement("article", {
732
+ className: "h-full overflow-hidden bg-base-surface"
733
+ }, /* @__PURE__ */ React7.createElement(Surface2.Surface, {
737
734
  key: id,
738
735
  role: "article",
739
736
  data,
740
737
  limit: 1,
741
- fallback: ContentError,
738
+ fallback: ErrorFallback,
742
739
  placeholder
743
- })), showNavBar && /* @__PURE__ */ React8.createElement(NavBar, {
744
- classNames: "border-bs border-subduedSeparator",
740
+ })), showNavBar && /* @__PURE__ */ React7.createElement(NavBar, {
741
+ classNames: "border-y border-subdued-separator",
745
742
  actions,
746
743
  onAction
747
744
  }));
748
745
  };
749
746
  Main.displayName = MAIN_NAME;
750
747
 
751
- // src/components/Workspace/Workspace.tsx
752
- import React9, { useCallback as useCallback4, useEffect as useEffect5, useRef as useRef3 } from "react";
748
+ // src/components/NavBranch/NavBranch.tsx
749
+ import React8, { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef3 } from "react";
753
750
  import { useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/ui";
754
- import { LayoutOperation as LayoutOperation4 } from "@dxos/app-toolkit";
751
+ import { LayoutOperation as LayoutOperation3 } from "@dxos/app-toolkit";
755
752
  import { useAppGraph as useAppGraph6 } from "@dxos/app-toolkit/ui";
756
753
  import { useConnections as useConnections3 } from "@dxos/plugin-graph";
757
- import { Avatar as Avatar2, Icon as Icon2, Layout as Layout2, ScrollArea as ScrollArea2, Toolbar as Toolbar3, toLocalizedString as toLocalizedString4, useTranslation as useTranslation6 } from "@dxos/react-ui";
758
- import { Card as Card3, Mosaic as Mosaic2 } from "@dxos/react-ui-mosaic";
754
+ import { Avatar as Avatar2, Icon as Icon2, Panel as Panel2, ScrollArea as ScrollArea2, Toolbar as Toolbar3, toLocalizedString as toLocalizedString4, useTranslation as useTranslation5 } from "@dxos/react-ui";
755
+ import { Card as Card3 } from "@dxos/react-ui";
756
+ import { Mosaic as Mosaic2 } from "@dxos/react-ui-mosaic";
759
757
  import { SearchList as SearchList2, useSearchListItem as useSearchListItem2, useSearchListResults as useSearchListResults2 } from "@dxos/react-ui-searchlist";
760
- import { mx as mx7 } from "@dxos/ui-theme";
761
- var Workspace = ({ id }) => {
762
- const { t } = useTranslation6(meta.id);
758
+ import { mx as mx6 } from "@dxos/ui-theme";
759
+ var NavBranch = ({ id }) => {
760
+ const { t } = useTranslation5(meta.id);
763
761
  const { graph } = useAppGraph6();
764
- useLoadDescendents(id);
765
- const children = useConnections3(graph, id, "outbound");
762
+ useExpandPath(id);
763
+ const children = useConnections3(graph, id, "child");
764
+ const visibleChildren = useMemo6(() => children.filter((node) => node.properties.disposition !== "alternate-tree"), [
765
+ children
766
+ ]);
766
767
  const { results, handleSearch } = useSearchListResults2({
767
- items: children,
768
+ items: visibleChildren,
768
769
  extract: (child) => toLocalizedString4(child.properties.label, t)
769
770
  });
770
- return /* @__PURE__ */ React9.createElement(Layout2.Main, {
771
- toolbar: true
772
- }, /* @__PURE__ */ React9.createElement(SearchList2.Root, {
771
+ return /* @__PURE__ */ React8.createElement(SearchList2.Root, {
773
772
  onSearch: handleSearch
774
- }, /* @__PURE__ */ React9.createElement(Toolbar3.Root, null, /* @__PURE__ */ React9.createElement(SearchList2.Input, {
773
+ }, /* @__PURE__ */ React8.createElement(Panel2.Root, null, /* @__PURE__ */ React8.createElement(Panel2.Toolbar, {
774
+ asChild: true
775
+ }, /* @__PURE__ */ React8.createElement(Toolbar3.Root, null, /* @__PURE__ */ React8.createElement(SearchList2.Input, {
775
776
  placeholder: t("search placeholder"),
776
777
  autoFocus: true
777
- })), /* @__PURE__ */ React9.createElement(SearchList2.Content, null, /* @__PURE__ */ React9.createElement(Mosaic2.Container, {
778
+ }))), /* @__PURE__ */ React8.createElement(Panel2.Content, {
778
779
  asChild: true
779
- }, /* @__PURE__ */ React9.createElement(ScrollArea2.Root, {
780
+ }, /* @__PURE__ */ React8.createElement(SearchList2.Content, null, /* @__PURE__ */ React8.createElement(Mosaic2.Container, {
781
+ asChild: true
782
+ }, /* @__PURE__ */ React8.createElement(ScrollArea2.Root, {
780
783
  orientation: "vertical"
781
- }, /* @__PURE__ */ React9.createElement(ScrollArea2.Viewport, {
784
+ }, /* @__PURE__ */ React8.createElement(ScrollArea2.Viewport, {
782
785
  classNames: "p-2"
783
- }, /* @__PURE__ */ React9.createElement(Mosaic2.Stack, {
786
+ }, /* @__PURE__ */ React8.createElement(Mosaic2.Stack, {
784
787
  items: results,
785
788
  getId: (child) => child.id,
786
- Tile: WorkspaceChildTile
787
- })))))));
789
+ Tile: NavBranchTile
790
+ }))))))));
788
791
  };
789
- var WorkspaceChildTile = ({ data }) => {
790
- const { t } = useTranslation6(meta.id);
792
+ var NavBranchTile = (props) => {
793
+ const data = props.data;
794
+ const { t } = useTranslation5(meta.id);
791
795
  const { invokeSync } = useOperationInvoker3();
792
796
  const ref = useRef3(null);
793
797
  const { selectedValue, registerItem, unregisterItem } = useSearchListItem2();
794
798
  const isSelected = selectedValue === data.id;
795
799
  const name = toLocalizedString4(data.properties.label, t);
796
- const handleSelect = useCallback4(() => invokeSync(LayoutOperation4.Open, {
800
+ const handleSelect = useCallback4(() => invokeSync(LayoutOperation3.Open, {
797
801
  subject: [
798
802
  data.id
799
803
  ]
@@ -822,24 +826,24 @@ var WorkspaceChildTile = ({ data }) => {
822
826
  }, [
823
827
  isSelected
824
828
  ]);
825
- return /* @__PURE__ */ React9.createElement(Card3.Root, {
829
+ return /* @__PURE__ */ React8.createElement(Card3.Root, {
826
830
  ref,
827
831
  role: "button",
828
832
  fullWidth: true,
829
833
  tabIndex: -1,
830
834
  "data-selected": isSelected,
831
- classNames: mx7("dx-focus-ring", isSelected && "bg-hoverOverlay"),
835
+ classNames: mx6("dx-focus-ring", isSelected && "bg-hover-overlay"),
832
836
  onClick: handleSelect
833
- }, /* @__PURE__ */ React9.createElement(Card3.Toolbar, {
837
+ }, /* @__PURE__ */ React8.createElement(Card3.Toolbar, {
834
838
  density: "coarse"
835
- }, /* @__PURE__ */ React9.createElement(Avatar2.Root, null, /* @__PURE__ */ React9.createElement(Avatar2.Content, {
839
+ }, /* @__PURE__ */ React8.createElement(Avatar2.Root, null, /* @__PURE__ */ React8.createElement(Avatar2.Content, {
836
840
  hue: data.properties.hue,
837
841
  icon: data.properties.icon,
838
842
  hueVariant: "transparent",
839
843
  variant: "square",
840
844
  size: 12,
841
845
  fallback: name
842
- }), /* @__PURE__ */ React9.createElement(Avatar2.Label, null, name), /* @__PURE__ */ React9.createElement(Icon2, {
846
+ }), /* @__PURE__ */ React8.createElement(Avatar2.Label, null, name), /* @__PURE__ */ React8.createElement(Icon2, {
843
847
  icon: "ph--caret-right--regular"
844
848
  }))));
845
849
  };
@@ -866,19 +870,18 @@ var useSimpleLayoutState = () => {
866
870
 
867
871
  // src/hooks/useDrawerActions.ts
868
872
  var useDrawerActions = (consumerName) => {
869
- const { t } = useTranslation7(meta.id);
873
+ const { t } = useTranslation6(meta.id);
870
874
  const stateAtom = useCapability3(SimpleLayoutState);
871
875
  const { graph } = useAppGraph7();
872
876
  const runAction = useActionRunner2();
873
- const { invokeSync } = useOperationInvoker4();
874
877
  const { updateState } = useSimpleLayoutState();
875
878
  const { keyboardOpen } = useMobileLayout(consumerName);
876
- const actionsAtom = useMemo6(() => Atom2.make((get) => {
879
+ const actionsAtom = useMemo7(() => Atom2.make((get) => {
877
880
  const state = get(stateAtom);
878
881
  const { nodes, edges } = createCompanionActions(graph, stateAtom, get, {
879
882
  idPrefix: "drawer",
880
883
  selectedVariant: state.companionVariant,
881
- invokeSync
884
+ updateState
882
885
  });
883
886
  const gapSeparator = createGapSeparator("drawer-gap");
884
887
  nodes.push(...gapSeparator.nodes);
@@ -901,7 +904,8 @@ var useDrawerActions = (consumerName) => {
901
904
  nodes.push(toggleExpandAction);
902
905
  edges.push({
903
906
  source: "root",
904
- target: toggleExpandAction.id
907
+ target: toggleExpandAction.id,
908
+ relation: "child"
905
909
  });
906
910
  }
907
911
  const closeAction = {
@@ -914,13 +918,15 @@ var useDrawerActions = (consumerName) => {
914
918
  },
915
919
  data: () => Effect3.sync(() => updateState((state2) => ({
916
920
  ...state2,
917
- drawerState: "closed"
921
+ drawerState: "closed",
922
+ companionVariant: void 0
918
923
  })))
919
924
  };
920
925
  nodes.push(closeAction);
921
926
  edges.push({
922
927
  source: "root",
923
- target: closeAction.id
928
+ target: closeAction.id,
929
+ relation: "child"
924
930
  });
925
931
  return {
926
932
  nodes,
@@ -929,7 +935,6 @@ var useDrawerActions = (consumerName) => {
929
935
  }), [
930
936
  graph,
931
937
  stateAtom,
932
- invokeSync,
933
938
  updateState,
934
939
  keyboardOpen,
935
940
  t
@@ -942,23 +947,23 @@ var useDrawerActions = (consumerName) => {
942
947
 
943
948
  // src/hooks/useNavbarActions.ts
944
949
  import { Atom as Atom3 } from "@effect-atom/atom-react";
945
- import { useMemo as useMemo7 } from "react";
946
- import { useCapability as useCapability4, useOperationInvoker as useOperationInvoker5 } from "@dxos/app-framework/ui";
950
+ import { useMemo as useMemo8 } from "react";
951
+ import { useCapability as useCapability4 } from "@dxos/app-framework/ui";
947
952
  import { useAppGraph as useAppGraph8 } from "@dxos/app-toolkit/ui";
948
953
  import { Node as Node5, useActionRunner as useActionRunner3 } from "@dxos/plugin-graph";
949
- import { useTranslation as useTranslation8 } from "@dxos/react-ui";
954
+ import { useTranslation as useTranslation7 } from "@dxos/react-ui";
950
955
  import { createGapSeparator as createGapSeparator2, createMenuItemGroup } from "@dxos/react-ui-menu";
951
956
  var MAIN_MENU_GROUP_ID = "navbar-main-menu";
952
957
  var useNavbarActions = () => {
953
- const { t } = useTranslation8(meta.id);
958
+ const { t } = useTranslation7(meta.id);
954
959
  const { graph } = useAppGraph8();
955
960
  const runAction = useActionRunner3();
956
- const { invokeSync } = useOperationInvoker5();
957
961
  const stateAtom = useCapability4(SimpleLayoutState);
958
- const actionsAtom = useMemo7(() => Atom3.make((get) => {
962
+ const { updateState } = useSimpleLayoutState();
963
+ const actionsAtom = useMemo8(() => Atom3.make((get) => {
959
964
  const { nodes, edges } = createCompanionActions(graph, stateAtom, get, {
960
965
  idPrefix: "navbar",
961
- invokeSync
966
+ updateState
962
967
  });
963
968
  const gapSeparator = createGapSeparator2("navbar-gap");
964
969
  nodes.push(...gapSeparator.nodes);
@@ -973,15 +978,17 @@ var useNavbarActions = () => {
973
978
  nodes.push(mainMenuGroup);
974
979
  edges.push({
975
980
  source: "root",
976
- target: mainMenuGroup.id
981
+ target: mainMenuGroup.id,
982
+ relation: "child"
977
983
  });
978
- const rootConnections = get(graph.connections(Node5.RootId));
979
- const menuActions = rootConnections.filter((node) => node.properties.disposition === "menu");
984
+ const rootActions = get(graph.actions(Node5.RootId));
985
+ const menuActions = rootActions.filter((node) => node.properties.disposition === "menu");
980
986
  menuActions.forEach((menuAction) => {
981
987
  nodes.push(menuAction);
982
988
  edges.push({
983
989
  source: MAIN_MENU_GROUP_ID,
984
- target: menuAction.id
990
+ target: menuAction.id,
991
+ relation: "child"
985
992
  });
986
993
  });
987
994
  return {
@@ -991,7 +998,7 @@ var useNavbarActions = () => {
991
998
  }), [
992
999
  graph,
993
1000
  stateAtom,
994
- invokeSync,
1001
+ updateState,
995
1002
  t
996
1003
  ]);
997
1004
  return {
@@ -1001,56 +1008,57 @@ var useNavbarActions = () => {
1001
1008
  };
1002
1009
 
1003
1010
  // src/components/Dialog/Dialog.tsx
1004
- import React10 from "react";
1011
+ import React9 from "react";
1005
1012
  import { Surface as Surface3 } from "@dxos/app-framework/ui";
1006
1013
  import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
1014
+ import { ErrorFallback as ErrorFallback2 } from "@dxos/react-ui";
1007
1015
  var Dialog = () => {
1008
1016
  const { state, updateState } = useSimpleLayoutState();
1009
1017
  const DialogRoot = state.dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
1010
1018
  const DialogOverlay = state.dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
1011
- return /* @__PURE__ */ React10.createElement(DialogRoot, {
1019
+ return /* @__PURE__ */ React9.createElement(DialogRoot, {
1012
1020
  modal: state.dialogBlockAlign !== "end",
1013
1021
  open: state.dialogOpen,
1014
1022
  onOpenChange: (nextOpen) => updateState((state2) => ({
1015
1023
  ...state2,
1016
1024
  dialogOpen: nextOpen
1017
1025
  }))
1018
- }, state.dialogBlockAlign === "end" ? /* @__PURE__ */ React10.createElement(Surface3.Surface, {
1026
+ }, state.dialogBlockAlign === "end" ? /* @__PURE__ */ React9.createElement(Surface3.Surface, {
1019
1027
  role: "dialog",
1020
1028
  data: state.dialogContent,
1021
1029
  limit: 1,
1022
- fallback: ContentError
1023
- }) : /* @__PURE__ */ React10.createElement(DialogOverlay, {
1030
+ fallback: ErrorFallback2
1031
+ }) : /* @__PURE__ */ React9.createElement(DialogOverlay, {
1024
1032
  blockAlign: state.dialogBlockAlign,
1025
1033
  classNames: state.dialogOverlayClasses,
1026
1034
  style: state.dialogOverlayStyle
1027
- }, /* @__PURE__ */ React10.createElement(Surface3.Surface, {
1035
+ }, /* @__PURE__ */ React9.createElement(Surface3.Surface, {
1028
1036
  role: "dialog",
1029
1037
  data: state.dialogContent,
1030
1038
  limit: 1,
1031
- fallback: ContentError
1039
+ fallback: ErrorFallback2
1032
1040
  })));
1033
1041
  };
1034
1042
 
1035
1043
  // src/components/SimpleLayout/Drawer.tsx
1036
- import React11, { useMemo as useMemo8 } from "react";
1044
+ import React10, { useMemo as useMemo9 } from "react";
1037
1045
  import { Surface as Surface4 } from "@dxos/app-framework/ui";
1046
+ import { getCompanionVariant as getCompanionVariant2 } from "@dxos/app-toolkit";
1038
1047
  import { useAppGraph as useAppGraph9 } from "@dxos/app-toolkit/ui";
1039
1048
  import { useNode as useNode3 } from "@dxos/plugin-graph";
1040
- import { Layout as Layout3 } from "@dxos/react-ui";
1041
- import { ATTENDABLE_PATH_SEPARATOR as ATTENDABLE_PATH_SEPARATOR2 } from "@dxos/react-ui-attention";
1042
- import { MenuProvider as MenuProvider3, ToolbarMenu as ToolbarMenu2, useMenuActions as useMenuActions3 } from "@dxos/react-ui-menu";
1049
+ import { ErrorFallback as ErrorFallback3, Panel as Panel3 } from "@dxos/react-ui";
1050
+ import { Menu as Menu3, useMenuActions as useMenuActions3 } from "@dxos/react-ui-menu";
1043
1051
  var DRAWER_NAME = "SimpleLayout.Drawer";
1044
1052
  var Drawer = () => {
1045
1053
  const { graph } = useAppGraph9();
1046
1054
  const { state: layoutState } = useSimpleLayoutState();
1047
- const placeholder = useMemo8(() => /* @__PURE__ */ React11.createElement(ContentLoading, null), []);
1055
+ const placeholder = useMemo9(() => /* @__PURE__ */ React10.createElement(ContentLoading, null), []);
1048
1056
  const activeId = layoutState.active ?? layoutState.workspace;
1049
1057
  const companions = useCompanions(activeId);
1050
1058
  const { companionId, variant } = useSelectedCompanion(companions, layoutState.companionVariant);
1051
1059
  const node = useNode3(graph, companionId);
1052
1060
  const parentNode = useNode3(graph, activeId);
1053
- const data = useMemo8(() => {
1061
+ const data = useMemo9(() => {
1054
1062
  return node && {
1055
1063
  attendableId: companionId,
1056
1064
  subject: node.data,
@@ -1066,40 +1074,30 @@ var Drawer = () => {
1066
1074
  ]);
1067
1075
  const { actions, onAction } = useDrawerActions(DRAWER_NAME);
1068
1076
  const menu = useMenuActions3(actions);
1069
- return /* @__PURE__ */ React11.createElement(Layout3.Main, {
1070
- toolbar: true
1071
- }, /* @__PURE__ */ React11.createElement(MenuProvider3, {
1077
+ return /* @__PURE__ */ React10.createElement(Panel3.Root, null, /* @__PURE__ */ React10.createElement(Panel3.Toolbar, null, /* @__PURE__ */ React10.createElement(Menu3.Root, {
1072
1078
  ...menu,
1073
- onAction,
1074
- alwaysActive: true
1075
- }, /* @__PURE__ */ React11.createElement(ToolbarMenu2, {
1079
+ alwaysActive: true,
1080
+ onAction
1081
+ }, /* @__PURE__ */ React10.createElement(Menu3.Toolbar, {
1076
1082
  density: "coarse"
1077
- })), /* @__PURE__ */ React11.createElement(Surface4.Surface, {
1083
+ }))), /* @__PURE__ */ React10.createElement(Panel3.Content, {
1084
+ asChild: true
1085
+ }, /* @__PURE__ */ React10.createElement(Surface4.Surface, {
1078
1086
  role: "article",
1079
1087
  data,
1080
1088
  limit: 1,
1081
- fallback: ContentError,
1089
+ fallback: ErrorFallback3,
1082
1090
  placeholder
1083
- }));
1091
+ })));
1084
1092
  };
1085
1093
  Drawer.displayName = DRAWER_NAME;
1086
- var parseEntryId = (entryId) => {
1087
- const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR2);
1088
- return {
1089
- id,
1090
- variant
1091
- };
1092
- };
1093
1094
  var useSelectedCompanion = (companions, preferredVariant) => {
1094
- const selectedCompanion = useMemo8(() => {
1095
+ const selectedCompanion = useMemo9(() => {
1095
1096
  if (companions.length === 0) {
1096
1097
  return void 0;
1097
1098
  }
1098
1099
  if (preferredVariant) {
1099
- const preferred = companions.find((c) => {
1100
- const { variant: variant2 } = parseEntryId(c.id);
1101
- return variant2 === preferredVariant;
1102
- });
1100
+ const preferred = companions.find((c) => getCompanionVariant2(c.id) === preferredVariant);
1103
1101
  if (preferred) {
1104
1102
  return preferred;
1105
1103
  }
@@ -1110,7 +1108,7 @@ var useSelectedCompanion = (companions, preferredVariant) => {
1110
1108
  preferredVariant
1111
1109
  ]);
1112
1110
  const companionId = selectedCompanion?.id;
1113
- const { variant } = parseEntryId(companionId ?? "");
1111
+ const variant = companionId ? getCompanionVariant2(companionId) : void 0;
1114
1112
  return {
1115
1113
  selectedCompanion,
1116
1114
  companionId,
@@ -1136,30 +1134,30 @@ var SimpleLayout = () => {
1136
1134
  state.drawerState,
1137
1135
  keyboardOpen
1138
1136
  ]);
1139
- return /* @__PURE__ */ React12.createElement(Mosaic3.Root, {
1137
+ return /* @__PURE__ */ React11.createElement(Mosaic3.Root, {
1140
1138
  classNames: "contents"
1141
- }, /* @__PURE__ */ React12.createElement(MobileLayout.Root, {
1142
- classNames: "bg-toolbarSurface",
1139
+ }, /* @__PURE__ */ React11.createElement(MobileLayout.Root, {
1140
+ classNames: "bg-toolbar-surface",
1143
1141
  onKeyboardOpenChange: (keyboardOpen2) => setKeyboardOpen(keyboardOpen2)
1144
- }, /* @__PURE__ */ React12.createElement(MobileLayout.Panel, {
1142
+ }, /* @__PURE__ */ React11.createElement(MobileLayout.Panel, {
1145
1143
  safe: {
1146
1144
  top: true,
1147
1145
  bottom: splitterMode === "upper"
1148
1146
  }
1149
- }, /* @__PURE__ */ React12.createElement(PopoverRoot, null, /* @__PURE__ */ React12.createElement(Splitter.Root, {
1147
+ }, /* @__PURE__ */ React11.createElement(PopoverRoot, null, /* @__PURE__ */ React11.createElement(Splitter.Root, {
1150
1148
  mode: splitterMode,
1151
1149
  ratio: 0.55
1152
- }, /* @__PURE__ */ React12.createElement(Splitter.Panel, {
1150
+ }, /* @__PURE__ */ React11.createElement(Splitter.Panel, {
1153
1151
  position: "upper"
1154
- }, /* @__PURE__ */ React12.createElement(Main, null)), /* @__PURE__ */ React12.createElement(Splitter.Panel, {
1152
+ }, /* @__PURE__ */ React11.createElement(Main, null)), /* @__PURE__ */ React11.createElement(Splitter.Panel, {
1155
1153
  position: "lower",
1156
1154
  ref: drawerRef
1157
- }, /* @__PURE__ */ React12.createElement(Drawer, null))), /* @__PURE__ */ React12.createElement(Dialog, null), /* @__PURE__ */ React12.createElement(PopoverContent, null)))));
1155
+ }, /* @__PURE__ */ React11.createElement(Drawer, null))), /* @__PURE__ */ React11.createElement(Dialog, null), /* @__PURE__ */ React11.createElement(PopoverContent, null)))));
1158
1156
  };
1159
1157
 
1160
1158
  export {
1161
1159
  Home,
1162
1160
  SimpleLayout,
1163
- Workspace
1161
+ NavBranch
1164
1162
  };
1165
- //# sourceMappingURL=chunk-O3BQBYMW.mjs.map
1163
+ //# sourceMappingURL=chunk-MDPEKLKR.mjs.map