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