@dxos/plugin-space 0.8.4-main.fd6878d → 0.8.4-main.fffef41

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 (366) hide show
  1. package/dist/lib/browser/{CollectionMain-D2B75XBS.mjs → CollectionArticle-WTHWY4YS.mjs} +10 -10
  2. package/dist/lib/browser/CollectionArticle-WTHWY4YS.mjs.map +7 -0
  3. package/dist/lib/browser/ObjectDetailsPanel-2BRUBHP6.mjs +141 -0
  4. package/dist/lib/browser/ObjectDetailsPanel-2BRUBHP6.mjs.map +7 -0
  5. package/dist/lib/browser/ObjectSettings-5LLWCVEK.mjs +144 -0
  6. package/dist/lib/browser/ObjectSettings-5LLWCVEK.mjs.map +7 -0
  7. package/dist/lib/browser/RecordArticle-SXDRWTTU.mjs +116 -0
  8. package/dist/lib/browser/RecordArticle-SXDRWTTU.mjs.map +7 -0
  9. package/dist/lib/browser/{app-graph-builder-VZW75QPJ.mjs → app-graph-builder-DTM7BJ6D.mjs} +114 -97
  10. package/dist/lib/browser/app-graph-builder-DTM7BJ6D.mjs.map +7 -0
  11. package/dist/lib/browser/{app-graph-serializer-YPHYVZAP.mjs → app-graph-serializer-TIKXF43P.mjs} +19 -19
  12. package/dist/lib/browser/app-graph-serializer-TIKXF43P.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-AFUOMLX6.mjs +167 -0
  14. package/dist/lib/browser/chunk-AFUOMLX6.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-PSIBVBTA.mjs → chunk-CKACGS7T.mjs} +576 -500
  16. package/dist/lib/browser/chunk-CKACGS7T.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-K5J7ZB5P.mjs +20 -0
  18. package/dist/lib/browser/chunk-K5J7ZB5P.mjs.map +7 -0
  19. package/dist/lib/browser/{chunk-SMB4DGYO.mjs → chunk-KFUMADZF.mjs} +184 -60
  20. package/dist/lib/browser/chunk-KFUMADZF.mjs.map +7 -0
  21. package/dist/lib/browser/{chunk-WAXS2ZVX.mjs → chunk-VGKOXAPE.mjs} +27 -13
  22. package/dist/lib/browser/chunk-VGKOXAPE.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-VZBIIYFM.mjs +16 -0
  24. package/dist/lib/browser/chunk-VZBIIYFM.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-WJXU4GKV.mjs +19 -0
  26. package/dist/lib/browser/chunk-WJXU4GKV.mjs.map +7 -0
  27. package/dist/lib/browser/{chunk-3UFG6LQQ.mjs → chunk-ZQMSGD5J.mjs} +44 -22
  28. package/dist/lib/browser/chunk-ZQMSGD5J.mjs.map +7 -0
  29. package/dist/lib/browser/{identity-created-T6ZNVE7S.mjs → identity-created-NAXTPQXE.mjs} +5 -5
  30. package/dist/lib/browser/identity-created-NAXTPQXE.mjs.map +7 -0
  31. package/dist/lib/browser/index.mjs +89 -91
  32. package/dist/lib/browser/index.mjs.map +3 -3
  33. package/dist/lib/browser/{intent-resolver-TS6CCKST.mjs → intent-resolver-3FNTO3VW.mjs} +103 -85
  34. package/dist/lib/browser/intent-resolver-3FNTO3VW.mjs.map +7 -0
  35. package/dist/lib/browser/meta.json +1 -1
  36. package/dist/lib/browser/react-root-Q7VBWBES.mjs +30 -0
  37. package/dist/lib/browser/react-root-Q7VBWBES.mjs.map +7 -0
  38. package/dist/lib/browser/{react-surface-V3ARS2BP.mjs → react-surface-TTHS332A.mjs} +75 -109
  39. package/dist/lib/browser/react-surface-TTHS332A.mjs.map +7 -0
  40. package/dist/lib/browser/{schema-defs-5LBA43X5.mjs → schema-defs-QPI2JU3X.mjs} +6 -6
  41. package/dist/lib/browser/schema-defs-QPI2JU3X.mjs.map +7 -0
  42. package/dist/lib/browser/{settings-FLLBP5KI.mjs → settings-45PGPO2V.mjs} +5 -5
  43. package/dist/lib/browser/{settings-FLLBP5KI.mjs.map → settings-45PGPO2V.mjs.map} +1 -1
  44. package/dist/lib/browser/{spaces-ready-FXEP6XEW.mjs → spaces-ready-QCND4DVY.mjs} +15 -14
  45. package/dist/lib/browser/spaces-ready-QCND4DVY.mjs.map +7 -0
  46. package/dist/lib/browser/{state-K3UBPKYP.mjs → state-Q7YRE5KG.mjs} +7 -7
  47. package/dist/lib/browser/state-Q7YRE5KG.mjs.map +7 -0
  48. package/dist/lib/browser/types/index.mjs +2 -2
  49. package/dist/lib/node-esm/{CollectionMain-ZJIFCWKZ.mjs → CollectionArticle-KHXYT3SH.mjs} +10 -10
  50. package/dist/lib/node-esm/CollectionArticle-KHXYT3SH.mjs.map +7 -0
  51. package/dist/lib/node-esm/ObjectDetailsPanel-6PZQIQG3.mjs +142 -0
  52. package/dist/lib/node-esm/ObjectDetailsPanel-6PZQIQG3.mjs.map +7 -0
  53. package/dist/lib/node-esm/ObjectSettings-OQSBOH7K.mjs +145 -0
  54. package/dist/lib/node-esm/ObjectSettings-OQSBOH7K.mjs.map +7 -0
  55. package/dist/lib/node-esm/RecordArticle-NACBH42P.mjs +117 -0
  56. package/dist/lib/node-esm/RecordArticle-NACBH42P.mjs.map +7 -0
  57. package/dist/lib/node-esm/{app-graph-builder-XNVQOJLE.mjs → app-graph-builder-FBJFWI4H.mjs} +114 -97
  58. package/dist/lib/node-esm/app-graph-builder-FBJFWI4H.mjs.map +7 -0
  59. package/dist/lib/node-esm/{app-graph-serializer-PKVLWV6V.mjs → app-graph-serializer-BESQZAYU.mjs} +19 -19
  60. package/dist/lib/node-esm/app-graph-serializer-BESQZAYU.mjs.map +7 -0
  61. package/dist/lib/node-esm/{chunk-S7MKRQHY.mjs → chunk-6VEONPNZ.mjs} +44 -22
  62. package/dist/lib/node-esm/chunk-6VEONPNZ.mjs.map +7 -0
  63. package/dist/lib/node-esm/chunk-6ZQGZBEP.mjs +168 -0
  64. package/dist/lib/node-esm/chunk-6ZQGZBEP.mjs.map +7 -0
  65. package/dist/lib/node-esm/chunk-BDEFTL6K.mjs +18 -0
  66. package/dist/lib/node-esm/chunk-BDEFTL6K.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-H4JILUJK.mjs +20 -0
  68. package/dist/lib/node-esm/chunk-H4JILUJK.mjs.map +7 -0
  69. package/dist/lib/node-esm/{chunk-CTQMR7E3.mjs → chunk-OK2L7N2F.mjs} +184 -60
  70. package/dist/lib/node-esm/chunk-OK2L7N2F.mjs.map +7 -0
  71. package/dist/lib/node-esm/{chunk-HYIZVPOA.mjs → chunk-QBRPYAEL.mjs} +27 -13
  72. package/dist/lib/node-esm/chunk-QBRPYAEL.mjs.map +7 -0
  73. package/dist/lib/node-esm/{chunk-KYUHPPRN.mjs → chunk-XGAMJC5C.mjs} +576 -500
  74. package/dist/lib/node-esm/chunk-XGAMJC5C.mjs.map +7 -0
  75. package/dist/lib/node-esm/chunk-Z7BB6HC2.mjs +21 -0
  76. package/dist/lib/node-esm/chunk-Z7BB6HC2.mjs.map +7 -0
  77. package/dist/lib/node-esm/{identity-created-AL7NNCKH.mjs → identity-created-OXLKCJE3.mjs} +5 -5
  78. package/dist/lib/node-esm/identity-created-OXLKCJE3.mjs.map +7 -0
  79. package/dist/lib/node-esm/index.mjs +89 -91
  80. package/dist/lib/node-esm/index.mjs.map +3 -3
  81. package/dist/lib/node-esm/{intent-resolver-W6P27SCF.mjs → intent-resolver-6O5FSB7Z.mjs} +103 -85
  82. package/dist/lib/node-esm/intent-resolver-6O5FSB7Z.mjs.map +7 -0
  83. package/dist/lib/node-esm/meta.json +1 -1
  84. package/dist/lib/node-esm/{react-root-N27KETKT.mjs → react-root-K66W3FMA.mjs} +13 -12
  85. package/dist/lib/node-esm/react-root-K66W3FMA.mjs.map +7 -0
  86. package/dist/lib/node-esm/{react-surface-TNPAUQCM.mjs → react-surface-Y7FTEIDF.mjs} +75 -109
  87. package/dist/lib/node-esm/react-surface-Y7FTEIDF.mjs.map +7 -0
  88. package/dist/lib/node-esm/{schema-defs-TPWZPDCR.mjs → schema-defs-ZS2D47XW.mjs} +6 -6
  89. package/dist/lib/node-esm/schema-defs-ZS2D47XW.mjs.map +7 -0
  90. package/dist/lib/node-esm/{settings-WKUWY3P6.mjs → settings-6FO65BA6.mjs} +5 -5
  91. package/dist/lib/node-esm/{settings-WKUWY3P6.mjs.map → settings-6FO65BA6.mjs.map} +1 -1
  92. package/dist/lib/node-esm/{spaces-ready-PQLLIO5W.mjs → spaces-ready-P7CKVXBE.mjs} +15 -14
  93. package/dist/lib/node-esm/spaces-ready-P7CKVXBE.mjs.map +7 -0
  94. package/dist/lib/node-esm/{state-4M5A6OSB.mjs → state-362I5BMK.mjs} +7 -7
  95. package/dist/lib/node-esm/state-362I5BMK.mjs.map +7 -0
  96. package/dist/lib/node-esm/types/index.mjs +2 -2
  97. package/dist/types/src/SpacePlugin.d.ts +1 -1
  98. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  100. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  101. package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
  102. package/dist/types/src/capabilities/capabilities.d.ts +6 -5
  103. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  104. package/dist/types/src/capabilities/identity-created.d.ts +1 -1
  105. package/dist/types/src/capabilities/index.d.ts +11 -12
  106. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  107. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  108. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  109. package/dist/types/src/capabilities/react-root.d.ts +2 -2
  110. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  111. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  112. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  113. package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
  114. package/dist/types/src/capabilities/settings.d.ts +1 -1
  115. package/dist/types/src/capabilities/spaces-ready.d.ts +1 -1
  116. package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
  117. package/dist/types/src/capabilities/state.d.ts +1 -1
  118. package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
  119. package/dist/types/src/components/CollectionArticle.d.ts +6 -0
  120. package/dist/types/src/components/CollectionArticle.d.ts.map +1 -0
  121. package/dist/types/src/components/CollectionSection.d.ts +3 -4
  122. package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
  123. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +3 -3
  124. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
  125. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1704 -4
  126. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
  127. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +6 -4
  128. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  129. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
  130. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
  131. package/dist/types/src/components/{JoinDialog.d.ts → JoinDialog/JoinDialog.d.ts} +1 -1
  132. package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +1 -0
  133. package/dist/types/src/components/JoinDialog/index.d.ts +2 -0
  134. package/dist/types/src/components/JoinDialog/index.d.ts.map +1 -0
  135. package/dist/types/src/components/{MembersContainer.d.ts → MembersContainer/MembersContainer.d.ts} +3 -2
  136. package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +1 -0
  137. package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +1707 -0
  138. package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +1 -0
  139. package/dist/types/src/components/MembersContainer/index.d.ts +2 -0
  140. package/dist/types/src/components/MembersContainer/index.d.ts.map +1 -0
  141. package/dist/types/src/components/ObjectDetailsPanel/ObjectDetailsPanel.d.ts +9 -0
  142. package/dist/types/src/components/ObjectDetailsPanel/ObjectDetailsPanel.d.ts.map +1 -0
  143. package/dist/types/src/components/ObjectDetailsPanel/ObjectForm.d.ts +10 -0
  144. package/dist/types/src/components/ObjectDetailsPanel/ObjectForm.d.ts.map +1 -0
  145. package/dist/types/src/components/ObjectDetailsPanel/index.d.ts +3 -0
  146. package/dist/types/src/components/ObjectDetailsPanel/index.d.ts.map +1 -0
  147. package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts +7 -0
  148. package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -0
  149. package/dist/types/src/components/ObjectRenamePopover/index.d.ts +2 -0
  150. package/dist/types/src/components/ObjectRenamePopover/index.d.ts.map +1 -0
  151. package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts +2 -2
  152. package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -1
  153. package/dist/types/src/components/ObjectSettings/BaseObjectSettings.stories.d.ts +1540 -0
  154. package/dist/types/src/components/ObjectSettings/BaseObjectSettings.stories.d.ts.map +1 -0
  155. package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts +1 -1
  156. package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -1
  157. package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
  158. package/dist/types/src/components/ObjectSettings/index.d.ts +2 -1
  159. package/dist/types/src/components/ObjectSettings/index.d.ts.map +1 -1
  160. package/dist/types/src/components/RecordArticle.d.ts +5 -0
  161. package/dist/types/src/components/RecordArticle.d.ts.map +1 -0
  162. package/dist/types/src/components/RecordArticle.stories.d.ts +1707 -0
  163. package/dist/types/src/components/RecordArticle.stories.d.ts.map +1 -0
  164. package/dist/types/src/components/SchemaContainer.d.ts +1 -1
  165. package/dist/types/src/components/SchemaContainer.d.ts.map +1 -1
  166. package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
  167. package/dist/types/src/components/{SpacePresence.d.ts → SpacePresence/SpacePresence.d.ts} +4 -3
  168. package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +1 -0
  169. package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +1537 -0
  170. package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +1 -0
  171. package/dist/types/src/components/SpacePresence/index.d.ts +2 -0
  172. package/dist/types/src/components/SpacePresence/index.d.ts.map +1 -0
  173. package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts +7 -0
  174. package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -0
  175. package/dist/types/src/components/SpaceRenamePopover/index.d.ts +2 -0
  176. package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +1 -0
  177. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
  178. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1537 -4
  179. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
  180. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
  181. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1538 -5
  182. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
  183. package/dist/types/src/components/ViewEditor.d.ts +3 -4
  184. package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
  185. package/dist/types/src/components/index.d.ts +10 -14
  186. package/dist/types/src/components/index.d.ts.map +1 -1
  187. package/dist/types/src/events.d.ts.map +1 -1
  188. package/dist/types/src/helpers/index.d.ts +2 -0
  189. package/dist/types/src/helpers/index.d.ts.map +1 -0
  190. package/dist/types/src/helpers/query.d.ts +8 -0
  191. package/dist/types/src/helpers/query.d.ts.map +1 -0
  192. package/dist/types/src/helpers/query.test.d.ts +2 -0
  193. package/dist/types/src/helpers/query.test.d.ts.map +1 -0
  194. package/dist/types/src/hooks/index.d.ts +1 -0
  195. package/dist/types/src/hooks/index.d.ts.map +1 -1
  196. package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
  197. package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +1 -1
  198. package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
  199. package/dist/types/src/hooks/usePath.d.ts +1 -1
  200. package/dist/types/src/hooks/usePath.d.ts.map +1 -1
  201. package/dist/types/src/hooks/useTypeOptions.d.ts +10 -0
  202. package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -0
  203. package/dist/types/src/index.d.ts +1 -0
  204. package/dist/types/src/index.d.ts.map +1 -1
  205. package/dist/types/src/meta.d.ts +0 -1
  206. package/dist/types/src/meta.d.ts.map +1 -1
  207. package/dist/types/src/translations.d.ts +1332 -22
  208. package/dist/types/src/translations.d.ts.map +1 -1
  209. package/dist/types/src/types/types.d.ts +92 -97
  210. package/dist/types/src/types/types.d.ts.map +1 -1
  211. package/dist/types/src/util.d.ts +12 -8
  212. package/dist/types/src/util.d.ts.map +1 -1
  213. package/dist/types/tsconfig.tsbuildinfo +1 -1
  214. package/package.json +65 -59
  215. package/src/SpacePlugin.ts +228 -218
  216. package/src/capabilities/app-graph-builder.ts +184 -135
  217. package/src/capabilities/app-graph-serializer.ts +12 -12
  218. package/src/capabilities/capabilities.ts +17 -11
  219. package/src/capabilities/identity-created.ts +2 -2
  220. package/src/capabilities/index.ts +0 -1
  221. package/src/capabilities/intent-resolver.ts +89 -62
  222. package/src/capabilities/react-root.tsx +4 -3
  223. package/src/capabilities/react-surface.tsx +69 -145
  224. package/src/capabilities/schema-defs.ts +1 -1
  225. package/src/capabilities/spaces-ready.ts +8 -5
  226. package/src/capabilities/state.ts +2 -2
  227. package/src/components/AwaitingObject.tsx +12 -14
  228. package/src/components/{CollectionMain.tsx → CollectionArticle.tsx} +7 -6
  229. package/src/components/CollectionSection.tsx +8 -6
  230. package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +15 -15
  231. package/src/components/CreateDialog/CreateObjectDialog.tsx +48 -31
  232. package/src/components/CreateDialog/CreateObjectPanel.tsx +22 -11
  233. package/src/components/CreateDialog/CreateSpaceDialog.tsx +30 -11
  234. package/src/components/{JoinDialog.tsx → JoinDialog/JoinDialog.tsx} +26 -10
  235. package/src/components/JoinDialog/index.ts +5 -0
  236. package/src/components/MembersContainer/MembersContainer.stories.tsx +56 -0
  237. package/src/components/{MembersContainer.tsx → MembersContainer/MembersContainer.tsx} +21 -20
  238. package/src/components/MembersContainer/index.ts +5 -0
  239. package/src/components/MenuFooter.tsx +2 -2
  240. package/src/components/ObjectDetailsPanel/ObjectDetailsPanel.tsx +51 -0
  241. package/src/components/ObjectDetailsPanel/ObjectForm.tsx +72 -0
  242. package/src/components/ObjectDetailsPanel/index.ts +7 -0
  243. package/src/components/{PopoverRenameObject.tsx → ObjectRenamePopover/ObjectRenamePopover.tsx} +6 -6
  244. package/src/components/ObjectRenamePopover/index.ts +5 -0
  245. package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +3 -3
  246. package/src/components/ObjectSettings/BaseObjectSettings.stories.tsx +63 -0
  247. package/src/components/ObjectSettings/BaseObjectSettings.tsx +90 -26
  248. package/src/components/ObjectSettings/ForeignKeys.tsx +4 -4
  249. package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +4 -3
  250. package/src/components/ObjectSettings/index.ts +3 -1
  251. package/src/components/RecordArticle.stories.tsx +115 -0
  252. package/src/components/RecordArticle.tsx +114 -0
  253. package/src/components/SchemaContainer.tsx +23 -26
  254. package/src/components/SpacePluginSettings.tsx +15 -10
  255. package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx} +22 -22
  256. package/src/components/{SpacePresence.tsx → SpacePresence/SpacePresence.tsx} +16 -11
  257. package/src/components/SpacePresence/index.ts +5 -0
  258. package/src/components/{PopoverRenameSpace.tsx → SpaceRenamePopover/SpaceRenamePopover.tsx} +7 -6
  259. package/src/components/SpaceRenamePopover/index.ts +5 -0
  260. package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +15 -8
  261. package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +45 -24
  262. package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -8
  263. package/src/components/SyncStatus/SyncStatus.stories.tsx +7 -8
  264. package/src/components/SyncStatus/SyncStatus.tsx +107 -11
  265. package/src/components/ViewEditor.tsx +51 -23
  266. package/src/components/index.ts +7 -8
  267. package/src/events.ts +6 -6
  268. package/src/helpers/index.ts +5 -0
  269. package/src/helpers/query.test.ts +24 -0
  270. package/src/helpers/query.ts +158 -0
  271. package/src/hooks/index.ts +1 -0
  272. package/src/hooks/useActiveSpace.ts +3 -2
  273. package/src/hooks/useInputSurfaceLookup.tsx +8 -3
  274. package/src/hooks/usePath.ts +1 -1
  275. package/src/hooks/useTypeOptions.ts +59 -0
  276. package/src/index.ts +1 -0
  277. package/src/meta.ts +6 -3
  278. package/src/translations.ts +26 -10
  279. package/src/types/types.ts +42 -23
  280. package/src/util.tsx +183 -62
  281. package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
  282. package/dist/lib/browser/ObjectDetailsPanel-SY6FYTYC.mjs +0 -88
  283. package/dist/lib/browser/ObjectDetailsPanel-SY6FYTYC.mjs.map +0 -7
  284. package/dist/lib/browser/RecordMain-TEBGAVSL.mjs +0 -68
  285. package/dist/lib/browser/RecordMain-TEBGAVSL.mjs.map +0 -7
  286. package/dist/lib/browser/app-graph-builder-VZW75QPJ.mjs.map +0 -7
  287. package/dist/lib/browser/app-graph-serializer-YPHYVZAP.mjs.map +0 -7
  288. package/dist/lib/browser/chunk-3UFG6LQQ.mjs.map +0 -7
  289. package/dist/lib/browser/chunk-CBYL62HG.mjs +0 -19
  290. package/dist/lib/browser/chunk-CBYL62HG.mjs.map +0 -7
  291. package/dist/lib/browser/chunk-DYKFFVN6.mjs +0 -94
  292. package/dist/lib/browser/chunk-DYKFFVN6.mjs.map +0 -7
  293. package/dist/lib/browser/chunk-FBCGT5YY.mjs +0 -13
  294. package/dist/lib/browser/chunk-FBCGT5YY.mjs.map +0 -7
  295. package/dist/lib/browser/chunk-PSIBVBTA.mjs.map +0 -7
  296. package/dist/lib/browser/chunk-Q5EEPP3S.mjs +0 -20
  297. package/dist/lib/browser/chunk-Q5EEPP3S.mjs.map +0 -7
  298. package/dist/lib/browser/chunk-SMB4DGYO.mjs.map +0 -7
  299. package/dist/lib/browser/chunk-WAXS2ZVX.mjs.map +0 -7
  300. package/dist/lib/browser/identity-created-T6ZNVE7S.mjs.map +0 -7
  301. package/dist/lib/browser/intent-resolver-TS6CCKST.mjs.map +0 -7
  302. package/dist/lib/browser/react-root-RQGTZ2ZO.mjs +0 -29
  303. package/dist/lib/browser/react-root-RQGTZ2ZO.mjs.map +0 -7
  304. package/dist/lib/browser/react-surface-V3ARS2BP.mjs.map +0 -7
  305. package/dist/lib/browser/schema-defs-5LBA43X5.mjs.map +0 -7
  306. package/dist/lib/browser/schema-tools-LPL35WOJ.mjs +0 -124
  307. package/dist/lib/browser/schema-tools-LPL35WOJ.mjs.map +0 -7
  308. package/dist/lib/browser/spaces-ready-FXEP6XEW.mjs.map +0 -7
  309. package/dist/lib/browser/state-K3UBPKYP.mjs.map +0 -7
  310. package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +0 -7
  311. package/dist/lib/node-esm/ObjectDetailsPanel-3MYLTMXN.mjs +0 -89
  312. package/dist/lib/node-esm/ObjectDetailsPanel-3MYLTMXN.mjs.map +0 -7
  313. package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs +0 -70
  314. package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs.map +0 -7
  315. package/dist/lib/node-esm/app-graph-builder-XNVQOJLE.mjs.map +0 -7
  316. package/dist/lib/node-esm/app-graph-serializer-PKVLWV6V.mjs.map +0 -7
  317. package/dist/lib/node-esm/chunk-7MZ3J3LI.mjs +0 -21
  318. package/dist/lib/node-esm/chunk-7MZ3J3LI.mjs.map +0 -7
  319. package/dist/lib/node-esm/chunk-CTQMR7E3.mjs.map +0 -7
  320. package/dist/lib/node-esm/chunk-FJZNSJC4.mjs +0 -20
  321. package/dist/lib/node-esm/chunk-FJZNSJC4.mjs.map +0 -7
  322. package/dist/lib/node-esm/chunk-HWNG4MEU.mjs +0 -15
  323. package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
  324. package/dist/lib/node-esm/chunk-HYIZVPOA.mjs.map +0 -7
  325. package/dist/lib/node-esm/chunk-KLG4Y4GY.mjs +0 -96
  326. package/dist/lib/node-esm/chunk-KLG4Y4GY.mjs.map +0 -7
  327. package/dist/lib/node-esm/chunk-KYUHPPRN.mjs.map +0 -7
  328. package/dist/lib/node-esm/chunk-S7MKRQHY.mjs.map +0 -7
  329. package/dist/lib/node-esm/identity-created-AL7NNCKH.mjs.map +0 -7
  330. package/dist/lib/node-esm/intent-resolver-W6P27SCF.mjs.map +0 -7
  331. package/dist/lib/node-esm/react-root-N27KETKT.mjs.map +0 -7
  332. package/dist/lib/node-esm/react-surface-TNPAUQCM.mjs.map +0 -7
  333. package/dist/lib/node-esm/schema-defs-TPWZPDCR.mjs.map +0 -7
  334. package/dist/lib/node-esm/schema-tools-PJE2FKWH.mjs +0 -126
  335. package/dist/lib/node-esm/schema-tools-PJE2FKWH.mjs.map +0 -7
  336. package/dist/lib/node-esm/spaces-ready-PQLLIO5W.mjs.map +0 -7
  337. package/dist/lib/node-esm/state-4M5A6OSB.mjs.map +0 -7
  338. package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
  339. package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
  340. package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
  341. package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
  342. package/dist/types/src/components/CollectionMain.d.ts +0 -7
  343. package/dist/types/src/components/CollectionMain.d.ts.map +0 -1
  344. package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
  345. package/dist/types/src/components/MembersContainer.d.ts.map +0 -1
  346. package/dist/types/src/components/MembersContainer.stories.d.ts +0 -8
  347. package/dist/types/src/components/MembersContainer.stories.d.ts.map +0 -1
  348. package/dist/types/src/components/ObjectDetailsPanel.d.ts +0 -9
  349. package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +0 -1
  350. package/dist/types/src/components/PersistenceStatus.d.ts +0 -6
  351. package/dist/types/src/components/PersistenceStatus.d.ts.map +0 -1
  352. package/dist/types/src/components/PopoverRenameObject.d.ts +0 -7
  353. package/dist/types/src/components/PopoverRenameObject.d.ts.map +0 -1
  354. package/dist/types/src/components/PopoverRenameSpace.d.ts +0 -7
  355. package/dist/types/src/components/PopoverRenameSpace.d.ts.map +0 -1
  356. package/dist/types/src/components/RecordMain.d.ts +0 -7
  357. package/dist/types/src/components/RecordMain.d.ts.map +0 -1
  358. package/dist/types/src/components/SpacePresence.d.ts.map +0 -1
  359. package/dist/types/src/components/SpacePresence.stories.d.ts +0 -9
  360. package/dist/types/src/components/SpacePresence.stories.d.ts.map +0 -1
  361. package/src/capabilities/schema-tool.test.ts +0 -44
  362. package/src/capabilities/schema-tools.ts +0 -125
  363. package/src/components/MembersContainer.stories.tsx +0 -31
  364. package/src/components/ObjectDetailsPanel.tsx +0 -77
  365. package/src/components/PersistenceStatus.tsx +0 -83
  366. package/src/components/RecordMain.tsx +0 -43
@@ -1,40 +1,42 @@
1
1
  import {
2
2
  useInputSurfaceLookup,
3
- usePath
4
- } from "./chunk-DYKFFVN6.mjs";
3
+ usePath,
4
+ useTypeOptions
5
+ } from "./chunk-AFUOMLX6.mjs";
5
6
  import {
6
7
  SpaceCapabilities
7
- } from "./chunk-Q5EEPP3S.mjs";
8
+ } from "./chunk-K5J7ZB5P.mjs";
8
9
  import {
9
10
  COMPOSER_SPACE_LOCK,
10
11
  getSpaceDisplayName
11
- } from "./chunk-SMB4DGYO.mjs";
12
+ } from "./chunk-KFUMADZF.mjs";
12
13
  import {
13
14
  SpaceAction,
14
15
  SpaceForm
15
- } from "./chunk-3UFG6LQQ.mjs";
16
+ } from "./chunk-ZQMSGD5J.mjs";
16
17
  import {
17
- SPACE_PLUGIN,
18
18
  meta
19
- } from "./chunk-FBCGT5YY.mjs";
19
+ } from "./chunk-VZBIIYFM.mjs";
20
20
 
21
21
  // src/components/AwaitingObject.tsx
22
22
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
23
23
  import React, { useCallback, useEffect, useState } from "react";
24
- import { LayoutAction, createIntent, useIntentDispatcher, useLayout } from "@dxos/app-framework";
24
+ import { LayoutAction, createIntent } from "@dxos/app-framework";
25
+ import { useIntentDispatcher, useLayout } from "@dxos/app-framework/react";
26
+ import { Obj } from "@dxos/echo";
25
27
  import { useClient } from "@dxos/react-client";
26
- import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
28
+ import { Filter, useQuery } from "@dxos/react-client/echo";
27
29
  import { Button, Icon, Toast, useTranslation } from "@dxos/react-ui";
28
- var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
29
- var TOAST_TIMEOUT = 24e4;
30
+ var WAIT_FOR_OBJECT_TIMEOUT = 3 * 60 * 1e3;
31
+ var TOAST_TIMEOUT = 4 * 60 * 1e3;
30
32
  var AwaitingObject = ({ id }) => {
31
33
  var _effect = _useSignals();
32
34
  try {
35
+ const { t } = useTranslation(meta.id);
36
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
33
37
  const [open, setOpen] = useState(true);
34
38
  const [waiting, setWaiting] = useState(true);
35
39
  const [found, setFound] = useState(false);
36
- const { t } = useTranslation(SPACE_PLUGIN);
37
- const { dispatchPromise: dispatch } = useIntentDispatcher();
38
40
  const layout = useLayout();
39
41
  const client = useClient();
40
42
  const objects = useQuery(client.spaces, Filter.everything());
@@ -42,15 +44,13 @@ var AwaitingObject = ({ id }) => {
42
44
  if (!id) {
43
45
  return;
44
46
  }
45
- const timeout = setTimeout(() => {
46
- setWaiting(false);
47
- }, WAIT_FOR_OBJECT_TIMEOUT);
48
- () => clearTimeout(timeout);
47
+ const timeout = setTimeout(() => setWaiting(false), WAIT_FOR_OBJECT_TIMEOUT);
48
+ return () => clearTimeout(timeout);
49
49
  }, [
50
50
  id
51
51
  ]);
52
52
  useEffect(() => {
53
- if (objects.findIndex((object) => fullyQualifiedId(object) === id) > -1) {
53
+ if (objects.findIndex((object) => Obj.getDXN(object).toString() === id) > -1) {
54
54
  setFound(true);
55
55
  if (layout.active.includes(id)) {
56
56
  setOpen(false);
@@ -121,48 +121,44 @@ var AwaitingObject = ({ id }) => {
121
121
 
122
122
  // src/components/CreateDialog/CreateObjectDialog.tsx
123
123
  import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
124
- import { Effect, pipe } from "effect";
124
+ import * as Effect from "effect/Effect";
125
+ import * as Function2 from "effect/Function";
125
126
  import React3, { useCallback as useCallback3, useRef, useState as useState2 } from "react";
126
- import { Capabilities, LayoutAction as LayoutAction2, chain, createIntent as createIntent2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager } from "@dxos/app-framework";
127
- import { Obj, Query, Type as Type2 } from "@dxos/echo";
127
+ import { Capabilities, LayoutAction as LayoutAction2, chain, createIntent as createIntent2 } from "@dxos/app-framework";
128
+ import { useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager } from "@dxos/app-framework/react";
129
+ import { Obj as Obj2, Query, Type as Type2 } from "@dxos/echo";
128
130
  import { invariant } from "@dxos/invariant";
129
131
  import { useClient as useClient2 } from "@dxos/react-client";
130
132
  import { getSpace, isLiveObject, isSpace, useQuery as useQuery2, useSpaces } from "@dxos/react-client/echo";
131
- import { Button as Button2, Dialog, Icon as Icon3, useTranslation as useTranslation3 } from "@dxos/react-ui";
133
+ import { Dialog, IconButton, useTranslation as useTranslation3 } from "@dxos/react-ui";
132
134
  import { cardDialogContent, cardDialogHeader } from "@dxos/react-ui-stack";
133
- import { DataType } from "@dxos/schema";
135
+ import { Collection, StoredSchema, getTypenameFromQuery } from "@dxos/schema";
134
136
  import { isNonNullable as isNonNullable2 } from "@dxos/util";
135
137
 
136
- // src/capabilities/index.ts
137
- import { lazy } from "@dxos/app-framework";
138
- var AppGraphBuilder = lazy(() => import("./app-graph-builder-VZW75QPJ.mjs"));
139
- var AppGraphSerializer = lazy(() => import("./app-graph-serializer-YPHYVZAP.mjs"));
140
- var IdentityCreated = lazy(() => import("./identity-created-T6ZNVE7S.mjs"));
141
- var IntentResolver = lazy(() => import("./intent-resolver-TS6CCKST.mjs"));
142
- var ReactRoot = lazy(() => import("./react-root-RQGTZ2ZO.mjs"));
143
- var ReactSurface = lazy(() => import("./react-surface-V3ARS2BP.mjs"));
144
- var SchemaDefs = lazy(() => import("./schema-defs-5LBA43X5.mjs"));
145
- var SchemaTools = lazy(() => import("./schema-tools-LPL35WOJ.mjs"));
146
- var SpaceSettings = lazy(() => import("./settings-FLLBP5KI.mjs"));
147
- var SpaceState = lazy(() => import("./state-K3UBPKYP.mjs"));
148
- var SpacesReady = lazy(() => import("./spaces-ready-FXEP6XEW.mjs"));
149
-
150
138
  // src/components/CreateDialog/CreateObjectPanel.tsx
151
139
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
140
+ import * as Option from "effect/Option";
152
141
  import React2, { useCallback as useCallback2 } from "react";
153
142
  import { Type } from "@dxos/echo";
154
- import { getTypeAnnotation } from "@dxos/echo-schema";
155
- import { Icon as Icon2, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
143
+ import { ViewAnnotation, getTypeAnnotation } from "@dxos/echo/internal";
144
+ import { Icon as Icon2, toLocalizedString, useDefaultValue, useTranslation as useTranslation2 } from "@dxos/react-ui";
156
145
  import { Form } from "@dxos/react-ui-form";
157
146
  import { SearchList } from "@dxos/react-ui-searchlist";
158
147
  import { cardDialogOverflow, cardDialogPaddedOverflow, cardDialogSearchListRoot } from "@dxos/react-ui-stack";
159
148
  import { isNonNullable } from "@dxos/util";
160
- var CreateObjectPanel = ({ forms, spaces, typename, target, name: initialName, defaultSpaceId, resolve, onTargetChange, onTypenameChange, onCreateObject }) => {
149
+ var CreateObjectPanel = ({ forms, spaces, typename, target, views, initialFormValues: _initialFormValues, defaultSpaceId, resolve, onTargetChange, onTypenameChange, onCreateObject }) => {
161
150
  var _effect = _useSignals2();
162
151
  try {
163
- const { t } = useTranslation2(SPACE_PLUGIN);
152
+ const { t } = useTranslation2(meta.id);
153
+ const initialFormValues = useDefaultValue(_initialFormValues, () => ({}));
164
154
  const form = forms.find((form2) => Type.getTypename(form2.objectSchema) === typename);
165
- const options = forms.map((form2) => getTypeAnnotation(form2.objectSchema)).filter(isNonNullable).sort((a, b) => {
155
+ const options = forms.filter((form2) => {
156
+ if (views == null) {
157
+ return true;
158
+ } else {
159
+ return views === ViewAnnotation.get(form2.objectSchema).pipe(Option.getOrElse(() => false));
160
+ }
161
+ }).map((form2) => getTypeAnnotation(form2.objectSchema)).filter(isNonNullable).sort((a, b) => {
166
162
  const nameA = t("typename label", {
167
163
  ns: a.typename,
168
164
  defaultValue: a.typename
@@ -214,9 +210,7 @@ var CreateObjectPanel = ({ forms, spaces, typename, target, name: initialName, d
214
210
  className: cardDialogOverflow
215
211
  }, /* @__PURE__ */ React2.createElement(Form, {
216
212
  autoFocus: true,
217
- values: {
218
- name: initialName
219
- },
213
+ values: initialFormValues,
220
214
  schema: form.formSchema,
221
215
  testId: "create-object-form",
222
216
  onSave: handleCreateObject,
@@ -230,7 +224,7 @@ var CreateObjectPanel = ({ forms, spaces, typename, target, name: initialName, d
230
224
  var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
231
225
  var _effect = _useSignals2();
232
226
  try {
233
- const { t } = useTranslation2(SPACE_PLUGIN);
227
+ const { t } = useTranslation2(meta.id);
234
228
  return /* @__PURE__ */ React2.createElement(SearchList.Root, {
235
229
  label: t("space input label"),
236
230
  classNames: cardDialogSearchListRoot
@@ -270,7 +264,7 @@ var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
270
264
  var SelectSchema = ({ options, resolve, onChange }) => {
271
265
  var _effect = _useSignals2();
272
266
  try {
273
- const { t } = useTranslation2(SPACE_PLUGIN);
267
+ const { t } = useTranslation2(meta.id);
274
268
  return /* @__PURE__ */ React2.createElement(SearchList.Root, {
275
269
  label: t("schema input label"),
276
270
  classNames: cardDialogSearchListRoot
@@ -304,22 +298,22 @@ var SelectSchema = ({ options, resolve, onChange }) => {
304
298
 
305
299
  // src/components/CreateDialog/CreateObjectDialog.tsx
306
300
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
307
- var CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
308
- var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, name, onCreateObject, shouldNavigate: _shouldNavigate }) => {
301
+ var CREATE_OBJECT_DIALOG = `${meta.id}/CreateObjectDialog`;
302
+ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, views, initialFormValues, onCreateObject, shouldNavigate: _shouldNavigate }) => {
309
303
  var _effect = _useSignals3();
310
304
  try {
311
- const closeRef = useRef(null);
312
305
  const manager = usePluginManager();
313
- const { t } = useTranslation3(SPACE_PLUGIN);
314
- const client = useClient2();
315
- const spaces = useSpaces();
306
+ const { t } = useTranslation3(meta.id);
316
307
  const { dispatch } = useIntentDispatcher2();
317
308
  const forms = useCapabilities(SpaceCapabilities.ObjectForm);
318
309
  const [target, setTarget] = useState2(initialTarget);
319
310
  const [typename, setTypename] = useState2(initialTypename);
311
+ const client = useClient2();
312
+ const spaces = useSpaces();
320
313
  const space = isSpace(target) ? target : getSpace(target);
321
- const queryCollections = useQuery2(space, Query.type(DataType.QueryCollection));
322
- const hiddenTypenames = queryCollections.map((collection) => collection.query.typename).filter(isNonNullable2);
314
+ const queryCollections = useQuery2(space, Query.type(Collection.QueryCollection));
315
+ const hiddenTypenames = queryCollections.map((collection) => getTypenameFromQuery(collection.query)).filter(isNonNullable2);
316
+ const closeRef = useRef(null);
323
317
  const resolve = useCallback3((typename2) => manager.context.getCapabilities(Capabilities.Metadata).find(({ id }) => id === typename2)?.metadata ?? {}, [
324
318
  manager
325
319
  ]);
@@ -341,7 +335,7 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
341
335
  const { object } = yield* dispatch(form.getIntent(data, {
342
336
  space: space2
343
337
  }));
344
- if (isLiveObject(object) && !Obj.instanceOf(DataType.StoredSchema, object)) {
338
+ if (isLiveObject(object) && !Obj2.instanceOf(StoredSchema, object)) {
345
339
  const hidden = form.hidden || hiddenTypenames.includes(Type2.getTypename(form.objectSchema));
346
340
  const addObjectIntent = createIntent2(SpaceAction.AddObject, {
347
341
  target,
@@ -350,7 +344,7 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
350
344
  });
351
345
  const shouldNavigate = _shouldNavigate ?? (() => true);
352
346
  if (shouldNavigate(object)) {
353
- yield* dispatch(pipe(addObjectIntent, chain(LayoutAction2.Open, {
347
+ yield* dispatch(Function2.pipe(addObjectIntent, chain(LayoutAction2.Open, {
354
348
  part: "main"
355
349
  })));
356
350
  } else {
@@ -376,24 +370,26 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
376
370
  }, /* @__PURE__ */ React3.createElement(Dialog.Title, null, t("create object dialog title", {
377
371
  object: t("typename label", {
378
372
  ns: typename,
379
- defaultValue: "Item"
373
+ defaultValue: views ? "View" : "Item"
380
374
  })
381
375
  })), /* @__PURE__ */ React3.createElement(Dialog.Close, {
382
376
  asChild: true
383
- }, /* @__PURE__ */ React3.createElement(Button2, {
377
+ }, /* @__PURE__ */ React3.createElement(IconButton, {
384
378
  ref: closeRef,
379
+ icon: "ph--x--regular",
380
+ size: 4,
381
+ label: "Close",
382
+ iconOnly: true,
385
383
  density: "fine",
386
384
  variant: "ghost",
387
385
  autoFocus: true
388
- }, /* @__PURE__ */ React3.createElement(Icon3, {
389
- icon: "ph--x--regular",
390
- size: 4
391
- })))), /* @__PURE__ */ React3.createElement(CreateObjectPanel, {
386
+ }))), /* @__PURE__ */ React3.createElement(CreateObjectPanel, {
392
387
  forms,
393
388
  spaces,
394
389
  target,
390
+ views,
395
391
  typename,
396
- name,
392
+ initialFormValues,
397
393
  defaultSpaceId: client.spaces.default.id,
398
394
  resolve,
399
395
  onTargetChange: setTarget,
@@ -408,13 +404,14 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
408
404
 
409
405
  // src/components/CreateDialog/CreateSpaceDialog.tsx
410
406
  import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
411
- import { Effect as Effect2 } from "effect";
407
+ import * as Effect2 from "effect/Effect";
412
408
  import React4, { useCallback as useCallback4, useRef as useRef2 } from "react";
413
- import { LayoutAction as LayoutAction3, createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
414
- import { Button as Button3, Dialog as Dialog2, Icon as Icon4, useTranslation as useTranslation4 } from "@dxos/react-ui";
409
+ import { LayoutAction as LayoutAction3, createIntent as createIntent3 } from "@dxos/app-framework";
410
+ import { useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework/react";
411
+ import { Dialog as Dialog2, IconButton as IconButton2, useTranslation as useTranslation4 } from "@dxos/react-ui";
415
412
  import { Form as Form2 } from "@dxos/react-ui-form";
416
413
  import { cardDialogContent as cardDialogContent2, cardDialogHeader as cardDialogHeader2 } from "@dxos/react-ui-stack";
417
- var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
414
+ var CREATE_SPACE_DIALOG = `${meta.id}/CreateSpaceDialog`;
418
415
  var initialValues = {
419
416
  edgeReplication: true
420
417
  };
@@ -422,7 +419,7 @@ var CreateSpaceDialog = () => {
422
419
  var _effect = _useSignals4();
423
420
  try {
424
421
  const closeRef = useRef2(null);
425
- const { t } = useTranslation4(SPACE_PLUGIN);
422
+ const { t } = useTranslation4(meta.id);
426
423
  const { dispatch } = useIntentDispatcher3();
427
424
  const inputSurfaceLookup = useInputSurfaceLookup();
428
425
  const handleCreateSpace = useCallback4(async (data) => {
@@ -453,15 +450,16 @@ var CreateSpaceDialog = () => {
453
450
  className: cardDialogHeader2
454
451
  }, /* @__PURE__ */ React4.createElement(Dialog2.Title, null, t("create space dialog title")), /* @__PURE__ */ React4.createElement(Dialog2.Close, {
455
452
  asChild: true
456
- }, /* @__PURE__ */ React4.createElement(Button3, {
453
+ }, /* @__PURE__ */ React4.createElement(IconButton2, {
457
454
  ref: closeRef,
455
+ icon: "ph--x--regular",
456
+ size: 4,
457
+ label: "Close",
458
+ iconOnly: true,
458
459
  density: "fine",
459
460
  variant: "ghost",
460
461
  autoFocus: true
461
- }, /* @__PURE__ */ React4.createElement(Icon4, {
462
- icon: "ph--x--regular",
463
- size: 4
464
- })))), /* @__PURE__ */ React4.createElement("div", {
462
+ }))), /* @__PURE__ */ React4.createElement("div", {
465
463
  role: "none",
466
464
  className: "contents"
467
465
  }, /* @__PURE__ */ React4.createElement(Form2, {
@@ -483,37 +481,39 @@ var CreateSpaceDialog = () => {
483
481
  import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
484
482
  import React5 from "react";
485
483
  import { useTranslation as useTranslation5 } from "@dxos/react-ui";
486
- var CollectionSection = ({ collection }) => {
484
+ var CollectionSection = ({ role, subject }) => {
487
485
  var _effect = _useSignals5();
488
486
  try {
489
- const { t } = useTranslation5(SPACE_PLUGIN);
487
+ const { t } = useTranslation5(meta.id);
490
488
  return /* @__PURE__ */ React5.createElement("div", {
489
+ role,
491
490
  className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
492
491
  }, /* @__PURE__ */ React5.createElement("span", {
493
492
  className: "truncate"
494
- }, collection.name ?? t("unnamed collection label")));
493
+ }, subject.name ?? t("unnamed collection label")));
495
494
  } finally {
496
495
  _effect.f();
497
496
  }
498
497
  };
499
498
 
500
- // src/components/JoinDialog.tsx
499
+ // src/components/JoinDialog/JoinDialog.tsx
501
500
  import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
502
501
  import React6, { useCallback as useCallback5 } from "react";
503
- import { LayoutAction as LayoutAction4, createIntent as createIntent4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
502
+ import { LayoutAction as LayoutAction4, createIntent as createIntent4 } from "@dxos/app-framework";
503
+ import { useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework/react";
504
504
  import { Trigger } from "@dxos/async";
505
505
  import { ObservabilityAction } from "@dxos/plugin-observability/types";
506
506
  import { useClient as useClient3 } from "@dxos/react-client";
507
507
  import { Dialog as Dialog3, useTranslation as useTranslation6 } from "@dxos/react-ui";
508
508
  import { JoinPanel } from "@dxos/shell/react";
509
- var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
509
+ var JOIN_DIALOG = `${meta.id}/JoinDialog`;
510
510
  var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
511
511
  var _effect = _useSignals6();
512
512
  try {
513
513
  const { dispatchPromise: dispatch } = useIntentDispatcher4();
514
514
  const client = useClient3();
515
515
  const { graph } = useAppGraph();
516
- const { t } = useTranslation6(SPACE_PLUGIN);
516
+ const { t } = useTranslation6(meta.id);
517
517
  const handleDone = useCallback5(async (result) => {
518
518
  const spaceKey = result?.spaceKey;
519
519
  if (!spaceKey) {
@@ -523,18 +523,18 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
523
523
  dispatch(createIntent4(LayoutAction4.AddToast, {
524
524
  part: "toast",
525
525
  subject: {
526
- id: `${SPACE_PLUGIN}/join-success`,
526
+ id: `${meta.id}/join-success`,
527
527
  duration: 5e3,
528
528
  title: [
529
529
  "join success label",
530
530
  {
531
- ns: SPACE_PLUGIN
531
+ ns: meta.id
532
532
  }
533
533
  ],
534
534
  closeLabel: [
535
535
  "dismiss label",
536
536
  {
537
- ns: SPACE_PLUGIN
537
+ ns: meta.id
538
538
  }
539
539
  ]
540
540
  }
@@ -613,22 +613,24 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
613
613
  }
614
614
  };
615
615
 
616
- // src/components/MembersContainer.tsx
616
+ // src/components/MembersContainer/MembersContainer.tsx
617
617
  import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
618
618
  import React7, { useCallback as useCallback6, useMemo, useState as useState3 } from "react";
619
619
  import { QR } from "react-qr-rounded";
620
- import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
620
+ import { createIntent as createIntent5 } from "@dxos/app-framework";
621
+ import { useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework/react";
622
+ import { Obj as Obj3 } from "@dxos/echo";
621
623
  import { log } from "@dxos/log";
622
624
  import { useConfig } from "@dxos/react-client";
623
- import { fullyQualifiedId as fullyQualifiedId2, useSpaceInvitations } from "@dxos/react-client/echo";
625
+ import { useSpaceInvitations } from "@dxos/react-client/echo";
624
626
  import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
625
- import { Button as Button4, Clipboard, Icon as Icon5, Input, useId, useTranslation as useTranslation7 } from "@dxos/react-ui";
627
+ import { Button as Button2, Clipboard, Icon as Icon3, Input, useId, useTranslation as useTranslation7 } from "@dxos/react-ui";
626
628
  import { ControlFrame, ControlFrameItem, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
627
629
  import { StackItem } from "@dxos/react-ui-stack";
628
- import { DataType as DataType2 } from "@dxos/schema";
630
+ import { Collection as Collection2 } from "@dxos/schema";
629
631
  import { AuthCode, BifurcatedAction, Centered, Emoji, InvitationList, SpaceMemberList, Viewport } from "@dxos/shell/react";
630
632
  import { hexToEmoji } from "@dxos/util";
631
- var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/MembersContainer.tsx";
633
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/MembersContainer/MembersContainer.tsx";
632
634
  var activeActionKey = "dxos:react-shell/space-manager/active-action";
633
635
  var handleInvitationEvent = (invitation, subscription) => {
634
636
  const invitationCode = InvitationEncoder.encode(invitation);
@@ -638,7 +640,7 @@ var handleInvitationEvent = (invitation, subscription) => {
638
640
  authCode: invitation.authCode
639
641
  }), void 0, {
640
642
  F: __dxlog_file2,
641
- L: 39,
643
+ L: 41,
642
644
  S: void 0,
643
645
  C: (f, a) => f(...a)
644
646
  });
@@ -648,7 +650,7 @@ var handleInvitationEvent = (invitation, subscription) => {
648
650
  var MembersContainer = ({ space, createInvitationUrl }) => {
649
651
  var _effect = _useSignals7();
650
652
  try {
651
- const { t } = useTranslation7(SPACE_PLUGIN);
653
+ const { t } = useTranslation7(meta.id);
652
654
  const config = useConfig();
653
655
  const { dispatchPromise: dispatch } = useIntentDispatcher5();
654
656
  const invitations = useSpaceInvitations(space.key);
@@ -660,7 +662,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
660
662
  setInternalActiveAction(nextAction);
661
663
  localStorage.setItem(activeActionKey, nextAction);
662
664
  };
663
- const target = space.properties[DataType2.Collection.typename]?.target?.objects[0]?.target;
665
+ const target = space.properties[Collection2.Collection.typename]?.target?.objects[0]?.target;
664
666
  const locked = space.properties[COMPOSER_SPACE_LOCK];
665
667
  const handleChangeLocked = useCallback6(() => {
666
668
  space.properties[COMPOSER_SPACE_LOCK] = !locked;
@@ -676,10 +678,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
676
678
  description: t("invite one description", {
677
679
  ns: "os"
678
680
  }),
679
- icon: () => /* @__PURE__ */ React7.createElement(Icon5, {
680
- icon: "ph--user-plus--regular",
681
- size: 5
682
- }),
681
+ icon: "ph--user-plus--regular",
683
682
  testId: "membersContainer.inviteOne",
684
683
  onClick: async () => {
685
684
  const { data: invitation } = await dispatch(createIntent5(SpaceAction.Share, {
@@ -687,7 +686,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
687
686
  type: Invitation.Type.INTERACTIVE,
688
687
  authMethod: Invitation.AuthMethod.SHARED_SECRET,
689
688
  multiUse: false,
690
- target: target && fullyQualifiedId2(target)
689
+ target: target && Obj3.getDXN(target).toString()
691
690
  }));
692
691
  if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
693
692
  const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
@@ -701,10 +700,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
701
700
  description: t("invite many description", {
702
701
  ns: "os"
703
702
  }),
704
- icon: () => /* @__PURE__ */ React7.createElement(Icon5, {
705
- icon: "ph--users-three--regular",
706
- size: 5
707
- }),
703
+ icon: "ph--users-three--regular",
708
704
  testId: "membersContainer.inviteMany",
709
705
  onClick: async () => {
710
706
  const { data: invitation } = await dispatch(createIntent5(SpaceAction.Share, {
@@ -712,7 +708,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
712
708
  type: Invitation.Type.DELEGATED,
713
709
  authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
714
710
  multiUse: true,
715
- target: target && fullyQualifiedId2(target)
711
+ target: target && Obj3.getDXN(target).toString()
716
712
  }));
717
713
  if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
718
714
  const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
@@ -732,7 +728,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
732
728
  setSelectedInvitation(null);
733
729
  };
734
730
  return /* @__PURE__ */ React7.createElement(Clipboard.Provider, null, /* @__PURE__ */ React7.createElement(StackItem.Content, {
735
- classNames: "block overflow-y-auto"
731
+ scrollable: true
736
732
  }, /* @__PURE__ */ React7.createElement(ControlPage, null, /* @__PURE__ */ React7.createElement(ControlSection, {
737
733
  title: t("members verbose label"),
738
734
  description: t("members description")
@@ -764,7 +760,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
764
760
  onChangeActiveAction: setActiveAction,
765
761
  "data-testid": "membersContainer.createInvitation"
766
762
  })))), /* @__PURE__ */ React7.createElement("div", {
767
- className: "justify-center gap-4 p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
763
+ className: "justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
768
764
  }, /* @__PURE__ */ React7.createElement(ControlItemInput, {
769
765
  title: t("space locked label"),
770
766
  description: t("space locked description")
@@ -815,7 +811,7 @@ var InvitationQR = ({ id, url, onCancel }) => {
815
811
  return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
816
812
  className: "text-description"
817
813
  }, t("qr code description", {
818
- ns: SPACE_PLUGIN
814
+ ns: meta.id
819
815
  })), /* @__PURE__ */ React7.createElement("div", {
820
816
  role: "group",
821
817
  className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
@@ -836,7 +832,7 @@ var InvitationQR = ({ id, url, onCancel }) => {
836
832
  className: "sr-only"
837
833
  }, t("qr label")), /* @__PURE__ */ React7.createElement(Clipboard.Button, {
838
834
  value: url ?? "never"
839
- })), /* @__PURE__ */ React7.createElement(Button4, {
835
+ })), /* @__PURE__ */ React7.createElement(Button2, {
840
836
  variant: "ghost",
841
837
  onClick: onCancel
842
838
  }, t("cancel label")));
@@ -860,7 +856,7 @@ var InvitationAuthCode = ({ id, code, onCancel }) => {
860
856
  code,
861
857
  large: true,
862
858
  classNames: "mli-auto mlb-2 text-center grow"
863
- }), /* @__PURE__ */ React7.createElement(Button4, {
859
+ }), /* @__PURE__ */ React7.createElement(Button2, {
864
860
  variant: "ghost",
865
861
  onClick: onCancel
866
862
  }, t("cancel label")));
@@ -871,11 +867,11 @@ var InvitationAuthCode = ({ id, code, onCancel }) => {
871
867
  var InvitationComplete = ({ statusValue }) => {
872
868
  var _effect = _useSignals7();
873
869
  try {
874
- return statusValue > 0 ? /* @__PURE__ */ React7.createElement(Icon5, {
870
+ return statusValue > 0 ? /* @__PURE__ */ React7.createElement(Icon3, {
875
871
  icon: "ph--check--regular",
876
872
  size: 6,
877
873
  classNames: "m-1.5"
878
- }) : /* @__PURE__ */ React7.createElement(Icon5, {
874
+ }) : /* @__PURE__ */ React7.createElement(Icon3, {
879
875
  icon: "ph--x--regular",
880
876
  size: 6,
881
877
  classNames: "m-1.5"
@@ -890,11 +886,11 @@ import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking"
890
886
  import React8 from "react";
891
887
  import { getSpace as getSpace2 } from "@dxos/client/echo";
892
888
  import { useClient as useClient4 } from "@dxos/react-client";
893
- import { DropdownMenu, Icon as Icon6, toLocalizedString as toLocalizedString2, useTranslation as useTranslation8 } from "@dxos/react-ui";
889
+ import { DropdownMenu, Icon as Icon4, toLocalizedString as toLocalizedString2, useTranslation as useTranslation8 } from "@dxos/react-ui";
894
890
  var MenuFooter = ({ object }) => {
895
891
  var _effect = _useSignals8();
896
892
  try {
897
- const { t } = useTranslation8(SPACE_PLUGIN);
893
+ const { t } = useTranslation8(meta.id);
898
894
  const client = useClient4();
899
895
  const space = getSpace2(object);
900
896
  const spaceName = space ? getSpaceDisplayName(space, {
@@ -906,7 +902,7 @@ var MenuFooter = ({ object }) => {
906
902
  className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
907
903
  }, t("location label")), /* @__PURE__ */ React8.createElement("dd", {
908
904
  className: "line-clamp-3"
909
- }, /* @__PURE__ */ React8.createElement(Icon6, {
905
+ }, /* @__PURE__ */ React8.createElement(Icon4, {
910
906
  icon: "ph--planet--regular",
911
907
  classNames: "inline-block mie-1"
912
908
  }), toLocalizedString2(spaceName, t)))) : null;
@@ -915,153 +911,26 @@ var MenuFooter = ({ object }) => {
915
911
  }
916
912
  };
917
913
 
918
- // src/components/ObjectSettings/ObjectSettingsContainer.tsx
919
- import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
920
- import React10, { useMemo as useMemo2 } from "react";
921
- import { Surface } from "@dxos/app-framework";
922
- import { Clipboard as Clipboard2 } from "@dxos/react-ui";
923
- import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
924
-
925
- // src/components/ObjectSettings/BaseObjectSettings.tsx
914
+ // src/components/ObjectRenamePopover/ObjectRenamePopover.tsx
926
915
  import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
927
- import React9, { useRef as useRef3 } from "react";
928
- import { Input as Input2, useTranslation as useTranslation9 } from "@dxos/react-ui";
929
- var BaseObjectSettings = ({ classNames, children, object }) => {
916
+ import React9, { useCallback as useCallback7, useRef as useRef3, useState as useState4 } from "react";
917
+ import { LayoutAction as LayoutAction5, createIntent as createIntent6 } from "@dxos/app-framework";
918
+ import { useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework/react";
919
+ import { Obj as Obj4 } from "@dxos/echo";
920
+ import { log as log2 } from "@dxos/log";
921
+ import { Button as Button3, Input as Input2, useTranslation as useTranslation9 } from "@dxos/react-ui";
922
+ var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx";
923
+ var OBJECT_RENAME_POPOVER = `${meta.id}/ObjectRenamePopover`;
924
+ var ObjectRenamePopover = ({ object }) => {
930
925
  var _effect = _useSignals9();
931
926
  try {
932
927
  const { t } = useTranslation9(meta.id);
933
- const inputRef = useRef3(null);
934
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Input2.Root, null, /* @__PURE__ */ React9.createElement(Input2.Label, null, t("name label")), /* @__PURE__ */ React9.createElement(Input2.TextInput, {
935
- ref: inputRef,
936
- placeholder: t("name placeholder"),
937
- // TODO(burdon): Use annotation to get the name field.
938
- value: object.name ?? "",
939
- onChange: (event) => {
940
- object.name = event.target.value;
941
- },
942
- onKeyDown: (event) => {
943
- if (event.key === "Enter") {
944
- inputRef.current?.blur();
945
- }
946
- }
947
- })), children);
948
- } finally {
949
- _effect.f();
950
- }
951
- };
952
-
953
- // src/components/ObjectSettings/ObjectSettingsContainer.tsx
954
- var ObjectSettingsContainer = ({ object, role }) => {
955
- var _effect = _useSignals10();
956
- try {
957
- const data = useMemo2(() => ({
958
- subject: object
959
- }), [
960
- object
961
- ]);
962
- return /* @__PURE__ */ React10.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React10.createElement(StackItem2.Content, {
963
- toolbar: false
964
- }, /* @__PURE__ */ React10.createElement("div", {
965
- role: "none",
966
- className: "overflow-y-auto pli-cardSpacingInline plb-cardSpacingBlock"
967
- }, /* @__PURE__ */ React10.createElement(BaseObjectSettings, {
968
- object
969
- }, /* @__PURE__ */ React10.createElement(Surface, {
970
- role: "base-object-settings",
971
- data
972
- })), /* @__PURE__ */ React10.createElement(Surface, {
973
- role: "object-settings",
974
- data
975
- }))));
976
- } finally {
977
- _effect.f();
978
- }
979
- };
980
-
981
- // src/components/PersistenceStatus.tsx
982
- import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
983
- import React11, { useEffect as useEffect2, useState as useState4 } from "react";
984
- import { debounce } from "@dxos/async";
985
- import { Icon as Icon7, Tooltip, useTranslation as useTranslation10 } from "@dxos/react-ui";
986
- import { mx, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
987
- var PersistenceStatus = ({ db }) => {
988
- var _effect = _useSignals11();
989
- try {
990
- const { t } = useTranslation10(SPACE_PLUGIN);
991
- const [displayMessage, setDisplayMessage] = useState4(false);
992
- const [status, naturalSetStatus] = useState4(0);
993
- const [prevStatus, setPrevStatus] = useState4(0);
994
- const _setStatus = debounce(naturalSetStatus, 500);
995
- useEffect2(() => {
996
- setPrevStatus(status);
997
- if (prevStatus !== status && status === 0) {
998
- setDisplayMessage(true);
999
- const timeout = setTimeout(() => setDisplayMessage(false), 5e3);
1000
- return () => clearTimeout(timeout);
1001
- }
1002
- }, [
1003
- status
1004
- ]);
1005
- switch (status) {
1006
- case 2:
1007
- return /* @__PURE__ */ React11.createElement("div", {
1008
- className: "flex items-center"
1009
- }, /* @__PURE__ */ React11.createElement(Icon7, {
1010
- icon: "ph--warning--regular",
1011
- size: 4,
1012
- classNames: "me-1"
1013
- }), /* @__PURE__ */ React11.createElement("span", {
1014
- className: mx("text-sm", warningText)
1015
- }, t("persistence error label")));
1016
- case 1:
1017
- return /* @__PURE__ */ React11.createElement("div", {
1018
- className: "flex items-center"
1019
- }, /* @__PURE__ */ React11.createElement(Icon7, {
1020
- icon: "ph--arrows-counter-clockwise--regular",
1021
- size: 4,
1022
- classNames: "me-1"
1023
- }), /* @__PURE__ */ React11.createElement("span", {
1024
- className: mx("text-sm", staticPlaceholderText)
1025
- }, t("persistence pending label")));
1026
- case 0:
1027
- default:
1028
- return /* @__PURE__ */ React11.createElement(Tooltip.Trigger, {
1029
- delayDuration: 400,
1030
- role: "status",
1031
- content: t("persisted locally message"),
1032
- className: "flex items-center"
1033
- }, /* @__PURE__ */ React11.createElement(Icon7, {
1034
- icon: "ph--check-circle--regular",
1035
- size: 4,
1036
- classNames: "me-1"
1037
- }), displayMessage && /* @__PURE__ */ React11.createElement("span", {
1038
- className: mx("text-sm", staticPlaceholderText)
1039
- }, t("persisted locally label")));
1040
- }
1041
- } finally {
1042
- _effect.f();
1043
- }
1044
- };
1045
-
1046
- // src/components/PopoverRenameObject.tsx
1047
- import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
1048
- import React12, { useCallback as useCallback7, useRef as useRef4, useState as useState5 } from "react";
1049
- import { LayoutAction as LayoutAction5, createIntent as createIntent6, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
1050
- import { Obj as Obj2 } from "@dxos/echo";
1051
- import { log as log2 } from "@dxos/log";
1052
- import { Button as Button5, Input as Input3, useTranslation as useTranslation11 } from "@dxos/react-ui";
1053
- var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
1054
- var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
1055
- var PopoverRenameObject = ({ object }) => {
1056
- var _effect = _useSignals12();
1057
- try {
1058
- const { t } = useTranslation11(SPACE_PLUGIN);
1059
- const doneButton = useRef4(null);
1060
- const [name, setName] = useState5(Obj2.getLabel(object));
928
+ const doneButton = useRef3(null);
929
+ const [name, setName] = useState4(Obj4.getLabel(object));
1061
930
  const { dispatchPromise: dispatch } = useIntentDispatcher6();
1062
931
  const handleDone = useCallback7(() => {
1063
932
  try {
1064
- name && Obj2.setLabel(object, name);
933
+ name && Obj4.setLabel(object, name);
1065
934
  } catch (err) {
1066
935
  log2.error("Failed to rename object", {
1067
936
  err
@@ -1084,21 +953,21 @@ var PopoverRenameObject = ({ object }) => {
1084
953
  object,
1085
954
  name
1086
955
  ]);
1087
- return /* @__PURE__ */ React12.createElement("div", {
956
+ return /* @__PURE__ */ React9.createElement("div", {
1088
957
  role: "none",
1089
958
  className: "p-2 flex gap-2"
1090
- }, /* @__PURE__ */ React12.createElement("div", {
959
+ }, /* @__PURE__ */ React9.createElement("div", {
1091
960
  role: "none",
1092
961
  className: "flex-1"
1093
- }, /* @__PURE__ */ React12.createElement(Input3.Root, null, /* @__PURE__ */ React12.createElement(Input3.Label, {
962
+ }, /* @__PURE__ */ React9.createElement(Input2.Root, null, /* @__PURE__ */ React9.createElement(Input2.Label, {
1094
963
  srOnly: true
1095
- }, t("object name label")), /* @__PURE__ */ React12.createElement(Input3.TextInput, {
964
+ }, t("object name label")), /* @__PURE__ */ React9.createElement(Input2.TextInput, {
1096
965
  placeholder: t("object placeholder"),
1097
966
  value: name,
1098
967
  "data-testid": "spacePlugin.renameObject.input",
1099
- onChange: ({ target: { value } }) => setName(value),
968
+ onChange: ({ target: { value: value2 } }) => setName(value2),
1100
969
  onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
1101
- }))), /* @__PURE__ */ React12.createElement(Button5, {
970
+ }))), /* @__PURE__ */ React9.createElement(Button3, {
1102
971
  ref: doneButton,
1103
972
  classNames: "self-stretch",
1104
973
  onClick: handleDone
@@ -1110,18 +979,19 @@ var PopoverRenameObject = ({ object }) => {
1110
979
  }
1111
980
  };
1112
981
 
1113
- // src/components/PopoverRenameSpace.tsx
1114
- import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
1115
- import React13, { useCallback as useCallback8, useRef as useRef5, useState as useState6 } from "react";
1116
- import { LayoutAction as LayoutAction6, createIntent as createIntent7, useIntentDispatcher as useIntentDispatcher7 } from "@dxos/app-framework";
1117
- import { Button as Button6, Input as Input4, Popover, useTranslation as useTranslation12 } from "@dxos/react-ui";
1118
- var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
1119
- var PopoverRenameSpace = ({ space }) => {
1120
- var _effect = _useSignals13();
982
+ // src/components/SpaceRenamePopover/SpaceRenamePopover.tsx
983
+ import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
984
+ import React10, { useCallback as useCallback8, useRef as useRef4, useState as useState5 } from "react";
985
+ import { LayoutAction as LayoutAction6, createIntent as createIntent7 } from "@dxos/app-framework";
986
+ import { useIntentDispatcher as useIntentDispatcher7 } from "@dxos/app-framework/react";
987
+ import { Button as Button4, Input as Input3, Popover, useTranslation as useTranslation10 } from "@dxos/react-ui";
988
+ var SPACE_RENAME_POPOVER = `${meta.id}/SpaceRenamePopover`;
989
+ var SpaceRenamePopover = ({ space }) => {
990
+ var _effect = _useSignals10();
1121
991
  try {
1122
- const { t } = useTranslation12(SPACE_PLUGIN);
1123
- const doneButton = useRef5(null);
1124
- const [name, setName] = useState6(space.properties.name ?? "");
992
+ const { t } = useTranslation10(meta.id);
993
+ const doneButton = useRef4(null);
994
+ const [name, setName] = useState5(space.properties.name ?? "");
1125
995
  const { dispatchPromise: dispatch } = useIntentDispatcher7();
1126
996
  const handleDone = useCallback8(() => {
1127
997
  space.properties.name = name;
@@ -1137,24 +1007,24 @@ var PopoverRenameSpace = ({ space }) => {
1137
1007
  space,
1138
1008
  name
1139
1009
  ]);
1140
- return /* @__PURE__ */ React13.createElement("div", {
1010
+ return /* @__PURE__ */ React10.createElement("div", {
1141
1011
  role: "none",
1142
1012
  className: "p-2 flex gap-2"
1143
- }, /* @__PURE__ */ React13.createElement("div", {
1013
+ }, /* @__PURE__ */ React10.createElement("div", {
1144
1014
  role: "none",
1145
1015
  className: "flex-1"
1146
- }, /* @__PURE__ */ React13.createElement(Input4.Root, null, /* @__PURE__ */ React13.createElement(Input4.Label, {
1016
+ }, /* @__PURE__ */ React10.createElement(Input3.Root, null, /* @__PURE__ */ React10.createElement(Input3.Label, {
1147
1017
  srOnly: true
1148
- }, t("space name label")), /* @__PURE__ */ React13.createElement(Input4.TextInput, {
1018
+ }, t("space name label")), /* @__PURE__ */ React10.createElement(Input3.TextInput, {
1149
1019
  defaultValue: space.properties.name ?? "",
1150
1020
  placeholder: t("unnamed space label"),
1151
- onChange: ({ target: { value } }) => setName(value),
1021
+ onChange: ({ target: { value: value2 } }) => setName(value2),
1152
1022
  // TODO(wittjosiah): Ideally this should access the popover context to close the popover.
1153
1023
  // Currently this is not possible because Radix does not expose the popover context.
1154
1024
  onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
1155
- }))), /* @__PURE__ */ React13.createElement(Popover.Close, {
1025
+ }))), /* @__PURE__ */ React10.createElement(Popover.Close, {
1156
1026
  asChild: true
1157
- }, /* @__PURE__ */ React13.createElement(Button6, {
1027
+ }, /* @__PURE__ */ React10.createElement(Button4, {
1158
1028
  ref: doneButton,
1159
1029
  classNames: "self-stretch",
1160
1030
  onClick: handleDone
@@ -1167,57 +1037,59 @@ var PopoverRenameSpace = ({ space }) => {
1167
1037
  };
1168
1038
 
1169
1039
  // src/components/SchemaContainer.tsx
1170
- import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
1171
- import React14, { useEffect as useEffect3, useState as useState7 } from "react";
1172
- import { useTranslation as useTranslation13 } from "@dxos/react-ui";
1040
+ import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
1041
+ import React11, { useEffect as useEffect2, useState as useState6 } from "react";
1042
+ import { useTranslation as useTranslation11 } from "@dxos/react-ui";
1173
1043
  import { ControlPage as ControlPage2, ControlSection as ControlSection2, controlItemClasses } from "@dxos/react-ui-form";
1174
- import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
1175
- var useQuerySpaceSchemas = (space) => {
1176
- const [schemas, setSchemas] = useState7([]);
1177
- useEffect3(() => {
1178
- const query = space.db.schemaRegistry.query();
1179
- const initialResults = query.runSync();
1180
- setSchemas(initialResults);
1181
- const unsubscribe = query.subscribe(() => setSchemas(query.results));
1182
- return () => unsubscribe();
1183
- }, [
1184
- space
1185
- ]);
1186
- return schemas;
1187
- };
1044
+ import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
1188
1045
  var SchemaContainer = ({ space }) => {
1189
- var _effect = _useSignals14();
1046
+ var _effect = _useSignals11();
1190
1047
  try {
1191
- const { t } = useTranslation13(SPACE_PLUGIN);
1048
+ const { t } = useTranslation11(meta.id);
1192
1049
  const schemas = useQuerySpaceSchemas(space);
1193
- return /* @__PURE__ */ React14.createElement(StackItem3.Content, {
1194
- classNames: "block overflow-y-auto"
1195
- }, /* @__PURE__ */ React14.createElement(ControlPage2, null, /* @__PURE__ */ React14.createElement(ControlSection2, {
1050
+ return /* @__PURE__ */ React11.createElement(StackItem2.Content, {
1051
+ scrollable: true
1052
+ }, /* @__PURE__ */ React11.createElement(ControlPage2, null, /* @__PURE__ */ React11.createElement(ControlSection2, {
1196
1053
  title: t("schema verbose label"),
1197
1054
  description: t("schema description")
1198
- }, /* @__PURE__ */ React14.createElement("div", {
1055
+ }, /* @__PURE__ */ React11.createElement("div", {
1199
1056
  role: "none",
1200
1057
  className: controlItemClasses
1201
- }, schemas.length === 0 && /* @__PURE__ */ React14.createElement("div", {
1058
+ }, schemas.length === 0 && /* @__PURE__ */ React11.createElement("div", {
1202
1059
  className: "text-center plb-4"
1203
- }, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React14.createElement("div", {
1060
+ }, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React11.createElement("div", {
1061
+ role: "none",
1204
1062
  key: schema.id
1205
- }, /* @__PURE__ */ React14.createElement("div", null, schema.typename)))))));
1063
+ }, schema.typename))))));
1206
1064
  } finally {
1207
1065
  _effect.f();
1208
1066
  }
1209
1067
  };
1068
+ var useQuerySpaceSchemas = (space) => {
1069
+ const [schemas, setSchemas] = useState6([]);
1070
+ useEffect2(() => {
1071
+ const query = space.db.schemaRegistry.query();
1072
+ const initialResults = query.runSync();
1073
+ setSchemas(initialResults);
1074
+ const unsubscribe = query.subscribe(() => setSchemas(query.results));
1075
+ return () => unsubscribe();
1076
+ }, [
1077
+ space
1078
+ ]);
1079
+ return schemas;
1080
+ };
1210
1081
 
1211
- // src/components/SpacePresence.tsx
1212
- import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
1213
- import { Option } from "effect";
1214
- import React15, { forwardRef, useCallback as useCallback9, useEffect as useEffect4, useState as useState8 } from "react";
1215
- import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
1082
+ // src/components/SpacePresence/SpacePresence.tsx
1083
+ import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
1084
+ import * as Option2 from "effect/Option";
1085
+ import React12, { forwardRef, useCallback as useCallback9, useEffect as useEffect3, useState as useState7 } from "react";
1086
+ import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework/react";
1216
1087
  import { generateName } from "@dxos/display-name";
1088
+ import { Obj as Obj5 } from "@dxos/echo";
1217
1089
  import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
1218
- import { fullyQualifiedId as fullyQualifiedId3, getSpace as getSpace3, useMembers } from "@dxos/react-client/echo";
1090
+ import { getSpace as getSpace3, useMembers } from "@dxos/react-client/echo";
1219
1091
  import { useIdentity } from "@dxos/react-client/halo";
1220
- import { Avatar, List, ListItem, Popover as Popover2, Tooltip as Tooltip2, useDefaultValue, useTranslation as useTranslation14 } from "@dxos/react-ui";
1092
+ import { Avatar, List, ListItem, Popover as Popover2, Tooltip, useDefaultValue as useDefaultValue2, useTranslation as useTranslation12 } from "@dxos/react-ui";
1221
1093
  import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
1222
1094
  import { ComplexMap, keyToFallback } from "@dxos/util";
1223
1095
  var REFRESH_INTERVAL = 5e3;
@@ -1225,15 +1097,15 @@ var ACTIVITY_DURATION = 3e4;
1225
1097
  var noViewers = new ComplexMap(PublicKey.hash);
1226
1098
  var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
1227
1099
  var SpacePresence = ({ object, spaceKey }) => {
1228
- var _effect = _useSignals15();
1100
+ var _effect = _useSignals12();
1229
1101
  try {
1230
1102
  const spaceState = useCapability(SpaceCapabilities.MutableState);
1231
1103
  const client = useClient5();
1232
1104
  const identity = useIdentity();
1233
1105
  const space = spaceKey ? client.spaces.get(spaceKey) : getSpace3(object);
1234
1106
  const spaceMembers = useMembers(space?.key);
1235
- const [_moment, setMoment] = useState8(Date.now());
1236
- useEffect4(() => {
1107
+ const [_moment, setMoment] = useState7(Date.now());
1108
+ useEffect3(() => {
1237
1109
  const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
1238
1110
  return () => clearInterval(interval);
1239
1111
  }, []);
@@ -1244,7 +1116,7 @@ var SpacePresence = ({ object, spaceKey }) => {
1244
1116
  if (!identity || !spaceState || !space) {
1245
1117
  return null;
1246
1118
  }
1247
- const currentObjectViewers = spaceState.viewersByObject[fullyQualifiedId3(object)] ?? noViewers;
1119
+ const currentObjectViewers = spaceState.viewersByObject[Obj5.getDXN(object).toString()] ?? noViewers;
1248
1120
  const membersForObject = spaceMembers.filter((member) => memberOnline(member) && memberIsNotSelf(member)).filter((member) => currentObjectViewers.has(member.identity.identityKey)).map((member) => {
1249
1121
  const objectView = currentObjectViewers.get(member.identity.identityKey);
1250
1122
  const lastSeen = objectView?.lastSeen ?? -Infinity;
@@ -1255,7 +1127,7 @@ var SpacePresence = ({ object, spaceKey }) => {
1255
1127
  lastSeen
1256
1128
  };
1257
1129
  }).toSorted((a, b) => a.lastSeen - b.lastSeen);
1258
- return /* @__PURE__ */ React15.createElement(FullPresence, {
1130
+ return /* @__PURE__ */ React12.createElement(FullPresence, {
1259
1131
  members: membersForObject
1260
1132
  });
1261
1133
  } finally {
@@ -1263,46 +1135,46 @@ var SpacePresence = ({ object, spaceKey }) => {
1263
1135
  }
1264
1136
  };
1265
1137
  var FullPresence = (props) => {
1266
- var _effect = _useSignals15();
1138
+ var _effect = _useSignals12();
1267
1139
  try {
1268
1140
  const { size = 9, onMemberClick } = props;
1269
- const members = useDefaultValue(props.members, () => []);
1141
+ const members = useDefaultValue2(props.members, () => []);
1270
1142
  if (members.length === 0) {
1271
1143
  return null;
1272
1144
  }
1273
- return /* @__PURE__ */ React15.createElement("div", {
1145
+ return /* @__PURE__ */ React12.createElement("div", {
1274
1146
  className: "dx-avatar-group",
1275
1147
  "data-testid": "spacePlugin.presence"
1276
- }, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
1148
+ }, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
1277
1149
  key: member.identity.identityKey.toHex(),
1278
1150
  side: "bottom",
1279
1151
  content: getName(member.identity),
1280
1152
  className: "grid focus:outline-none"
1281
- }, /* @__PURE__ */ React15.createElement(PresenceAvatar, {
1153
+ }, /* @__PURE__ */ React12.createElement(PresenceAvatar, {
1282
1154
  identity: member.identity,
1283
1155
  match: member.currentlyAttended,
1284
1156
  index: members.length - i,
1285
1157
  onClick: () => onMemberClick?.(member),
1286
1158
  size
1287
- }))), members.length > 3 && /* @__PURE__ */ React15.createElement(Popover2.Root, null, /* @__PURE__ */ React15.createElement(Popover2.Trigger, {
1159
+ }))), members.length > 3 && /* @__PURE__ */ React12.createElement(Popover2.Root, null, /* @__PURE__ */ React12.createElement(Popover2.Trigger, {
1288
1160
  className: "grid focus:outline-none"
1289
- }, /* @__PURE__ */ React15.createElement(Avatar.Root, null, /* @__PURE__ */ React15.createElement(Avatar.Content, {
1161
+ }, /* @__PURE__ */ React12.createElement(Avatar.Root, null, /* @__PURE__ */ React12.createElement(Avatar.Content, {
1290
1162
  status: "inactive",
1291
1163
  style: {
1292
1164
  zIndex: members.length - 4
1293
1165
  },
1294
1166
  fallback: `+${members.length - 3}`,
1295
1167
  size
1296
- }))), /* @__PURE__ */ React15.createElement(Popover2.Portal, null, /* @__PURE__ */ React15.createElement(Popover2.Content, {
1168
+ }))), /* @__PURE__ */ React12.createElement(Popover2.Portal, null, /* @__PURE__ */ React12.createElement(Popover2.Content, {
1297
1169
  side: "bottom"
1298
- }, /* @__PURE__ */ React15.createElement(Popover2.Arrow, null), /* @__PURE__ */ React15.createElement(Popover2.Viewport, {
1170
+ }, /* @__PURE__ */ React12.createElement(Popover2.Arrow, null), /* @__PURE__ */ React12.createElement(Popover2.Viewport, {
1299
1171
  classNames: "max-bs-56"
1300
- }, /* @__PURE__ */ React15.createElement(List, null, members.map((member) => /* @__PURE__ */ React15.createElement(ListItem.Root, {
1172
+ }, /* @__PURE__ */ React12.createElement(List, null, members.map((member) => /* @__PURE__ */ React12.createElement(ListItem.Root, {
1301
1173
  key: member.identity.identityKey.toHex(),
1302
1174
  classNames: "flex gap-2 items-center cursor-pointer mbe-2",
1303
1175
  onClick: () => onMemberClick?.(member),
1304
1176
  "data-testid": "identity-list-item"
1305
- }, /* @__PURE__ */ React15.createElement(PresenceAvatar, {
1177
+ }, /* @__PURE__ */ React12.createElement(PresenceAvatar, {
1306
1178
  identity: member.identity,
1307
1179
  size,
1308
1180
  showName: true,
@@ -1312,12 +1184,12 @@ var FullPresence = (props) => {
1312
1184
  _effect.f();
1313
1185
  }
1314
1186
  };
1315
- var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, index, onClick, size }, forwardedRef) => {
1316
- var _effect = _useSignals15();
1187
+ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match: match2, index, onClick, size }, forwardedRef) => {
1188
+ var _effect = _useSignals12();
1317
1189
  try {
1318
- const status = match ? "current" : "active";
1190
+ const status = match2 ? "current" : "active";
1319
1191
  const fallbackValue = keyToFallback(identity.identityKey);
1320
- return /* @__PURE__ */ React15.createElement(Avatar.Root, null, /* @__PURE__ */ React15.createElement(Avatar.Content, {
1192
+ return /* @__PURE__ */ React12.createElement(Avatar.Root, null, /* @__PURE__ */ React12.createElement(Avatar.Content, {
1321
1193
  status,
1322
1194
  hue: identity.profile?.data?.hue || fallbackValue.hue,
1323
1195
  "data-testid": "spacePlugin.presence.member",
@@ -1331,7 +1203,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
1331
1203
  onClick,
1332
1204
  fallback: identity.profile?.data?.emoji || fallbackValue.emoji,
1333
1205
  ref: forwardedRef
1334
- }), /* @__PURE__ */ React15.createElement(Avatar.Label, {
1206
+ }), /* @__PURE__ */ React12.createElement(Avatar.Label, {
1335
1207
  classNames: showName ? "text-sm truncate pli-2" : "sr-only"
1336
1208
  }, getName(identity)));
1337
1209
  } finally {
@@ -1339,7 +1211,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
1339
1211
  }
1340
1212
  });
1341
1213
  var SmallPresenceLive = ({ id, open, viewers }) => {
1342
- var _effect = _useSignals15();
1214
+ var _effect = _useSignals12();
1343
1215
  try {
1344
1216
  const { hasAttention, isAncestor, isRelated } = useAttention(id);
1345
1217
  const isAttended = hasAttention || isAncestor || isRelated;
@@ -1347,13 +1219,13 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
1347
1219
  const attended = useAttended();
1348
1220
  const startOfAttention = attended.at(-1);
1349
1221
  const path = usePath(graph, startOfAttention);
1350
- const containsAttended = !open && !isAttended && id && Option.isSome(path) ? path.value.includes(id) : false;
1222
+ const containsAttended = !open && !isAttended && id && Option2.isSome(path) ? path.value.includes(id) : false;
1351
1223
  const getActiveViewers = (viewers2) => {
1352
1224
  const moment = Date.now();
1353
1225
  return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
1354
1226
  };
1355
- const [activeViewers, setActiveViewers] = useState8(viewers ? getActiveViewers(viewers) : []);
1356
- useEffect4(() => {
1227
+ const [activeViewers, setActiveViewers] = useState7(viewers ? getActiveViewers(viewers) : []);
1228
+ useEffect3(() => {
1357
1229
  if (viewers) {
1358
1230
  setActiveViewers(getActiveViewers(viewers));
1359
1231
  const interval = setInterval(() => {
@@ -1364,7 +1236,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
1364
1236
  }, [
1365
1237
  viewers
1366
1238
  ]);
1367
- return /* @__PURE__ */ React15.createElement(SmallPresence, {
1239
+ return /* @__PURE__ */ React12.createElement(SmallPresence, {
1368
1240
  count: activeViewers.length,
1369
1241
  attended: isAttended,
1370
1242
  containsAttended
@@ -1374,16 +1246,16 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
1374
1246
  }
1375
1247
  };
1376
1248
  var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1377
- var _effect = _useSignals15();
1249
+ var _effect = _useSignals12();
1378
1250
  try {
1379
- const { t } = useTranslation14(SPACE_PLUGIN);
1380
- return /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
1251
+ const { t } = useTranslation12(meta.id);
1252
+ return /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
1381
1253
  asChild: true,
1382
1254
  content: t("presence label", {
1383
1255
  count
1384
1256
  }),
1385
1257
  side: "bottom"
1386
- }, /* @__PURE__ */ React15.createElement(AttentionGlyph, {
1258
+ }, /* @__PURE__ */ React12.createElement(AttentionGlyph, {
1387
1259
  attended,
1388
1260
  containsAttended,
1389
1261
  presence: count > 1 ? "many" : count === 1 ? "one" : "none",
@@ -1395,45 +1267,44 @@ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1395
1267
  };
1396
1268
 
1397
1269
  // src/components/SpacePluginSettings.tsx
1398
- import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
1399
- import React16 from "react";
1400
- import { createIntent as createIntent8, useIntentDispatcher as useIntentDispatcher8 } from "@dxos/app-framework";
1270
+ import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
1271
+ import React13 from "react";
1272
+ import { createIntent as createIntent8 } from "@dxos/app-framework";
1273
+ import { useIntentDispatcher as useIntentDispatcher8 } from "@dxos/app-framework/react";
1401
1274
  import { useClient as useClient6 } from "@dxos/react-client";
1402
1275
  import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
1403
- import { IconButton, Input as Input5, List as List2, ListItem as ListItem2, toLocalizedString as toLocalizedString3, useTranslation as useTranslation15 } from "@dxos/react-ui";
1404
- import { ControlPage as ControlPage3, ControlSection as ControlSection3, DeprecatedFormInput, controlItemClasses as controlItemClasses2 } from "@dxos/react-ui-form";
1276
+ import { IconButton as IconButton3, Input as Input4, List as List2, ListItem as ListItem2, toLocalizedString as toLocalizedString3, useTranslation as useTranslation13 } from "@dxos/react-ui";
1277
+ import { ControlGroup, ControlItemInput as ControlItemInput2, ControlPage as ControlPage3, ControlSection as ControlSection3, controlItemClasses as controlItemClasses2 } from "@dxos/react-ui-form";
1405
1278
  var SpacePluginSettings = ({ settings }) => {
1406
- var _effect = _useSignals16();
1279
+ var _effect = _useSignals13();
1407
1280
  try {
1408
- const { t } = useTranslation15(SPACE_PLUGIN);
1281
+ const { t } = useTranslation13(meta.id);
1409
1282
  const client = useClient6();
1410
1283
  const spaces = useSpaces2({
1411
1284
  all: settings.showHidden
1412
1285
  });
1413
1286
  const { dispatchPromise: dispatch } = useIntentDispatcher8();
1414
- return /* @__PURE__ */ React16.createElement(ControlPage3, null, /* @__PURE__ */ React16.createElement(ControlSection3, {
1287
+ return /* @__PURE__ */ React13.createElement(ControlPage3, null, /* @__PURE__ */ React13.createElement(ControlSection3, {
1415
1288
  title: t("space settings label"),
1416
1289
  description: t("space settings description")
1417
- }, /* @__PURE__ */ React16.createElement("div", {
1418
- className: "pli-trimMd container-max-width"
1419
- }, /* @__PURE__ */ React16.createElement(DeprecatedFormInput, {
1420
- label: t("show hidden spaces label")
1421
- }, /* @__PURE__ */ React16.createElement(Input5.Switch, {
1290
+ }, /* @__PURE__ */ React13.createElement(ControlGroup, null, /* @__PURE__ */ React13.createElement(ControlItemInput2, {
1291
+ title: t("show hidden spaces label")
1292
+ }, /* @__PURE__ */ React13.createElement(Input4.Switch, {
1422
1293
  checked: settings.showHidden,
1423
1294
  onCheckedChange: (checked) => settings.showHidden = !!checked
1424
- }))), /* @__PURE__ */ React16.createElement(List2, {
1295
+ }))), /* @__PURE__ */ React13.createElement(List2, {
1425
1296
  classNames: [
1426
1297
  controlItemClasses2,
1427
1298
  "flex flex-col gap-trimSm"
1428
1299
  ]
1429
- }, spaces.map((space) => /* @__PURE__ */ React16.createElement(ListItem2.Root, {
1300
+ }, spaces.map((space) => /* @__PURE__ */ React13.createElement(ListItem2.Root, {
1430
1301
  key: space.id,
1431
1302
  classNames: "is-full items-center"
1432
- }, /* @__PURE__ */ React16.createElement(ListItem2.Heading, {
1303
+ }, /* @__PURE__ */ React13.createElement(ListItem2.Heading, {
1433
1304
  classNames: "grow truncate !min-bs-0"
1434
1305
  }, toLocalizedString3(getSpaceDisplayName(space, {
1435
1306
  personal: space === client.spaces.default
1436
- }), t)), /* @__PURE__ */ React16.createElement(IconButton, {
1307
+ }), t)), /* @__PURE__ */ React13.createElement(IconButton3, {
1437
1308
  icon: "ph--faders--regular",
1438
1309
  onClick: () => dispatch(createIntent8(SpaceAction.OpenSettings, {
1439
1310
  space
@@ -1446,38 +1317,40 @@ var SpacePluginSettings = ({ settings }) => {
1446
1317
  };
1447
1318
 
1448
1319
  // src/components/SpaceSettings/SpaceSettingsContainer.tsx
1449
- import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
1450
- import { Schema, pipe as pipe2 } from "effect";
1451
- import React17, { useCallback as useCallback10, useMemo as useMemo3, useState as useState9 } from "react";
1452
- import { LayoutAction as LayoutAction7, chain as chain2, createIntent as createIntent9, useIntentDispatcher as useIntentDispatcher9 } from "@dxos/app-framework";
1320
+ import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
1321
+ import * as Function3 from "effect/Function";
1322
+ import * as Schema from "effect/Schema";
1323
+ import React14, { useCallback as useCallback10, useMemo as useMemo2, useState as useState8 } from "react";
1324
+ import { LayoutAction as LayoutAction7, chain as chain2, createIntent as createIntent9 } from "@dxos/app-framework";
1325
+ import { useIntentDispatcher as useIntentDispatcher9 } from "@dxos/app-framework/react";
1453
1326
  import { log as log3 } from "@dxos/log";
1454
1327
  import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
1455
1328
  import { useClient as useClient7 } from "@dxos/react-client";
1456
- import { SpaceState as SpaceState2 } from "@dxos/react-client/echo";
1457
- import { Button as Button7, Input as Input6, useMulticastObservable, useTranslation as useTranslation16 } from "@dxos/react-ui";
1458
- import { ControlItem, ControlItemInput as ControlItemInput2, ControlPage as ControlPage4, ControlSection as ControlSection4, Form as Form3 } from "@dxos/react-ui-form";
1329
+ import { SpaceState } from "@dxos/react-client/echo";
1330
+ import { Button as Button5, Input as Input5, useFileDownload, useMulticastObservable, useTranslation as useTranslation14 } from "@dxos/react-ui";
1331
+ import { ControlItem, ControlItemInput as ControlItemInput3, ControlPage as ControlPage4, ControlSection as ControlSection4, Form as Form3 } from "@dxos/react-ui-form";
1459
1332
  import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
1460
- import { StackItem as StackItem4 } from "@dxos/react-ui-stack";
1333
+ import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
1461
1334
  var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx";
1462
1335
  var FormSchema = SpaceForm.pipe(Schema.extend(Schema.Struct({
1463
1336
  archived: Schema.Boolean.annotations({
1464
- title: "Archive space"
1337
+ title: "Archive Space"
1465
1338
  })
1466
1339
  })));
1467
1340
  var SpaceSettingsContainer = ({ space }) => {
1468
- var _effect = _useSignals17();
1341
+ var _effect = _useSignals14();
1469
1342
  try {
1470
- const { t } = useTranslation16(SPACE_PLUGIN);
1343
+ const { t } = useTranslation14(meta.id);
1471
1344
  const { dispatchPromise: dispatch } = useIntentDispatcher9();
1472
1345
  const client = useClient7();
1473
- const archived = useMulticastObservable(space.state) === SpaceState2.SPACE_INACTIVE;
1474
- const [edgeReplication, setEdgeReplication] = useState9(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
1346
+ const archived = useMulticastObservable(space.state) === SpaceState.SPACE_INACTIVE;
1347
+ const [edgeReplication, setEdgeReplication] = useState8(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
1475
1348
  const toggleEdgeReplication = useCallback10(async (next) => {
1476
1349
  setEdgeReplication(next);
1477
1350
  await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
1478
1351
  log3.catch(err, void 0, {
1479
1352
  F: __dxlog_file4,
1480
- L: 51,
1353
+ L: 57,
1481
1354
  S: void 0,
1482
1355
  C: (f, a) => f(...a)
1483
1356
  });
@@ -1498,7 +1371,7 @@ var SpaceSettingsContainer = ({ space }) => {
1498
1371
  space.properties.hue = properties.hue;
1499
1372
  }
1500
1373
  if (properties.archived && !archived) {
1501
- void dispatch(pipe2(createIntent9(SpaceAction.Close, {
1374
+ void dispatch(Function3.pipe(createIntent9(SpaceAction.Close, {
1502
1375
  space
1503
1376
  }), chain2(LayoutAction7.SwitchWorkspace, {
1504
1377
  part: "workspace",
@@ -1514,7 +1387,7 @@ var SpaceSettingsContainer = ({ space }) => {
1514
1387
  toggleEdgeReplication,
1515
1388
  archived
1516
1389
  ]);
1517
- const values = useMemo3(() => ({
1390
+ const values = useMemo2(() => ({
1518
1391
  name: space.properties.name,
1519
1392
  icon: space.properties.icon,
1520
1393
  hue: space.properties.hue,
@@ -1527,16 +1400,16 @@ var SpaceSettingsContainer = ({ space }) => {
1527
1400
  edgeReplication,
1528
1401
  archived
1529
1402
  ]);
1530
- const customElements = useMemo3(() => ({
1403
+ const customElements = useMemo2(() => ({
1531
1404
  name: ({ type, label, getValue, onValueChange }) => {
1532
- const handleChange = useCallback10(({ target: { value } }) => onValueChange(type, value), [
1405
+ const handleChange = useCallback10(({ target: { value: value2 } }) => onValueChange(type, value2), [
1533
1406
  onValueChange,
1534
1407
  type
1535
1408
  ]);
1536
- return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
1409
+ return /* @__PURE__ */ React14.createElement(ControlItemInput3, {
1537
1410
  title: label,
1538
1411
  description: t("display name description")
1539
- }, /* @__PURE__ */ React17.createElement(Input6.TextInput, {
1412
+ }, /* @__PURE__ */ React14.createElement(Input5.TextInput, {
1540
1413
  value: getValue(),
1541
1414
  onChange: handleChange,
1542
1415
  placeholder: t("display name input placeholder"),
@@ -1544,23 +1417,22 @@ var SpaceSettingsContainer = ({ space }) => {
1544
1417
  }));
1545
1418
  },
1546
1419
  icon: ({ type, label, getValue, onValueChange }) => {
1547
- const handleChange = useCallback10((nextEmoji) => onValueChange(type, nextEmoji), [
1420
+ const handleChange = useCallback10((icon) => onValueChange(type, icon), [
1548
1421
  onValueChange,
1549
1422
  type
1550
1423
  ]);
1551
- const handleEmojiReset = useCallback10(() => onValueChange(type, void 0), [
1424
+ const handleReset = useCallback10(() => onValueChange(type, void 0), [
1552
1425
  onValueChange,
1553
1426
  type
1554
1427
  ]);
1555
- return /* @__PURE__ */ React17.createElement(ControlItem, {
1428
+ return /* @__PURE__ */ React14.createElement(ControlItem, {
1556
1429
  title: label,
1557
1430
  description: t("icon description")
1558
- }, /* @__PURE__ */ React17.createElement(IconPicker, {
1431
+ }, /* @__PURE__ */ React14.createElement(IconPicker, {
1559
1432
  value: getValue(),
1560
1433
  onChange: handleChange,
1561
- onReset: handleEmojiReset,
1562
- classNames: "justify-self-end",
1563
- iconSize: 5
1434
+ onReset: handleReset,
1435
+ classNames: "justify-self-end"
1564
1436
  }));
1565
1437
  },
1566
1438
  hue: ({ type, label, getValue, onValueChange }) => {
@@ -1568,18 +1440,18 @@ var SpaceSettingsContainer = ({ space }) => {
1568
1440
  onValueChange,
1569
1441
  type
1570
1442
  ]);
1571
- const handleHueReset = useCallback10(() => onValueChange(type, void 0), [
1443
+ const handleReset = useCallback10(() => onValueChange(type, void 0), [
1572
1444
  onValueChange,
1573
1445
  type
1574
1446
  ]);
1575
- return /* @__PURE__ */ React17.createElement(ControlItem, {
1447
+ return /* @__PURE__ */ React14.createElement(ControlItem, {
1576
1448
  title: label,
1577
1449
  description: t("hue description")
1578
- }, /* @__PURE__ */ React17.createElement(HuePicker, {
1450
+ }, /* @__PURE__ */ React14.createElement(HuePicker, {
1579
1451
  value: getValue(),
1580
1452
  onChange: handleChange,
1581
- onReset: handleHueReset,
1582
- classNames: "[--hue-preview-size:1.25rem] justify-self-end"
1453
+ onReset: handleReset,
1454
+ classNames: "justify-self-end"
1583
1455
  }));
1584
1456
  },
1585
1457
  edgeReplication: ({ type, label, getValue, onValueChange }) => {
@@ -1587,10 +1459,10 @@ var SpaceSettingsContainer = ({ space }) => {
1587
1459
  onValueChange,
1588
1460
  type
1589
1461
  ]);
1590
- return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
1462
+ return /* @__PURE__ */ React14.createElement(ControlItemInput3, {
1591
1463
  title: label,
1592
1464
  description: t("edge replication description")
1593
- }, /* @__PURE__ */ React17.createElement(Input6.Switch, {
1465
+ }, /* @__PURE__ */ React14.createElement(Input5.Switch, {
1594
1466
  checked: getValue(),
1595
1467
  onCheckedChange: handleChange,
1596
1468
  classNames: "justify-self-end"
@@ -1602,11 +1474,12 @@ var SpaceSettingsContainer = ({ space }) => {
1602
1474
  type,
1603
1475
  getValue
1604
1476
  ]);
1605
- return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
1477
+ return /* @__PURE__ */ React14.createElement(ControlItemInput3, {
1606
1478
  title: label,
1607
1479
  description: t("archive space description")
1608
- }, /* @__PURE__ */ React17.createElement(Button7, {
1480
+ }, /* @__PURE__ */ React14.createElement(Button5, {
1609
1481
  disabled: space === client.spaces.default,
1482
+ variant: getValue() ? "default" : "destructive",
1610
1483
  onClick: handleChange
1611
1484
  }, getValue() ? t("unarchive space label") : t("archive space label")));
1612
1485
  }
@@ -1614,46 +1487,65 @@ var SpaceSettingsContainer = ({ space }) => {
1614
1487
  t,
1615
1488
  space
1616
1489
  ]);
1617
- return /* @__PURE__ */ React17.createElement(StackItem4.Content, {
1618
- classNames: "block overflow-y-auto pli-2"
1619
- }, /* @__PURE__ */ React17.createElement(ControlPage4, null, /* @__PURE__ */ React17.createElement(ControlSection4, {
1490
+ const download = useFileDownload();
1491
+ const handleBackup = useCallback10(async () => {
1492
+ const archive = await space.internal.export();
1493
+ download(new Blob([
1494
+ archive.contents
1495
+ ]), archive.filename);
1496
+ }, [
1497
+ space,
1498
+ download
1499
+ ]);
1500
+ return /* @__PURE__ */ React14.createElement(StackItem3.Content, {
1501
+ scrollable: true
1502
+ }, /* @__PURE__ */ React14.createElement(ControlPage4, null, /* @__PURE__ */ React14.createElement(ControlSection4, {
1620
1503
  title: t("space properties settings verbose label", {
1621
- ns: SPACE_PLUGIN
1504
+ ns: meta.id
1622
1505
  }),
1623
1506
  description: t("space properties settings description", {
1624
- ns: SPACE_PLUGIN
1507
+ ns: meta.id
1625
1508
  })
1626
- }, /* @__PURE__ */ React17.createElement(Form3, {
1509
+ }, /* @__PURE__ */ React14.createElement(Form3, {
1627
1510
  schema: FormSchema,
1628
1511
  values,
1629
1512
  autoSave: true,
1630
1513
  onSave: handleSave,
1631
1514
  Custom: customElements,
1632
1515
  outerSpacing: false,
1633
- classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content] gap-4"
1634
- }))));
1516
+ classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
1517
+ })), /* @__PURE__ */ React14.createElement(ControlItemInput3, {
1518
+ title: t("backup space label", {
1519
+ ns: meta.id
1520
+ }),
1521
+ description: t("backup space description", {
1522
+ ns: meta.id
1523
+ })
1524
+ }, /* @__PURE__ */ React14.createElement(Button5, {
1525
+ onClick: handleBackup
1526
+ }, t("download backup")))));
1635
1527
  } finally {
1636
1528
  _effect.f();
1637
1529
  }
1638
1530
  };
1639
1531
 
1640
1532
  // src/components/SyncStatus/InlineSyncStatus.tsx
1641
- import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
1642
- import { Option as Option2 } from "effect";
1643
- import React18, { useEffect as useEffect5, useState as useState10 } from "react";
1644
- import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
1533
+ import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
1534
+ import * as Option3 from "effect/Option";
1535
+ import React15, { useEffect as useEffect4, useState as useState9 } from "react";
1536
+ import { useAppGraph as useAppGraph3 } from "@dxos/app-framework/react";
1645
1537
  import { EdgeStatus } from "@dxos/protocols/proto/dxos/client/services";
1646
1538
  import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
1647
1539
  import { useClient as useClient8 } from "@dxos/react-client";
1648
1540
  import { useSpaceSyncState } from "@dxos/react-client/echo";
1649
- import { Tooltip as Tooltip3, useTranslation as useTranslation17 } from "@dxos/react-ui";
1541
+ import { Tooltip as Tooltip2, useTranslation as useTranslation15 } from "@dxos/react-ui";
1650
1542
  import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
1651
1543
  var useEdgeStatus = () => {
1652
- const [status, setStatus] = useState10(EdgeStatus.NOT_CONNECTED);
1544
+ const [status, setStatus] = useState9(EdgeStatus.ConnectionState.NOT_CONNECTED);
1653
1545
  const client = useClient8();
1654
- useEffect5(() => {
1546
+ useEffect4(() => {
1655
1547
  client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
1656
- setStatus(status2);
1548
+ setStatus(status2.state);
1657
1549
  });
1658
1550
  }, [
1659
1551
  client
@@ -1661,9 +1553,9 @@ var useEdgeStatus = () => {
1661
1553
  return status;
1662
1554
  };
1663
1555
  var InlineSyncStatus = ({ space, open }) => {
1664
- var _effect = _useSignals18();
1556
+ var _effect = _useSignals15();
1665
1557
  try {
1666
- const { t } = useTranslation17(SPACE_PLUGIN);
1558
+ const { t } = useTranslation15(meta.id);
1667
1559
  const id = space.id;
1668
1560
  const { hasAttention, isAncestor, isRelated } = useAttention2(id);
1669
1561
  const isAttended = hasAttention || isAncestor || isRelated;
@@ -1671,16 +1563,16 @@ var InlineSyncStatus = ({ space, open }) => {
1671
1563
  const attended = useAttended2();
1672
1564
  const startOfAttention = attended.at(-1);
1673
1565
  const path = usePath(graph, startOfAttention);
1674
- const containsAttended = !open && !isAttended && id && Option2.isSome(path) ? path.value.includes(id) : false;
1675
- const connectedToEdge = useEdgeStatus() === EdgeStatus.CONNECTED;
1566
+ const containsAttended = !open && !isAttended && id && Option3.isSome(path) ? path.value.includes(id) : false;
1567
+ const connectedToEdge = useEdgeStatus() === EdgeStatus.ConnectionState.CONNECTED;
1676
1568
  const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
1677
1569
  const syncState = useSpaceSyncState(space);
1678
1570
  const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
1679
- return /* @__PURE__ */ React18.createElement(Tooltip3.Trigger, {
1571
+ return /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
1680
1572
  asChild: true,
1681
1573
  content: t("syncing label"),
1682
1574
  side: "bottom"
1683
- }, /* @__PURE__ */ React18.createElement(AttentionGlyph2, {
1575
+ }, /* @__PURE__ */ React15.createElement(AttentionGlyph2, {
1684
1576
  syncing,
1685
1577
  attended: isAttended,
1686
1578
  containsAttended,
@@ -1692,12 +1584,16 @@ var InlineSyncStatus = ({ space, open }) => {
1692
1584
  };
1693
1585
 
1694
1586
  // src/components/SyncStatus/SyncStatus.tsx
1695
- import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
1696
- import React19, { useEffect as useEffect6, useState as useState11 } from "react";
1587
+ import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
1588
+ import React16, { useEffect as useEffect5, useState as useState10 } from "react";
1697
1589
  import { StatusBar } from "@dxos/plugin-status-bar";
1590
+ import { EdgeStatus as EdgeStatus2 } from "@dxos/protocols/proto/dxos/client/services";
1698
1591
  import { useClient as useClient9 } from "@dxos/react-client";
1592
+ import { useStream } from "@dxos/react-client/devtools";
1699
1593
  import { getSyncSummary, useSyncState } from "@dxos/react-client/echo";
1700
- import { Icon as Icon8, useTranslation as useTranslation18 } from "@dxos/react-ui";
1594
+ import { Icon as Icon5, Popover as Popover3, useTranslation as useTranslation16 } from "@dxos/react-ui";
1595
+ import { mx } from "@dxos/react-ui-theme";
1596
+ import { Unit } from "@dxos/util";
1701
1597
 
1702
1598
  // src/components/SyncStatus/save-tracker.ts
1703
1599
  import { Context } from "@dxos/context";
@@ -1793,17 +1689,13 @@ var getIcon = (status) => {
1793
1689
  // src/components/SyncStatus/SyncStatus.tsx
1794
1690
  var SYNC_STALLED_TIMEOUT = 5e3;
1795
1691
  var SyncStatus = () => {
1796
- var _effect = _useSignals19();
1692
+ var _effect = _useSignals16();
1797
1693
  try {
1798
1694
  const client = useClient9();
1799
1695
  const state = useSyncState();
1800
- const [saved, setSaved] = useState11(true);
1801
- useEffect6(() => {
1802
- return createClientSaveTracker(client, (state2) => {
1803
- setSaved(state2 === "saved");
1804
- });
1805
- }, []);
1806
- return /* @__PURE__ */ React19.createElement(SyncStatusIndicator, {
1696
+ const [saved, setSaved] = useState10(true);
1697
+ useEffect5(() => createClientSaveTracker(client, (state2) => setSaved(state2 === "saved")), []);
1698
+ return /* @__PURE__ */ React16.createElement(SyncStatusIndicator, {
1807
1699
  state,
1808
1700
  saved
1809
1701
  });
@@ -1812,9 +1704,9 @@ var SyncStatus = () => {
1812
1704
  }
1813
1705
  };
1814
1706
  var SyncStatusIndicator = ({ state, saved }) => {
1815
- var _effect = _useSignals19();
1707
+ var _effect = _useSignals16();
1816
1708
  try {
1817
- const { t } = useTranslation18(SPACE_PLUGIN);
1709
+ const { t } = useTranslation16(meta.id);
1818
1710
  const summary = getSyncSummary(state);
1819
1711
  const offline = Object.values(state).length === 0;
1820
1712
  const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
@@ -1825,8 +1717,8 @@ var SyncStatusIndicator = ({ state, saved }) => {
1825
1717
  needsToUpload,
1826
1718
  needsToDownload
1827
1719
  });
1828
- const [classNames, setClassNames] = useState11();
1829
- useEffect6(() => {
1720
+ const [classNames, setClassNames] = useState10();
1721
+ useEffect5(() => {
1830
1722
  setClassNames(void 0);
1831
1723
  if (offline || !needsToUpload && !needsToDownload) {
1832
1724
  return;
@@ -1841,67 +1733,256 @@ var SyncStatusIndicator = ({ state, saved }) => {
1841
1733
  needsToDownload
1842
1734
  ]);
1843
1735
  const title = t(`${status} label`);
1844
- const icon = /* @__PURE__ */ React19.createElement(Icon8, {
1736
+ const icon = /* @__PURE__ */ React16.createElement(Icon5, {
1845
1737
  icon: getIcon(status),
1846
- size: 4,
1847
1738
  classNames
1848
1739
  });
1849
- return /* @__PURE__ */ React19.createElement(StatusBar.Item, {
1740
+ return /* @__PURE__ */ React16.createElement(Popover3.Root, null, /* @__PURE__ */ React16.createElement(Popover3.Trigger, {
1741
+ asChild: true
1742
+ }, /* @__PURE__ */ React16.createElement(StatusBar.Item, {
1850
1743
  title
1851
- }, icon);
1744
+ }, icon)), /* @__PURE__ */ React16.createElement(Popover3.Portal, null, /* @__PURE__ */ React16.createElement(Popover3.Content, null, /* @__PURE__ */ React16.createElement(EdgeConnectionPopover, null), /* @__PURE__ */ React16.createElement(Popover3.Arrow, null))));
1745
+ } finally {
1746
+ _effect.f();
1747
+ }
1748
+ };
1749
+ var useEdgeStatus2 = () => {
1750
+ const client = useClient9();
1751
+ const { status } = useStream(() => client.services.services.EdgeAgentService.queryEdgeStatus(), {});
1752
+ return status;
1753
+ };
1754
+ var EdgeConnectionPopover = () => {
1755
+ var _effect = _useSignals16();
1756
+ try {
1757
+ const status = useEdgeStatus2();
1758
+ const { t } = useTranslation16(meta.id);
1759
+ const isConnected = status?.state === EdgeStatus2.ConnectionState.CONNECTED;
1760
+ return /* @__PURE__ */ React16.createElement("div", {
1761
+ className: "min-is-[240px] p-2"
1762
+ }, /* @__PURE__ */ React16.createElement("div", {
1763
+ className: "flex items-center gap-2 mbe-2"
1764
+ }, /* @__PURE__ */ React16.createElement(Icon5, {
1765
+ icon: isConnected ? "ph--check-circle--regular" : "ph--warning-circle--regular",
1766
+ classNames: mx(isConnected ? "text-successText" : "text-errorText animate-pulse")
1767
+ }), /* @__PURE__ */ React16.createElement("span", {
1768
+ className: "font-medium text-sm"
1769
+ }, isConnected ? t("sync edge connected label") : t("sync edge disconnected label"))), status?.state === EdgeStatus2.ConnectionState.NOT_CONNECTED && /* @__PURE__ */ React16.createElement("div", {
1770
+ className: "flex items-center gap-2 text-sm text-description"
1771
+ }, /* @__PURE__ */ React16.createElement(Icon5, {
1772
+ icon: "ph--cloud-x--regular"
1773
+ }), /* @__PURE__ */ React16.createElement("span", null, t("sync no connection label"))), status?.state === EdgeStatus2.ConnectionState.CONNECTED && /* @__PURE__ */ React16.createElement("div", {
1774
+ className: "space-y-2"
1775
+ }, /* @__PURE__ */ React16.createElement("div", {
1776
+ className: "flex items-center justify-between text-sm"
1777
+ }, /* @__PURE__ */ React16.createElement("div", {
1778
+ className: "flex items-center gap-2 text-description"
1779
+ }, /* @__PURE__ */ React16.createElement(Icon5, {
1780
+ icon: "ph--timer--regular"
1781
+ }), /* @__PURE__ */ React16.createElement("span", null, t("sync latency label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
1782
+ value: status.rtt,
1783
+ format: Unit.Millisecond
1784
+ })), /* @__PURE__ */ React16.createElement("div", {
1785
+ className: "flex items-center justify-between text-sm"
1786
+ }, /* @__PURE__ */ React16.createElement("div", {
1787
+ className: "flex items-center gap-2 text-description"
1788
+ }, /* @__PURE__ */ React16.createElement(Icon5, {
1789
+ icon: "ph--arrow-up--regular"
1790
+ }), /* @__PURE__ */ React16.createElement("span", null, t("sync upload label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
1791
+ value: status.rateBytesUp,
1792
+ format: Unit.Kilobyte,
1793
+ suffix: "/s"
1794
+ })), /* @__PURE__ */ React16.createElement("div", {
1795
+ className: "flex items-center justify-between text-sm"
1796
+ }, /* @__PURE__ */ React16.createElement("div", {
1797
+ className: "flex items-center gap-2 text-sm text-description"
1798
+ }, /* @__PURE__ */ React16.createElement(Icon5, {
1799
+ icon: "ph--arrow-down--regular"
1800
+ }), /* @__PURE__ */ React16.createElement("span", null, t("sync download label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
1801
+ value: status.rateBytesDown,
1802
+ format: Unit.Kilobyte,
1803
+ suffix: "/s"
1804
+ }))));
1805
+ } finally {
1806
+ _effect.f();
1807
+ }
1808
+ };
1809
+ var UnitValue = ({ value: input, format, suffix }) => {
1810
+ var _effect = _useSignals16();
1811
+ try {
1812
+ const { formattedValue, unit } = format(input);
1813
+ return /* @__PURE__ */ React16.createElement("span", {
1814
+ className: "font-mono"
1815
+ }, formattedValue, /* @__PURE__ */ React16.createElement("span", {
1816
+ className: "mis-1 text-subdued"
1817
+ }, unit.symbol, suffix));
1852
1818
  } finally {
1853
1819
  _effect.f();
1854
1820
  }
1855
1821
  };
1856
1822
 
1823
+ // src/helpers/query.ts
1824
+ import * as Array2 from "effect/Array";
1825
+ import * as Effect3 from "effect/Effect";
1826
+ import * as EffectFunction from "effect/Function";
1827
+ import * as Match from "effect/Match";
1828
+ import * as Option4 from "effect/Option";
1829
+ import * as SchemaAST from "effect/SchemaAST";
1830
+ import { DXN, Filter as Filter2, Query as Query2 } from "@dxos/echo";
1831
+ import { ReferenceAnnotationId, getTypeAnnotation as getTypeAnnotation2, unwrapOptional } from "@dxos/echo/internal";
1832
+ import { log as log4 } from "@dxos/log";
1833
+ import { Person } from "@dxos/types";
1834
+ var __dxlog_file6 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/helpers/query.ts";
1835
+ var evalQuery = (queryString) => {
1836
+ const globals = {
1837
+ Query: Query2,
1838
+ Filter: Filter2,
1839
+ Person
1840
+ };
1841
+ try {
1842
+ return new Function(...Object.keys(globals), `return ${queryString}`)(...Object.values(globals));
1843
+ } catch (err) {
1844
+ log4.catch(err, void 0, {
1845
+ F: __dxlog_file6,
1846
+ L: 33,
1847
+ S: void 0,
1848
+ C: (f, a) => f(...a)
1849
+ });
1850
+ return Query2.select(Filter2.nothing());
1851
+ }
1852
+ };
1853
+ var resolveSchemaWithClientAndSpace = (client, space, query) => {
1854
+ const resolve = Effect3.fn(function* (dxn) {
1855
+ const typename = DXN.parse(dxn).asTypeDXN()?.type;
1856
+ if (!typename) {
1857
+ return Option4.none();
1858
+ }
1859
+ const staticSchema = client.graph.schemaRegistry.getSchema(typename);
1860
+ if (staticSchema) {
1861
+ return Option4.some(staticSchema);
1862
+ }
1863
+ const query2 = space.db.schemaRegistry.query({
1864
+ typename
1865
+ });
1866
+ const schemas = yield* Effect3.promise(() => query2.run());
1867
+ return Array2.head(schemas).pipe(Option4.map((schema) => schema.snapshot));
1868
+ });
1869
+ return resolveSchema(query, resolve).pipe(Effect3.map((schema) => Option4.getOrUndefined(schema)), Effect3.runPromise);
1870
+ };
1871
+ var resolveSchema = (query, resolve) => {
1872
+ return Match.value(query).pipe(
1873
+ Match.withReturnType(),
1874
+ // TODO(wittjosiah): Reconcile with filter match?
1875
+ Match.when({
1876
+ type: "select"
1877
+ }, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
1878
+ Match.when({
1879
+ type: "filter"
1880
+ }, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
1881
+ Match.when({
1882
+ type: "reference-traversal"
1883
+ }, ({ anchor, property }) => resolveSchema(anchor, resolve).pipe(Effect3.map((base) => base.pipe(Option4.map((schema) => SchemaAST.getPropertySignatures(schema.ast)), Option4.flatMap((properties) => Array2.findFirst(properties, (p) => p.name === property)), Option4.flatMap((property2) => SchemaAST.getAnnotation(ReferenceAnnotationId)(unwrapOptional(property2))), Option4.map((annotation) => annotation.typename))), Effect3.flatMap(Option4.match({
1884
+ onNone: () => Effect3.succeed(Option4.none()),
1885
+ onSome: (typename) => resolve(DXN.fromTypename(typename).toString())
1886
+ })))),
1887
+ Match.when({
1888
+ type: "relation",
1889
+ filter: Match.defined
1890
+ }, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
1891
+ Match.when({
1892
+ type: "relation-traversal"
1893
+ }, ({ anchor, direction }) => resolveSchema(anchor, resolve).pipe(Effect3.map((base) => base.pipe(Option4.map((schema) => getTypeAnnotation2(schema)), Option4.flatMap((annotation) => Option4.fromNullable(direction === "source" ? annotation?.sourceSchema : annotation?.targetSchema)))), Effect3.flatMap(Option4.match({
1894
+ onNone: () => Effect3.succeed(Option4.none()),
1895
+ onSome: (typename) => resolve(typename)
1896
+ })))),
1897
+ Match.when({
1898
+ type: "options"
1899
+ }, ({ query: query2 }) => resolveSchema(query2, resolve)),
1900
+ Match.orElse((_q) => {
1901
+ return Effect3.succeed(Option4.none());
1902
+ })
1903
+ );
1904
+ };
1905
+ var typenameFromFilter = (filter) => Match.value(filter).pipe(Match.withReturnType(), Match.when({
1906
+ type: "object"
1907
+ }, ({ typename }) => Option4.fromNullable(typename)), Match.when({
1908
+ type: "and"
1909
+ }, ({ filters }) => EffectFunction.pipe(filters, Array2.map(typenameFromFilter), Array2.findFirst(Option4.isSome), Option4.flatten)), Match.when({
1910
+ type: "or"
1911
+ }, ({ filters }) => EffectFunction.pipe(filters, Array2.map(typenameFromFilter), Array2.findFirst(Option4.isSome), Option4.flatten)), Match.orElse(() => Option4.none()));
1912
+ var getQueryTarget = (query, space) => {
1913
+ return Match.value(query).pipe(Match.when({
1914
+ type: "options"
1915
+ }, ({ options }) => {
1916
+ return Option4.fromNullable(options.queues).pipe(Option4.flatMap((queues) => Array2.head(queues)), Option4.flatMap((queueDxn) => Option4.fromNullable(DXN.tryParse(queueDxn))), Option4.flatMap((queueDxn) => Option4.fromNullable(space?.queues.get(queueDxn))), Option4.getOrElse(() => space));
1917
+ }), Match.orElse(() => space));
1918
+ };
1919
+
1857
1920
  // src/components/ViewEditor.tsx
1858
- import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
1859
- import React20, { useCallback as useCallback11, useMemo as useMemo4 } from "react";
1860
- import { createIntent as createIntent10, useIntentDispatcher as useIntentDispatcher10 } from "@dxos/app-framework";
1861
- import { Type as Type3 } from "@dxos/echo";
1862
- import { invariant as invariant2 } from "@dxos/invariant";
1921
+ import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
1922
+ import * as Schema2 from "effect/Schema";
1923
+ import React17, { useCallback as useCallback11, useState as useState11 } from "react";
1924
+ import { createIntent as createIntent10 } from "@dxos/app-framework";
1925
+ import { useIntentDispatcher as useIntentDispatcher10 } from "@dxos/app-framework/react";
1926
+ import { DXN as DXN2, Filter as Filter3, Obj as Obj6, Query as Query3, Tag, Type as Type3 } from "@dxos/echo";
1863
1927
  import { useClient as useClient10 } from "@dxos/react-client";
1864
- import { Filter as Filter2, getSpace as getSpace4, useQuery as useQuery3, useSchema } from "@dxos/react-client/echo";
1865
- import { ViewEditor as NativeViewEditor } from "@dxos/react-ui-form";
1866
- import { DataType as DataType3 } from "@dxos/schema";
1867
- var __dxlog_file6 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/ViewEditor.tsx";
1928
+ import { getSpace as getSpace4, useQuery as useQuery3 } from "@dxos/react-client/echo";
1929
+ import { useAsyncEffect } from "@dxos/react-ui";
1930
+ import { ViewEditor as NaturalViewEditor } from "@dxos/react-ui-form";
1931
+ import { View } from "@dxos/schema";
1868
1932
  var ViewEditor = ({ view }) => {
1869
- var _effect = _useSignals20();
1933
+ var _effect = _useSignals17();
1870
1934
  try {
1871
1935
  const { dispatchPromise: dispatch } = useIntentDispatcher10();
1872
1936
  const client = useClient10();
1873
1937
  const space = getSpace4(view);
1874
- const schema = useSchema(client, space, view.query.typename);
1875
- const views = useQuery3(space, Filter2.type(DataType3.View));
1876
- const currentTypename = useMemo4(() => view.query?.typename, [
1877
- view.query?.typename
1938
+ const [schema, setSchema] = useState11(() => Schema2.Struct({}));
1939
+ const tags = useQuery3(space, Filter3.type(Tag.Tag));
1940
+ const types = useTypeOptions({
1941
+ space,
1942
+ annotation: [
1943
+ "dynamic",
1944
+ "limited-static",
1945
+ "object-form"
1946
+ ]
1947
+ });
1948
+ useAsyncEffect(async () => {
1949
+ if (!view?.query || !space) {
1950
+ return;
1951
+ }
1952
+ const foundSchema = await resolveSchemaWithClientAndSpace(client, space, view.query.ast);
1953
+ if (foundSchema && foundSchema !== schema) {
1954
+ setSchema(() => foundSchema);
1955
+ }
1956
+ }, [
1957
+ client,
1958
+ space,
1959
+ view,
1960
+ schema
1878
1961
  ]);
1879
- const handleUpdateTypename = useCallback11((typename) => {
1880
- invariant2(schema, void 0, {
1881
- F: __dxlog_file6,
1882
- L: 30,
1883
- S: void 0,
1884
- A: [
1885
- "schema",
1886
- ""
1887
- ]
1888
- });
1889
- invariant2(Type3.isMutable(schema), void 0, {
1890
- F: __dxlog_file6,
1891
- L: 31,
1892
- S: void 0,
1893
- A: [
1894
- "Type.isMutable(schema)",
1895
- ""
1962
+ const handleQueryChanged = useCallback11(async (newQuery, target) => {
1963
+ if (!view || !space) {
1964
+ return;
1965
+ }
1966
+ const queue = target && DXN2.tryParse(target) ? target : void 0;
1967
+ const query = queue ? Query3.fromAst(newQuery).options({
1968
+ queues: [
1969
+ queue
1896
1970
  ]
1897
- });
1898
- const matchingViews = views.filter((view2) => view2.query.typename === currentTypename);
1899
- for (const view2 of matchingViews) {
1900
- view2.query.typename = typename;
1971
+ }) : Query3.fromAst(newQuery);
1972
+ view.query.ast = query.ast;
1973
+ const newSchema = await resolveSchemaWithClientAndSpace(client, space, query.ast);
1974
+ if (!newSchema) {
1975
+ return;
1901
1976
  }
1902
- schema.updateTypename(typename);
1977
+ const newView = View.make({
1978
+ query,
1979
+ jsonSchema: Type3.toJsonSchema(newSchema),
1980
+ presentation: Obj6.make(Type3.Expando, {})
1981
+ });
1982
+ view.projection = Obj6.getSnapshot(newView).projection;
1983
+ setSchema(() => newSchema);
1903
1984
  }, [
1904
- views,
1985
+ view,
1905
1986
  schema
1906
1987
  ]);
1907
1988
  const handleDelete = useCallback11((fieldId) => {
@@ -1916,13 +1997,16 @@ var ViewEditor = ({ view }) => {
1916
1997
  if (!space || !schema) {
1917
1998
  return null;
1918
1999
  }
1919
- return /* @__PURE__ */ React20.createElement(NativeViewEditor, {
2000
+ return /* @__PURE__ */ React17.createElement(NaturalViewEditor, {
1920
2001
  registry: space.db.schemaRegistry,
1921
2002
  schema,
1922
2003
  view,
1923
- onTypenameChanged: Type3.isMutable(schema) ? handleUpdateTypename : void 0,
1924
- onDelete: Type3.isMutable(schema) ? handleDelete : void 0,
1925
- outerSpacing: false
2004
+ mode: "query",
2005
+ outerSpacing: false,
2006
+ tags,
2007
+ types,
2008
+ onQueryChanged: handleQueryChanged,
2009
+ onDelete: Type3.isMutable(schema) ? handleDelete : void 0
1926
2010
  });
1927
2011
  } finally {
1928
2012
  _effect.f();
@@ -1930,10 +2014,11 @@ var ViewEditor = ({ view }) => {
1930
2014
  };
1931
2015
 
1932
2016
  // src/components/index.ts
1933
- import { lazy as lazy2 } from "react";
1934
- var CollectionMain = lazy2(() => import("./CollectionMain-D2B75XBS.mjs"));
1935
- var ObjectDetailsPanel = lazy2(() => import("./ObjectDetailsPanel-SY6FYTYC.mjs"));
1936
- var RecordMain = lazy2(() => import("./RecordMain-TEBGAVSL.mjs"));
2017
+ import { lazy } from "react";
2018
+ var CollectionArticle = lazy(() => import("./CollectionArticle-WTHWY4YS.mjs"));
2019
+ var ObjectDetailsPanel = lazy(() => import("./ObjectDetailsPanel-2BRUBHP6.mjs"));
2020
+ var ObjectSettingsContainer = lazy(() => import("./ObjectSettings-5LLWCVEK.mjs"));
2021
+ var RecordArticle = lazy(() => import("./RecordArticle-SXDRWTTU.mjs"));
1937
2022
 
1938
2023
  export {
1939
2024
  AwaitingObject,
@@ -1946,14 +2031,12 @@ export {
1946
2031
  JoinDialog,
1947
2032
  MembersContainer,
1948
2033
  MenuFooter,
1949
- ObjectSettingsContainer,
1950
- PersistenceStatus,
1951
- POPOVER_RENAME_OBJECT,
1952
- PopoverRenameObject,
1953
- POPOVER_RENAME_SPACE,
1954
- PopoverRenameSpace,
1955
- useQuerySpaceSchemas,
2034
+ OBJECT_RENAME_POPOVER,
2035
+ ObjectRenamePopover,
2036
+ SPACE_RENAME_POPOVER,
2037
+ SpaceRenamePopover,
1956
2038
  SchemaContainer,
2039
+ useQuerySpaceSchemas,
1957
2040
  SpacePresence,
1958
2041
  FullPresence,
1959
2042
  SmallPresenceLive,
@@ -1963,20 +2046,13 @@ export {
1963
2046
  InlineSyncStatus,
1964
2047
  SyncStatus,
1965
2048
  SyncStatusIndicator,
2049
+ evalQuery,
2050
+ resolveSchemaWithClientAndSpace,
2051
+ getQueryTarget,
1966
2052
  ViewEditor,
1967
- CollectionMain,
2053
+ CollectionArticle,
1968
2054
  ObjectDetailsPanel,
1969
- RecordMain,
1970
- AppGraphBuilder,
1971
- AppGraphSerializer,
1972
- IdentityCreated,
1973
- IntentResolver,
1974
- ReactRoot,
1975
- ReactSurface,
1976
- SchemaDefs,
1977
- SchemaTools,
1978
- SpaceSettings,
1979
- SpaceState,
1980
- SpacesReady
2055
+ ObjectSettingsContainer,
2056
+ RecordArticle
1981
2057
  };
1982
- //# sourceMappingURL=chunk-PSIBVBTA.mjs.map
2058
+ //# sourceMappingURL=chunk-CKACGS7T.mjs.map