@dxos/plugin-space 0.7.5-main.9d2a38b → 0.7.5-main.ff8607b

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 (171) hide show
  1. package/dist/lib/browser/{app-graph-builder-F6XSETHX.mjs → app-graph-builder-J4NX44Y4.mjs} +10 -8
  2. package/dist/lib/browser/{app-graph-builder-F6XSETHX.mjs.map → app-graph-builder-J4NX44Y4.mjs.map} +3 -3
  3. package/dist/lib/browser/{app-graph-serializer-FYJE23GN.mjs → app-graph-serializer-QF7VVRCV.mjs} +5 -5
  4. package/dist/lib/browser/{chunk-IZ7QKQ2E.mjs → chunk-6UIFMVVI.mjs} +14 -9
  5. package/dist/lib/browser/chunk-6UIFMVVI.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-SOXNANA6.mjs → chunk-PQXZCNAU.mjs} +3 -2
  7. package/dist/lib/browser/{chunk-SOXNANA6.mjs.map → chunk-PQXZCNAU.mjs.map} +3 -3
  8. package/dist/lib/browser/{chunk-UH5P4UL3.mjs → chunk-RLZQJD47.mjs} +3 -2
  9. package/dist/lib/browser/chunk-RLZQJD47.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-T36CIHPG.mjs → chunk-SDK7RZI3.mjs} +3 -3
  11. package/dist/lib/browser/{chunk-SSJ772GK.mjs → chunk-XPZ6IIXF.mjs} +4 -5
  12. package/dist/lib/browser/chunk-XPZ6IIXF.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-XXD33C4E.mjs → chunk-XZ2NH3CP.mjs} +291 -250
  14. package/dist/lib/browser/chunk-XZ2NH3CP.mjs.map +7 -0
  15. package/dist/lib/browser/{identity-created-4Q4PFIC5.mjs → identity-created-25TK5XNO.mjs} +3 -3
  16. package/dist/lib/browser/index.mjs +11 -11
  17. package/dist/lib/browser/index.mjs.map +3 -3
  18. package/dist/lib/browser/intent-resolver-IEDVV74T.mjs +523 -0
  19. package/dist/lib/browser/intent-resolver-IEDVV74T.mjs.map +7 -0
  20. package/dist/lib/browser/meta.json +1 -1
  21. package/dist/lib/browser/{react-root-BDOPFJGJ.mjs → react-root-6VRPRLQR.mjs} +6 -6
  22. package/dist/lib/browser/{react-surface-EGOL2JBL.mjs → react-surface-DMNDXLZ7.mjs} +26 -33
  23. package/dist/lib/browser/react-surface-DMNDXLZ7.mjs.map +7 -0
  24. package/dist/lib/browser/{settings-WF67QZSD.mjs → settings-K4JPYYEM.mjs} +3 -3
  25. package/dist/lib/browser/{spaces-ready-WVU7US3C.mjs → spaces-ready-2MUWWVVO.mjs} +31 -32
  26. package/dist/lib/browser/spaces-ready-2MUWWVVO.mjs.map +7 -0
  27. package/dist/lib/browser/{state-MS4KYJWI.mjs → state-6DCY5YJP.mjs} +3 -3
  28. package/dist/lib/browser/types/index.mjs +2 -2
  29. package/dist/lib/node/{app-graph-builder-GKLVZ4PM.cjs → app-graph-builder-ZOPG4MOS.cjs} +58 -56
  30. package/dist/lib/node/{app-graph-builder-GKLVZ4PM.cjs.map → app-graph-builder-ZOPG4MOS.cjs.map} +3 -3
  31. package/dist/lib/node/{app-graph-serializer-RMTU5YSC.cjs → app-graph-serializer-QE2G4MWB.cjs} +21 -21
  32. package/dist/lib/node/{chunk-5D4RWKTV.cjs → chunk-3QWZCN6L.cjs} +65 -60
  33. package/dist/lib/node/chunk-3QWZCN6L.cjs.map +7 -0
  34. package/dist/lib/node/{chunk-YCBBGTFD.cjs → chunk-6MEOP3DH.cjs} +8 -9
  35. package/dist/lib/node/chunk-6MEOP3DH.cjs.map +7 -0
  36. package/dist/lib/node/{chunk-UENH2YBM.cjs → chunk-D6BFKOXY.cjs} +8 -8
  37. package/dist/lib/node/{chunk-AJRP7AD6.cjs → chunk-SZEIQGQU.cjs} +292 -251
  38. package/dist/lib/node/chunk-SZEIQGQU.cjs.map +7 -0
  39. package/dist/lib/node/{chunk-56NGXG2A.cjs → chunk-UX3U4RU2.cjs} +9 -8
  40. package/dist/lib/node/chunk-UX3U4RU2.cjs.map +7 -0
  41. package/dist/lib/node/{chunk-AO4EW2RX.cjs → chunk-WZR6OAN3.cjs} +6 -5
  42. package/dist/lib/node/{chunk-AO4EW2RX.cjs.map → chunk-WZR6OAN3.cjs.map} +3 -3
  43. package/dist/lib/node/{identity-created-QQWX7WX3.cjs → identity-created-7G5U7R36.cjs} +7 -7
  44. package/dist/lib/node/index.cjs +90 -90
  45. package/dist/lib/node/index.cjs.map +3 -3
  46. package/dist/lib/node/intent-resolver-N2W2L6OL.cjs +522 -0
  47. package/dist/lib/node/intent-resolver-N2W2L6OL.cjs.map +7 -0
  48. package/dist/lib/node/meta.json +1 -1
  49. package/dist/lib/node/{react-root-ZTR2J2I3.cjs → react-root-YD35W3VU.cjs} +12 -12
  50. package/dist/lib/node/{react-surface-75KRPQYT.cjs → react-surface-QPLXK7DT.cjs} +72 -76
  51. package/dist/lib/node/react-surface-QPLXK7DT.cjs.map +7 -0
  52. package/dist/lib/node/{settings-KOVSPA3S.cjs → settings-TEELGWS4.cjs} +8 -8
  53. package/dist/lib/node/{spaces-ready-ILVGUHJH.cjs → spaces-ready-PZZQWS6T.cjs} +39 -40
  54. package/dist/lib/node/spaces-ready-PZZQWS6T.cjs.map +7 -0
  55. package/dist/lib/node/{state-4UIOUKLJ.cjs → state-WPZC4JXB.cjs} +8 -8
  56. package/dist/lib/node/types/index.cjs +16 -16
  57. package/dist/lib/node/types/index.cjs.map +1 -1
  58. package/dist/lib/node-esm/{app-graph-builder-NEHQ5Z63.mjs → app-graph-builder-TKGLOK22.mjs} +10 -8
  59. package/dist/lib/node-esm/{app-graph-builder-NEHQ5Z63.mjs.map → app-graph-builder-TKGLOK22.mjs.map} +3 -3
  60. package/dist/lib/node-esm/{app-graph-serializer-UWWS5OVC.mjs → app-graph-serializer-HLX2JRNF.mjs} +5 -5
  61. package/dist/lib/node-esm/{chunk-E5DWIQ3N.mjs → chunk-4UX5WGKJ.mjs} +3 -3
  62. package/dist/lib/node-esm/{chunk-HTBGWQEU.mjs → chunk-AAQRELDK.mjs} +4 -5
  63. package/dist/lib/node-esm/chunk-AAQRELDK.mjs.map +7 -0
  64. package/dist/lib/node-esm/{chunk-7FUVU45N.mjs → chunk-ICCM4YRJ.mjs} +3 -2
  65. package/dist/lib/node-esm/{chunk-7FUVU45N.mjs.map → chunk-ICCM4YRJ.mjs.map} +3 -3
  66. package/dist/lib/node-esm/{chunk-5QMAPAZD.mjs → chunk-LA45TPAN.mjs} +14 -9
  67. package/dist/lib/node-esm/chunk-LA45TPAN.mjs.map +7 -0
  68. package/dist/lib/node-esm/{chunk-375RB3CZ.mjs → chunk-LGL4A5B5.mjs} +3 -2
  69. package/dist/lib/node-esm/chunk-LGL4A5B5.mjs.map +7 -0
  70. package/dist/lib/node-esm/{chunk-GVOPDPS2.mjs → chunk-N6EAOMIS.mjs} +291 -250
  71. package/dist/lib/node-esm/chunk-N6EAOMIS.mjs.map +7 -0
  72. package/dist/lib/node-esm/{identity-created-HMNY2MPB.mjs → identity-created-7THGZ7EW.mjs} +3 -3
  73. package/dist/lib/node-esm/index.mjs +11 -11
  74. package/dist/lib/node-esm/index.mjs.map +3 -3
  75. package/dist/lib/node-esm/intent-resolver-L2TKJU4I.mjs +524 -0
  76. package/dist/lib/node-esm/intent-resolver-L2TKJU4I.mjs.map +7 -0
  77. package/dist/lib/node-esm/meta.json +1 -1
  78. package/dist/lib/node-esm/{react-root-OUPJA4RY.mjs → react-root-Q5MFDXZE.mjs} +6 -6
  79. package/dist/lib/node-esm/{react-surface-7EVWCKIP.mjs → react-surface-RQQZ5BOG.mjs} +26 -33
  80. package/dist/lib/node-esm/react-surface-RQQZ5BOG.mjs.map +7 -0
  81. package/dist/lib/node-esm/{settings-EDK6WI3V.mjs → settings-KXYUZBLN.mjs} +3 -3
  82. package/dist/lib/node-esm/{spaces-ready-CH3W7OGN.mjs → spaces-ready-MWNP3WBX.mjs} +31 -32
  83. package/dist/lib/node-esm/spaces-ready-MWNP3WBX.mjs.map +7 -0
  84. package/dist/lib/node-esm/{state-BMISGQ2O.mjs → state-5GH2D5U4.mjs} +3 -3
  85. package/dist/lib/node-esm/types/index.mjs +2 -2
  86. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/app-graph-builder.d.ts +22 -22
  88. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/capabilities.d.ts +6 -0
  90. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/index.d.ts +33 -33
  92. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  93. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  94. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  95. package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
  96. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +4 -3
  97. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  98. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
  99. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  100. package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
  101. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -1
  102. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
  103. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
  104. package/dist/types/src/meta.d.ts +1 -0
  105. package/dist/types/src/meta.d.ts.map +1 -1
  106. package/dist/types/src/types/types.d.ts +2 -2
  107. package/dist/types/src/types/types.d.ts.map +1 -1
  108. package/dist/types/src/util.d.ts.map +1 -1
  109. package/package.json +38 -37
  110. package/src/SpacePlugin.tsx +4 -5
  111. package/src/capabilities/app-graph-builder.ts +4 -2
  112. package/src/capabilities/capabilities.ts +4 -1
  113. package/src/capabilities/intent-resolver.ts +373 -304
  114. package/src/capabilities/react-surface.tsx +22 -30
  115. package/src/capabilities/spaces-ready.ts +20 -21
  116. package/src/components/AwaitingObject.tsx +5 -5
  117. package/src/components/CreateDialog/CreateObjectDialog.tsx +15 -15
  118. package/src/components/CreateDialog/CreateObjectPanel.tsx +114 -114
  119. package/src/components/CreateDialog/CreateSpaceDialog.tsx +10 -8
  120. package/src/components/JoinDialog.tsx +27 -19
  121. package/src/components/SpacePluginSettings.tsx +3 -3
  122. package/src/components/SpacePresence.tsx +2 -3
  123. package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +16 -1
  124. package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +3 -4
  125. package/src/components/SyncStatus/InlineSyncStatus.tsx +2 -2
  126. package/src/components/SyncStatus/SyncStatus.tsx +2 -1
  127. package/src/meta.ts +1 -0
  128. package/src/types/types.ts +2 -3
  129. package/src/util.tsx +8 -4
  130. package/dist/lib/browser/chunk-IZ7QKQ2E.mjs.map +0 -7
  131. package/dist/lib/browser/chunk-SSJ772GK.mjs.map +0 -7
  132. package/dist/lib/browser/chunk-UH5P4UL3.mjs.map +0 -7
  133. package/dist/lib/browser/chunk-XXD33C4E.mjs.map +0 -7
  134. package/dist/lib/browser/intent-resolver-XRZYCXXX.mjs +0 -459
  135. package/dist/lib/browser/intent-resolver-XRZYCXXX.mjs.map +0 -7
  136. package/dist/lib/browser/react-surface-EGOL2JBL.mjs.map +0 -7
  137. package/dist/lib/browser/spaces-ready-WVU7US3C.mjs.map +0 -7
  138. package/dist/lib/node/chunk-56NGXG2A.cjs.map +0 -7
  139. package/dist/lib/node/chunk-5D4RWKTV.cjs.map +0 -7
  140. package/dist/lib/node/chunk-AJRP7AD6.cjs.map +0 -7
  141. package/dist/lib/node/chunk-YCBBGTFD.cjs.map +0 -7
  142. package/dist/lib/node/intent-resolver-3NI6AUAI.cjs +0 -458
  143. package/dist/lib/node/intent-resolver-3NI6AUAI.cjs.map +0 -7
  144. package/dist/lib/node/react-surface-75KRPQYT.cjs.map +0 -7
  145. package/dist/lib/node/spaces-ready-ILVGUHJH.cjs.map +0 -7
  146. package/dist/lib/node-esm/chunk-375RB3CZ.mjs.map +0 -7
  147. package/dist/lib/node-esm/chunk-5QMAPAZD.mjs.map +0 -7
  148. package/dist/lib/node-esm/chunk-GVOPDPS2.mjs.map +0 -7
  149. package/dist/lib/node-esm/chunk-HTBGWQEU.mjs.map +0 -7
  150. package/dist/lib/node-esm/intent-resolver-P5EVBOGP.mjs +0 -460
  151. package/dist/lib/node-esm/intent-resolver-P5EVBOGP.mjs.map +0 -7
  152. package/dist/lib/node-esm/react-surface-7EVWCKIP.mjs.map +0 -7
  153. package/dist/lib/node-esm/spaces-ready-CH3W7OGN.mjs.map +0 -7
  154. /package/dist/lib/browser/{app-graph-serializer-FYJE23GN.mjs.map → app-graph-serializer-QF7VVRCV.mjs.map} +0 -0
  155. /package/dist/lib/browser/{chunk-T36CIHPG.mjs.map → chunk-SDK7RZI3.mjs.map} +0 -0
  156. /package/dist/lib/browser/{identity-created-4Q4PFIC5.mjs.map → identity-created-25TK5XNO.mjs.map} +0 -0
  157. /package/dist/lib/browser/{react-root-BDOPFJGJ.mjs.map → react-root-6VRPRLQR.mjs.map} +0 -0
  158. /package/dist/lib/browser/{settings-WF67QZSD.mjs.map → settings-K4JPYYEM.mjs.map} +0 -0
  159. /package/dist/lib/browser/{state-MS4KYJWI.mjs.map → state-6DCY5YJP.mjs.map} +0 -0
  160. /package/dist/lib/node/{app-graph-serializer-RMTU5YSC.cjs.map → app-graph-serializer-QE2G4MWB.cjs.map} +0 -0
  161. /package/dist/lib/node/{chunk-UENH2YBM.cjs.map → chunk-D6BFKOXY.cjs.map} +0 -0
  162. /package/dist/lib/node/{identity-created-QQWX7WX3.cjs.map → identity-created-7G5U7R36.cjs.map} +0 -0
  163. /package/dist/lib/node/{react-root-ZTR2J2I3.cjs.map → react-root-YD35W3VU.cjs.map} +0 -0
  164. /package/dist/lib/node/{settings-KOVSPA3S.cjs.map → settings-TEELGWS4.cjs.map} +0 -0
  165. /package/dist/lib/node/{state-4UIOUKLJ.cjs.map → state-WPZC4JXB.cjs.map} +0 -0
  166. /package/dist/lib/node-esm/{app-graph-serializer-UWWS5OVC.mjs.map → app-graph-serializer-HLX2JRNF.mjs.map} +0 -0
  167. /package/dist/lib/node-esm/{chunk-E5DWIQ3N.mjs.map → chunk-4UX5WGKJ.mjs.map} +0 -0
  168. /package/dist/lib/node-esm/{identity-created-HMNY2MPB.mjs.map → identity-created-7THGZ7EW.mjs.map} +0 -0
  169. /package/dist/lib/node-esm/{react-root-OUPJA4RY.mjs.map → react-root-Q5MFDXZE.mjs.map} +0 -0
  170. /package/dist/lib/node-esm/{settings-EDK6WI3V.mjs.map → settings-KXYUZBLN.mjs.map} +0 -0
  171. /package/dist/lib/node-esm/{state-BMISGQ2O.mjs.map → state-5GH2D5U4.mjs.map} +0 -0
@@ -1,19 +1,19 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  SpaceCapabilities
4
- } from "./chunk-375RB3CZ.mjs";
4
+ } from "./chunk-LGL4A5B5.mjs";
5
5
  import {
6
6
  COMPOSER_SPACE_LOCK,
7
7
  getSpaceDisplayName
8
- } from "./chunk-5QMAPAZD.mjs";
8
+ } from "./chunk-LA45TPAN.mjs";
9
9
  import {
10
10
  CollectionType,
11
11
  SpaceAction,
12
12
  SpaceForm
13
- } from "./chunk-HTBGWQEU.mjs";
13
+ } from "./chunk-AAQRELDK.mjs";
14
14
  import {
15
15
  SPACE_PLUGIN
16
- } from "./chunk-7FUVU45N.mjs";
16
+ } from "./chunk-ICCM4YRJ.mjs";
17
17
 
18
18
  // packages/plugins/plugin-space/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx
19
19
  import React2, { useCallback as useCallback2, useState } from "react";
@@ -112,7 +112,7 @@ var AdvancedObjectSettings = ({ object }) => {
112
112
  // packages/plugins/plugin-space/src/components/AwaitingObject.tsx
113
113
  import { CheckCircle, CircleDashed, CircleNotch } from "@phosphor-icons/react";
114
114
  import React3, { useCallback as useCallback3, useEffect, useState as useState2 } from "react";
115
- import { NavigationAction, useIntentDispatcher, createIntent, useCapability, Capabilities } from "@dxos/app-framework";
115
+ import { createIntent, LayoutAction, useIntentDispatcher, useLayout } from "@dxos/app-framework";
116
116
  import { useClient } from "@dxos/react-client";
117
117
  import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
118
118
  import { Button, Toast, useTranslation as useTranslation3 } from "@dxos/react-ui";
@@ -125,7 +125,7 @@ var AwaitingObject = ({ id }) => {
125
125
  const [found, setFound] = useState2(false);
126
126
  const { t } = useTranslation3(SPACE_PLUGIN);
127
127
  const { dispatchPromise: dispatch } = useIntentDispatcher();
128
- const location = useCapability(Capabilities.Location);
128
+ const layout = useLayout();
129
129
  const client = useClient();
130
130
  const objects = useQuery(client.spaces, Filter.all());
131
131
  useEffect(() => {
@@ -142,14 +142,14 @@ var AwaitingObject = ({ id }) => {
142
142
  useEffect(() => {
143
143
  if (objects.findIndex((object) => fullyQualifiedId(object) === id) > -1) {
144
144
  setFound(true);
145
- if (location.active.solo?.[0].id === id) {
145
+ if (layout.active.includes(id)) {
146
146
  setOpen(false);
147
147
  }
148
148
  }
149
149
  }, [
150
150
  id,
151
151
  objects,
152
- location
152
+ layout
153
153
  ]);
154
154
  const handleClose = useCallback3(async () => dispatch(createIntent(SpaceAction.WaitForObject, {
155
155
  id: void 0
@@ -157,12 +157,11 @@ var AwaitingObject = ({ id }) => {
157
157
  dispatch
158
158
  ]);
159
159
  const handleNavigate = useCallback3(() => {
160
- void dispatch(createIntent(NavigationAction.Open, {
161
- activeParts: {
162
- main: [
163
- id
164
- ]
165
- }
160
+ void dispatch(createIntent(LayoutAction.Open, {
161
+ part: "main",
162
+ subject: [
163
+ id
164
+ ]
166
165
  }));
167
166
  void handleClose();
168
167
  }, [
@@ -223,19 +222,19 @@ var BaseObjectSettings = ({ object }) => {
223
222
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
224
223
  import { pipe } from "effect";
225
224
  import React6, { useCallback as useCallback5, useRef } from "react";
226
- import { chain, createIntent as createIntent2, NavigationAction as NavigationAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
225
+ import { chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
227
226
  import { useClient as useClient2 } from "@dxos/react-client";
228
- import { getSpace, isReactiveObject, isSpace as isSpace2, useSpaces } from "@dxos/react-client/echo";
227
+ import { getSpace, isReactiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
229
228
  import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation6 } from "@dxos/react-ui";
230
229
 
231
230
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
232
231
  import React5, { useCallback as useCallback4, useMemo, useState as useState3 } from "react";
233
232
  import { Surface, isSurfaceAvailable, usePluginManager } from "@dxos/app-framework";
234
233
  import { getObjectAnnotation, S } from "@dxos/echo-schema";
235
- import { isSpace } from "@dxos/react-client/echo";
236
- import { Icon, IconButton as IconButton3, Input as Input2, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
237
- import { Form as Form2, InputHeader } from "@dxos/react-ui-form";
234
+ import { Icon, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
235
+ import { Form as Form2 } from "@dxos/react-ui-form";
238
236
  import { SearchList } from "@dxos/react-ui-searchlist";
237
+ import { mx as mx2 } from "@dxos/react-ui-theme";
239
238
  import { nonNullable } from "@dxos/util";
240
239
  var useInputSurfaceLookup = (baseData) => {
241
240
  const pluginManager = usePluginManager();
@@ -261,14 +260,22 @@ var useInputSurfaceLookup = (baseData) => {
261
260
  baseData
262
261
  ]);
263
262
  };
264
- var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
263
+ var CreateObjectPanel = ({ classNames, schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
265
264
  const { t } = useTranslation5(SPACE_PLUGIN);
266
265
  const [typename, setTypename] = useState3(initialTypename);
267
266
  const [target, setTarget] = useState3(initialTarget);
268
267
  const schema = schemas.find((schema2) => getObjectAnnotation(schema2)?.typename === typename);
269
- const options = schemas.map(getObjectAnnotation).filter(nonNullable);
270
- const handleClearSchema = useCallback4(() => setTypename(void 0), []);
271
- const handleClearTarget = useCallback4(() => setTarget(void 0), []);
268
+ const options = schemas.map(getObjectAnnotation).filter(nonNullable).sort((a, b) => {
269
+ const nameA = t("typename label", {
270
+ ns: a.typename,
271
+ defaultValue: a.typename
272
+ });
273
+ const nameB = t("typename label", {
274
+ ns: b.typename,
275
+ defaultValue: b.typename
276
+ });
277
+ return nameA.localeCompare(nameB);
278
+ });
272
279
  const handleCreateObject = useCallback4(async (props) => {
273
280
  if (!schema || !target) {
274
281
  return;
@@ -292,55 +299,6 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
292
299
  resolve,
293
300
  typename
294
301
  ]);
295
- const schemaInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
296
- label: t("schema input label"),
297
- classNames: "flex flex-col grow overflow-hidden"
298
- }, /* @__PURE__ */ React5.createElement(SearchList.Input, {
299
- autoFocus: true,
300
- "data-testid": "create-object-form.schema-input",
301
- placeholder: t("schema input placeholder"),
302
- classNames: "px-1 my-2"
303
- }), /* @__PURE__ */ React5.createElement(SearchList.Content, {
304
- classNames: "max-bs-[24rem] overflow-auto"
305
- }, options.map((option) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
306
- key: option.typename,
307
- value: t("typename label", {
308
- ns: option.typename,
309
- defaultValue: option.typename
310
- }),
311
- onSelect: () => setTypename(option.typename),
312
- classNames: "flex items-center gap-2"
313
- }, /* @__PURE__ */ React5.createElement("span", {
314
- className: "flex gap-2 items-center grow truncate"
315
- }, /* @__PURE__ */ React5.createElement(Icon, {
316
- icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
317
- size: 5
318
- }), t("typename label", {
319
- ns: option.typename,
320
- defaultValue: option.typename
321
- }))))));
322
- const spaceInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
323
- label: t("space input label"),
324
- classNames: "flex flex-col grow overflow-hidden"
325
- }, /* @__PURE__ */ React5.createElement(SearchList.Input, {
326
- autoFocus: true,
327
- "data-testid": "create-object-form.space-input",
328
- placeholder: t("space input placeholder"),
329
- classNames: "px-1 my-2"
330
- }), /* @__PURE__ */ React5.createElement(SearchList.Content, {
331
- classNames: "max-bs-[24rem] overflow-auto"
332
- }, spaces.map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
333
- key: space.id,
334
- value: toLocalizedString(getSpaceDisplayName(space, {
335
- personal: space.id === defaultSpaceId
336
- }), t),
337
- onSelect: () => setTarget(space),
338
- classNames: "flex items-center gap-2"
339
- }, /* @__PURE__ */ React5.createElement("span", {
340
- className: "grow truncate"
341
- }, toLocalizedString(getSpaceDisplayName(space, {
342
- personal: space.id === defaultSpaceId
343
- }), t))))));
344
302
  const inputSurfaceLookup = useInputSurfaceLookup({
345
303
  target
346
304
  });
@@ -349,6 +307,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
349
307
  name: S.optional(S.String)
350
308
  });
351
309
  return /* @__PURE__ */ React5.createElement(Form2, {
310
+ classNames: "!p-0",
352
311
  autoFocus: true,
353
312
  values: {
354
313
  name: initialName
@@ -365,39 +324,79 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
365
324
  ]);
366
325
  return /* @__PURE__ */ React5.createElement("div", {
367
326
  role: "form",
368
- className: "flex flex-col gap-2"
369
- }, target && /* @__PURE__ */ React5.createElement("div", {
370
- role: "none"
371
- }, /* @__PURE__ */ React5.createElement(Input2.Root, null, /* @__PURE__ */ React5.createElement(InputHeader, null, /* @__PURE__ */ React5.createElement(Input2.Label, null, t(isSpace(target) ? "creating in space label" : "creating in collection label"))), /* @__PURE__ */ React5.createElement("div", {
372
- role: "none",
373
- className: "flex gap-2"
374
- }, /* @__PURE__ */ React5.createElement(Input2.TextInput, {
375
- disabled: true,
376
- value: isSpace(target) ? toLocalizedString(getSpaceDisplayName(target, {
377
- personal: target.id === defaultSpaceId
378
- }), t) : target.name || t("unnamed collection label")
379
- }), /* @__PURE__ */ React5.createElement(IconButton3, {
380
- iconOnly: true,
381
- icon: "ph--x--regular",
382
- label: t("clear input label"),
383
- onClick: handleClearTarget
384
- })))), schema && /* @__PURE__ */ React5.createElement("div", {
385
- role: "none"
386
- }, /* @__PURE__ */ React5.createElement(Input2.Root, null, /* @__PURE__ */ React5.createElement(InputHeader, null, /* @__PURE__ */ React5.createElement(Input2.Label, null, t("creating object type label"))), /* @__PURE__ */ React5.createElement("div", {
387
- role: "none",
388
- className: "flex gap-2"
389
- }, /* @__PURE__ */ React5.createElement(Input2.TextInput, {
390
- disabled: true,
327
+ className: mx2("flex flex-col gap-2", classNames)
328
+ }, !schema ? /* @__PURE__ */ React5.createElement(SelectSchema, {
329
+ options,
330
+ resolve,
331
+ onChange: setTypename
332
+ }) : !target ? /* @__PURE__ */ React5.createElement(SelectSpace, {
333
+ spaces,
334
+ defaultSpaceId,
335
+ onChange: setTarget
336
+ }) : form);
337
+ };
338
+ var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
339
+ const { t } = useTranslation5(SPACE_PLUGIN);
340
+ return /* @__PURE__ */ React5.createElement(SearchList.Root, {
341
+ label: t("space input label"),
342
+ classNames: "flex flex-col grow overflow-hidden"
343
+ }, /* @__PURE__ */ React5.createElement(SearchList.Input, {
344
+ autoFocus: true,
345
+ "data-testid": "create-object-form.space-input",
346
+ placeholder: t("space input placeholder"),
347
+ classNames: "px-1 my-2"
348
+ }), /* @__PURE__ */ React5.createElement(SearchList.Content, {
349
+ classNames: "max-bs-[24rem] overflow-auto"
350
+ }, spaces.sort((a, b) => {
351
+ const aName = toLocalizedString(getSpaceDisplayName(a, {
352
+ personal: a.id === defaultSpaceId
353
+ }), t);
354
+ const bName = toLocalizedString(getSpaceDisplayName(b, {
355
+ personal: b.id === defaultSpaceId
356
+ }), t);
357
+ return aName.localeCompare(bName);
358
+ }).map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
359
+ key: space.id,
360
+ value: toLocalizedString(getSpaceDisplayName(space, {
361
+ personal: space.id === defaultSpaceId
362
+ }), t),
363
+ onSelect: () => onChange(space),
364
+ classNames: "flex items-center gap-2"
365
+ }, /* @__PURE__ */ React5.createElement("span", {
366
+ className: "grow truncate"
367
+ }, toLocalizedString(getSpaceDisplayName(space, {
368
+ personal: space.id === defaultSpaceId
369
+ }), t))))));
370
+ };
371
+ var SelectSchema = ({ options, resolve, onChange }) => {
372
+ const { t } = useTranslation5(SPACE_PLUGIN);
373
+ return /* @__PURE__ */ React5.createElement(SearchList.Root, {
374
+ label: t("schema input label"),
375
+ classNames: "flex flex-col grow overflow-hidden"
376
+ }, /* @__PURE__ */ React5.createElement(SearchList.Input, {
377
+ autoFocus: true,
378
+ "data-testid": "create-object-form.schema-input",
379
+ placeholder: t("schema input placeholder"),
380
+ classNames: "px-1 my-2"
381
+ }), /* @__PURE__ */ React5.createElement(SearchList.Content, {
382
+ classNames: "max-bs-[24rem] overflow-auto"
383
+ }, options.map((option) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
384
+ key: option.typename,
391
385
  value: t("typename label", {
392
- ns: schema.typename,
393
- defaultValue: schema.typename
394
- })
395
- }), /* @__PURE__ */ React5.createElement(IconButton3, {
396
- iconOnly: true,
397
- icon: "ph--x--regular",
398
- label: t("clear input label"),
399
- onClick: handleClearSchema
400
- })))), !schema ? schemaInput : !target ? spaceInput : form);
386
+ ns: option.typename,
387
+ defaultValue: option.typename
388
+ }),
389
+ onSelect: () => onChange(option.typename),
390
+ classNames: "flex items-center gap-2"
391
+ }, /* @__PURE__ */ React5.createElement("span", {
392
+ className: "flex gap-2 items-center grow truncate"
393
+ }, /* @__PURE__ */ React5.createElement(Icon, {
394
+ icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
395
+ size: 5
396
+ }), t("typename label", {
397
+ ns: option.typename,
398
+ defaultValue: option.typename
399
+ }))))));
401
400
  };
402
401
 
403
402
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
@@ -409,13 +408,13 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
409
408
  const spaces = useSpaces();
410
409
  const { dispatchPromise: dispatch } = useIntentDispatcher2();
411
410
  const handleCreateObject = useCallback5(async ({ schema, target: _target, data }) => {
412
- const target2 = isSpace2(_target) ? _target.properties[CollectionType.typename]?.target : _target;
411
+ const target2 = isSpace(_target) ? _target.properties[CollectionType.typename]?.target : _target;
413
412
  const createObjectIntent = resolve?.(schema.typename)?.createObject;
414
413
  if (!createObjectIntent || !target2) {
415
414
  return;
416
415
  }
417
416
  closeRef.current?.click();
418
- const space = isSpace2(target2) ? target2 : getSpace(target2);
417
+ const space = isSpace(target2) ? target2 : getSpace(target2);
419
418
  const result = await dispatch(createObjectIntent(data, {
420
419
  space
421
420
  }));
@@ -427,7 +426,9 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
427
426
  });
428
427
  const shouldNavigate = _shouldNavigate ?? (() => true);
429
428
  if (shouldNavigate(object)) {
430
- await dispatch(pipe(addObjectIntent, chain(NavigationAction2.Open, {})));
429
+ await dispatch(pipe(addObjectIntent, chain(LayoutAction2.Open, {
430
+ part: "main"
431
+ })));
431
432
  } else {
432
433
  await dispatch(addObjectIntent);
433
434
  }
@@ -440,7 +441,7 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
440
441
  // TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
441
442
  // Consider factoring it out to the tabs package.
442
443
  /* @__PURE__ */ React6.createElement(Dialog.Content, {
443
- classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
444
+ classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
444
445
  }, /* @__PURE__ */ React6.createElement("div", {
445
446
  role: "none",
446
447
  className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
@@ -454,9 +455,8 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
454
455
  }, /* @__PURE__ */ React6.createElement(Icon2, {
455
456
  icon: "ph--x--regular",
456
457
  size: 4
457
- })))), /* @__PURE__ */ React6.createElement("div", {
458
- className: "p-4"
459
- }, /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
458
+ })))), /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
459
+ classNames: "p-4",
460
460
  schemas,
461
461
  spaces,
462
462
  target,
@@ -465,13 +465,14 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
465
465
  defaultSpaceId: client.spaces.default.id,
466
466
  resolve,
467
467
  onCreateObject: handleCreateObject
468
- })))
468
+ }))
469
469
  );
470
470
  };
471
471
 
472
472
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateSpaceDialog.tsx
473
+ import { Effect } from "effect";
473
474
  import React7, { useCallback as useCallback6, useRef as useRef2 } from "react";
474
- import { createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
475
+ import { createIntent as createIntent3, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
475
476
  import { Button as Button3, Dialog as Dialog2, Icon as Icon3, useTranslation as useTranslation7 } from "@dxos/react-ui";
476
477
  import { Form as Form3 } from "@dxos/react-ui-form";
477
478
  var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
@@ -481,15 +482,19 @@ var initialValues2 = {
481
482
  var CreateSpaceDialog = () => {
482
483
  const closeRef = useRef2(null);
483
484
  const { t } = useTranslation7(SPACE_PLUGIN);
484
- const { dispatchPromise: dispatch } = useIntentDispatcher3();
485
+ const { dispatch } = useIntentDispatcher3();
485
486
  const handleCreateSpace = useCallback6(async (data) => {
486
- const result = await dispatch(createIntent3(SpaceAction.Create, data));
487
- const target = result.data?.space;
488
- if (target) {
489
- await dispatch(createIntent3(SpaceAction.OpenCreateObject, {
490
- target
487
+ const program = Effect.gen(function* () {
488
+ const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
489
+ yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
490
+ part: "workspace",
491
+ subject: space.id
491
492
  }));
492
- }
493
+ yield* dispatch(createIntent3(SpaceAction.OpenCreateObject, {
494
+ target: space
495
+ }));
496
+ });
497
+ await Effect.runPromise(program);
493
498
  }, [
494
499
  dispatch
495
500
  ]);
@@ -497,7 +502,7 @@ var CreateSpaceDialog = () => {
497
502
  // TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
498
503
  // Consider factoring it out to the tabs package.
499
504
  /* @__PURE__ */ React7.createElement(Dialog2.Content, {
500
- classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
505
+ classNames: "p-0 bs-content min-bs-[16rem] max-bs-full md:max-is-[32rem] overflow-hidden"
501
506
  }, /* @__PURE__ */ React7.createElement("div", {
502
507
  role: "none",
503
508
  className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
@@ -525,16 +530,16 @@ var CreateSpaceDialog = () => {
525
530
  // packages/plugins/plugin-space/src/components/CollectionMain.tsx
526
531
  import React8 from "react";
527
532
  import { useTranslation as useTranslation8 } from "@dxos/react-ui";
528
- import { baseSurface, descriptionText, mx as mx2 } from "@dxos/react-ui-theme";
533
+ import { baseSurface, descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
529
534
  var CollectionMain = ({ collection }) => {
530
535
  const { t } = useTranslation8(SPACE_PLUGIN);
531
536
  return /* @__PURE__ */ React8.createElement("div", {
532
537
  role: "none",
533
- className: mx2(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
538
+ className: mx3(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
534
539
  "data-testid": "composer.firstRunMessage"
535
540
  }, /* @__PURE__ */ React8.createElement("p", {
536
541
  role: "alert",
537
- className: mx2(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
542
+ className: mx3(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
538
543
  }, collection.name ?? t("unnamed collection label")));
539
544
  };
540
545
 
@@ -552,37 +557,62 @@ var CollectionSection = ({ collection }) => {
552
557
 
553
558
  // packages/plugins/plugin-space/src/components/JoinDialog.tsx
554
559
  import React10, { useCallback as useCallback7 } from "react";
555
- import { createIntent as createIntent4, LayoutAction, NavigationAction as NavigationAction3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
556
- import { useGraph } from "@dxos/plugin-graph";
560
+ import { createIntent as createIntent4, LayoutAction as LayoutAction4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
561
+ import { log } from "@dxos/log";
557
562
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
558
- import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
559
- import { Dialog as Dialog3, useTranslation as useTranslation10 } from "@dxos/react-ui";
563
+ import { useClient as useClient3 } from "@dxos/react-client";
564
+ import { Dialog as Dialog3 } from "@dxos/react-ui";
560
565
  import { JoinPanel } from "@dxos/shell/react";
566
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/JoinDialog.tsx";
561
567
  var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
562
568
  var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
563
- const { t } = useTranslation10(SPACE_PLUGIN);
564
569
  const { dispatchPromise: dispatch } = useIntentDispatcher4();
565
- const spaces = useSpaces2();
566
- const { graph } = useGraph();
570
+ const client = useClient3();
571
+ const { graph } = useAppGraph();
567
572
  const handleDone = useCallback7(async (result) => {
568
573
  if (result?.spaceKey) {
569
574
  await Promise.all([
570
- dispatch(createIntent4(LayoutAction.SetLayout, {
571
- element: "toast",
575
+ dispatch(createIntent4(LayoutAction4.AddToast, {
576
+ part: "toast",
572
577
  subject: {
573
578
  id: `${SPACE_PLUGIN}/join-success`,
574
579
  duration: 5e3,
575
- title: t("join success label"),
576
- closeLabel: t("dismiss label")
580
+ title: [
581
+ "join success label",
582
+ {
583
+ ns: SPACE_PLUGIN
584
+ }
585
+ ],
586
+ closeLabel: [
587
+ "dismiss label",
588
+ {
589
+ ns: SPACE_PLUGIN
590
+ }
591
+ ]
577
592
  }
578
593
  })),
579
- dispatch(createIntent4(LayoutAction.SetLayout, {
580
- element: "dialog",
581
- state: false
594
+ dispatch(createIntent4(LayoutAction4.UpdateDialog, {
595
+ part: "dialog",
596
+ options: {
597
+ state: false
598
+ }
582
599
  }))
583
600
  ]);
584
601
  }
585
- const space = spaces.find(({ key }) => result?.spaceKey?.equals(key));
602
+ const space = result?.spaceKey ? client.spaces.get(result.spaceKey) : void 0;
603
+ if (!space) {
604
+ log.warn("Space not found", result?.spaceKey, {
605
+ F: __dxlog_file,
606
+ L: 56,
607
+ S: void 0,
608
+ C: (f, a) => f(...a)
609
+ });
610
+ return;
611
+ }
612
+ await dispatch(createIntent4(LayoutAction4.SwitchWorkspace, {
613
+ part: "workspace",
614
+ subject: space.id
615
+ }));
586
616
  const target = result?.target || (navigableCollections ? space?.id : void 0);
587
617
  if (target) {
588
618
  await graph.waitForPath({
@@ -590,15 +620,15 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
590
620
  }).catch(() => {
591
621
  });
592
622
  await Promise.all([
593
- dispatch(createIntent4(NavigationAction3.Open, {
594
- activeParts: {
595
- main: [
596
- target
597
- ]
598
- }
623
+ dispatch(createIntent4(LayoutAction4.Open, {
624
+ part: "main",
625
+ subject: [
626
+ target
627
+ ]
599
628
  })),
600
- dispatch(createIntent4(NavigationAction3.Expose, {
601
- id: target
629
+ dispatch(createIntent4(LayoutAction4.Expose, {
630
+ part: "navigation",
631
+ subject: target
602
632
  }))
603
633
  ]);
604
634
  }
@@ -613,7 +643,8 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
613
643
  }
614
644
  }, [
615
645
  dispatch,
616
- spaces
646
+ client,
647
+ graph
617
648
  ]);
618
649
  return /* @__PURE__ */ React10.createElement(Dialog3.Content, null, /* @__PURE__ */ React10.createElement(JoinPanel, {
619
650
  ...props,
@@ -631,11 +662,11 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
631
662
  import { Planet } from "@phosphor-icons/react";
632
663
  import React11 from "react";
633
664
  import { getSpace as getSpace2 } from "@dxos/client/echo";
634
- import { useClient as useClient3 } from "@dxos/react-client";
635
- import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation11 } from "@dxos/react-ui";
665
+ import { useClient as useClient4 } from "@dxos/react-client";
666
+ import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation10 } from "@dxos/react-ui";
636
667
  var MenuFooter = ({ object }) => {
637
- const { t } = useTranslation11(SPACE_PLUGIN);
638
- const client = useClient3();
668
+ const { t } = useTranslation10(SPACE_PLUGIN);
669
+ const client = useClient4();
639
670
  const space = getSpace2(object);
640
671
  const spaceName = space ? getSpaceDisplayName(space, {
641
672
  personal: client.spaces.default === space
@@ -655,8 +686,8 @@ var MenuFooter = ({ object }) => {
655
686
  import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
656
687
  import React12, { useEffect as useEffect2, useState as useState4 } from "react";
657
688
  import { debounce } from "@dxos/async";
658
- import { Tooltip, useTranslation as useTranslation12 } from "@dxos/react-ui";
659
- import { getSize as getSize2, mx as mx3, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
689
+ import { Tooltip, useTranslation as useTranslation11 } from "@dxos/react-ui";
690
+ import { getSize as getSize2, mx as mx4, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
660
691
  var Status;
661
692
  (function(Status2) {
662
693
  Status2[Status2["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
@@ -664,7 +695,7 @@ var Status;
664
695
  Status2[Status2["ERROR"] = 2] = "ERROR";
665
696
  })(Status || (Status = {}));
666
697
  var PersistenceStatus = ({ db }) => {
667
- const { t } = useTranslation12(SPACE_PLUGIN);
698
+ const { t } = useTranslation11(SPACE_PLUGIN);
668
699
  const [displayMessage, setDisplayMessage] = useState4(false);
669
700
  const [status, naturalSetStatus] = useState4(0);
670
701
  const [prevStatus, setPrevStatus] = useState4(0);
@@ -684,17 +715,17 @@ var PersistenceStatus = ({ db }) => {
684
715
  return /* @__PURE__ */ React12.createElement("div", {
685
716
  className: "flex items-center"
686
717
  }, /* @__PURE__ */ React12.createElement(Warning, {
687
- className: mx3(getSize2(4), "me-1")
718
+ className: mx4(getSize2(4), "me-1")
688
719
  }), /* @__PURE__ */ React12.createElement("span", {
689
- className: mx3("text-sm", warningText)
720
+ className: mx4("text-sm", warningText)
690
721
  }, t("persistence error label")));
691
722
  case 1:
692
723
  return /* @__PURE__ */ React12.createElement("div", {
693
724
  className: "flex items-center"
694
725
  }, /* @__PURE__ */ React12.createElement(ArrowsCounterClockwise, {
695
- className: mx3(getSize2(4), "me-1")
726
+ className: mx4(getSize2(4), "me-1")
696
727
  }), /* @__PURE__ */ React12.createElement("span", {
697
- className: mx3("text-sm", staticPlaceholderText)
728
+ className: mx4("text-sm", staticPlaceholderText)
698
729
  }, t("persistence pending label")));
699
730
  case 0:
700
731
  default:
@@ -704,21 +735,21 @@ var PersistenceStatus = ({ db }) => {
704
735
  role: "status",
705
736
  className: "flex items-center"
706
737
  }, /* @__PURE__ */ React12.createElement(CheckCircle2, {
707
- className: mx3(getSize2(4), "me-1")
738
+ className: mx4(getSize2(4), "me-1")
708
739
  }), displayMessage && /* @__PURE__ */ React12.createElement("span", {
709
- className: mx3("text-sm", staticPlaceholderText)
740
+ className: mx4("text-sm", staticPlaceholderText)
710
741
  }, t("persisted locally label"))), /* @__PURE__ */ React12.createElement(Tooltip.Portal, null, /* @__PURE__ */ React12.createElement(Tooltip.Content, null, t("persisted locally message"), /* @__PURE__ */ React12.createElement(Tooltip.Arrow, null))));
711
742
  }
712
743
  };
713
744
 
714
745
  // packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
715
746
  import React13, { useCallback as useCallback8, useRef as useRef3, useState as useState5 } from "react";
716
- import { log } from "@dxos/log";
717
- import { Button as Button4, Input as Input3, Popover, useTranslation as useTranslation13 } from "@dxos/react-ui";
718
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
747
+ import { log as log2 } from "@dxos/log";
748
+ import { Button as Button4, Input as Input2, Popover, useTranslation as useTranslation12 } from "@dxos/react-ui";
749
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
719
750
  var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
720
751
  var PopoverRenameObject = ({ object: obj }) => {
721
- const { t } = useTranslation13(SPACE_PLUGIN);
752
+ const { t } = useTranslation12(SPACE_PLUGIN);
722
753
  const doneButton = useRef3(null);
723
754
  const object = obj;
724
755
  const [name, setName] = useState5(object.name || object.title || "");
@@ -729,10 +760,10 @@ var PopoverRenameObject = ({ object: obj }) => {
729
760
  try {
730
761
  object.title = name;
731
762
  } catch (err) {
732
- log.error("Failed to rename object", {
763
+ log2.error("Failed to rename object", {
733
764
  err
734
765
  }, {
735
- F: __dxlog_file,
766
+ F: __dxlog_file2,
736
767
  L: 30,
737
768
  S: void 0,
738
769
  C: (f, a) => f(...a)
@@ -749,9 +780,9 @@ var PopoverRenameObject = ({ object: obj }) => {
749
780
  }, /* @__PURE__ */ React13.createElement("div", {
750
781
  role: "none",
751
782
  className: "flex-1"
752
- }, /* @__PURE__ */ React13.createElement(Input3.Root, null, /* @__PURE__ */ React13.createElement(Input3.Label, {
783
+ }, /* @__PURE__ */ React13.createElement(Input2.Root, null, /* @__PURE__ */ React13.createElement(Input2.Label, {
753
784
  srOnly: true
754
- }, t("object name label")), /* @__PURE__ */ React13.createElement(Input3.TextInput, {
785
+ }, t("object name label")), /* @__PURE__ */ React13.createElement(Input2.TextInput, {
755
786
  placeholder: t("object title placeholder"),
756
787
  value: name,
757
788
  "data-testid": "spacePlugin.renameObject.input",
@@ -770,10 +801,10 @@ var PopoverRenameObject = ({ object: obj }) => {
770
801
 
771
802
  // packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
772
803
  import React14, { useCallback as useCallback9, useRef as useRef4, useState as useState6 } from "react";
773
- import { Button as Button5, Input as Input4, Popover as Popover2, useTranslation as useTranslation14 } from "@dxos/react-ui";
804
+ import { Button as Button5, Input as Input3, Popover as Popover2, useTranslation as useTranslation13 } from "@dxos/react-ui";
774
805
  var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
775
806
  var PopoverRenameSpace = ({ space }) => {
776
- const { t } = useTranslation14(SPACE_PLUGIN);
807
+ const { t } = useTranslation13(SPACE_PLUGIN);
777
808
  const doneButton = useRef4(null);
778
809
  const [name, setName] = useState6(space.properties.name ?? "");
779
810
  const handleDone = useCallback9(() => {
@@ -788,9 +819,9 @@ var PopoverRenameSpace = ({ space }) => {
788
819
  }, /* @__PURE__ */ React14.createElement("div", {
789
820
  role: "none",
790
821
  className: "flex-1"
791
- }, /* @__PURE__ */ React14.createElement(Input4.Root, null, /* @__PURE__ */ React14.createElement(Input4.Label, {
822
+ }, /* @__PURE__ */ React14.createElement(Input3.Root, null, /* @__PURE__ */ React14.createElement(Input3.Label, {
792
823
  srOnly: true
793
- }, t("space name label")), /* @__PURE__ */ React14.createElement(Input4.TextInput, {
824
+ }, t("space name label")), /* @__PURE__ */ React14.createElement(Input3.TextInput, {
794
825
  defaultValue: space.properties.name ?? "",
795
826
  placeholder: t("unnamed space label"),
796
827
  onChange: ({ target: { value } }) => setName(value),
@@ -811,7 +842,7 @@ var PopoverRenameSpace = ({ space }) => {
811
842
  // packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
812
843
  import React15 from "react";
813
844
  import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
814
- import { IconButton as IconButton4, useTranslation as useTranslation15 } from "@dxos/react-ui";
845
+ import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
815
846
  var ShareSpaceButton = ({ space }) => {
816
847
  const { dispatchPromise: dispatch } = useIntentDispatcher5();
817
848
  return /* @__PURE__ */ React15.createElement(ShareSpaceButtonImpl, {
@@ -821,8 +852,8 @@ var ShareSpaceButton = ({ space }) => {
821
852
  });
822
853
  };
823
854
  var ShareSpaceButtonImpl = ({ onClick }) => {
824
- const { t } = useTranslation15(SPACE_PLUGIN);
825
- return /* @__PURE__ */ React15.createElement(IconButton4, {
855
+ const { t } = useTranslation14(SPACE_PLUGIN);
856
+ return /* @__PURE__ */ React15.createElement(IconButton3, {
826
857
  "data-testid": "spacePlugin.shareSpaceButton",
827
858
  icon: "ph--users--regular",
828
859
  label: t("share space label"),
@@ -832,27 +863,26 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
832
863
 
833
864
  // packages/plugins/plugin-space/src/components/SpacePresence.tsx
834
865
  import React16, { useCallback as useCallback10, useEffect as useEffect4, useState as useState8 } from "react";
835
- import { useCapability as useCapability2 } from "@dxos/app-framework";
866
+ import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
836
867
  import { generateName } from "@dxos/display-name";
837
- import { useGraph as useGraph2 } from "@dxos/plugin-graph";
838
- import { PublicKey, useClient as useClient4 } from "@dxos/react-client";
868
+ import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
839
869
  import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId2 } from "@dxos/react-client/echo";
840
870
  import { useIdentity } from "@dxos/react-client/halo";
841
- import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation16, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
871
+ import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation15, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
842
872
  import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
843
873
  import { ComplexMap, keyToFallback } from "@dxos/util";
844
874
 
845
875
  // packages/plugins/plugin-space/src/capabilities/index.ts
846
876
  import { lazy } from "@dxos/app-framework";
847
- var AppGraphBuilder = lazy(() => import("./app-graph-builder-NEHQ5Z63.mjs"));
848
- var AppGraphSerializer = lazy(() => import("./app-graph-serializer-UWWS5OVC.mjs"));
849
- var IdentityCreated = lazy(() => import("./identity-created-HMNY2MPB.mjs"));
850
- var IntentResolver = lazy(() => import("./intent-resolver-P5EVBOGP.mjs"));
851
- var ReactRoot = lazy(() => import("./react-root-OUPJA4RY.mjs"));
852
- var ReactSurface = lazy(() => import("./react-surface-7EVWCKIP.mjs"));
853
- var SpaceSettings = lazy(() => import("./settings-EDK6WI3V.mjs"));
854
- var SpaceState = lazy(() => import("./state-BMISGQ2O.mjs"));
855
- var SpacesReady = lazy(() => import("./spaces-ready-CH3W7OGN.mjs"));
877
+ var AppGraphBuilder = lazy(() => import("./app-graph-builder-TKGLOK22.mjs"));
878
+ var AppGraphSerializer = lazy(() => import("./app-graph-serializer-HLX2JRNF.mjs"));
879
+ var IdentityCreated = lazy(() => import("./identity-created-7THGZ7EW.mjs"));
880
+ var IntentResolver = lazy(() => import("./intent-resolver-L2TKJU4I.mjs"));
881
+ var ReactRoot = lazy(() => import("./react-root-Q5MFDXZE.mjs"));
882
+ var ReactSurface = lazy(() => import("./react-surface-RQQZ5BOG.mjs"));
883
+ var SpaceSettings = lazy(() => import("./settings-KXYUZBLN.mjs"));
884
+ var SpaceState = lazy(() => import("./state-5GH2D5U4.mjs"));
885
+ var SpacesReady = lazy(() => import("./spaces-ready-MWNP3WBX.mjs"));
856
886
 
857
887
  // packages/plugins/plugin-space/src/hooks/usePath.ts
858
888
  import { useEffect as useEffect3, useState as useState7 } from "react";
@@ -896,8 +926,8 @@ var ACTIVITY_DURATION = 3e4;
896
926
  var noViewers = new ComplexMap(PublicKey.hash);
897
927
  var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
898
928
  var SpacePresence = ({ object, spaceKey }) => {
899
- const spaceState = useCapability2(SpaceCapabilities.MutableState);
900
- const client = useClient4();
929
+ const spaceState = useCapability(SpaceCapabilities.MutableState);
930
+ const client = useClient5();
901
931
  const identity = useIdentity();
902
932
  const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
903
933
  const spaceMembers = useMembers(space?.key);
@@ -996,7 +1026,7 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
996
1026
  var SmallPresenceLive = ({ id, open, viewers }) => {
997
1027
  const { hasAttention, isAncestor, isRelated } = useAttention(id);
998
1028
  const isAttended = hasAttention || isAncestor || isRelated;
999
- const { graph } = useGraph2();
1029
+ const { graph } = useAppGraph2();
1000
1030
  const attended = useAttended();
1001
1031
  const startOfAttention = attended.at(-1);
1002
1032
  const path = usePath(graph, startOfAttention);
@@ -1024,7 +1054,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
1024
1054
  });
1025
1055
  };
1026
1056
  var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1027
- const { t } = useTranslation16(SPACE_PLUGIN);
1057
+ const { t } = useTranslation15(SPACE_PLUGIN);
1028
1058
  return /* @__PURE__ */ React16.createElement(Tooltip2.Root, null, /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, {
1029
1059
  asChild: true
1030
1060
  }, /* @__PURE__ */ React16.createElement(AttentionGlyph, {
@@ -1041,13 +1071,13 @@ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1041
1071
 
1042
1072
  // packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
1043
1073
  import React17 from "react";
1044
- import { Input as Input5, useTranslation as useTranslation17 } from "@dxos/react-ui";
1045
- import { DeprecatedFormInput } from "@dxos/react-ui-form";
1074
+ import { Input as Input4, useTranslation as useTranslation16 } from "@dxos/react-ui";
1075
+ import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
1046
1076
  var SpacePluginSettings = ({ settings }) => {
1047
- const { t } = useTranslation17(SPACE_PLUGIN);
1048
- return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
1077
+ const { t } = useTranslation16(SPACE_PLUGIN);
1078
+ return /* @__PURE__ */ React17.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
1049
1079
  label: t("show hidden spaces label")
1050
- }, /* @__PURE__ */ React17.createElement(Input5.Switch, {
1080
+ }, /* @__PURE__ */ React17.createElement(Input4.Switch, {
1051
1081
  checked: settings.showHidden,
1052
1082
  onCheckedChange: (checked) => settings.showHidden = !!checked
1053
1083
  })));
@@ -1055,24 +1085,23 @@ var SpacePluginSettings = ({ settings }) => {
1055
1085
 
1056
1086
  // packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx
1057
1087
  import React18, { useCallback as useCallback11, useState as useState9 } from "react";
1058
- import { log as log2 } from "@dxos/log";
1088
+ import { log as log3 } from "@dxos/log";
1059
1089
  import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
1060
- import { useClient as useClient5 } from "@dxos/react-client";
1061
- import { Input as Input6, useTranslation as useTranslation18 } from "@dxos/react-ui";
1062
- import { DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
1063
- import { mx as mx4 } from "@dxos/react-ui-theme";
1064
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
1090
+ import { useClient as useClient6 } from "@dxos/react-client";
1091
+ import { Input as Input5, useTranslation as useTranslation17 } from "@dxos/react-ui";
1092
+ import { DeprecatedFormContainer as DeprecatedFormContainer2, DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
1093
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
1065
1094
  var SpaceSettingsPanel = ({ classNames, space }) => {
1066
- const { t } = useTranslation18(SPACE_PLUGIN);
1067
- const client = useClient5();
1095
+ const { t } = useTranslation17(SPACE_PLUGIN);
1096
+ const client = useClient6();
1068
1097
  const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
1069
1098
  const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
1070
1099
  const toggleEdgeReplication = useCallback11(async (next) => {
1071
1100
  setEdgeReplication(next);
1072
1101
  await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
1073
- log2.catch(err, void 0, {
1074
- F: __dxlog_file2,
1075
- L: 36,
1102
+ log3.catch(err, void 0, {
1103
+ F: __dxlog_file3,
1104
+ L: 35,
1076
1105
  S: void 0,
1077
1106
  C: (f, a) => f(...a)
1078
1107
  });
@@ -1081,12 +1110,9 @@ var SpaceSettingsPanel = ({ classNames, space }) => {
1081
1110
  }, [
1082
1111
  space
1083
1112
  ]);
1084
- return /* @__PURE__ */ React18.createElement("div", {
1085
- role: "form",
1086
- className: mx4("flex flex-col", classNames)
1087
- }, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1113
+ return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer2, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1088
1114
  label: t("name label")
1089
- }, /* @__PURE__ */ React18.createElement(Input6.TextInput, {
1115
+ }, /* @__PURE__ */ React18.createElement(Input5.TextInput, {
1090
1116
  placeholder: t("unnamed space label"),
1091
1117
  value: space.properties.name ?? "",
1092
1118
  onChange: (event) => {
@@ -1094,22 +1120,23 @@ var SpaceSettingsPanel = ({ classNames, space }) => {
1094
1120
  }
1095
1121
  })), edgeEnabled && /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1096
1122
  label: t("edge replication label")
1097
- }, /* @__PURE__ */ React18.createElement(Input6.Switch, {
1123
+ }, /* @__PURE__ */ React18.createElement(Input5.Switch, {
1098
1124
  checked: edgeReplication,
1099
1125
  onCheckedChange: toggleEdgeReplication
1100
1126
  })));
1101
1127
  };
1102
1128
 
1103
1129
  // packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsDialog.tsx
1104
- import React19, { useState as useState10 } from "react";
1105
- import { useClient as useClient6 } from "@dxos/react-client";
1106
- import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation19 } from "@dxos/react-ui";
1130
+ import React19, { useMemo as useMemo2, useState as useState10 } from "react";
1131
+ import { Surface as Surface2, useCapabilities } from "@dxos/app-framework";
1132
+ import { useClient as useClient7 } from "@dxos/react-client";
1133
+ import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation18 } from "@dxos/react-ui";
1107
1134
  import { Tabs } from "@dxos/react-ui-tabs";
1108
1135
  import { SpacePanel } from "@dxos/shell/react";
1109
1136
  var SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
1110
1137
  var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
1111
- const { t } = useTranslation19(SPACE_PLUGIN);
1112
- const client = useClient6();
1138
+ const { t } = useTranslation18(SPACE_PLUGIN);
1139
+ const client = useClient7();
1113
1140
  const [tabsActivePart, setTabsActivePart] = useState10("list");
1114
1141
  const [selected, setSelected] = useState10(initialTab);
1115
1142
  const locked = space.properties[COMPOSER_SPACE_LOCK];
@@ -1117,6 +1144,12 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1117
1144
  personal: client.spaces.default === space,
1118
1145
  namesCache
1119
1146
  });
1147
+ const panels = useCapabilities(SpaceCapabilities.SettingsPanel);
1148
+ const data = useMemo2(() => ({
1149
+ subject: space
1150
+ }), [
1151
+ space
1152
+ ]);
1120
1153
  return (
1121
1154
  // TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
1122
1155
  // Consider factoring it out to the tabs package.
@@ -1169,7 +1202,10 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1169
1202
  }, t("settings tab label")), /* @__PURE__ */ React19.createElement(Tabs.Tab, {
1170
1203
  value: "members",
1171
1204
  disabled: locked
1172
- }, t("members tab label"))))), /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1205
+ }, t("members tab label")), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tab, {
1206
+ key: panel.id,
1207
+ value: panel.id
1208
+ }, toLocalizedString3(panel.label, t)))))), /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1173
1209
  value: "settings",
1174
1210
  classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1175
1211
  }, /* @__PURE__ */ React19.createElement(SpaceSettingsPanel, {
@@ -1182,25 +1218,32 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1182
1218
  hideHeading: true,
1183
1219
  target,
1184
1220
  createInvitationUrl
1221
+ }))), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1222
+ key: panel.id,
1223
+ value: panel.id,
1224
+ classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1225
+ }, /* @__PURE__ */ React19.createElement(Surface2, {
1226
+ role: `space-settings--${panel.id}`,
1227
+ data
1185
1228
  }))))))
1186
1229
  );
1187
1230
  };
1188
1231
 
1189
1232
  // packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
1190
1233
  import React20, { useEffect as useEffect6, useState as useState12 } from "react";
1191
- import { useGraph as useGraph3 } from "@dxos/plugin-graph";
1234
+ import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
1192
1235
  import { QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
1193
1236
  import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
1194
- import { useClient as useClient8 } from "@dxos/react-client";
1195
- import { Tooltip as Tooltip3, useTranslation as useTranslation20 } from "@dxos/react-ui";
1237
+ import { useClient as useClient9 } from "@dxos/react-client";
1238
+ import { Tooltip as Tooltip3, useTranslation as useTranslation19 } from "@dxos/react-ui";
1196
1239
  import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
1197
1240
 
1198
1241
  // packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts
1199
1242
  import { useEffect as useEffect5, useState as useState11 } from "react";
1200
1243
  import { Context } from "@dxos/context";
1201
1244
  import { EdgeService } from "@dxos/protocols";
1202
- import { useClient as useClient7 } from "@dxos/react-client";
1203
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
1245
+ import { useClient as useClient8 } from "@dxos/react-client";
1246
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
1204
1247
  var createEmptyEdgeSyncState = () => ({
1205
1248
  missingOnLocal: 0,
1206
1249
  missingOnRemote: 0,
@@ -1220,11 +1263,11 @@ var getSyncSummary = (syncMap) => {
1220
1263
  };
1221
1264
  var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
1222
1265
  var useSyncState = () => {
1223
- const client = useClient7();
1266
+ const client = useClient8();
1224
1267
  const [spaceState, setSpaceState] = useState11({});
1225
1268
  useEffect5(() => {
1226
1269
  const ctx = new Context(void 0, {
1227
- F: __dxlog_file3,
1270
+ F: __dxlog_file4,
1228
1271
  L: 48
1229
1272
  });
1230
1273
  const createSubscriptions = (spaces) => {
@@ -1259,7 +1302,7 @@ var useSpaceSyncState = (space) => {
1259
1302
  const [spaceState, setSpaceState] = useState11();
1260
1303
  useEffect5(() => {
1261
1304
  const ctx = new Context(void 0, {
1262
- F: __dxlog_file3,
1305
+ F: __dxlog_file4,
1263
1306
  L: 87
1264
1307
  });
1265
1308
  space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
@@ -1280,7 +1323,7 @@ var useSpaceSyncState = (space) => {
1280
1323
  // packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
1281
1324
  var useEdgeStatus = () => {
1282
1325
  const [status, setStatus] = useState12(QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
1283
- const client = useClient8();
1326
+ const client = useClient9();
1284
1327
  useEffect6(() => {
1285
1328
  client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
1286
1329
  setStatus(status2);
@@ -1291,11 +1334,11 @@ var useEdgeStatus = () => {
1291
1334
  return status;
1292
1335
  };
1293
1336
  var InlineSyncStatus = ({ space, open }) => {
1294
- const { t } = useTranslation20(SPACE_PLUGIN);
1337
+ const { t } = useTranslation19(SPACE_PLUGIN);
1295
1338
  const id = space.id;
1296
1339
  const { hasAttention, isAncestor, isRelated } = useAttention2(id);
1297
1340
  const isAttended = hasAttention || isAncestor || isRelated;
1298
- const { graph } = useGraph3();
1341
+ const { graph } = useAppGraph3();
1299
1342
  const attended = useAttended2();
1300
1343
  const startOfAttention = attended.at(-1);
1301
1344
  const path = usePath(graph, startOfAttention);
@@ -1320,16 +1363,16 @@ var InlineSyncStatus = ({ space, open }) => {
1320
1363
  // packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
1321
1364
  import React22, { useCallback as useCallback12, useEffect as useEffect8, useState as useState14 } from "react";
1322
1365
  import { StatusBar } from "@dxos/plugin-status-bar";
1323
- import { useClient as useClient10 } from "@dxos/react-client";
1324
- import { Icon as Icon6, Input as Input7, Popover as Popover3, useTranslation as useTranslation22 } from "@dxos/react-ui";
1366
+ import { useClient as useClient11 } from "@dxos/react-client";
1367
+ import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation21 } from "@dxos/react-ui";
1325
1368
  import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
1326
1369
  import { mx as mx6 } from "@dxos/react-ui-theme";
1327
1370
 
1328
1371
  // packages/plugins/plugin-space/src/components/SyncStatus/Space.tsx
1329
1372
  import React21, { useEffect as useEffect7, useState as useState13 } from "react";
1330
- import { useClient as useClient9 } from "@dxos/react-client";
1373
+ import { useClient as useClient10 } from "@dxos/react-client";
1331
1374
  import { useSpace } from "@dxos/react-client/echo";
1332
- import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation21 } from "@dxos/react-ui";
1375
+ import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation20 } from "@dxos/react-ui";
1333
1376
  import { mx as mx5 } from "@dxos/react-ui-theme";
1334
1377
  var SYNC_STALLED_TIMEOUT = 5e3;
1335
1378
  var styles = {
@@ -1361,8 +1404,8 @@ var useActive = (count) => {
1361
1404
  return active;
1362
1405
  };
1363
1406
  var SpaceRowContainer = ({ spaceId, state }) => {
1364
- const { t } = useTranslation21(SPACE_PLUGIN);
1365
- const client = useClient9();
1407
+ const { t } = useTranslation20(SPACE_PLUGIN);
1408
+ const client = useClient10();
1366
1409
  const space = useSpace(spaceId);
1367
1410
  if (!space) {
1368
1411
  return null;
@@ -1438,7 +1481,7 @@ var Bar = ({ classNames, count, total }) => {
1438
1481
 
1439
1482
  // packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts
1440
1483
  import { Context as Context2 } from "@dxos/context";
1441
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
1484
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
1442
1485
  var createClientSaveTracker = (client, cb) => {
1443
1486
  const unsubscribeCallbacks = {};
1444
1487
  const state = {};
@@ -1466,7 +1509,7 @@ var createClientSaveTracker = (client, cb) => {
1466
1509
  };
1467
1510
  var createSpaceSaveTracker = (space, cb) => {
1468
1511
  const ctx = new Context2(void 0, {
1469
- F: __dxlog_file4,
1512
+ F: __dxlog_file5,
1470
1513
  L: 40
1471
1514
  });
1472
1515
  void space.waitUntilReady().then(() => {
@@ -1529,7 +1572,7 @@ var getIcon = (status) => {
1529
1572
 
1530
1573
  // packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
1531
1574
  var SyncStatus = () => {
1532
- const client = useClient10();
1575
+ const client = useClient11();
1533
1576
  const state = useSyncState();
1534
1577
  const [saved, setSaved] = useState14(true);
1535
1578
  useEffect8(() => {
@@ -1543,7 +1586,7 @@ var SyncStatus = () => {
1543
1586
  });
1544
1587
  };
1545
1588
  var SyncStatusIndicator = ({ state, saved }) => {
1546
- const { t } = useTranslation22(SPACE_PLUGIN);
1589
+ const { t } = useTranslation21(SPACE_PLUGIN);
1547
1590
  const summary = getSyncSummary(state);
1548
1591
  const offline = Object.values(state).length === 0;
1549
1592
  const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
@@ -1584,18 +1627,16 @@ var SyncStatusIndicator = ({ state, saved }) => {
1584
1627
  asChild: true
1585
1628
  }, /* @__PURE__ */ React22.createElement(StatusBar.Button, {
1586
1629
  title
1587
- }, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, {
1588
- sideOffset: 16
1589
- }, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
1630
+ }, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, null, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
1590
1631
  state,
1591
1632
  summary,
1592
1633
  debug: false
1593
- }))));
1634
+ }), /* @__PURE__ */ React22.createElement(Popover3.Arrow, null))));
1594
1635
  }
1595
1636
  };
1596
1637
  var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
1597
1638
  const [showAll, setShowAll] = useState14(false);
1598
- const { t } = useTranslation22(SPACE_PLUGIN);
1639
+ const { t } = useTranslation21(SPACE_PLUGIN);
1599
1640
  const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
1600
1641
  const handleCheckedChange = useCallback12((state2) => setShowAll(state2), [
1601
1642
  setShowAll
@@ -1609,9 +1650,9 @@ var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
1609
1650
  className: "flex-1"
1610
1651
  }, t("sync status title")), /* @__PURE__ */ React22.createElement("div", {
1611
1652
  className: "flex items-center gap-2"
1612
- }, /* @__PURE__ */ React22.createElement(Input7.Root, null, /* @__PURE__ */ React22.createElement(Input7.Label, {
1653
+ }, /* @__PURE__ */ React22.createElement(Input6.Root, null, /* @__PURE__ */ React22.createElement(Input6.Label, {
1613
1654
  classNames: "text-xs"
1614
- }, t("show all label")), /* @__PURE__ */ React22.createElement(Input7.Checkbox, {
1655
+ }, t("show all label")), /* @__PURE__ */ React22.createElement(Input6.Checkbox, {
1615
1656
  checked: showAll,
1616
1657
  onCheckedChange: handleCheckedChange
1617
1658
  })))), /* @__PURE__ */ React22.createElement("div", {
@@ -1670,4 +1711,4 @@ export {
1670
1711
  SpaceState,
1671
1712
  SpacesReady
1672
1713
  };
1673
- //# sourceMappingURL=chunk-GVOPDPS2.mjs.map
1714
+ //# sourceMappingURL=chunk-N6EAOMIS.mjs.map