@dxos/plugin-space 0.8.4-main.5ea62a8 → 0.8.4-main.66e292d

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