@dxos/app-framework 0.7.5-main.9cb18ac → 0.7.5-main.9d2a38b

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 (316) hide show
  1. package/dist/lib/browser/chunk-GNLU3GAU.mjs +1595 -0
  2. package/dist/lib/browser/chunk-GNLU3GAU.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +112 -618
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +67 -0
  7. package/dist/lib/browser/testing/index.mjs.map +7 -0
  8. package/dist/lib/node/chunk-FBA4BB3J.cjs +1639 -0
  9. package/dist/lib/node/chunk-FBA4BB3J.cjs.map +7 -0
  10. package/dist/lib/node/index.cjs +123 -651
  11. package/dist/lib/node/index.cjs.map +4 -4
  12. package/dist/lib/node/meta.json +1 -1
  13. package/dist/lib/node/testing/index.cjs +91 -0
  14. package/dist/lib/node/testing/index.cjs.map +7 -0
  15. package/dist/lib/node-esm/chunk-KPMTPXQI.mjs +1597 -0
  16. package/dist/lib/node-esm/chunk-KPMTPXQI.mjs.map +7 -0
  17. package/dist/lib/node-esm/index.mjs +112 -618
  18. package/dist/lib/node-esm/index.mjs.map +4 -4
  19. package/dist/lib/node-esm/meta.json +1 -1
  20. package/dist/lib/node-esm/testing/index.mjs +68 -0
  21. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  22. package/dist/types/src/App.d.ts +22 -13
  23. package/dist/types/src/App.d.ts.map +1 -1
  24. package/dist/types/src/common/capabilities.d.ts +340 -0
  25. package/dist/types/src/common/capabilities.d.ts.map +1 -0
  26. package/dist/types/src/common/events.d.ts +41 -0
  27. package/dist/types/src/common/events.d.ts.map +1 -0
  28. package/dist/types/src/common/file.d.ts +14 -0
  29. package/dist/types/src/common/file.d.ts.map +1 -0
  30. package/dist/types/src/common/graph.d.ts +21 -0
  31. package/dist/types/src/common/graph.d.ts.map +1 -0
  32. package/dist/types/src/{plugins/common → common}/index.d.ts +3 -1
  33. package/dist/types/src/common/index.d.ts.map +1 -0
  34. package/dist/types/src/{plugins/common → common}/layout.d.ts +0 -11
  35. package/dist/types/src/common/layout.d.ts.map +1 -0
  36. package/dist/types/src/{plugins/common → common}/navigation.d.ts +0 -2
  37. package/dist/types/src/common/navigation.d.ts.map +1 -0
  38. package/dist/types/src/{plugins/plugin-surface/SurfaceContext.d.ts → common/surface.d.ts} +12 -29
  39. package/dist/types/src/common/surface.d.ts.map +1 -0
  40. package/dist/types/src/{plugins/common → common}/translations.d.ts +0 -11
  41. package/dist/types/src/common/translations.d.ts.map +1 -0
  42. package/dist/types/src/core/capabilities.d.ts +90 -0
  43. package/dist/types/src/core/capabilities.d.ts.map +1 -0
  44. package/dist/types/src/core/capabilities.test.d.ts +2 -0
  45. package/dist/types/src/core/capabilities.test.d.ts.map +1 -0
  46. package/dist/types/src/core/events.d.ts +58 -0
  47. package/dist/types/src/core/events.d.ts.map +1 -0
  48. package/dist/types/src/core/index.d.ts +5 -0
  49. package/dist/types/src/core/index.d.ts.map +1 -0
  50. package/dist/types/src/core/manager.d.ts +126 -0
  51. package/dist/types/src/core/manager.d.ts.map +1 -0
  52. package/dist/types/src/core/manager.test.d.ts +2 -0
  53. package/dist/types/src/core/manager.test.d.ts.map +1 -0
  54. package/dist/types/src/core/plugin.d.ts +94 -0
  55. package/dist/types/src/core/plugin.d.ts.map +1 -0
  56. package/dist/types/src/helpers.d.ts +10 -0
  57. package/dist/types/src/helpers.d.ts.map +1 -0
  58. package/dist/types/src/helpers.test.d.ts +2 -0
  59. package/dist/types/src/helpers.test.d.ts.map +1 -0
  60. package/dist/types/src/index.d.ts +5 -1
  61. package/dist/types/src/index.d.ts.map +1 -1
  62. package/dist/types/src/playground/debug/Debug.d.ts +6 -0
  63. package/dist/types/src/playground/debug/Debug.d.ts.map +1 -0
  64. package/dist/types/src/playground/debug/index.d.ts +2 -0
  65. package/dist/types/src/playground/debug/index.d.ts.map +1 -0
  66. package/dist/types/src/playground/debug/plugin.d.ts +2 -0
  67. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -0
  68. package/dist/types/src/playground/generator/Main.d.ts +6 -0
  69. package/dist/types/src/playground/generator/Main.d.ts.map +1 -0
  70. package/dist/types/src/playground/generator/Toolbar.d.ts +6 -0
  71. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -0
  72. package/dist/types/src/playground/generator/generator.d.ts +5 -0
  73. package/dist/types/src/playground/generator/generator.d.ts.map +1 -0
  74. package/dist/types/src/playground/generator/index.d.ts +3 -0
  75. package/dist/types/src/playground/generator/index.d.ts.map +1 -0
  76. package/dist/types/src/playground/generator/plugin.d.ts +2 -0
  77. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -0
  78. package/dist/types/src/playground/layout/Layout.d.ts +8 -0
  79. package/dist/types/src/playground/layout/Layout.d.ts.map +1 -0
  80. package/dist/types/src/playground/layout/index.d.ts +2 -0
  81. package/dist/types/src/playground/layout/index.d.ts.map +1 -0
  82. package/dist/types/src/playground/layout/plugin.d.ts +2 -0
  83. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -0
  84. package/dist/types/src/playground/logger/Toolbar.d.ts +6 -0
  85. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -0
  86. package/dist/types/src/playground/logger/index.d.ts +2 -0
  87. package/dist/types/src/playground/logger/index.d.ts.map +1 -0
  88. package/dist/types/src/playground/logger/plugin.d.ts +2 -0
  89. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -0
  90. package/dist/types/src/playground/logger/schema.d.ts +13 -0
  91. package/dist/types/src/playground/logger/schema.d.ts.map +1 -0
  92. package/dist/types/src/playground/playground.stories.d.ts +10 -0
  93. package/dist/types/src/playground/playground.stories.d.ts.map +1 -0
  94. package/dist/types/src/{plugins/plugin-intent → plugin-intent}/IntentContext.d.ts +1 -1
  95. package/dist/types/src/plugin-intent/IntentContext.d.ts.map +1 -0
  96. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +2 -0
  97. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -0
  98. package/dist/types/src/plugin-intent/actions.d.ts +23 -0
  99. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -0
  100. package/dist/types/src/plugin-intent/errors.d.ts +16 -0
  101. package/dist/types/src/plugin-intent/errors.d.ts.map +1 -0
  102. package/dist/types/src/plugin-intent/index.d.ts +6 -0
  103. package/dist/types/src/plugin-intent/index.d.ts.map +1 -0
  104. package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.d.ts +18 -19
  105. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -0
  106. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
  107. package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent.d.ts +5 -25
  108. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -0
  109. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -0
  110. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -0
  111. package/dist/types/src/{plugins/plugin-settings/provides.d.ts → plugin-settings/actions.d.ts} +1 -10
  112. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
  113. package/dist/types/src/plugin-settings/index.d.ts +3 -0
  114. package/dist/types/src/plugin-settings/index.d.ts.map +1 -0
  115. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
  116. package/dist/types/src/react/PluginManagerProvider.d.ts +10 -0
  117. package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -0
  118. package/dist/types/src/react/Surface.d.ts +12 -0
  119. package/dist/types/src/react/Surface.d.ts.map +1 -0
  120. package/dist/types/src/react/index.d.ts +5 -0
  121. package/dist/types/src/react/index.d.ts.map +1 -0
  122. package/dist/types/src/react/useCapabilities.d.ts +13 -0
  123. package/dist/types/src/react/useCapabilities.d.ts.map +1 -0
  124. package/dist/types/src/testing/index.d.ts +2 -0
  125. package/dist/types/src/testing/index.d.ts.map +1 -0
  126. package/dist/types/src/testing/withPluginManager.d.ts +10 -0
  127. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -0
  128. package/dist/types/src/testing/withPluginManager.stories.d.ts +5 -0
  129. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -0
  130. package/dist/types/tsconfig.tsbuildinfo +1 -1
  131. package/package.json +28 -15
  132. package/project.json +2 -1
  133. package/src/App.tsx +138 -34
  134. package/src/common/capabilities.ts +82 -0
  135. package/src/common/events.ts +63 -0
  136. package/src/common/file.ts +22 -0
  137. package/src/common/graph.ts +30 -0
  138. package/src/{plugins/common → common}/index.ts +3 -1
  139. package/src/{plugins/common → common}/layout.ts +0 -16
  140. package/src/{plugins/common → common}/navigation.ts +0 -15
  141. package/src/{plugins/plugin-surface/SurfaceContext.ts → common/surface.ts} +6 -37
  142. package/src/common/translations.ts +18 -0
  143. package/src/core/capabilities.test.ts +116 -0
  144. package/src/core/capabilities.ts +213 -0
  145. package/src/core/events.ts +58 -0
  146. package/src/core/index.ts +8 -0
  147. package/src/core/manager.test.ts +567 -0
  148. package/src/core/manager.ts +497 -0
  149. package/src/core/plugin.ts +128 -0
  150. package/src/helpers.test.ts +97 -0
  151. package/src/helpers.ts +45 -0
  152. package/src/index.ts +6 -3
  153. package/src/playground/debug/Debug.tsx +39 -0
  154. package/src/playground/debug/index.ts +5 -0
  155. package/src/playground/debug/plugin.ts +17 -0
  156. package/src/playground/generator/Main.tsx +71 -0
  157. package/src/playground/generator/Toolbar.tsx +46 -0
  158. package/src/playground/generator/generator.ts +23 -0
  159. package/src/playground/generator/index.ts +6 -0
  160. package/src/playground/generator/plugin.ts +18 -0
  161. package/src/playground/layout/Layout.tsx +33 -0
  162. package/src/playground/layout/index.ts +5 -0
  163. package/src/playground/layout/plugin.ts +17 -0
  164. package/src/playground/logger/Toolbar.tsx +28 -0
  165. package/src/playground/logger/index.ts +5 -0
  166. package/src/playground/logger/plugin.ts +33 -0
  167. package/src/playground/logger/schema.ts +12 -0
  168. package/src/playground/playground.stories.tsx +34 -0
  169. package/src/{plugins/plugin-intent → plugin-intent}/IntentContext.tsx +12 -4
  170. package/src/plugin-intent/IntentPlugin.tsx +60 -0
  171. package/src/plugin-intent/actions.ts +22 -0
  172. package/src/plugin-intent/errors.ts +39 -0
  173. package/src/{plugins/plugin-intent → plugin-intent}/index.ts +2 -6
  174. package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.ts +36 -35
  175. package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.ts +49 -65
  176. package/src/{plugins/plugin-intent → plugin-intent}/intent.ts +5 -21
  177. package/src/plugin-settings/SettingsPlugin.ts +29 -0
  178. package/src/plugin-settings/actions.ts +17 -0
  179. package/src/plugin-settings/index.ts +6 -0
  180. package/src/react/PluginManagerProvider.ts +22 -0
  181. package/src/react/Surface.tsx +72 -0
  182. package/src/react/index.ts +8 -0
  183. package/src/react/useCapabilities.ts +39 -0
  184. package/src/testing/index.ts +5 -0
  185. package/src/testing/withPluginManager.stories.tsx +47 -0
  186. package/src/testing/withPluginManager.tsx +67 -0
  187. package/tsconfig.json +13 -1
  188. package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
  189. package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
  190. package/dist/lib/browser/chunk-QG25ZU2N.mjs +0 -320
  191. package/dist/lib/browser/chunk-QG25ZU2N.mjs.map +0 -7
  192. package/dist/lib/browser/chunk-SPDTXTOV.mjs +0 -163
  193. package/dist/lib/browser/chunk-SPDTXTOV.mjs.map +0 -7
  194. package/dist/lib/browser/chunk-WBOXEHBE.mjs +0 -51
  195. package/dist/lib/browser/chunk-WBOXEHBE.mjs.map +0 -7
  196. package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs +0 -32
  197. package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs.map +0 -7
  198. package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs +0 -15
  199. package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs.map +0 -7
  200. package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs +0 -24
  201. package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs.map +0 -7
  202. package/dist/lib/node/chunk-BW3RNEVI.cjs +0 -185
  203. package/dist/lib/node/chunk-BW3RNEVI.cjs.map +0 -7
  204. package/dist/lib/node/chunk-FCMHRU3M.cjs +0 -70
  205. package/dist/lib/node/chunk-FCMHRU3M.cjs.map +0 -7
  206. package/dist/lib/node/chunk-QBM42OQ6.cjs +0 -97
  207. package/dist/lib/node/chunk-QBM42OQ6.cjs.map +0 -7
  208. package/dist/lib/node/chunk-VWHAALIN.cjs +0 -344
  209. package/dist/lib/node/chunk-VWHAALIN.cjs.map +0 -7
  210. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs +0 -53
  211. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs.map +0 -7
  212. package/dist/lib/node/plugin-settings-W6UHMH5M.cjs +0 -36
  213. package/dist/lib/node/plugin-settings-W6UHMH5M.cjs.map +0 -7
  214. package/dist/lib/node/plugin-surface-CCSIONYW.cjs +0 -45
  215. package/dist/lib/node/plugin-surface-CCSIONYW.cjs.map +0 -7
  216. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs +0 -53
  217. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs.map +0 -7
  218. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs +0 -164
  219. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs.map +0 -7
  220. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs +0 -321
  221. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs.map +0 -7
  222. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs +0 -74
  223. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs.map +0 -7
  224. package/dist/lib/node-esm/plugin-intent-W2HQC6LC.mjs +0 -33
  225. package/dist/lib/node-esm/plugin-intent-W2HQC6LC.mjs.map +0 -7
  226. package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs +0 -16
  227. package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs.map +0 -7
  228. package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs +0 -25
  229. package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs.map +0 -7
  230. package/dist/types/src/plugins/common/file.d.ts +0 -22
  231. package/dist/types/src/plugins/common/file.d.ts.map +0 -1
  232. package/dist/types/src/plugins/common/graph.d.ts +0 -51
  233. package/dist/types/src/plugins/common/graph.d.ts.map +0 -1
  234. package/dist/types/src/plugins/common/index.d.ts.map +0 -1
  235. package/dist/types/src/plugins/common/layout.d.ts.map +0 -1
  236. package/dist/types/src/plugins/common/metadata.d.ts +0 -16
  237. package/dist/types/src/plugins/common/metadata.d.ts.map +0 -1
  238. package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
  239. package/dist/types/src/plugins/common/translations.d.ts.map +0 -1
  240. package/dist/types/src/plugins/helpers.d.ts +0 -41
  241. package/dist/types/src/plugins/helpers.d.ts.map +0 -1
  242. package/dist/types/src/plugins/index.d.ts +0 -7
  243. package/dist/types/src/plugins/index.d.ts.map +0 -1
  244. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +0 -16
  245. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +0 -1
  246. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts +0 -14
  247. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts.map +0 -1
  248. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts +0 -47
  249. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts.map +0 -1
  250. package/dist/types/src/plugins/plugin-host/index.d.ts +0 -6
  251. package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
  252. package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -104
  253. package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +0 -1
  254. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts +0 -35
  255. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts.map +0 -1
  256. package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +0 -1
  257. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts +0 -8
  258. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +0 -1
  259. package/dist/types/src/plugins/plugin-intent/index.d.ts +0 -7
  260. package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
  261. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  262. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  263. package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
  264. package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -6
  265. package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
  266. package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -16
  267. package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +0 -1
  268. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts +0 -4
  269. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  270. package/dist/types/src/plugins/plugin-settings/index.d.ts +0 -4
  271. package/dist/types/src/plugins/plugin-settings/index.d.ts.map +0 -1
  272. package/dist/types/src/plugins/plugin-settings/meta.d.ts +0 -5
  273. package/dist/types/src/plugins/plugin-settings/meta.d.ts.map +0 -1
  274. package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +0 -1
  275. package/dist/types/src/plugins/plugin-surface/ErrorBoundary.d.ts.map +0 -1
  276. package/dist/types/src/plugins/plugin-surface/Surface.d.ts +0 -7
  277. package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
  278. package/dist/types/src/plugins/plugin-surface/SurfaceContext.d.ts.map +0 -1
  279. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts +0 -7
  280. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +0 -1
  281. package/dist/types/src/plugins/plugin-surface/helpers.d.ts +0 -21
  282. package/dist/types/src/plugins/plugin-surface/helpers.d.ts.map +0 -1
  283. package/dist/types/src/plugins/plugin-surface/index.d.ts +0 -8
  284. package/dist/types/src/plugins/plugin-surface/index.d.ts.map +0 -1
  285. package/dist/types/src/plugins/plugin-surface/meta.d.ts +0 -5
  286. package/dist/types/src/plugins/plugin-surface/meta.d.ts.map +0 -1
  287. package/dist/types/src/plugins/plugin-surface/provides.d.ts +0 -17
  288. package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +0 -1
  289. package/src/plugins/common/file.ts +0 -36
  290. package/src/plugins/common/graph.ts +0 -70
  291. package/src/plugins/common/metadata.ts +0 -29
  292. package/src/plugins/common/translations.ts +0 -36
  293. package/src/plugins/helpers.ts +0 -92
  294. package/src/plugins/index.ts +0 -11
  295. package/src/plugins/plugin-host/HostPlugin.tsx +0 -88
  296. package/src/plugins/plugin-host/PluginContainer.tsx +0 -120
  297. package/src/plugins/plugin-host/PluginContext.tsx +0 -79
  298. package/src/plugins/plugin-host/index.ts +0 -12
  299. package/src/plugins/plugin-host/plugin.test.ts +0 -158
  300. package/src/plugins/plugin-host/plugin.ts +0 -133
  301. package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -75
  302. package/src/plugins/plugin-intent/meta.ts +0 -11
  303. package/src/plugins/plugin-intent/provides.ts +0 -26
  304. package/src/plugins/plugin-settings/SettingsPlugin.tsx +0 -22
  305. package/src/plugins/plugin-settings/index.ts +0 -9
  306. package/src/plugins/plugin-settings/meta.ts +0 -9
  307. package/src/plugins/plugin-settings/provides.ts +0 -34
  308. package/src/plugins/plugin-surface/Surface.tsx +0 -62
  309. package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -45
  310. package/src/plugins/plugin-surface/helpers.ts +0 -22
  311. package/src/plugins/plugin-surface/index.ts +0 -14
  312. package/src/plugins/plugin-surface/meta.ts +0 -9
  313. package/src/plugins/plugin-surface/provides.ts +0 -27
  314. /package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.d.ts +0 -0
  315. /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
  316. /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,649 +15,129 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var node_exports = {};
30
20
  __export(node_exports, {
31
- ActiveParts: () => ActiveParts,
32
- ErrorBoundary: () => import_chunk_BW3RNEVI.ErrorBoundary,
33
- HostPlugin: () => HostPlugin,
34
- INTENT_ACTION: () => import_chunk_VWHAALIN.INTENT_ACTION,
35
- IntentAction: () => import_chunk_VWHAALIN.IntentAction,
36
- IntentProvider: () => import_chunk_VWHAALIN.IntentProvider,
37
- LAYOUT_ACTION: () => LAYOUT_ACTION,
38
- LAYOUT_PLUGIN: () => LAYOUT_PLUGIN,
39
- Label: () => import_chunk_VWHAALIN.Label,
40
- Layout: () => Layout,
41
- LayoutAction: () => LayoutAction,
42
- NAVIGATION_ACTION: () => NAVIGATION_ACTION,
43
- NAVIGATION_PLUGIN: () => NAVIGATION_PLUGIN,
44
- NavigationAction: () => NavigationAction,
45
- Plugin: () => Plugin,
46
- PluginProvider: () => PluginProvider,
47
- Resource: () => Resource,
48
- ResourceKey: () => ResourceKey,
49
- ResourceLanguage: () => ResourceLanguage,
50
- SETTINGS_ACTION: () => import_chunk_FCMHRU3M.SETTINGS_ACTION,
51
- SETTINGS_PLUGIN: () => import_chunk_FCMHRU3M.SETTINGS_PLUGIN,
52
- SLUG_COLLECTION_INDICATOR: () => SLUG_COLLECTION_INDICATOR,
53
- SLUG_ENTRY_SEPARATOR: () => SLUG_ENTRY_SEPARATOR,
54
- SLUG_KEY_VALUE_SEPARATOR: () => SLUG_KEY_VALUE_SEPARATOR,
55
- SLUG_LIST_SEPARATOR: () => SLUG_LIST_SEPARATOR,
56
- SLUG_PATH_SEPARATOR: () => SLUG_PATH_SEPARATOR,
57
- SettingsAction: () => import_chunk_FCMHRU3M.SettingsAction,
58
- Surface: () => import_chunk_BW3RNEVI.Surface,
59
- SurfaceProvider: () => import_chunk_BW3RNEVI.SurfaceProvider,
60
- Toast: () => Toast,
61
- chain: () => import_chunk_VWHAALIN.chain,
62
- createApp: () => createApp,
63
- createDispatcher: () => import_chunk_VWHAALIN.createDispatcher,
64
- createIntent: () => import_chunk_VWHAALIN.createIntent,
65
- createResolver: () => import_chunk_VWHAALIN.createResolver,
66
- createSurface: () => import_chunk_BW3RNEVI.createSurface,
67
- defaultFileTypes: () => defaultFileTypes,
68
- definePlugin: () => import_chunk_QBM42OQ6.definePlugin,
69
- filterPlugins: () => import_chunk_QBM42OQ6.filterPlugins,
70
- findPlugin: () => import_chunk_QBM42OQ6.findPlugin,
71
- firstIdInPart: () => firstIdInPart,
72
- getPlugin: () => import_chunk_QBM42OQ6.getPlugin,
73
- indexInPart: () => indexInPart,
74
- isLayoutAdjustment: () => isLayoutAdjustment,
75
- isLayoutMode: () => isLayoutMode,
76
- isLayoutParts: () => isLayoutParts,
77
- isObject: () => import_chunk_BW3RNEVI.isObject,
78
- openIds: () => openIds,
79
- parseFileManagerPlugin: () => parseFileManagerPlugin,
80
- parseGraphBuilderPlugin: () => parseGraphBuilderPlugin,
81
- parseGraphPlugin: () => parseGraphPlugin,
82
- parseGraphSerializerPlugin: () => parseGraphSerializerPlugin,
83
- parseIntentPlugin: () => import_chunk_VWHAALIN.parseIntentPlugin,
84
- parseIntentResolverPlugin: () => import_chunk_VWHAALIN.parseIntentResolverPlugin,
85
- parseLayoutPlugin: () => parseLayoutPlugin,
86
- parseMetadataRecordsPlugin: () => parseMetadataRecordsPlugin,
87
- parseMetadataResolverPlugin: () => parseMetadataResolverPlugin,
88
- parseNavigationPlugin: () => parseNavigationPlugin,
89
- parseRootSurfacePlugin: () => import_chunk_BW3RNEVI.parseRootSurfacePlugin,
90
- parseSettingsPlugin: () => import_chunk_FCMHRU3M.parseSettingsPlugin,
91
- parseSurfacePlugin: () => import_chunk_BW3RNEVI.parseSurfacePlugin,
92
- parseTranslationsPlugin: () => parseTranslationsPlugin,
93
- partLength: () => partLength,
94
- resolvePlugin: () => import_chunk_QBM42OQ6.resolvePlugin,
95
- useIntentDispatcher: () => import_chunk_VWHAALIN.useIntentDispatcher,
96
- useIntentResolver: () => import_chunk_VWHAALIN.useIntentResolver,
97
- usePlugin: () => usePlugin,
98
- usePlugins: () => usePlugins,
99
- useResolvePlugin: () => useResolvePlugin,
100
- useResolvePlugins: () => useResolvePlugins,
101
- useSurfaceRoot: () => import_chunk_BW3RNEVI.useSurfaceRoot
21
+ ActiveParts: () => import_chunk_FBA4BB3J.ActiveParts,
22
+ Capabilities: () => import_chunk_FBA4BB3J.Capabilities,
23
+ ErrorBoundary: () => import_chunk_FBA4BB3J.ErrorBoundary,
24
+ Events: () => import_chunk_FBA4BB3J.Events,
25
+ FileInfoSchema: () => import_chunk_FBA4BB3J.FileInfoSchema,
26
+ INTENT_ACTION: () => import_chunk_FBA4BB3J.INTENT_ACTION,
27
+ INTENT_PLUGIN: () => import_chunk_FBA4BB3J.INTENT_PLUGIN,
28
+ IntentAction: () => import_chunk_FBA4BB3J.IntentAction,
29
+ IntentPlugin: () => import_chunk_FBA4BB3J.IntentPlugin,
30
+ IntentProvider: () => import_chunk_FBA4BB3J.IntentProvider,
31
+ LAYOUT_ACTION: () => import_chunk_FBA4BB3J.LAYOUT_ACTION,
32
+ LAYOUT_PLUGIN: () => import_chunk_FBA4BB3J.LAYOUT_PLUGIN,
33
+ Label: () => import_chunk_FBA4BB3J.Label,
34
+ Layout: () => import_chunk_FBA4BB3J.Layout,
35
+ LayoutAction: () => import_chunk_FBA4BB3J.LayoutAction,
36
+ NAVIGATION_ACTION: () => import_chunk_FBA4BB3J.NAVIGATION_ACTION,
37
+ NAVIGATION_PLUGIN: () => import_chunk_FBA4BB3J.NAVIGATION_PLUGIN,
38
+ NavigationAction: () => import_chunk_FBA4BB3J.NavigationAction,
39
+ Plugin: () => import_chunk_FBA4BB3J.Plugin,
40
+ PluginManager: () => import_chunk_FBA4BB3J.PluginManager,
41
+ PluginManagerProvider: () => import_chunk_FBA4BB3J.PluginManagerProvider,
42
+ PluginModule: () => import_chunk_FBA4BB3J.PluginModule,
43
+ PluginsContext: () => import_chunk_FBA4BB3J.PluginsContext,
44
+ Resource: () => import_chunk_FBA4BB3J.Resource,
45
+ ResourceKey: () => import_chunk_FBA4BB3J.ResourceKey,
46
+ ResourceLanguage: () => import_chunk_FBA4BB3J.ResourceLanguage,
47
+ SETTINGS_ACTION: () => SETTINGS_ACTION,
48
+ SETTINGS_PLUGIN: () => SETTINGS_PLUGIN,
49
+ SLUG_COLLECTION_INDICATOR: () => import_chunk_FBA4BB3J.SLUG_COLLECTION_INDICATOR,
50
+ SLUG_ENTRY_SEPARATOR: () => import_chunk_FBA4BB3J.SLUG_ENTRY_SEPARATOR,
51
+ SLUG_KEY_VALUE_SEPARATOR: () => import_chunk_FBA4BB3J.SLUG_KEY_VALUE_SEPARATOR,
52
+ SLUG_LIST_SEPARATOR: () => import_chunk_FBA4BB3J.SLUG_LIST_SEPARATOR,
53
+ SLUG_PATH_SEPARATOR: () => import_chunk_FBA4BB3J.SLUG_PATH_SEPARATOR,
54
+ SettingsAction: () => SettingsAction,
55
+ SettingsPlugin: () => SettingsPlugin,
56
+ Surface: () => import_chunk_FBA4BB3J.Surface,
57
+ Toast: () => import_chunk_FBA4BB3J.Toast,
58
+ allOf: () => import_chunk_FBA4BB3J.allOf,
59
+ chain: () => import_chunk_FBA4BB3J.chain,
60
+ contributes: () => import_chunk_FBA4BB3J.contributes,
61
+ createApp: () => import_chunk_FBA4BB3J.createApp,
62
+ createDispatcher: () => import_chunk_FBA4BB3J.createDispatcher,
63
+ createIntent: () => import_chunk_FBA4BB3J.createIntent,
64
+ createResolver: () => import_chunk_FBA4BB3J.createResolver,
65
+ createSurface: () => import_chunk_FBA4BB3J.createSurface,
66
+ defaultFileTypes: () => import_chunk_FBA4BB3J.defaultFileTypes,
67
+ defineCapability: () => import_chunk_FBA4BB3J.defineCapability,
68
+ defineEvent: () => import_chunk_FBA4BB3J.defineEvent,
69
+ defineModule: () => import_chunk_FBA4BB3J.defineModule,
70
+ definePlugin: () => import_chunk_FBA4BB3J.definePlugin,
71
+ eventKey: () => import_chunk_FBA4BB3J.eventKey,
72
+ firstIdInPart: () => import_chunk_FBA4BB3J.firstIdInPart,
73
+ getEvents: () => import_chunk_FBA4BB3J.getEvents,
74
+ indexInPart: () => import_chunk_FBA4BB3J.indexInPart,
75
+ isAllOf: () => import_chunk_FBA4BB3J.isAllOf,
76
+ isLayoutAdjustment: () => import_chunk_FBA4BB3J.isLayoutAdjustment,
77
+ isLayoutMode: () => import_chunk_FBA4BB3J.isLayoutMode,
78
+ isLayoutParts: () => import_chunk_FBA4BB3J.isLayoutParts,
79
+ isOneOf: () => import_chunk_FBA4BB3J.isOneOf,
80
+ isSurfaceAvailable: () => import_chunk_FBA4BB3J.isSurfaceAvailable,
81
+ lazy: () => import_chunk_FBA4BB3J.lazy,
82
+ oneOf: () => import_chunk_FBA4BB3J.oneOf,
83
+ openIds: () => import_chunk_FBA4BB3J.openIds,
84
+ partLength: () => import_chunk_FBA4BB3J.partLength,
85
+ useCapabilities: () => import_chunk_FBA4BB3J.useCapabilities,
86
+ useCapability: () => import_chunk_FBA4BB3J.useCapability,
87
+ useIntentDispatcher: () => import_chunk_FBA4BB3J.useIntentDispatcher,
88
+ useIntentResolver: () => import_chunk_FBA4BB3J.useIntentResolver,
89
+ usePluginManager: () => import_chunk_FBA4BB3J.usePluginManager
102
90
  });
103
91
  module.exports = __toCommonJS(node_exports);
104
- var import_chunk_VWHAALIN = require("./chunk-VWHAALIN.cjs");
105
- var import_chunk_BW3RNEVI = require("./chunk-BW3RNEVI.cjs");
106
- var import_chunk_QBM42OQ6 = require("./chunk-QBM42OQ6.cjs");
107
- var import_chunk_FCMHRU3M = require("./chunk-FCMHRU3M.cjs");
92
+ var import_chunk_FBA4BB3J = require("./chunk-FBA4BB3J.cjs");
108
93
  var import_echo_schema = require("@dxos/echo-schema");
109
- var import_schema = require("@effect/schema");
110
- var import_util = require("@dxos/util");
111
- var import_zod = require("zod");
112
- var import_react = __toESM(require("react"));
113
94
  var import_local_storage = require("@dxos/local-storage");
114
- var import_react2 = __toESM(require("react"));
115
- var import_log = require("@dxos/log");
116
- var import_react3 = require("react");
117
- var import_debug = require("@dxos/debug");
118
- var import_util2 = require("@dxos/util");
119
- var import_react4 = __toESM(require("react"));
120
- var import_invariant = require("@dxos/invariant");
121
- var defaultFileTypes = {
122
- images: [
123
- "png",
124
- "jpg",
125
- "jpeg",
126
- "gif"
127
- ],
128
- media: [
129
- "mp3",
130
- "mp4",
131
- "mov",
132
- "avi"
133
- ],
134
- text: [
135
- "pdf",
136
- "txt",
137
- "md"
138
- ]
139
- };
140
- var parseFileManagerPlugin = (plugin) => {
141
- return plugin.provides.file ? plugin : void 0;
142
- };
143
- var parseGraphPlugin = (plugin) => plugin.provides.graph?.root ? plugin : void 0;
144
- var parseGraphBuilderPlugin = (plugin) => plugin.provides.graph?.builder ? plugin : void 0;
145
- var parseGraphSerializerPlugin = (plugin) => plugin.provides.graph?.serializer ? plugin : void 0;
146
- var Toast = import_echo_schema.S.Struct({
147
- id: import_echo_schema.S.String,
148
- title: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
149
- description: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
150
- icon: import_echo_schema.S.optional(import_echo_schema.S.String),
151
- duration: import_echo_schema.S.optional(import_echo_schema.S.Number),
152
- closeLabel: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
153
- actionLabel: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
154
- actionAlt: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
155
- // TODO(wittjosiah): Make class with customizable method?
156
- onAction: import_echo_schema.S.optional(import_echo_schema.S.Any)
157
- });
158
- var LayoutMode = import_echo_schema.S.Union(import_echo_schema.S.Literal("deck"), import_echo_schema.S.Literal("solo"), import_echo_schema.S.Literal("fullscreen"));
159
- var isLayoutMode = (value) => import_echo_schema.S.is(LayoutMode)(value);
160
- var Layout = import_echo_schema.S.mutable(import_echo_schema.S.Struct({
161
- layoutMode: LayoutMode,
162
- sidebarOpen: import_echo_schema.S.Boolean,
163
- complementarySidebarOpen: import_echo_schema.S.Boolean,
164
- /**
165
- * @deprecated Data to be passed to the complementary sidebar Surface.
166
- */
167
- complementarySidebarContent: import_echo_schema.S.optional(import_echo_schema.S.Any),
168
- dialogOpen: import_echo_schema.S.Boolean,
169
- /**
170
- * Data to be passed to the dialog Surface.
171
- */
172
- dialogContent: import_echo_schema.S.optional(import_echo_schema.S.Any),
173
- // TODO(wittjosiah): Custom properties?
174
- dialogBlockAlign: import_echo_schema.S.optional(import_echo_schema.S.Literal("start", "center")),
175
- dialogType: import_echo_schema.S.optional(import_echo_schema.S.Literal("default", "alert")),
176
- popoverOpen: import_echo_schema.S.Boolean,
177
- /**
178
- * Data to be passed to the popover Surface.
179
- */
180
- popoverContent: import_echo_schema.S.optional(import_echo_schema.S.Any),
181
- popoverAnchorId: import_echo_schema.S.optional(import_echo_schema.S.String),
182
- toasts: import_echo_schema.S.mutable(import_echo_schema.S.Array(Toast)),
183
- /**
184
- * The identifier of a component to scroll into view when it is mounted.
185
- */
186
- scrollIntoView: import_echo_schema.S.optional(import_echo_schema.S.String)
187
- }));
188
- var parseLayoutPlugin = (plugin) => {
189
- const success = import_echo_schema.S.is(Layout)(plugin.provides.layout);
190
- return success ? plugin : void 0;
191
- };
192
- var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
193
- var LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
194
- var LayoutAction;
195
- (function(LayoutAction2) {
196
- class SetLayout extends import_echo_schema.S.TaggedClass()(`${LAYOUT_ACTION}/set-layout`, {
197
- input: import_echo_schema.S.Struct({
198
- /**
199
- * Element to set the state of.
200
- */
201
- element: import_echo_schema.S.Literal("fullscreen", "sidebar", "complementary", "dialog", "popover", "toast"),
202
- /**
203
- * Whether the element is on or off.
204
- *
205
- * If omitted, the element's state will be toggled or set based on other provided data.
206
- * For example, if `component` is provided, the state will be set to `true`.
207
- */
208
- state: import_echo_schema.S.optional(import_echo_schema.S.Boolean),
209
- /**
210
- * Component to render in the dialog or popover.
211
- */
212
- component: import_echo_schema.S.optional(import_echo_schema.S.String),
213
- /**
214
- * Data to be passed to the dialog or popover Surface.
215
- */
216
- subject: import_echo_schema.S.optional(import_echo_schema.S.Any),
217
- /**
218
- * Anchor ID for the popover.
219
- */
220
- anchorId: import_echo_schema.S.optional(import_echo_schema.S.String),
221
- // TODO(wittjosiah): Custom properties?
222
- /**
223
- * Block alignment for the dialog.
224
- */
225
- dialogBlockAlign: import_echo_schema.S.optional(import_echo_schema.S.Literal("start", "center")),
226
- /**
227
- * Type of dialog.
228
- */
229
- dialogType: import_echo_schema.S.optional(import_echo_schema.S.Literal("default", "alert"))
230
- }),
231
- output: import_echo_schema.S.Void
232
- }) {
233
- }
234
- LayoutAction2.SetLayout = SetLayout;
235
- class SetLayoutMode extends import_echo_schema.S.TaggedClass()(`${LAYOUT_ACTION}/set-layout-mode`, {
236
- input: import_echo_schema.S.Union(import_echo_schema.S.Struct({
237
- layoutMode: LayoutMode
238
- }), import_echo_schema.S.Struct({
239
- revert: import_echo_schema.S.Literal(true)
240
- })),
241
- output: import_echo_schema.S.Void
242
- }) {
243
- }
244
- LayoutAction2.SetLayoutMode = SetLayoutMode;
245
- class ScrollIntoView extends import_echo_schema.S.TaggedClass()(`${LAYOUT_ACTION}/scroll-into-view`, {
95
+ var SETTINGS_PLUGIN = "dxos.org/plugin/settings";
96
+ var SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;
97
+ var SettingsAction;
98
+ (function(SettingsAction2) {
99
+ class Open extends import_echo_schema.S.TaggedClass()(`${SETTINGS_ACTION}/open`, {
246
100
  input: import_echo_schema.S.Struct({
247
- id: import_echo_schema.S.optional(import_echo_schema.S.String),
248
- // TODO(wittjosiah): Factor out to thread scroll into view action?
249
- cursor: import_echo_schema.S.optional(import_echo_schema.S.String),
250
- ref: import_echo_schema.S.optional(import_echo_schema.S.String)
101
+ plugin: import_echo_schema.S.optional(import_echo_schema.S.String)
251
102
  }),
252
103
  output: import_echo_schema.S.Void
253
104
  }) {
254
105
  }
255
- LayoutAction2.ScrollIntoView = ScrollIntoView;
256
- })(LayoutAction || (LayoutAction = {}));
257
- var parseMetadataRecordsPlugin = (plugin) => {
258
- return plugin.provides.metadata?.records ? plugin : void 0;
259
- };
260
- var parseMetadataResolverPlugin = (plugin) => {
261
- return plugin.provides.metadata?.resolver ? plugin : void 0;
262
- };
263
- var SLUG_LIST_SEPARATOR = "+";
264
- var SLUG_ENTRY_SEPARATOR = "_";
265
- var SLUG_KEY_VALUE_SEPARATOR = "-";
266
- var SLUG_PATH_SEPARATOR = "~";
267
- var SLUG_COLLECTION_INDICATOR = "";
268
- var LayoutEntrySchema = import_schema.Schema.mutable(import_schema.Schema.Struct({
269
- id: import_schema.Schema.String,
270
- path: import_schema.Schema.optional(import_schema.Schema.String)
271
- }));
272
- var LayoutPartSchema = import_schema.Schema.Union(import_schema.Schema.Literal("sidebar"), import_schema.Schema.Literal("main"), import_schema.Schema.Literal("solo"), import_schema.Schema.Literal("complementary"), import_schema.Schema.Literal("fullScreen"));
273
- var LayoutPartsSchema = import_schema.Schema.partial(import_schema.Schema.mutable(import_schema.Schema.Record({
274
- key: LayoutPartSchema,
275
- value: import_schema.Schema.mutable(import_schema.Schema.Array(LayoutEntrySchema))
276
- })));
277
- var LayoutCoordinateSchema = import_schema.Schema.mutable(import_schema.Schema.Struct({
278
- part: LayoutPartSchema,
279
- entryId: import_schema.Schema.String
280
- }));
281
- var PartAdjustmentSchema = import_schema.Schema.Union(import_schema.Schema.Literal("increment-start"), import_schema.Schema.Literal("increment-end"), import_schema.Schema.Literal("pin-start"), import_schema.Schema.Literal("pin-end"), import_schema.Schema.Literal("close"), import_schema.Schema.Literal("solo"));
282
- var LayoutAdjustmentSchema = import_schema.Schema.mutable(import_schema.Schema.Struct({
283
- layoutCoordinate: LayoutCoordinateSchema,
284
- type: PartAdjustmentSchema
285
- }));
286
- var ActiveParts = import_schema.Schema.Record({
287
- key: import_schema.Schema.String,
288
- value: import_schema.Schema.Union(import_schema.Schema.String, import_schema.Schema.mutable(import_schema.Schema.Array(import_schema.Schema.String)))
289
- });
290
- var LocationProvidesSchema = import_schema.Schema.mutable(import_schema.Schema.Struct({
291
- location: import_schema.Schema.Struct({
292
- active: LayoutPartsSchema,
293
- closed: import_schema.Schema.Array(import_schema.Schema.String)
294
- })
295
- }));
296
- var isLayoutParts = (value) => {
297
- return import_schema.Schema.is(LayoutPartsSchema)(value);
298
- };
299
- var isLayoutAdjustment = (value) => {
300
- return import_schema.Schema.is(LayoutAdjustmentSchema)(value);
301
- };
302
- var parseNavigationPlugin = (plugin) => {
303
- const location = plugin.provides?.location;
304
- if (!location) {
305
- return void 0;
306
- }
307
- if (import_schema.Schema.is(LocationProvidesSchema)({
308
- location
309
- })) {
310
- return plugin;
311
- }
312
- return void 0;
313
- };
314
- var openIds = (layout, parts) => {
315
- return Object.values(parts ? (0, import_util.pick)(layout, parts) : layout).flatMap((part) => part?.map((entry) => entry.id) ?? []).filter((id) => id !== void 0);
316
- };
317
- var firstIdInPart = (layout, part) => {
318
- if (!layout) {
319
- return void 0;
320
- }
321
- return layout[part]?.at(0)?.id;
322
- };
323
- var indexInPart = (layout, layoutCoordinate) => {
324
- if (!layout || !layoutCoordinate) {
325
- return void 0;
326
- }
327
- const { part, entryId } = layoutCoordinate;
328
- return layout[part]?.findIndex((entry) => entry.id === entryId);
329
- };
330
- var partLength = (layout, part) => {
331
- if (!layout || !part) {
332
- return 0;
333
- }
334
- return layout[part]?.length ?? 0;
335
- };
336
- var NAVIGATION_PLUGIN = "dxos.org/plugin/navigation";
337
- var NAVIGATION_ACTION = `${NAVIGATION_PLUGIN}/action`;
338
- var NavigationAction;
339
- (function(NavigationAction2) {
340
- class Open extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/open`, {
341
- input: import_schema.Schema.Struct({
342
- activeParts: ActiveParts,
343
- noToggle: import_schema.Schema.optional(import_schema.Schema.Boolean)
344
- }),
345
- output: import_schema.Schema.Struct({
346
- open: import_schema.Schema.Array(import_schema.Schema.String)
347
- })
348
- }) {
349
- }
350
- NavigationAction2.Open = Open;
351
- class AddToActive extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/add-to-active`, {
352
- input: import_schema.Schema.Struct({
353
- id: import_schema.Schema.String,
354
- part: LayoutPartSchema,
355
- scrollIntoView: import_schema.Schema.optional(import_schema.Schema.Boolean),
356
- pivotId: import_schema.Schema.optional(import_schema.Schema.String),
357
- positioning: import_schema.Schema.optional(import_schema.Schema.Literal("start", "end"))
358
- }),
359
- output: import_schema.Schema.Void
360
- }) {
361
- }
362
- NavigationAction2.AddToActive = AddToActive;
363
- class Set extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/set`, {
364
- input: import_schema.Schema.Struct({
365
- activeParts: ActiveParts
366
- }),
367
- output: import_schema.Schema.Void
368
- }) {
369
- }
370
- NavigationAction2.Set = Set;
371
- class Close extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/close`, {
372
- input: import_schema.Schema.Struct({
373
- activeParts: ActiveParts,
374
- noToggle: import_schema.Schema.optional(import_schema.Schema.Boolean)
375
- }),
376
- output: import_schema.Schema.Void
377
- }) {
378
- }
379
- NavigationAction2.Close = Close;
380
- class Adjust extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/adjust`, {
381
- input: LayoutAdjustmentSchema,
382
- output: import_schema.Schema.Void
383
- }) {
384
- }
385
- NavigationAction2.Adjust = Adjust;
386
- class Expose extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/expose`, {
387
- input: import_schema.Schema.Struct({
388
- id: import_schema.Schema.String
389
- }),
390
- output: import_schema.Schema.Void
391
- }) {
392
- }
393
- NavigationAction2.Expose = Expose;
394
- })(NavigationAction || (NavigationAction = {}));
395
- var ResourceKey = import_zod.z.union([
396
- import_zod.z.string(),
397
- import_zod.z.record(import_zod.z.any())
398
- ]);
399
- var ResourceLanguage = import_zod.z.record(ResourceKey);
400
- var Resource = import_zod.z.record(ResourceLanguage);
401
- var parseTranslationsPlugin = (plugin) => {
402
- const { success } = import_zod.z.array(Resource).safeParse(plugin.provides.translations);
403
- return success ? plugin : void 0;
404
- };
405
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/plugins/plugin-host/PluginContainer.tsx";
406
- var PluginContainer = ({ plugins: definitions, core, state, placeholder }) => {
407
- const [error, setError] = (0, import_react2.useState)();
408
- (0, import_react2.useEffect)(() => {
409
- (0, import_log.log)("initializing plugins", {
410
- enabled: state.enabled
411
- }, {
412
- F: __dxlog_file,
413
- L: 26,
414
- S: void 0,
415
- C: (f, a) => f(...a)
416
- });
417
- const t = setTimeout(async () => {
418
- try {
419
- const enabledIds = [
420
- ...core,
421
- ...state.enabled
422
- ];
423
- const enabled = await Promise.all(enabledIds.map((id) => definitions[id]).filter((definition) => Boolean(definition)).map((definition) => definition()));
424
- const plugins = await Promise.all(enabled.map(async (definition) => {
425
- const plugin = await initializePlugin(definition).catch((err) => {
426
- import_log.log.error("Failed to initialize plugin:", {
427
- id: definition.meta.id,
428
- err
429
- }, {
430
- F: __dxlog_file,
431
- L: 41,
432
- S: void 0,
433
- C: (f, a) => f(...a)
434
- });
435
- });
436
- (0, import_log.log)("initialized", {
437
- plugin: definition.meta.id
438
- }, {
439
- F: __dxlog_file,
440
- L: 44,
441
- S: void 0,
442
- C: (f, a) => f(...a)
443
- });
444
- return plugin;
445
- }));
446
- const initialized = plugins.filter((plugin) => Boolean(plugin));
447
- (0, import_log.log)("plugins initialized", {
448
- plugins: initialized
449
- }, {
450
- F: __dxlog_file,
451
- L: 50,
452
- S: void 0,
453
- C: (f, a) => f(...a)
454
- });
455
- await Promise.all(enabled.map((plugin) => plugin.ready?.({
456
- plugins: initialized
457
- })));
458
- (0, import_log.log)("plugins ready", {
459
- plugins: initialized
460
- }, {
461
- F: __dxlog_file,
462
- L: 53,
463
- S: void 0,
464
- C: (f, a) => f(...a)
465
- });
466
- state.plugins = initialized;
467
- state.ready = true;
468
- } catch (err) {
469
- setError(err);
470
- }
471
- });
472
- return () => {
473
- clearTimeout(t);
474
- state.ready = false;
475
- };
476
- }, []);
477
- if (error) {
478
- throw error;
479
- }
480
- if (!state.ready) {
481
- return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, placeholder);
482
- }
483
- const ComposedContext = composeContext(state.plugins);
484
- return /* @__PURE__ */ import_react2.default.createElement(ComposedContext, null, rootComponents(state.plugins));
485
- };
486
- var initializePlugin = async (pluginDefinition) => {
487
- const provides = await pluginDefinition.initialize?.();
488
- return {
489
- ...pluginDefinition,
490
- provides: {
491
- ...pluginDefinition.provides,
492
- ...provides
493
- }
494
- };
495
- };
496
- var rootComponents = (plugins) => {
497
- return plugins.map((plugin) => {
498
- const Component = plugin.provides.root;
499
- if (Component) {
500
- return /* @__PURE__ */ import_react2.default.createElement(Component, {
501
- key: plugin.meta.id
502
- });
503
- } else {
504
- return null;
505
- }
506
- }).filter((node) => Boolean(node));
507
- };
508
- var composeContext = (plugins) => {
509
- return compose(plugins.map((p) => p.provides.context).filter(Boolean));
510
- };
511
- var compose = (contexts) => {
512
- return [
513
- ...contexts
514
- ].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ import_react2.default.createElement(Acc, null, /* @__PURE__ */ import_react2.default.createElement(Next, null, children)));
515
- };
516
- var PluginContext = /* @__PURE__ */ (0, import_react3.createContext)(void 0);
517
- var usePlugins = () => (0, import_react3.useContext)(PluginContext) ?? (0, import_debug.raise)(new Error("Missing PluginContext"));
518
- var usePlugin = (id) => {
519
- const { plugins } = usePlugins();
520
- return (0, import_chunk_QBM42OQ6.findPlugin)(plugins, id);
521
- };
522
- var useResolvePlugin = (predicate) => {
523
- const { plugins } = usePlugins();
524
- return (0, import_chunk_QBM42OQ6.resolvePlugin)(plugins, predicate);
525
- };
526
- var useResolvePlugins = (predicate) => {
527
- const { plugins } = usePlugins();
528
- return (0, import_react3.useMemo)(() => plugins.map(predicate).filter(import_util2.nonNullable), [
529
- plugins,
530
- predicate
531
- ]);
532
- };
533
- var PluginProvider = PluginContext.Provider;
534
- var HOST_PLUGIN = "dxos.org/plugin/host";
535
- var HostPlugin = ({ plugins, meta, core, defaults = [], fallback = DefaultFallback, placeholder = null }) => {
536
- const state = new import_local_storage.LocalStorageStore(HOST_PLUGIN, {
537
- ready: false,
538
- core,
539
- enabled: [
540
- ...defaults
541
- ],
542
- plugins: [],
543
- available: meta.filter(({ id }) => !core.includes(id)),
544
- // TODO(burdon): Functions should not be part of the settings type.
545
- setPlugin: (id, enabled) => {
546
- if (enabled) {
547
- state.values.enabled.push(id);
548
- } else {
549
- const index = state.values.enabled.findIndex((enabled2) => enabled2 === id);
550
- index !== -1 && state.values.enabled.splice(index, 1);
551
- }
552
- }
553
- });
554
- state.prop({
555
- key: "enabled",
556
- type: import_local_storage.LocalStorageStore.json()
557
- });
558
- return {
559
- meta: {
560
- id: HOST_PLUGIN,
561
- name: "Plugin host"
562
- },
563
- provides: {
564
- context: ({ children }) => {
565
- return /* @__PURE__ */ import_react.default.createElement(PluginProvider, {
566
- value: state.values
567
- }, children);
568
- },
569
- root: () => {
570
- return /* @__PURE__ */ import_react.default.createElement(import_chunk_BW3RNEVI.ErrorBoundary, {
571
- fallback
572
- }, /* @__PURE__ */ import_react.default.createElement(PluginContainer, {
573
- plugins,
574
- core,
575
- state: state.values,
576
- placeholder
577
- }));
578
- }
579
- }
580
- };
581
- };
582
- var DefaultFallback = ({ error }) => {
583
- return /* @__PURE__ */ import_react.default.createElement("div", {
584
- style: {
585
- padding: "1rem"
586
- }
587
- }, /* @__PURE__ */ import_react.default.createElement("h1", {
588
- style: {
589
- fontSize: "1.2rem",
590
- fontWeight: 700,
591
- margin: "0.5rem 0"
592
- }
593
- }, error.message), /* @__PURE__ */ import_react.default.createElement("pre", null, error.stack));
594
- };
595
- var Plugin;
596
- (function(Plugin2) {
597
- Plugin2.lazy = (p, props) => {
598
- return () => p().then(({ default: definition }) => {
599
- return definition(props);
600
- });
601
- };
602
- })(Plugin || (Plugin = {}));
603
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
604
- var createApp = ({ meta, plugins, core, ...params }) => {
605
- const hostPlugin = HostPlugin({
606
- plugins: {
607
- ...plugins,
608
- [import_chunk_VWHAALIN.meta_default.id]: Plugin.lazy(() => import("./plugin-intent-F3TQZIUR.cjs")),
609
- [import_chunk_FCMHRU3M.meta_default.id]: Plugin.lazy(() => import("./plugin-settings-W6UHMH5M.cjs")),
610
- [import_chunk_BW3RNEVI.meta_default.id]: Plugin.lazy(() => import("./plugin-surface-CCSIONYW.cjs"))
611
- },
612
- meta: [
613
- import_chunk_VWHAALIN.meta_default,
614
- import_chunk_FCMHRU3M.meta_default,
615
- import_chunk_BW3RNEVI.meta_default,
616
- ...meta
106
+ SettingsAction2.Open = Open;
107
+ })(SettingsAction || (SettingsAction = {}));
108
+ var SettingsPlugin = () => (0, import_chunk_FBA4BB3J.definePlugin)({
109
+ id: SETTINGS_PLUGIN
110
+ }, [
111
+ (0, import_chunk_FBA4BB3J.defineModule)({
112
+ id: `${SETTINGS_PLUGIN}/module/store`,
113
+ activatesOn: import_chunk_FBA4BB3J.Events.Startup,
114
+ activatesBefore: [
115
+ import_chunk_FBA4BB3J.Events.SetupSettings
617
116
  ],
618
- core: [
619
- import_chunk_VWHAALIN.meta_default.id,
620
- import_chunk_FCMHRU3M.meta_default.id,
621
- import_chunk_BW3RNEVI.meta_default.id,
622
- ...core
117
+ activatesAfter: [
118
+ import_chunk_FBA4BB3J.Events.SettingsReady
623
119
  ],
624
- ...params
625
- });
626
- (0, import_invariant.invariant)(hostPlugin.provides, void 0, {
627
- F: __dxlog_file2,
628
- L: 53,
629
- S: void 0,
630
- A: [
631
- "hostPlugin.provides",
632
- ""
633
- ]
634
- });
635
- const { context: Context, root: Root } = hostPlugin.provides;
636
- (0, import_invariant.invariant)(Context, void 0, {
637
- F: __dxlog_file2,
638
- L: 55,
639
- S: void 0,
640
- A: [
641
- "Context",
642
- ""
643
- ]
644
- });
645
- (0, import_invariant.invariant)(Root, void 0, {
646
- F: __dxlog_file2,
647
- L: 56,
648
- S: void 0,
649
- A: [
650
- "Root",
651
- ""
652
- ]
653
- });
654
- return () => /* @__PURE__ */ import_react4.default.createElement(Context, null, /* @__PURE__ */ import_react4.default.createElement(Root, null));
655
- };
120
+ activate: (context) => {
121
+ const allSettings = context.requestCapabilities(import_chunk_FBA4BB3J.Capabilities.Settings);
122
+ const settingsStore = new import_local_storage.RootSettingsStore();
123
+ allSettings.forEach((setting) => {
124
+ settingsStore.createStore(setting);
125
+ });
126
+ return (0, import_chunk_FBA4BB3J.contributes)(import_chunk_FBA4BB3J.Capabilities.SettingsStore, settingsStore);
127
+ }
128
+ })
129
+ ]);
656
130
  // Annotate the CommonJS export names for ESM import in node:
657
131
  0 && (module.exports = {
658
132
  ActiveParts,
133
+ Capabilities,
659
134
  ErrorBoundary,
660
- HostPlugin,
135
+ Events,
136
+ FileInfoSchema,
661
137
  INTENT_ACTION,
138
+ INTENT_PLUGIN,
662
139
  IntentAction,
140
+ IntentPlugin,
663
141
  IntentProvider,
664
142
  LAYOUT_ACTION,
665
143
  LAYOUT_PLUGIN,
@@ -670,7 +148,10 @@ var createApp = ({ meta, plugins, core, ...params }) => {
670
148
  NAVIGATION_PLUGIN,
671
149
  NavigationAction,
672
150
  Plugin,
673
- PluginProvider,
151
+ PluginManager,
152
+ PluginManagerProvider,
153
+ PluginModule,
154
+ PluginsContext,
674
155
  Resource,
675
156
  ResourceKey,
676
157
  ResourceLanguage,
@@ -682,49 +163,40 @@ var createApp = ({ meta, plugins, core, ...params }) => {
682
163
  SLUG_LIST_SEPARATOR,
683
164
  SLUG_PATH_SEPARATOR,
684
165
  SettingsAction,
166
+ SettingsPlugin,
685
167
  Surface,
686
- SurfaceProvider,
687
168
  Toast,
169
+ allOf,
688
170
  chain,
171
+ contributes,
689
172
  createApp,
690
173
  createDispatcher,
691
174
  createIntent,
692
175
  createResolver,
693
176
  createSurface,
694
177
  defaultFileTypes,
178
+ defineCapability,
179
+ defineEvent,
180
+ defineModule,
695
181
  definePlugin,
696
- filterPlugins,
697
- findPlugin,
182
+ eventKey,
698
183
  firstIdInPart,
699
- getPlugin,
184
+ getEvents,
700
185
  indexInPart,
186
+ isAllOf,
701
187
  isLayoutAdjustment,
702
188
  isLayoutMode,
703
189
  isLayoutParts,
704
- isObject,
190
+ isOneOf,
191
+ isSurfaceAvailable,
192
+ lazy,
193
+ oneOf,
705
194
  openIds,
706
- parseFileManagerPlugin,
707
- parseGraphBuilderPlugin,
708
- parseGraphPlugin,
709
- parseGraphSerializerPlugin,
710
- parseIntentPlugin,
711
- parseIntentResolverPlugin,
712
- parseLayoutPlugin,
713
- parseMetadataRecordsPlugin,
714
- parseMetadataResolverPlugin,
715
- parseNavigationPlugin,
716
- parseRootSurfacePlugin,
717
- parseSettingsPlugin,
718
- parseSurfacePlugin,
719
- parseTranslationsPlugin,
720
195
  partLength,
721
- resolvePlugin,
196
+ useCapabilities,
197
+ useCapability,
722
198
  useIntentDispatcher,
723
199
  useIntentResolver,
724
- usePlugin,
725
- usePlugins,
726
- useResolvePlugin,
727
- useResolvePlugins,
728
- useSurfaceRoot
200
+ usePluginManager
729
201
  });
730
202
  //# sourceMappingURL=index.cjs.map