@dxos/plugin-space 0.8.4-main.84f28bd → 0.8.4-main.9735255

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