@dxos/plugin-space 0.7.5-labs.c0e040f → 0.7.5-labs.d199c0f

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 (220) hide show
  1. package/dist/lib/browser/{app-graph-builder-GSS3V7IN.mjs → app-graph-builder-MGK5HWPZ.mjs} +16 -95
  2. package/dist/lib/browser/app-graph-builder-MGK5HWPZ.mjs.map +7 -0
  3. package/dist/lib/browser/{app-graph-serializer-QDXM5M6K.mjs → app-graph-serializer-FOWFLYGU.mjs} +4 -4
  4. package/dist/lib/browser/{chunk-ZL5ZFGBK.mjs → chunk-23RVI5FZ.mjs} +15 -5
  5. package/dist/lib/browser/chunk-23RVI5FZ.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-RLZQJD47.mjs → chunk-NU7WDVGN.mjs} +2 -1
  7. package/dist/lib/browser/chunk-NU7WDVGN.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-DIBLC24B.mjs → chunk-S6B7627U.mjs} +293 -213
  9. package/dist/lib/browser/chunk-S6B7627U.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-SDK7RZI3.mjs → chunk-UDWHTKB5.mjs} +6 -3
  11. package/dist/lib/browser/chunk-UDWHTKB5.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-XPZ6IIXF.mjs → chunk-ULA2UQJ4.mjs} +15 -1
  13. package/dist/lib/browser/chunk-ULA2UQJ4.mjs.map +7 -0
  14. package/dist/lib/browser/{identity-created-25TK5XNO.mjs → identity-created-FYGS6TBH.mjs} +2 -2
  15. package/dist/lib/browser/index.mjs +53 -19
  16. package/dist/lib/browser/index.mjs.map +3 -3
  17. package/dist/lib/browser/{intent-resolver-LNTCXZ57.mjs → intent-resolver-QVR4MSJV.mjs} +26 -8
  18. package/dist/lib/browser/intent-resolver-QVR4MSJV.mjs.map +7 -0
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/{react-root-Q7JJDCPB.mjs → react-root-IP2ZB245.mjs} +5 -5
  21. package/dist/lib/browser/{react-surface-BDMYLARO.mjs → react-surface-BT3EHB6V.mjs} +16 -22
  22. package/dist/lib/browser/react-surface-BT3EHB6V.mjs.map +7 -0
  23. package/dist/lib/browser/schema-5W3DSY2E.mjs +24 -0
  24. package/dist/lib/browser/schema-5W3DSY2E.mjs.map +7 -0
  25. package/dist/lib/browser/{settings-K4JPYYEM.mjs → settings-PHPCXX33.mjs} +2 -2
  26. package/dist/lib/browser/{spaces-ready-THYJEJYZ.mjs → spaces-ready-K47RR7N2.mjs} +4 -4
  27. package/dist/lib/browser/{state-6DCY5YJP.mjs → state-INJ63O57.mjs} +2 -2
  28. package/dist/lib/browser/types/index.mjs +5 -3
  29. package/dist/lib/node/{app-graph-builder-V3RCGDV7.cjs → app-graph-builder-ZIUBXRPA.cjs} +43 -122
  30. package/dist/lib/node/app-graph-builder-ZIUBXRPA.cjs.map +7 -0
  31. package/dist/lib/node/{app-graph-serializer-H4UACG57.cjs → app-graph-serializer-VQOGHKXL.cjs} +20 -20
  32. package/dist/lib/node/{chunk-4AZ2DD4G.cjs → chunk-N2FS7PRA.cjs} +354 -273
  33. package/dist/lib/node/chunk-N2FS7PRA.cjs.map +7 -0
  34. package/dist/lib/node/{chunk-SYVPVU3K.cjs → chunk-OVGKWJOC.cjs} +50 -40
  35. package/dist/lib/node/chunk-OVGKWJOC.cjs.map +7 -0
  36. package/dist/lib/node/{chunk-D6BFKOXY.cjs → chunk-U6DYXAR3.cjs} +10 -7
  37. package/dist/lib/node/chunk-U6DYXAR3.cjs.map +7 -0
  38. package/dist/lib/node/{chunk-6MEOP3DH.cjs → chunk-WAJKBO3J.cjs} +21 -6
  39. package/dist/lib/node/chunk-WAJKBO3J.cjs.map +7 -0
  40. package/dist/lib/node/{chunk-UX3U4RU2.cjs → chunk-YZKNRFHU.cjs} +5 -4
  41. package/dist/lib/node/chunk-YZKNRFHU.cjs.map +7 -0
  42. package/dist/lib/node/{identity-created-7G5U7R36.cjs → identity-created-AXI64BLE.cjs} +6 -6
  43. package/dist/lib/node/index.cjs +106 -73
  44. package/dist/lib/node/index.cjs.map +3 -3
  45. package/dist/lib/node/{intent-resolver-CDE4M3TW.cjs → intent-resolver-MLENGECT.cjs} +76 -59
  46. package/dist/lib/node/intent-resolver-MLENGECT.cjs.map +7 -0
  47. package/dist/lib/node/meta.json +1 -1
  48. package/dist/lib/node/{react-root-JN6AIHMS.cjs → react-root-3OX5Z5CX.cjs} +10 -10
  49. package/dist/lib/node/{react-surface-XSK2QEQV.cjs → react-surface-5NYCMXSM.cjs} +49 -57
  50. package/dist/lib/node/react-surface-5NYCMXSM.cjs.map +7 -0
  51. package/dist/lib/node/schema-YN7WVFRX.cjs +40 -0
  52. package/dist/lib/node/schema-YN7WVFRX.cjs.map +7 -0
  53. package/dist/lib/node/{settings-TEELGWS4.cjs → settings-5QYFWNH7.cjs} +6 -6
  54. package/dist/lib/node/{spaces-ready-L4MJTFQ6.cjs → spaces-ready-FQNAKR7G.cjs} +13 -13
  55. package/dist/lib/node/{state-WPZC4JXB.cjs → state-57UE3DYE.cjs} +6 -6
  56. package/dist/lib/node/types/index.cjs +18 -16
  57. package/dist/lib/node/types/index.cjs.map +2 -2
  58. package/dist/lib/node-esm/{app-graph-builder-VFHK7OQI.mjs → app-graph-builder-TERVM2SL.mjs} +16 -95
  59. package/dist/lib/node-esm/app-graph-builder-TERVM2SL.mjs.map +7 -0
  60. package/dist/lib/node-esm/{app-graph-serializer-PIPJVXYZ.mjs → app-graph-serializer-GZRSWHEN.mjs} +4 -4
  61. package/dist/lib/node-esm/{chunk-4UX5WGKJ.mjs → chunk-2TQ2AJEZ.mjs} +6 -3
  62. package/dist/lib/node-esm/chunk-2TQ2AJEZ.mjs.map +7 -0
  63. package/dist/lib/node-esm/{chunk-LGL4A5B5.mjs → chunk-6RSVVEPS.mjs} +2 -1
  64. package/dist/lib/node-esm/chunk-6RSVVEPS.mjs.map +7 -0
  65. package/dist/lib/node-esm/{chunk-FTVEA5LO.mjs → chunk-DIKRH2IK.mjs} +293 -213
  66. package/dist/lib/node-esm/chunk-DIKRH2IK.mjs.map +7 -0
  67. package/dist/lib/node-esm/{chunk-RCZRYXI3.mjs → chunk-PGH5L7MV.mjs} +15 -5
  68. package/dist/lib/node-esm/chunk-PGH5L7MV.mjs.map +7 -0
  69. package/dist/lib/node-esm/{chunk-AAQRELDK.mjs → chunk-TRNZQEEN.mjs} +15 -1
  70. package/dist/lib/node-esm/chunk-TRNZQEEN.mjs.map +7 -0
  71. package/dist/lib/node-esm/{identity-created-7THGZ7EW.mjs → identity-created-3CGEXNPO.mjs} +2 -2
  72. package/dist/lib/node-esm/index.mjs +53 -19
  73. package/dist/lib/node-esm/index.mjs.map +3 -3
  74. package/dist/lib/node-esm/{intent-resolver-7L3GJAZE.mjs → intent-resolver-BLW4RM6X.mjs} +26 -8
  75. package/dist/lib/node-esm/intent-resolver-BLW4RM6X.mjs.map +7 -0
  76. package/dist/lib/node-esm/meta.json +1 -1
  77. package/dist/lib/node-esm/{react-root-BNA6PBFZ.mjs → react-root-7XXGP56B.mjs} +5 -5
  78. package/dist/lib/node-esm/{react-surface-FTI2LQNL.mjs → react-surface-R2ECJSFB.mjs} +16 -22
  79. package/dist/lib/node-esm/react-surface-R2ECJSFB.mjs.map +7 -0
  80. package/dist/lib/node-esm/schema-LOR2EVGY.mjs +25 -0
  81. package/dist/lib/node-esm/schema-LOR2EVGY.mjs.map +7 -0
  82. package/dist/lib/node-esm/{settings-KXYUZBLN.mjs → settings-H6MXTEQM.mjs} +2 -2
  83. package/dist/lib/node-esm/{spaces-ready-ZC2R73H3.mjs → spaces-ready-HKAQG5SA.mjs} +4 -4
  84. package/dist/lib/node-esm/{state-5GH2D5U4.mjs → state-VYA6OFHD.mjs} +2 -2
  85. package/dist/lib/node-esm/types/index.mjs +5 -3
  86. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/app-graph-builder.d.ts +88 -88
  88. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/capabilities.d.ts +2 -1
  90. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/index.d.ts +112 -111
  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/schema.d.ts +4 -0
  96. package/dist/types/src/capabilities/schema.d.ts.map +1 -0
  97. package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts +1 -2
  98. package/dist/types/src/components/AdvancedObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
  99. package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts +1 -2
  100. package/dist/types/src/components/AdvancedObjectSettings/ForeignKeys.d.ts.map +1 -1
  101. package/dist/types/src/components/AwaitingObject.d.ts +1 -2
  102. package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
  103. package/dist/types/src/components/BaseObjectSettings.d.ts +1 -2
  104. package/dist/types/src/components/BaseObjectSettings.d.ts.map +1 -1
  105. package/dist/types/src/components/CollectionMain.d.ts +1 -2
  106. package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
  107. package/dist/types/src/components/CollectionSection.d.ts +1 -2
  108. package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
  109. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -4
  110. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
  111. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
  112. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +5 -7
  113. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  114. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -2
  115. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
  116. package/dist/types/src/components/JoinDialog.d.ts +1 -2
  117. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  118. package/dist/types/src/components/MenuFooter.d.ts +1 -2
  119. package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
  120. package/dist/types/src/components/PersistenceStatus.d.ts +1 -2
  121. package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
  122. package/dist/types/src/components/PopoverAddSpace.d.ts +3 -0
  123. package/dist/types/src/components/PopoverAddSpace.d.ts.map +1 -0
  124. package/dist/types/src/components/PopoverRenameObject.d.ts +1 -2
  125. package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
  126. package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -2
  127. package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
  128. package/dist/types/src/components/ShareSpaceButton.d.ts +2 -3
  129. package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -1
  130. package/dist/types/src/components/SpacePluginSettings.d.ts +1 -2
  131. package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
  132. package/dist/types/src/components/SpacePresence.d.ts +4 -5
  133. package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
  134. package/dist/types/src/components/SpacePresence.stories.d.ts +2 -3
  135. package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
  136. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts +1 -2
  137. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -1
  138. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts +1 -2
  139. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
  140. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts +1 -2
  141. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
  142. package/dist/types/src/components/SyncStatus/Space.d.ts +2 -3
  143. package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -1
  144. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +3 -4
  145. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
  146. package/dist/types/src/components/index.d.ts +1 -0
  147. package/dist/types/src/components/index.d.ts.map +1 -1
  148. package/dist/types/src/events.d.ts +4 -0
  149. package/dist/types/src/events.d.ts.map +1 -1
  150. package/dist/types/src/index.d.ts +1 -1
  151. package/dist/types/src/index.d.ts.map +1 -1
  152. package/dist/types/src/translations.d.ts +9 -0
  153. package/dist/types/src/translations.d.ts.map +1 -1
  154. package/dist/types/src/types/collection.d.ts +2 -2
  155. package/dist/types/src/types/thread.d.ts +34 -34
  156. package/dist/types/src/types/types.d.ts +35 -10
  157. package/dist/types/src/types/types.d.ts.map +1 -1
  158. package/dist/types/src/util.d.ts +2 -2
  159. package/dist/types/src/util.d.ts.map +1 -1
  160. package/package.json +40 -39
  161. package/src/SpacePlugin.tsx +35 -11
  162. package/src/capabilities/app-graph-builder.ts +10 -84
  163. package/src/capabilities/capabilities.ts +3 -1
  164. package/src/capabilities/index.ts +1 -0
  165. package/src/capabilities/intent-resolver.ts +18 -0
  166. package/src/capabilities/react-surface.tsx +12 -28
  167. package/src/capabilities/schema.ts +27 -0
  168. package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +1 -3
  169. package/src/components/CreateDialog/CreateObjectDialog.tsx +29 -21
  170. package/src/components/CreateDialog/CreateObjectPanel.tsx +39 -41
  171. package/src/components/PopoverAddSpace.tsx +46 -0
  172. package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +22 -7
  173. package/src/components/index.ts +1 -0
  174. package/src/events.ts +6 -0
  175. package/src/index.ts +1 -1
  176. package/src/translations.ts +3 -0
  177. package/src/types/types.ts +21 -1
  178. package/src/util.tsx +7 -2
  179. package/dist/lib/browser/app-graph-builder-GSS3V7IN.mjs.map +0 -7
  180. package/dist/lib/browser/chunk-DIBLC24B.mjs.map +0 -7
  181. package/dist/lib/browser/chunk-RLZQJD47.mjs.map +0 -7
  182. package/dist/lib/browser/chunk-SDK7RZI3.mjs.map +0 -7
  183. package/dist/lib/browser/chunk-XPZ6IIXF.mjs.map +0 -7
  184. package/dist/lib/browser/chunk-ZL5ZFGBK.mjs.map +0 -7
  185. package/dist/lib/browser/intent-resolver-LNTCXZ57.mjs.map +0 -7
  186. package/dist/lib/browser/react-surface-BDMYLARO.mjs.map +0 -7
  187. package/dist/lib/node/app-graph-builder-V3RCGDV7.cjs.map +0 -7
  188. package/dist/lib/node/chunk-4AZ2DD4G.cjs.map +0 -7
  189. package/dist/lib/node/chunk-6MEOP3DH.cjs.map +0 -7
  190. package/dist/lib/node/chunk-D6BFKOXY.cjs.map +0 -7
  191. package/dist/lib/node/chunk-SYVPVU3K.cjs.map +0 -7
  192. package/dist/lib/node/chunk-UX3U4RU2.cjs.map +0 -7
  193. package/dist/lib/node/intent-resolver-CDE4M3TW.cjs.map +0 -7
  194. package/dist/lib/node/react-surface-XSK2QEQV.cjs.map +0 -7
  195. package/dist/lib/node-esm/app-graph-builder-VFHK7OQI.mjs.map +0 -7
  196. package/dist/lib/node-esm/chunk-4UX5WGKJ.mjs.map +0 -7
  197. package/dist/lib/node-esm/chunk-AAQRELDK.mjs.map +0 -7
  198. package/dist/lib/node-esm/chunk-FTVEA5LO.mjs.map +0 -7
  199. package/dist/lib/node-esm/chunk-LGL4A5B5.mjs.map +0 -7
  200. package/dist/lib/node-esm/chunk-RCZRYXI3.mjs.map +0 -7
  201. package/dist/lib/node-esm/intent-resolver-7L3GJAZE.mjs.map +0 -7
  202. package/dist/lib/node-esm/react-surface-FTI2LQNL.mjs.map +0 -7
  203. /package/dist/lib/browser/{app-graph-serializer-QDXM5M6K.mjs.map → app-graph-serializer-FOWFLYGU.mjs.map} +0 -0
  204. /package/dist/lib/browser/{identity-created-25TK5XNO.mjs.map → identity-created-FYGS6TBH.mjs.map} +0 -0
  205. /package/dist/lib/browser/{react-root-Q7JJDCPB.mjs.map → react-root-IP2ZB245.mjs.map} +0 -0
  206. /package/dist/lib/browser/{settings-K4JPYYEM.mjs.map → settings-PHPCXX33.mjs.map} +0 -0
  207. /package/dist/lib/browser/{spaces-ready-THYJEJYZ.mjs.map → spaces-ready-K47RR7N2.mjs.map} +0 -0
  208. /package/dist/lib/browser/{state-6DCY5YJP.mjs.map → state-INJ63O57.mjs.map} +0 -0
  209. /package/dist/lib/node/{app-graph-serializer-H4UACG57.cjs.map → app-graph-serializer-VQOGHKXL.cjs.map} +0 -0
  210. /package/dist/lib/node/{identity-created-7G5U7R36.cjs.map → identity-created-AXI64BLE.cjs.map} +0 -0
  211. /package/dist/lib/node/{react-root-JN6AIHMS.cjs.map → react-root-3OX5Z5CX.cjs.map} +0 -0
  212. /package/dist/lib/node/{settings-TEELGWS4.cjs.map → settings-5QYFWNH7.cjs.map} +0 -0
  213. /package/dist/lib/node/{spaces-ready-L4MJTFQ6.cjs.map → spaces-ready-FQNAKR7G.cjs.map} +0 -0
  214. /package/dist/lib/node/{state-WPZC4JXB.cjs.map → state-57UE3DYE.cjs.map} +0 -0
  215. /package/dist/lib/node-esm/{app-graph-serializer-PIPJVXYZ.mjs.map → app-graph-serializer-GZRSWHEN.mjs.map} +0 -0
  216. /package/dist/lib/node-esm/{identity-created-7THGZ7EW.mjs.map → identity-created-3CGEXNPO.mjs.map} +0 -0
  217. /package/dist/lib/node-esm/{react-root-BNA6PBFZ.mjs.map → react-root-7XXGP56B.mjs.map} +0 -0
  218. /package/dist/lib/node-esm/{settings-KXYUZBLN.mjs.map → settings-H6MXTEQM.mjs.map} +0 -0
  219. /package/dist/lib/node-esm/{spaces-ready-ZC2R73H3.mjs.map → spaces-ready-HKAQG5SA.mjs.map} +0 -0
  220. /package/dist/lib/node-esm/{state-5GH2D5U4.mjs.map → state-VYA6OFHD.mjs.map} +0 -0
@@ -1,16 +1,16 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  SpaceCapabilities
4
- } from "./chunk-LGL4A5B5.mjs";
4
+ } from "./chunk-6RSVVEPS.mjs";
5
5
  import {
6
6
  COMPOSER_SPACE_LOCK,
7
7
  getSpaceDisplayName
8
- } from "./chunk-RCZRYXI3.mjs";
8
+ } from "./chunk-PGH5L7MV.mjs";
9
9
  import {
10
10
  CollectionType,
11
11
  SpaceAction,
12
12
  SpaceForm
13
- } from "./chunk-AAQRELDK.mjs";
13
+ } from "./chunk-TRNZQEEN.mjs";
14
14
  import {
15
15
  SPACE_PLUGIN
16
16
  } from "./chunk-ICCM4YRJ.mjs";
@@ -229,20 +229,23 @@ var BaseObjectSettings = ({ object }) => {
229
229
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
230
230
  import { pipe } from "effect";
231
231
  import React6, { useCallback as useCallback5, useRef } from "react";
232
- import { chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
232
+ import { Capabilities, chain, createIntent as createIntent2, LayoutAction as LayoutAction2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager as usePluginManager2 } from "@dxos/app-framework";
233
+ import { invariant as invariant2 } from "@dxos/invariant";
233
234
  import { useClient as useClient2 } from "@dxos/react-client";
234
235
  import { getSpace, isReactiveObject, isSpace, useSpaces } from "@dxos/react-client/echo";
235
236
  import { Button as Button2, Dialog, Icon as Icon2, useTranslation as useTranslation6 } from "@dxos/react-ui";
236
237
 
237
238
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx
238
- import React5, { useCallback as useCallback4, useMemo, useState as useState3 } from "react";
239
+ import React5, { useCallback as useCallback4, useState as useState3 } from "react";
239
240
  import { Surface, isSurfaceAvailable, usePluginManager } from "@dxos/app-framework";
240
- import { getObjectAnnotation, S } from "@dxos/echo-schema";
241
+ import { getObjectAnnotation } from "@dxos/echo-schema";
242
+ import { invariant } from "@dxos/invariant";
241
243
  import { Icon, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
242
244
  import { Form as Form2 } from "@dxos/react-ui-form";
243
245
  import { SearchList } from "@dxos/react-ui-searchlist";
244
246
  import { mx as mx2 } from "@dxos/react-ui-theme";
245
247
  import { isNonNullable } from "@dxos/util";
248
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectPanel.tsx";
246
249
  var useInputSurfaceLookup = (baseData) => {
247
250
  const pluginManager = usePluginManager();
248
251
  return useCallback4(({ prop, schema, inputProps }) => {
@@ -267,12 +270,12 @@ var useInputSurfaceLookup = (baseData) => {
267
270
  baseData
268
271
  ]);
269
272
  };
270
- var CreateObjectPanel = ({ classNames, schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
273
+ var CreateObjectPanel = ({ classNames, forms, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
271
274
  const { t } = useTranslation5(SPACE_PLUGIN);
272
275
  const [typename, setTypename] = useState3(initialTypename);
273
276
  const [target, setTarget] = useState3(initialTarget);
274
- const schema = schemas.find((schema2) => getObjectAnnotation(schema2)?.typename === typename);
275
- const options = schemas.map(getObjectAnnotation).filter(isNonNullable).sort((a, b) => {
277
+ const form = forms.find((form2) => getObjectAnnotation(form2.objectSchema)?.typename === typename);
278
+ const options = forms.map((form2) => getObjectAnnotation(form2.objectSchema)).filter(isNonNullable).sort((a, b) => {
276
279
  const nameA = t("typename label", {
277
280
  ns: a.typename,
278
281
  defaultValue: a.typename
@@ -284,63 +287,68 @@ var CreateObjectPanel = ({ classNames, schemas, spaces, typename: initialTypenam
284
287
  return nameA.localeCompare(nameB);
285
288
  });
286
289
  const handleCreateObject = useCallback4(async (props) => {
287
- if (!schema || !target) {
290
+ if (!form || !target) {
288
291
  return;
289
292
  }
290
293
  await onCreateObject?.({
291
- schema,
294
+ form,
292
295
  target,
293
296
  data: props
294
297
  });
295
298
  }, [
296
299
  onCreateObject,
297
- schema,
300
+ form,
298
301
  target
299
302
  ]);
300
- const metadata = useMemo(() => {
301
- if (!typename) {
302
- return;
303
+ const handleSetTypename = useCallback4(async (typename2) => {
304
+ invariant(target, "target is required", {
305
+ F: __dxlog_file,
306
+ L: 94,
307
+ S: void 0,
308
+ A: [
309
+ "target",
310
+ "'target is required'"
311
+ ]
312
+ });
313
+ const form2 = forms.find((form3) => getObjectAnnotation(form3.objectSchema)?.typename === typename2);
314
+ if (form2 && !form2.formSchema) {
315
+ await onCreateObject?.({
316
+ form: form2,
317
+ target
318
+ });
319
+ } else {
320
+ setTypename(typename2);
303
321
  }
304
- return resolve?.(typename);
305
322
  }, [
306
- resolve,
307
- typename
323
+ forms,
324
+ onCreateObject,
325
+ target
308
326
  ]);
309
327
  const inputSurfaceLookup = useInputSurfaceLookup({
310
328
  target
311
329
  });
312
- const form = useMemo(() => {
313
- const schema2 = metadata?.creationSchema ?? S.Struct({
314
- name: S.optional(S.String)
315
- });
316
- return /* @__PURE__ */ React5.createElement(Form2, {
317
- classNames: "!p-0",
318
- autoFocus: true,
319
- values: {
320
- name: initialName
321
- },
322
- schema: schema2,
323
- testId: "create-object-form",
324
- onSave: handleCreateObject,
325
- lookupComponent: inputSurfaceLookup
326
- });
327
- }, [
328
- initialName,
329
- handleCreateObject,
330
- metadata
331
- ]);
332
330
  return /* @__PURE__ */ React5.createElement("div", {
333
331
  role: "form",
334
332
  className: mx2("flex flex-col gap-2", classNames)
335
- }, !schema ? /* @__PURE__ */ React5.createElement(SelectSchema, {
333
+ }, !form ? /* @__PURE__ */ React5.createElement(SelectSchema, {
336
334
  options,
337
335
  resolve,
338
- onChange: setTypename
336
+ onChange: handleSetTypename
339
337
  }) : !target ? /* @__PURE__ */ React5.createElement(SelectSpace, {
340
338
  spaces,
341
339
  defaultSpaceId,
342
340
  onChange: setTarget
343
- }) : form);
341
+ }) : form.formSchema ? /* @__PURE__ */ React5.createElement(Form2, {
342
+ classNames: "!p-0",
343
+ autoFocus: true,
344
+ values: {
345
+ name: initialName
346
+ },
347
+ schema: form.formSchema,
348
+ testId: "create-object-form",
349
+ onSave: handleCreateObject,
350
+ lookupComponent: inputSurfaceLookup
351
+ }) : void 0);
344
352
  };
345
353
  var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
346
354
  const { t } = useTranslation5(SPACE_PLUGIN);
@@ -406,23 +414,50 @@ var SelectSchema = ({ options, resolve, onChange }) => {
406
414
  }))))));
407
415
  };
408
416
 
417
+ // packages/plugins/plugin-space/src/capabilities/index.ts
418
+ import { lazy } from "@dxos/app-framework";
419
+ var AppGraphBuilder = lazy(() => import("./app-graph-builder-TERVM2SL.mjs"));
420
+ var AppGraphSerializer = lazy(() => import("./app-graph-serializer-GZRSWHEN.mjs"));
421
+ var IdentityCreated = lazy(() => import("./identity-created-3CGEXNPO.mjs"));
422
+ var IntentResolver = lazy(() => import("./intent-resolver-BLW4RM6X.mjs"));
423
+ var ReactRoot = lazy(() => import("./react-root-7XXGP56B.mjs"));
424
+ var ReactSurface = lazy(() => import("./react-surface-R2ECJSFB.mjs"));
425
+ var Schema = lazy(() => import("./schema-LOR2EVGY.mjs"));
426
+ var SpaceSettings = lazy(() => import("./settings-H6MXTEQM.mjs"));
427
+ var SpaceState = lazy(() => import("./state-VYA6OFHD.mjs"));
428
+ var SpacesReady = lazy(() => import("./spaces-ready-HKAQG5SA.mjs"));
429
+
409
430
  // packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
431
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
410
432
  var CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
411
- var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _shouldNavigate, resolve }) => {
433
+ var CreateObjectDialog = ({ target, typename, name, shouldNavigate: _shouldNavigate }) => {
412
434
  const closeRef = useRef(null);
435
+ const manager = usePluginManager2();
413
436
  const { t } = useTranslation6(SPACE_PLUGIN);
414
437
  const client = useClient2();
415
438
  const spaces = useSpaces();
416
439
  const { dispatchPromise: dispatch } = useIntentDispatcher2();
417
- const handleCreateObject = useCallback5(async ({ schema, target: _target, data }) => {
440
+ const forms = useCapabilities(SpaceCapabilities.ObjectForm);
441
+ const resolve = useCallback5((typename2) => manager.context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename2)?.metadata ?? {}, [
442
+ manager
443
+ ]);
444
+ const handleCreateObject = useCallback5(async ({ form, target: _target, data = {} }) => {
418
445
  const target2 = isSpace(_target) ? _target.properties[CollectionType.typename]?.target : _target;
419
- const createObjectIntent = resolve?.(schema.typename)?.createObject;
420
- if (!createObjectIntent || !target2) {
446
+ if (!target2) {
421
447
  return;
422
448
  }
423
449
  closeRef.current?.click();
424
450
  const space = isSpace(target2) ? target2 : getSpace(target2);
425
- const result = await dispatch(createObjectIntent(data, {
451
+ invariant2(space, "Missing space", {
452
+ F: __dxlog_file2,
453
+ L: 75,
454
+ S: void 0,
455
+ A: [
456
+ "space",
457
+ "'Missing space'"
458
+ ]
459
+ });
460
+ const result = await dispatch(form.getIntent(data, {
426
461
  space
427
462
  }));
428
463
  const object = result.data?.object;
@@ -464,7 +499,7 @@ var CreateObjectDialog = ({ schemas, target, typename, name, shouldNavigate: _sh
464
499
  size: 4
465
500
  })))), /* @__PURE__ */ React6.createElement(CreateObjectPanel, {
466
501
  classNames: "p-4",
467
- schemas,
502
+ forms,
468
503
  spaces,
469
504
  target,
470
505
  typename,
@@ -572,7 +607,7 @@ import { ObservabilityAction } from "@dxos/plugin-observability/types";
572
607
  import { useClient as useClient3 } from "@dxos/react-client";
573
608
  import { Dialog as Dialog3 } from "@dxos/react-ui";
574
609
  import { JoinPanel } from "@dxos/shell/react";
575
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/JoinDialog.tsx";
610
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/JoinDialog.tsx";
576
611
  var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
577
612
  var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
578
613
  const { dispatchPromise: dispatch } = useIntentDispatcher4();
@@ -611,7 +646,7 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
611
646
  const space = result?.spaceKey ? client.spaces.get(result.spaceKey) : void 0;
612
647
  if (!space) {
613
648
  log.warn("Space not found", result?.spaceKey, {
614
- F: __dxlog_file,
649
+ F: __dxlog_file3,
615
650
  L: 56,
616
651
  S: void 0,
617
652
  C: (f, a) => f(...a)
@@ -751,14 +786,58 @@ var PersistenceStatus = ({ db }) => {
751
786
  }
752
787
  };
753
788
 
789
+ // packages/plugins/plugin-space/src/components/PopoverAddSpace.tsx
790
+ import React13 from "react";
791
+ import { createIntent as createIntent5, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
792
+ import { IconButton as IconButton3, useTranslation as useTranslation12 } from "@dxos/react-ui";
793
+ var POPOVER_ADD_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
794
+ var PopoverAddSpace = () => {
795
+ const { t } = useTranslation12(SPACE_PLUGIN);
796
+ const { dispatchPromise: dispatch } = useIntentDispatcher5();
797
+ return /* @__PURE__ */ React13.createElement("div", {
798
+ role: "none",
799
+ className: "grid grid-cols-1 gap-1 [&>button]:justify-start"
800
+ }, /* @__PURE__ */ React13.createElement(IconButton3, {
801
+ variant: "ghost",
802
+ label: t("create space label"),
803
+ icon: "ph--plus--regular",
804
+ onClick: () => {
805
+ void dispatch(createIntent5(SpaceAction.OpenCreateSpace));
806
+ void dispatch(createIntent5(LayoutAction5.UpdatePopover, {
807
+ part: "popover",
808
+ options: {
809
+ anchorId: "",
810
+ state: false
811
+ }
812
+ }));
813
+ },
814
+ "data-testid": "spacePlugin.createSpace"
815
+ }), /* @__PURE__ */ React13.createElement(IconButton3, {
816
+ variant: "ghost",
817
+ label: t("join space label"),
818
+ icon: "ph--sign-in--regular",
819
+ onClick: () => {
820
+ void dispatch(createIntent5(SpaceAction.Join));
821
+ void dispatch(createIntent5(LayoutAction5.UpdatePopover, {
822
+ part: "popover",
823
+ options: {
824
+ anchorId: "",
825
+ state: false
826
+ }
827
+ }));
828
+ },
829
+ "data-testid": "spacePlugin.joinSpace"
830
+ }));
831
+ };
832
+
754
833
  // packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx
755
- import React13, { useCallback as useCallback8, useRef as useRef3, useState as useState5 } from "react";
834
+ import React14, { useCallback as useCallback8, useRef as useRef3, useState as useState5 } from "react";
756
835
  import { log as log2 } from "@dxos/log";
757
- import { Button as Button4, Input as Input2, Popover, useTranslation as useTranslation12 } from "@dxos/react-ui";
758
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
836
+ import { Button as Button4, Input as Input2, Popover, useTranslation as useTranslation13 } from "@dxos/react-ui";
837
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
759
838
  var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
760
839
  var PopoverRenameObject = ({ object: obj }) => {
761
- const { t } = useTranslation12(SPACE_PLUGIN);
840
+ const { t } = useTranslation13(SPACE_PLUGIN);
762
841
  const doneButton = useRef3(null);
763
842
  const object = obj;
764
843
  const [name, setName] = useState5(object.name || object.title || "");
@@ -772,7 +851,7 @@ var PopoverRenameObject = ({ object: obj }) => {
772
851
  log2.error("Failed to rename object", {
773
852
  err
774
853
  }, {
775
- F: __dxlog_file2,
854
+ F: __dxlog_file4,
776
855
  L: 30,
777
856
  S: void 0,
778
857
  C: (f, a) => f(...a)
@@ -783,23 +862,23 @@ var PopoverRenameObject = ({ object: obj }) => {
783
862
  object,
784
863
  name
785
864
  ]);
786
- return /* @__PURE__ */ React13.createElement("div", {
865
+ return /* @__PURE__ */ React14.createElement("div", {
787
866
  role: "none",
788
867
  className: "p-1 flex gap-2"
789
- }, /* @__PURE__ */ React13.createElement("div", {
868
+ }, /* @__PURE__ */ React14.createElement("div", {
790
869
  role: "none",
791
870
  className: "flex-1"
792
- }, /* @__PURE__ */ React13.createElement(Input2.Root, null, /* @__PURE__ */ React13.createElement(Input2.Label, {
871
+ }, /* @__PURE__ */ React14.createElement(Input2.Root, null, /* @__PURE__ */ React14.createElement(Input2.Label, {
793
872
  srOnly: true
794
- }, t("object name label")), /* @__PURE__ */ React13.createElement(Input2.TextInput, {
873
+ }, t("object name label")), /* @__PURE__ */ React14.createElement(Input2.TextInput, {
795
874
  placeholder: t("object title placeholder"),
796
875
  value: name,
797
876
  "data-testid": "spacePlugin.renameObject.input",
798
877
  onChange: ({ target: { value } }) => setName(value),
799
878
  onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
800
- }))), /* @__PURE__ */ React13.createElement(Popover.Close, {
879
+ }))), /* @__PURE__ */ React14.createElement(Popover.Close, {
801
880
  asChild: true
802
- }, /* @__PURE__ */ React13.createElement(Button4, {
881
+ }, /* @__PURE__ */ React14.createElement(Button4, {
803
882
  ref: doneButton,
804
883
  classNames: "self-stretch",
805
884
  onClick: handleDone
@@ -809,11 +888,11 @@ var PopoverRenameObject = ({ object: obj }) => {
809
888
  };
810
889
 
811
890
  // packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx
812
- import React14, { useCallback as useCallback9, useRef as useRef4, useState as useState6 } from "react";
813
- import { Button as Button5, Input as Input3, Popover as Popover2, useTranslation as useTranslation13 } from "@dxos/react-ui";
891
+ import React15, { useCallback as useCallback9, useRef as useRef4, useState as useState6 } from "react";
892
+ import { Button as Button5, Input as Input3, Popover as Popover2, useTranslation as useTranslation14 } from "@dxos/react-ui";
814
893
  var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
815
894
  var PopoverRenameSpace = ({ space }) => {
816
- const { t } = useTranslation13(SPACE_PLUGIN);
895
+ const { t } = useTranslation14(SPACE_PLUGIN);
817
896
  const doneButton = useRef4(null);
818
897
  const [name, setName] = useState6(space.properties.name ?? "");
819
898
  const handleDone = useCallback9(() => {
@@ -822,24 +901,24 @@ var PopoverRenameSpace = ({ space }) => {
822
901
  space,
823
902
  name
824
903
  ]);
825
- return /* @__PURE__ */ React14.createElement("div", {
904
+ return /* @__PURE__ */ React15.createElement("div", {
826
905
  role: "none",
827
906
  className: "p-1 flex gap-2"
828
- }, /* @__PURE__ */ React14.createElement("div", {
907
+ }, /* @__PURE__ */ React15.createElement("div", {
829
908
  role: "none",
830
909
  className: "flex-1"
831
- }, /* @__PURE__ */ React14.createElement(Input3.Root, null, /* @__PURE__ */ React14.createElement(Input3.Label, {
910
+ }, /* @__PURE__ */ React15.createElement(Input3.Root, null, /* @__PURE__ */ React15.createElement(Input3.Label, {
832
911
  srOnly: true
833
- }, t("space name label")), /* @__PURE__ */ React14.createElement(Input3.TextInput, {
912
+ }, t("space name label")), /* @__PURE__ */ React15.createElement(Input3.TextInput, {
834
913
  defaultValue: space.properties.name ?? "",
835
914
  placeholder: t("unnamed space label"),
836
915
  onChange: ({ target: { value } }) => setName(value),
837
916
  // TODO(wittjosiah): Ideally this should access the popover context to close the popover.
838
917
  // Currently this is not possible because Radix does not expose the popover context.
839
918
  onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
840
- }))), /* @__PURE__ */ React14.createElement(Popover2.Close, {
919
+ }))), /* @__PURE__ */ React15.createElement(Popover2.Close, {
841
920
  asChild: true
842
- }, /* @__PURE__ */ React14.createElement(Button5, {
921
+ }, /* @__PURE__ */ React15.createElement(Button5, {
843
922
  ref: doneButton,
844
923
  classNames: "self-stretch",
845
924
  onClick: handleDone
@@ -849,20 +928,20 @@ var PopoverRenameSpace = ({ space }) => {
849
928
  };
850
929
 
851
930
  // packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx
852
- import React15 from "react";
853
- import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
854
- import { IconButton as IconButton3, useTranslation as useTranslation14 } from "@dxos/react-ui";
931
+ import React16 from "react";
932
+ import { createIntent as createIntent6, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
933
+ import { IconButton as IconButton4, useTranslation as useTranslation15 } from "@dxos/react-ui";
855
934
  var ShareSpaceButton = ({ space }) => {
856
- const { dispatchPromise: dispatch } = useIntentDispatcher5();
857
- return /* @__PURE__ */ React15.createElement(ShareSpaceButtonImpl, {
858
- onClick: () => dispatch(createIntent5(SpaceAction.Share, {
935
+ const { dispatchPromise: dispatch } = useIntentDispatcher6();
936
+ return /* @__PURE__ */ React16.createElement(ShareSpaceButtonImpl, {
937
+ onClick: () => dispatch(createIntent6(SpaceAction.Share, {
859
938
  space
860
939
  }))
861
940
  });
862
941
  };
863
942
  var ShareSpaceButtonImpl = ({ onClick }) => {
864
- const { t } = useTranslation14(SPACE_PLUGIN);
865
- return /* @__PURE__ */ React15.createElement(IconButton3, {
943
+ const { t } = useTranslation15(SPACE_PLUGIN);
944
+ return /* @__PURE__ */ React16.createElement(IconButton4, {
866
945
  "data-testid": "spacePlugin.shareSpaceButton",
867
946
  icon: "ph--users--regular",
868
947
  label: t("share space label"),
@@ -871,28 +950,16 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
871
950
  };
872
951
 
873
952
  // packages/plugins/plugin-space/src/components/SpacePresence.tsx
874
- import React16, { useCallback as useCallback10, useEffect as useEffect4, useState as useState8 } from "react";
953
+ import React17, { useCallback as useCallback10, useEffect as useEffect4, useState as useState8 } from "react";
875
954
  import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
876
955
  import { generateName } from "@dxos/display-name";
877
956
  import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
878
957
  import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId2 } from "@dxos/react-client/echo";
879
958
  import { useIdentity } from "@dxos/react-client/halo";
880
- import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation15, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
959
+ import { Avatar, AvatarGroup, AvatarGroupItem, Tooltip as Tooltip2, useTranslation as useTranslation16, List as List2, ListItem as ListItem2, useDefaultValue } from "@dxos/react-ui";
881
960
  import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
882
961
  import { ComplexMap, keyToFallback } from "@dxos/util";
883
962
 
884
- // packages/plugins/plugin-space/src/capabilities/index.ts
885
- import { lazy } from "@dxos/app-framework";
886
- var AppGraphBuilder = lazy(() => import("./app-graph-builder-VFHK7OQI.mjs"));
887
- var AppGraphSerializer = lazy(() => import("./app-graph-serializer-PIPJVXYZ.mjs"));
888
- var IdentityCreated = lazy(() => import("./identity-created-7THGZ7EW.mjs"));
889
- var IntentResolver = lazy(() => import("./intent-resolver-7L3GJAZE.mjs"));
890
- var ReactRoot = lazy(() => import("./react-root-BNA6PBFZ.mjs"));
891
- var ReactSurface = lazy(() => import("./react-surface-FTI2LQNL.mjs"));
892
- var SpaceSettings = lazy(() => import("./settings-KXYUZBLN.mjs"));
893
- var SpaceState = lazy(() => import("./state-5GH2D5U4.mjs"));
894
- var SpacesReady = lazy(() => import("./spaces-ready-ZC2R73H3.mjs"));
895
-
896
963
  // packages/plugins/plugin-space/src/hooks/usePath.ts
897
964
  import { useEffect as useEffect3, useState as useState7 } from "react";
898
965
  var usePath = (graph, id, timeout) => {
@@ -963,7 +1030,7 @@ var SpacePresence = ({ object, spaceKey }) => {
963
1030
  lastSeen
964
1031
  };
965
1032
  }).toSorted((a, b) => a.lastSeen - b.lastSeen);
966
- return /* @__PURE__ */ React16.createElement(FullPresence, {
1033
+ return /* @__PURE__ */ React17.createElement(FullPresence, {
967
1034
  members: membersForObject
968
1035
  });
969
1036
  };
@@ -973,38 +1040,38 @@ var FullPresence = (props) => {
973
1040
  if (members.length === 0) {
974
1041
  return null;
975
1042
  }
976
- return /* @__PURE__ */ React16.createElement(AvatarGroup.Root, {
1043
+ return /* @__PURE__ */ React17.createElement(AvatarGroup.Root, {
977
1044
  size,
978
1045
  classNames: "mbs-2 mie-4",
979
1046
  "data-testid": "spacePlugin.presence"
980
- }, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React16.createElement(Tooltip2.Root, {
1047
+ }, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React17.createElement(Tooltip2.Root, {
981
1048
  key: member.identity.identityKey.toHex()
982
- }, /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React16.createElement(PrensenceAvatar, {
1049
+ }, /* @__PURE__ */ React17.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React17.createElement(PrensenceAvatar, {
983
1050
  identity: member.identity,
984
1051
  group: true,
985
1052
  match: member.currentlyAttended,
986
1053
  index: members.length - i,
987
1054
  onClick: () => onMemberClick?.(member)
988
- })), /* @__PURE__ */ React16.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React16.createElement(Tooltip2.Content, {
1055
+ })), /* @__PURE__ */ React17.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React17.createElement(Tooltip2.Content, {
989
1056
  side: "bottom"
990
- }, /* @__PURE__ */ React16.createElement("span", null, getName(member.identity)), /* @__PURE__ */ React16.createElement(Tooltip2.Arrow, null))))), members.length > 3 && /* @__PURE__ */ React16.createElement(Tooltip2.Root, null, /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React16.createElement(AvatarGroupItem.Root, {
1057
+ }, /* @__PURE__ */ React17.createElement("span", null, getName(member.identity)), /* @__PURE__ */ React17.createElement(Tooltip2.Arrow, null))))), members.length > 3 && /* @__PURE__ */ React17.createElement(Tooltip2.Root, null, /* @__PURE__ */ React17.createElement(Tooltip2.Trigger, null, /* @__PURE__ */ React17.createElement(AvatarGroupItem.Root, {
991
1058
  status: "inactive"
992
- }, /* @__PURE__ */ React16.createElement(Avatar.Frame, {
1059
+ }, /* @__PURE__ */ React17.createElement(Avatar.Frame, {
993
1060
  style: {
994
1061
  zIndex: members.length - 4
995
1062
  }
996
- }, /* @__PURE__ */ React16.createElement(Avatar.Fallback, {
1063
+ }, /* @__PURE__ */ React17.createElement(Avatar.Fallback, {
997
1064
  text: `+${members.length - 3}`
998
- })))), /* @__PURE__ */ React16.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React16.createElement(Tooltip2.Content, {
1065
+ })))), /* @__PURE__ */ React17.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React17.createElement(Tooltip2.Content, {
999
1066
  side: "bottom"
1000
- }, /* @__PURE__ */ React16.createElement(Tooltip2.Arrow, null), /* @__PURE__ */ React16.createElement(List2, {
1067
+ }, /* @__PURE__ */ React17.createElement(Tooltip2.Arrow, null), /* @__PURE__ */ React17.createElement(List2, {
1001
1068
  classNames: "max-h-56 overflow-y-auto"
1002
- }, members.map((member) => /* @__PURE__ */ React16.createElement(ListItem2.Root, {
1069
+ }, members.map((member) => /* @__PURE__ */ React17.createElement(ListItem2.Root, {
1003
1070
  key: member.identity.identityKey.toHex(),
1004
1071
  classNames: "flex gap-2 items-center cursor-pointer mbe-2",
1005
1072
  onClick: () => onMemberClick?.(member),
1006
1073
  "data-testid": "identity-list-item"
1007
- }, /* @__PURE__ */ React16.createElement(PrensenceAvatar, {
1074
+ }, /* @__PURE__ */ React17.createElement(PrensenceAvatar, {
1008
1075
  identity: member.identity,
1009
1076
  showName: true,
1010
1077
  match: member.currentlyAttended
@@ -1014,10 +1081,10 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
1014
1081
  const Root = group ? AvatarGroupItem.Root : Avatar.Root;
1015
1082
  const status = match ? "current" : "active";
1016
1083
  const fallbackValue = keyToFallback(identity.identityKey);
1017
- return /* @__PURE__ */ React16.createElement(Root, {
1084
+ return /* @__PURE__ */ React17.createElement(Root, {
1018
1085
  status,
1019
1086
  hue: identity.profile?.data?.hue || fallbackValue.hue
1020
- }, /* @__PURE__ */ React16.createElement(Avatar.Frame, {
1087
+ }, /* @__PURE__ */ React17.createElement(Avatar.Frame, {
1021
1088
  "data-testid": "spacePlugin.presence.member",
1022
1089
  "data-status": status,
1023
1090
  ...index ? {
@@ -1026,9 +1093,9 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
1026
1093
  }
1027
1094
  } : {},
1028
1095
  onClick: () => onClick?.()
1029
- }, /* @__PURE__ */ React16.createElement(Avatar.Fallback, {
1096
+ }, /* @__PURE__ */ React17.createElement(Avatar.Fallback, {
1030
1097
  text: identity.profile?.data?.emoji || fallbackValue.emoji
1031
- })), showName && /* @__PURE__ */ React16.createElement(Avatar.Label, {
1098
+ })), showName && /* @__PURE__ */ React17.createElement(Avatar.Label, {
1032
1099
  classNames: "text-sm truncate pli-2"
1033
1100
  }, getName(identity)));
1034
1101
  };
@@ -1056,53 +1123,53 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
1056
1123
  }, [
1057
1124
  viewers
1058
1125
  ]);
1059
- return /* @__PURE__ */ React16.createElement(SmallPresence, {
1126
+ return /* @__PURE__ */ React17.createElement(SmallPresence, {
1060
1127
  count: activeViewers.length,
1061
1128
  attended: isAttended,
1062
1129
  containsAttended
1063
1130
  });
1064
1131
  };
1065
1132
  var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1066
- const { t } = useTranslation15(SPACE_PLUGIN);
1067
- return /* @__PURE__ */ React16.createElement(Tooltip2.Root, null, /* @__PURE__ */ React16.createElement(Tooltip2.Trigger, {
1133
+ const { t } = useTranslation16(SPACE_PLUGIN);
1134
+ return /* @__PURE__ */ React17.createElement(Tooltip2.Root, null, /* @__PURE__ */ React17.createElement(Tooltip2.Trigger, {
1068
1135
  asChild: true
1069
- }, /* @__PURE__ */ React16.createElement(AttentionGlyph, {
1136
+ }, /* @__PURE__ */ React17.createElement(AttentionGlyph, {
1070
1137
  attended,
1071
1138
  containsAttended,
1072
1139
  presence: count > 1 ? "many" : count === 1 ? "one" : "none",
1073
1140
  classNames: "self-center mie-1"
1074
- })), /* @__PURE__ */ React16.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React16.createElement(Tooltip2.Content, {
1141
+ })), /* @__PURE__ */ React17.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React17.createElement(Tooltip2.Content, {
1075
1142
  side: "bottom"
1076
- }, /* @__PURE__ */ React16.createElement("span", null, t("presence label", {
1143
+ }, /* @__PURE__ */ React17.createElement("span", null, t("presence label", {
1077
1144
  count
1078
- })), /* @__PURE__ */ React16.createElement(Tooltip2.Arrow, null))));
1145
+ })), /* @__PURE__ */ React17.createElement(Tooltip2.Arrow, null))));
1079
1146
  };
1080
1147
 
1081
1148
  // packages/plugins/plugin-space/src/components/SpacePluginSettings.tsx
1082
- import React17 from "react";
1083
- import { Input as Input4, useTranslation as useTranslation16 } from "@dxos/react-ui";
1149
+ import React18 from "react";
1150
+ import { Input as Input4, useTranslation as useTranslation17 } from "@dxos/react-ui";
1084
1151
  import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
1085
1152
  var SpacePluginSettings = ({ settings }) => {
1086
- const { t } = useTranslation16(SPACE_PLUGIN);
1087
- return /* @__PURE__ */ React17.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React17.createElement(DeprecatedFormInput, {
1153
+ const { t } = useTranslation17(SPACE_PLUGIN);
1154
+ return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
1088
1155
  label: t("show hidden spaces label")
1089
- }, /* @__PURE__ */ React17.createElement(Input4.Switch, {
1156
+ }, /* @__PURE__ */ React18.createElement(Input4.Switch, {
1090
1157
  checked: settings.showHidden,
1091
1158
  onCheckedChange: (checked) => settings.showHidden = !!checked
1092
1159
  })));
1093
1160
  };
1094
1161
 
1095
1162
  // packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx
1096
- import React18, { useCallback as useCallback11, useState as useState9 } from "react";
1163
+ import React19, { useCallback as useCallback11, useState as useState9 } from "react";
1097
1164
  import { log as log3 } from "@dxos/log";
1098
1165
  import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
1099
1166
  import { useClient as useClient6 } from "@dxos/react-client";
1100
- import { Input as Input5, useTranslation as useTranslation17 } from "@dxos/react-ui";
1167
+ import { Input as Input5, Toolbar, useTranslation as useTranslation18 } from "@dxos/react-ui";
1101
1168
  import { DeprecatedFormContainer as DeprecatedFormContainer2, DeprecatedFormInput as DeprecatedFormInput2 } from "@dxos/react-ui-form";
1102
- import { HuePickerBlock } from "@dxos/react-ui-pickers";
1103
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
1169
+ import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
1170
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
1104
1171
  var SpaceSettingsPanel = ({ space }) => {
1105
- const { t } = useTranslation17(SPACE_PLUGIN);
1172
+ const { t } = useTranslation18(SPACE_PLUGIN);
1106
1173
  const client = useClient6();
1107
1174
  const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
1108
1175
  const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
@@ -1110,7 +1177,7 @@ var SpaceSettingsPanel = ({ space }) => {
1110
1177
  setEdgeReplication(next);
1111
1178
  await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
1112
1179
  log3.catch(err, void 0, {
1113
- F: __dxlog_file3,
1180
+ F: __dxlog_file5,
1114
1181
  L: 36,
1115
1182
  S: void 0,
1116
1183
  C: (f, a) => f(...a)
@@ -1120,38 +1187,48 @@ var SpaceSettingsPanel = ({ space }) => {
1120
1187
  }, [
1121
1188
  space
1122
1189
  ]);
1123
- return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer2, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1190
+ return /* @__PURE__ */ React19.createElement(DeprecatedFormContainer2, null, /* @__PURE__ */ React19.createElement(DeprecatedFormInput2, {
1124
1191
  label: t("name label")
1125
- }, /* @__PURE__ */ React18.createElement(Input5.TextInput, {
1192
+ }, /* @__PURE__ */ React19.createElement(Input5.TextInput, {
1126
1193
  placeholder: t("unnamed space label"),
1127
1194
  value: space.properties.name ?? "",
1128
1195
  onChange: (event) => {
1129
1196
  space.properties.name = event.target.value;
1130
1197
  }
1131
- })), /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1198
+ })), /* @__PURE__ */ React19.createElement(DeprecatedFormInput2, {
1199
+ label: t("icon label")
1200
+ }, /* @__PURE__ */ React19.createElement(Toolbar.Root, null, /* @__PURE__ */ React19.createElement(IconPicker, {
1201
+ value: space.properties.icon,
1202
+ onChange: (nextIcon) => space.properties.icon = nextIcon,
1203
+ onReset: () => {
1204
+ space.properties.icon = void 0;
1205
+ }
1206
+ }))), /* @__PURE__ */ React19.createElement(DeprecatedFormInput2, {
1132
1207
  label: t("hue label")
1133
- }, /* @__PURE__ */ React18.createElement(HuePickerBlock, {
1134
- hue: space.properties.hue,
1135
- onChangeHue: (nextHue) => space.properties.hue = nextHue,
1136
- onClickClear: () => space.properties.hue = void 0
1137
- })), edgeEnabled && /* @__PURE__ */ React18.createElement(DeprecatedFormInput2, {
1208
+ }, /* @__PURE__ */ React19.createElement(Toolbar.Root, null, /* @__PURE__ */ React19.createElement(HuePicker, {
1209
+ value: space.properties.hue,
1210
+ onChange: (nextHue) => space.properties.hue = nextHue,
1211
+ onReset: () => {
1212
+ space.properties.hue = void 0;
1213
+ }
1214
+ }))), edgeEnabled && /* @__PURE__ */ React19.createElement(DeprecatedFormInput2, {
1138
1215
  label: t("edge replication label")
1139
- }, /* @__PURE__ */ React18.createElement(Input5.Switch, {
1216
+ }, /* @__PURE__ */ React19.createElement(Input5.Switch, {
1140
1217
  checked: edgeReplication,
1141
1218
  onCheckedChange: toggleEdgeReplication
1142
1219
  })));
1143
1220
  };
1144
1221
 
1145
1222
  // packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsDialog.tsx
1146
- import React19, { useMemo as useMemo2, useState as useState10 } from "react";
1147
- import { Surface as Surface2, useCapabilities } from "@dxos/app-framework";
1223
+ import React20, { useMemo, useState as useState10 } from "react";
1224
+ import { Surface as Surface2, useCapabilities as useCapabilities2 } from "@dxos/app-framework";
1148
1225
  import { useClient as useClient7 } from "@dxos/react-client";
1149
- import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation18 } from "@dxos/react-ui";
1226
+ import { Button as Button6, Clipboard, Dialog as Dialog4, Icon as Icon4, toLocalizedString as toLocalizedString3, useTranslation as useTranslation19 } from "@dxos/react-ui";
1150
1227
  import { Tabs } from "@dxos/react-ui-tabs";
1151
1228
  import { SpacePanel } from "@dxos/shell/react";
1152
1229
  var SPACE_SETTINGS_DIALOG = `${SPACE_PLUGIN}/SpaceSettingsDialog`;
1153
1230
  var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
1154
- const { t } = useTranslation18(SPACE_PLUGIN);
1231
+ const { t } = useTranslation19(SPACE_PLUGIN);
1155
1232
  const client = useClient7();
1156
1233
  const [tabsActivePart, setTabsActivePart] = useState10("list");
1157
1234
  const [selected, setSelected] = useState10(initialTab);
@@ -1160,8 +1237,8 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1160
1237
  personal: client.spaces.default === space,
1161
1238
  namesCache
1162
1239
  });
1163
- const panels = useCapabilities(SpaceCapabilities.SettingsPanel);
1164
- const data = useMemo2(() => ({
1240
+ const panels = useCapabilities2(SpaceCapabilities.SettingsPanel);
1241
+ const data = useMemo(() => ({
1165
1242
  subject: space
1166
1243
  }), [
1167
1244
  space
@@ -1169,76 +1246,76 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1169
1246
  return (
1170
1247
  // TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
1171
1248
  // Consider factoring it out to the tabs package.
1172
- /* @__PURE__ */ React19.createElement(Dialog4.Content, {
1249
+ /* @__PURE__ */ React20.createElement(Dialog4.Content, {
1173
1250
  classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
1174
- }, /* @__PURE__ */ React19.createElement("div", {
1251
+ }, /* @__PURE__ */ React20.createElement("div", {
1175
1252
  role: "none",
1176
1253
  className: "flex justify-between pbs-2 pis-2 pie-2 @md:pbs-4 @md:pis-4 @md:pie-4"
1177
- }, /* @__PURE__ */ React19.createElement(Dialog4.Title, {
1254
+ }, /* @__PURE__ */ React20.createElement(Dialog4.Title, {
1178
1255
  onClick: () => setTabsActivePart("list"),
1179
1256
  "aria-description": t("click to return to tablist description"),
1180
1257
  classNames: "flex cursor-pointer items-center group/title"
1181
- }, /* @__PURE__ */ React19.createElement(Icon4, {
1258
+ }, /* @__PURE__ */ React20.createElement(Icon4, {
1182
1259
  icon: "ph--caret-left--regular",
1183
1260
  size: 4,
1184
1261
  classNames: [
1185
1262
  "@md:hidden",
1186
1263
  tabsActivePart === "list" && "invisible"
1187
1264
  ]
1188
- }), /* @__PURE__ */ React19.createElement("span", {
1265
+ }), /* @__PURE__ */ React20.createElement("span", {
1189
1266
  className: tabsActivePart !== "list" ? "group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1" : ""
1190
- }, toLocalizedString3(name, t))), /* @__PURE__ */ React19.createElement(Dialog4.Close, {
1267
+ }, toLocalizedString3(name, t))), /* @__PURE__ */ React20.createElement(Dialog4.Close, {
1191
1268
  asChild: true
1192
- }, /* @__PURE__ */ React19.createElement(Button6, {
1269
+ }, /* @__PURE__ */ React20.createElement(Button6, {
1193
1270
  density: "fine",
1194
1271
  variant: "ghost",
1195
1272
  autoFocus: true
1196
- }, /* @__PURE__ */ React19.createElement(Icon4, {
1273
+ }, /* @__PURE__ */ React20.createElement(Icon4, {
1197
1274
  icon: "ph--x--regular",
1198
1275
  size: 4
1199
- })))), /* @__PURE__ */ React19.createElement(Tabs.Root, {
1276
+ })))), /* @__PURE__ */ React20.createElement(Tabs.Root, {
1200
1277
  orientation: "vertical",
1201
1278
  value: selected,
1202
1279
  onValueChange: setSelected,
1203
1280
  activePart: tabsActivePart,
1204
1281
  onActivePartChange: setTabsActivePart,
1205
1282
  classNames: "flex flex-col flex-1 mbs-2"
1206
- }, /* @__PURE__ */ React19.createElement(Tabs.Viewport, {
1283
+ }, /* @__PURE__ */ React20.createElement(Tabs.Viewport, {
1207
1284
  classNames: "flex-1 min-bs-0"
1208
- }, /* @__PURE__ */ React19.createElement("div", {
1285
+ }, /* @__PURE__ */ React20.createElement("div", {
1209
1286
  role: "none",
1210
1287
  className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
1211
- }, /* @__PURE__ */ React19.createElement(Tabs.Tablist, {
1288
+ }, /* @__PURE__ */ React20.createElement(Tabs.Tablist, {
1212
1289
  classNames: "flex flex-col max-bs-none min-is-[200px] gap-4 overflow-y-auto"
1213
- }, /* @__PURE__ */ React19.createElement("div", {
1290
+ }, /* @__PURE__ */ React20.createElement("div", {
1214
1291
  role: "none",
1215
1292
  className: "flex flex-col ml-1"
1216
- }, /* @__PURE__ */ React19.createElement(Tabs.Tab, {
1293
+ }, /* @__PURE__ */ React20.createElement(Tabs.Tab, {
1217
1294
  value: "settings"
1218
- }, t("settings tab label")), /* @__PURE__ */ React19.createElement(Tabs.Tab, {
1295
+ }, t("settings tab label")), /* @__PURE__ */ React20.createElement(Tabs.Tab, {
1219
1296
  value: "members",
1220
1297
  disabled: locked
1221
- }, t("members tab label")), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tab, {
1298
+ }, t("members tab label")), panels.map((panel) => /* @__PURE__ */ React20.createElement(Tabs.Tab, {
1222
1299
  key: panel.id,
1223
1300
  value: panel.id
1224
- }, toLocalizedString3(panel.label, t)))))), /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1301
+ }, toLocalizedString3(panel.label, t)))))), /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
1225
1302
  value: "settings",
1226
1303
  classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1227
- }, /* @__PURE__ */ React19.createElement(SpaceSettingsPanel, {
1304
+ }, /* @__PURE__ */ React20.createElement(SpaceSettingsPanel, {
1228
1305
  space
1229
- })), /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1306
+ })), /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
1230
1307
  value: "members",
1231
1308
  classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1232
- }, /* @__PURE__ */ React19.createElement(Clipboard.Provider, null, /* @__PURE__ */ React19.createElement(SpacePanel, {
1309
+ }, /* @__PURE__ */ React20.createElement(Clipboard.Provider, null, /* @__PURE__ */ React20.createElement(SpacePanel, {
1233
1310
  space,
1234
1311
  hideHeading: true,
1235
1312
  target,
1236
1313
  createInvitationUrl
1237
- }))), panels.map((panel) => /* @__PURE__ */ React19.createElement(Tabs.Tabpanel, {
1314
+ }))), panels.map((panel) => /* @__PURE__ */ React20.createElement(Tabs.Tabpanel, {
1238
1315
  key: panel.id,
1239
1316
  value: panel.id,
1240
1317
  classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
1241
- }, /* @__PURE__ */ React19.createElement(Surface2, {
1318
+ }, /* @__PURE__ */ React20.createElement(Surface2, {
1242
1319
  role: `space-settings--${panel.id}`,
1243
1320
  data
1244
1321
  }))))))
@@ -1246,12 +1323,12 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
1246
1323
  };
1247
1324
 
1248
1325
  // packages/plugins/plugin-space/src/components/SyncStatus/InlineSyncStatus.tsx
1249
- import React20, { useEffect as useEffect6, useState as useState12 } from "react";
1326
+ import React21, { useEffect as useEffect6, useState as useState12 } from "react";
1250
1327
  import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
1251
1328
  import { QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
1252
1329
  import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
1253
1330
  import { useClient as useClient9 } from "@dxos/react-client";
1254
- import { Tooltip as Tooltip3, useTranslation as useTranslation19 } from "@dxos/react-ui";
1331
+ import { Tooltip as Tooltip3, useTranslation as useTranslation20 } from "@dxos/react-ui";
1255
1332
  import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
1256
1333
 
1257
1334
  // packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts
@@ -1259,7 +1336,7 @@ import { useEffect as useEffect5, useState as useState11 } from "react";
1259
1336
  import { Context } from "@dxos/context";
1260
1337
  import { EdgeService } from "@dxos/protocols";
1261
1338
  import { useClient as useClient8 } from "@dxos/react-client";
1262
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
1339
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
1263
1340
  var createEmptyEdgeSyncState = () => ({
1264
1341
  missingOnLocal: 0,
1265
1342
  missingOnRemote: 0,
@@ -1283,7 +1360,7 @@ var useSyncState = () => {
1283
1360
  const [spaceState, setSpaceState] = useState11({});
1284
1361
  useEffect5(() => {
1285
1362
  const ctx = new Context(void 0, {
1286
- F: __dxlog_file4,
1363
+ F: __dxlog_file6,
1287
1364
  L: 48
1288
1365
  });
1289
1366
  const createSubscriptions = (spaces) => {
@@ -1318,7 +1395,7 @@ var useSpaceSyncState = (space) => {
1318
1395
  const [spaceState, setSpaceState] = useState11();
1319
1396
  useEffect5(() => {
1320
1397
  const ctx = new Context(void 0, {
1321
- F: __dxlog_file4,
1398
+ F: __dxlog_file6,
1322
1399
  L: 87
1323
1400
  });
1324
1401
  space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
@@ -1350,7 +1427,7 @@ var useEdgeStatus = () => {
1350
1427
  return status;
1351
1428
  };
1352
1429
  var InlineSyncStatus = ({ space, open }) => {
1353
- const { t } = useTranslation19(SPACE_PLUGIN);
1430
+ const { t } = useTranslation20(SPACE_PLUGIN);
1354
1431
  const id = space.id;
1355
1432
  const { hasAttention, isAncestor, isRelated } = useAttention2(id);
1356
1433
  const isAttended = hasAttention || isAncestor || isRelated;
@@ -1363,32 +1440,32 @@ var InlineSyncStatus = ({ space, open }) => {
1363
1440
  const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
1364
1441
  const syncState = useSpaceSyncState(space);
1365
1442
  const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
1366
- return /* @__PURE__ */ React20.createElement(Tooltip3.Root, null, /* @__PURE__ */ React20.createElement(Tooltip3.Trigger, {
1443
+ return /* @__PURE__ */ React21.createElement(Tooltip3.Root, null, /* @__PURE__ */ React21.createElement(Tooltip3.Trigger, {
1367
1444
  asChild: true
1368
- }, /* @__PURE__ */ React20.createElement(AttentionGlyph2, {
1445
+ }, /* @__PURE__ */ React21.createElement(AttentionGlyph2, {
1369
1446
  syncing,
1370
1447
  attended: isAttended,
1371
1448
  containsAttended,
1372
1449
  classNames: "self-center mie-1"
1373
- })), /* @__PURE__ */ React20.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React20.createElement(Tooltip3.Content, {
1450
+ })), /* @__PURE__ */ React21.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React21.createElement(Tooltip3.Content, {
1374
1451
  side: "bottom",
1375
1452
  classNames: "z-[70]"
1376
- }, /* @__PURE__ */ React20.createElement("span", null, t("syncing label")), /* @__PURE__ */ React20.createElement(Tooltip3.Arrow, null))));
1453
+ }, /* @__PURE__ */ React21.createElement("span", null, t("syncing label")), /* @__PURE__ */ React21.createElement(Tooltip3.Arrow, null))));
1377
1454
  };
1378
1455
 
1379
1456
  // packages/plugins/plugin-space/src/components/SyncStatus/SyncStatus.tsx
1380
- import React22, { useCallback as useCallback12, useEffect as useEffect8, useState as useState14 } from "react";
1457
+ import React23, { useCallback as useCallback12, useEffect as useEffect8, useState as useState14 } from "react";
1381
1458
  import { StatusBar } from "@dxos/plugin-status-bar";
1382
1459
  import { useClient as useClient11 } from "@dxos/react-client";
1383
- import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation21 } from "@dxos/react-ui";
1460
+ import { Icon as Icon6, Input as Input6, Popover as Popover3, useTranslation as useTranslation22 } from "@dxos/react-ui";
1384
1461
  import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
1385
1462
  import { mx as mx6 } from "@dxos/react-ui-theme";
1386
1463
 
1387
1464
  // packages/plugins/plugin-space/src/components/SyncStatus/Space.tsx
1388
- import React21, { useEffect as useEffect7, useState as useState13 } from "react";
1465
+ import React22, { useEffect as useEffect7, useState as useState13 } from "react";
1389
1466
  import { useClient as useClient10 } from "@dxos/react-client";
1390
1467
  import { useSpace } from "@dxos/react-client/echo";
1391
- import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation20 } from "@dxos/react-ui";
1468
+ import { Icon as Icon5, toLocalizedString as toLocalizedString4, useTranslation as useTranslation21 } from "@dxos/react-ui";
1392
1469
  import { mx as mx5 } from "@dxos/react-ui-theme";
1393
1470
  var SYNC_STALLED_TIMEOUT = 5e3;
1394
1471
  var styles = {
@@ -1420,7 +1497,7 @@ var useActive = (count) => {
1420
1497
  return active;
1421
1498
  };
1422
1499
  var SpaceRowContainer = ({ spaceId, state }) => {
1423
- const { t } = useTranslation20(SPACE_PLUGIN);
1500
+ const { t } = useTranslation21(SPACE_PLUGIN);
1424
1501
  const client = useClient10();
1425
1502
  const space = useSpace(spaceId);
1426
1503
  if (!space) {
@@ -1429,7 +1506,7 @@ var SpaceRowContainer = ({ spaceId, state }) => {
1429
1506
  const spaceName = toLocalizedString4(getSpaceDisplayName(space, {
1430
1507
  personal: space === client.spaces.default
1431
1508
  }), t);
1432
- return /* @__PURE__ */ React21.createElement(SpaceRow, {
1509
+ return /* @__PURE__ */ React22.createElement(SpaceRow, {
1433
1510
  spaceId,
1434
1511
  spaceName,
1435
1512
  state
@@ -1438,19 +1515,19 @@ var SpaceRowContainer = ({ spaceId, state }) => {
1438
1515
  var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
1439
1516
  const downActive = useActive(localDocumentCount);
1440
1517
  const upActive = useActive(remoteDocumentCount);
1441
- return /* @__PURE__ */ React21.createElement("div", {
1518
+ return /* @__PURE__ */ React22.createElement("div", {
1442
1519
  className: "flex items-center mx-0.5 gap-0.5 cursor-pointer",
1443
1520
  title: spaceId,
1444
1521
  onClick: () => {
1445
1522
  void navigator.clipboard.writeText(spaceId);
1446
1523
  }
1447
- }, /* @__PURE__ */ React21.createElement("span", {
1524
+ }, /* @__PURE__ */ React22.createElement("span", {
1448
1525
  className: "is-1/2 truncate"
1449
- }, spaceName), /* @__PURE__ */ React21.createElement(Icon5, {
1526
+ }, spaceName), /* @__PURE__ */ React22.createElement(Icon5, {
1450
1527
  icon: "ph--arrow-fat-line-left--regular",
1451
1528
  size: 3,
1452
1529
  classNames: mx5(downActive && "animate-[pulse_1s_infinite]")
1453
- }), /* @__PURE__ */ React21.createElement(Candle, {
1530
+ }), /* @__PURE__ */ React22.createElement(Candle, {
1454
1531
  up: {
1455
1532
  count: remoteDocumentCount,
1456
1533
  total: remoteDocumentCount + missingOnRemote
@@ -1460,44 +1537,44 @@ var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumen
1460
1537
  total: localDocumentCount + missingOnLocal
1461
1538
  },
1462
1539
  title: spaceId
1463
- }), /* @__PURE__ */ React21.createElement(Icon5, {
1540
+ }), /* @__PURE__ */ React22.createElement(Icon5, {
1464
1541
  icon: "ph--arrow-fat-line-right--regular",
1465
1542
  size: 3,
1466
1543
  classNames: mx5(upActive && "animate-[pulse_1s_step-start_infinite]")
1467
1544
  }));
1468
1545
  };
1469
1546
  var Candle = ({ classNames, up, down }) => {
1470
- return /* @__PURE__ */ React21.createElement("div", {
1547
+ return /* @__PURE__ */ React22.createElement("div", {
1471
1548
  className: mx5("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
1472
- }, /* @__PURE__ */ React21.createElement(Bar, {
1549
+ }, /* @__PURE__ */ React22.createElement(Bar, {
1473
1550
  classNames: "justify-end",
1474
1551
  ...up
1475
- }), /* @__PURE__ */ React21.createElement("div", {
1552
+ }), /* @__PURE__ */ React22.createElement("div", {
1476
1553
  className: "relative"
1477
- }, /* @__PURE__ */ React21.createElement("div", {
1554
+ }, /* @__PURE__ */ React22.createElement("div", {
1478
1555
  className: mx5("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
1479
- }, up.total)), /* @__PURE__ */ React21.createElement(Bar, down));
1556
+ }, up.total)), /* @__PURE__ */ React22.createElement(Bar, down));
1480
1557
  };
1481
1558
  var Bar = ({ classNames, count, total }) => {
1482
1559
  let p = count / total * 100;
1483
1560
  if (count < total) {
1484
1561
  p = Math.min(p, 95);
1485
1562
  }
1486
- return /* @__PURE__ */ React21.createElement("div", {
1563
+ return /* @__PURE__ */ React22.createElement("div", {
1487
1564
  className: mx5("relative flex w-full", styles.barBg, classNames)
1488
- }, /* @__PURE__ */ React21.createElement("div", {
1565
+ }, /* @__PURE__ */ React22.createElement("div", {
1489
1566
  className: mx5("shrink-0", styles.barFg),
1490
1567
  style: {
1491
1568
  width: `${p}%`
1492
1569
  }
1493
- }), count !== total && /* @__PURE__ */ React21.createElement("div", {
1570
+ }), count !== total && /* @__PURE__ */ React22.createElement("div", {
1494
1571
  className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
1495
1572
  }, count));
1496
1573
  };
1497
1574
 
1498
1575
  // packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts
1499
1576
  import { Context as Context2 } from "@dxos/context";
1500
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
1577
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
1501
1578
  var createClientSaveTracker = (client, cb) => {
1502
1579
  const unsubscribeCallbacks = {};
1503
1580
  const state = {};
@@ -1525,7 +1602,7 @@ var createClientSaveTracker = (client, cb) => {
1525
1602
  };
1526
1603
  var createSpaceSaveTracker = (space, cb) => {
1527
1604
  const ctx = new Context2(void 0, {
1528
- F: __dxlog_file5,
1605
+ F: __dxlog_file7,
1529
1606
  L: 40
1530
1607
  });
1531
1608
  void space.waitUntilReady().then(() => {
@@ -1596,13 +1673,13 @@ var SyncStatus = () => {
1596
1673
  setSaved(state2 === "saved");
1597
1674
  });
1598
1675
  }, []);
1599
- return /* @__PURE__ */ React22.createElement(SyncStatusIndicator, {
1676
+ return /* @__PURE__ */ React23.createElement(SyncStatusIndicator, {
1600
1677
  state,
1601
1678
  saved
1602
1679
  });
1603
1680
  };
1604
1681
  var SyncStatusIndicator = ({ state, saved }) => {
1605
- const { t } = useTranslation21(SPACE_PLUGIN);
1682
+ const { t } = useTranslation22(SPACE_PLUGIN);
1606
1683
  const summary = getSyncSummary(state);
1607
1684
  const offline = Object.values(state).length === 0;
1608
1685
  const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
@@ -1629,58 +1706,58 @@ var SyncStatusIndicator = ({ state, saved }) => {
1629
1706
  needsToDownload
1630
1707
  ]);
1631
1708
  const title = t(`${status} label`);
1632
- const icon = /* @__PURE__ */ React22.createElement(Icon6, {
1709
+ const icon = /* @__PURE__ */ React23.createElement(Icon6, {
1633
1710
  icon: getIcon(status),
1634
1711
  size: 4,
1635
1712
  classNames
1636
1713
  });
1637
1714
  if (offline) {
1638
- return /* @__PURE__ */ React22.createElement(StatusBar.Item, {
1715
+ return /* @__PURE__ */ React23.createElement(StatusBar.Item, {
1639
1716
  title
1640
1717
  }, icon);
1641
1718
  } else {
1642
- return /* @__PURE__ */ React22.createElement(Popover3.Root, null, /* @__PURE__ */ React22.createElement(Popover3.Trigger, {
1719
+ return /* @__PURE__ */ React23.createElement(Popover3.Root, null, /* @__PURE__ */ React23.createElement(Popover3.Trigger, {
1643
1720
  asChild: true
1644
- }, /* @__PURE__ */ React22.createElement(StatusBar.Button, {
1721
+ }, /* @__PURE__ */ React23.createElement(StatusBar.Button, {
1645
1722
  title
1646
- }, icon)), /* @__PURE__ */ React22.createElement(Popover3.Portal, null, /* @__PURE__ */ React22.createElement(Popover3.Content, null, /* @__PURE__ */ React22.createElement(SyncStatusDetail, {
1723
+ }, icon)), /* @__PURE__ */ React23.createElement(Popover3.Portal, null, /* @__PURE__ */ React23.createElement(Popover3.Content, null, /* @__PURE__ */ React23.createElement(SyncStatusDetail, {
1647
1724
  state,
1648
1725
  summary,
1649
1726
  debug: false
1650
- }), /* @__PURE__ */ React22.createElement(Popover3.Arrow, null))));
1727
+ }), /* @__PURE__ */ React23.createElement(Popover3.Arrow, null))));
1651
1728
  }
1652
1729
  };
1653
1730
  var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
1654
1731
  const [showAll, setShowAll] = useState14(false);
1655
- const { t } = useTranslation21(SPACE_PLUGIN);
1732
+ const { t } = useTranslation22(SPACE_PLUGIN);
1656
1733
  const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
1657
1734
  const handleCheckedChange = useCallback12((state2) => setShowAll(state2), [
1658
1735
  setShowAll
1659
1736
  ]);
1660
- return /* @__PURE__ */ React22.createElement("div", {
1737
+ return /* @__PURE__ */ React23.createElement("div", {
1661
1738
  className: mx6("flex flex-col gap-3 p-2 text-xs min-w-96", classNames)
1662
- }, /* @__PURE__ */ React22.createElement("div", {
1739
+ }, /* @__PURE__ */ React23.createElement("div", {
1663
1740
  role: "none",
1664
1741
  className: "flex items-center"
1665
- }, /* @__PURE__ */ React22.createElement("h1", {
1742
+ }, /* @__PURE__ */ React23.createElement("h1", {
1666
1743
  className: "flex-1"
1667
- }, t("sync status title")), /* @__PURE__ */ React22.createElement("div", {
1744
+ }, t("sync status title")), /* @__PURE__ */ React23.createElement("div", {
1668
1745
  className: "flex items-center gap-2"
1669
- }, /* @__PURE__ */ React22.createElement(Input6.Root, null, /* @__PURE__ */ React22.createElement(Input6.Label, {
1746
+ }, /* @__PURE__ */ React23.createElement(Input6.Root, null, /* @__PURE__ */ React23.createElement(Input6.Label, {
1670
1747
  classNames: "text-xs"
1671
- }, t("show all label")), /* @__PURE__ */ React22.createElement(Input6.Checkbox, {
1748
+ }, t("show all label")), /* @__PURE__ */ React23.createElement(Input6.Checkbox, {
1672
1749
  checked: showAll,
1673
1750
  onCheckedChange: handleCheckedChange
1674
- })))), /* @__PURE__ */ React22.createElement("div", {
1751
+ })))), /* @__PURE__ */ React23.createElement("div", {
1675
1752
  className: "flex flex-col gap-2"
1676
- }, entries.length === 0 && /* @__PURE__ */ React22.createElement("div", {
1753
+ }, entries.length === 0 && /* @__PURE__ */ React23.createElement("div", {
1677
1754
  role: "none",
1678
1755
  className: "flex justify-center"
1679
- }, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ React22.createElement(SpaceRowContainer, {
1756
+ }, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ React23.createElement(SpaceRowContainer, {
1680
1757
  key: spaceId,
1681
1758
  spaceId,
1682
1759
  state: state2
1683
- }))), debug && /* @__PURE__ */ React22.createElement(SyntaxHighlighter, {
1760
+ }))), debug && /* @__PURE__ */ React23.createElement(SyntaxHighlighter, {
1684
1761
  language: "json"
1685
1762
  }, JSON.stringify(summary, null, 2)));
1686
1763
  };
@@ -1699,6 +1776,8 @@ export {
1699
1776
  JoinDialog,
1700
1777
  MenuFooter,
1701
1778
  PersistenceStatus,
1779
+ POPOVER_ADD_SPACE,
1780
+ PopoverAddSpace,
1702
1781
  POPOVER_RENAME_OBJECT,
1703
1782
  PopoverRenameObject,
1704
1783
  POPOVER_RENAME_SPACE,
@@ -1723,8 +1802,9 @@ export {
1723
1802
  IntentResolver,
1724
1803
  ReactRoot,
1725
1804
  ReactSurface,
1805
+ Schema,
1726
1806
  SpaceSettings,
1727
1807
  SpaceState,
1728
1808
  SpacesReady
1729
1809
  };
1730
- //# sourceMappingURL=chunk-FTVEA5LO.mjs.map
1810
+ //# sourceMappingURL=chunk-DIKRH2IK.mjs.map