@dxos/plugin-space 0.8.4-main.ae835ea → 0.8.4-main.bc674ce

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