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