@dxos/plugin-space 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41

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 (1024) hide show
  1. package/dist/lib/browser/add-object-N4W6WPQE.mjs +78 -0
  2. package/dist/lib/browser/add-object-N4W6WPQE.mjs.map +7 -0
  3. package/dist/lib/browser/add-relation-NYKFMHCX.mjs +26 -0
  4. package/dist/lib/browser/add-relation-NYKFMHCX.mjs.map +7 -0
  5. package/dist/lib/browser/add-schema-YOPXV3H3.mjs +60 -0
  6. package/dist/lib/browser/add-schema-YOPXV3H3.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-BCQ2HQF2.mjs +530 -0
  8. package/dist/lib/browser/chunk-BCQ2HQF2.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-BWDWDXYZ.mjs +18 -0
  10. package/dist/lib/browser/chunk-BWDWDXYZ.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-EDP4XO2G.mjs +19 -0
  12. package/dist/lib/browser/chunk-EDP4XO2G.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-EWEBQVSI.mjs +101 -0
  14. package/dist/lib/browser/chunk-EWEBQVSI.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  16. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-JHZGRYGS.mjs +8 -0
  18. package/dist/lib/browser/chunk-JHZGRYGS.mjs.map +7 -0
  19. package/dist/lib/browser/close-H4BN5IIS.mjs +17 -0
  20. package/dist/lib/browser/close-H4BN5IIS.mjs.map +7 -0
  21. package/dist/lib/browser/create-JSER6CW7.mjs +74 -0
  22. package/dist/lib/browser/create-JSER6CW7.mjs.map +7 -0
  23. package/dist/lib/browser/delete-field-KLA2R5BV.mjs +43 -0
  24. package/dist/lib/browser/delete-field-KLA2R5BV.mjs.map +7 -0
  25. package/dist/lib/browser/duplicate-object-TBCYMIMV.mjs +17 -0
  26. package/dist/lib/browser/duplicate-object-TBCYMIMV.mjs.map +7 -0
  27. package/dist/lib/browser/export-space-EH7AF2LC.mjs +34 -0
  28. package/dist/lib/browser/export-space-EH7AF2LC.mjs.map +7 -0
  29. package/dist/lib/browser/get-share-link-A5LQL5GX.mjs +41 -0
  30. package/dist/lib/browser/get-share-link-A5LQL5GX.mjs.map +7 -0
  31. package/dist/lib/browser/import-space-RLY7FKRM.mjs +24 -0
  32. package/dist/lib/browser/import-space-RLY7FKRM.mjs.map +7 -0
  33. package/dist/lib/browser/index.mjs +31 -332
  34. package/dist/lib/browser/index.mjs.map +4 -4
  35. package/dist/lib/browser/join-YELW44DM.mjs +28 -0
  36. package/dist/lib/browser/join-YELW44DM.mjs.map +7 -0
  37. package/dist/lib/browser/meta.json +1 -1
  38. package/dist/lib/browser/meta.mjs +8 -0
  39. package/dist/lib/browser/meta.mjs.map +7 -0
  40. package/dist/lib/browser/migrate-N7SLJGCB.mjs +50 -0
  41. package/dist/lib/browser/migrate-N7SLJGCB.mjs.map +7 -0
  42. package/dist/lib/browser/open-YFA5YRB6.mjs +17 -0
  43. package/dist/lib/browser/open-YFA5YRB6.mjs.map +7 -0
  44. package/dist/lib/browser/open-create-object-BTOCMAIH.mjs +42 -0
  45. package/dist/lib/browser/open-create-object-BTOCMAIH.mjs.map +7 -0
  46. package/dist/lib/browser/open-create-space-L2G4YKKS.mjs +24 -0
  47. package/dist/lib/browser/open-create-space-L2G4YKKS.mjs.map +7 -0
  48. package/dist/lib/browser/open-import-space-MC4TA2GC.mjs +24 -0
  49. package/dist/lib/browser/open-import-space-MC4TA2GC.mjs.map +7 -0
  50. package/dist/lib/browser/open-members-HWP6Q7T6.mjs +23 -0
  51. package/dist/lib/browser/open-members-HWP6Q7T6.mjs.map +7 -0
  52. package/dist/lib/browser/open-settings-JAIE5AZH.mjs +23 -0
  53. package/dist/lib/browser/open-settings-JAIE5AZH.mjs.map +7 -0
  54. package/dist/lib/browser/operations/index.mjs +14 -0
  55. package/dist/lib/browser/operations/index.mjs.map +7 -0
  56. package/dist/lib/browser/plugin.mjs +144 -0
  57. package/dist/lib/browser/plugin.mjs.map +7 -0
  58. package/dist/lib/browser/remove-objects-2LPGZETO.mjs +51 -0
  59. package/dist/lib/browser/remove-objects-2LPGZETO.mjs.map +7 -0
  60. package/dist/lib/browser/rename-XPWATFTR.mjs +25 -0
  61. package/dist/lib/browser/rename-XPWATFTR.mjs.map +7 -0
  62. package/dist/lib/browser/rename-object-NXT5S6DB.mjs +26 -0
  63. package/dist/lib/browser/rename-object-NXT5S6DB.mjs.map +7 -0
  64. package/dist/lib/browser/restore-field-KVL5WH6P.mjs +41 -0
  65. package/dist/lib/browser/restore-field-KVL5WH6P.mjs.map +7 -0
  66. package/dist/lib/browser/restore-objects-PZZQTWCC.mjs +40 -0
  67. package/dist/lib/browser/restore-objects-PZZQTWCC.mjs.map +7 -0
  68. package/dist/lib/browser/share-6PXG476F.mjs +31 -0
  69. package/dist/lib/browser/share-6PXG476F.mjs.map +7 -0
  70. package/dist/lib/browser/snapshot-DFN2RF5D.mjs +30 -0
  71. package/dist/lib/browser/snapshot-DFN2RF5D.mjs.map +7 -0
  72. package/dist/lib/browser/types/index.mjs +8 -8
  73. package/dist/lib/browser/wait-for-object-L2PSFV2P.mjs +23 -0
  74. package/dist/lib/browser/wait-for-object-L2PSFV2P.mjs.map +7 -0
  75. package/dist/lib/node-esm/add-object-VZKKLZUC.mjs +79 -0
  76. package/dist/lib/node-esm/add-object-VZKKLZUC.mjs.map +7 -0
  77. package/dist/lib/node-esm/add-relation-K54CVWBI.mjs +27 -0
  78. package/dist/lib/node-esm/add-relation-K54CVWBI.mjs.map +7 -0
  79. package/dist/lib/node-esm/add-schema-PV6AQDDN.mjs +61 -0
  80. package/dist/lib/node-esm/add-schema-PV6AQDDN.mjs.map +7 -0
  81. package/dist/lib/node-esm/chunk-5T3ESDLM.mjs +531 -0
  82. package/dist/lib/node-esm/chunk-5T3ESDLM.mjs.map +7 -0
  83. package/dist/lib/node-esm/chunk-74U7NAKO.mjs +20 -0
  84. package/dist/lib/node-esm/chunk-74U7NAKO.mjs.map +7 -0
  85. package/dist/lib/node-esm/chunk-DR6YNKUL.mjs +102 -0
  86. package/dist/lib/node-esm/chunk-DR6YNKUL.mjs.map +7 -0
  87. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  88. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  89. package/dist/lib/node-esm/chunk-HSVHLOWA.mjs +10 -0
  90. package/dist/lib/node-esm/chunk-HSVHLOWA.mjs.map +7 -0
  91. package/dist/lib/node-esm/chunk-YP7CFUD2.mjs +21 -0
  92. package/dist/lib/node-esm/chunk-YP7CFUD2.mjs.map +7 -0
  93. package/dist/lib/node-esm/close-GQXAPILO.mjs +18 -0
  94. package/dist/lib/node-esm/close-GQXAPILO.mjs.map +7 -0
  95. package/dist/lib/node-esm/create-AOGTW76A.mjs +75 -0
  96. package/dist/lib/node-esm/create-AOGTW76A.mjs.map +7 -0
  97. package/dist/lib/node-esm/delete-field-7PEVIBJ7.mjs +44 -0
  98. package/dist/lib/node-esm/delete-field-7PEVIBJ7.mjs.map +7 -0
  99. package/dist/lib/node-esm/duplicate-object-5JL5LYNV.mjs +18 -0
  100. package/dist/lib/node-esm/duplicate-object-5JL5LYNV.mjs.map +7 -0
  101. package/dist/lib/node-esm/export-space-ZKYD3Y3P.mjs +35 -0
  102. package/dist/lib/node-esm/export-space-ZKYD3Y3P.mjs.map +7 -0
  103. package/dist/lib/node-esm/get-share-link-7NV635FT.mjs +42 -0
  104. package/dist/lib/node-esm/get-share-link-7NV635FT.mjs.map +7 -0
  105. package/dist/lib/node-esm/import-space-KP3SNVEX.mjs +25 -0
  106. package/dist/lib/node-esm/import-space-KP3SNVEX.mjs.map +7 -0
  107. package/dist/lib/node-esm/index.mjs +31 -332
  108. package/dist/lib/node-esm/index.mjs.map +4 -4
  109. package/dist/lib/node-esm/join-37XXLOAK.mjs +29 -0
  110. package/dist/lib/node-esm/join-37XXLOAK.mjs.map +7 -0
  111. package/dist/lib/node-esm/meta.json +1 -1
  112. package/dist/lib/node-esm/meta.mjs +9 -0
  113. package/dist/lib/node-esm/meta.mjs.map +7 -0
  114. package/dist/lib/node-esm/migrate-7AKX7B3K.mjs +51 -0
  115. package/dist/lib/node-esm/migrate-7AKX7B3K.mjs.map +7 -0
  116. package/dist/lib/node-esm/open-H4CC6IVH.mjs +18 -0
  117. package/dist/lib/node-esm/open-H4CC6IVH.mjs.map +7 -0
  118. package/dist/lib/node-esm/open-create-object-YDIQOWO4.mjs +43 -0
  119. package/dist/lib/node-esm/open-create-object-YDIQOWO4.mjs.map +7 -0
  120. package/dist/lib/node-esm/open-create-space-ARDVMXES.mjs +25 -0
  121. package/dist/lib/node-esm/open-create-space-ARDVMXES.mjs.map +7 -0
  122. package/dist/lib/node-esm/open-import-space-ZW35ZLYL.mjs +25 -0
  123. package/dist/lib/node-esm/open-import-space-ZW35ZLYL.mjs.map +7 -0
  124. package/dist/lib/node-esm/open-members-XSH4P7XX.mjs +24 -0
  125. package/dist/lib/node-esm/open-members-XSH4P7XX.mjs.map +7 -0
  126. package/dist/lib/node-esm/open-settings-7MGZRFDA.mjs +24 -0
  127. package/dist/lib/node-esm/open-settings-7MGZRFDA.mjs.map +7 -0
  128. package/dist/lib/node-esm/operations/index.mjs +15 -0
  129. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  130. package/dist/lib/node-esm/plugin.mjs +145 -0
  131. package/dist/lib/node-esm/plugin.mjs.map +7 -0
  132. package/dist/lib/node-esm/remove-objects-56MWKS6L.mjs +52 -0
  133. package/dist/lib/node-esm/remove-objects-56MWKS6L.mjs.map +7 -0
  134. package/dist/lib/node-esm/rename-WMJOTTAW.mjs +26 -0
  135. package/dist/lib/node-esm/rename-WMJOTTAW.mjs.map +7 -0
  136. package/dist/lib/node-esm/rename-object-6P5OYIS3.mjs +27 -0
  137. package/dist/lib/node-esm/rename-object-6P5OYIS3.mjs.map +7 -0
  138. package/dist/lib/node-esm/restore-field-6JAEF7VP.mjs +42 -0
  139. package/dist/lib/node-esm/restore-field-6JAEF7VP.mjs.map +7 -0
  140. package/dist/lib/node-esm/restore-objects-BQG2V2AV.mjs +41 -0
  141. package/dist/lib/node-esm/restore-objects-BQG2V2AV.mjs.map +7 -0
  142. package/dist/lib/node-esm/share-TFYYNZVV.mjs +32 -0
  143. package/dist/lib/node-esm/share-TFYYNZVV.mjs.map +7 -0
  144. package/dist/lib/node-esm/snapshot-PUVJWCFL.mjs +31 -0
  145. package/dist/lib/node-esm/snapshot-PUVJWCFL.mjs.map +7 -0
  146. package/dist/lib/node-esm/types/index.mjs +8 -8
  147. package/dist/lib/node-esm/wait-for-object-7O564KVO.mjs +24 -0
  148. package/dist/lib/node-esm/wait-for-object-7O564KVO.mjs.map +7 -0
  149. package/dist/types/src/SpacePlugin.d.ts +2 -1
  150. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  151. package/dist/types/src/SpacePlugin.node.d.ts +5 -0
  152. package/dist/types/src/SpacePlugin.node.d.ts.map +1 -0
  153. package/dist/types/src/SpacePlugin.test.d.ts +2 -0
  154. package/dist/types/src/SpacePlugin.test.d.ts.map +1 -0
  155. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +2 -3
  156. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
  157. package/dist/types/src/capabilities/app-graph-builder/extensions/collections.d.ts +33 -0
  158. package/dist/types/src/capabilities/app-graph-builder/extensions/collections.d.ts.map +1 -0
  159. package/dist/types/src/capabilities/app-graph-builder/extensions/companions.d.ts +25 -0
  160. package/dist/types/src/capabilities/app-graph-builder/extensions/companions.d.ts.map +1 -0
  161. package/dist/types/src/capabilities/app-graph-builder/extensions/index.d.ts +6 -0
  162. package/dist/types/src/capabilities/app-graph-builder/extensions/index.d.ts.map +1 -0
  163. package/dist/types/src/capabilities/app-graph-builder/extensions/settings.d.ts +25 -0
  164. package/dist/types/src/capabilities/app-graph-builder/extensions/settings.d.ts.map +1 -0
  165. package/dist/types/src/capabilities/app-graph-builder/extensions/shared.d.ts +56 -0
  166. package/dist/types/src/capabilities/app-graph-builder/extensions/shared.d.ts.map +1 -0
  167. package/dist/types/src/capabilities/app-graph-builder/extensions/shared.test.d.ts +2 -0
  168. package/dist/types/src/capabilities/app-graph-builder/extensions/shared.test.d.ts.map +1 -0
  169. package/dist/types/src/capabilities/app-graph-builder/extensions/spaces.d.ts +42 -0
  170. package/dist/types/src/capabilities/app-graph-builder/extensions/spaces.d.ts.map +1 -0
  171. package/dist/types/src/capabilities/app-graph-builder/extensions/types.d.ts +68 -0
  172. package/dist/types/src/capabilities/app-graph-builder/extensions/types.d.ts.map +1 -0
  173. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +1 -1
  174. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -1
  175. package/dist/types/src/capabilities/app-graph-serializer.d.ts +5 -0
  176. package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -0
  177. package/dist/types/src/capabilities/create-object.d.ts +37 -0
  178. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  179. package/dist/types/src/capabilities/identity-created.d.ts +5 -0
  180. package/dist/types/src/capabilities/identity-created.d.ts.map +1 -0
  181. package/dist/types/src/capabilities/index.d.ts +65 -9
  182. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  183. package/dist/types/src/capabilities/migrations.d.ts +5 -0
  184. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  185. package/dist/types/src/capabilities/navigation-handler/index.d.ts +4 -0
  186. package/dist/types/src/capabilities/navigation-handler/index.d.ts.map +1 -0
  187. package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts +13 -0
  188. package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts.map +1 -0
  189. package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
  190. package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
  191. package/dist/types/src/capabilities/node.d.ts +40 -0
  192. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  193. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  194. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  195. package/dist/types/src/capabilities/react-root.d.ts +9 -0
  196. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  197. package/dist/types/src/capabilities/react-surface.d.ts +8 -0
  198. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  199. package/dist/types/src/capabilities/repair.d.ts +6 -0
  200. package/dist/types/src/capabilities/repair.d.ts.map +1 -0
  201. package/dist/types/src/capabilities/settings.d.ts +7 -0
  202. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  203. package/dist/types/src/capabilities/spaces-ready.d.ts +5 -0
  204. package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -0
  205. package/dist/types/src/capabilities/state.d.ts +17 -0
  206. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  207. package/dist/types/src/capabilities/undo-mappings.d.ts +10 -0
  208. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
  209. package/dist/types/src/commands/database/add.d.ts +10 -0
  210. package/dist/types/src/commands/database/add.d.ts.map +1 -0
  211. package/dist/types/src/commands/database/index.d.ts.map +1 -0
  212. package/dist/types/src/commands/database/query/index.d.ts.map +1 -0
  213. package/dist/types/src/commands/database/query/query.d.ts +13 -0
  214. package/dist/types/src/commands/database/query/query.d.ts.map +1 -0
  215. package/dist/types/src/commands/database/query/query.test.d.ts.map +1 -0
  216. package/dist/types/src/commands/database/remove.d.ts +9 -0
  217. package/dist/types/src/commands/database/remove.d.ts.map +1 -0
  218. package/dist/types/src/commands/database/stats.d.ts +6 -0
  219. package/dist/types/src/commands/database/stats.d.ts.map +1 -0
  220. package/dist/types/src/commands/database/util.d.ts.map +1 -0
  221. package/dist/types/src/commands/index.d.ts.map +1 -0
  222. package/dist/types/src/commands/queue/index.d.ts +7 -0
  223. package/dist/types/src/commands/queue/index.d.ts.map +1 -0
  224. package/dist/types/src/commands/queue/query.d.ts +8 -0
  225. package/dist/types/src/commands/queue/query.d.ts.map +1 -0
  226. package/dist/types/src/commands/queue/util.d.ts.map +1 -0
  227. package/dist/types/src/commands/space/close/close.d.ts +12 -0
  228. package/dist/types/src/commands/space/close/close.d.ts.map +1 -0
  229. package/dist/types/src/commands/space/close/index.d.ts.map +1 -0
  230. package/dist/types/src/commands/space/create/create.d.ts +12 -0
  231. package/dist/types/src/commands/space/create/create.d.ts.map +1 -0
  232. package/dist/types/src/commands/space/create/create.test.d.ts.map +1 -0
  233. package/dist/types/src/commands/space/create/index.d.ts.map +1 -0
  234. package/dist/types/src/commands/space/index.d.ts +34 -0
  235. package/dist/types/src/commands/space/index.d.ts.map +1 -0
  236. package/dist/types/src/commands/space/info/index.d.ts.map +1 -0
  237. package/dist/types/src/commands/space/info/info.d.ts +15 -0
  238. package/dist/types/src/commands/space/info/info.d.ts.map +1 -0
  239. package/dist/types/src/commands/space/info/info.test.d.ts.map +1 -0
  240. package/dist/types/src/commands/space/join/index.d.ts.map +1 -0
  241. package/dist/types/src/commands/space/join/join.d.ts +14 -0
  242. package/dist/types/src/commands/space/join/join.d.ts.map +1 -0
  243. package/dist/types/src/commands/space/join/util.d.ts.map +1 -0
  244. package/dist/types/src/commands/space/list/index.d.ts.map +1 -0
  245. package/dist/types/src/commands/space/list/list.d.ts +12 -0
  246. package/dist/types/src/commands/space/list/list.d.ts.map +1 -0
  247. package/dist/types/src/commands/space/list/list.test.d.ts.map +1 -0
  248. package/dist/types/src/commands/space/members/index.d.ts.map +1 -0
  249. package/dist/types/src/commands/space/members/members.d.ts +13 -0
  250. package/dist/types/src/commands/space/members/members.d.ts.map +1 -0
  251. package/dist/types/src/commands/space/members/members.test.d.ts.map +1 -0
  252. package/dist/types/src/commands/space/members/util.d.ts.map +1 -0
  253. package/dist/types/src/commands/space/open/index.d.ts.map +1 -0
  254. package/dist/types/src/commands/space/open/open.d.ts +12 -0
  255. package/dist/types/src/commands/space/open/open.d.ts.map +1 -0
  256. package/dist/types/src/commands/space/schema/index.d.ts +8 -0
  257. package/dist/types/src/commands/space/schema/index.d.ts.map +1 -0
  258. package/dist/types/src/commands/space/schema/list/index.d.ts.map +1 -0
  259. package/dist/types/src/commands/space/schema/list/list.d.ts +15 -0
  260. package/dist/types/src/commands/space/schema/list/list.d.ts.map +1 -0
  261. package/dist/types/src/commands/space/schema/list/list.test.d.ts.map +1 -0
  262. package/dist/types/src/commands/space/schema/list/util.d.ts.map +1 -0
  263. package/dist/types/src/commands/space/share/index.d.ts.map +1 -0
  264. package/dist/types/src/commands/space/share/share.d.ts +19 -0
  265. package/dist/types/src/commands/space/share/share.d.ts.map +1 -0
  266. package/dist/types/src/commands/space/sync/index.d.ts.map +1 -0
  267. package/dist/types/src/commands/space/sync/sync.d.ts.map +1 -0
  268. package/dist/types/src/commands/space/sync/sync.test.d.ts.map +1 -0
  269. package/dist/types/src/components/AwaitingObject/AwaitingObject.d.ts.map +1 -0
  270. package/dist/types/src/components/AwaitingObject/index.d.ts +2 -0
  271. package/dist/types/src/components/AwaitingObject/index.d.ts.map +1 -0
  272. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +12 -13
  273. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  274. package/dist/types/src/components/CreateDialog/index.d.ts +1 -2
  275. package/dist/types/src/components/CreateDialog/index.d.ts.map +1 -1
  276. package/dist/types/src/components/ForeignKeys/ForeignKeys.d.ts.map +1 -0
  277. package/dist/types/src/components/ForeignKeys/index.d.ts +2 -0
  278. package/dist/types/src/components/ForeignKeys/index.d.ts.map +1 -0
  279. package/dist/types/src/components/SpaceSettings/SpaceSettings.d.ts +10 -0
  280. package/dist/types/src/components/SpaceSettings/SpaceSettings.d.ts.map +1 -0
  281. package/dist/types/src/components/SpaceSettings/SpaceSettings.stories.d.ts +1909 -0
  282. package/dist/types/src/components/SpaceSettings/SpaceSettings.stories.d.ts.map +1 -0
  283. package/dist/types/src/components/SpaceSettings/index.d.ts +1 -1
  284. package/dist/types/src/components/SpaceSettings/index.d.ts.map +1 -1
  285. package/dist/types/src/components/SyncStatus/index.d.ts +2 -2
  286. package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -1
  287. package/dist/types/src/components/SyncStatus/save-tracker.d.ts +1 -1
  288. package/dist/types/src/components/SyncStatus/save-tracker.d.ts.map +1 -1
  289. package/dist/types/src/components/SyncStatus/status.d.ts +2 -2
  290. package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -1
  291. package/dist/types/src/components/index.d.ts +3 -23
  292. package/dist/types/src/components/index.d.ts.map +1 -1
  293. package/dist/types/src/constants.d.ts +1 -0
  294. package/dist/types/src/constants.d.ts.map +1 -1
  295. package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts +8 -0
  296. package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts.map +1 -0
  297. package/dist/types/src/containers/CollectionArticle/index.d.ts +2 -0
  298. package/dist/types/src/containers/CollectionArticle/index.d.ts.map +1 -0
  299. package/dist/types/src/containers/CollectionSection/CollectionSection.d.ts +6 -0
  300. package/dist/types/src/containers/CollectionSection/CollectionSection.d.ts.map +1 -0
  301. package/dist/types/src/containers/CollectionSection/index.d.ts +2 -0
  302. package/dist/types/src/containers/CollectionSection/index.d.ts.map +1 -0
  303. package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.d.ts +12 -0
  304. package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.d.ts.map +1 -0
  305. package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.stories.d.ts +1906 -0
  306. package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.stories.d.ts.map +1 -0
  307. package/dist/types/src/containers/CreateObjectDialog/index.d.ts +3 -0
  308. package/dist/types/src/containers/CreateObjectDialog/index.d.ts.map +1 -0
  309. package/dist/types/src/containers/CreateSpaceDialog/CreateSpaceDialog.d.ts.map +1 -0
  310. package/dist/types/src/containers/CreateSpaceDialog/CreateSpaceDialog.stories.d.ts +1910 -0
  311. package/dist/types/src/containers/CreateSpaceDialog/CreateSpaceDialog.stories.d.ts.map +1 -0
  312. package/dist/types/src/containers/CreateSpaceDialog/index.d.ts +2 -0
  313. package/dist/types/src/containers/CreateSpaceDialog/index.d.ts.map +1 -0
  314. package/dist/types/src/containers/ImportSpaceDialog/ImportSpaceDialog.d.ts +3 -0
  315. package/dist/types/src/containers/ImportSpaceDialog/ImportSpaceDialog.d.ts.map +1 -0
  316. package/dist/types/src/containers/ImportSpaceDialog/index.d.ts +2 -0
  317. package/dist/types/src/containers/ImportSpaceDialog/index.d.ts.map +1 -0
  318. package/dist/types/src/containers/InlineSyncStatus/InlineSyncStatus.d.ts.map +1 -0
  319. package/dist/types/src/containers/InlineSyncStatus/index.d.ts +2 -0
  320. package/dist/types/src/containers/InlineSyncStatus/index.d.ts.map +1 -0
  321. package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -0
  322. package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts +1909 -0
  323. package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts.map +1 -0
  324. package/dist/types/src/containers/JoinDialog/index.d.ts +3 -0
  325. package/dist/types/src/containers/JoinDialog/index.d.ts.map +1 -0
  326. package/dist/types/src/containers/MembersContainer/MembersContainer.d.ts +7 -0
  327. package/dist/types/src/containers/MembersContainer/MembersContainer.d.ts.map +1 -0
  328. package/dist/types/src/containers/MembersContainer/index.d.ts +2 -0
  329. package/dist/types/src/containers/MembersContainer/index.d.ts.map +1 -0
  330. package/dist/types/src/containers/MenuFooter/MenuFooter.d.ts.map +1 -0
  331. package/dist/types/src/containers/MenuFooter/index.d.ts +2 -0
  332. package/dist/types/src/containers/MenuFooter/index.d.ts.map +1 -0
  333. package/dist/types/src/containers/ObjectCardStack/ObjectCardStack.d.ts +11 -0
  334. package/dist/types/src/containers/ObjectCardStack/ObjectCardStack.d.ts.map +1 -0
  335. package/dist/types/src/containers/ObjectCardStack/index.d.ts +2 -0
  336. package/dist/types/src/containers/ObjectCardStack/index.d.ts.map +1 -0
  337. package/dist/types/src/containers/ObjectProperties/ObjectProperties.d.ts +10 -0
  338. package/dist/types/src/containers/ObjectProperties/ObjectProperties.d.ts.map +1 -0
  339. package/dist/types/src/containers/ObjectProperties/index.d.ts +2 -0
  340. package/dist/types/src/containers/ObjectProperties/index.d.ts.map +1 -0
  341. package/dist/types/src/containers/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -0
  342. package/dist/types/src/containers/ObjectRenamePopover/index.d.ts +2 -0
  343. package/dist/types/src/containers/ObjectRenamePopover/index.d.ts.map +1 -0
  344. package/dist/types/src/containers/RecordArticle/RecordArticle.d.ts +4 -0
  345. package/dist/types/src/containers/RecordArticle/RecordArticle.d.ts.map +1 -0
  346. package/dist/types/src/containers/RecordArticle/RecordArticle.stories.d.ts +14 -0
  347. package/dist/types/src/containers/RecordArticle/RecordArticle.stories.d.ts.map +1 -0
  348. package/dist/types/src/containers/RecordArticle/index.d.ts +2 -0
  349. package/dist/types/src/containers/RecordArticle/index.d.ts.map +1 -0
  350. package/dist/types/src/containers/RelatedArticle/RelatedArticle.d.ts +6 -0
  351. package/dist/types/src/containers/RelatedArticle/RelatedArticle.d.ts.map +1 -0
  352. package/dist/types/src/containers/RelatedArticle/index.d.ts +2 -0
  353. package/dist/types/src/containers/RelatedArticle/index.d.ts.map +1 -0
  354. package/dist/types/src/containers/SchemaContainer/SchemaContainer.d.ts +10 -0
  355. package/dist/types/src/containers/SchemaContainer/SchemaContainer.d.ts.map +1 -0
  356. package/dist/types/src/containers/SchemaContainer/index.d.ts +2 -0
  357. package/dist/types/src/containers/SchemaContainer/index.d.ts.map +1 -0
  358. package/dist/types/src/containers/SmallPresenceLive/index.d.ts +2 -0
  359. package/dist/types/src/containers/SmallPresenceLive/index.d.ts.map +1 -0
  360. package/dist/types/src/containers/SpacePresence/SpacePresence.d.ts +38 -0
  361. package/dist/types/src/containers/SpacePresence/SpacePresence.d.ts.map +1 -0
  362. package/dist/types/src/containers/SpacePresence/SpacePresence.stories.d.ts +1907 -0
  363. package/dist/types/src/containers/SpacePresence/SpacePresence.stories.d.ts.map +1 -0
  364. package/dist/types/src/containers/SpacePresence/index.d.ts +3 -0
  365. package/dist/types/src/containers/SpacePresence/index.d.ts.map +1 -0
  366. package/dist/types/src/containers/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -0
  367. package/dist/types/src/containers/SpaceRenamePopover/index.d.ts +2 -0
  368. package/dist/types/src/containers/SpaceRenamePopover/index.d.ts.map +1 -0
  369. package/dist/types/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.d.ts +7 -0
  370. package/dist/types/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.d.ts.map +1 -0
  371. package/dist/types/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.stories.d.ts +1914 -0
  372. package/dist/types/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.stories.d.ts.map +1 -0
  373. package/dist/types/src/containers/SpaceSettingsContainer/index.d.ts +2 -0
  374. package/dist/types/src/containers/SpaceSettingsContainer/index.d.ts.map +1 -0
  375. package/dist/types/src/containers/SyncStatus/SyncStatus.d.ts.map +1 -0
  376. package/dist/types/src/containers/SyncStatus/SyncStatus.stories.d.ts +1912 -0
  377. package/dist/types/src/containers/SyncStatus/SyncStatus.stories.d.ts.map +1 -0
  378. package/dist/types/src/containers/SyncStatus/index.d.ts +2 -0
  379. package/dist/types/src/containers/SyncStatus/index.d.ts.map +1 -0
  380. package/dist/types/src/containers/ViewEditor/ViewEditor.d.ts +7 -0
  381. package/dist/types/src/containers/ViewEditor/ViewEditor.d.ts.map +1 -0
  382. package/dist/types/src/containers/ViewEditor/index.d.ts +2 -0
  383. package/dist/types/src/containers/ViewEditor/index.d.ts.map +1 -0
  384. package/dist/types/src/containers/index.d.ts +24 -0
  385. package/dist/types/src/containers/index.d.ts.map +1 -0
  386. package/dist/types/src/hooks/index.d.ts +1 -2
  387. package/dist/types/src/hooks/index.d.ts.map +1 -1
  388. package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
  389. package/dist/types/src/hooks/usePath.d.ts.map +1 -1
  390. package/dist/types/src/hooks/useRelatedObjects.d.ts +10 -0
  391. package/dist/types/src/hooks/useRelatedObjects.d.ts.map +1 -0
  392. package/dist/types/src/index.d.ts +2 -4
  393. package/dist/types/src/index.d.ts.map +1 -1
  394. package/dist/types/src/meta.d.ts.map +1 -1
  395. package/dist/types/src/operations/add-object.d.ts +5 -0
  396. package/dist/types/src/operations/add-object.d.ts.map +1 -0
  397. package/dist/types/src/operations/add-relation.d.ts +5 -0
  398. package/dist/types/src/operations/add-relation.d.ts.map +1 -0
  399. package/dist/types/src/operations/add-schema.d.ts +5 -0
  400. package/dist/types/src/operations/add-schema.d.ts.map +1 -0
  401. package/dist/types/src/operations/close.d.ts +5 -0
  402. package/dist/types/src/operations/close.d.ts.map +1 -0
  403. package/dist/types/src/operations/create.d.ts +5 -0
  404. package/dist/types/src/operations/create.d.ts.map +1 -0
  405. package/dist/types/src/operations/definitions.d.ts +228 -0
  406. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  407. package/dist/types/src/operations/delete-field.d.ts +5 -0
  408. package/dist/types/src/operations/delete-field.d.ts.map +1 -0
  409. package/dist/types/src/operations/duplicate-object.d.ts +5 -0
  410. package/dist/types/src/operations/duplicate-object.d.ts.map +1 -0
  411. package/dist/types/src/operations/export-space.d.ts +5 -0
  412. package/dist/types/src/operations/export-space.d.ts.map +1 -0
  413. package/dist/types/src/operations/get-share-link.d.ts +5 -0
  414. package/dist/types/src/operations/get-share-link.d.ts.map +1 -0
  415. package/dist/types/src/operations/helpers.d.ts +7 -0
  416. package/dist/types/src/operations/helpers.d.ts.map +1 -0
  417. package/dist/types/src/operations/import-space.d.ts +5 -0
  418. package/dist/types/src/operations/import-space.d.ts.map +1 -0
  419. package/dist/types/src/operations/index.d.ts +4 -0
  420. package/dist/types/src/operations/index.d.ts.map +1 -0
  421. package/dist/types/src/operations/join.d.ts +5 -0
  422. package/dist/types/src/operations/join.d.ts.map +1 -0
  423. package/dist/types/src/operations/migrate.d.ts +5 -0
  424. package/dist/types/src/operations/migrate.d.ts.map +1 -0
  425. package/dist/types/src/operations/open-create-object.d.ts +5 -0
  426. package/dist/types/src/operations/open-create-object.d.ts.map +1 -0
  427. package/dist/types/src/operations/open-create-space.d.ts +5 -0
  428. package/dist/types/src/operations/open-create-space.d.ts.map +1 -0
  429. package/dist/types/src/operations/open-import-space.d.ts +5 -0
  430. package/dist/types/src/operations/open-import-space.d.ts.map +1 -0
  431. package/dist/types/src/operations/open-members.d.ts +5 -0
  432. package/dist/types/src/operations/open-members.d.ts.map +1 -0
  433. package/dist/types/src/operations/open-settings.d.ts +5 -0
  434. package/dist/types/src/operations/open-settings.d.ts.map +1 -0
  435. package/dist/types/src/operations/open.d.ts +5 -0
  436. package/dist/types/src/operations/open.d.ts.map +1 -0
  437. package/dist/types/src/operations/remove-objects.d.ts +5 -0
  438. package/dist/types/src/operations/remove-objects.d.ts.map +1 -0
  439. package/dist/types/src/operations/rename-object.d.ts +5 -0
  440. package/dist/types/src/operations/rename-object.d.ts.map +1 -0
  441. package/dist/types/src/operations/rename.d.ts +5 -0
  442. package/dist/types/src/operations/rename.d.ts.map +1 -0
  443. package/dist/types/src/operations/restore-field.d.ts +5 -0
  444. package/dist/types/src/operations/restore-field.d.ts.map +1 -0
  445. package/dist/types/src/operations/restore-objects.d.ts +5 -0
  446. package/dist/types/src/operations/restore-objects.d.ts.map +1 -0
  447. package/dist/types/src/operations/share.d.ts +5 -0
  448. package/dist/types/src/operations/share.d.ts.map +1 -0
  449. package/dist/types/src/operations/snapshot.d.ts +5 -0
  450. package/dist/types/src/operations/snapshot.d.ts.map +1 -0
  451. package/dist/types/src/operations/wait-for-object.d.ts +5 -0
  452. package/dist/types/src/operations/wait-for-object.d.ts.map +1 -0
  453. package/dist/types/src/plugin.d.ts +2 -0
  454. package/dist/types/src/plugin.d.ts.map +1 -0
  455. package/dist/types/src/translations.d.ts +1881 -1404
  456. package/dist/types/src/translations.d.ts.map +1 -1
  457. package/dist/types/src/types/Settings.d.ts +10 -0
  458. package/dist/types/src/types/Settings.d.ts.map +1 -0
  459. package/dist/types/src/types/capabilities.d.ts +36 -9
  460. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  461. package/dist/types/src/types/events.d.ts +1 -1
  462. package/dist/types/src/types/events.d.ts.map +1 -1
  463. package/dist/types/src/types/form.d.ts +1 -21
  464. package/dist/types/src/types/form.d.ts.map +1 -1
  465. package/dist/types/src/types/types.d.ts +24 -639
  466. package/dist/types/src/types/types.d.ts.map +1 -1
  467. package/dist/types/src/util.d.ts +4 -126
  468. package/dist/types/src/util.d.ts.map +1 -1
  469. package/dist/types/tsconfig.tsbuildinfo +1 -1
  470. package/package.json +104 -72
  471. package/src/SpacePlugin.node.ts +79 -0
  472. package/src/SpacePlugin.test.ts +33 -0
  473. package/src/SpacePlugin.ts +38 -88
  474. package/src/capabilities/app-graph-builder/app-graph-builder.ts +15 -604
  475. package/src/capabilities/app-graph-builder/extensions/collections.ts +343 -0
  476. package/src/capabilities/app-graph-builder/extensions/companions.ts +88 -0
  477. package/src/capabilities/app-graph-builder/extensions/index.ts +9 -0
  478. package/src/capabilities/app-graph-builder/extensions/settings.ts +88 -0
  479. package/src/capabilities/app-graph-builder/extensions/shared.test.ts +112 -0
  480. package/src/capabilities/app-graph-builder/extensions/shared.ts +189 -0
  481. package/src/capabilities/app-graph-builder/extensions/spaces.ts +366 -0
  482. package/src/capabilities/app-graph-builder/extensions/types.ts +423 -0
  483. package/src/capabilities/app-graph-builder/index.ts +1 -1
  484. package/src/capabilities/app-graph-serializer.ts +85 -0
  485. package/src/capabilities/create-object.ts +108 -0
  486. package/src/capabilities/identity-created.ts +34 -0
  487. package/src/capabilities/index.ts +22 -9
  488. package/src/capabilities/migrations.ts +59 -0
  489. package/src/capabilities/navigation-handler/index.ts +9 -0
  490. package/src/capabilities/navigation-handler/navigation-handler.ts +50 -0
  491. package/src/capabilities/navigation-resolver.ts +94 -0
  492. package/src/capabilities/node.ts +14 -0
  493. package/src/capabilities/operation-handler.ts +14 -0
  494. package/src/capabilities/react-root.tsx +25 -0
  495. package/src/capabilities/react-surface.tsx +393 -0
  496. package/src/capabilities/repair.ts +42 -0
  497. package/src/capabilities/settings.ts +33 -0
  498. package/src/capabilities/spaces-ready.ts +331 -0
  499. package/src/capabilities/state.ts +66 -0
  500. package/src/capabilities/undo-mappings.ts +58 -0
  501. package/src/commands/database/add.ts +106 -0
  502. package/src/commands/database/query/query.test.ts +53 -0
  503. package/src/commands/space/close/close.ts +40 -0
  504. package/src/commands/space/create/create.ts +61 -0
  505. package/src/commands/space/info/info.test.ts +32 -0
  506. package/src/commands/space/info/info.ts +50 -0
  507. package/src/commands/space/join/join.ts +122 -0
  508. package/src/commands/space/list/list.test.ts +37 -0
  509. package/src/commands/space/list/list.ts +42 -0
  510. package/src/commands/space/members/members.test.ts +33 -0
  511. package/src/commands/space/open/open.ts +39 -0
  512. package/src/commands/space/schema/list/list.test.ts +29 -0
  513. package/src/components/AwaitingObject/AwaitingObject.tsx +114 -0
  514. package/src/components/AwaitingObject/index.ts +5 -0
  515. package/src/components/CreateDialog/CreateObjectPanel.tsx +125 -140
  516. package/src/components/CreateDialog/index.ts +1 -2
  517. package/src/components/ForeignKeys/ForeignKeys.tsx +57 -0
  518. package/src/components/ForeignKeys/index.ts +5 -0
  519. package/src/components/SpaceSettings/SpaceSettings.stories.tsx +34 -0
  520. package/src/components/SpaceSettings/SpaceSettings.tsx +69 -0
  521. package/src/components/SpaceSettings/index.ts +2 -2
  522. package/src/components/SyncStatus/index.ts +2 -2
  523. package/src/components/SyncStatus/status.ts +7 -7
  524. package/src/components/index.ts +3 -16
  525. package/src/constants.ts +7 -6
  526. package/src/containers/CollectionArticle/CollectionArticle.tsx +120 -0
  527. package/src/containers/CollectionArticle/index.ts +5 -0
  528. package/src/containers/CollectionSection/CollectionSection.tsx +24 -0
  529. package/src/containers/CollectionSection/index.ts +5 -0
  530. package/src/containers/CreateObjectDialog/CreateObjectDialog.stories.tsx +81 -0
  531. package/src/containers/CreateObjectDialog/CreateObjectDialog.tsx +163 -0
  532. package/src/containers/CreateObjectDialog/index.ts +6 -0
  533. package/src/containers/CreateSpaceDialog/CreateSpaceDialog.stories.tsx +46 -0
  534. package/src/containers/CreateSpaceDialog/CreateSpaceDialog.tsx +75 -0
  535. package/src/containers/CreateSpaceDialog/index.ts +5 -0
  536. package/src/containers/ImportSpaceDialog/ImportSpaceDialog.tsx +62 -0
  537. package/src/containers/ImportSpaceDialog/index.ts +5 -0
  538. package/src/containers/InlineSyncStatus/InlineSyncStatus.tsx +51 -0
  539. package/src/containers/InlineSyncStatus/index.ts +5 -0
  540. package/src/containers/JoinDialog/JoinDialog.stories.tsx +43 -0
  541. package/src/containers/JoinDialog/JoinDialog.tsx +108 -0
  542. package/src/containers/JoinDialog/index.ts +6 -0
  543. package/src/containers/MembersContainer/MembersContainer.tsx +262 -0
  544. package/src/containers/MembersContainer/index.ts +5 -0
  545. package/src/containers/MenuFooter/MenuFooter.tsx +33 -0
  546. package/src/containers/MenuFooter/index.ts +5 -0
  547. package/src/containers/ObjectCardStack/ObjectCardStack.tsx +82 -0
  548. package/src/containers/ObjectCardStack/index.ts +5 -0
  549. package/src/containers/ObjectProperties/ObjectProperties.tsx +32 -0
  550. package/src/containers/ObjectProperties/index.ts +5 -0
  551. package/src/containers/ObjectRenamePopover/ObjectRenamePopover.tsx +52 -0
  552. package/src/containers/ObjectRenamePopover/index.ts +5 -0
  553. package/src/containers/RecordArticle/RecordArticle.stories.tsx +81 -0
  554. package/src/containers/RecordArticle/RecordArticle.tsx +56 -0
  555. package/src/containers/RecordArticle/index.ts +5 -0
  556. package/src/containers/RelatedArticle/RelatedArticle.tsx +82 -0
  557. package/src/containers/RelatedArticle/index.ts +5 -0
  558. package/src/containers/SchemaContainer/SchemaContainer.tsx +59 -0
  559. package/src/containers/SchemaContainer/index.ts +5 -0
  560. package/src/containers/SmallPresenceLive/index.ts +5 -0
  561. package/src/containers/SpacePresence/SpacePresence.stories.tsx +108 -0
  562. package/src/containers/SpacePresence/SpacePresence.tsx +261 -0
  563. package/src/containers/SpacePresence/index.ts +6 -0
  564. package/src/containers/SpaceRenamePopover/SpaceRenamePopover.tsx +54 -0
  565. package/src/containers/SpaceRenamePopover/index.ts +5 -0
  566. package/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.stories.tsx +48 -0
  567. package/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.tsx +244 -0
  568. package/src/containers/SpaceSettingsContainer/index.ts +5 -0
  569. package/src/containers/SyncStatus/SyncStatus.stories.tsx +40 -0
  570. package/src/containers/SyncStatus/SyncStatus.tsx +149 -0
  571. package/src/containers/SyncStatus/index.ts +5 -0
  572. package/src/containers/ViewEditor/ViewEditor.tsx +102 -0
  573. package/src/containers/ViewEditor/index.ts +5 -0
  574. package/src/containers/index.ts +29 -0
  575. package/src/hooks/index.ts +1 -2
  576. package/src/hooks/useInputSurfaceLookup.tsx +9 -2
  577. package/src/hooks/useRelatedObjects.ts +79 -0
  578. package/src/index.ts +6 -4
  579. package/src/meta.ts +2 -1
  580. package/src/operations/add-object.ts +81 -0
  581. package/src/operations/add-relation.ts +25 -0
  582. package/src/operations/add-schema.ts +51 -0
  583. package/src/operations/close.ts +16 -0
  584. package/src/operations/create.ts +59 -0
  585. package/src/operations/definitions.ts +476 -0
  586. package/src/operations/delete-field.ts +42 -0
  587. package/src/operations/duplicate-object.ts +17 -0
  588. package/src/operations/export-space.ts +30 -0
  589. package/src/operations/get-share-link.ts +43 -0
  590. package/src/operations/helpers.ts +10 -0
  591. package/src/operations/import-space.ts +21 -0
  592. package/src/operations/index.ts +34 -0
  593. package/src/operations/join.ts +26 -0
  594. package/src/operations/migrate.ts +45 -0
  595. package/src/operations/open-create-object.ts +40 -0
  596. package/src/operations/open-create-space.ts +21 -0
  597. package/src/operations/open-import-space.ts +21 -0
  598. package/src/operations/open-members.ts +20 -0
  599. package/src/operations/open-settings.ts +20 -0
  600. package/src/operations/open.ts +16 -0
  601. package/src/operations/remove-objects.ts +63 -0
  602. package/src/operations/rename-object.ts +24 -0
  603. package/src/operations/rename.ts +22 -0
  604. package/src/operations/restore-field.ts +36 -0
  605. package/src/operations/restore-objects.ts +40 -0
  606. package/src/operations/share.ts +27 -0
  607. package/src/operations/snapshot.ts +24 -0
  608. package/src/operations/wait-for-object.ts +21 -0
  609. package/src/plugin.ts +7 -0
  610. package/src/translations.ts +279 -206
  611. package/src/types/Settings.ts +18 -0
  612. package/src/types/capabilities.ts +35 -12
  613. package/src/types/events.ts +7 -7
  614. package/src/types/form.ts +6 -65
  615. package/src/types/types.ts +32 -553
  616. package/src/util.ts +36 -0
  617. package/dist/lib/browser/CollectionArticle-XXLUNK3F.mjs +0 -127
  618. package/dist/lib/browser/CollectionArticle-XXLUNK3F.mjs.map +0 -7
  619. package/dist/lib/browser/ObjectCardStack-CXNBCSMR.mjs +0 -148
  620. package/dist/lib/browser/ObjectCardStack-CXNBCSMR.mjs.map +0 -7
  621. package/dist/lib/browser/ObjectDetails-HXV4IQEM.mjs +0 -143
  622. package/dist/lib/browser/ObjectDetails-HXV4IQEM.mjs.map +0 -7
  623. package/dist/lib/browser/RecordArticle-36LDKFWF.mjs +0 -108
  624. package/dist/lib/browser/RecordArticle-36LDKFWF.mjs.map +0 -7
  625. package/dist/lib/browser/app-graph-builder-GLV46QSI.mjs +0 -530
  626. package/dist/lib/browser/app-graph-builder-GLV46QSI.mjs.map +0 -7
  627. package/dist/lib/browser/app-graph-serializer-VOLRDNVE.mjs +0 -85
  628. package/dist/lib/browser/app-graph-serializer-VOLRDNVE.mjs.map +0 -7
  629. package/dist/lib/browser/chunk-7D63MVRS.mjs +0 -234
  630. package/dist/lib/browser/chunk-7D63MVRS.mjs.map +0 -7
  631. package/dist/lib/browser/chunk-A7ZCVQGZ.mjs +0 -118
  632. package/dist/lib/browser/chunk-A7ZCVQGZ.mjs.map +0 -7
  633. package/dist/lib/browser/chunk-ASV6DYFH.mjs +0 -19
  634. package/dist/lib/browser/chunk-ASV6DYFH.mjs.map +0 -7
  635. package/dist/lib/browser/chunk-CMLRMQNM.mjs +0 -1889
  636. package/dist/lib/browser/chunk-CMLRMQNM.mjs.map +0 -7
  637. package/dist/lib/browser/chunk-HSMQFM57.mjs +0 -16
  638. package/dist/lib/browser/chunk-HSMQFM57.mjs.map +0 -7
  639. package/dist/lib/browser/chunk-KGLWYGIF.mjs +0 -715
  640. package/dist/lib/browser/chunk-KGLWYGIF.mjs.map +0 -7
  641. package/dist/lib/browser/chunk-NF3ZFAB4.mjs +0 -13
  642. package/dist/lib/browser/chunk-NF3ZFAB4.mjs.map +0 -7
  643. package/dist/lib/browser/chunk-WAOJLA2S.mjs +0 -772
  644. package/dist/lib/browser/chunk-WAOJLA2S.mjs.map +0 -7
  645. package/dist/lib/browser/cli/index.mjs +0 -851
  646. package/dist/lib/browser/cli/index.mjs.map +0 -7
  647. package/dist/lib/browser/identity-created-VCFYLSBB.mjs +0 -23
  648. package/dist/lib/browser/identity-created-VCFYLSBB.mjs.map +0 -7
  649. package/dist/lib/browser/operation-resolver-PJJ3PCM7.mjs +0 -830
  650. package/dist/lib/browser/operation-resolver-PJJ3PCM7.mjs.map +0 -7
  651. package/dist/lib/browser/react-root-ITWAPZIY.mjs +0 -30
  652. package/dist/lib/browser/react-root-ITWAPZIY.mjs.map +0 -7
  653. package/dist/lib/browser/react-surface-6GD6K4I4.mjs +0 -383
  654. package/dist/lib/browser/react-surface-6GD6K4I4.mjs.map +0 -7
  655. package/dist/lib/browser/repair-DKU4TUD2.mjs +0 -50
  656. package/dist/lib/browser/repair-DKU4TUD2.mjs.map +0 -7
  657. package/dist/lib/browser/settings-M2DMD2ZA.mjs +0 -34
  658. package/dist/lib/browser/settings-M2DMD2ZA.mjs.map +0 -7
  659. package/dist/lib/browser/spaces-ready-XWJUJ43N.mjs +0 -243
  660. package/dist/lib/browser/spaces-ready-XWJUJ43N.mjs.map +0 -7
  661. package/dist/lib/browser/state-V637BLIM.mjs +0 -58
  662. package/dist/lib/browser/state-V637BLIM.mjs.map +0 -7
  663. package/dist/lib/node-esm/CollectionArticle-KFFKKP37.mjs +0 -128
  664. package/dist/lib/node-esm/CollectionArticle-KFFKKP37.mjs.map +0 -7
  665. package/dist/lib/node-esm/ObjectCardStack-EHXPNRQW.mjs +0 -149
  666. package/dist/lib/node-esm/ObjectCardStack-EHXPNRQW.mjs.map +0 -7
  667. package/dist/lib/node-esm/ObjectDetails-N73UI4ZL.mjs +0 -144
  668. package/dist/lib/node-esm/ObjectDetails-N73UI4ZL.mjs.map +0 -7
  669. package/dist/lib/node-esm/RecordArticle-CMEXNNOZ.mjs +0 -109
  670. package/dist/lib/node-esm/RecordArticle-CMEXNNOZ.mjs.map +0 -7
  671. package/dist/lib/node-esm/app-graph-builder-KCEHEKVS.mjs +0 -531
  672. package/dist/lib/node-esm/app-graph-builder-KCEHEKVS.mjs.map +0 -7
  673. package/dist/lib/node-esm/app-graph-serializer-7C4MV5NB.mjs +0 -86
  674. package/dist/lib/node-esm/app-graph-serializer-7C4MV5NB.mjs.map +0 -7
  675. package/dist/lib/node-esm/chunk-2NM62ORP.mjs +0 -1890
  676. package/dist/lib/node-esm/chunk-2NM62ORP.mjs.map +0 -7
  677. package/dist/lib/node-esm/chunk-5N3YIAXD.mjs +0 -235
  678. package/dist/lib/node-esm/chunk-5N3YIAXD.mjs.map +0 -7
  679. package/dist/lib/node-esm/chunk-A5A7M37T.mjs +0 -119
  680. package/dist/lib/node-esm/chunk-A5A7M37T.mjs.map +0 -7
  681. package/dist/lib/node-esm/chunk-CVXULIYC.mjs +0 -20
  682. package/dist/lib/node-esm/chunk-CVXULIYC.mjs.map +0 -7
  683. package/dist/lib/node-esm/chunk-FB5YNROS.mjs +0 -773
  684. package/dist/lib/node-esm/chunk-FB5YNROS.mjs.map +0 -7
  685. package/dist/lib/node-esm/chunk-NYSDQPNM.mjs +0 -716
  686. package/dist/lib/node-esm/chunk-NYSDQPNM.mjs.map +0 -7
  687. package/dist/lib/node-esm/chunk-PG7DNOEX.mjs +0 -15
  688. package/dist/lib/node-esm/chunk-PG7DNOEX.mjs.map +0 -7
  689. package/dist/lib/node-esm/chunk-SL4BJSUG.mjs +0 -18
  690. package/dist/lib/node-esm/chunk-SL4BJSUG.mjs.map +0 -7
  691. package/dist/lib/node-esm/cli/index.mjs +0 -852
  692. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  693. package/dist/lib/node-esm/identity-created-2SJABVJD.mjs +0 -25
  694. package/dist/lib/node-esm/identity-created-2SJABVJD.mjs.map +0 -7
  695. package/dist/lib/node-esm/operation-resolver-2K7N4KYC.mjs +0 -831
  696. package/dist/lib/node-esm/operation-resolver-2K7N4KYC.mjs.map +0 -7
  697. package/dist/lib/node-esm/react-root-GIQAKDQ2.mjs +0 -31
  698. package/dist/lib/node-esm/react-root-GIQAKDQ2.mjs.map +0 -7
  699. package/dist/lib/node-esm/react-surface-KWP2DNFG.mjs +0 -384
  700. package/dist/lib/node-esm/react-surface-KWP2DNFG.mjs.map +0 -7
  701. package/dist/lib/node-esm/repair-C2H6JQCL.mjs +0 -51
  702. package/dist/lib/node-esm/repair-C2H6JQCL.mjs.map +0 -7
  703. package/dist/lib/node-esm/settings-VCPCNBOY.mjs +0 -35
  704. package/dist/lib/node-esm/settings-VCPCNBOY.mjs.map +0 -7
  705. package/dist/lib/node-esm/spaces-ready-5JOGEWON.mjs +0 -244
  706. package/dist/lib/node-esm/spaces-ready-5JOGEWON.mjs.map +0 -7
  707. package/dist/lib/node-esm/state-5MCEPWN3.mjs +0 -59
  708. package/dist/lib/node-esm/state-5MCEPWN3.mjs.map +0 -7
  709. package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +0 -5
  710. package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +0 -1
  711. package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +0 -3
  712. package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +0 -1
  713. package/dist/types/src/capabilities/identity-created/identity-created.d.ts +0 -5
  714. package/dist/types/src/capabilities/identity-created/identity-created.d.ts.map +0 -1
  715. package/dist/types/src/capabilities/identity-created/index.d.ts +0 -3
  716. package/dist/types/src/capabilities/identity-created/index.d.ts.map +0 -1
  717. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -6
  718. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  719. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -9
  720. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  721. package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
  722. package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
  723. package/dist/types/src/capabilities/react-root/react-root.d.ts +0 -9
  724. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
  725. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -5
  726. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  727. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -8
  728. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  729. package/dist/types/src/capabilities/repair/index.d.ts +0 -3
  730. package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
  731. package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
  732. package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
  733. package/dist/types/src/capabilities/settings/index.d.ts +0 -7
  734. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  735. package/dist/types/src/capabilities/settings/settings.d.ts +0 -10
  736. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  737. package/dist/types/src/capabilities/spaces-ready/index.d.ts +0 -3
  738. package/dist/types/src/capabilities/spaces-ready/index.d.ts.map +0 -1
  739. package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts +0 -5
  740. package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts.map +0 -1
  741. package/dist/types/src/capabilities/state/index.d.ts +0 -13
  742. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  743. package/dist/types/src/capabilities/state/state.d.ts +0 -17
  744. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  745. package/dist/types/src/cli/commands/database/add.d.ts +0 -17
  746. package/dist/types/src/cli/commands/database/add.d.ts.map +0 -1
  747. package/dist/types/src/cli/commands/database/index.d.ts.map +0 -1
  748. package/dist/types/src/cli/commands/database/query/index.d.ts.map +0 -1
  749. package/dist/types/src/cli/commands/database/query/query.d.ts +0 -13
  750. package/dist/types/src/cli/commands/database/query/query.d.ts.map +0 -1
  751. package/dist/types/src/cli/commands/database/query/query.test.d.ts.map +0 -1
  752. package/dist/types/src/cli/commands/database/remove.d.ts +0 -9
  753. package/dist/types/src/cli/commands/database/remove.d.ts.map +0 -1
  754. package/dist/types/src/cli/commands/database/stats.d.ts +0 -6
  755. package/dist/types/src/cli/commands/database/stats.d.ts.map +0 -1
  756. package/dist/types/src/cli/commands/database/util.d.ts.map +0 -1
  757. package/dist/types/src/cli/commands/index.d.ts.map +0 -1
  758. package/dist/types/src/cli/commands/queue/index.d.ts +0 -7
  759. package/dist/types/src/cli/commands/queue/index.d.ts.map +0 -1
  760. package/dist/types/src/cli/commands/queue/query.d.ts +0 -8
  761. package/dist/types/src/cli/commands/queue/query.d.ts.map +0 -1
  762. package/dist/types/src/cli/commands/queue/util.d.ts.map +0 -1
  763. package/dist/types/src/cli/commands/space/close/close.d.ts +0 -12
  764. package/dist/types/src/cli/commands/space/close/close.d.ts.map +0 -1
  765. package/dist/types/src/cli/commands/space/close/index.d.ts.map +0 -1
  766. package/dist/types/src/cli/commands/space/create/create.d.ts +0 -12
  767. package/dist/types/src/cli/commands/space/create/create.d.ts.map +0 -1
  768. package/dist/types/src/cli/commands/space/create/create.test.d.ts.map +0 -1
  769. package/dist/types/src/cli/commands/space/create/index.d.ts.map +0 -1
  770. package/dist/types/src/cli/commands/space/index.d.ts +0 -31
  771. package/dist/types/src/cli/commands/space/index.d.ts.map +0 -1
  772. package/dist/types/src/cli/commands/space/info/index.d.ts.map +0 -1
  773. package/dist/types/src/cli/commands/space/info/info.d.ts +0 -13
  774. package/dist/types/src/cli/commands/space/info/info.d.ts.map +0 -1
  775. package/dist/types/src/cli/commands/space/info/info.test.d.ts.map +0 -1
  776. package/dist/types/src/cli/commands/space/join/index.d.ts.map +0 -1
  777. package/dist/types/src/cli/commands/space/join/join.d.ts +0 -14
  778. package/dist/types/src/cli/commands/space/join/join.d.ts.map +0 -1
  779. package/dist/types/src/cli/commands/space/join/util.d.ts.map +0 -1
  780. package/dist/types/src/cli/commands/space/list/index.d.ts.map +0 -1
  781. package/dist/types/src/cli/commands/space/list/list.d.ts +0 -7
  782. package/dist/types/src/cli/commands/space/list/list.d.ts.map +0 -1
  783. package/dist/types/src/cli/commands/space/list/list.test.d.ts.map +0 -1
  784. package/dist/types/src/cli/commands/space/members/index.d.ts.map +0 -1
  785. package/dist/types/src/cli/commands/space/members/members.d.ts +0 -13
  786. package/dist/types/src/cli/commands/space/members/members.d.ts.map +0 -1
  787. package/dist/types/src/cli/commands/space/members/members.test.d.ts.map +0 -1
  788. package/dist/types/src/cli/commands/space/members/util.d.ts.map +0 -1
  789. package/dist/types/src/cli/commands/space/open/index.d.ts.map +0 -1
  790. package/dist/types/src/cli/commands/space/open/open.d.ts +0 -12
  791. package/dist/types/src/cli/commands/space/open/open.d.ts.map +0 -1
  792. package/dist/types/src/cli/commands/space/schema/index.d.ts +0 -8
  793. package/dist/types/src/cli/commands/space/schema/index.d.ts.map +0 -1
  794. package/dist/types/src/cli/commands/space/schema/list/index.d.ts.map +0 -1
  795. package/dist/types/src/cli/commands/space/schema/list/list.d.ts +0 -15
  796. package/dist/types/src/cli/commands/space/schema/list/list.d.ts.map +0 -1
  797. package/dist/types/src/cli/commands/space/schema/list/list.test.d.ts.map +0 -1
  798. package/dist/types/src/cli/commands/space/schema/list/util.d.ts.map +0 -1
  799. package/dist/types/src/cli/commands/space/share/index.d.ts.map +0 -1
  800. package/dist/types/src/cli/commands/space/share/share.d.ts +0 -19
  801. package/dist/types/src/cli/commands/space/share/share.d.ts.map +0 -1
  802. package/dist/types/src/cli/commands/space/sync/index.d.ts.map +0 -1
  803. package/dist/types/src/cli/commands/space/sync/sync.d.ts.map +0 -1
  804. package/dist/types/src/cli/commands/space/sync/sync.test.d.ts.map +0 -1
  805. package/dist/types/src/cli/index.d.ts +0 -2
  806. package/dist/types/src/cli/index.d.ts.map +0 -1
  807. package/dist/types/src/cli/plugin.d.ts +0 -4
  808. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  809. package/dist/types/src/components/AwaitingObject.d.ts.map +0 -1
  810. package/dist/types/src/components/CollectionArticle.d.ts +0 -9
  811. package/dist/types/src/components/CollectionArticle.d.ts.map +0 -1
  812. package/dist/types/src/components/CollectionSection.d.ts +0 -5
  813. package/dist/types/src/components/CollectionSection.d.ts.map +0 -1
  814. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +0 -10
  815. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +0 -1
  816. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +0 -1604
  817. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +0 -1
  818. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +0 -1
  819. package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +0 -1
  820. package/dist/types/src/components/JoinDialog/index.d.ts +0 -2
  821. package/dist/types/src/components/JoinDialog/index.d.ts.map +0 -1
  822. package/dist/types/src/components/MembersContainer/MembersContainer.d.ts +0 -8
  823. package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +0 -1
  824. package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +0 -1600
  825. package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +0 -1
  826. package/dist/types/src/components/MembersContainer/index.d.ts +0 -2
  827. package/dist/types/src/components/MembersContainer/index.d.ts.map +0 -1
  828. package/dist/types/src/components/MenuFooter.d.ts.map +0 -1
  829. package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts +0 -8
  830. package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts.map +0 -1
  831. package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts +0 -9
  832. package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts.map +0 -1
  833. package/dist/types/src/components/ObjectCardStack/index.d.ts +0 -3
  834. package/dist/types/src/components/ObjectCardStack/index.d.ts.map +0 -1
  835. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts +0 -8
  836. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts.map +0 -1
  837. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts +0 -1433
  838. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts.map +0 -1
  839. package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts.map +0 -1
  840. package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts +0 -9
  841. package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts.map +0 -1
  842. package/dist/types/src/components/ObjectDetails/index.d.ts +0 -3
  843. package/dist/types/src/components/ObjectDetails/index.d.ts.map +0 -1
  844. package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +0 -1
  845. package/dist/types/src/components/ObjectRenamePopover/index.d.ts +0 -2
  846. package/dist/types/src/components/ObjectRenamePopover/index.d.ts.map +0 -1
  847. package/dist/types/src/components/RecordArticle.d.ts +0 -5
  848. package/dist/types/src/components/RecordArticle.d.ts.map +0 -1
  849. package/dist/types/src/components/RecordArticle.stories.d.ts +0 -1600
  850. package/dist/types/src/components/RecordArticle.stories.d.ts.map +0 -1
  851. package/dist/types/src/components/SchemaContainer.d.ts +0 -13
  852. package/dist/types/src/components/SchemaContainer.d.ts.map +0 -1
  853. package/dist/types/src/components/SpacePluginSettings.d.ts +0 -8
  854. package/dist/types/src/components/SpacePluginSettings.d.ts.map +0 -1
  855. package/dist/types/src/components/SpacePresence/SpacePresence.d.ts +0 -38
  856. package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +0 -1
  857. package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +0 -1430
  858. package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +0 -1
  859. package/dist/types/src/components/SpacePresence/index.d.ts +0 -2
  860. package/dist/types/src/components/SpacePresence/index.d.ts.map +0 -1
  861. package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +0 -1
  862. package/dist/types/src/components/SpaceRenamePopover/index.d.ts +0 -2
  863. package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +0 -1
  864. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +0 -10
  865. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +0 -1
  866. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +0 -1436
  867. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +0 -1
  868. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +0 -1
  869. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +0 -1
  870. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +0 -1435
  871. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +0 -1
  872. package/dist/types/src/components/ViewEditor.d.ts +0 -7
  873. package/dist/types/src/components/ViewEditor.d.ts.map +0 -1
  874. package/dist/types/src/helpers/index.d.ts +0 -2
  875. package/dist/types/src/helpers/index.d.ts.map +0 -1
  876. package/dist/types/src/helpers/query.d.ts +0 -7
  877. package/dist/types/src/helpers/query.d.ts.map +0 -1
  878. package/dist/types/src/helpers/query.test.d.ts +0 -2
  879. package/dist/types/src/helpers/query.test.d.ts.map +0 -1
  880. package/dist/types/src/hooks/useActiveSpace.d.ts +0 -4
  881. package/dist/types/src/hooks/useActiveSpace.d.ts.map +0 -1
  882. package/dist/types/src/hooks/useTypeOptions.d.ts +0 -10
  883. package/dist/types/src/hooks/useTypeOptions.d.ts.map +0 -1
  884. package/src/capabilities/app-graph-serializer/app-graph-serializer.ts +0 -83
  885. package/src/capabilities/app-graph-serializer/index.ts +0 -7
  886. package/src/capabilities/identity-created/identity-created.ts +0 -29
  887. package/src/capabilities/identity-created/index.ts +0 -7
  888. package/src/capabilities/operation-resolver/index.ts +0 -7
  889. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -762
  890. package/src/capabilities/react-root/index.ts +0 -7
  891. package/src/capabilities/react-root/react-root.tsx +0 -25
  892. package/src/capabilities/react-surface/index.ts +0 -7
  893. package/src/capabilities/react-surface/react-surface.tsx +0 -377
  894. package/src/capabilities/repair/index.ts +0 -7
  895. package/src/capabilities/repair/repair.ts +0 -67
  896. package/src/capabilities/settings/index.ts +0 -7
  897. package/src/capabilities/settings/settings.ts +0 -33
  898. package/src/capabilities/spaces-ready/index.ts +0 -7
  899. package/src/capabilities/spaces-ready/spaces-ready.ts +0 -290
  900. package/src/capabilities/state/index.ts +0 -7
  901. package/src/capabilities/state/state.ts +0 -64
  902. package/src/cli/commands/database/add.ts +0 -115
  903. package/src/cli/commands/database/query/query.test.ts +0 -55
  904. package/src/cli/commands/space/close/close.ts +0 -40
  905. package/src/cli/commands/space/create/create.ts +0 -61
  906. package/src/cli/commands/space/info/info.test.ts +0 -47
  907. package/src/cli/commands/space/info/info.ts +0 -37
  908. package/src/cli/commands/space/join/join.ts +0 -122
  909. package/src/cli/commands/space/list/list.test.ts +0 -36
  910. package/src/cli/commands/space/list/list.ts +0 -30
  911. package/src/cli/commands/space/members/members.test.ts +0 -46
  912. package/src/cli/commands/space/open/open.ts +0 -39
  913. package/src/cli/commands/space/schema/list/list.test.ts +0 -42
  914. package/src/cli/index.ts +0 -5
  915. package/src/cli/plugin.ts +0 -88
  916. package/src/components/AwaitingObject.tsx +0 -114
  917. package/src/components/CollectionArticle.tsx +0 -156
  918. package/src/components/CollectionSection.tsx +0 -22
  919. package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +0 -91
  920. package/src/components/CreateDialog/CreateObjectDialog.tsx +0 -147
  921. package/src/components/CreateDialog/CreateSpaceDialog.tsx +0 -72
  922. package/src/components/JoinDialog/JoinDialog.tsx +0 -105
  923. package/src/components/JoinDialog/index.ts +0 -5
  924. package/src/components/MembersContainer/MembersContainer.stories.tsx +0 -56
  925. package/src/components/MembersContainer/MembersContainer.tsx +0 -282
  926. package/src/components/MembersContainer/index.ts +0 -5
  927. package/src/components/MenuFooter.tsx +0 -33
  928. package/src/components/ObjectCardStack/ObjectCardStack.tsx +0 -67
  929. package/src/components/ObjectCardStack/ObjectForm.tsx +0 -97
  930. package/src/components/ObjectCardStack/index.ts +0 -7
  931. package/src/components/ObjectDetails/BaseObjectSettings.stories.tsx +0 -63
  932. package/src/components/ObjectDetails/BaseObjectSettings.tsx +0 -122
  933. package/src/components/ObjectDetails/ForeignKeys.tsx +0 -51
  934. package/src/components/ObjectDetails/ObjectDetails.tsx +0 -33
  935. package/src/components/ObjectDetails/index.ts +0 -7
  936. package/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx +0 -52
  937. package/src/components/ObjectRenamePopover/index.ts +0 -5
  938. package/src/components/RecordArticle.stories.tsx +0 -116
  939. package/src/components/RecordArticle.tsx +0 -124
  940. package/src/components/SchemaContainer.tsx +0 -59
  941. package/src/components/SpacePluginSettings.tsx +0 -65
  942. package/src/components/SpacePresence/SpacePresence.stories.tsx +0 -108
  943. package/src/components/SpacePresence/SpacePresence.tsx +0 -273
  944. package/src/components/SpacePresence/index.ts +0 -5
  945. package/src/components/SpaceRenamePopover/SpaceRenamePopover.tsx +0 -54
  946. package/src/components/SpaceRenamePopover/index.ts +0 -5
  947. package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +0 -46
  948. package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +0 -202
  949. package/src/components/SyncStatus/InlineSyncStatus.tsx +0 -62
  950. package/src/components/SyncStatus/SyncStatus.stories.tsx +0 -40
  951. package/src/components/SyncStatus/SyncStatus.tsx +0 -155
  952. package/src/components/ViewEditor.tsx +0 -101
  953. package/src/helpers/index.ts +0 -5
  954. package/src/helpers/query.test.ts +0 -24
  955. package/src/helpers/query.ts +0 -153
  956. package/src/hooks/useActiveSpace.ts +0 -24
  957. package/src/hooks/useTypeOptions.ts +0 -25
  958. package/src/util.tsx +0 -782
  959. /package/dist/types/src/{cli/commands → commands}/database/index.d.ts +0 -0
  960. /package/dist/types/src/{cli/commands → commands}/database/query/index.d.ts +0 -0
  961. /package/dist/types/src/{cli/commands → commands}/database/query/query.test.d.ts +0 -0
  962. /package/dist/types/src/{cli/commands → commands}/database/util.d.ts +0 -0
  963. /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
  964. /package/dist/types/src/{cli/commands → commands}/queue/util.d.ts +0 -0
  965. /package/dist/types/src/{cli/commands → commands}/space/close/index.d.ts +0 -0
  966. /package/dist/types/src/{cli/commands → commands}/space/create/create.test.d.ts +0 -0
  967. /package/dist/types/src/{cli/commands → commands}/space/create/index.d.ts +0 -0
  968. /package/dist/types/src/{cli/commands → commands}/space/info/index.d.ts +0 -0
  969. /package/dist/types/src/{cli/commands → commands}/space/info/info.test.d.ts +0 -0
  970. /package/dist/types/src/{cli/commands → commands}/space/join/index.d.ts +0 -0
  971. /package/dist/types/src/{cli/commands → commands}/space/join/util.d.ts +0 -0
  972. /package/dist/types/src/{cli/commands → commands}/space/list/index.d.ts +0 -0
  973. /package/dist/types/src/{cli/commands → commands}/space/list/list.test.d.ts +0 -0
  974. /package/dist/types/src/{cli/commands → commands}/space/members/index.d.ts +0 -0
  975. /package/dist/types/src/{cli/commands → commands}/space/members/members.test.d.ts +0 -0
  976. /package/dist/types/src/{cli/commands → commands}/space/members/util.d.ts +0 -0
  977. /package/dist/types/src/{cli/commands → commands}/space/open/index.d.ts +0 -0
  978. /package/dist/types/src/{cli/commands → commands}/space/schema/list/index.d.ts +0 -0
  979. /package/dist/types/src/{cli/commands → commands}/space/schema/list/list.test.d.ts +0 -0
  980. /package/dist/types/src/{cli/commands → commands}/space/schema/list/util.d.ts +0 -0
  981. /package/dist/types/src/{cli/commands → commands}/space/share/index.d.ts +0 -0
  982. /package/dist/types/src/{cli/commands → commands}/space/sync/index.d.ts +0 -0
  983. /package/dist/types/src/{cli/commands → commands}/space/sync/sync.d.ts +0 -0
  984. /package/dist/types/src/{cli/commands → commands}/space/sync/sync.test.d.ts +0 -0
  985. /package/dist/types/src/components/{AwaitingObject.d.ts → AwaitingObject/AwaitingObject.d.ts} +0 -0
  986. /package/dist/types/src/components/{ObjectDetails → ForeignKeys}/ForeignKeys.d.ts +0 -0
  987. /package/dist/types/src/{components/CreateDialog → containers/CreateSpaceDialog}/CreateSpaceDialog.d.ts +0 -0
  988. /package/dist/types/src/{components/SyncStatus → containers/InlineSyncStatus}/InlineSyncStatus.d.ts +0 -0
  989. /package/dist/types/src/{components → containers}/JoinDialog/JoinDialog.d.ts +0 -0
  990. /package/dist/types/src/{components → containers/MenuFooter}/MenuFooter.d.ts +0 -0
  991. /package/dist/types/src/{components → containers}/ObjectRenamePopover/ObjectRenamePopover.d.ts +0 -0
  992. /package/dist/types/src/{components → containers}/SpaceRenamePopover/SpaceRenamePopover.d.ts +0 -0
  993. /package/dist/types/src/{components → containers}/SyncStatus/SyncStatus.d.ts +0 -0
  994. /package/src/{cli/commands → commands}/database/index.ts +0 -0
  995. /package/src/{cli/commands → commands}/database/query/index.ts +0 -0
  996. /package/src/{cli/commands → commands}/database/query/query.ts +0 -0
  997. /package/src/{cli/commands → commands}/database/remove.ts +0 -0
  998. /package/src/{cli/commands → commands}/database/stats.ts +0 -0
  999. /package/src/{cli/commands → commands}/database/util.ts +0 -0
  1000. /package/src/{cli/commands → commands}/index.ts +0 -0
  1001. /package/src/{cli/commands → commands}/queue/index.ts +0 -0
  1002. /package/src/{cli/commands → commands}/queue/query.ts +0 -0
  1003. /package/src/{cli/commands → commands}/queue/util.ts +0 -0
  1004. /package/src/{cli/commands → commands}/space/close/index.ts +0 -0
  1005. /package/src/{cli/commands → commands}/space/create/create.test.ts +0 -0
  1006. /package/src/{cli/commands → commands}/space/create/index.ts +0 -0
  1007. /package/src/{cli/commands → commands}/space/index.ts +0 -0
  1008. /package/src/{cli/commands → commands}/space/info/index.ts +0 -0
  1009. /package/src/{cli/commands → commands}/space/join/index.ts +0 -0
  1010. /package/src/{cli/commands → commands}/space/join/util.ts +0 -0
  1011. /package/src/{cli/commands → commands}/space/list/index.ts +0 -0
  1012. /package/src/{cli/commands → commands}/space/members/index.ts +0 -0
  1013. /package/src/{cli/commands → commands}/space/members/members.ts +0 -0
  1014. /package/src/{cli/commands → commands}/space/members/util.ts +0 -0
  1015. /package/src/{cli/commands → commands}/space/open/index.ts +0 -0
  1016. /package/src/{cli/commands → commands}/space/schema/index.ts +0 -0
  1017. /package/src/{cli/commands → commands}/space/schema/list/index.ts +0 -0
  1018. /package/src/{cli/commands → commands}/space/schema/list/list.ts +0 -0
  1019. /package/src/{cli/commands → commands}/space/schema/list/util.ts +0 -0
  1020. /package/src/{cli/commands → commands}/space/share/index.ts +0 -0
  1021. /package/src/{cli/commands → commands}/space/share/share.ts +0 -0
  1022. /package/src/{cli/commands → commands}/space/sync/index.ts +0 -0
  1023. /package/src/{cli/commands → commands}/space/sync/sync.test.ts +0 -0
  1024. /package/src/{cli/commands → commands}/space/sync/sync.ts +0 -0
@@ -1,1890 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- useInputSurfaceLookup,
4
- usePath,
5
- useTypeOptions
6
- } from "./chunk-A5A7M37T.mjs";
7
- import {
8
- COMPOSER_SPACE_LOCK,
9
- getSpaceDisplayName
10
- } from "./chunk-FB5YNROS.mjs";
11
- import {
12
- SpaceCapabilities,
13
- SpaceForm,
14
- SpaceOperation
15
- } from "./chunk-NYSDQPNM.mjs";
16
- import {
17
- meta
18
- } from "./chunk-SL4BJSUG.mjs";
19
-
20
- // src/components/AwaitingObject.tsx
21
- import React, { useCallback, useEffect, useState } from "react";
22
- import { useOperationInvoker } from "@dxos/app-framework/ui";
23
- import { LayoutOperation } from "@dxos/app-toolkit";
24
- import { useLayout } from "@dxos/app-toolkit/ui";
25
- import { Obj } from "@dxos/echo";
26
- import { useClient } from "@dxos/react-client";
27
- import { Filter, useQuery } from "@dxos/react-client/echo";
28
- import { Button, Icon, Toast, useTranslation } from "@dxos/react-ui";
29
- import { osTranslations } from "@dxos/ui-theme";
30
- var WAIT_FOR_OBJECT_TIMEOUT = 3 * 60 * 1e3;
31
- var TOAST_TIMEOUT = 4 * 60 * 1e3;
32
- var AwaitingObject = ({ id }) => {
33
- const { t } = useTranslation(meta.id);
34
- const { invokePromise } = useOperationInvoker();
35
- const [open, setOpen] = useState(true);
36
- const [waiting, setWaiting] = useState(true);
37
- const [found, setFound] = useState(false);
38
- const layout = useLayout();
39
- const client = useClient();
40
- const objects = useQuery(client.spaces, Filter.everything());
41
- useEffect(() => {
42
- if (!id) {
43
- return;
44
- }
45
- const timeout = setTimeout(() => setWaiting(false), WAIT_FOR_OBJECT_TIMEOUT);
46
- return () => clearTimeout(timeout);
47
- }, [
48
- id
49
- ]);
50
- useEffect(() => {
51
- if (objects.findIndex((object) => Obj.getDXN(object).toString() === id) > -1) {
52
- setFound(true);
53
- if (layout.active.includes(id)) {
54
- setOpen(false);
55
- }
56
- }
57
- }, [
58
- id,
59
- objects,
60
- layout
61
- ]);
62
- const handleClose = useCallback(async () => invokePromise(SpaceOperation.WaitForObject, {
63
- id: void 0
64
- }), [
65
- invokePromise
66
- ]);
67
- const handleNavigate = useCallback(() => {
68
- void invokePromise(LayoutOperation.Open, {
69
- subject: [
70
- id
71
- ]
72
- });
73
- void handleClose();
74
- }, [
75
- id,
76
- handleClose,
77
- invokePromise
78
- ]);
79
- return /* @__PURE__ */ React.createElement(Toast.Root, {
80
- open,
81
- duration: TOAST_TIMEOUT,
82
- onOpenChange: setOpen
83
- }, /* @__PURE__ */ React.createElement(Toast.Body, null, /* @__PURE__ */ React.createElement(Toast.Title, {
84
- classNames: "flex items-center gap-2"
85
- }, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
86
- icon: "ph--check-circle--regular",
87
- size: 5
88
- }), /* @__PURE__ */ React.createElement("span", null, t("found object label"))) : waiting ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
89
- icon: "ph--circle-notch--regular",
90
- size: 5,
91
- classNames: "animate-spin"
92
- }), /* @__PURE__ */ React.createElement("span", null, t("waiting for object label"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
93
- icon: "ph--circle-dashed--regular",
94
- size: 5
95
- }), /* @__PURE__ */ React.createElement("span", null, t("object not found label")))), /* @__PURE__ */ React.createElement(Toast.Description, null, t(found ? "found object description" : waiting ? "waiting for object description" : "object not found description"))), /* @__PURE__ */ React.createElement(Toast.Actions, null, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Toast.Action, {
96
- altText: t("go to object alt"),
97
- asChild: true
98
- }, /* @__PURE__ */ React.createElement(Button, {
99
- variant: "primary",
100
- onClick: handleNavigate
101
- }, t("go to object label"))), /* @__PURE__ */ React.createElement(Toast.Close, {
102
- asChild: true
103
- }, /* @__PURE__ */ React.createElement(Button, {
104
- onClick: handleClose
105
- }, t("close label", {
106
- ns: osTranslations
107
- })))) : /* @__PURE__ */ React.createElement(Toast.Close, {
108
- asChild: true
109
- }, /* @__PURE__ */ React.createElement(Button, {
110
- onClick: handleClose
111
- }, t(waiting ? "close label" : "confirm label", {
112
- ns: osTranslations
113
- })))));
114
- };
115
-
116
- // src/components/CreateDialog/CreateObjectDialog.tsx
117
- import * as Effect from "effect/Effect";
118
- import React3, { useCallback as useCallback3, useMemo as useMemo2, useRef, useState as useState2 } from "react";
119
- import { Capability } from "@dxos/app-framework";
120
- import { useOperationInvoker as useOperationInvoker2, usePluginManager } from "@dxos/app-framework/ui";
121
- import { AppCapabilities, LayoutOperation as LayoutOperation2 } from "@dxos/app-toolkit";
122
- import { Database, Obj as Obj3, Type } from "@dxos/echo";
123
- import { EntityKind, getTypeAnnotation as getTypeAnnotation2 } from "@dxos/echo/internal";
124
- import { runAndForwardErrors } from "@dxos/effect";
125
- import { invariant } from "@dxos/invariant";
126
- import { Operation } from "@dxos/operation";
127
- import { useClient as useClient2 } from "@dxos/react-client";
128
- import { useSpaces } from "@dxos/react-client/echo";
129
- import { Dialog, useTranslation as useTranslation3 } from "@dxos/react-ui";
130
-
131
- // src/components/CreateDialog/CreateObjectPanel.tsx
132
- import * as Option from "effect/Option";
133
- import React2, { useCallback as useCallback2, useMemo } from "react";
134
- import { Obj as Obj2 } from "@dxos/echo";
135
- import { getTypeAnnotation } from "@dxos/echo/internal";
136
- import { toLocalizedString, useDefaultValue, useTranslation as useTranslation2 } from "@dxos/react-ui";
137
- import { Form, omitId } from "@dxos/react-ui-form";
138
- import { SearchList, useSearchListResults } from "@dxos/react-ui-searchlist";
139
- import { ViewAnnotation } from "@dxos/schema";
140
- import { isNonNullable } from "@dxos/util";
141
- var CreateObjectPanel = ({ schemas, spaces, typename, target, views, initialFormValues: _initialFormValues, defaultSpaceId, resolve, onTargetChange, onTypenameChange, onCreateObject }) => {
142
- const { t } = useTranslation2(meta.id);
143
- const initialFormValues = useDefaultValue(_initialFormValues, () => ({}));
144
- const metadata = typename && resolve?.(typename);
145
- const options = schemas.filter((schema) => {
146
- if (views == null) {
147
- return true;
148
- } else {
149
- return views === ViewAnnotation.get(schema).pipe(Option.getOrElse(() => false));
150
- }
151
- }).map((schema) => getTypeAnnotation(schema)).filter(isNonNullable).sort((a, b) => {
152
- const nameA = t("typename label", {
153
- ns: a.typename,
154
- defaultValue: a.typename
155
- });
156
- const nameB = t("typename label", {
157
- ns: b.typename,
158
- defaultValue: b.typename
159
- });
160
- return nameA.localeCompare(nameB);
161
- });
162
- const handleCreateObject = useCallback2(async (props) => {
163
- if (!metadata) {
164
- return;
165
- }
166
- await onCreateObject?.({
167
- metadata,
168
- data: props
169
- });
170
- }, [
171
- onCreateObject,
172
- metadata
173
- ]);
174
- const handleSetTypename = useCallback2(async (typename2) => {
175
- const metadata2 = resolve?.(typename2);
176
- if (metadata2 && !metadata2.inputSchema) {
177
- await onCreateObject?.({
178
- metadata: metadata2
179
- });
180
- } else {
181
- onTypenameChange?.(typename2);
182
- }
183
- }, [
184
- resolve,
185
- onCreateObject
186
- ]);
187
- const inputSurfaceLookup = useInputSurfaceLookup({
188
- target
189
- });
190
- return !metadata ? /* @__PURE__ */ React2.createElement(SelectSchema, {
191
- options,
192
- resolve,
193
- onChange: handleSetTypename
194
- }) : !target ? /* @__PURE__ */ React2.createElement(SelectSpace, {
195
- spaces,
196
- defaultSpaceId,
197
- onChange: onTargetChange
198
- }) : metadata.inputSchema ? /* @__PURE__ */ React2.createElement(Form.Root, {
199
- testId: "create-object-form",
200
- autoFocus: true,
201
- schema: omitId(metadata.inputSchema),
202
- values: initialFormValues,
203
- db: Obj2.isObject(target) ? Obj2.getDatabase(target) : target,
204
- fieldProvider: inputSurfaceLookup,
205
- onSave: handleCreateObject
206
- }, /* @__PURE__ */ React2.createElement(Form.Viewport, null, /* @__PURE__ */ React2.createElement(Form.Content, null, /* @__PURE__ */ React2.createElement(Form.FieldSet, null), /* @__PURE__ */ React2.createElement(Form.Submit, null)))) : null;
207
- };
208
- CreateObjectPanel.displayName = "CreateObjectPanel";
209
- var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
210
- const { t } = useTranslation2(meta.id);
211
- const sortedSpaces = useMemo(() => [
212
- ...spaces
213
- ].sort((a, b) => {
214
- const labelA = toLocalizedString(getSpaceDisplayName(a, {
215
- personal: a.id === defaultSpaceId
216
- }), t);
217
- const labelB = toLocalizedString(getSpaceDisplayName(b, {
218
- personal: b.id === defaultSpaceId
219
- }), t);
220
- return labelA.localeCompare(labelB);
221
- }), [
222
- spaces,
223
- defaultSpaceId,
224
- t
225
- ]);
226
- const { results, handleSearch } = useSearchListResults({
227
- items: sortedSpaces,
228
- extract: (space) => toLocalizedString(getSpaceDisplayName(space, {
229
- personal: space.id === defaultSpaceId
230
- }), t)
231
- });
232
- return /* @__PURE__ */ React2.createElement(SearchList.Root, {
233
- onSearch: handleSearch
234
- }, /* @__PURE__ */ React2.createElement(SearchList.Content, null, /* @__PURE__ */ React2.createElement(SearchList.Input, {
235
- autoFocus: true,
236
- "data-testid": "create-object-form.space-input",
237
- placeholder: t("space input placeholder")
238
- }), /* @__PURE__ */ React2.createElement(SearchList.Viewport, null, results.map((space) => /* @__PURE__ */ React2.createElement(SearchList.Item, {
239
- key: space.id,
240
- value: space.id,
241
- label: toLocalizedString(getSpaceDisplayName(space, {
242
- personal: space.id === defaultSpaceId
243
- }), t),
244
- onSelect: () => onChange?.(space.db),
245
- classNames: "flex items-center gap-2"
246
- })))));
247
- };
248
- var SelectSchema = ({ options, resolve, onChange }) => {
249
- const { t } = useTranslation2(meta.id);
250
- const { results, handleSearch } = useSearchListResults({
251
- items: options,
252
- extract: (option) => t("typename label", {
253
- ns: option.typename,
254
- defaultValue: option.typename
255
- })
256
- });
257
- return /* @__PURE__ */ React2.createElement(SearchList.Root, {
258
- onSearch: handleSearch
259
- }, /* @__PURE__ */ React2.createElement(SearchList.Content, null, /* @__PURE__ */ React2.createElement(SearchList.Input, {
260
- autoFocus: true,
261
- "data-testid": "create-object-form.schema-input",
262
- placeholder: t("schema input placeholder")
263
- }), /* @__PURE__ */ React2.createElement(SearchList.Viewport, null, results.map((option) => /* @__PURE__ */ React2.createElement(SearchList.Item, {
264
- key: option.typename,
265
- value: option.typename,
266
- label: t("typename label", {
267
- ns: option.typename,
268
- defaultValue: option.typename
269
- }),
270
- icon: resolve?.(option.typename)?.icon ?? "ph--placeholder--regular",
271
- onSelect: () => onChange(option.typename),
272
- classNames: "flex items-center gap-2"
273
- })))));
274
- };
275
-
276
- // src/components/CreateDialog/CreateObjectDialog.tsx
277
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
278
- var CREATE_OBJECT_DIALOG = `${meta.id}/CreateObjectDialog`;
279
- var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, views, initialFormValues, onCreateObject, shouldNavigate: _shouldNavigate }) => {
280
- const manager = usePluginManager();
281
- const { t } = useTranslation3(meta.id);
282
- const operationInvoker = useOperationInvoker2();
283
- const [target, setTarget] = useState2(initialTarget);
284
- const [typename, setTypename] = useState2(initialTypename);
285
- const client = useClient2();
286
- const spaces = useSpaces();
287
- const closeRef = useRef(null);
288
- const resolve = useCallback3((typename2) => {
289
- const metadata = manager.capabilities.getAll(AppCapabilities.Metadata).find(({ id }) => id === typename2)?.metadata;
290
- return metadata?.createObject ? metadata : void 0;
291
- }, [
292
- manager
293
- ]);
294
- const db = Database.isDatabase(target) ? target : target && Obj3.getDatabase(target);
295
- const schemas = db?.schemaRegistry.query({
296
- location: [
297
- "runtime"
298
- ],
299
- includeSystem: false
300
- }).runSync();
301
- const userSchemas = useMemo2(() => schemas?.filter((schema) => getTypeAnnotation2(schema)?.kind !== EntityKind.Relation).filter((schema) => !!resolve(Type.getTypename(schema))) ?? [], [
302
- schemas
303
- ]);
304
- const handleCreateObject = useCallback3(({ metadata, data = {} }) => Effect.gen(function* () {
305
- if (!target) {
306
- return;
307
- }
308
- closeRef.current?.click();
309
- const db2 = Database.isDatabase(target) ? target : target && Obj3.getDatabase(target);
310
- invariant(db2, "Missing database", {
311
- F: __dxlog_file,
312
- L: 86,
313
- S: this,
314
- A: [
315
- "db",
316
- "'Missing database'"
317
- ]
318
- });
319
- const object = yield* metadata.createObject(data, {
320
- db: db2
321
- });
322
- if (Obj3.isObject(object) && !Obj3.instanceOf(Type.PersistentType, object)) {
323
- const hidden = !metadata.addToCollectionOnCreate;
324
- yield* operationInvoker.invoke(SpaceOperation.AddObject, {
325
- target,
326
- object,
327
- hidden
328
- });
329
- const shouldNavigate = _shouldNavigate ?? (() => true);
330
- if (shouldNavigate(object)) {
331
- yield* Effect.promise(() => operationInvoker.invokePromise(LayoutOperation2.Open, {
332
- subject: [
333
- Obj3.getDXN(object).toString()
334
- ]
335
- }));
336
- }
337
- onCreateObject?.(object);
338
- }
339
- }).pipe(Effect.provideService(Capability.Service, manager.capabilities), Effect.provideService(Operation.Service, operationInvoker), runAndForwardErrors), [
340
- target,
341
- _shouldNavigate,
342
- onCreateObject,
343
- manager.capabilities,
344
- operationInvoker
345
- ]);
346
- return /* @__PURE__ */ React3.createElement(Dialog.Content, null, /* @__PURE__ */ React3.createElement(Dialog.Header, null, /* @__PURE__ */ React3.createElement(Dialog.Title, null, t("create object dialog title", {
347
- object: t("typename label", {
348
- ns: typename,
349
- defaultValue: views ? "View" : "Object"
350
- })
351
- })), /* @__PURE__ */ React3.createElement(Dialog.Close, {
352
- asChild: true
353
- }, /* @__PURE__ */ React3.createElement(Dialog.CloseIconButton, {
354
- ref: closeRef
355
- }))), /* @__PURE__ */ React3.createElement(Dialog.Body, null, /* @__PURE__ */ React3.createElement(CreateObjectPanel, {
356
- schemas: userSchemas,
357
- spaces,
358
- target,
359
- views,
360
- typename,
361
- initialFormValues,
362
- defaultSpaceId: client.spaces.default.id,
363
- resolve,
364
- onTargetChange: setTarget,
365
- onTypenameChange: setTypename,
366
- onCreateObject: handleCreateObject
367
- })));
368
- };
369
-
370
- // src/components/CreateDialog/CreateSpaceDialog.tsx
371
- import * as Effect2 from "effect/Effect";
372
- import React4, { useCallback as useCallback4, useRef as useRef2 } from "react";
373
- import { useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/ui";
374
- import { LayoutOperation as LayoutOperation3 } from "@dxos/app-toolkit";
375
- import { runAndForwardErrors as runAndForwardErrors2 } from "@dxos/effect";
376
- import { Dialog as Dialog2, useTranslation as useTranslation4 } from "@dxos/react-ui";
377
- import { Form as Form2 } from "@dxos/react-ui-form";
378
- var CREATE_SPACE_DIALOG = `${meta.id}/CreateSpaceDialog`;
379
- var initialValues = {
380
- edgeReplication: true
381
- };
382
- var CreateSpaceDialog = () => {
383
- const closeRef = useRef2(null);
384
- const { t } = useTranslation4(meta.id);
385
- const { invokePromise } = useOperationInvoker3();
386
- const inputSurfaceLookup = useInputSurfaceLookup();
387
- const handleCreateSpace = useCallback4(async (data) => {
388
- const program = Effect2.gen(function* () {
389
- const { data: result } = yield* Effect2.promise(() => invokePromise(SpaceOperation.Create, data));
390
- if (result?.space) {
391
- yield* Effect2.promise(() => invokePromise(LayoutOperation3.SwitchWorkspace, {
392
- subject: result.space.id
393
- }));
394
- yield* Effect2.promise(() => invokePromise(LayoutOperation3.UpdateDialog, {
395
- state: false
396
- }));
397
- }
398
- });
399
- await runAndForwardErrors2(program);
400
- }, [
401
- invokePromise
402
- ]);
403
- return /* @__PURE__ */ React4.createElement(Dialog2.Content, null, /* @__PURE__ */ React4.createElement(Dialog2.Header, null, /* @__PURE__ */ React4.createElement(Dialog2.Title, null, t("create space dialog title")), /* @__PURE__ */ React4.createElement(Dialog2.Close, {
404
- asChild: true
405
- }, /* @__PURE__ */ React4.createElement(Dialog2.CloseIconButton, {
406
- ref: closeRef
407
- }))), /* @__PURE__ */ React4.createElement(Dialog2.Body, null, /* @__PURE__ */ React4.createElement(Form2.Root, {
408
- testId: "create-space-form",
409
- autoFocus: true,
410
- schema: SpaceForm,
411
- values: initialValues,
412
- fieldProvider: inputSurfaceLookup,
413
- onSave: handleCreateSpace
414
- }, /* @__PURE__ */ React4.createElement(Form2.Viewport, null, /* @__PURE__ */ React4.createElement(Form2.Content, null, /* @__PURE__ */ React4.createElement(Form2.FieldSet, null), /* @__PURE__ */ React4.createElement(Form2.Submit, null))))));
415
- };
416
-
417
- // src/components/CollectionSection.tsx
418
- import React5 from "react";
419
- import { useTranslation as useTranslation5 } from "@dxos/react-ui";
420
- var CollectionSection = ({ role, subject }) => {
421
- const { t } = useTranslation5(meta.id);
422
- return /* @__PURE__ */ React5.createElement("div", {
423
- role,
424
- className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
425
- }, /* @__PURE__ */ React5.createElement("span", {
426
- className: "truncate"
427
- }, subject.name ?? t("unnamed collection label")));
428
- };
429
-
430
- // src/components/JoinDialog/JoinDialog.tsx
431
- import React6, { useCallback as useCallback5 } from "react";
432
- import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/ui";
433
- import { LayoutOperation as LayoutOperation4 } from "@dxos/app-toolkit";
434
- import { useAppGraph } from "@dxos/app-toolkit/ui";
435
- import { Trigger } from "@dxos/async";
436
- import { Graph } from "@dxos/plugin-graph";
437
- import { ObservabilityOperation } from "@dxos/plugin-observability/types";
438
- import { useClient as useClient3 } from "@dxos/react-client";
439
- import { Dialog as Dialog3, useTranslation as useTranslation6 } from "@dxos/react-ui";
440
- import { JoinPanel } from "@dxos/shell/react";
441
- import { osTranslations as osTranslations2 } from "@dxos/ui-theme";
442
- var JOIN_DIALOG = `${meta.id}/JoinDialog`;
443
- var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
444
- const { invokePromise } = useOperationInvoker4();
445
- const client = useClient3();
446
- const { graph } = useAppGraph();
447
- const { t } = useTranslation6(meta.id);
448
- const handleDone = useCallback5(async (result) => {
449
- const spaceKey = result?.spaceKey;
450
- if (!spaceKey) {
451
- return;
452
- }
453
- await Promise.all([
454
- invokePromise(LayoutOperation4.AddToast, {
455
- id: `${meta.id}/join-success`,
456
- duration: 5e3,
457
- title: [
458
- "join success label",
459
- {
460
- ns: meta.id
461
- }
462
- ],
463
- closeLabel: [
464
- "dismiss label",
465
- {
466
- ns: meta.id
467
- }
468
- ]
469
- }),
470
- invokePromise(LayoutOperation4.UpdateDialog, {
471
- state: false
472
- })
473
- ]);
474
- let space = client.spaces.get(spaceKey);
475
- if (!space) {
476
- const trigger = new Trigger();
477
- client.spaces.subscribe(() => {
478
- const space2 = client.spaces.get(spaceKey);
479
- if (space2) {
480
- trigger.wake(space2);
481
- }
482
- });
483
- space = await trigger.wait();
484
- }
485
- await invokePromise(LayoutOperation4.SwitchWorkspace, {
486
- subject: space.id
487
- });
488
- const target = result?.target || (navigableCollections ? space?.id : void 0);
489
- if (target) {
490
- await Graph.waitForPath(graph, {
491
- target
492
- }).catch(() => {
493
- });
494
- await Promise.all([
495
- invokePromise(LayoutOperation4.Open, {
496
- subject: [
497
- target
498
- ]
499
- }),
500
- invokePromise(LayoutOperation4.Expose, {
501
- subject: target
502
- })
503
- ]);
504
- }
505
- await onDone?.(result);
506
- if (space) {
507
- await invokePromise(ObservabilityOperation.SendEvent, {
508
- name: "space.join",
509
- properties: {
510
- spaceId: space.id
511
- }
512
- });
513
- }
514
- }, [
515
- invokePromise,
516
- client,
517
- graph,
518
- navigableCollections,
519
- onDone
520
- ]);
521
- return /* @__PURE__ */ React6.createElement(Dialog3.Content, null, /* @__PURE__ */ React6.createElement(Dialog3.Title, {
522
- classNames: "sr-only"
523
- }, t("join space label", {
524
- ns: osTranslations2
525
- })), /* @__PURE__ */ React6.createElement(JoinPanel, {
526
- ...props,
527
- exitActionParent: /* @__PURE__ */ React6.createElement(Dialog3.Close, {
528
- asChild: true
529
- }),
530
- doneActionParent: /* @__PURE__ */ React6.createElement(Dialog3.Close, {
531
- asChild: true
532
- }),
533
- onDone: handleDone
534
- }));
535
- };
536
-
537
- // src/components/MembersContainer/MembersContainer.tsx
538
- import React7, { useCallback as useCallback6, useMemo as useMemo3, useState as useState3 } from "react";
539
- import { QR } from "react-qr-rounded";
540
- import { useOperationInvoker as useOperationInvoker5 } from "@dxos/app-framework/ui";
541
- import { Obj as Obj4 } from "@dxos/echo";
542
- import { log } from "@dxos/log";
543
- import { useConfig } from "@dxos/react-client";
544
- import { useSpaceInvitations } from "@dxos/react-client/echo";
545
- import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
546
- import { Button as Button2, Clipboard, Icon as Icon2, Input, useId, useTranslation as useTranslation7 } from "@dxos/react-ui";
547
- import { Settings } from "@dxos/react-ui-form";
548
- import { Collection } from "@dxos/schema";
549
- import { AuthCode, BifurcatedAction, Centered, Emoji, InvitationList, SpaceMemberList, Viewport, translationKey as shellTranslationKey } from "@dxos/shell/react";
550
- import { hexToEmoji } from "@dxos/util";
551
- var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/MembersContainer/MembersContainer.tsx";
552
- var activeActionKey = "dxos:react-shell/space-manager/active-action";
553
- var handleInvitationEvent = (invitation, subscription) => {
554
- const invitationCode = InvitationEncoder.encode(invitation);
555
- if (invitation.state === Invitation.State.CONNECTING) {
556
- log.info(JSON.stringify({
557
- invitationCode,
558
- authCode: invitation.authCode
559
- }), void 0, {
560
- F: __dxlog_file2,
561
- L: 40,
562
- S: void 0,
563
- C: (f, a) => f(...a)
564
- });
565
- subscription.unsubscribe();
566
- }
567
- };
568
- var MembersContainer = ({ space, createInvitationUrl }) => {
569
- const { t } = useTranslation7(meta.id);
570
- const config = useConfig();
571
- const { invokePromise } = useOperationInvoker5();
572
- const invitations = useSpaceInvitations(space.key);
573
- const visibleInvitations = invitations?.filter((invitation) => ![
574
- Invitation.State.CANCELLED
575
- ].includes(invitation.get().state));
576
- const [activeAction, setInternalActiveAction] = useState3(localStorage.getItem(activeActionKey) ?? "inviteMany");
577
- const setActiveAction = (nextAction) => {
578
- setInternalActiveAction(nextAction);
579
- localStorage.setItem(activeActionKey, nextAction);
580
- };
581
- const target = space.properties[Collection.Collection.typename]?.target?.objects[0]?.target;
582
- const locked = space.properties[COMPOSER_SPACE_LOCK];
583
- const handleChangeLocked = useCallback6(() => {
584
- Obj4.change(space.properties, (p) => {
585
- p[COMPOSER_SPACE_LOCK] = !locked;
586
- });
587
- }, [
588
- locked,
589
- space
590
- ]);
591
- const inviteActions = useMemo3(() => ({
592
- inviteOne: {
593
- label: t("invite one label", {
594
- ns: shellTranslationKey
595
- }),
596
- description: t("invite one description", {
597
- ns: shellTranslationKey
598
- }),
599
- icon: "ph--user-plus--regular",
600
- testId: "membersContainer.inviteOne",
601
- onClick: async () => {
602
- const { data: invitation } = await invokePromise(SpaceOperation.Share, {
603
- space,
604
- type: Invitation.Type.INTERACTIVE,
605
- authMethod: Invitation.AuthMethod.SHARED_SECRET,
606
- multiUse: false,
607
- target: target && Obj4.getDXN(target).toString()
608
- });
609
- if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
610
- const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
611
- }
612
- }
613
- },
614
- inviteMany: {
615
- label: t("invite many label", {
616
- ns: shellTranslationKey
617
- }),
618
- description: t("invite many description", {
619
- ns: shellTranslationKey
620
- }),
621
- icon: "ph--users-three--regular",
622
- testId: "membersContainer.inviteMany",
623
- onClick: async () => {
624
- const { data: invitation } = await invokePromise(SpaceOperation.Share, {
625
- space,
626
- type: Invitation.Type.DELEGATED,
627
- authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
628
- multiUse: true,
629
- target: target && Obj4.getDXN(target).toString()
630
- });
631
- if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
632
- const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
633
- }
634
- }
635
- }
636
- }), [
637
- t,
638
- space,
639
- target,
640
- invokePromise
641
- ]);
642
- const [selectedInvitation, setSelectedInvitation] = useState3(null);
643
- const handleSend = (event) => {
644
- setSelectedInvitation(event.invitation);
645
- };
646
- const handleBack = () => {
647
- setSelectedInvitation(null);
648
- };
649
- return /* @__PURE__ */ React7.createElement(Clipboard.Provider, null, /* @__PURE__ */ React7.createElement(Settings.Root, null, /* @__PURE__ */ React7.createElement(Settings.Section, {
650
- title: t("members verbose label"),
651
- description: t("members description")
652
- }, /* @__PURE__ */ React7.createElement(Settings.Frame, null, /* @__PURE__ */ React7.createElement(Settings.FrameItem, {
653
- title: t("members label")
654
- }, /* @__PURE__ */ React7.createElement(SpaceMemberList, {
655
- spaceKey: space.key,
656
- includeSelf: true
657
- })), locked && /* @__PURE__ */ React7.createElement(Settings.FrameItem, {
658
- title: t("invitations label")
659
- }, /* @__PURE__ */ React7.createElement("p", {
660
- className: "text-description mbe-2"
661
- }, t("locked space description"))), !locked && /* @__PURE__ */ React7.createElement(Settings.FrameItem, {
662
- title: t("invitations label")
663
- }, selectedInvitation && /* @__PURE__ */ React7.createElement(InvitationSection, {
664
- ...selectedInvitation,
665
- onBack: handleBack
666
- }), !selectedInvitation && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
667
- className: "text-description mbe-2"
668
- }, t("space invitation description")), /* @__PURE__ */ React7.createElement(InvitationList, {
669
- className: "mb-2",
670
- send: handleSend,
671
- invitations: visibleInvitations ?? [],
672
- onClickRemove: (invitation) => invitation.cancel(),
673
- createInvitationUrl
674
- }), /* @__PURE__ */ React7.createElement(BifurcatedAction, {
675
- actions: inviteActions,
676
- activeAction,
677
- onChangeActiveAction: setActiveAction,
678
- "data-testid": "membersContainer.createInvitation"
679
- })))), /* @__PURE__ */ React7.createElement("div", {
680
- className: "justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
681
- }, /* @__PURE__ */ React7.createElement(Settings.ItemInput, {
682
- title: t("space locked label"),
683
- description: t("space locked description")
684
- }, /* @__PURE__ */ React7.createElement(Input.Switch, {
685
- checked: locked,
686
- onCheckedChange: handleChangeLocked,
687
- classNames: "justify-self-end"
688
- }))))));
689
- };
690
- var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
691
- const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
692
- return /* @__PURE__ */ React7.createElement(Viewport.Root, {
693
- activeView
694
- }, /* @__PURE__ */ React7.createElement(Viewport.Views, null, /* @__PURE__ */ React7.createElement(Viewport.View, {
695
- id: "init"
696
- }), /* @__PURE__ */ React7.createElement(Viewport.View, {
697
- id: "complete"
698
- }, /* @__PURE__ */ React7.createElement(InvitationComplete, {
699
- statusValue: state
700
- })), /* @__PURE__ */ React7.createElement(Viewport.View, {
701
- id: "auth-code"
702
- }, /* @__PURE__ */ React7.createElement(InvitationAuthCode, {
703
- id: invitationId,
704
- code: authCode ?? "never",
705
- onCancel: onBack
706
- })), /* @__PURE__ */ React7.createElement(Viewport.View, {
707
- id: "qr-code"
708
- }, /* @__PURE__ */ React7.createElement(InvitationQR, {
709
- id: invitationId,
710
- url,
711
- onCancel: onBack
712
- }))));
713
- };
714
- var InvitationQR = ({ id, url, onCancel }) => {
715
- const { t } = useTranslation7(shellTranslationKey);
716
- const qrLabel = useId("members-container__qr-code");
717
- const emoji = hexToEmoji(id);
718
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
719
- className: "text-description"
720
- }, t("qr code description", {
721
- ns: meta.id
722
- })), /* @__PURE__ */ React7.createElement("div", {
723
- role: "group",
724
- className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
725
- }, /* @__PURE__ */ React7.createElement("div", {
726
- role: "none",
727
- className: "is-full aspect-square relative text-description"
728
- }, /* @__PURE__ */ React7.createElement(QR, {
729
- rounding: 100,
730
- backgroundColor: "transparent",
731
- color: "currentColor",
732
- "aria-labelledby": qrLabel,
733
- errorCorrectionLevel: "Q",
734
- cutout: true
735
- }, url ?? "never"), /* @__PURE__ */ React7.createElement(Centered, null, /* @__PURE__ */ React7.createElement(Emoji, {
736
- text: emoji
737
- }))), /* @__PURE__ */ React7.createElement("span", {
738
- id: qrLabel,
739
- className: "sr-only"
740
- }, t("qr label")), /* @__PURE__ */ React7.createElement(Clipboard.Button, {
741
- value: url ?? "never"
742
- })), /* @__PURE__ */ React7.createElement(Button2, {
743
- variant: "ghost",
744
- onClick: onCancel
745
- }, t("cancel label")));
746
- };
747
- var InvitationAuthCode = ({ id, code, onCancel }) => {
748
- const { t } = useTranslation7(shellTranslationKey);
749
- const emoji = hexToEmoji(id);
750
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
751
- className: "text-description"
752
- }, t("auth other device emoji message")), emoji && /* @__PURE__ */ React7.createElement(Emoji, {
753
- text: emoji,
754
- className: "mli-auto mlb-2 text-center"
755
- }), /* @__PURE__ */ React7.createElement("p", {
756
- className: "text-description"
757
- }, t("auth code message")), /* @__PURE__ */ React7.createElement(AuthCode, {
758
- code,
759
- large: true,
760
- classNames: "mli-auto mlb-2 text-center grow"
761
- }), /* @__PURE__ */ React7.createElement(Button2, {
762
- variant: "ghost",
763
- onClick: onCancel
764
- }, t("cancel label")));
765
- };
766
- var InvitationComplete = ({ statusValue }) => {
767
- return statusValue > 0 ? /* @__PURE__ */ React7.createElement(Icon2, {
768
- icon: "ph--check--regular",
769
- size: 6,
770
- classNames: "m-1.5"
771
- }) : /* @__PURE__ */ React7.createElement(Icon2, {
772
- icon: "ph--x--regular",
773
- size: 6,
774
- classNames: "m-1.5"
775
- });
776
- };
777
-
778
- // src/components/MenuFooter.tsx
779
- import React8 from "react";
780
- import { getSpace } from "@dxos/client/echo";
781
- import { useClient as useClient4 } from "@dxos/react-client";
782
- import { DropdownMenu, Icon as Icon3, toLocalizedString as toLocalizedString2, useTranslation as useTranslation8 } from "@dxos/react-ui";
783
- var MenuFooter = ({ object }) => {
784
- const { t } = useTranslation8(meta.id);
785
- const client = useClient4();
786
- const space = getSpace(object);
787
- const spaceName = space ? getSpaceDisplayName(space, {
788
- personal: client.spaces.default === space
789
- }) : "";
790
- return space ? /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(DropdownMenu.Separator, null), /* @__PURE__ */ React8.createElement(DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ React8.createElement("dl", {
791
- className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
792
- }, /* @__PURE__ */ React8.createElement("dt", {
793
- className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
794
- }, t("location label")), /* @__PURE__ */ React8.createElement("dd", {
795
- className: "line-clamp-3"
796
- }, /* @__PURE__ */ React8.createElement(Icon3, {
797
- icon: "ph--planet--regular",
798
- classNames: "inline-block mie-1"
799
- }), toLocalizedString2(spaceName, t)))) : null;
800
- };
801
-
802
- // src/components/ObjectRenamePopover/ObjectRenamePopover.tsx
803
- import React9, { useCallback as useCallback7, useRef as useRef3, useState as useState4 } from "react";
804
- import { useOperationInvoker as useOperationInvoker6 } from "@dxos/app-framework/ui";
805
- import { LayoutOperation as LayoutOperation5 } from "@dxos/app-toolkit";
806
- import { Obj as Obj5 } from "@dxos/echo";
807
- import { log as log2 } from "@dxos/log";
808
- import { Button as Button3, Input as Input2, useTranslation as useTranslation9 } from "@dxos/react-ui";
809
- import { osTranslations as osTranslations3 } from "@dxos/ui-theme";
810
- var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx";
811
- var OBJECT_RENAME_POPOVER = `${meta.id}/ObjectRenamePopover`;
812
- var ObjectRenamePopover = ({ object }) => {
813
- const { t } = useTranslation9(meta.id);
814
- const doneButton = useRef3(null);
815
- const [name, setName] = useState4(Obj5.getLabel(object));
816
- const { invokePromise } = useOperationInvoker6();
817
- const handleDone = useCallback7(() => {
818
- try {
819
- name && Obj5.change(object, () => Obj5.setLabel(object, name));
820
- } catch (err) {
821
- log2.error("Failed to rename object", {
822
- err
823
- }, {
824
- F: __dxlog_file3,
825
- L: 28,
826
- S: void 0,
827
- C: (f, a) => f(...a)
828
- });
829
- }
830
- void invokePromise(LayoutOperation5.UpdatePopover, {
831
- anchorId: "",
832
- state: false
833
- });
834
- }, [
835
- object,
836
- name,
837
- invokePromise
838
- ]);
839
- return /* @__PURE__ */ React9.createElement("div", {
840
- role: "none",
841
- className: "p-2 flex gap-2"
842
- }, /* @__PURE__ */ React9.createElement("div", {
843
- role: "none",
844
- className: "flex-1"
845
- }, /* @__PURE__ */ React9.createElement(Input2.Root, null, /* @__PURE__ */ React9.createElement(Input2.Label, {
846
- srOnly: true
847
- }, t("object name label")), /* @__PURE__ */ React9.createElement(Input2.TextInput, {
848
- placeholder: t("object placeholder"),
849
- value: name,
850
- "data-testid": "spacePlugin.renameObject.input",
851
- onChange: ({ target: { value: value2 } }) => setName(value2),
852
- onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
853
- }))), /* @__PURE__ */ React9.createElement(Button3, {
854
- ref: doneButton,
855
- classNames: "self-stretch",
856
- onClick: handleDone
857
- }, t("done label", {
858
- ns: osTranslations3
859
- })));
860
- };
861
-
862
- // src/components/SchemaContainer.tsx
863
- import React10, { useEffect as useEffect2, useState as useState5 } from "react";
864
- import { useTranslation as useTranslation10 } from "@dxos/react-ui";
865
- import { Settings as Settings2 } from "@dxos/react-ui-form";
866
- import { mx } from "@dxos/ui-theme";
867
- var itemClasses = mx([
868
- "container-max-width grid md:col-span-2 grid-cols-subgrid gap-trimSm items-center",
869
- "*:first:!mbs-0 *:last:!mbe-0 pli-trimMd plb-trimMd",
870
- "border border-separator rounded-md"
871
- ]);
872
- var SchemaContainer = ({ space }) => {
873
- const { t } = useTranslation10(meta.id);
874
- const schemas = useQuerySpaceSchemas(space);
875
- return /* @__PURE__ */ React10.createElement(Settings2.Root, null, /* @__PURE__ */ React10.createElement(Settings2.Section, {
876
- title: t("schema verbose label"),
877
- description: t("schema description")
878
- }, /* @__PURE__ */ React10.createElement("div", {
879
- role: "none",
880
- className: itemClasses
881
- }, schemas.length === 0 && /* @__PURE__ */ React10.createElement("div", {
882
- className: "text-center plb-4"
883
- }, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React10.createElement("div", {
884
- role: "none",
885
- key: schema.id
886
- }, schema.typename)))));
887
- };
888
- var useQuerySpaceSchemas = (space) => {
889
- const [schemas, setSchemas] = useState5([]);
890
- useEffect2(() => {
891
- const query = space.db.schemaRegistry.query();
892
- const initialResults = query.runSync();
893
- setSchemas(initialResults);
894
- const unsubscribe = query.subscribe(() => setSchemas(query.results));
895
- return () => unsubscribe();
896
- }, [
897
- space
898
- ]);
899
- return schemas;
900
- };
901
-
902
- // src/components/SpacePluginSettings.tsx
903
- import React11 from "react";
904
- import { useOperationInvoker as useOperationInvoker7 } from "@dxos/app-framework/ui";
905
- import { useClient as useClient5 } from "@dxos/react-client";
906
- import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
907
- import { IconButton, Input as Input3, List, ListItem, toLocalizedString as toLocalizedString3, useTranslation as useTranslation11 } from "@dxos/react-ui";
908
- import { Settings as Settings3 } from "@dxos/react-ui-form";
909
- var SpacePluginSettings = ({ settings, onSettingsChange }) => {
910
- const { t } = useTranslation11(meta.id);
911
- const client = useClient5();
912
- const spaces = useSpaces2({
913
- all: settings.showHidden
914
- });
915
- const { invokePromise } = useOperationInvoker7();
916
- return /* @__PURE__ */ React11.createElement(Settings3.Root, null, /* @__PURE__ */ React11.createElement(Settings3.Section, {
917
- title: t("space settings label"),
918
- description: t("space settings description")
919
- }, /* @__PURE__ */ React11.createElement(Settings3.Group, null, /* @__PURE__ */ React11.createElement(Settings3.ItemInput, {
920
- title: t("show hidden spaces label")
921
- }, /* @__PURE__ */ React11.createElement(Input3.Switch, {
922
- checked: settings.showHidden,
923
- onCheckedChange: (checked) => onSettingsChange((state) => ({
924
- ...state,
925
- showHidden: !!checked
926
- }))
927
- }))), /* @__PURE__ */ React11.createElement(Settings3.Container, null, /* @__PURE__ */ React11.createElement(List, {
928
- classNames: "flex flex-col gap-trimSm"
929
- }, spaces.map((space) => /* @__PURE__ */ React11.createElement(ListItem.Root, {
930
- key: space.id,
931
- classNames: "is-full items-center"
932
- }, /* @__PURE__ */ React11.createElement(ListItem.Heading, {
933
- classNames: "grow truncate !min-bs-0"
934
- }, toLocalizedString3(getSpaceDisplayName(space, {
935
- personal: space === client.spaces.default
936
- }), t)), /* @__PURE__ */ React11.createElement(IconButton, {
937
- icon: "ph--faders--regular",
938
- onClick: () => invokePromise(SpaceOperation.OpenSettings, {
939
- space
940
- }),
941
- label: t("open space settings label")
942
- })))))));
943
- };
944
-
945
- // src/components/SpacePresence/SpacePresence.tsx
946
- import * as Option2 from "effect/Option";
947
- import React12, { forwardRef, useCallback as useCallback8, useEffect as useEffect3, useState as useState6 } from "react";
948
- import { useAtomCapability } from "@dxos/app-framework/ui";
949
- import { useAppGraph as useAppGraph2 } from "@dxos/app-toolkit/ui";
950
- import { generateName } from "@dxos/display-name";
951
- import { Obj as Obj6 } from "@dxos/echo";
952
- import { PublicKey } from "@dxos/react-client";
953
- import { useMembers, useSpace } from "@dxos/react-client/echo";
954
- import { useIdentity } from "@dxos/react-client/halo";
955
- import { Avatar, List as List2, ListItem as ListItem2, Popover, Tooltip, useDefaultValue as useDefaultValue2, useTranslation as useTranslation12 } from "@dxos/react-ui";
956
- import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
957
- import { ComplexMap, keyToFallback } from "@dxos/util";
958
- var REFRESH_INTERVAL = 5e3;
959
- var ACTIVITY_DURATION = 3e4;
960
- var noViewers = new ComplexMap(PublicKey.hash);
961
- var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
962
- var SpacePresence = ({ object, spaceId }) => {
963
- const ephemeral = useAtomCapability(SpaceCapabilities.EphemeralState);
964
- const identity = useIdentity();
965
- const db = Obj6.getDatabase(object);
966
- const space = useSpace(spaceId ?? db?.spaceId);
967
- const spaceMembers = useMembers(spaceId ?? db?.spaceId);
968
- const [_moment, setMoment] = useState6(Date.now());
969
- useEffect3(() => {
970
- const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
971
- return () => clearInterval(interval);
972
- }, []);
973
- const memberOnline = useCallback8((member) => member.presence === 1, []);
974
- const memberIsNotSelf = useCallback8((member) => !identity?.identityKey.equals(member.identity.identityKey), [
975
- identity?.identityKey
976
- ]);
977
- if (!identity || !ephemeral || !space) {
978
- return null;
979
- }
980
- const currentObjectViewers = ephemeral.viewersByObject[Obj6.getDXN(object).toString()] ?? noViewers;
981
- const membersForObject = spaceMembers.filter((member) => memberOnline(member) && memberIsNotSelf(member)).filter((member) => currentObjectViewers.has(member.identity.identityKey)).map((member) => {
982
- const objectView = currentObjectViewers.get(member.identity.identityKey);
983
- const lastSeen = objectView?.lastSeen ?? -Infinity;
984
- const currentlyAttended = objectView?.currentlyAttended ?? false;
985
- return {
986
- ...member,
987
- currentlyAttended,
988
- lastSeen
989
- };
990
- }).toSorted((a, b) => a.lastSeen - b.lastSeen);
991
- return /* @__PURE__ */ React12.createElement(FullPresence, {
992
- members: membersForObject
993
- });
994
- };
995
- var FullPresence = (props) => {
996
- const { size = 9, onMemberClick } = props;
997
- const members = useDefaultValue2(props.members, () => []);
998
- if (members.length === 0) {
999
- return null;
1000
- }
1001
- return /* @__PURE__ */ React12.createElement("div", {
1002
- className: "dx-avatar-group",
1003
- "data-testid": "spacePlugin.presence"
1004
- }, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
1005
- key: member.identity.identityKey.toHex(),
1006
- side: "bottom",
1007
- content: getName(member.identity),
1008
- className: "grid focus:outline-none"
1009
- }, /* @__PURE__ */ React12.createElement(PresenceAvatar, {
1010
- identity: member.identity,
1011
- match: member.currentlyAttended,
1012
- index: members.length - i,
1013
- onClick: () => onMemberClick?.(member),
1014
- size
1015
- }))), members.length > 3 && /* @__PURE__ */ React12.createElement(Popover.Root, null, /* @__PURE__ */ React12.createElement(Popover.Trigger, {
1016
- className: "grid focus:outline-none"
1017
- }, /* @__PURE__ */ React12.createElement(Avatar.Root, null, /* @__PURE__ */ React12.createElement(Avatar.Content, {
1018
- status: "inactive",
1019
- style: {
1020
- zIndex: members.length - 4
1021
- },
1022
- fallback: `+${members.length - 3}`,
1023
- size
1024
- }))), /* @__PURE__ */ React12.createElement(Popover.Portal, null, /* @__PURE__ */ React12.createElement(Popover.Content, {
1025
- side: "bottom"
1026
- }, /* @__PURE__ */ React12.createElement(Popover.Arrow, null), /* @__PURE__ */ React12.createElement(Popover.Viewport, {
1027
- classNames: "max-bs-56"
1028
- }, /* @__PURE__ */ React12.createElement(List2, null, members.map((member) => /* @__PURE__ */ React12.createElement(ListItem2.Root, {
1029
- key: member.identity.identityKey.toHex(),
1030
- classNames: "flex gap-2 items-center cursor-pointer mbe-2",
1031
- onClick: () => onMemberClick?.(member),
1032
- "data-testid": "identity-list-item"
1033
- }, /* @__PURE__ */ React12.createElement(PresenceAvatar, {
1034
- identity: member.identity,
1035
- size,
1036
- showName: true,
1037
- match: member.currentlyAttended
1038
- })))))))));
1039
- };
1040
- var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match: match2, index, onClick, size }, forwardedRef) => {
1041
- const status = match2 ? "current" : "active";
1042
- const fallbackValue = keyToFallback(identity.identityKey);
1043
- return /* @__PURE__ */ React12.createElement(Avatar.Root, null, /* @__PURE__ */ React12.createElement(Avatar.Content, {
1044
- status,
1045
- hue: identity.profile?.data?.hue || fallbackValue.hue,
1046
- "data-testid": "spacePlugin.presence.member",
1047
- "data-status": status,
1048
- size,
1049
- ...index ? {
1050
- style: {
1051
- zIndex: index
1052
- }
1053
- } : {},
1054
- onClick,
1055
- fallback: identity.profile?.data?.emoji || fallbackValue.emoji,
1056
- ref: forwardedRef
1057
- }), /* @__PURE__ */ React12.createElement(Avatar.Label, {
1058
- classNames: showName ? "text-sm truncate pli-2" : "sr-only"
1059
- }, getName(identity)));
1060
- });
1061
- var SmallPresenceLive = ({ id, open, viewers }) => {
1062
- const { hasAttention, isAncestor, isRelated } = useAttention(id);
1063
- const isAttended = hasAttention || isAncestor || isRelated;
1064
- const { graph } = useAppGraph2();
1065
- const attended = useAttended();
1066
- const startOfAttention = attended.at(-1);
1067
- const path = usePath(graph, startOfAttention);
1068
- const containsAttended = !open && !isAttended && id && Option2.isSome(path) ? path.value.includes(id) : false;
1069
- const getActiveViewers = (viewers2) => {
1070
- const moment = Date.now();
1071
- return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
1072
- };
1073
- const [activeViewers, setActiveViewers] = useState6(viewers ? getActiveViewers(viewers) : []);
1074
- useEffect3(() => {
1075
- if (viewers) {
1076
- setActiveViewers(getActiveViewers(viewers));
1077
- const interval = setInterval(() => {
1078
- setActiveViewers(getActiveViewers(viewers));
1079
- }, REFRESH_INTERVAL);
1080
- return () => clearInterval(interval);
1081
- }
1082
- }, [
1083
- viewers
1084
- ]);
1085
- return /* @__PURE__ */ React12.createElement(SmallPresence, {
1086
- count: activeViewers.length,
1087
- attended: isAttended,
1088
- containsAttended
1089
- });
1090
- };
1091
- var SmallPresence = ({ count = 0, attended, containsAttended }) => {
1092
- const { t } = useTranslation12(meta.id);
1093
- return /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
1094
- asChild: true,
1095
- content: t("presence label", {
1096
- count
1097
- }),
1098
- side: "bottom"
1099
- }, /* @__PURE__ */ React12.createElement(AttentionGlyph, {
1100
- attended,
1101
- containsAttended,
1102
- presence: count > 1 ? "many" : count === 1 ? "one" : "none",
1103
- classNames: "self-center mie-1"
1104
- }));
1105
- };
1106
-
1107
- // src/components/SpaceRenamePopover/SpaceRenamePopover.tsx
1108
- import React13, { useCallback as useCallback9, useRef as useRef4, useState as useState7 } from "react";
1109
- import { useOperationInvoker as useOperationInvoker8 } from "@dxos/app-framework/ui";
1110
- import { LayoutOperation as LayoutOperation6 } from "@dxos/app-toolkit";
1111
- import { Obj as Obj7 } from "@dxos/echo";
1112
- import { Button as Button4, Input as Input4, Popover as Popover2, useTranslation as useTranslation13 } from "@dxos/react-ui";
1113
- import { osTranslations as osTranslations4 } from "@dxos/ui-theme";
1114
- var SPACE_RENAME_POPOVER = `${meta.id}/SpaceRenamePopover`;
1115
- var SpaceRenamePopover = ({ space }) => {
1116
- const { t } = useTranslation13(meta.id);
1117
- const doneButton = useRef4(null);
1118
- const [name, setName] = useState7(space.properties.name ?? "");
1119
- const { invokePromise } = useOperationInvoker8();
1120
- const handleDone = useCallback9(() => {
1121
- Obj7.change(space.properties, (p) => {
1122
- p.name = name;
1123
- });
1124
- void invokePromise(LayoutOperation6.UpdatePopover, {
1125
- anchorId: "",
1126
- state: false
1127
- });
1128
- }, [
1129
- space,
1130
- name,
1131
- invokePromise
1132
- ]);
1133
- return /* @__PURE__ */ React13.createElement("div", {
1134
- role: "none",
1135
- className: "p-2 flex gap-2"
1136
- }, /* @__PURE__ */ React13.createElement("div", {
1137
- role: "none",
1138
- className: "flex-1"
1139
- }, /* @__PURE__ */ React13.createElement(Input4.Root, null, /* @__PURE__ */ React13.createElement(Input4.Label, {
1140
- srOnly: true
1141
- }, t("space name label")), /* @__PURE__ */ React13.createElement(Input4.TextInput, {
1142
- defaultValue: space.properties.name ?? "",
1143
- placeholder: t("unnamed space label"),
1144
- onChange: ({ target: { value: value2 } }) => setName(value2),
1145
- // TODO(wittjosiah): Ideally this should access the popover context to close the popover.
1146
- // Currently this is not possible because Radix does not expose the popover context.
1147
- onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
1148
- }))), /* @__PURE__ */ React13.createElement(Popover2.Close, {
1149
- asChild: true
1150
- }, /* @__PURE__ */ React13.createElement(Button4, {
1151
- ref: doneButton,
1152
- classNames: "self-stretch",
1153
- onClick: handleDone
1154
- }, t("done label", {
1155
- ns: osTranslations4
1156
- }))));
1157
- };
1158
-
1159
- // src/components/SpaceSettings/SpaceSettingsContainer.tsx
1160
- import * as Schema from "effect/Schema";
1161
- import React14, { useCallback as useCallback10, useMemo as useMemo4, useState as useState8 } from "react";
1162
- import { useCapabilities, useOperationInvoker as useOperationInvoker9 } from "@dxos/app-framework/ui";
1163
- import { LayoutOperation as LayoutOperation7 } from "@dxos/app-toolkit";
1164
- import { Obj as Obj8 } from "@dxos/echo";
1165
- import { log as log3 } from "@dxos/log";
1166
- import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
1167
- import { useClient as useClient6 } from "@dxos/react-client";
1168
- import { SpaceState } from "@dxos/react-client/echo";
1169
- import { Button as Button5, Input as Input5, useFileDownload, useMulticastObservable, useTranslation as useTranslation14 } from "@dxos/react-ui";
1170
- import { Form as Form3, Settings as Settings4 } from "@dxos/react-ui-form";
1171
- import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
1172
- var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx";
1173
- var SpaceFormSchema = SpaceForm.pipe(Schema.extend(Schema.Struct({
1174
- archived: Schema.Boolean.annotations({
1175
- title: "Archive Space"
1176
- })
1177
- })));
1178
- var SpaceSettingsContainer = ({ space }) => {
1179
- const { t } = useTranslation14(meta.id);
1180
- const { invokePromise } = useOperationInvoker9();
1181
- const client = useClient6();
1182
- const archived = useMulticastObservable(space.state) === SpaceState.SPACE_INACTIVE;
1183
- const [edgeReplication, setEdgeReplication] = useState8(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
1184
- const toggleEdgeReplication = useCallback10(async (next) => {
1185
- setEdgeReplication(next);
1186
- await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
1187
- log3.catch(err, void 0, {
1188
- F: __dxlog_file4,
1189
- L: 49,
1190
- S: void 0,
1191
- C: (f, a) => f(...a)
1192
- });
1193
- setEdgeReplication(!next);
1194
- });
1195
- }, [
1196
- space
1197
- ]);
1198
- const handleValuesChanged = useCallback10((newValues, meta2) => {
1199
- const changed = meta2.changed ?? {};
1200
- if (changed["edgeReplication"]) {
1201
- void toggleEdgeReplication(newValues.edgeReplication ?? false);
1202
- }
1203
- if (changed["name"] || changed["icon"] || changed["hue"]) {
1204
- Obj8.change(space.properties, (p) => {
1205
- if (changed["name"] && newValues.name !== void 0) {
1206
- p.name = newValues.name;
1207
- }
1208
- if (changed["icon"]) {
1209
- p.icon = newValues.icon;
1210
- }
1211
- if (changed["hue"]) {
1212
- p.hue = newValues.hue;
1213
- }
1214
- });
1215
- }
1216
- if (changed["archived"]) {
1217
- if (newValues.archived && !archived) {
1218
- void invokePromise(SpaceOperation.Close, {
1219
- space
1220
- });
1221
- void invokePromise(LayoutOperation7.SwitchWorkspace, {
1222
- subject: client.spaces.default.id
1223
- });
1224
- } else if (!newValues.archived && archived) {
1225
- void invokePromise(SpaceOperation.Open, {
1226
- space
1227
- });
1228
- }
1229
- }
1230
- }, [
1231
- space,
1232
- client,
1233
- archived,
1234
- invokePromise,
1235
- toggleEdgeReplication
1236
- ]);
1237
- const values = useMemo4(() => ({
1238
- name: space.properties.name,
1239
- icon: space.properties.icon,
1240
- hue: space.properties.hue,
1241
- edgeReplication,
1242
- archived
1243
- }), [
1244
- space.properties.name,
1245
- space.properties.icon,
1246
- space.properties.hue,
1247
- edgeReplication,
1248
- archived
1249
- ]);
1250
- const fieldMap = useMemo4(() => ({
1251
- name: ({ type, label, getValue, onValueChange }) => {
1252
- const handleChange = useCallback10(({ target: { value: value2 } }) => onValueChange(type, value2), [
1253
- onValueChange,
1254
- type
1255
- ]);
1256
- return /* @__PURE__ */ React14.createElement(Settings4.ItemInput, {
1257
- title: label,
1258
- description: t("display name description")
1259
- }, /* @__PURE__ */ React14.createElement(Input5.TextInput, {
1260
- value: getValue(),
1261
- onChange: handleChange,
1262
- placeholder: t("display name input placeholder"),
1263
- classNames: "min-is-64"
1264
- }));
1265
- },
1266
- icon: ({ type, label, getValue, onValueChange }) => {
1267
- const handleChange = useCallback10((icon) => onValueChange(type, icon), [
1268
- onValueChange,
1269
- type
1270
- ]);
1271
- const handleReset = useCallback10(() => onValueChange(type, void 0), [
1272
- onValueChange,
1273
- type
1274
- ]);
1275
- return /* @__PURE__ */ React14.createElement(Settings4.Item, {
1276
- title: label,
1277
- description: t("icon description")
1278
- }, /* @__PURE__ */ React14.createElement(IconPicker, {
1279
- value: getValue(),
1280
- onChange: handleChange,
1281
- onReset: handleReset,
1282
- classNames: "justify-self-end"
1283
- }));
1284
- },
1285
- hue: ({ type, label, getValue, onValueChange }) => {
1286
- const handleChange = useCallback10((nextHue) => onValueChange(type, nextHue), [
1287
- onValueChange,
1288
- type
1289
- ]);
1290
- const handleReset = useCallback10(() => onValueChange(type, void 0), [
1291
- onValueChange,
1292
- type
1293
- ]);
1294
- return /* @__PURE__ */ React14.createElement(Settings4.Item, {
1295
- title: label,
1296
- description: t("hue description")
1297
- }, /* @__PURE__ */ React14.createElement(HuePicker, {
1298
- value: getValue(),
1299
- onChange: handleChange,
1300
- onReset: handleReset,
1301
- classNames: "justify-self-end"
1302
- }));
1303
- },
1304
- edgeReplication: ({ type, label, getValue, onValueChange }) => {
1305
- const handleChange = useCallback10((checked) => onValueChange(type, checked), [
1306
- onValueChange,
1307
- type
1308
- ]);
1309
- return /* @__PURE__ */ React14.createElement(Settings4.ItemInput, {
1310
- title: label,
1311
- description: t("edge replication description")
1312
- }, /* @__PURE__ */ React14.createElement(Input5.Switch, {
1313
- checked: getValue(),
1314
- onCheckedChange: handleChange,
1315
- classNames: "justify-self-end"
1316
- }));
1317
- },
1318
- archived: ({ type, label, getValue, onValueChange }) => {
1319
- const handleChange = useCallback10(() => onValueChange(type, !getValue()), [
1320
- onValueChange,
1321
- type,
1322
- getValue
1323
- ]);
1324
- return /* @__PURE__ */ React14.createElement(Settings4.ItemInput, {
1325
- title: label,
1326
- description: t("archive space description")
1327
- }, /* @__PURE__ */ React14.createElement(Button5, {
1328
- disabled: space === client.spaces.default,
1329
- variant: getValue() ? "default" : "destructive",
1330
- onClick: handleChange
1331
- }, getValue() ? t("unarchive space label") : t("archive space label")));
1332
- }
1333
- }), [
1334
- t,
1335
- space,
1336
- client
1337
- ]);
1338
- const download = useFileDownload();
1339
- const handleBackup = useCallback10(async () => {
1340
- const archive = await space.internal.export();
1341
- download(new Blob([
1342
- archive.contents
1343
- ]), archive.filename);
1344
- }, [
1345
- space,
1346
- download
1347
- ]);
1348
- const repairs = useCapabilities(SpaceCapabilities.Repair);
1349
- const handleRepair = useCallback10(async () => {
1350
- await Promise.all(repairs.map((repair) => repair({
1351
- space,
1352
- isDefault: client.spaces.default === space
1353
- })));
1354
- }, [
1355
- client,
1356
- space,
1357
- repairs
1358
- ]);
1359
- return /* @__PURE__ */ React14.createElement(Settings4.Root, null, /* @__PURE__ */ React14.createElement(Settings4.Section, {
1360
- title: t("space properties settings verbose label"),
1361
- description: t("space properties settings description", {
1362
- ns: meta.id
1363
- })
1364
- }, /* @__PURE__ */ React14.createElement(Form3.Root, {
1365
- fieldMap,
1366
- schema: SpaceFormSchema,
1367
- values,
1368
- onValuesChanged: handleValuesChanged
1369
- }, /* @__PURE__ */ React14.createElement(Form3.FieldSet, {
1370
- classNames: "space-y-trimMd"
1371
- }))), /* @__PURE__ */ React14.createElement(Settings4.Section, {
1372
- title: t("space controls title"),
1373
- description: t("space controls description")
1374
- }, /* @__PURE__ */ React14.createElement(Settings4.ItemInput, {
1375
- title: t("backup space title"),
1376
- description: t("backup space description")
1377
- }, /* @__PURE__ */ React14.createElement(Button5, {
1378
- onClick: handleBackup
1379
- }, t("download backup label"))), /* @__PURE__ */ React14.createElement(Settings4.ItemInput, {
1380
- title: t("repair space title"),
1381
- description: t("repair space description")
1382
- }, /* @__PURE__ */ React14.createElement(Button5, {
1383
- onClick: handleRepair
1384
- }, t("repair space label")))));
1385
- };
1386
- SpaceSettingsContainer.displayName = "SpaceSettingsContainer";
1387
-
1388
- // src/components/SyncStatus/InlineSyncStatus.tsx
1389
- import * as Option3 from "effect/Option";
1390
- import React15, { useEffect as useEffect4, useState as useState9 } from "react";
1391
- import { useAppGraph as useAppGraph3 } from "@dxos/app-toolkit/ui";
1392
- import { EdgeStatus } from "@dxos/protocols/proto/dxos/client/services";
1393
- import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
1394
- import { useClient as useClient7 } from "@dxos/react-client";
1395
- import { useSpaceSyncState } from "@dxos/react-client/echo";
1396
- import { Tooltip as Tooltip2, useTranslation as useTranslation15 } from "@dxos/react-ui";
1397
- import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
1398
- var useEdgeStatus = () => {
1399
- const [status, setStatus] = useState9(EdgeStatus.ConnectionState.NOT_CONNECTED);
1400
- const client = useClient7();
1401
- useEffect4(() => {
1402
- client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
1403
- setStatus(status2.state);
1404
- });
1405
- }, [
1406
- client
1407
- ]);
1408
- return status;
1409
- };
1410
- var InlineSyncStatus = ({ space, open }) => {
1411
- const { t } = useTranslation15(meta.id);
1412
- const id = space.id;
1413
- const { hasAttention, isAncestor, isRelated } = useAttention2(id);
1414
- const isAttended = hasAttention || isAncestor || isRelated;
1415
- const { graph } = useAppGraph3();
1416
- const attended = useAttended2();
1417
- const startOfAttention = attended.at(-1);
1418
- const path = usePath(graph, startOfAttention);
1419
- const containsAttended = !open && !isAttended && id && Option3.isSome(path) ? path.value.includes(id) : false;
1420
- const connectedToEdge = useEdgeStatus() === EdgeStatus.ConnectionState.CONNECTED;
1421
- const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
1422
- const syncState = useSpaceSyncState(space);
1423
- const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
1424
- return /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
1425
- asChild: true,
1426
- content: t("syncing label"),
1427
- side: "bottom"
1428
- }, /* @__PURE__ */ React15.createElement(AttentionGlyph2, {
1429
- syncing,
1430
- attended: isAttended,
1431
- containsAttended,
1432
- classNames: "self-center mie-1"
1433
- }));
1434
- };
1435
-
1436
- // src/components/SyncStatus/SyncStatus.tsx
1437
- import React16, { useEffect as useEffect5, useState as useState10 } from "react";
1438
- import { StatusBar } from "@dxos/plugin-status-bar";
1439
- import { EdgeStatus as EdgeStatus2 } from "@dxos/protocols/proto/dxos/client/services";
1440
- import { useClient as useClient8 } from "@dxos/react-client";
1441
- import { useStream } from "@dxos/react-client/devtools";
1442
- import { getSyncSummary, useSyncState } from "@dxos/react-client/echo";
1443
- import { Icon as Icon4, Popover as Popover3, useTranslation as useTranslation16 } from "@dxos/react-ui";
1444
- import { mx as mx2 } from "@dxos/ui-theme";
1445
- import { Unit } from "@dxos/util";
1446
-
1447
- // src/components/SyncStatus/save-tracker.ts
1448
- import { Context } from "@dxos/context";
1449
- var __dxlog_file5 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
1450
- var createClientSaveTracker = (client, cb) => {
1451
- const CleanupFns = {};
1452
- const state = {};
1453
- const install = (spaces) => {
1454
- for (const space of spaces) {
1455
- if (state[space.id]) {
1456
- continue;
1457
- }
1458
- state[space.id] = "saved";
1459
- CleanupFns[space.id] = createSpaceSaveTracker(space, (s) => {
1460
- state[space.id] = s;
1461
- cb(Object.values(state).some((s2) => s2 === "saving") ? "saving" : "saved");
1462
- });
1463
- }
1464
- };
1465
- client.spaces.subscribe((spaces) => {
1466
- install(spaces);
1467
- });
1468
- install(client.spaces.get());
1469
- return () => {
1470
- for (const unsubscribe of Object.values(CleanupFns)) {
1471
- unsubscribe();
1472
- }
1473
- };
1474
- };
1475
- var createSpaceSaveTracker = (space, cb) => {
1476
- const ctx = new Context(void 0, {
1477
- F: __dxlog_file5,
1478
- L: 40
1479
- });
1480
- void space.waitUntilReady().then(() => {
1481
- if (ctx.disposed) {
1482
- return;
1483
- }
1484
- let hasUnsavedChanges = false;
1485
- let lastFlushPromise;
1486
- space.internal.db.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
1487
- hasUnsavedChanges = unsavedDocuments.length > 0;
1488
- });
1489
- space.internal.db.saveStateChanged.debounce(500).on(ctx, () => {
1490
- if (hasUnsavedChanges) {
1491
- lastFlushPromise = void 0;
1492
- cb("saving");
1493
- } else {
1494
- const flushPromise = space.db.flush();
1495
- lastFlushPromise = flushPromise;
1496
- void flushPromise.then(() => {
1497
- if (lastFlushPromise === flushPromise) {
1498
- cb("saved");
1499
- }
1500
- });
1501
- }
1502
- });
1503
- });
1504
- return () => {
1505
- void ctx.dispose();
1506
- };
1507
- };
1508
-
1509
- // src/components/SyncStatus/status.ts
1510
- var getStatus = ({ offline, saved, needsToUpload, needsToDownload }) => {
1511
- if (!saved) {
1512
- return "saving locally";
1513
- } else if (!offline && needsToDownload) {
1514
- return "downloading";
1515
- } else if (!offline && needsToUpload) {
1516
- return "uploading";
1517
- } else if (offline && !needsToUpload && !needsToDownload) {
1518
- return "offline persisted";
1519
- } else {
1520
- return "remote synced";
1521
- }
1522
- };
1523
- var getIcon = (status) => {
1524
- switch (status) {
1525
- case "saving locally":
1526
- return "ph--download--regular";
1527
- case "downloading":
1528
- return "ph--cloud-arrow-down--regular";
1529
- case "uploading":
1530
- return "ph--cloud-arrow-up--regular";
1531
- case "offline persisted":
1532
- return "ph--check-circle--regular";
1533
- case "remote synced":
1534
- return "ph--cloud-check--regular";
1535
- }
1536
- };
1537
-
1538
- // src/components/SyncStatus/SyncStatus.tsx
1539
- var SYNC_STALLED_TIMEOUT = 5e3;
1540
- var SyncStatus = () => {
1541
- const client = useClient8();
1542
- const state = useSyncState();
1543
- const [saved, setSaved] = useState10(true);
1544
- useEffect5(() => createClientSaveTracker(client, (state2) => setSaved(state2 === "saved")), []);
1545
- return /* @__PURE__ */ React16.createElement(SyncStatusIndicator, {
1546
- state,
1547
- saved
1548
- });
1549
- };
1550
- var SyncStatusIndicator = ({ state, saved }) => {
1551
- const { t } = useTranslation16(meta.id);
1552
- const summary = getSyncSummary(state);
1553
- const offline = Object.values(state).length === 0;
1554
- const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
1555
- const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
1556
- const status = getStatus({
1557
- offline,
1558
- saved,
1559
- needsToUpload,
1560
- needsToDownload
1561
- });
1562
- const [classNames, setClassNames] = useState10();
1563
- useEffect5(() => {
1564
- setClassNames(void 0);
1565
- if (offline || !needsToUpload && !needsToDownload) {
1566
- return;
1567
- }
1568
- const t2 = setTimeout(() => {
1569
- setClassNames("text-orange-500");
1570
- }, SYNC_STALLED_TIMEOUT);
1571
- return () => clearTimeout(t2);
1572
- }, [
1573
- offline,
1574
- needsToUpload,
1575
- needsToDownload
1576
- ]);
1577
- const title = t(`${status} label`);
1578
- const icon = /* @__PURE__ */ React16.createElement(Icon4, {
1579
- icon: getIcon(status),
1580
- classNames
1581
- });
1582
- return /* @__PURE__ */ React16.createElement(Popover3.Root, null, /* @__PURE__ */ React16.createElement(Popover3.Trigger, {
1583
- asChild: true
1584
- }, /* @__PURE__ */ React16.createElement(StatusBar.Item, {
1585
- title
1586
- }, icon)), /* @__PURE__ */ React16.createElement(Popover3.Portal, null, /* @__PURE__ */ React16.createElement(Popover3.Content, null, /* @__PURE__ */ React16.createElement(EdgeConnectionPopover, null), /* @__PURE__ */ React16.createElement(Popover3.Arrow, null))));
1587
- };
1588
- var useEdgeStatus2 = () => {
1589
- const client = useClient8();
1590
- const { status } = useStream(() => client.services.services.EdgeAgentService.queryEdgeStatus(), {});
1591
- return status;
1592
- };
1593
- var EdgeConnectionPopover = () => {
1594
- const status = useEdgeStatus2();
1595
- const { t } = useTranslation16(meta.id);
1596
- const isConnected = status?.state === EdgeStatus2.ConnectionState.CONNECTED;
1597
- return /* @__PURE__ */ React16.createElement("div", {
1598
- className: "min-is-[240px] p-2"
1599
- }, /* @__PURE__ */ React16.createElement("div", {
1600
- className: "flex items-center gap-2 mbe-2"
1601
- }, /* @__PURE__ */ React16.createElement(Icon4, {
1602
- icon: isConnected ? "ph--check-circle--regular" : "ph--warning-circle--regular",
1603
- classNames: mx2(isConnected ? "text-successText" : "text-errorText animate-pulse")
1604
- }), /* @__PURE__ */ React16.createElement("span", {
1605
- className: "font-medium text-sm"
1606
- }, isConnected ? t("sync edge connected label") : t("sync edge disconnected label"))), status?.state === EdgeStatus2.ConnectionState.NOT_CONNECTED && /* @__PURE__ */ React16.createElement("div", {
1607
- className: "flex items-center gap-2 text-sm text-description"
1608
- }, /* @__PURE__ */ React16.createElement(Icon4, {
1609
- icon: "ph--cloud-x--regular"
1610
- }), /* @__PURE__ */ React16.createElement("span", null, t("sync no connection label"))), status?.state === EdgeStatus2.ConnectionState.CONNECTED && /* @__PURE__ */ React16.createElement("div", {
1611
- className: "space-y-2"
1612
- }, /* @__PURE__ */ React16.createElement("div", {
1613
- className: "flex items-center justify-between text-sm"
1614
- }, /* @__PURE__ */ React16.createElement("div", {
1615
- className: "flex items-center gap-2 text-description"
1616
- }, /* @__PURE__ */ React16.createElement(Icon4, {
1617
- icon: "ph--timer--regular"
1618
- }), /* @__PURE__ */ React16.createElement("span", null, t("sync latency label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
1619
- value: status.rtt,
1620
- format: Unit.Millisecond
1621
- })), /* @__PURE__ */ React16.createElement("div", {
1622
- className: "flex items-center justify-between text-sm"
1623
- }, /* @__PURE__ */ React16.createElement("div", {
1624
- className: "flex items-center gap-2 text-description"
1625
- }, /* @__PURE__ */ React16.createElement(Icon4, {
1626
- icon: "ph--arrow-up--regular"
1627
- }), /* @__PURE__ */ React16.createElement("span", null, t("sync upload label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
1628
- value: status.rateBytesUp,
1629
- format: Unit.Kilobyte,
1630
- suffix: "/s"
1631
- })), /* @__PURE__ */ React16.createElement("div", {
1632
- className: "flex items-center justify-between text-sm"
1633
- }, /* @__PURE__ */ React16.createElement("div", {
1634
- className: "flex items-center gap-2 text-sm text-description"
1635
- }, /* @__PURE__ */ React16.createElement(Icon4, {
1636
- icon: "ph--arrow-down--regular"
1637
- }), /* @__PURE__ */ React16.createElement("span", null, t("sync download label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
1638
- value: status.rateBytesDown,
1639
- format: Unit.Kilobyte,
1640
- suffix: "/s"
1641
- }))));
1642
- };
1643
- var UnitValue = ({ value: input, format, suffix }) => {
1644
- const { formattedValue, unit } = format(input);
1645
- return /* @__PURE__ */ React16.createElement("span", {
1646
- className: "font-mono"
1647
- }, formattedValue, /* @__PURE__ */ React16.createElement("span", {
1648
- className: "mis-1 text-subdued"
1649
- }, unit.symbol, suffix));
1650
- };
1651
-
1652
- // src/helpers/query.ts
1653
- import * as Array2 from "effect/Array";
1654
- import * as Effect3 from "effect/Effect";
1655
- import * as EffectFunction from "effect/Function";
1656
- import * as Match from "effect/Match";
1657
- import * as Option4 from "effect/Option";
1658
- import * as SchemaAST from "effect/SchemaAST";
1659
- import { DXN, Filter as Filter2, Query } from "@dxos/echo";
1660
- import { ReferenceAnnotationId, getTypeAnnotation as getTypeAnnotation3, unwrapOptional } from "@dxos/echo/internal";
1661
- import { runAndForwardErrors as runAndForwardErrors3 } from "@dxos/effect";
1662
- import { log as log4 } from "@dxos/log";
1663
- import { Person } from "@dxos/types";
1664
- var __dxlog_file6 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/helpers/query.ts";
1665
- var evalQuery = (queryString) => {
1666
- const globals = {
1667
- Query,
1668
- Filter: Filter2,
1669
- Person
1670
- };
1671
- try {
1672
- return new Function(...Object.keys(globals), `return ${queryString}`)(...Object.values(globals));
1673
- } catch (err) {
1674
- log4.catch(err, void 0, {
1675
- F: __dxlog_file6,
1676
- L: 33,
1677
- S: void 0,
1678
- C: (f, a) => f(...a)
1679
- });
1680
- return Query.select(Filter2.nothing());
1681
- }
1682
- };
1683
- var resolveSchemaWithRegistry = (registry, query) => {
1684
- const resolve = Effect3.fn(function* (dxn) {
1685
- const typename = DXN.parse(dxn).asTypeDXN()?.type;
1686
- if (!typename) {
1687
- return Option4.none();
1688
- }
1689
- const query2 = registry.query({
1690
- typename,
1691
- location: [
1692
- "database",
1693
- "runtime"
1694
- ]
1695
- });
1696
- const schemas = yield* Effect3.promise(() => query2.run());
1697
- return Array2.head(schemas);
1698
- });
1699
- return resolveSchema(query, resolve).pipe(Effect3.map((schema) => Option4.getOrUndefined(schema)), runAndForwardErrors3);
1700
- };
1701
- var resolveSchema = (query, resolve) => {
1702
- return Match.value(query).pipe(
1703
- Match.withReturnType(),
1704
- // TODO(wittjosiah): Reconcile with filter match?
1705
- Match.when({
1706
- type: "select"
1707
- }, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
1708
- Match.when({
1709
- type: "filter"
1710
- }, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
1711
- Match.when({
1712
- type: "reference-traversal"
1713
- }, ({ anchor, property }) => resolveSchema(anchor, resolve).pipe(Effect3.map((base) => base.pipe(Option4.map((schema) => SchemaAST.getPropertySignatures(schema.ast)), Option4.flatMap((properties) => Array2.findFirst(properties, (p) => p.name === property)), Option4.flatMap((property2) => SchemaAST.getAnnotation(ReferenceAnnotationId)(unwrapOptional(property2))), Option4.map((annotation) => annotation.typename))), Effect3.flatMap(Option4.match({
1714
- onNone: () => Effect3.succeed(Option4.none()),
1715
- onSome: (typename) => resolve(DXN.fromTypename(typename).toString())
1716
- })))),
1717
- Match.when({
1718
- type: "relation",
1719
- filter: Match.defined
1720
- }, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
1721
- Match.when({
1722
- type: "relation-traversal"
1723
- }, ({ anchor, direction }) => resolveSchema(anchor, resolve).pipe(Effect3.map((base) => base.pipe(Option4.map((schema) => getTypeAnnotation3(schema)), Option4.flatMap((annotation) => Option4.fromNullable(direction === "source" ? annotation?.sourceSchema : annotation?.targetSchema)))), Effect3.flatMap(Option4.match({
1724
- onNone: () => Effect3.succeed(Option4.none()),
1725
- onSome: (typename) => resolve(typename)
1726
- })))),
1727
- Match.when({
1728
- type: "options"
1729
- }, ({ query: query2 }) => resolveSchema(query2, resolve)),
1730
- Match.orElse((_q) => {
1731
- return Effect3.succeed(Option4.none());
1732
- })
1733
- );
1734
- };
1735
- var typenameFromFilter = (filter) => Match.value(filter).pipe(Match.withReturnType(), Match.when({
1736
- type: "object"
1737
- }, ({ typename }) => Option4.fromNullable(typename)), Match.when({
1738
- type: "and"
1739
- }, ({ filters }) => EffectFunction.pipe(filters, Array2.map(typenameFromFilter), Array2.findFirst(Option4.isSome), Option4.flatten)), Match.when({
1740
- type: "or"
1741
- }, ({ filters }) => EffectFunction.pipe(filters, Array2.map(typenameFromFilter), Array2.findFirst(Option4.isSome), Option4.flatten)), Match.orElse(() => Option4.none()));
1742
- var getQueryTarget = (query, space) => {
1743
- return Match.value(query).pipe(Match.when({
1744
- type: "options"
1745
- }, ({ options }) => {
1746
- return Option4.fromNullable(options.queues).pipe(Option4.flatMap((queues) => Array2.head(queues)), Option4.flatMap((queueDxn) => Option4.fromNullable(DXN.tryParse(queueDxn))), Option4.flatMap((queueDxn) => Option4.fromNullable(space?.queues.get(queueDxn))), Option4.getOrElse(() => space?.db));
1747
- }), Match.orElse(() => space?.db));
1748
- };
1749
-
1750
- // src/components/ViewEditor.tsx
1751
- import * as Schema2 from "effect/Schema";
1752
- import React17, { useCallback as useCallback11, useState as useState11 } from "react";
1753
- import { useOperationInvoker as useOperationInvoker10 } from "@dxos/app-framework/ui";
1754
- import { DXN as DXN2, Filter as Filter3, Obj as Obj9, Query as Query2, Tag, Type as Type2 } from "@dxos/echo";
1755
- import { useClient as useClient9 } from "@dxos/react-client";
1756
- import { getSpace as getSpace2, useQuery as useQuery2 } from "@dxos/react-client/echo";
1757
- import { useAsyncEffect } from "@dxos/react-ui";
1758
- import { ViewEditor as NaturalViewEditor } from "@dxos/react-ui-form";
1759
- import { View } from "@dxos/schema";
1760
- var ViewEditor = ({ view }) => {
1761
- const { invokePromise } = useOperationInvoker10();
1762
- const client = useClient9();
1763
- const space = getSpace2(view);
1764
- const [schema, setSchema] = useState11(() => Schema2.Struct({}));
1765
- const tags = useQuery2(space?.db, Filter3.type(Tag.Tag));
1766
- const types = useTypeOptions({
1767
- space,
1768
- annotation: {
1769
- location: [
1770
- "database",
1771
- "runtime"
1772
- ],
1773
- kind: [
1774
- "user"
1775
- ],
1776
- registered: [
1777
- "registered"
1778
- ]
1779
- }
1780
- });
1781
- useAsyncEffect(async () => {
1782
- if (!view?.query || !space) {
1783
- return;
1784
- }
1785
- const foundSchema = await resolveSchemaWithRegistry(space.db.schemaRegistry, view.query.ast);
1786
- if (foundSchema && foundSchema !== schema) {
1787
- setSchema(() => foundSchema);
1788
- }
1789
- }, [
1790
- client,
1791
- space,
1792
- view,
1793
- schema
1794
- ]);
1795
- const handleQueryChanged = useCallback11(async (newQuery, target) => {
1796
- if (!view || !space) {
1797
- return;
1798
- }
1799
- const queue = target && DXN2.tryParse(target) ? target : void 0;
1800
- const query = queue ? Query2.fromAst(newQuery).options({
1801
- queues: [
1802
- queue
1803
- ]
1804
- }) : Query2.fromAst(newQuery);
1805
- Obj9.change(view, (v) => {
1806
- v.query.ast = query.ast;
1807
- });
1808
- const newSchema = await resolveSchemaWithRegistry(space.db.schemaRegistry, query.ast);
1809
- if (!newSchema) {
1810
- return;
1811
- }
1812
- const newView = View.make({
1813
- query,
1814
- jsonSchema: Type2.toJsonSchema(newSchema)
1815
- });
1816
- Obj9.change(view, (v) => {
1817
- v.projection = Obj9.getSnapshot(newView).projection;
1818
- });
1819
- setSchema(() => newSchema);
1820
- }, [
1821
- view,
1822
- schema
1823
- ]);
1824
- const handleDelete = useCallback11((fieldId) => {
1825
- void invokePromise(SpaceOperation.DeleteField, {
1826
- view,
1827
- fieldId
1828
- });
1829
- }, [
1830
- invokePromise,
1831
- view
1832
- ]);
1833
- if (!space || !schema) {
1834
- return null;
1835
- }
1836
- return /* @__PURE__ */ React17.createElement(NaturalViewEditor, {
1837
- registry: space.db.schemaRegistry,
1838
- schema,
1839
- view,
1840
- mode: "tag",
1841
- tags,
1842
- types,
1843
- onQueryChanged: handleQueryChanged,
1844
- onDelete: Type2.isMutable(schema) ? handleDelete : void 0
1845
- });
1846
- };
1847
-
1848
- // src/components/index.ts
1849
- import { lazy } from "react";
1850
- var CollectionArticle = lazy(() => import("./CollectionArticle-KFFKKP37.mjs"));
1851
- var ObjectCardStack = lazy(() => import("./ObjectCardStack-EHXPNRQW.mjs"));
1852
- var ObjectDetails = lazy(() => import("./ObjectDetails-N73UI4ZL.mjs"));
1853
- var RecordArticle = lazy(() => import("./RecordArticle-CMEXNNOZ.mjs"));
1854
-
1855
- export {
1856
- AwaitingObject,
1857
- CREATE_OBJECT_DIALOG,
1858
- CreateObjectDialog,
1859
- CREATE_SPACE_DIALOG,
1860
- CreateSpaceDialog,
1861
- CollectionSection,
1862
- JOIN_DIALOG,
1863
- JoinDialog,
1864
- MembersContainer,
1865
- MenuFooter,
1866
- OBJECT_RENAME_POPOVER,
1867
- ObjectRenamePopover,
1868
- SchemaContainer,
1869
- useQuerySpaceSchemas,
1870
- SpacePluginSettings,
1871
- SpacePresence,
1872
- FullPresence,
1873
- SmallPresenceLive,
1874
- SmallPresence,
1875
- SPACE_RENAME_POPOVER,
1876
- SpaceRenamePopover,
1877
- SpaceSettingsContainer,
1878
- InlineSyncStatus,
1879
- SyncStatus,
1880
- SyncStatusIndicator,
1881
- evalQuery,
1882
- resolveSchemaWithRegistry,
1883
- getQueryTarget,
1884
- ViewEditor,
1885
- CollectionArticle,
1886
- ObjectCardStack,
1887
- ObjectDetails,
1888
- RecordArticle
1889
- };
1890
- //# sourceMappingURL=chunk-2NM62ORP.mjs.map