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

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 (665) hide show
  1. package/dist/lib/browser/CollectionArticle-XXLUNK3F.mjs +127 -0
  2. package/dist/lib/browser/CollectionArticle-XXLUNK3F.mjs.map +7 -0
  3. package/dist/lib/browser/ObjectCardStack-CXNBCSMR.mjs +148 -0
  4. package/dist/lib/browser/ObjectCardStack-CXNBCSMR.mjs.map +7 -0
  5. package/dist/lib/browser/ObjectDetails-HXV4IQEM.mjs +143 -0
  6. package/dist/lib/browser/ObjectDetails-HXV4IQEM.mjs.map +7 -0
  7. package/dist/lib/browser/RecordArticle-36LDKFWF.mjs +108 -0
  8. package/dist/lib/browser/RecordArticle-36LDKFWF.mjs.map +7 -0
  9. package/dist/lib/browser/app-graph-builder-GLV46QSI.mjs +530 -0
  10. package/dist/lib/browser/app-graph-builder-GLV46QSI.mjs.map +7 -0
  11. package/dist/lib/browser/app-graph-serializer-VOLRDNVE.mjs +85 -0
  12. package/dist/lib/browser/app-graph-serializer-VOLRDNVE.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-4ZKSFDXM.mjs → chunk-7D63MVRS.mjs} +110 -41
  14. package/dist/lib/browser/chunk-7D63MVRS.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-A7ZCVQGZ.mjs +118 -0
  16. package/dist/lib/browser/chunk-A7ZCVQGZ.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-ASV6DYFH.mjs +19 -0
  18. package/dist/lib/browser/chunk-ASV6DYFH.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-CMLRMQNM.mjs +1889 -0
  20. package/dist/lib/browser/chunk-CMLRMQNM.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-HSMQFM57.mjs +16 -0
  22. package/dist/lib/browser/chunk-HSMQFM57.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-KGLWYGIF.mjs +715 -0
  24. package/dist/lib/browser/chunk-KGLWYGIF.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-NF3ZFAB4.mjs +13 -0
  26. package/dist/lib/browser/chunk-NF3ZFAB4.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-WAOJLA2S.mjs +772 -0
  28. package/dist/lib/browser/chunk-WAOJLA2S.mjs.map +7 -0
  29. package/dist/lib/browser/cli/index.mjs +851 -0
  30. package/dist/lib/browser/cli/index.mjs.map +7 -0
  31. package/dist/lib/browser/identity-created-VCFYLSBB.mjs +23 -0
  32. package/dist/lib/browser/identity-created-VCFYLSBB.mjs.map +7 -0
  33. package/dist/lib/browser/index.mjs +251 -183
  34. package/dist/lib/browser/index.mjs.map +4 -4
  35. package/dist/lib/browser/meta.json +1 -1
  36. package/dist/lib/browser/operation-resolver-PJJ3PCM7.mjs +830 -0
  37. package/dist/lib/browser/operation-resolver-PJJ3PCM7.mjs.map +7 -0
  38. package/dist/lib/browser/react-root-ITWAPZIY.mjs +30 -0
  39. package/dist/lib/browser/react-root-ITWAPZIY.mjs.map +7 -0
  40. package/dist/lib/browser/react-surface-6GD6K4I4.mjs +383 -0
  41. package/dist/lib/browser/react-surface-6GD6K4I4.mjs.map +7 -0
  42. package/dist/lib/browser/repair-DKU4TUD2.mjs +50 -0
  43. package/dist/lib/browser/repair-DKU4TUD2.mjs.map +7 -0
  44. package/dist/lib/browser/settings-M2DMD2ZA.mjs +34 -0
  45. package/dist/lib/browser/settings-M2DMD2ZA.mjs.map +7 -0
  46. package/dist/lib/browser/spaces-ready-XWJUJ43N.mjs +243 -0
  47. package/dist/lib/browser/spaces-ready-XWJUJ43N.mjs.map +7 -0
  48. package/dist/lib/browser/state-V637BLIM.mjs +58 -0
  49. package/dist/lib/browser/state-V637BLIM.mjs.map +7 -0
  50. package/dist/lib/browser/types/index.mjs +18 -10
  51. package/dist/lib/node-esm/CollectionArticle-KFFKKP37.mjs +128 -0
  52. package/dist/lib/node-esm/CollectionArticle-KFFKKP37.mjs.map +7 -0
  53. package/dist/lib/node-esm/ObjectCardStack-EHXPNRQW.mjs +149 -0
  54. package/dist/lib/node-esm/ObjectCardStack-EHXPNRQW.mjs.map +7 -0
  55. package/dist/lib/node-esm/ObjectDetails-N73UI4ZL.mjs +144 -0
  56. package/dist/lib/node-esm/ObjectDetails-N73UI4ZL.mjs.map +7 -0
  57. package/dist/lib/node-esm/RecordArticle-CMEXNNOZ.mjs +109 -0
  58. package/dist/lib/node-esm/RecordArticle-CMEXNNOZ.mjs.map +7 -0
  59. package/dist/lib/node-esm/app-graph-builder-KCEHEKVS.mjs +531 -0
  60. package/dist/lib/node-esm/app-graph-builder-KCEHEKVS.mjs.map +7 -0
  61. package/dist/lib/node-esm/app-graph-serializer-7C4MV5NB.mjs +86 -0
  62. package/dist/lib/node-esm/app-graph-serializer-7C4MV5NB.mjs.map +7 -0
  63. package/dist/lib/node-esm/chunk-2NM62ORP.mjs +1890 -0
  64. package/dist/lib/node-esm/chunk-2NM62ORP.mjs.map +7 -0
  65. package/dist/lib/node-esm/{chunk-JBQKU4K5.mjs → chunk-5N3YIAXD.mjs} +110 -41
  66. package/dist/lib/node-esm/chunk-5N3YIAXD.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-A5A7M37T.mjs +119 -0
  68. package/dist/lib/node-esm/chunk-A5A7M37T.mjs.map +7 -0
  69. package/dist/lib/node-esm/chunk-CVXULIYC.mjs +20 -0
  70. package/dist/lib/node-esm/chunk-CVXULIYC.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-FB5YNROS.mjs +773 -0
  72. package/dist/lib/node-esm/chunk-FB5YNROS.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-NYSDQPNM.mjs +716 -0
  74. package/dist/lib/node-esm/chunk-NYSDQPNM.mjs.map +7 -0
  75. package/dist/lib/node-esm/chunk-PG7DNOEX.mjs +15 -0
  76. package/dist/lib/node-esm/chunk-PG7DNOEX.mjs.map +7 -0
  77. package/dist/lib/node-esm/chunk-SL4BJSUG.mjs +18 -0
  78. package/dist/lib/node-esm/chunk-SL4BJSUG.mjs.map +7 -0
  79. package/dist/lib/node-esm/cli/index.mjs +852 -0
  80. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  81. package/dist/lib/node-esm/identity-created-2SJABVJD.mjs +25 -0
  82. package/dist/lib/node-esm/identity-created-2SJABVJD.mjs.map +7 -0
  83. package/dist/lib/node-esm/index.mjs +251 -183
  84. package/dist/lib/node-esm/index.mjs.map +4 -4
  85. package/dist/lib/node-esm/meta.json +1 -1
  86. package/dist/lib/node-esm/operation-resolver-2K7N4KYC.mjs +831 -0
  87. package/dist/lib/node-esm/operation-resolver-2K7N4KYC.mjs.map +7 -0
  88. package/dist/lib/node-esm/react-root-GIQAKDQ2.mjs +31 -0
  89. package/dist/lib/node-esm/react-root-GIQAKDQ2.mjs.map +7 -0
  90. package/dist/lib/node-esm/react-surface-KWP2DNFG.mjs +384 -0
  91. package/dist/lib/node-esm/react-surface-KWP2DNFG.mjs.map +7 -0
  92. package/dist/lib/node-esm/repair-C2H6JQCL.mjs +51 -0
  93. package/dist/lib/node-esm/repair-C2H6JQCL.mjs.map +7 -0
  94. package/dist/lib/node-esm/settings-VCPCNBOY.mjs +35 -0
  95. package/dist/lib/node-esm/settings-VCPCNBOY.mjs.map +7 -0
  96. package/dist/lib/node-esm/spaces-ready-5JOGEWON.mjs +244 -0
  97. package/dist/lib/node-esm/spaces-ready-5JOGEWON.mjs.map +7 -0
  98. package/dist/lib/node-esm/state-5MCEPWN3.mjs +59 -0
  99. package/dist/lib/node-esm/state-5MCEPWN3.mjs.map +7 -0
  100. package/dist/lib/node-esm/types/index.mjs +18 -10
  101. package/dist/types/src/SpacePlugin.d.ts +3 -15
  102. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  103. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +7 -0
  104. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  106. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +5 -0
  108. package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +3 -0
  110. package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/identity-created/identity-created.d.ts +5 -0
  112. package/dist/types/src/capabilities/identity-created/identity-created.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/identity-created/index.d.ts +3 -0
  114. package/dist/types/src/capabilities/identity-created/index.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/index.d.ts +10 -21
  116. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  117. package/dist/types/src/capabilities/operation-resolver/index.d.ts +6 -0
  118. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +9 -0
  120. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  122. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  124. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
  126. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +8 -0
  128. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  130. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  132. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/settings/index.d.ts +7 -0
  134. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
  136. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  137. package/dist/types/src/capabilities/spaces-ready/index.d.ts +3 -0
  138. package/dist/types/src/capabilities/spaces-ready/index.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts +5 -0
  140. package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts.map +1 -0
  141. package/dist/types/src/capabilities/state/index.d.ts +13 -0
  142. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/state/state.d.ts +17 -0
  144. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  145. package/dist/types/src/cli/commands/database/add.d.ts +17 -0
  146. package/dist/types/src/cli/commands/database/add.d.ts.map +1 -0
  147. package/dist/types/src/cli/commands/database/index.d.ts +3 -0
  148. package/dist/types/src/cli/commands/database/index.d.ts.map +1 -0
  149. package/dist/types/src/cli/commands/database/query/index.d.ts +2 -0
  150. package/dist/types/src/cli/commands/database/query/index.d.ts.map +1 -0
  151. package/dist/types/src/cli/commands/database/query/query.d.ts +13 -0
  152. package/dist/types/src/cli/commands/database/query/query.d.ts.map +1 -0
  153. package/dist/types/src/cli/commands/database/query/query.test.d.ts +2 -0
  154. package/dist/types/src/cli/commands/database/query/query.test.d.ts.map +1 -0
  155. package/dist/types/src/cli/commands/database/remove.d.ts +9 -0
  156. package/dist/types/src/cli/commands/database/remove.d.ts.map +1 -0
  157. package/dist/types/src/cli/commands/database/stats.d.ts +6 -0
  158. package/dist/types/src/cli/commands/database/stats.d.ts.map +1 -0
  159. package/dist/types/src/cli/commands/database/util.d.ts +14 -0
  160. package/dist/types/src/cli/commands/database/util.d.ts.map +1 -0
  161. package/dist/types/src/cli/commands/index.d.ts +4 -0
  162. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  163. package/dist/types/src/cli/commands/queue/index.d.ts +7 -0
  164. package/dist/types/src/cli/commands/queue/index.d.ts.map +1 -0
  165. package/dist/types/src/cli/commands/queue/query.d.ts +8 -0
  166. package/dist/types/src/cli/commands/queue/query.d.ts.map +1 -0
  167. package/dist/types/src/cli/commands/queue/util.d.ts +6 -0
  168. package/dist/types/src/cli/commands/queue/util.d.ts.map +1 -0
  169. package/dist/types/src/cli/commands/space/close/close.d.ts +12 -0
  170. package/dist/types/src/cli/commands/space/close/close.d.ts.map +1 -0
  171. package/dist/types/src/cli/commands/space/close/index.d.ts +2 -0
  172. package/dist/types/src/cli/commands/space/close/index.d.ts.map +1 -0
  173. package/dist/types/src/cli/commands/space/create/create.d.ts +12 -0
  174. package/dist/types/src/cli/commands/space/create/create.d.ts.map +1 -0
  175. package/dist/types/src/cli/commands/space/create/create.test.d.ts +2 -0
  176. package/dist/types/src/cli/commands/space/create/create.test.d.ts.map +1 -0
  177. package/dist/types/src/cli/commands/space/create/index.d.ts +2 -0
  178. package/dist/types/src/cli/commands/space/create/index.d.ts.map +1 -0
  179. package/dist/types/src/cli/commands/space/index.d.ts +31 -0
  180. package/dist/types/src/cli/commands/space/index.d.ts.map +1 -0
  181. package/dist/types/src/cli/commands/space/info/index.d.ts +2 -0
  182. package/dist/types/src/cli/commands/space/info/index.d.ts.map +1 -0
  183. package/dist/types/src/cli/commands/space/info/info.d.ts +13 -0
  184. package/dist/types/src/cli/commands/space/info/info.d.ts.map +1 -0
  185. package/dist/types/src/cli/commands/space/info/info.test.d.ts +2 -0
  186. package/dist/types/src/cli/commands/space/info/info.test.d.ts.map +1 -0
  187. package/dist/types/src/cli/commands/space/join/index.d.ts +2 -0
  188. package/dist/types/src/cli/commands/space/join/index.d.ts.map +1 -0
  189. package/dist/types/src/cli/commands/space/join/join.d.ts +14 -0
  190. package/dist/types/src/cli/commands/space/join/join.d.ts.map +1 -0
  191. package/dist/types/src/cli/commands/space/join/util.d.ts +17 -0
  192. package/dist/types/src/cli/commands/space/join/util.d.ts.map +1 -0
  193. package/dist/types/src/cli/commands/space/list/index.d.ts +2 -0
  194. package/dist/types/src/cli/commands/space/list/index.d.ts.map +1 -0
  195. package/dist/types/src/cli/commands/space/list/list.d.ts +7 -0
  196. package/dist/types/src/cli/commands/space/list/list.d.ts.map +1 -0
  197. package/dist/types/src/cli/commands/space/list/list.test.d.ts +2 -0
  198. package/dist/types/src/cli/commands/space/list/list.test.d.ts.map +1 -0
  199. package/dist/types/src/cli/commands/space/members/index.d.ts +2 -0
  200. package/dist/types/src/cli/commands/space/members/index.d.ts.map +1 -0
  201. package/dist/types/src/cli/commands/space/members/members.d.ts +13 -0
  202. package/dist/types/src/cli/commands/space/members/members.d.ts.map +1 -0
  203. package/dist/types/src/cli/commands/space/members/members.test.d.ts +2 -0
  204. package/dist/types/src/cli/commands/space/members/members.test.d.ts.map +1 -0
  205. package/dist/types/src/cli/commands/space/members/util.d.ts +9 -0
  206. package/dist/types/src/cli/commands/space/members/util.d.ts.map +1 -0
  207. package/dist/types/src/cli/commands/space/open/index.d.ts +2 -0
  208. package/dist/types/src/cli/commands/space/open/index.d.ts.map +1 -0
  209. package/dist/types/src/cli/commands/space/open/open.d.ts +12 -0
  210. package/dist/types/src/cli/commands/space/open/open.d.ts.map +1 -0
  211. package/dist/types/src/cli/commands/space/schema/index.d.ts +8 -0
  212. package/dist/types/src/cli/commands/space/schema/index.d.ts.map +1 -0
  213. package/dist/types/src/cli/commands/space/schema/list/index.d.ts +2 -0
  214. package/dist/types/src/cli/commands/space/schema/list/index.d.ts.map +1 -0
  215. package/dist/types/src/cli/commands/space/schema/list/list.d.ts +15 -0
  216. package/dist/types/src/cli/commands/space/schema/list/list.d.ts.map +1 -0
  217. package/dist/types/src/cli/commands/space/schema/list/list.test.d.ts +2 -0
  218. package/dist/types/src/cli/commands/space/schema/list/list.test.d.ts.map +1 -0
  219. package/dist/types/src/cli/commands/space/schema/list/util.d.ts +15 -0
  220. package/dist/types/src/cli/commands/space/schema/list/util.d.ts.map +1 -0
  221. package/dist/types/src/cli/commands/space/share/index.d.ts +2 -0
  222. package/dist/types/src/cli/commands/space/share/index.d.ts.map +1 -0
  223. package/dist/types/src/cli/commands/space/share/share.d.ts +19 -0
  224. package/dist/types/src/cli/commands/space/share/share.d.ts.map +1 -0
  225. package/dist/types/src/cli/commands/space/sync/index.d.ts +2 -0
  226. package/dist/types/src/cli/commands/space/sync/index.d.ts.map +1 -0
  227. package/dist/types/src/cli/commands/space/sync/sync.d.ts +6 -0
  228. package/dist/types/src/cli/commands/space/sync/sync.d.ts.map +1 -0
  229. package/dist/types/src/cli/commands/space/sync/sync.test.d.ts +2 -0
  230. package/dist/types/src/cli/commands/space/sync/sync.test.d.ts.map +1 -0
  231. package/dist/types/src/cli/index.d.ts +2 -0
  232. package/dist/types/src/cli/index.d.ts.map +1 -0
  233. package/dist/types/src/cli/plugin.d.ts +4 -0
  234. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  235. package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
  236. package/dist/types/src/components/CollectionArticle.d.ts +9 -0
  237. package/dist/types/src/components/CollectionArticle.d.ts.map +1 -0
  238. package/dist/types/src/components/CollectionSection.d.ts +3 -4
  239. package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
  240. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +6 -5
  241. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
  242. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1602 -8
  243. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
  244. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +23 -10
  245. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  246. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
  247. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
  248. package/dist/types/src/components/{JoinDialog.d.ts → JoinDialog/JoinDialog.d.ts} +1 -1
  249. package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +1 -0
  250. package/dist/types/src/components/JoinDialog/index.d.ts +2 -0
  251. package/dist/types/src/components/JoinDialog/index.d.ts.map +1 -0
  252. package/dist/types/src/components/{MembersContainer.d.ts → MembersContainer/MembersContainer.d.ts} +3 -2
  253. package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +1 -0
  254. package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +1600 -0
  255. package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +1 -0
  256. package/dist/types/src/components/MembersContainer/index.d.ts +2 -0
  257. package/dist/types/src/components/MembersContainer/index.d.ts.map +1 -0
  258. package/dist/types/src/components/MenuFooter.d.ts +1 -1
  259. package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
  260. package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts +8 -0
  261. package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts.map +1 -0
  262. package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts +9 -0
  263. package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts.map +1 -0
  264. package/dist/types/src/components/ObjectCardStack/index.d.ts +3 -0
  265. package/dist/types/src/components/ObjectCardStack/index.d.ts.map +1 -0
  266. package/dist/types/src/components/{ObjectSettings → ObjectDetails}/BaseObjectSettings.d.ts +3 -3
  267. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts.map +1 -0
  268. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts +1433 -0
  269. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts.map +1 -0
  270. package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts +8 -0
  271. package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts.map +1 -0
  272. package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts +9 -0
  273. package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts.map +1 -0
  274. package/dist/types/src/components/ObjectDetails/index.d.ts +3 -0
  275. package/dist/types/src/components/ObjectDetails/index.d.ts.map +1 -0
  276. package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts +7 -0
  277. package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -0
  278. package/dist/types/src/components/ObjectRenamePopover/index.d.ts +2 -0
  279. package/dist/types/src/components/ObjectRenamePopover/index.d.ts.map +1 -0
  280. package/dist/types/src/components/RecordArticle.d.ts +5 -0
  281. package/dist/types/src/components/RecordArticle.d.ts.map +1 -0
  282. package/dist/types/src/components/RecordArticle.stories.d.ts +1600 -0
  283. package/dist/types/src/components/RecordArticle.stories.d.ts.map +1 -0
  284. package/dist/types/src/components/SchemaContainer.d.ts +2 -2
  285. package/dist/types/src/components/SchemaContainer.d.ts.map +1 -1
  286. package/dist/types/src/components/SpacePluginSettings.d.ts +4 -2
  287. package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
  288. package/dist/types/src/components/{SpacePresence.d.ts → SpacePresence/SpacePresence.d.ts} +7 -6
  289. package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +1 -0
  290. package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +1430 -0
  291. package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +1 -0
  292. package/dist/types/src/components/SpacePresence/index.d.ts +2 -0
  293. package/dist/types/src/components/SpacePresence/index.d.ts.map +1 -0
  294. package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts +7 -0
  295. package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -0
  296. package/dist/types/src/components/SpaceRenamePopover/index.d.ts +2 -0
  297. package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +1 -0
  298. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +4 -1
  299. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
  300. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1433 -4
  301. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
  302. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -1
  303. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
  304. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1431 -5
  305. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
  306. package/dist/types/src/components/SyncStatus/status.d.ts +5 -5
  307. package/dist/types/src/components/ViewEditor.d.ts +7 -0
  308. package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
  309. package/dist/types/src/components/index.d.ts +16 -6
  310. package/dist/types/src/components/index.d.ts.map +1 -1
  311. package/dist/types/src/constants.d.ts +6 -0
  312. package/dist/types/src/constants.d.ts.map +1 -0
  313. package/dist/types/src/helpers/index.d.ts +2 -0
  314. package/dist/types/src/helpers/index.d.ts.map +1 -0
  315. package/dist/types/src/helpers/query.d.ts +7 -0
  316. package/dist/types/src/helpers/query.d.ts.map +1 -0
  317. package/dist/types/src/helpers/query.test.d.ts +2 -0
  318. package/dist/types/src/helpers/query.test.d.ts.map +1 -0
  319. package/dist/types/src/hooks/index.d.ts +1 -0
  320. package/dist/types/src/hooks/index.d.ts.map +1 -1
  321. package/dist/types/src/hooks/useActiveSpace.d.ts +2 -2
  322. package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
  323. package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +2 -8
  324. package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
  325. package/dist/types/src/hooks/usePath.d.ts +3 -3
  326. package/dist/types/src/hooks/usePath.d.ts.map +1 -1
  327. package/dist/types/src/hooks/useTypeOptions.d.ts +10 -0
  328. package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -0
  329. package/dist/types/src/index.d.ts +2 -2
  330. package/dist/types/src/index.d.ts.map +1 -1
  331. package/dist/types/src/meta.d.ts +2 -3
  332. package/dist/types/src/meta.d.ts.map +1 -1
  333. package/dist/types/src/translations.d.ts +1415 -410
  334. package/dist/types/src/translations.d.ts.map +1 -1
  335. package/dist/types/src/types/capabilities.d.ts +71 -0
  336. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  337. package/dist/types/src/types/events.d.ts +9 -0
  338. package/dist/types/src/types/events.d.ts.map +1 -0
  339. package/dist/types/src/types/form.d.ts +22 -0
  340. package/dist/types/src/types/form.d.ts.map +1 -0
  341. package/dist/types/src/types/index.d.ts +3 -0
  342. package/dist/types/src/types/index.d.ts.map +1 -1
  343. package/dist/types/src/types/types.d.ts +646 -338
  344. package/dist/types/src/types/types.d.ts.map +1 -1
  345. package/dist/types/src/util.d.ts +50 -31
  346. package/dist/types/src/util.d.ts.map +1 -1
  347. package/dist/types/tsconfig.tsbuildinfo +1 -1
  348. package/package.json +87 -64
  349. package/src/SpacePlugin.ts +197 -174
  350. package/src/capabilities/app-graph-builder/app-graph-builder.ts +621 -0
  351. package/src/capabilities/app-graph-builder/index.ts +7 -0
  352. package/src/capabilities/app-graph-serializer/app-graph-serializer.ts +83 -0
  353. package/src/capabilities/app-graph-serializer/index.ts +7 -0
  354. package/src/capabilities/identity-created/identity-created.ts +29 -0
  355. package/src/capabilities/identity-created/index.ts +7 -0
  356. package/src/capabilities/index.ts +10 -15
  357. package/src/capabilities/operation-resolver/index.ts +7 -0
  358. package/src/capabilities/operation-resolver/operation-resolver.ts +762 -0
  359. package/src/capabilities/react-root/index.ts +7 -0
  360. package/src/capabilities/react-root/react-root.tsx +25 -0
  361. package/src/capabilities/react-surface/index.ts +7 -0
  362. package/src/capabilities/react-surface/react-surface.tsx +377 -0
  363. package/src/capabilities/repair/index.ts +7 -0
  364. package/src/capabilities/repair/repair.ts +67 -0
  365. package/src/capabilities/settings/index.ts +7 -0
  366. package/src/capabilities/settings/settings.ts +33 -0
  367. package/src/capabilities/spaces-ready/index.ts +7 -0
  368. package/src/capabilities/spaces-ready/spaces-ready.ts +290 -0
  369. package/src/capabilities/state/index.ts +7 -0
  370. package/src/capabilities/state/state.ts +64 -0
  371. package/src/cli/commands/database/add.ts +115 -0
  372. package/src/cli/commands/database/index.ts +16 -0
  373. package/src/cli/commands/database/query/index.ts +5 -0
  374. package/src/cli/commands/database/query/query.test.ts +55 -0
  375. package/src/cli/commands/database/query/query.ts +44 -0
  376. package/src/cli/commands/database/remove.ts +51 -0
  377. package/src/cli/commands/database/stats.ts +44 -0
  378. package/src/cli/commands/database/util.ts +32 -0
  379. package/src/cli/commands/index.ts +7 -0
  380. package/src/cli/commands/queue/index.ts +12 -0
  381. package/src/cli/commands/queue/query.ts +45 -0
  382. package/src/cli/commands/queue/util.ts +19 -0
  383. package/src/cli/commands/space/close/close.ts +40 -0
  384. package/src/cli/commands/space/close/index.ts +5 -0
  385. package/src/cli/commands/space/create/create.test.ts +67 -0
  386. package/src/cli/commands/space/create/create.ts +61 -0
  387. package/src/cli/commands/space/create/index.ts +5 -0
  388. package/src/cli/commands/space/index.ts +21 -0
  389. package/src/cli/commands/space/info/index.ts +5 -0
  390. package/src/cli/commands/space/info/info.test.ts +47 -0
  391. package/src/cli/commands/space/info/info.ts +37 -0
  392. package/src/cli/commands/space/join/index.ts +5 -0
  393. package/src/cli/commands/space/join/join.ts +122 -0
  394. package/src/cli/commands/space/join/util.ts +82 -0
  395. package/src/cli/commands/space/list/index.ts +5 -0
  396. package/src/cli/commands/space/list/list.test.ts +36 -0
  397. package/src/cli/commands/space/list/list.ts +30 -0
  398. package/src/cli/commands/space/members/index.ts +5 -0
  399. package/src/cli/commands/space/members/members.test.ts +46 -0
  400. package/src/cli/commands/space/members/members.ts +40 -0
  401. package/src/cli/commands/space/members/util.ts +29 -0
  402. package/src/cli/commands/space/open/index.ts +5 -0
  403. package/src/cli/commands/space/open/open.ts +39 -0
  404. package/src/cli/commands/space/schema/index.ts +12 -0
  405. package/src/cli/commands/space/schema/list/index.ts +5 -0
  406. package/src/cli/commands/space/schema/list/list.test.ts +42 -0
  407. package/src/cli/commands/space/schema/list/list.ts +64 -0
  408. package/src/cli/commands/space/schema/list/util.ts +39 -0
  409. package/src/cli/commands/space/share/index.ts +5 -0
  410. package/src/cli/commands/space/share/share.ts +112 -0
  411. package/src/cli/commands/space/sync/index.ts +5 -0
  412. package/src/cli/commands/space/sync/sync.test.ts +12 -0
  413. package/src/cli/commands/space/sync/sync.ts +33 -0
  414. package/src/cli/index.ts +5 -0
  415. package/src/cli/plugin.ts +88 -0
  416. package/src/components/AwaitingObject.tsx +27 -27
  417. package/src/components/CollectionArticle.tsx +156 -0
  418. package/src/components/CollectionSection.tsx +8 -6
  419. package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +40 -33
  420. package/src/components/CreateDialog/CreateObjectDialog.tsx +108 -81
  421. package/src/components/CreateDialog/CreateObjectPanel.tsx +163 -91
  422. package/src/components/CreateDialog/CreateSpaceDialog.tsx +35 -29
  423. package/src/components/{JoinDialog.tsx → JoinDialog/JoinDialog.tsx} +29 -39
  424. package/src/components/JoinDialog/index.ts +5 -0
  425. package/src/components/MembersContainer/MembersContainer.stories.tsx +56 -0
  426. package/src/components/{MembersContainer.tsx → MembersContainer/MembersContainer.tsx} +95 -98
  427. package/src/components/MembersContainer/index.ts +5 -0
  428. package/src/components/MenuFooter.tsx +5 -6
  429. package/src/components/ObjectCardStack/ObjectCardStack.tsx +67 -0
  430. package/src/components/ObjectCardStack/ObjectForm.tsx +97 -0
  431. package/src/components/ObjectCardStack/index.ts +7 -0
  432. package/src/components/ObjectDetails/BaseObjectSettings.stories.tsx +63 -0
  433. package/src/components/ObjectDetails/BaseObjectSettings.tsx +122 -0
  434. package/src/components/{ObjectSettings → ObjectDetails}/ForeignKeys.tsx +8 -8
  435. package/src/components/ObjectDetails/ObjectDetails.tsx +33 -0
  436. package/src/components/ObjectDetails/index.ts +7 -0
  437. package/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx +52 -0
  438. package/src/components/ObjectRenamePopover/index.ts +5 -0
  439. package/src/components/RecordArticle.stories.tsx +116 -0
  440. package/src/components/RecordArticle.tsx +124 -0
  441. package/src/components/SchemaContainer.tsx +31 -31
  442. package/src/components/SpacePluginSettings.tsx +45 -33
  443. package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx} +25 -24
  444. package/src/components/{SpacePresence.tsx → SpacePresence/SpacePresence.tsx} +28 -24
  445. package/src/components/SpacePresence/index.ts +5 -0
  446. package/src/components/{PopoverRenameSpace.tsx → SpaceRenamePopover/SpaceRenamePopover.tsx} +16 -16
  447. package/src/components/SpaceRenamePopover/index.ts +5 -0
  448. package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +20 -12
  449. package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +99 -81
  450. package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -8
  451. package/src/components/SyncStatus/SyncStatus.stories.tsx +12 -19
  452. package/src/components/SyncStatus/SyncStatus.tsx +110 -13
  453. package/src/components/SyncStatus/save-tracker.ts +3 -3
  454. package/src/components/SyncStatus/status.ts +4 -4
  455. package/src/components/ViewEditor.tsx +101 -0
  456. package/src/components/index.ts +11 -6
  457. package/src/constants.ts +11 -0
  458. package/src/helpers/index.ts +5 -0
  459. package/src/helpers/query.test.ts +24 -0
  460. package/src/helpers/query.ts +153 -0
  461. package/src/hooks/index.ts +1 -0
  462. package/src/hooks/useActiveSpace.ts +8 -4
  463. package/src/hooks/useInputSurfaceLookup.tsx +9 -13
  464. package/src/hooks/usePath.ts +5 -5
  465. package/src/hooks/useTypeOptions.ts +25 -0
  466. package/src/index.ts +2 -2
  467. package/src/meta.ts +8 -5
  468. package/src/translations.ts +112 -36
  469. package/src/types/capabilities.ts +73 -0
  470. package/src/types/events.ts +16 -0
  471. package/src/types/form.ts +69 -0
  472. package/src/types/index.ts +3 -0
  473. package/src/types/types.ts +546 -206
  474. package/src/util.tsx +451 -242
  475. package/dist/lib/browser/app-graph-builder-M2RH72VL.mjs +0 -363
  476. package/dist/lib/browser/app-graph-builder-M2RH72VL.mjs.map +0 -7
  477. package/dist/lib/browser/app-graph-serializer-F7ISRRBV.mjs +0 -80
  478. package/dist/lib/browser/app-graph-serializer-F7ISRRBV.mjs.map +0 -7
  479. package/dist/lib/browser/chunk-4ZKSFDXM.mjs.map +0 -7
  480. package/dist/lib/browser/chunk-7Y4M7GXO.mjs +0 -94
  481. package/dist/lib/browser/chunk-7Y4M7GXO.mjs.map +0 -7
  482. package/dist/lib/browser/chunk-BXNL6SDI.mjs +0 -19
  483. package/dist/lib/browser/chunk-BXNL6SDI.mjs.map +0 -7
  484. package/dist/lib/browser/chunk-NFUKCRGE.mjs +0 -1916
  485. package/dist/lib/browser/chunk-NFUKCRGE.mjs.map +0 -7
  486. package/dist/lib/browser/chunk-PTKYMZWO.mjs +0 -13
  487. package/dist/lib/browser/chunk-PTKYMZWO.mjs.map +0 -7
  488. package/dist/lib/browser/chunk-TW7O2EPP.mjs +0 -284
  489. package/dist/lib/browser/chunk-TW7O2EPP.mjs.map +0 -7
  490. package/dist/lib/browser/chunk-V24VASAJ.mjs +0 -546
  491. package/dist/lib/browser/chunk-V24VASAJ.mjs.map +0 -7
  492. package/dist/lib/browser/chunk-YMCZR6EZ.mjs +0 -18
  493. package/dist/lib/browser/chunk-YMCZR6EZ.mjs.map +0 -7
  494. package/dist/lib/browser/identity-created-PI7TKANR.mjs +0 -23
  495. package/dist/lib/browser/identity-created-PI7TKANR.mjs.map +0 -7
  496. package/dist/lib/browser/intent-resolver-RWU6ZE4H.mjs +0 -610
  497. package/dist/lib/browser/intent-resolver-RWU6ZE4H.mjs.map +0 -7
  498. package/dist/lib/browser/react-root-QIKHSNT2.mjs +0 -29
  499. package/dist/lib/browser/react-root-QIKHSNT2.mjs.map +0 -7
  500. package/dist/lib/browser/react-surface-W56UD53I.mjs +0 -353
  501. package/dist/lib/browser/react-surface-W56UD53I.mjs.map +0 -7
  502. package/dist/lib/browser/schema-defs-WREJNMIC.mjs +0 -26
  503. package/dist/lib/browser/schema-defs-WREJNMIC.mjs.map +0 -7
  504. package/dist/lib/browser/schema-tools-ILTVSSS3.mjs +0 -124
  505. package/dist/lib/browser/schema-tools-ILTVSSS3.mjs.map +0 -7
  506. package/dist/lib/browser/settings-K54STC5A.mjs +0 -24
  507. package/dist/lib/browser/settings-K54STC5A.mjs.map +0 -7
  508. package/dist/lib/browser/spaces-ready-3PDRDHPC.mjs +0 -199
  509. package/dist/lib/browser/spaces-ready-3PDRDHPC.mjs.map +0 -7
  510. package/dist/lib/browser/state-HRZ4VRXU.mjs +0 -47
  511. package/dist/lib/browser/state-HRZ4VRXU.mjs.map +0 -7
  512. package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs +0 -364
  513. package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs.map +0 -7
  514. package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs +0 -89
  515. package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs.map +0 -7
  516. package/dist/lib/node/chunk-3X4EA4XL.cjs +0 -37
  517. package/dist/lib/node/chunk-3X4EA4XL.cjs.map +0 -7
  518. package/dist/lib/node/chunk-5WLAXYE3.cjs +0 -125
  519. package/dist/lib/node/chunk-5WLAXYE3.cjs.map +0 -7
  520. package/dist/lib/node/chunk-6P2DB4QQ.cjs +0 -36
  521. package/dist/lib/node/chunk-6P2DB4QQ.cjs.map +0 -7
  522. package/dist/lib/node/chunk-DOC5XEZ4.cjs +0 -184
  523. package/dist/lib/node/chunk-DOC5XEZ4.cjs.map +0 -7
  524. package/dist/lib/node/chunk-NCHF433F.cjs +0 -1921
  525. package/dist/lib/node/chunk-NCHF433F.cjs.map +0 -7
  526. package/dist/lib/node/chunk-NL5Y4EDX.cjs +0 -38
  527. package/dist/lib/node/chunk-NL5Y4EDX.cjs.map +0 -7
  528. package/dist/lib/node/chunk-ULJZPATP.cjs +0 -312
  529. package/dist/lib/node/chunk-ULJZPATP.cjs.map +0 -7
  530. package/dist/lib/node/chunk-XHWVT7LW.cjs +0 -572
  531. package/dist/lib/node/chunk-XHWVT7LW.cjs.map +0 -7
  532. package/dist/lib/node/identity-created-FF4WZ2WY.cjs +0 -42
  533. package/dist/lib/node/identity-created-FF4WZ2WY.cjs.map +0 -7
  534. package/dist/lib/node/index.cjs +0 -278
  535. package/dist/lib/node/index.cjs.map +0 -7
  536. package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs +0 -609
  537. package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs.map +0 -7
  538. package/dist/lib/node/meta.json +0 -1
  539. package/dist/lib/node/react-root-RQUU3A45.cjs +0 -51
  540. package/dist/lib/node/react-root-RQUU3A45.cjs.map +0 -7
  541. package/dist/lib/node/react-surface-AZFJLE72.cjs +0 -351
  542. package/dist/lib/node/react-surface-AZFJLE72.cjs.map +0 -7
  543. package/dist/lib/node/schema-defs-OB2X2HBH.cjs +0 -42
  544. package/dist/lib/node/schema-defs-OB2X2HBH.cjs.map +0 -7
  545. package/dist/lib/node/schema-tools-IYREN4IH.cjs +0 -147
  546. package/dist/lib/node/schema-tools-IYREN4IH.cjs.map +0 -7
  547. package/dist/lib/node/settings-P2EQ7VKQ.cjs +0 -38
  548. package/dist/lib/node/settings-P2EQ7VKQ.cjs.map +0 -7
  549. package/dist/lib/node/spaces-ready-DXPOHYV7.cjs +0 -210
  550. package/dist/lib/node/spaces-ready-DXPOHYV7.cjs.map +0 -7
  551. package/dist/lib/node/state-M35DK75Z.cjs +0 -61
  552. package/dist/lib/node/state-M35DK75Z.cjs.map +0 -7
  553. package/dist/lib/node/types/index.cjs +0 -48
  554. package/dist/lib/node/types/index.cjs.map +0 -7
  555. package/dist/lib/node-esm/app-graph-builder-BCHVZ4OM.mjs +0 -364
  556. package/dist/lib/node-esm/app-graph-builder-BCHVZ4OM.mjs.map +0 -7
  557. package/dist/lib/node-esm/app-graph-serializer-TXRGGNP2.mjs +0 -81
  558. package/dist/lib/node-esm/app-graph-serializer-TXRGGNP2.mjs.map +0 -7
  559. package/dist/lib/node-esm/chunk-3CP67AYY.mjs +0 -19
  560. package/dist/lib/node-esm/chunk-3CP67AYY.mjs.map +0 -7
  561. package/dist/lib/node-esm/chunk-BSLREHIX.mjs +0 -20
  562. package/dist/lib/node-esm/chunk-BSLREHIX.mjs.map +0 -7
  563. package/dist/lib/node-esm/chunk-D4QMPPS7.mjs +0 -285
  564. package/dist/lib/node-esm/chunk-D4QMPPS7.mjs.map +0 -7
  565. package/dist/lib/node-esm/chunk-GH2FGJXH.mjs +0 -96
  566. package/dist/lib/node-esm/chunk-GH2FGJXH.mjs.map +0 -7
  567. package/dist/lib/node-esm/chunk-HO7AIKQS.mjs +0 -547
  568. package/dist/lib/node-esm/chunk-HO7AIKQS.mjs.map +0 -7
  569. package/dist/lib/node-esm/chunk-JBQKU4K5.mjs.map +0 -7
  570. package/dist/lib/node-esm/chunk-LA6AVVH6.mjs +0 -1917
  571. package/dist/lib/node-esm/chunk-LA6AVVH6.mjs.map +0 -7
  572. package/dist/lib/node-esm/chunk-MSWEFAPD.mjs +0 -15
  573. package/dist/lib/node-esm/chunk-MSWEFAPD.mjs.map +0 -7
  574. package/dist/lib/node-esm/identity-created-35CTAQWI.mjs +0 -25
  575. package/dist/lib/node-esm/identity-created-35CTAQWI.mjs.map +0 -7
  576. package/dist/lib/node-esm/intent-resolver-JO6L2VXC.mjs +0 -611
  577. package/dist/lib/node-esm/intent-resolver-JO6L2VXC.mjs.map +0 -7
  578. package/dist/lib/node-esm/react-root-YFGL3B4J.mjs +0 -30
  579. package/dist/lib/node-esm/react-root-YFGL3B4J.mjs.map +0 -7
  580. package/dist/lib/node-esm/react-surface-CVAPDLEZ.mjs +0 -354
  581. package/dist/lib/node-esm/react-surface-CVAPDLEZ.mjs.map +0 -7
  582. package/dist/lib/node-esm/schema-defs-4MEJETVX.mjs +0 -27
  583. package/dist/lib/node-esm/schema-defs-4MEJETVX.mjs.map +0 -7
  584. package/dist/lib/node-esm/schema-tools-SRLCRZ3B.mjs +0 -126
  585. package/dist/lib/node-esm/schema-tools-SRLCRZ3B.mjs.map +0 -7
  586. package/dist/lib/node-esm/settings-TD76LTQS.mjs +0 -25
  587. package/dist/lib/node-esm/settings-TD76LTQS.mjs.map +0 -7
  588. package/dist/lib/node-esm/spaces-ready-FJMGPAVV.mjs +0 -200
  589. package/dist/lib/node-esm/spaces-ready-FJMGPAVV.mjs.map +0 -7
  590. package/dist/lib/node-esm/state-XQNDCN37.mjs +0 -48
  591. package/dist/lib/node-esm/state-XQNDCN37.mjs.map +0 -7
  592. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  593. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  594. package/dist/types/src/capabilities/app-graph-serializer.d.ts +0 -4
  595. package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +0 -1
  596. package/dist/types/src/capabilities/capabilities.d.ts +0 -22
  597. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  598. package/dist/types/src/capabilities/identity-created.d.ts +0 -4
  599. package/dist/types/src/capabilities/identity-created.d.ts.map +0 -1
  600. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -9
  601. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  602. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  603. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  604. package/dist/types/src/capabilities/react-surface.d.ts +0 -7
  605. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  606. package/dist/types/src/capabilities/schema-defs.d.ts +0 -4
  607. package/dist/types/src/capabilities/schema-defs.d.ts.map +0 -1
  608. package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
  609. package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
  610. package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
  611. package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
  612. package/dist/types/src/capabilities/settings.d.ts +0 -4
  613. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  614. package/dist/types/src/capabilities/spaces-ready.d.ts +0 -4
  615. package/dist/types/src/capabilities/spaces-ready.d.ts.map +0 -1
  616. package/dist/types/src/capabilities/state.d.ts +0 -5
  617. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  618. package/dist/types/src/components/CollectionMain.d.ts +0 -6
  619. package/dist/types/src/components/CollectionMain.d.ts.map +0 -1
  620. package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
  621. package/dist/types/src/components/MembersContainer.d.ts.map +0 -1
  622. package/dist/types/src/components/MembersContainer.stories.d.ts +0 -8
  623. package/dist/types/src/components/MembersContainer.stories.d.ts.map +0 -1
  624. package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts +0 -7
  625. package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +0 -1
  626. package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +0 -1
  627. package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts +0 -8
  628. package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +0 -1
  629. package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts +0 -8
  630. package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +0 -1
  631. package/dist/types/src/components/ObjectSettings/index.d.ts +0 -2
  632. package/dist/types/src/components/ObjectSettings/index.d.ts.map +0 -1
  633. package/dist/types/src/components/PersistenceStatus.d.ts +0 -6
  634. package/dist/types/src/components/PersistenceStatus.d.ts.map +0 -1
  635. package/dist/types/src/components/PopoverRenameObject.d.ts +0 -7
  636. package/dist/types/src/components/PopoverRenameObject.d.ts.map +0 -1
  637. package/dist/types/src/components/PopoverRenameSpace.d.ts +0 -7
  638. package/dist/types/src/components/PopoverRenameSpace.d.ts.map +0 -1
  639. package/dist/types/src/components/SpacePresence.d.ts.map +0 -1
  640. package/dist/types/src/components/SpacePresence.stories.d.ts +0 -9
  641. package/dist/types/src/components/SpacePresence.stories.d.ts.map +0 -1
  642. package/dist/types/src/events.d.ts +0 -7
  643. package/dist/types/src/events.d.ts.map +0 -1
  644. package/src/capabilities/app-graph-builder.ts +0 -540
  645. package/src/capabilities/app-graph-serializer.ts +0 -76
  646. package/src/capabilities/capabilities.ts +0 -24
  647. package/src/capabilities/identity-created.ts +0 -27
  648. package/src/capabilities/intent-resolver.ts +0 -585
  649. package/src/capabilities/react-root.tsx +0 -20
  650. package/src/capabilities/react-surface.tsx +0 -349
  651. package/src/capabilities/schema-defs.ts +0 -30
  652. package/src/capabilities/schema-tool.test.ts +0 -44
  653. package/src/capabilities/schema-tools.ts +0 -125
  654. package/src/capabilities/settings.ts +0 -21
  655. package/src/capabilities/spaces-ready.ts +0 -231
  656. package/src/capabilities/state.ts +0 -45
  657. package/src/components/CollectionMain.tsx +0 -30
  658. package/src/components/MembersContainer.stories.tsx +0 -30
  659. package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +0 -80
  660. package/src/components/ObjectSettings/BaseObjectSettings.tsx +0 -47
  661. package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +0 -36
  662. package/src/components/ObjectSettings/index.ts +0 -5
  663. package/src/components/PersistenceStatus.tsx +0 -84
  664. package/src/components/PopoverRenameObject.tsx +0 -62
  665. package/src/events.ts +0 -14
@@ -0,0 +1,762 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability, Plugin, UndoMapping } from '@dxos/app-framework';
8
+ import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
9
+ import { SpaceState, getSpace } from '@dxos/client/echo';
10
+ import { Database, Obj, Query, Ref, Relation, Type } from '@dxos/echo';
11
+ import { EchoDatabaseImpl, Serializer } from '@dxos/echo-db';
12
+ import { invariant } from '@dxos/invariant';
13
+ import { Migrations } from '@dxos/migrations';
14
+ import { OperationResolver } from '@dxos/operation';
15
+ import { Operation } from '@dxos/operation';
16
+ import { ClientCapabilities } from '@dxos/plugin-client/types';
17
+ import { ObservabilityOperation } from '@dxos/plugin-observability/types';
18
+ import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
19
+ import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention/types';
20
+ import { iconValues } from '@dxos/react-ui-pickers/icons';
21
+ import { Collection, ProjectionModel, createEchoChangeCallback, getTypenameFromQuery } from '@dxos/schema';
22
+ import { hues } from '@dxos/ui-theme';
23
+
24
+ import { type JoinDialogProps } from '../../components';
25
+ import {
26
+ CREATE_OBJECT_DIALOG,
27
+ CREATE_SPACE_DIALOG,
28
+ JOIN_DIALOG,
29
+ OBJECT_RENAME_POPOVER,
30
+ SPACE_RENAME_POPOVER,
31
+ } from '../../constants';
32
+ import { meta } from '../../meta';
33
+ import { SpaceEvents } from '../../types';
34
+ import { SpaceCapabilities, SpaceOperation } from '../../types';
35
+ import { COMPOSER_SPACE_LOCK, cloneObject, getNestedObjects } from '../../util';
36
+
37
+ type OperationResolverOptions = {
38
+ createInvitationUrl: (invitationCode: string) => string;
39
+ observability?: boolean;
40
+ };
41
+
42
+ export default Capability.makeModule(
43
+ Effect.fnUntraced(function* (props?: OperationResolverOptions) {
44
+ const { createInvitationUrl, observability } = props!;
45
+ const capabilityManager = yield* Capability.Service;
46
+
47
+ const resolve = (typename: string) =>
48
+ capabilityManager.getAll(AppCapabilities.Metadata).find(({ id }: { id: string }) => id === typename)?.metadata ??
49
+ {};
50
+
51
+ return [
52
+ Capability.contributes(Capabilities.UndoMapping, [
53
+ UndoMapping.make({
54
+ operation: SpaceOperation.DeleteField,
55
+ inverse: SpaceOperation.RestoreField,
56
+ deriveContext: (input, output) => ({
57
+ view: input.view,
58
+ field: output.field,
59
+ props: output.props,
60
+ index: output.index,
61
+ }),
62
+ message: ['field deleted label', { ns: meta.id }],
63
+ }),
64
+ UndoMapping.make({
65
+ operation: SpaceOperation.RemoveObjects,
66
+ inverse: SpaceOperation.RestoreObjects,
67
+ deriveContext: (_input, output) => ({
68
+ objects: output.objects,
69
+ parentCollection: output.parentCollection,
70
+ indices: output.indices,
71
+ nestedObjectsList: output.nestedObjectsList,
72
+ wasActive: output.wasActive,
73
+ }),
74
+ message: (input, _output) => {
75
+ const ns = Obj.getTypename(input.objects[0]);
76
+ return ns && input.objects.length === 1
77
+ ? ['object deleted label', { ns: meta.id }]
78
+ : ['objects deleted label', { ns: meta.id }];
79
+ },
80
+ }),
81
+ ]),
82
+ Capability.contributes(Capabilities.OperationResolver, [
83
+ //
84
+ // Open
85
+ //
86
+ OperationResolver.make({
87
+ operation: SpaceOperation.Open,
88
+ handler: (input) =>
89
+ Effect.promise(async () => {
90
+ await input.space.open();
91
+ }),
92
+ }),
93
+
94
+ //
95
+ // Close
96
+ //
97
+ OperationResolver.make({
98
+ operation: SpaceOperation.Close,
99
+ handler: (input) =>
100
+ Effect.promise(async () => {
101
+ await input.space.close();
102
+ }),
103
+ }),
104
+
105
+ //
106
+ // Join
107
+ //
108
+ OperationResolver.make({
109
+ operation: SpaceOperation.Join,
110
+ handler: Effect.fnUntraced(function* (input) {
111
+ yield* Operation.invoke(LayoutOperation.UpdateDialog, {
112
+ subject: JOIN_DIALOG,
113
+ blockAlign: 'start',
114
+ props: {
115
+ initialInvitationCode: input.invitationCode,
116
+ onDone: input.onDone,
117
+ } satisfies Partial<JoinDialogProps>,
118
+ });
119
+ }),
120
+ }),
121
+
122
+ //
123
+ // WaitForObject
124
+ //
125
+ OperationResolver.make({
126
+ operation: SpaceOperation.WaitForObject,
127
+ handler: Effect.fnUntraced(function* (input) {
128
+ yield* Capabilities.updateAtomValue(SpaceCapabilities.EphemeralState, (current) => ({
129
+ ...current,
130
+ awaiting: input.id,
131
+ }));
132
+ }),
133
+ }),
134
+
135
+ //
136
+ // OpenSettings
137
+ //
138
+ OperationResolver.make({
139
+ operation: SpaceOperation.OpenSettings,
140
+ handler: Effect.fnUntraced(function* (input) {
141
+ yield* Operation.invoke(LayoutOperation.Open, {
142
+ subject: [`properties-settings${ATTENDABLE_PATH_SEPARATOR}${input.space.id}`],
143
+ workspace: input.space.id,
144
+ });
145
+ }),
146
+ }),
147
+
148
+ //
149
+ // RemoveObjects
150
+ //
151
+ OperationResolver.make({
152
+ operation: SpaceOperation.RemoveObjects,
153
+ handler: Effect.fnUntraced(function* (input) {
154
+ const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);
155
+ const objects = input.objects as Obj.Unknown[];
156
+
157
+ // All objects must be a member of the same space.
158
+ const space = getSpace(objects[0]);
159
+ invariant(space && objects.every((obj) => Obj.isObject(obj) && getSpace(obj) === space));
160
+ const openObjectIds = new Set<string>(layout.active);
161
+
162
+ const parentCollection: Collection.Collection =
163
+ input.target ?? space.properties[Collection.Collection.typename]?.target;
164
+
165
+ const nestedObjectsList = yield* Effect.promise(() =>
166
+ Promise.all(objects.map((obj) => getNestedObjects(obj, resolve))),
167
+ );
168
+
169
+ // Capture indices before removal.
170
+ const indices = objects.map((obj) =>
171
+ Obj.instanceOf(Collection.Collection, parentCollection)
172
+ ? parentCollection.objects.findIndex((ref) => ref.target === obj)
173
+ : -1,
174
+ );
175
+
176
+ // Close objects that were open.
177
+ const wasActive = objects
178
+ .flatMap((obj, i) => [obj, ...nestedObjectsList[i]])
179
+ .filter((obj) => Obj.isObject(obj) && openObjectIds.has(Obj.getDXN(obj).toString()))
180
+ .map((obj) => Obj.getDXN(obj).toString());
181
+
182
+ for (let i = 0; i < objects.length; i++) {
183
+ const obj = objects[i];
184
+ const nestedObjects = nestedObjectsList[i];
185
+
186
+ // Remove from parent collection.
187
+ const index = parentCollection.objects.findIndex((ref) => ref.target === obj);
188
+ if (index !== -1) {
189
+ Obj.change(parentCollection, (c) => {
190
+ c.objects.splice(index, 1);
191
+ });
192
+ }
193
+
194
+ // Delete nested objects.
195
+ for (const nestedObject of nestedObjects) {
196
+ if (Obj.isObject(nestedObject)) {
197
+ Obj.getDatabase(nestedObject)?.remove(nestedObject);
198
+ } else if (Relation.isRelation(nestedObject)) {
199
+ const db = Obj.getDatabase(Relation.getSource(nestedObject));
200
+ db?.remove(nestedObject);
201
+ }
202
+ }
203
+
204
+ // Delete the object.
205
+ const db = Obj.getDatabase(obj);
206
+ db?.remove(obj);
207
+ }
208
+
209
+ if (wasActive.length > 0) {
210
+ yield* Operation.invoke(LayoutOperation.Close, { subject: wasActive });
211
+ }
212
+
213
+ // Return data needed for undo.
214
+ return {
215
+ objects,
216
+ parentCollection,
217
+ indices,
218
+ nestedObjectsList,
219
+ wasActive,
220
+ };
221
+ }),
222
+ }),
223
+
224
+ //
225
+ // DeleteField
226
+ //
227
+ OperationResolver.make({
228
+ operation: SpaceOperation.DeleteField,
229
+ handler: Effect.fnUntraced(function* (input) {
230
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
231
+ const view = input.view as any;
232
+ const db = Obj.getDatabase(view);
233
+ invariant(db);
234
+ const typename = getTypenameFromQuery(view.query.ast);
235
+ invariant(typename);
236
+ const schema = yield* Effect.promise(() => db.schemaRegistry.query({ typename }).firstOrUndefined());
237
+ invariant(schema);
238
+
239
+ // Create projection with change callbacks that wrap in Obj.change().
240
+ const projection = new ProjectionModel({
241
+ registry,
242
+ view,
243
+ baseSchema: schema.jsonSchema,
244
+ change: createEchoChangeCallback(view, schema),
245
+ });
246
+
247
+ const result = projection.deleteFieldProjection(input.fieldId);
248
+
249
+ // Return data needed for undo.
250
+ return {
251
+ field: result.deleted.field,
252
+ props: result.deleted.props,
253
+ index: result.index,
254
+ };
255
+ }),
256
+ }),
257
+
258
+ //
259
+ // OpenCreateObject
260
+ //
261
+ OperationResolver.make({
262
+ operation: SpaceOperation.OpenCreateObject,
263
+ handler: Effect.fnUntraced(function* (input) {
264
+ const ephemeralState = yield* Capabilities.getAtomValue(SpaceCapabilities.EphemeralState);
265
+ const navigable = input.navigable ?? true;
266
+ yield* Operation.invoke(LayoutOperation.UpdateDialog, {
267
+ subject: CREATE_OBJECT_DIALOG,
268
+ blockAlign: 'start',
269
+ props: {
270
+ target: input.target,
271
+ views: input.views,
272
+ typename: input.typename,
273
+ initialFormValues: input.initialFormValues,
274
+ onCreateObject: input.onCreateObject,
275
+ shouldNavigate: navigable
276
+ ? (object: Obj.Unknown) => {
277
+ const isCollection = Obj.instanceOf(Collection.Collection, object);
278
+ const isSystemCollection = Obj.instanceOf(Collection.Managed, object);
279
+ return (!isCollection && !isSystemCollection) || ephemeralState.navigableCollections;
280
+ }
281
+ : () => false,
282
+ },
283
+ });
284
+ }),
285
+ }),
286
+
287
+ //
288
+ // AddObject
289
+ //
290
+ OperationResolver.make({
291
+ operation: SpaceOperation.AddObject,
292
+ handler: Effect.fnUntraced(function* (input) {
293
+ const target = input.target as any;
294
+ const object = input.object as Obj.Unknown;
295
+ const db = Database.isDatabase(target) ? target : Obj.getDatabase(target);
296
+ invariant(db, 'Database not found.');
297
+
298
+ yield* Collection.add({
299
+ object,
300
+ target: Database.isDatabase(target) ? undefined : target,
301
+ hidden: input.hidden,
302
+ }).pipe(Effect.provide(Database.layer(db)));
303
+
304
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
305
+ name: 'space.object.add',
306
+ properties: {
307
+ spaceId: db.spaceId,
308
+ objectId: object.id,
309
+ },
310
+ });
311
+
312
+ return {
313
+ id: Obj.getDXN(object).toString(),
314
+ subject: [Obj.getDXN(object).toString()],
315
+ object,
316
+ };
317
+ }),
318
+ }),
319
+
320
+ //
321
+ // Share
322
+ //
323
+ OperationResolver.make({
324
+ operation: SpaceOperation.Share,
325
+ handler: Effect.fnUntraced(function* (input) {
326
+ const { space, type, authMethod, multiUse, target } = input;
327
+ const invitation = space.share({ type, authMethod, multiUse, target });
328
+
329
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
330
+ name: 'space.share',
331
+ properties: {
332
+ spaceId: space.id,
333
+ },
334
+ });
335
+
336
+ return invitation;
337
+ }),
338
+ }),
339
+
340
+ //
341
+ // Lock
342
+ // TODO(wittjosiah): This appears to be unused.
343
+ //
344
+ OperationResolver.make({
345
+ operation: SpaceOperation.Lock,
346
+ handler: Effect.fnUntraced(function* ({ space }) {
347
+ Obj.change(space.properties, (p) => {
348
+ p[COMPOSER_SPACE_LOCK] = true;
349
+ });
350
+
351
+ if (observability) {
352
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
353
+ name: 'space.lock',
354
+ properties: { spaceId: space.id },
355
+ });
356
+ }
357
+ }),
358
+ }),
359
+
360
+ //
361
+ // Unlock
362
+ // TODO(wittjosiah): This appears to be unused.
363
+ //
364
+ OperationResolver.make({
365
+ operation: SpaceOperation.Unlock,
366
+ handler: Effect.fnUntraced(function* ({ space }) {
367
+ Obj.change(space.properties, (p) => {
368
+ p[COMPOSER_SPACE_LOCK] = false;
369
+ });
370
+
371
+ if (observability) {
372
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
373
+ name: 'space.unlock',
374
+ properties: { spaceId: space.id },
375
+ });
376
+ }
377
+ }),
378
+ }),
379
+
380
+ //
381
+ // OpenCreateSpace
382
+ //
383
+ OperationResolver.make({
384
+ operation: SpaceOperation.OpenCreateSpace,
385
+ handler: Effect.fnUntraced(function* () {
386
+ yield* Operation.invoke(LayoutOperation.UpdateDialog, {
387
+ subject: CREATE_SPACE_DIALOG,
388
+ blockAlign: 'start',
389
+ });
390
+ }),
391
+ }),
392
+
393
+ //
394
+ // Create
395
+ //
396
+ OperationResolver.make({
397
+ operation: SpaceOperation.Create,
398
+ handler: Effect.fnUntraced(function* ({ name, hue: hue_, icon: icon_, edgeReplication }) {
399
+ const client = yield* Capability.get(ClientCapabilities.Client);
400
+ const hue = hue_ ?? hues[Math.floor(Math.random() * hues.length)];
401
+ const icon = icon_ ?? iconValues[Math.floor(Math.random() * iconValues.length)];
402
+ const space = yield* Effect.promise(() => client.spaces.create({ name, hue, icon }));
403
+ if (edgeReplication) {
404
+ yield* Effect.promise(() => space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED));
405
+ }
406
+ yield* Effect.promise(() => space.waitUntilReady());
407
+
408
+ // Create root collection.
409
+ const collection = Obj.make(Collection.Collection, { objects: [] });
410
+ Obj.change(space.properties, (p) => {
411
+ p[Collection.Collection.typename] = Ref.make(collection);
412
+ // Set current migration version.
413
+ if (Migrations.versionProperty) {
414
+ p[Migrations.versionProperty] = Migrations.targetVersion;
415
+ }
416
+ });
417
+
418
+ // Create records smart collection.
419
+ Obj.change(collection, (c) => {
420
+ c.objects.push(Ref.make(Collection.makeManaged({ key: Type.getTypename(Type.PersistentType) })));
421
+ });
422
+
423
+ // Allow other plugins to add default content.
424
+ yield* Plugin.activate(SpaceEvents.SpaceCreated);
425
+ const onCreateSpaceCallbacks = yield* Capability.getAll(SpaceCapabilities.OnCreateSpace);
426
+ yield* Effect.all(
427
+ onCreateSpaceCallbacks.map((onCreateSpace) =>
428
+ onCreateSpace({ space, isDefault: false, rootCollection: collection }),
429
+ ),
430
+ );
431
+
432
+ if (observability) {
433
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
434
+ name: 'space.create',
435
+ properties: { spaceId: space.id },
436
+ });
437
+ }
438
+
439
+ return { id: space.id, subject: [space.id], space };
440
+ }),
441
+ }),
442
+
443
+ //
444
+ // Migrate
445
+ //
446
+ OperationResolver.make({
447
+ operation: SpaceOperation.Migrate,
448
+ handler: Effect.fnUntraced(function* (input) {
449
+ const { space, version: targetVersion } = input;
450
+
451
+ if (space.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION) {
452
+ yield* Capabilities.updateAtomValue(SpaceCapabilities.EphemeralState, (current) => ({
453
+ ...current,
454
+ sdkMigrationRunning: { ...current.sdkMigrationRunning, [space.id]: true },
455
+ }));
456
+ yield* Effect.promise(() => space.internal.migrate());
457
+ yield* Capabilities.updateAtomValue(SpaceCapabilities.EphemeralState, (current) => ({
458
+ ...current,
459
+ sdkMigrationRunning: { ...current.sdkMigrationRunning, [space.id]: false },
460
+ }));
461
+ }
462
+ const result = yield* Effect.promise(() => Migrations.migrate(space, targetVersion));
463
+
464
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
465
+ name: 'space.migrate',
466
+ properties: {
467
+ spaceId: space.id,
468
+ targetVersion,
469
+ version: Migrations.versionProperty ? space.properties[Migrations.versionProperty] : undefined,
470
+ },
471
+ });
472
+
473
+ return result;
474
+ }),
475
+ }),
476
+
477
+ //
478
+ // Snapshot
479
+ //
480
+ OperationResolver.make({
481
+ operation: SpaceOperation.Snapshot,
482
+ handler: (input) =>
483
+ Effect.promise(async () => {
484
+ const db = input.db as any;
485
+ invariant(db instanceof EchoDatabaseImpl, 'Database must be an instance of EchoDatabaseImpl');
486
+ const backup = await new Serializer().export(db, input.query && Query.fromAst(input.query));
487
+ return {
488
+ snapshot: new Blob([JSON.stringify(backup, null, 2)], { type: 'application/json' }),
489
+ };
490
+ }),
491
+ }),
492
+
493
+ //
494
+ // Rename
495
+ //
496
+ OperationResolver.make({
497
+ operation: SpaceOperation.Rename,
498
+ handler: Effect.fnUntraced(function* (input) {
499
+ yield* Operation.invoke(LayoutOperation.UpdatePopover, {
500
+ subject: SPACE_RENAME_POPOVER,
501
+ anchorId: `dxos.org/ui/${input.caller}/${input.space.id}`,
502
+ props: input.space,
503
+ });
504
+ }),
505
+ }),
506
+
507
+ //
508
+ // RenameObject
509
+ //
510
+ OperationResolver.make({
511
+ operation: SpaceOperation.RenameObject,
512
+ handler: Effect.fnUntraced(function* (input) {
513
+ const object = input.object as Obj.Unknown;
514
+ yield* Operation.invoke(LayoutOperation.UpdatePopover, {
515
+ subject: OBJECT_RENAME_POPOVER,
516
+ anchorId: `dxos.org/ui/${input.caller}/${Obj.getDXN(object).toString()}`,
517
+ props: object,
518
+ });
519
+ }),
520
+ }),
521
+
522
+ //
523
+ // OpenMembers
524
+ //
525
+ OperationResolver.make({
526
+ operation: SpaceOperation.OpenMembers,
527
+ handler: Effect.fnUntraced(function* (input) {
528
+ yield* Operation.invoke(LayoutOperation.Open, {
529
+ subject: [`members-settings${ATTENDABLE_PATH_SEPARATOR}${input.space.id}`],
530
+ workspace: input.space.id,
531
+ });
532
+ }),
533
+ }),
534
+
535
+ //
536
+ // GetShareLink
537
+ //
538
+ OperationResolver.make({
539
+ operation: SpaceOperation.GetShareLink,
540
+ handler: Effect.fnUntraced(function* (input) {
541
+ const { Invitation, InvitationEncoder } = yield* Effect.promise(
542
+ () => import('@dxos/react-client/invitations'),
543
+ );
544
+
545
+ const invitation = yield* Operation.invoke(SpaceOperation.Share, {
546
+ space: input.space,
547
+ type: Invitation.Type.DELEGATED,
548
+ authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
549
+ multiUse: true,
550
+ target: input.target,
551
+ });
552
+
553
+ // NOTE: Delegated invitations are invalid until the connecting state when keys are filled in.
554
+ const invitationCode = yield* Effect.tryPromise(
555
+ () =>
556
+ new Promise<string>((resolve) => {
557
+ invitation.subscribe((inv) => {
558
+ if (inv.state === Invitation.State.CONNECTING) {
559
+ resolve(InvitationEncoder.encode(inv));
560
+ }
561
+ });
562
+ }),
563
+ );
564
+ const url = createInvitationUrl(invitationCode);
565
+ if (input.copyToClipboard) {
566
+ yield* Effect.tryPromise(() => navigator.clipboard.writeText(url));
567
+ }
568
+ return url;
569
+ }),
570
+ }),
571
+
572
+ //
573
+ // UseStaticSchema
574
+ //
575
+ OperationResolver.make({
576
+ operation: SpaceOperation.UseStaticSchema,
577
+ handler: Effect.fnUntraced(function* (input) {
578
+ const db = input.db as Database.Database;
579
+ const client = yield* Capability.get(ClientCapabilities.Client);
580
+ const schema: any = yield* Effect.promise(() =>
581
+ (client as any).graph.schemaRegistry.query({ typename: input.typename, location: ['runtime'] }).first(),
582
+ );
583
+ const space = client.spaces.get(db.spaceId);
584
+ invariant(space, 'Space not found');
585
+
586
+ Obj.change(space.properties, (p) => {
587
+ if (!p.staticRecords) {
588
+ p.staticRecords = [];
589
+ }
590
+ if (!p.staticRecords.includes(input.typename)) {
591
+ p.staticRecords.push(input.typename);
592
+ }
593
+ });
594
+
595
+ yield* Plugin.activate(SpaceEvents.SchemaAdded);
596
+ const onSchemaAdded = yield* Capability.getAll(SpaceCapabilities.OnSchemaAdded);
597
+ yield* Effect.all(
598
+ onSchemaAdded.map((callback) => callback({ db, schema, show: input.show })),
599
+ { concurrency: 'unbounded' },
600
+ );
601
+
602
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
603
+ name: 'space.schema.use',
604
+ properties: {
605
+ spaceId: space.id,
606
+ typename: Type.getTypename(schema),
607
+ },
608
+ });
609
+
610
+ return {};
611
+ }),
612
+ }),
613
+
614
+ //
615
+ // AddSchema
616
+ //
617
+ OperationResolver.make({
618
+ operation: SpaceOperation.AddSchema,
619
+ handler: Effect.fnUntraced(function* (input) {
620
+ const db = input.db;
621
+ const schemas = yield* Effect.promise(() => db.schemaRegistry.register([input.schema]));
622
+ const schema = schemas[0];
623
+ Obj.change(schema.persistentSchema, (s) => {
624
+ if (input.name) {
625
+ s.name = input.name;
626
+ }
627
+ if (input.typename) {
628
+ s.typename = input.typename;
629
+ }
630
+ if (input.version) {
631
+ s.version = input.version;
632
+ }
633
+ });
634
+
635
+ yield* Plugin.activate(SpaceEvents.SchemaAdded);
636
+ const onSchemaAdded = yield* Capability.getAll(SpaceCapabilities.OnSchemaAdded);
637
+ yield* Effect.all(
638
+ onSchemaAdded.map((callback) => callback({ db, schema, show: input.show })),
639
+ { concurrency: 'unbounded' },
640
+ );
641
+
642
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
643
+ name: 'space.schema.add',
644
+ properties: {
645
+ spaceId: db.spaceId,
646
+ objectId: schema.id,
647
+ typename: schema.typename,
648
+ },
649
+ });
650
+
651
+ return { id: schema.id, object: schema.persistentSchema, schema };
652
+ }),
653
+ }),
654
+
655
+ //
656
+ // AddRelation
657
+ //
658
+ OperationResolver.make({
659
+ operation: SpaceOperation.AddRelation,
660
+ handler: (input) =>
661
+ Effect.sync(() => {
662
+ const db = input.db as Database.Database;
663
+ const relation = db.add(
664
+ Relation.make(input.schema, {
665
+ [Relation.Source]: input.source,
666
+ [Relation.Target]: input.target,
667
+ ...input.fields,
668
+ }),
669
+ );
670
+ return { relation };
671
+ }),
672
+ }),
673
+
674
+ //
675
+ // DuplicateObject
676
+ // TODO(wittjosiah): This appears to be unused.
677
+ //
678
+ OperationResolver.make({
679
+ operation: SpaceOperation.DuplicateObject,
680
+ handler: Effect.fnUntraced(function* (input) {
681
+ const object = input.object as Obj.Unknown;
682
+ const db = Obj.getDatabase(object);
683
+ invariant(db, 'Database not found.');
684
+ const newObject = yield* Effect.promise(() => cloneObject(object, resolve, db));
685
+ yield* Operation.invoke(SpaceOperation.AddObject, { object: newObject, target: db });
686
+ }),
687
+ }),
688
+
689
+ //
690
+ // RestoreField (inverse of DeleteField)
691
+ //
692
+ OperationResolver.make({
693
+ operation: SpaceOperation.RestoreField,
694
+ handler: Effect.fnUntraced(function* (input) {
695
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
696
+ const view = input.view as any;
697
+ const db = Obj.getDatabase(view);
698
+ invariant(db);
699
+ const typename = getTypenameFromQuery(view.query.ast);
700
+ invariant(typename);
701
+ const schema = yield* Effect.promise(() => db.schemaRegistry.query({ typename }).firstOrUndefined());
702
+ invariant(schema);
703
+
704
+ // Create projection with change callbacks that wrap in Obj.change().
705
+ const projection = new ProjectionModel({
706
+ registry,
707
+ view,
708
+ baseSchema: schema.jsonSchema,
709
+ change: createEchoChangeCallback(view, schema),
710
+ });
711
+
712
+ projection.setFieldProjection({ field: input.field, props: input.props }, input.index);
713
+ }),
714
+ }),
715
+
716
+ //
717
+ // RestoreObjects (inverse of RemoveObjects)
718
+ //
719
+ OperationResolver.make({
720
+ operation: SpaceOperation.RestoreObjects,
721
+ handler: Effect.fnUntraced(function* (input) {
722
+ const objects = input.objects as Obj.Unknown[];
723
+ const parentCollection = input.parentCollection as Collection.Collection;
724
+ const indices = input.indices as number[];
725
+ const nestedObjectsList = input.nestedObjectsList as Obj.Unknown[][];
726
+ const wasActive = input.wasActive as string[];
727
+
728
+ // Get the space from the first object.
729
+ const space = getSpace(objects[0]);
730
+ invariant(space);
731
+
732
+ // Restore objects to the space.
733
+ const restoredObjects = objects.map((obj: Obj.Unknown) => space.db.add(obj));
734
+
735
+ // Restore nested objects to the space.
736
+ nestedObjectsList.flat().forEach((obj: Obj.Unknown) => {
737
+ if (Obj.isObject(obj)) {
738
+ space.db.add(obj);
739
+ } else if (Relation.isRelation(obj)) {
740
+ space.db.add(obj);
741
+ }
742
+ });
743
+
744
+ // Restore objects to the parent collection at their original indices.
745
+ Obj.change(parentCollection, (c) => {
746
+ indices.forEach((index: number, i: number) => {
747
+ if (index !== -1) {
748
+ c.objects.splice(index, 0, Ref.make(restoredObjects[i] as Obj.Unknown));
749
+ }
750
+ });
751
+ });
752
+
753
+ // Re-open objects that were active.
754
+ if (wasActive.length > 0) {
755
+ yield* Operation.invoke(LayoutOperation.Open, { subject: wasActive });
756
+ }
757
+ }),
758
+ }),
759
+ ]),
760
+ ];
761
+ }),
762
+ );