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