@dxos/plugin-space 0.8.4-main.1da679c → 0.8.4-main.21d9917

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