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