@dxos/plugin-space 0.7.5-labs.a279d8c → 0.7.5-labs.d453967

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 (184) hide show
  1. package/dist/lib/browser/{app-graph-builder-5D2QB43K.mjs → app-graph-builder-GSS3V7IN.mjs} +15 -13
  2. package/dist/lib/browser/app-graph-builder-GSS3V7IN.mjs.map +7 -0
  3. package/dist/lib/browser/{app-graph-serializer-VNWPLPDF.mjs → app-graph-serializer-QDXM5M6K.mjs} +5 -5
  4. package/dist/lib/browser/{chunk-PDJ4MLA4.mjs → chunk-DIBLC24B.mjs} +308 -251
  5. package/dist/lib/browser/chunk-DIBLC24B.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-5TBRONF6.mjs → chunk-SDK7RZI3.mjs} +3 -3
  11. package/dist/lib/browser/{chunk-HCXWKGTE.mjs → chunk-XPZ6IIXF.mjs} +4 -9
  12. package/dist/lib/browser/chunk-XPZ6IIXF.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-ZBKFJNHH.mjs → chunk-ZL5ZFGBK.mjs} +15 -9
  14. package/dist/lib/browser/chunk-ZL5ZFGBK.mjs.map +7 -0
  15. package/dist/lib/browser/{identity-created-EC5FOCX2.mjs → identity-created-25TK5XNO.mjs} +3 -3
  16. package/dist/lib/browser/index.mjs +14 -13
  17. package/dist/lib/browser/index.mjs.map +3 -3
  18. package/dist/lib/browser/intent-resolver-LNTCXZ57.mjs +537 -0
  19. package/dist/lib/browser/intent-resolver-LNTCXZ57.mjs.map +7 -0
  20. package/dist/lib/browser/meta.json +1 -1
  21. package/dist/lib/browser/{react-root-4QQST3T2.mjs → react-root-Q7JJDCPB.mjs} +6 -6
  22. package/dist/lib/browser/{react-surface-JTNUNOJG.mjs → react-surface-BDMYLARO.mjs} +26 -33
  23. package/dist/lib/browser/react-surface-BDMYLARO.mjs.map +7 -0
  24. package/dist/lib/browser/{settings-ASFF5BZL.mjs → settings-K4JPYYEM.mjs} +3 -3
  25. package/dist/lib/browser/{spaces-ready-4SFNS5JQ.mjs → spaces-ready-THYJEJYZ.mjs} +31 -32
  26. package/dist/lib/browser/spaces-ready-THYJEJYZ.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 -4
  29. package/dist/lib/node/{app-graph-builder-ZQ5S62YR.cjs → app-graph-builder-V3RCGDV7.cjs} +60 -58
  30. package/dist/lib/node/app-graph-builder-V3RCGDV7.cjs.map +7 -0
  31. package/dist/lib/node/{app-graph-serializer-72S7P33H.cjs → app-graph-serializer-H4UACG57.cjs} +21 -21
  32. package/dist/lib/node/{chunk-VCPICVIE.cjs → chunk-4AZ2DD4G.cjs} +308 -251
  33. package/dist/lib/node/chunk-4AZ2DD4G.cjs.map +7 -0
  34. package/dist/lib/node/{chunk-DDZYVNVP.cjs → chunk-6MEOP3DH.cjs} +8 -14
  35. package/dist/lib/node/chunk-6MEOP3DH.cjs.map +7 -0
  36. package/dist/lib/node/{chunk-BQRNTKSQ.cjs → chunk-D6BFKOXY.cjs} +8 -8
  37. package/dist/lib/node/{chunk-Z34MTEU7.cjs → chunk-SYVPVU3K.cjs} +66 -60
  38. package/dist/lib/node/chunk-SYVPVU3K.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-IMDS4A6A.cjs → identity-created-7G5U7R36.cjs} +7 -7
  44. package/dist/lib/node/index.cjs +93 -92
  45. package/dist/lib/node/index.cjs.map +3 -3
  46. package/dist/lib/node/intent-resolver-CDE4M3TW.cjs +536 -0
  47. package/dist/lib/node/intent-resolver-CDE4M3TW.cjs.map +7 -0
  48. package/dist/lib/node/meta.json +1 -1
  49. package/dist/lib/node/{react-root-TCHYZQY3.cjs → react-root-JN6AIHMS.cjs} +12 -12
  50. package/dist/lib/node/{react-surface-TFPR6QAQ.cjs → react-surface-XSK2QEQV.cjs} +72 -76
  51. package/dist/lib/node/react-surface-XSK2QEQV.cjs.map +7 -0
  52. package/dist/lib/node/{settings-QLCKAUHK.cjs → settings-TEELGWS4.cjs} +8 -8
  53. package/dist/lib/node/{spaces-ready-RZTKEXOL.cjs → spaces-ready-L4MJTFQ6.cjs} +39 -40
  54. package/dist/lib/node/spaces-ready-L4MJTFQ6.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 -18
  57. package/dist/lib/node/types/index.cjs.map +2 -2
  58. package/dist/lib/node-esm/{app-graph-builder-CD6IYPSS.mjs → app-graph-builder-VFHK7OQI.mjs} +15 -13
  59. package/dist/lib/node-esm/app-graph-builder-VFHK7OQI.mjs.map +7 -0
  60. package/dist/lib/node-esm/{app-graph-serializer-CFXS6ZE2.mjs → app-graph-serializer-PIPJVXYZ.mjs} +5 -5
  61. package/dist/lib/node-esm/{chunk-M4XTHK35.mjs → chunk-4UX5WGKJ.mjs} +3 -3
  62. package/dist/lib/node-esm/{chunk-CLGCKZ2D.mjs → chunk-AAQRELDK.mjs} +4 -9
  63. package/dist/lib/node-esm/chunk-AAQRELDK.mjs.map +7 -0
  64. package/dist/lib/node-esm/{chunk-I75ZN2YH.mjs → chunk-FTVEA5LO.mjs} +308 -251
  65. package/dist/lib/node-esm/chunk-FTVEA5LO.mjs.map +7 -0
  66. package/dist/lib/node-esm/{chunk-7FUVU45N.mjs → chunk-ICCM4YRJ.mjs} +3 -2
  67. package/dist/lib/node-esm/{chunk-7FUVU45N.mjs.map → chunk-ICCM4YRJ.mjs.map} +3 -3
  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-FUMGYUD3.mjs → chunk-RCZRYXI3.mjs} +15 -9
  71. package/dist/lib/node-esm/chunk-RCZRYXI3.mjs.map +7 -0
  72. package/dist/lib/node-esm/{identity-created-SJYZZ7Q3.mjs → identity-created-7THGZ7EW.mjs} +3 -3
  73. package/dist/lib/node-esm/index.mjs +14 -13
  74. package/dist/lib/node-esm/index.mjs.map +3 -3
  75. package/dist/lib/node-esm/intent-resolver-7L3GJAZE.mjs +538 -0
  76. package/dist/lib/node-esm/intent-resolver-7L3GJAZE.mjs.map +7 -0
  77. package/dist/lib/node-esm/meta.json +1 -1
  78. package/dist/lib/node-esm/{react-root-BEX2XFJK.mjs → react-root-BNA6PBFZ.mjs} +6 -6
  79. package/dist/lib/node-esm/{react-surface-TRLHCJZ3.mjs → react-surface-FTI2LQNL.mjs} +26 -33
  80. package/dist/lib/node-esm/react-surface-FTI2LQNL.mjs.map +7 -0
  81. package/dist/lib/node-esm/{settings-WLVEO4JM.mjs → settings-KXYUZBLN.mjs} +3 -3
  82. package/dist/lib/node-esm/{spaces-ready-ITGYYT5A.mjs → spaces-ready-ZC2R73H3.mjs} +31 -32
  83. package/dist/lib/node-esm/spaces-ready-ZC2R73H3.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 -4
  86. package/dist/types/src/SpacePlugin.d.ts +5 -1
  87. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  88. package/dist/types/src/capabilities/app-graph-builder.d.ts +22 -22
  89. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  90. package/dist/types/src/capabilities/capabilities.d.ts +6 -0
  91. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  92. package/dist/types/src/capabilities/index.d.ts +34 -33
  93. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  94. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -1
  95. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  96. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  97. package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
  98. package/dist/types/src/components/BaseObjectSettings.d.ts.map +1 -1
  99. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +4 -3
  100. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  101. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
  102. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  103. package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
  104. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -1
  105. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts +3 -4
  106. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
  107. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts.map +1 -1
  108. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
  109. package/dist/types/src/meta.d.ts +1 -0
  110. package/dist/types/src/meta.d.ts.map +1 -1
  111. package/dist/types/src/types/types.d.ts +2 -5
  112. package/dist/types/src/types/types.d.ts.map +1 -1
  113. package/dist/types/src/util.d.ts +1 -0
  114. package/dist/types/src/util.d.ts.map +1 -1
  115. package/dist/types/tsconfig.tsbuildinfo +1 -1
  116. package/package.json +39 -37
  117. package/src/SpacePlugin.tsx +11 -6
  118. package/src/capabilities/app-graph-builder.ts +9 -8
  119. package/src/capabilities/capabilities.ts +4 -1
  120. package/src/capabilities/intent-resolver.ts +410 -312
  121. package/src/capabilities/react-surface.tsx +22 -30
  122. package/src/capabilities/spaces-ready.ts +20 -21
  123. package/src/components/AwaitingObject.tsx +5 -5
  124. package/src/components/BaseObjectSettings.tsx +7 -0
  125. package/src/components/CreateDialog/CreateObjectDialog.tsx +15 -15
  126. package/src/components/CreateDialog/CreateObjectPanel.tsx +114 -115
  127. package/src/components/CreateDialog/CreateSpaceDialog.tsx +18 -9
  128. package/src/components/JoinDialog.tsx +27 -19
  129. package/src/components/SpacePluginSettings.tsx +3 -3
  130. package/src/components/SpacePresence.stories.tsx +2 -2
  131. package/src/components/SpacePresence.tsx +2 -3
  132. package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +16 -1
  133. package/src/components/SpaceSettings/SpaceSettingsPanel.stories.tsx +5 -1
  134. package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +15 -8
  135. package/src/components/SyncStatus/InlineSyncStatus.tsx +2 -2
  136. package/src/components/SyncStatus/SyncStatus.tsx +2 -1
  137. package/src/meta.ts +1 -0
  138. package/src/types/types.ts +2 -7
  139. package/src/util.tsx +9 -4
  140. package/dist/lib/browser/app-graph-builder-5D2QB43K.mjs.map +0 -7
  141. package/dist/lib/browser/chunk-HCXWKGTE.mjs.map +0 -7
  142. package/dist/lib/browser/chunk-PDJ4MLA4.mjs.map +0 -7
  143. package/dist/lib/browser/chunk-UH5P4UL3.mjs.map +0 -7
  144. package/dist/lib/browser/chunk-ZBKFJNHH.mjs.map +0 -7
  145. package/dist/lib/browser/intent-resolver-Y6AZTVRL.mjs +0 -459
  146. package/dist/lib/browser/intent-resolver-Y6AZTVRL.mjs.map +0 -7
  147. package/dist/lib/browser/react-surface-JTNUNOJG.mjs.map +0 -7
  148. package/dist/lib/browser/spaces-ready-4SFNS5JQ.mjs.map +0 -7
  149. package/dist/lib/node/app-graph-builder-ZQ5S62YR.cjs.map +0 -7
  150. package/dist/lib/node/chunk-56NGXG2A.cjs.map +0 -7
  151. package/dist/lib/node/chunk-DDZYVNVP.cjs.map +0 -7
  152. package/dist/lib/node/chunk-VCPICVIE.cjs.map +0 -7
  153. package/dist/lib/node/chunk-Z34MTEU7.cjs.map +0 -7
  154. package/dist/lib/node/intent-resolver-MUGCKZPN.cjs +0 -458
  155. package/dist/lib/node/intent-resolver-MUGCKZPN.cjs.map +0 -7
  156. package/dist/lib/node/react-surface-TFPR6QAQ.cjs.map +0 -7
  157. package/dist/lib/node/spaces-ready-RZTKEXOL.cjs.map +0 -7
  158. package/dist/lib/node-esm/app-graph-builder-CD6IYPSS.mjs.map +0 -7
  159. package/dist/lib/node-esm/chunk-375RB3CZ.mjs.map +0 -7
  160. package/dist/lib/node-esm/chunk-CLGCKZ2D.mjs.map +0 -7
  161. package/dist/lib/node-esm/chunk-FUMGYUD3.mjs.map +0 -7
  162. package/dist/lib/node-esm/chunk-I75ZN2YH.mjs.map +0 -7
  163. package/dist/lib/node-esm/intent-resolver-6PNQKHDL.mjs +0 -460
  164. package/dist/lib/node-esm/intent-resolver-6PNQKHDL.mjs.map +0 -7
  165. package/dist/lib/node-esm/react-surface-TRLHCJZ3.mjs.map +0 -7
  166. package/dist/lib/node-esm/spaces-ready-ITGYYT5A.mjs.map +0 -7
  167. /package/dist/lib/browser/{app-graph-serializer-VNWPLPDF.mjs.map → app-graph-serializer-QDXM5M6K.mjs.map} +0 -0
  168. /package/dist/lib/browser/{chunk-5TBRONF6.mjs.map → chunk-SDK7RZI3.mjs.map} +0 -0
  169. /package/dist/lib/browser/{identity-created-EC5FOCX2.mjs.map → identity-created-25TK5XNO.mjs.map} +0 -0
  170. /package/dist/lib/browser/{react-root-4QQST3T2.mjs.map → react-root-Q7JJDCPB.mjs.map} +0 -0
  171. /package/dist/lib/browser/{settings-ASFF5BZL.mjs.map → settings-K4JPYYEM.mjs.map} +0 -0
  172. /package/dist/lib/browser/{state-MS4KYJWI.mjs.map → state-6DCY5YJP.mjs.map} +0 -0
  173. /package/dist/lib/node/{app-graph-serializer-72S7P33H.cjs.map → app-graph-serializer-H4UACG57.cjs.map} +0 -0
  174. /package/dist/lib/node/{chunk-BQRNTKSQ.cjs.map → chunk-D6BFKOXY.cjs.map} +0 -0
  175. /package/dist/lib/node/{identity-created-IMDS4A6A.cjs.map → identity-created-7G5U7R36.cjs.map} +0 -0
  176. /package/dist/lib/node/{react-root-TCHYZQY3.cjs.map → react-root-JN6AIHMS.cjs.map} +0 -0
  177. /package/dist/lib/node/{settings-QLCKAUHK.cjs.map → settings-TEELGWS4.cjs.map} +0 -0
  178. /package/dist/lib/node/{state-4UIOUKLJ.cjs.map → state-WPZC4JXB.cjs.map} +0 -0
  179. /package/dist/lib/node-esm/{app-graph-serializer-CFXS6ZE2.mjs.map → app-graph-serializer-PIPJVXYZ.mjs.map} +0 -0
  180. /package/dist/lib/node-esm/{chunk-M4XTHK35.mjs.map → chunk-4UX5WGKJ.mjs.map} +0 -0
  181. /package/dist/lib/node-esm/{identity-created-SJYZZ7Q3.mjs.map → identity-created-7THGZ7EW.mjs.map} +0 -0
  182. /package/dist/lib/node-esm/{react-root-BEX2XFJK.mjs.map → react-root-BNA6PBFZ.mjs.map} +0 -0
  183. /package/dist/lib/node-esm/{settings-WLVEO4JM.mjs.map → settings-KXYUZBLN.mjs.map} +0 -0
  184. /package/dist/lib/node-esm/{state-BMISGQ2O.mjs.map → state-5GH2D5U4.mjs.map} +0 -0
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  SpaceCapabilities
3
- } from "./chunk-UH5P4UL3.mjs";
3
+ } from "./chunk-RLZQJD47.mjs";
4
4
  import {
5
5
  COMPOSER_SPACE_LOCK,
6
6
  getSpaceDisplayName
7
- } from "./chunk-ZBKFJNHH.mjs";
7
+ } from "./chunk-ZL5ZFGBK.mjs";
8
8
  import {
9
9
  CollectionType,
10
10
  SpaceAction,
11
11
  SpaceForm
12
- } from "./chunk-HCXWKGTE.mjs";
12
+ } from "./chunk-XPZ6IIXF.mjs";
13
13
  import {
14
14
  SPACE_PLUGIN
15
- } from "./chunk-SOXNANA6.mjs";
15
+ } from "./chunk-PQXZCNAU.mjs";
16
16
 
17
17
  // packages/plugins/plugin-space/src/components/AdvancedObjectSettings/AdvancedObjectSettings.tsx
18
18
  import React2, { useCallback as useCallback2, useState } from "react";
@@ -111,7 +111,7 @@ var AdvancedObjectSettings = ({ object }) => {
111
111
  // packages/plugins/plugin-space/src/components/AwaitingObject.tsx
112
112
  import { CheckCircle, CircleDashed, CircleNotch } from "@phosphor-icons/react";
113
113
  import React3, { useCallback as useCallback3, useEffect, useState as useState2 } from "react";
114
- import { NavigationAction, useIntentDispatcher, createIntent, useCapability, Capabilities } from "@dxos/app-framework";
114
+ import { createIntent, LayoutAction, useIntentDispatcher, useLayout } from "@dxos/app-framework";
115
115
  import { useClient } from "@dxos/react-client";
116
116
  import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
117
117
  import { Button, Toast, useTranslation as useTranslation3 } from "@dxos/react-ui";
@@ -124,7 +124,7 @@ var AwaitingObject = ({ id }) => {
124
124
  const [found, setFound] = useState2(false);
125
125
  const { t } = useTranslation3(SPACE_PLUGIN);
126
126
  const { dispatchPromise: dispatch } = useIntentDispatcher();
127
- const location = useCapability(Capabilities.Location);
127
+ const layout = useLayout();
128
128
  const client = useClient();
129
129
  const objects = useQuery(client.spaces, Filter.all());
130
130
  useEffect(() => {
@@ -141,14 +141,14 @@ var AwaitingObject = ({ id }) => {
141
141
  useEffect(() => {
142
142
  if (objects.findIndex((object) => fullyQualifiedId(object) === id) > -1) {
143
143
  setFound(true);
144
- if (location.active.solo?.[0].id === id) {
144
+ if (layout.active.includes(id)) {
145
145
  setOpen(false);
146
146
  }
147
147
  }
148
148
  }, [
149
149
  id,
150
150
  objects,
151
- location
151
+ layout
152
152
  ]);
153
153
  const handleClose = useCallback3(async () => dispatch(createIntent(SpaceAction.WaitForObject, {
154
154
  id: void 0
@@ -156,12 +156,11 @@ var AwaitingObject = ({ id }) => {
156
156
  dispatch
157
157
  ]);
158
158
  const handleNavigate = useCallback3(() => {
159
- void dispatch(createIntent(NavigationAction.Open, {
160
- activeParts: {
161
- main: [
162
- id
163
- ]
164
- }
159
+ void dispatch(createIntent(LayoutAction.Open, {
160
+ part: "main",
161
+ subject: [
162
+ id
163
+ ]
165
164
  }));
166
165
  void handleClose();
167
166
  }, [
@@ -207,14 +206,21 @@ import React4 from "react";
207
206
  import { Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
208
207
  var BaseObjectSettings = ({ object }) => {
209
208
  const { t } = useTranslation4(SPACE_PLUGIN);
209
+ const inputRef = React4.useRef(null);
210
210
  return /* @__PURE__ */ React4.createElement("div", {
211
211
  role: "form",
212
212
  className: "flex flex-col w-full p-2 gap-1"
213
213
  }, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React4.createElement(Input.TextInput, {
214
+ ref: inputRef,
214
215
  placeholder: t("name placeholder"),
215
216
  value: object.name ?? "",
216
217
  onChange: (event) => {
217
218
  object.name = event.target.value;
219
+ },
220
+ onKeyDown: (event) => {
221
+ if (event.key === "Enter") {
222
+ inputRef.current?.blur();
223
+ }
218
224
  }
219
225
  })));
220
226
  };
@@ -222,20 +228,20 @@ var BaseObjectSettings = ({ object }) => {
222
228
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
223
229
  import { pipe } from "effect";
224
230
  import React6, { useCallback as useCallback5, useRef } from "react";
225
- import { chain, createIntent as createIntent2, NavigationAction as NavigationAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
231
+ import { chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
226
232
  import { useClient as useClient2 } from "@dxos/react-client";
227
- import { getSpace, isReactiveObject, isSpace as isSpace2, useSpaces } from "@dxos/react-client/echo";
233
+ import { getSpace, isReactiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
228
234
  import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation6 } from "@dxos/react-ui";
229
235
 
230
236
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
231
237
  import React5, { useCallback as useCallback4, useMemo, useState as useState3 } from "react";
232
238
  import { Surface, isSurfaceAvailable, usePluginManager } from "@dxos/app-framework";
233
239
  import { getObjectAnnotation, S } from "@dxos/echo-schema";
234
- import { isSpace } from "@dxos/react-client/echo";
235
- import { Icon, IconButton as IconButton3, Input as Input2, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
236
- import { Form as Form2, InputHeader } from "@dxos/react-ui-form";
240
+ import { Icon, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
241
+ import { Form as Form2 } from "@dxos/react-ui-form";
237
242
  import { SearchList } from "@dxos/react-ui-searchlist";
238
- import { nonNullable } from "@dxos/util";
243
+ import { mx as mx2 } from "@dxos/react-ui-theme";
244
+ import { isNonNullable } from "@dxos/util";
239
245
  var useInputSurfaceLookup = (baseData) => {
240
246
  const pluginManager = usePluginManager();
241
247
  return useCallback4(({ prop, schema, inputProps }) => {
@@ -260,14 +266,22 @@ var useInputSurfaceLookup = (baseData) => {
260
266
  baseData
261
267
  ]);
262
268
  };
263
- var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
269
+ var CreateObjectPanel = ({ classNames, schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
264
270
  const { t } = useTranslation5(SPACE_PLUGIN);
265
271
  const [typename, setTypename] = useState3(initialTypename);
266
272
  const [target, setTarget] = useState3(initialTarget);
267
273
  const schema = schemas.find((schema2) => getObjectAnnotation(schema2)?.typename === typename);
268
- const options = schemas.map(getObjectAnnotation).filter(nonNullable);
269
- const handleClearSchema = useCallback4(() => setTypename(void 0), []);
270
- const handleClearTarget = useCallback4(() => setTarget(void 0), []);
274
+ const options = schemas.map(getObjectAnnotation).filter(isNonNullable).sort((a, b) => {
275
+ const nameA = t("typename label", {
276
+ ns: a.typename,
277
+ defaultValue: a.typename
278
+ });
279
+ const nameB = t("typename label", {
280
+ ns: b.typename,
281
+ defaultValue: b.typename
282
+ });
283
+ return nameA.localeCompare(nameB);
284
+ });
271
285
  const handleCreateObject = useCallback4(async (props) => {
272
286
  if (!schema || !target) {
273
287
  return;
@@ -291,55 +305,6 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
291
305
  resolve,
292
306
  typename
293
307
  ]);
294
- const schemaInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
295
- label: t("schema input label"),
296
- classNames: "flex flex-col grow overflow-hidden"
297
- }, /* @__PURE__ */ React5.createElement(SearchList.Input, {
298
- autoFocus: true,
299
- "data-testid": "create-object-form.schema-input",
300
- placeholder: t("schema input placeholder"),
301
- classNames: "px-1 my-2"
302
- }), /* @__PURE__ */ React5.createElement(SearchList.Content, {
303
- classNames: "max-bs-[24rem] overflow-auto"
304
- }, options.map((option) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
305
- key: option.typename,
306
- value: t("typename label", {
307
- ns: option.typename,
308
- defaultValue: option.typename
309
- }),
310
- onSelect: () => setTypename(option.typename),
311
- classNames: "flex items-center gap-2"
312
- }, /* @__PURE__ */ React5.createElement("span", {
313
- className: "flex gap-2 items-center grow truncate"
314
- }, /* @__PURE__ */ React5.createElement(Icon, {
315
- icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
316
- size: 5
317
- }), t("typename label", {
318
- ns: option.typename,
319
- defaultValue: option.typename
320
- }))))));
321
- const spaceInput = /* @__PURE__ */ React5.createElement(SearchList.Root, {
322
- label: t("space input label"),
323
- classNames: "flex flex-col grow overflow-hidden"
324
- }, /* @__PURE__ */ React5.createElement(SearchList.Input, {
325
- autoFocus: true,
326
- "data-testid": "create-object-form.space-input",
327
- placeholder: t("space input placeholder"),
328
- classNames: "px-1 my-2"
329
- }), /* @__PURE__ */ React5.createElement(SearchList.Content, {
330
- classNames: "max-bs-[24rem] overflow-auto"
331
- }, spaces.map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
332
- key: space.id,
333
- value: toLocalizedString(getSpaceDisplayName(space, {
334
- personal: space.id === defaultSpaceId
335
- }), t),
336
- onSelect: () => setTarget(space),
337
- classNames: "flex items-center gap-2"
338
- }, /* @__PURE__ */ React5.createElement("span", {
339
- className: "grow truncate"
340
- }, toLocalizedString(getSpaceDisplayName(space, {
341
- personal: space.id === defaultSpaceId
342
- }), t))))));
343
308
  const inputSurfaceLookup = useInputSurfaceLookup({
344
309
  target
345
310
  });
@@ -348,6 +313,7 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
348
313
  name: S.optional(S.String)
349
314
  });
350
315
  return /* @__PURE__ */ React5.createElement(Form2, {
316
+ classNames: "!p-0",
351
317
  autoFocus: true,
352
318
  values: {
353
319
  name: initialName
@@ -364,39 +330,79 @@ var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: i
364
330
  ]);
365
331
  return /* @__PURE__ */ React5.createElement("div", {
366
332
  role: "form",
367
- className: "flex flex-col gap-2"
368
- }, target && /* @__PURE__ */ React5.createElement("div", {
369
- role: "none"
370
- }, /* @__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", {
371
- role: "none",
372
- className: "flex gap-2"
373
- }, /* @__PURE__ */ React5.createElement(Input2.TextInput, {
374
- disabled: true,
375
- value: isSpace(target) ? toLocalizedString(getSpaceDisplayName(target, {
376
- personal: target.id === defaultSpaceId
377
- }), t) : target.name || t("unnamed collection label")
378
- }), /* @__PURE__ */ React5.createElement(IconButton3, {
379
- iconOnly: true,
380
- icon: "ph--x--regular",
381
- label: t("clear input label"),
382
- onClick: handleClearTarget
383
- })))), schema && /* @__PURE__ */ React5.createElement("div", {
384
- role: "none"
385
- }, /* @__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", {
386
- role: "none",
387
- className: "flex gap-2"
388
- }, /* @__PURE__ */ React5.createElement(Input2.TextInput, {
389
- disabled: true,
333
+ className: mx2("flex flex-col gap-2", classNames)
334
+ }, !schema ? /* @__PURE__ */ React5.createElement(SelectSchema, {
335
+ options,
336
+ resolve,
337
+ onChange: setTypename
338
+ }) : !target ? /* @__PURE__ */ React5.createElement(SelectSpace, {
339
+ spaces,
340
+ defaultSpaceId,
341
+ onChange: setTarget
342
+ }) : form);
343
+ };
344
+ var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
345
+ const { t } = useTranslation5(SPACE_PLUGIN);
346
+ return /* @__PURE__ */ React5.createElement(SearchList.Root, {
347
+ label: t("space input label"),
348
+ classNames: "flex flex-col grow overflow-hidden"
349
+ }, /* @__PURE__ */ React5.createElement(SearchList.Input, {
350
+ autoFocus: true,
351
+ "data-testid": "create-object-form.space-input",
352
+ placeholder: t("space input placeholder"),
353
+ classNames: "px-1 my-2"
354
+ }), /* @__PURE__ */ React5.createElement(SearchList.Content, {
355
+ classNames: "max-bs-[24rem] overflow-auto"
356
+ }, spaces.sort((a, b) => {
357
+ const aName = toLocalizedString(getSpaceDisplayName(a, {
358
+ personal: a.id === defaultSpaceId
359
+ }), t);
360
+ const bName = toLocalizedString(getSpaceDisplayName(b, {
361
+ personal: b.id === defaultSpaceId
362
+ }), t);
363
+ return aName.localeCompare(bName);
364
+ }).map((space) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
365
+ key: space.id,
366
+ value: toLocalizedString(getSpaceDisplayName(space, {
367
+ personal: space.id === defaultSpaceId
368
+ }), t),
369
+ onSelect: () => onChange(space),
370
+ classNames: "flex items-center gap-2"
371
+ }, /* @__PURE__ */ React5.createElement("span", {
372
+ className: "grow truncate"
373
+ }, toLocalizedString(getSpaceDisplayName(space, {
374
+ personal: space.id === defaultSpaceId
375
+ }), t))))));
376
+ };
377
+ var SelectSchema = ({ options, resolve, onChange }) => {
378
+ const { t } = useTranslation5(SPACE_PLUGIN);
379
+ return /* @__PURE__ */ React5.createElement(SearchList.Root, {
380
+ label: t("schema input label"),
381
+ classNames: "flex flex-col grow overflow-hidden"
382
+ }, /* @__PURE__ */ React5.createElement(SearchList.Input, {
383
+ autoFocus: true,
384
+ "data-testid": "create-object-form.schema-input",
385
+ placeholder: t("schema input placeholder"),
386
+ classNames: "px-1 my-2"
387
+ }), /* @__PURE__ */ React5.createElement(SearchList.Content, {
388
+ classNames: "max-bs-[24rem] overflow-auto"
389
+ }, options.map((option) => /* @__PURE__ */ React5.createElement(SearchList.Item, {
390
+ key: option.typename,
390
391
  value: t("typename label", {
391
- ns: schema.typename,
392
- defaultValue: schema.typename
393
- })
394
- }), /* @__PURE__ */ React5.createElement(IconButton3, {
395
- iconOnly: true,
396
- icon: "ph--x--regular",
397
- label: t("clear input label"),
398
- onClick: handleClearSchema
399
- })))), !schema ? schemaInput : !target ? spaceInput : form);
392
+ ns: option.typename,
393
+ defaultValue: option.typename
394
+ }),
395
+ onSelect: () => onChange(option.typename),
396
+ classNames: "flex items-center gap-2"
397
+ }, /* @__PURE__ */ React5.createElement("span", {
398
+ className: "flex gap-2 items-center grow truncate"
399
+ }, /* @__PURE__ */ React5.createElement(Icon, {
400
+ icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
401
+ size: 5
402
+ }), t("typename label", {
403
+ ns: option.typename,
404
+ defaultValue: option.typename
405
+ }))))));
400
406
  };
401
407
 
402
408
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
@@ -408,13 +414,13 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
408
414
  const spaces = useSpaces();
409
415
  const { dispatchPromise: dispatch } = useIntentDispatcher2();
410
416
  const handleCreateObject = useCallback5(async ({ schema, target: _target, data }) => {
411
- const target2 = isSpace2(_target) ? _target.properties[CollectionType.typename]?.target : _target;
417
+ const target2 = isSpace(_target) ? _target.properties[CollectionType.typename]?.target : _target;
412
418
  const createObjectIntent = resolve?.(schema.typename)?.createObject;
413
419
  if (!createObjectIntent || !target2) {
414
420
  return;
415
421
  }
416
422
  closeRef.current?.click();
417
- const space = isSpace2(target2) ? target2 : getSpace(target2);
423
+ const space = isSpace(target2) ? target2 : getSpace(target2);
418
424
  const result = await dispatch(createObjectIntent(data, {
419
425
  space
420
426
  }));
@@ -426,7 +432,9 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
426
432
  });
427
433
  const shouldNavigate = _shouldNavigate ?? (() => true);
428
434
  if (shouldNavigate(object)) {
429
- await dispatch(pipe(addObjectIntent, chain(NavigationAction2.Open, {})));
435
+ await dispatch(pipe(addObjectIntent, chain(LayoutAction2.Open, {
436
+ part: "main"
437
+ })));
430
438
  } else {
431
439
  await dispatch(addObjectIntent);
432
440
  }
@@ -439,7 +447,7 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
439
447
  // TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
440
448
  // Consider factoring it out to the tabs package.
441
449
  /* @__PURE__ */ React6.createElement(Dialog.Content, {
442
- classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
450
+ classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
443
451
  }, /* @__PURE__ */ React6.createElement("div", {
444
452
  role: "none",
445
453
  className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
@@ -453,9 +461,8 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
453
461
  }, /* @__PURE__ */ React6.createElement(Icon2, {
454
462
  icon: "ph--x--regular",
455
463
  size: 4
456
- })))), /* @__PURE__ */ React6.createElement("div", {
457
- className: "p-4"
458
- }, /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
464
+ })))), /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
465
+ classNames: "p-4",
459
466
  schemas,
460
467
  spaces,
461
468
  target,
@@ -464,13 +471,14 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
464
471
  defaultSpaceId: client.spaces.default.id,
465
472
  resolve,
466
473
  onCreateObject: handleCreateObject
467
- })))
474
+ }))
468
475
  );
469
476
  };
470
477
 
471
478
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateSpaceDialog.tsx
479
+ import { Effect } from "effect";
472
480
  import React7, { useCallback as useCallback6, useRef as useRef2 } from "react";
473
- import { createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
481
+ import { createIntent as createIntent3, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
474
482
  import { Button as Button3, Dialog as Dialog2, Icon as Icon3, useTranslation as useTranslation7 } from "@dxos/react-ui";
475
483
  import { Form as Form3 } from "@dxos/react-ui-form";
476
484
  var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
@@ -480,15 +488,19 @@ var initialValues2 = {
480
488
  var CreateSpaceDialog = () => {
481
489
  const closeRef = useRef2(null);
482
490
  const { t } = useTranslation7(SPACE_PLUGIN);
483
- const { dispatchPromise: dispatch } = useIntentDispatcher3();
491
+ const { dispatch } = useIntentDispatcher3();
484
492
  const handleCreateSpace = useCallback6(async (data) => {
485
- const result = await dispatch(createIntent3(SpaceAction.Create, data));
486
- const target = result.data?.space;
487
- if (target) {
488
- await dispatch(createIntent3(SpaceAction.OpenCreateObject, {
489
- target
493
+ const program = Effect.gen(function* () {
494
+ const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
495
+ yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
496
+ part: "workspace",
497
+ subject: space.id
490
498
  }));
491
- }
499
+ yield* dispatch(createIntent3(SpaceAction.OpenCreateObject, {
500
+ target: space
501
+ }));
502
+ });
503
+ await Effect.runPromise(program);
492
504
  }, [
493
505
  dispatch
494
506
  ]);
@@ -496,7 +508,7 @@ var CreateSpaceDialog = () => {
496
508
  // TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
497
509
  // Consider factoring it out to the tabs package.
498
510
  /* @__PURE__ */ React7.createElement(Dialog2.Content, {
499
- classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
511
+ classNames: "p-0 bs-content min-bs-[16rem] max-bs-full md:max-is-[32rem] overflow-hidden"
500
512
  }, /* @__PURE__ */ React7.createElement("div", {
501
513
  role: "none",
502
514
  className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
@@ -514,6 +526,8 @@ var CreateSpaceDialog = () => {
514
526
  className: "p-4"
515
527
  }, /* @__PURE__ */ React7.createElement(Form3, {
516
528
  testId: "create-space-form",
529
+ classNames: "!p-0",
530
+ autoFocus: true,
517
531
  values: initialValues2,
518
532
  schema: SpaceForm,
519
533
  onSave: handleCreateSpace
@@ -524,16 +538,16 @@ var CreateSpaceDialog = () => {
524
538
  // packages/plugins/plugin-space/src/components/CollectionMain.tsx
525
539
  import React8 from "react";
526
540
  import { useTranslation as useTranslation8 } from "@dxos/react-ui";
527
- import { baseSurface, descriptionText, mx as mx2 } from "@dxos/react-ui-theme";
541
+ import { baseSurface, descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
528
542
  var CollectionMain = ({ collection }) => {
529
543
  const { t } = useTranslation8(SPACE_PLUGIN);
530
544
  return /* @__PURE__ */ React8.createElement("div", {
531
545
  role: "none",
532
- className: mx2(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
546
+ className: mx3(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
533
547
  "data-testid": "composer.firstRunMessage"
534
548
  }, /* @__PURE__ */ React8.createElement("p", {
535
549
  role: "alert",
536
- className: mx2(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
550
+ className: mx3(descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
537
551
  }, collection.name ?? t("unnamed collection label")));
538
552
  };
539
553
 
@@ -551,37 +565,62 @@ var CollectionSection = ({ collection }) => {
551
565
 
552
566
  // packages/plugins/plugin-space/src/components/JoinDialog.tsx
553
567
  import React10, { useCallback as useCallback7 } from "react";
554
- import { createIntent as createIntent4, LayoutAction, NavigationAction as NavigationAction3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
555
- import { useGraph } from "@dxos/plugin-graph";
568
+ import { createIntent as createIntent4, LayoutAction as LayoutAction4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
569
+ import { log } from "@dxos/log";
556
570
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
557
- import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
558
- import { Dialog as Dialog3, useTranslation as useTranslation10 } from "@dxos/react-ui";
571
+ import { useClient as useClient3 } from "@dxos/react-client";
572
+ import { Dialog as Dialog3 } from "@dxos/react-ui";
559
573
  import { JoinPanel } from "@dxos/shell/react";
574
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/JoinDialog.tsx";
560
575
  var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
561
576
  var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
562
- const { t } = useTranslation10(SPACE_PLUGIN);
563
577
  const { dispatchPromise: dispatch } = useIntentDispatcher4();
564
- const spaces = useSpaces2();
565
- const { graph } = useGraph();
578
+ const client = useClient3();
579
+ const { graph } = useAppGraph();
566
580
  const handleDone = useCallback7(async (result) => {
567
581
  if (result?.spaceKey) {
568
582
  await Promise.all([
569
- dispatch(createIntent4(LayoutAction.SetLayout, {
570
- element: "toast",
583
+ dispatch(createIntent4(LayoutAction4.AddToast, {
584
+ part: "toast",
571
585
  subject: {
572
586
  id: `${SPACE_PLUGIN}/join-success`,
573
587
  duration: 5e3,
574
- title: t("join success label"),
575
- closeLabel: t("dismiss label")
588
+ title: [
589
+ "join success label",
590
+ {
591
+ ns: SPACE_PLUGIN
592
+ }
593
+ ],
594
+ closeLabel: [
595
+ "dismiss label",
596
+ {
597
+ ns: SPACE_PLUGIN
598
+ }
599
+ ]
576
600
  }
577
601
  })),
578
- dispatch(createIntent4(LayoutAction.SetLayout, {
579
- element: "dialog",
580
- state: false
602
+ dispatch(createIntent4(LayoutAction4.UpdateDialog, {
603
+ part: "dialog",
604
+ options: {
605
+ state: false
606
+ }
581
607
  }))
582
608
  ]);
583
609
  }
584
- const space = spaces.find(({ key }) => result?.spaceKey?.equals(key));
610
+ const space = result?.spaceKey ? client.spaces.get(result.spaceKey) : void 0;
611
+ if (!space) {
612
+ log.warn("Space not found", result?.spaceKey, {
613
+ F: __dxlog_file,
614
+ L: 56,
615
+ S: void 0,
616
+ C: (f, a) => f(...a)
617
+ });
618
+ return;
619
+ }
620
+ await dispatch(createIntent4(LayoutAction4.SwitchWorkspace, {
621
+ part: "workspace",
622
+ subject: space.id
623
+ }));
585
624
  const target = result?.target || (navigableCollections ? space?.id : void 0);
586
625
  if (target) {
587
626
  await graph.waitForPath({
@@ -589,15 +628,15 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
589
628
  }).catch(() => {
590
629
  });
591
630
  await Promise.all([
592
- dispatch(createIntent4(NavigationAction3.Open, {
593
- activeParts: {
594
- main: [
595
- target
596
- ]
597
- }
631
+ dispatch(createIntent4(LayoutAction4.Open, {
632
+ part: "main",
633
+ subject: [
634
+ target
635
+ ]
598
636
  })),
599
- dispatch(createIntent4(NavigationAction3.Expose, {
600
- id: target
637
+ dispatch(createIntent4(LayoutAction4.Expose, {
638
+ part: "navigation",
639
+ subject: target
601
640
  }))
602
641
  ]);
603
642
  }
@@ -612,7 +651,8 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
612
651
  }
613
652
  }, [
614
653
  dispatch,
615
- spaces
654
+ client,
655
+ graph
616
656
  ]);
617
657
  return /* @__PURE__ */ React10.createElement(Dialog3.Content, null, /* @__PURE__ */ React10.createElement(JoinPanel, {
618
658
  ...props,
@@ -630,11 +670,11 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
630
670
  import { Planet } from "@phosphor-icons/react";
631
671
  import React11 from "react";
632
672
  import { getSpace as getSpace2 } from "@dxos/client/echo";
633
- import { useClient as useClient3 } from "@dxos/react-client";
634
- import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation11 } from "@dxos/react-ui";
673
+ import { useClient as useClient4 } from "@dxos/react-client";
674
+ import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as useTranslation10 } from "@dxos/react-ui";
635
675
  var MenuFooter = ({ object }) => {
636
- const { t } = useTranslation11(SPACE_PLUGIN);
637
- const client = useClient3();
676
+ const { t } = useTranslation10(SPACE_PLUGIN);
677
+ const client = useClient4();
638
678
  const space = getSpace2(object);
639
679
  const spaceName = space ? getSpaceDisplayName(space, {
640
680
  personal: client.spaces.default === space
@@ -654,8 +694,8 @@ var MenuFooter = ({ object }) => {
654
694
  import { ArrowsCounterClockwise, CheckCircle as CheckCircle2, Warning } from "@phosphor-icons/react";
655
695
  import React12, { useEffect as useEffect2, useState as useState4 } from "react";
656
696
  import { debounce } from "@dxos/async";
657
- import { Tooltip, useTranslation as useTranslation12 } from "@dxos/react-ui";
658
- import { getSize as getSize2, mx as mx3, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
697
+ import { Tooltip, useTranslation as useTranslation11 } from "@dxos/react-ui";
698
+ import { getSize as getSize2, mx as mx4, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
659
699
  var Status;
660
700
  (function(Status2) {
661
701
  Status2[Status2["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
@@ -663,7 +703,7 @@ var Status;
663
703
  Status2[Status2["ERROR"] = 2] = "ERROR";
664
704
  })(Status || (Status = {}));
665
705
  var PersistenceStatus = ({ db }) => {
666
- const { t } = useTranslation12(SPACE_PLUGIN);
706
+ const { t } = useTranslation11(SPACE_PLUGIN);
667
707
  const [displayMessage, setDisplayMessage] = useState4(false);
668
708
  const [status, naturalSetStatus] = useState4(0);
669
709
  const [prevStatus, setPrevStatus] = useState4(0);
@@ -683,17 +723,17 @@ var PersistenceStatus = ({ db }) => {
683
723
  return /* @__PURE__ */ React12.createElement("div", {
684
724
  className: "flex items-center"
685
725
  }, /* @__PURE__ */ React12.createElement(Warning, {
686
- className: mx3(getSize2(4), "me-1")
726
+ className: mx4(getSize2(4), "me-1")
687
727
  }), /* @__PURE__ */ React12.createElement("span", {
688
- className: mx3("text-sm", warningText)
728
+ className: mx4("text-sm", warningText)
689
729
  }, t("persistence error label")));
690
730
  case 1:
691
731
  return /* @__PURE__ */ React12.createElement("div", {
692
732
  className: "flex items-center"
693
733
  }, /* @__PURE__ */ React12.createElement(ArrowsCounterClockwise, {
694
- className: mx3(getSize2(4), "me-1")
734
+ className: mx4(getSize2(4), "me-1")
695
735
  }), /* @__PURE__ */ React12.createElement("span", {
696
- className: mx3("text-sm", staticPlaceholderText)
736
+ className: mx4("text-sm", staticPlaceholderText)
697
737
  }, t("persistence pending label")));
698
738
  case 0:
699
739
  default:
@@ -703,21 +743,21 @@ var PersistenceStatus = ({ db }) => {
703
743
  role: "status",
704
744
  className: "flex items-center"
705
745
  }, /* @__PURE__ */ React12.createElement(CheckCircle2, {
706
- className: mx3(getSize2(4), "me-1")
746
+ className: mx4(getSize2(4), "me-1")
707
747
  }), displayMessage && /* @__PURE__ */ React12.createElement("span", {
708
- className: mx3("text-sm", staticPlaceholderText)
748
+ className: mx4("text-sm", staticPlaceholderText)
709
749
  }, 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))));
710
750
  }
711
751
  };
712
752
 
713
753
  // packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
714
754
  import React13, { useCallback as useCallback8, useRef as useRef3, useState as useState5 } from "react";
715
- import { log } from "@dxos/log";
716
- import { Button as Button4, Input as Input3, Popover, useTranslation as useTranslation13 } from "@dxos/react-ui";
717
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
755
+ import { log as log2 } from "@dxos/log";
756
+ import { Button as Button4, Input as Input2, Popover, useTranslation as useTranslation12 } from "@dxos/react-ui";
757
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
718
758
  var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
719
759
  var PopoverRenameObject = ({ object: obj }) => {
720
- const { t } = useTranslation13(SPACE_PLUGIN);
760
+ const { t } = useTranslation12(SPACE_PLUGIN);
721
761
  const doneButton = useRef3(null);
722
762
  const object = obj;
723
763
  const [name, setName] = useState5(object.name || object.title || "");
@@ -728,10 +768,10 @@ var PopoverRenameObject = ({ object: obj }) => {
728
768
  try {
729
769
  object.title = name;
730
770
  } catch (err) {
731
- log.error("Failed to rename object", {
771
+ log2.error("Failed to rename object", {
732
772
  err
733
773
  }, {
734
- F: __dxlog_file,
774
+ F: __dxlog_file2,
735
775
  L: 30,
736
776
  S: void 0,
737
777
  C: (f, a) => f(...a)
@@ -748,9 +788,9 @@ var PopoverRenameObject = ({ object: obj }) => {
748
788
  }, /* @__PURE__ */ React13.createElement("div", {
749
789
  role: "none",
750
790
  className: "flex-1"
751
- }, /* @__PURE__ */ React13.createElement(Input3.Root, null, /* @__PURE__ */ React13.createElement(Input3.Label, {
791
+ }, /* @__PURE__ */ React13.createElement(Input2.Root, null, /* @__PURE__ */ React13.createElement(Input2.Label, {
752
792
  srOnly: true
753
- }, t("object name label")), /* @__PURE__ */ React13.createElement(Input3.TextInput, {
793
+ }, t("object name label")), /* @__PURE__ */ React13.createElement(Input2.TextInput, {
754
794
  placeholder: t("object title placeholder"),
755
795
  value: name,
756
796
  "data-testid": "spacePlugin.renameObject.input",
@@ -769,10 +809,10 @@ var PopoverRenameObject = ({ object: obj }) => {
769
809
 
770
810
  // packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
771
811
  import React14, { useCallback as useCallback9, useRef as useRef4, useState as useState6 } from "react";
772
- import { Button as Button5, Input as Input4, Popover as Popover2, useTranslation as useTranslation14 } from "@dxos/react-ui";
812
+ import { Button as Button5, Input as Input3, Popover as Popover2, useTranslation as useTranslation13 } from "@dxos/react-ui";
773
813
  var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
774
814
  var PopoverRenameSpace = ({ space }) => {
775
- const { t } = useTranslation14(SPACE_PLUGIN);
815
+ const { t } = useTranslation13(SPACE_PLUGIN);
776
816
  const doneButton = useRef4(null);
777
817
  const [name, setName] = useState6(space.properties.name ?? "");
778
818
  const handleDone = useCallback9(() => {
@@ -787,9 +827,9 @@ var PopoverRenameSpace = ({ space }) => {
787
827
  }, /* @__PURE__ */ React14.createElement("div", {
788
828
  role: "none",
789
829
  className: "flex-1"
790
- }, /* @__PURE__ */ React14.createElement(Input4.Root, null, /* @__PURE__ */ React14.createElement(Input4.Label, {
830
+ }, /* @__PURE__ */ React14.createElement(Input3.Root, null, /* @__PURE__ */ React14.createElement(Input3.Label, {
791
831
  srOnly: true
792
- }, t("space name label")), /* @__PURE__ */ React14.createElement(Input4.TextInput, {
832
+ }, t("space name label")), /* @__PURE__ */ React14.createElement(Input3.TextInput, {
793
833
  defaultValue: space.properties.name ?? "",
794
834
  placeholder: t("unnamed space label"),
795
835
  onChange: ({ target: { value } }) => setName(value),
@@ -810,7 +850,7 @@ var PopoverRenameSpace = ({ space }) => {
810
850
  // packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
811
851
  import React15 from "react";
812
852
  import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
813
- import { IconButton as IconButton4, useTranslation as useTranslation15 } from "@dxos/react-ui";
853
+ import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
814
854
  var ShareSpaceButton = ({ space }) => {
815
855
  const { dispatchPromise: dispatch } = useIntentDispatcher5();
816
856
  return /* @__PURE__ */ React15.createElement(ShareSpaceButtonImpl, {
@@ -820,8 +860,8 @@ var ShareSpaceButton = ({ space }) => {
820
860
  });
821
861
  };
822
862
  var ShareSpaceButtonImpl = ({ onClick }) => {
823
- const { t } = useTranslation15(SPACE_PLUGIN);
824
- return /* @__PURE__ */ React15.createElement(IconButton4, {
863
+ const { t } = useTranslation14(SPACE_PLUGIN);
864
+ return /* @__PURE__ */ React15.createElement(IconButton3, {
825
865
  "data-testid": "spacePlugin.shareSpaceButton",
826
866
  icon: "ph--users--regular",
827
867
  label: t("share space label"),
@@ -831,27 +871,26 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
831
871
 
832
872
  // packages/plugins/plugin-space/src/components/SpacePresence.tsx
833
873
  import React16, { useCallback as useCallback10, useEffect as useEffect4, useState as useState8 } from "react";
834
- import { useCapability as useCapability2 } from "@dxos/app-framework";
874
+ import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
835
875
  import { generateName } from "@dxos/display-name";
836
- import { useGraph as useGraph2 } from "@dxos/plugin-graph";
837
- import { PublicKey, useClient as useClient4 } from "@dxos/react-client";
876
+ import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
838
877
  import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId2 } from "@dxos/react-client/echo";
839
878
  import { useIdentity } from "@dxos/react-client/halo";
840
- import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation16, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
879
+ import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation15, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
841
880
  import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
842
881
  import { ComplexMap, keyToFallback } from "@dxos/util";
843
882
 
844
883
  // packages/plugins/plugin-space/src/capabilities/index.ts
845
884
  import { lazy } from "@dxos/app-framework";
846
- var AppGraphBuilder = lazy(() => import("./app-graph-builder-5D2QB43K.mjs"));
847
- var AppGraphSerializer = lazy(() => import("./app-graph-serializer-VNWPLPDF.mjs"));
848
- var IdentityCreated = lazy(() => import("./identity-created-EC5FOCX2.mjs"));
849
- var IntentResolver = lazy(() => import("./intent-resolver-Y6AZTVRL.mjs"));
850
- var ReactRoot = lazy(() => import("./react-root-4QQST3T2.mjs"));
851
- var ReactSurface = lazy(() => import("./react-surface-JTNUNOJG.mjs"));
852
- var SpaceSettings = lazy(() => import("./settings-ASFF5BZL.mjs"));
853
- var SpaceState = lazy(() => import("./state-MS4KYJWI.mjs"));
854
- var SpacesReady = lazy(() => import("./spaces-ready-4SFNS5JQ.mjs"));
885
+ var AppGraphBuilder = lazy(() => import("./app-graph-builder-GSS3V7IN.mjs"));
886
+ var AppGraphSerializer = lazy(() => import("./app-graph-serializer-QDXM5M6K.mjs"));
887
+ var IdentityCreated = lazy(() => import("./identity-created-25TK5XNO.mjs"));
888
+ var IntentResolver = lazy(() => import("./intent-resolver-LNTCXZ57.mjs"));
889
+ var ReactRoot = lazy(() => import("./react-root-Q7JJDCPB.mjs"));
890
+ var ReactSurface = lazy(() => import("./react-surface-BDMYLARO.mjs"));
891
+ var SpaceSettings = lazy(() => import("./settings-K4JPYYEM.mjs"));
892
+ var SpaceState = lazy(() => import("./state-6DCY5YJP.mjs"));
893
+ var SpacesReady = lazy(() => import("./spaces-ready-THYJEJYZ.mjs"));
855
894
 
856
895
  // packages/plugins/plugin-space/src/hooks/usePath.ts
857
896
  import { useEffect as useEffect3, useState as useState7 } from "react";
@@ -895,8 +934,8 @@ var ACTIVITY_DURATION = 3e4;
895
934
  var noViewers = new ComplexMap(PublicKey.hash);
896
935
  var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
897
936
  var SpacePresence = ({ object, spaceKey }) => {
898
- const spaceState = useCapability2(SpaceCapabilities.MutableState);
899
- const client = useClient4();
937
+ const spaceState = useCapability(SpaceCapabilities.MutableState);
938
+ const client = useClient5();
900
939
  const identity = useIdentity();
901
940
  const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
902
941
  const spaceMembers = useMembers(space?.key);
@@ -995,7 +1034,7 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
995
1034
  var SmallPresenceLive = ({ id, open, viewers }) => {
996
1035
  const { hasAttention, isAncestor, isRelated } = useAttention(id);
997
1036
  const isAttended = hasAttention || isAncestor || isRelated;
998
- const { graph } = useGraph2();
1037
+ const { graph } = useAppGraph2();
999
1038
  const attended = useAttended();
1000
1039
  const startOfAttention = attended.at(-1);
1001
1040
  const path = usePath(graph, startOfAttention);
@@ -1023,7 +1062,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
1023
1062
  });
1024
1063
  };
1025
1064
  var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1026
- const { t } = useTranslation16(SPACE_PLUGIN);
1065
+ const { t } = useTranslation15(SPACE_PLUGIN);
1027
1066
  return /* @__PURE__ */ React16.createElement(Tooltip2.Root, null, /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, {
1028
1067
  asChild: true
1029
1068
  }, /* @__PURE__ */ React16.createElement(AttentionGlyph, {
@@ -1040,13 +1079,13 @@ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1040
1079
 
1041
1080
  // packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
1042
1081
  import React17 from "react";
1043
- import { Input as Input5, useTranslation as useTranslation17 } from "@dxos/react-ui";
1044
- import { DeprecatedFormInput } from "@dxos/react-ui-form";
1082
+ import { Input as Input4, useTranslation as useTranslation16 } from "@dxos/react-ui";
1083
+ import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
1045
1084
  var SpacePluginSettings = ({ settings }) => {
1046
- const { t } = useTranslation17(SPACE_PLUGIN);
1047
- return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
1085
+ const { t } = useTranslation16(SPACE_PLUGIN);
1086
+ return /* @__PURE__ */ React17.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
1048
1087
  label: t("show hidden spaces label")
1049
- }, /* @__PURE__ */ React17.createElement(Input5.Switch, {
1088
+ }, /* @__PURE__ */ React17.createElement(Input4.Switch, {
1050
1089
  checked: settings.showHidden,
1051
1090
  onCheckedChange: (checked) => settings.showHidden = !!checked
1052
1091
  })));
@@ -1054,23 +1093,23 @@ var SpacePluginSettings = ({ settings }) => {
1054
1093
 
1055
1094
  // packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx
1056
1095
  import React18, { useCallback as useCallback11, useState as useState9 } from "react";
1057
- import { log as log2 } from "@dxos/log";
1096
+ import { log as log3 } from "@dxos/log";
1058
1097
  import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
1059
- import { useClient as useClient5 } from "@dxos/react-client";
1060
- import { Input as Input6, useTranslation as useTranslation18 } from "@dxos/react-ui";
1061
- import { DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
1062
- import { mx as mx4 } from "@dxos/react-ui-theme";
1063
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
1064
- var SpaceSettingsPanel = ({ classNames, space }) => {
1065
- const { t } = useTranslation18(SPACE_PLUGIN);
1066
- const client = useClient5();
1098
+ import { useClient as useClient6 } from "@dxos/react-client";
1099
+ import { Input as Input5, useTranslation as useTranslation17 } from "@dxos/react-ui";
1100
+ import { DeprecatedFormContainer as DeprecatedFormContainer2, DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
1101
+ import { HuePickerBlock } from "@dxos/react-ui-pickers";
1102
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
1103
+ var SpaceSettingsPanel = ({ space }) => {
1104
+ const { t } = useTranslation17(SPACE_PLUGIN);
1105
+ const client = useClient6();
1067
1106
  const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
1068
1107
  const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
1069
1108
  const toggleEdgeReplication = useCallback11(async (next) => {
1070
1109
  setEdgeReplication(next);
1071
1110
  await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
1072
- log2.catch(err, void 0, {
1073
- F: __dxlog_file2,
1111
+ log3.catch(err, void 0, {
1112
+ F: __dxlog_file3,
1074
1113
  L: 36,
1075
1114
  S: void 0,
1076
1115
  C: (f, a) => f(...a)
@@ -1080,35 +1119,39 @@ var SpaceSettingsPanel = ({ classNames, space }) => {
1080
1119
  }, [
1081
1120
  space
1082
1121
  ]);
1083
- return /* @__PURE__ */ React18.createElement("div", {
1084
- role: "form",
1085
- className: mx4("flex flex-col", classNames)
1086
- }, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1122
+ return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer2, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1087
1123
  label: t("name label")
1088
- }, /* @__PURE__ */ React18.createElement(Input6.TextInput, {
1124
+ }, /* @__PURE__ */ React18.createElement(Input5.TextInput, {
1089
1125
  placeholder: t("unnamed space label"),
1090
1126
  value: space.properties.name ?? "",
1091
1127
  onChange: (event) => {
1092
1128
  space.properties.name = event.target.value;
1093
1129
  }
1130
+ })), /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1131
+ label: t("hue label")
1132
+ }, /* @__PURE__ */ React18.createElement(HuePickerBlock, {
1133
+ hue: space.properties.hue,
1134
+ onChangeHue: (nextHue) => space.properties.hue = nextHue,
1135
+ onClickClear: () => space.properties.hue = void 0
1094
1136
  })), edgeEnabled && /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1095
1137
  label: t("edge replication label")
1096
- }, /* @__PURE__ */ React18.createElement(Input6.Switch, {
1138
+ }, /* @__PURE__ */ React18.createElement(Input5.Switch, {
1097
1139
  checked: edgeReplication,
1098
1140
  onCheckedChange: toggleEdgeReplication
1099
1141
  })));
1100
1142
  };
1101
1143
 
1102
1144
  // packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsDialog.tsx
1103
- import React19, { useState as useState10 } from "react";
1104
- import { useClient as useClient6 } from "@dxos/react-client";
1105
- import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation19 } from "@dxos/react-ui";
1145
+ import React19, { useMemo as useMemo2, useState as useState10 } from "react";
1146
+ import { Surface as Surface2, useCapabilities } from "@dxos/app-framework";
1147
+ import { useClient as useClient7 } from "@dxos/react-client";
1148
+ import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation18 } from "@dxos/react-ui";
1106
1149
  import { Tabs } from "@dxos/react-ui-tabs";
1107
1150
  import { SpacePanel } from "@dxos/shell/react";
1108
1151
  var SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
1109
1152
  var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
1110
- const { t } = useTranslation19(SPACE_PLUGIN);
1111
- const client = useClient6();
1153
+ const { t } = useTranslation18(SPACE_PLUGIN);
1154
+ const client = useClient7();
1112
1155
  const [tabsActivePart, setTabsActivePart] = useState10("list");
1113
1156
  const [selected, setSelected] = useState10(initialTab);
1114
1157
  const locked = space.properties[COMPOSER_SPACE_LOCK];
@@ -1116,6 +1159,12 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1116
1159
  personal: client.spaces.default === space,
1117
1160
  namesCache
1118
1161
  });
1162
+ const panels = useCapabilities(SpaceCapabilities.SettingsPanel);
1163
+ const data = useMemo2(() => ({
1164
+ subject: space
1165
+ }), [
1166
+ space
1167
+ ]);
1119
1168
  return (
1120
1169
  // TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
1121
1170
  // Consider factoring it out to the tabs package.
@@ -1168,7 +1217,10 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1168
1217
  }, t("settings tab label")), /* @__PURE__ */ React19.createElement(Tabs.Tab, {
1169
1218
  value: "members",
1170
1219
  disabled: locked
1171
- }, t("members tab label"))))), /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1220
+ }, t("members tab label")), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tab, {
1221
+ key: panel.id,
1222
+ value: panel.id
1223
+ }, toLocalizedString3(panel.label, t)))))), /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1172
1224
  value: "settings",
1173
1225
  classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1174
1226
  }, /* @__PURE__ */ React19.createElement(SpaceSettingsPanel, {
@@ -1181,25 +1233,32 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1181
1233
  hideHeading: true,
1182
1234
  target,
1183
1235
  createInvitationUrl
1236
+ }))), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1237
+ key: panel.id,
1238
+ value: panel.id,
1239
+ classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1240
+ }, /* @__PURE__ */ React19.createElement(Surface2, {
1241
+ role: `space-settings--${panel.id}`,
1242
+ data
1184
1243
  }))))))
1185
1244
  );
1186
1245
  };
1187
1246
 
1188
1247
  // packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
1189
1248
  import React20, { useEffect as useEffect6, useState as useState12 } from "react";
1190
- import { useGraph as useGraph3 } from "@dxos/plugin-graph";
1249
+ import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
1191
1250
  import { QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
1192
1251
  import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
1193
- import { useClient as useClient8 } from "@dxos/react-client";
1194
- import { Tooltip as Tooltip3, useTranslation as useTranslation20 } from "@dxos/react-ui";
1252
+ import { useClient as useClient9 } from "@dxos/react-client";
1253
+ import { Tooltip as Tooltip3, useTranslation as useTranslation19 } from "@dxos/react-ui";
1195
1254
  import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
1196
1255
 
1197
1256
  // packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts
1198
1257
  import { useEffect as useEffect5, useState as useState11 } from "react";
1199
1258
  import { Context } from "@dxos/context";
1200
1259
  import { EdgeService } from "@dxos/protocols";
1201
- import { useClient as useClient7 } from "@dxos/react-client";
1202
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
1260
+ import { useClient as useClient8 } from "@dxos/react-client";
1261
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
1203
1262
  var createEmptyEdgeSyncState = () => ({
1204
1263
  missingOnLocal: 0,
1205
1264
  missingOnRemote: 0,
@@ -1219,11 +1278,11 @@ var getSyncSummary = (syncMap) => {
1219
1278
  };
1220
1279
  var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
1221
1280
  var useSyncState = () => {
1222
- const client = useClient7();
1281
+ const client = useClient8();
1223
1282
  const [spaceState, setSpaceState] = useState11({});
1224
1283
  useEffect5(() => {
1225
1284
  const ctx = new Context(void 0, {
1226
- F: __dxlog_file3,
1285
+ F: __dxlog_file4,
1227
1286
  L: 48
1228
1287
  });
1229
1288
  const createSubscriptions = (spaces) => {
@@ -1258,7 +1317,7 @@ var useSpaceSyncState = (space) => {
1258
1317
  const [spaceState, setSpaceState] = useState11();
1259
1318
  useEffect5(() => {
1260
1319
  const ctx = new Context(void 0, {
1261
- F: __dxlog_file3,
1320
+ F: __dxlog_file4,
1262
1321
  L: 87
1263
1322
  });
1264
1323
  space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
@@ -1279,7 +1338,7 @@ var useSpaceSyncState = (space) => {
1279
1338
  // packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
1280
1339
  var useEdgeStatus = () => {
1281
1340
  const [status, setStatus] = useState12(QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
1282
- const client = useClient8();
1341
+ const client = useClient9();
1283
1342
  useEffect6(() => {
1284
1343
  client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
1285
1344
  setStatus(status2);
@@ -1290,11 +1349,11 @@ var useEdgeStatus = () => {
1290
1349
  return status;
1291
1350
  };
1292
1351
  var InlineSyncStatus = ({ space, open }) => {
1293
- const { t } = useTranslation20(SPACE_PLUGIN);
1352
+ const { t } = useTranslation19(SPACE_PLUGIN);
1294
1353
  const id = space.id;
1295
1354
  const { hasAttention, isAncestor, isRelated } = useAttention2(id);
1296
1355
  const isAttended = hasAttention || isAncestor || isRelated;
1297
- const { graph } = useGraph3();
1356
+ const { graph } = useAppGraph3();
1298
1357
  const attended = useAttended2();
1299
1358
  const startOfAttention = attended.at(-1);
1300
1359
  const path = usePath(graph, startOfAttention);
@@ -1319,16 +1378,16 @@ var InlineSyncStatus = ({ space, open }) => {
1319
1378
  // packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
1320
1379
  import React22, { useCallback as useCallback12, useEffect as useEffect8, useState as useState14 } from "react";
1321
1380
  import { StatusBar } from "@dxos/plugin-status-bar";
1322
- import { useClient as useClient10 } from "@dxos/react-client";
1323
- import { Icon as Icon6, Input as Input7, Popover as Popover3, useTranslation as useTranslation22 } from "@dxos/react-ui";
1381
+ import { useClient as useClient11 } from "@dxos/react-client";
1382
+ import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation21 } from "@dxos/react-ui";
1324
1383
  import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
1325
1384
  import { mx as mx6 } from "@dxos/react-ui-theme";
1326
1385
 
1327
1386
  // packages/plugins/plugin-space/src/components/SyncStatus/Space.tsx
1328
1387
  import React21, { useEffect as useEffect7, useState as useState13 } from "react";
1329
- import { useClient as useClient9 } from "@dxos/react-client";
1388
+ import { useClient as useClient10 } from "@dxos/react-client";
1330
1389
  import { useSpace } from "@dxos/react-client/echo";
1331
- import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation21 } from "@dxos/react-ui";
1390
+ import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation20 } from "@dxos/react-ui";
1332
1391
  import { mx as mx5 } from "@dxos/react-ui-theme";
1333
1392
  var SYNC_STALLED_TIMEOUT = 5e3;
1334
1393
  var styles = {
@@ -1360,8 +1419,8 @@ var useActive = (count) => {
1360
1419
  return active;
1361
1420
  };
1362
1421
  var SpaceRowContainer = ({ spaceId, state }) => {
1363
- const { t } = useTranslation21(SPACE_PLUGIN);
1364
- const client = useClient9();
1422
+ const { t } = useTranslation20(SPACE_PLUGIN);
1423
+ const client = useClient10();
1365
1424
  const space = useSpace(spaceId);
1366
1425
  if (!space) {
1367
1426
  return null;
@@ -1437,7 +1496,7 @@ var Bar = ({ classNames, count, total }) => {
1437
1496
 
1438
1497
  // packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts
1439
1498
  import { Context as Context2 } from "@dxos/context";
1440
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
1499
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
1441
1500
  var createClientSaveTracker = (client, cb) => {
1442
1501
  const unsubscribeCallbacks = {};
1443
1502
  const state = {};
@@ -1465,7 +1524,7 @@ var createClientSaveTracker = (client, cb) => {
1465
1524
  };
1466
1525
  var createSpaceSaveTracker = (space, cb) => {
1467
1526
  const ctx = new Context2(void 0, {
1468
- F: __dxlog_file4,
1527
+ F: __dxlog_file5,
1469
1528
  L: 40
1470
1529
  });
1471
1530
  void space.waitUntilReady().then(() => {
@@ -1528,7 +1587,7 @@ var getIcon = (status) => {
1528
1587
 
1529
1588
  // packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
1530
1589
  var SyncStatus = () => {
1531
- const client = useClient10();
1590
+ const client = useClient11();
1532
1591
  const state = useSyncState();
1533
1592
  const [saved, setSaved] = useState14(true);
1534
1593
  useEffect8(() => {
@@ -1542,7 +1601,7 @@ var SyncStatus = () => {
1542
1601
  });
1543
1602
  };
1544
1603
  var SyncStatusIndicator = ({ state, saved }) => {
1545
- const { t } = useTranslation22(SPACE_PLUGIN);
1604
+ const { t } = useTranslation21(SPACE_PLUGIN);
1546
1605
  const summary = getSyncSummary(state);
1547
1606
  const offline = Object.values(state).length === 0;
1548
1607
  const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
@@ -1583,18 +1642,16 @@ var SyncStatusIndicator = ({ state, saved }) => {
1583
1642
  asChild: true
1584
1643
  }, /* @__PURE__ */ React22.createElement(StatusBar.Button, {
1585
1644
  title
1586
- }, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, {
1587
- sideOffset: 16
1588
- }, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
1645
+ }, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, null, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
1589
1646
  state,
1590
1647
  summary,
1591
1648
  debug: false
1592
- }))));
1649
+ }), /* @__PURE__ */ React22.createElement(Popover3.Arrow, null))));
1593
1650
  }
1594
1651
  };
1595
1652
  var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
1596
1653
  const [showAll, setShowAll] = useState14(false);
1597
- const { t } = useTranslation22(SPACE_PLUGIN);
1654
+ const { t } = useTranslation21(SPACE_PLUGIN);
1598
1655
  const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
1599
1656
  const handleCheckedChange = useCallback12((state2) => setShowAll(state2), [
1600
1657
  setShowAll
@@ -1608,9 +1665,9 @@ var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
1608
1665
  className: "flex-1"
1609
1666
  }, t("sync status title")), /* @__PURE__ */ React22.createElement("div", {
1610
1667
  className: "flex items-center gap-2"
1611
- }, /* @__PURE__ */ React22.createElement(Input7.Root, null, /* @__PURE__ */ React22.createElement(Input7.Label, {
1668
+ }, /* @__PURE__ */ React22.createElement(Input6.Root, null, /* @__PURE__ */ React22.createElement(Input6.Label, {
1612
1669
  classNames: "text-xs"
1613
- }, t("show all label")), /* @__PURE__ */ React22.createElement(Input7.Checkbox, {
1670
+ }, t("show all label")), /* @__PURE__ */ React22.createElement(Input6.Checkbox, {
1614
1671
  checked: showAll,
1615
1672
  onCheckedChange: handleCheckedChange
1616
1673
  })))), /* @__PURE__ */ React22.createElement("div", {
@@ -1669,4 +1726,4 @@ export {
1669
1726
  SpaceState,
1670
1727
  SpacesReady
1671
1728
  };
1672
- //# sourceMappingURL=chunk-PDJ4MLA4.mjs.map
1729
+ //# sourceMappingURL=chunk-DIBLC24B.mjs.map