@dxos/app-framework 0.7.4 → 0.7.5-labs.071a3e2

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 (389) hide show
  1. package/dist/lib/browser/app-graph-builder-MOLT4EHG.mjs +137 -0
  2. package/dist/lib/browser/app-graph-builder-MOLT4EHG.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-G3HBVVT5.mjs +1403 -0
  4. package/dist/lib/browser/chunk-G3HBVVT5.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-LDJ3T4V3.mjs +32 -0
  6. package/dist/lib/browser/chunk-LDJ3T4V3.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-TGOF2WQZ.mjs +285 -0
  8. package/dist/lib/browser/chunk-TGOF2WQZ.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +135 -543
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/intent-dispatcher-LJKNIGAM.mjs +11 -0
  12. package/dist/lib/browser/intent-resolver-Z724VAMC.mjs +38 -0
  13. package/dist/lib/browser/intent-resolver-Z724VAMC.mjs.map +7 -0
  14. package/dist/lib/browser/meta.json +1 -1
  15. package/dist/lib/browser/store-NWCY7LAP.mjs +19 -0
  16. package/dist/lib/browser/store-NWCY7LAP.mjs.map +7 -0
  17. package/dist/lib/browser/testing/index.mjs +74 -0
  18. package/dist/lib/browser/testing/index.mjs.map +7 -0
  19. package/dist/lib/browser/worker.mjs +77 -0
  20. package/dist/lib/node/app-graph-builder-G7SRXDFD.cjs +146 -0
  21. package/dist/lib/node/app-graph-builder-G7SRXDFD.cjs.map +7 -0
  22. package/dist/lib/node/chunk-55KIQ6YK.cjs +1437 -0
  23. package/dist/lib/node/chunk-55KIQ6YK.cjs.map +7 -0
  24. package/dist/lib/node/chunk-5GABBW2Q.cjs +308 -0
  25. package/dist/lib/node/chunk-5GABBW2Q.cjs.map +7 -0
  26. package/dist/lib/node/chunk-QLVQ6PND.cjs +58 -0
  27. package/dist/lib/node/chunk-QLVQ6PND.cjs.map +7 -0
  28. package/dist/lib/node/index.cjs +136 -558
  29. package/dist/lib/node/index.cjs.map +4 -4
  30. package/dist/lib/node/{plugin-settings-OZ6IKAE5.cjs → intent-dispatcher-CGUK3BCJ.cjs} +10 -10
  31. package/dist/lib/node/intent-dispatcher-CGUK3BCJ.cjs.map +7 -0
  32. package/dist/lib/node/intent-resolver-7GNKPRWT.cjs +45 -0
  33. package/dist/lib/node/intent-resolver-7GNKPRWT.cjs.map +7 -0
  34. package/dist/lib/node/meta.json +1 -1
  35. package/dist/lib/node/store-WMJSEQPC.cjs +34 -0
  36. package/dist/lib/node/store-WMJSEQPC.cjs.map +7 -0
  37. package/dist/lib/node/testing/index.cjs +98 -0
  38. package/dist/lib/node/testing/index.cjs.map +7 -0
  39. package/dist/lib/node/worker.cjs +99 -0
  40. package/dist/lib/node/worker.cjs.map +7 -0
  41. package/dist/lib/node-esm/app-graph-builder-MKLYH3NE.mjs +138 -0
  42. package/dist/lib/node-esm/app-graph-builder-MKLYH3NE.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-47FG42II.mjs +286 -0
  44. package/dist/lib/node-esm/chunk-47FG42II.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-CNJYZNSL.mjs +34 -0
  46. package/dist/lib/node-esm/chunk-CNJYZNSL.mjs.map +7 -0
  47. package/dist/lib/node-esm/chunk-ZTB4TA6Q.mjs +1405 -0
  48. package/dist/lib/node-esm/chunk-ZTB4TA6Q.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +135 -543
  50. package/dist/lib/node-esm/index.mjs.map +4 -4
  51. package/dist/lib/node-esm/intent-dispatcher-RZAWA4XD.mjs +12 -0
  52. package/dist/lib/node-esm/intent-resolver-UIU37CKJ.mjs +39 -0
  53. package/dist/lib/node-esm/intent-resolver-UIU37CKJ.mjs.map +7 -0
  54. package/dist/lib/node-esm/meta.json +1 -1
  55. package/dist/lib/node-esm/store-YUWINFBN.mjs +20 -0
  56. package/dist/lib/node-esm/store-YUWINFBN.mjs.map +7 -0
  57. package/dist/lib/node-esm/testing/index.mjs +75 -0
  58. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  59. package/dist/lib/node-esm/worker.mjs +78 -0
  60. package/dist/types/src/App.d.ts +22 -13
  61. package/dist/types/src/App.d.ts.map +1 -1
  62. package/dist/types/src/common/capabilities.d.ts +296 -0
  63. package/dist/types/src/common/capabilities.d.ts.map +1 -0
  64. package/dist/types/src/common/events.d.ts +48 -0
  65. package/dist/types/src/common/events.d.ts.map +1 -0
  66. package/dist/types/src/common/file.d.ts +14 -0
  67. package/dist/types/src/common/file.d.ts.map +1 -0
  68. package/dist/types/src/common/graph.d.ts +21 -0
  69. package/dist/types/src/common/graph.d.ts.map +1 -0
  70. package/dist/types/src/common/index.d.ts +8 -0
  71. package/dist/types/src/common/index.d.ts.map +1 -0
  72. package/dist/types/src/common/layout.d.ts +248 -0
  73. package/dist/types/src/common/layout.d.ts.map +1 -0
  74. package/dist/types/src/common/surface.d.ts +68 -0
  75. package/dist/types/src/common/surface.d.ts.map +1 -0
  76. package/dist/types/src/common/translations.d.ts +11 -0
  77. package/dist/types/src/common/translations.d.ts.map +1 -0
  78. package/dist/types/src/core/capabilities.d.ts +94 -0
  79. package/dist/types/src/core/capabilities.d.ts.map +1 -0
  80. package/dist/types/src/core/capabilities.test.d.ts +2 -0
  81. package/dist/types/src/core/capabilities.test.d.ts.map +1 -0
  82. package/dist/types/src/core/events.d.ts +58 -0
  83. package/dist/types/src/core/events.d.ts.map +1 -0
  84. package/dist/types/src/core/index.d.ts +5 -0
  85. package/dist/types/src/core/index.d.ts.map +1 -0
  86. package/dist/types/src/core/manager.d.ts +119 -0
  87. package/dist/types/src/core/manager.d.ts.map +1 -0
  88. package/dist/types/src/core/manager.test.d.ts +2 -0
  89. package/dist/types/src/core/manager.test.d.ts.map +1 -0
  90. package/dist/types/src/core/plugin.d.ts +97 -0
  91. package/dist/types/src/core/plugin.d.ts.map +1 -0
  92. package/dist/types/src/helpers.d.ts +10 -0
  93. package/dist/types/src/helpers.d.ts.map +1 -0
  94. package/dist/types/src/helpers.test.d.ts +2 -0
  95. package/dist/types/src/helpers.test.d.ts.map +1 -0
  96. package/dist/types/src/index.d.ts +5 -1
  97. package/dist/types/src/index.d.ts.map +1 -1
  98. package/dist/types/src/playground/debug/Debug.d.ts +6 -0
  99. package/dist/types/src/playground/debug/Debug.d.ts.map +1 -0
  100. package/dist/types/src/playground/debug/index.d.ts +2 -0
  101. package/dist/types/src/playground/debug/index.d.ts.map +1 -0
  102. package/dist/types/src/playground/debug/plugin.d.ts +2 -0
  103. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -0
  104. package/dist/types/src/playground/generator/Main.d.ts +6 -0
  105. package/dist/types/src/playground/generator/Main.d.ts.map +1 -0
  106. package/dist/types/src/playground/generator/Toolbar.d.ts +6 -0
  107. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -0
  108. package/dist/types/src/playground/generator/generator.d.ts +7 -0
  109. package/dist/types/src/playground/generator/generator.d.ts.map +1 -0
  110. package/dist/types/src/playground/generator/index.d.ts +3 -0
  111. package/dist/types/src/playground/generator/index.d.ts.map +1 -0
  112. package/dist/types/src/playground/generator/plugin.d.ts +2 -0
  113. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -0
  114. package/dist/types/src/playground/layout/Layout.d.ts +8 -0
  115. package/dist/types/src/playground/layout/Layout.d.ts.map +1 -0
  116. package/dist/types/src/playground/layout/index.d.ts +2 -0
  117. package/dist/types/src/playground/layout/index.d.ts.map +1 -0
  118. package/dist/types/src/playground/layout/plugin.d.ts +2 -0
  119. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -0
  120. package/dist/types/src/playground/logger/Toolbar.d.ts +6 -0
  121. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -0
  122. package/dist/types/src/playground/logger/index.d.ts +2 -0
  123. package/dist/types/src/playground/logger/index.d.ts.map +1 -0
  124. package/dist/types/src/playground/logger/plugin.d.ts +2 -0
  125. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -0
  126. package/dist/types/src/playground/logger/schema.d.ts +13 -0
  127. package/dist/types/src/playground/logger/schema.d.ts.map +1 -0
  128. package/dist/types/src/playground/playground.stories.d.ts +10 -0
  129. package/dist/types/src/playground/playground.stories.d.ts.map +1 -0
  130. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +2 -0
  131. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -0
  132. package/dist/types/src/plugin-intent/actions.d.ts +23 -0
  133. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -0
  134. package/dist/types/src/plugin-intent/errors.d.ts +16 -0
  135. package/dist/types/src/plugin-intent/errors.d.ts.map +1 -0
  136. package/dist/types/src/plugin-intent/index.d.ts +5 -0
  137. package/dist/types/src/plugin-intent/index.d.ts.map +1 -0
  138. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +113 -0
  139. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -0
  140. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +2 -0
  141. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
  142. package/dist/types/src/plugin-intent/intent.d.ts +68 -0
  143. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -0
  144. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -0
  145. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -0
  146. package/dist/types/src/plugin-settings/actions.d.ts +27 -0
  147. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
  148. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +197 -0
  149. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -0
  150. package/dist/types/src/plugin-settings/index.d.ts +3 -0
  151. package/dist/types/src/plugin-settings/index.d.ts.map +1 -0
  152. package/dist/types/src/plugin-settings/intent-resolver.d.ts +4 -0
  153. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -0
  154. package/dist/types/src/plugin-settings/store.d.ts +5 -0
  155. package/dist/types/src/plugin-settings/store.d.ts.map +1 -0
  156. package/dist/types/src/plugin-settings/translations.d.ts +11 -0
  157. package/dist/types/src/plugin-settings/translations.d.ts.map +1 -0
  158. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
  159. package/dist/types/src/react/IntentContext.d.ts +8 -0
  160. package/dist/types/src/react/IntentContext.d.ts.map +1 -0
  161. package/dist/types/src/react/PluginManagerProvider.d.ts +10 -0
  162. package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -0
  163. package/dist/types/src/react/Surface.d.ts +12 -0
  164. package/dist/types/src/react/Surface.d.ts.map +1 -0
  165. package/dist/types/src/react/Surface.stories.d.ts +16 -0
  166. package/dist/types/src/react/Surface.stories.d.ts.map +1 -0
  167. package/dist/types/src/react/common.d.ts +12 -0
  168. package/dist/types/src/react/common.d.ts.map +1 -0
  169. package/dist/types/src/react/index.d.ts +7 -0
  170. package/dist/types/src/react/index.d.ts.map +1 -0
  171. package/dist/types/src/react/useCapabilities.d.ts +13 -0
  172. package/dist/types/src/react/useCapabilities.d.ts.map +1 -0
  173. package/dist/types/src/react/useIntentResolver.d.ts +3 -0
  174. package/dist/types/src/react/useIntentResolver.d.ts.map +1 -0
  175. package/dist/types/src/testing/index.d.ts +2 -0
  176. package/dist/types/src/testing/index.d.ts.map +1 -0
  177. package/dist/types/src/testing/withPluginManager.d.ts +10 -0
  178. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -0
  179. package/dist/types/src/testing/withPluginManager.stories.d.ts +5 -0
  180. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -0
  181. package/dist/types/src/worker.d.ts +4 -0
  182. package/dist/types/src/worker.d.ts.map +1 -0
  183. package/dist/types/tsconfig.tsbuildinfo +1 -0
  184. package/package.json +39 -17
  185. package/project.json +4 -3
  186. package/src/App.tsx +139 -34
  187. package/src/common/capabilities.ts +97 -0
  188. package/src/common/events.ts +72 -0
  189. package/src/common/file.ts +22 -0
  190. package/src/common/graph.ts +30 -0
  191. package/src/{plugins/common → common}/index.ts +3 -2
  192. package/src/common/layout.ts +225 -0
  193. package/src/common/surface.ts +81 -0
  194. package/src/common/translations.ts +17 -0
  195. package/src/core/capabilities.test.ts +116 -0
  196. package/src/core/capabilities.ts +222 -0
  197. package/src/core/events.ts +58 -0
  198. package/src/core/index.ts +8 -0
  199. package/src/core/manager.test.ts +516 -0
  200. package/src/core/manager.ts +511 -0
  201. package/src/core/plugin.ts +131 -0
  202. package/src/helpers.test.ts +97 -0
  203. package/src/helpers.ts +45 -0
  204. package/src/index.ts +6 -3
  205. package/src/playground/debug/Debug.tsx +39 -0
  206. package/src/playground/debug/index.ts +5 -0
  207. package/src/playground/debug/plugin.ts +17 -0
  208. package/src/playground/generator/Main.tsx +71 -0
  209. package/src/playground/generator/Toolbar.tsx +46 -0
  210. package/src/playground/generator/generator.ts +48 -0
  211. package/src/playground/generator/index.ts +6 -0
  212. package/src/playground/generator/plugin.ts +23 -0
  213. package/src/playground/layout/Layout.tsx +33 -0
  214. package/src/playground/layout/index.ts +5 -0
  215. package/src/playground/layout/plugin.ts +17 -0
  216. package/src/playground/logger/Toolbar.tsx +29 -0
  217. package/src/playground/logger/index.ts +5 -0
  218. package/src/playground/logger/plugin.ts +36 -0
  219. package/src/playground/logger/schema.ts +12 -0
  220. package/src/playground/playground.stories.tsx +34 -0
  221. package/src/plugin-intent/IntentPlugin.tsx +20 -0
  222. package/src/plugin-intent/actions.ts +22 -0
  223. package/src/plugin-intent/errors.ts +39 -0
  224. package/src/plugin-intent/index.ts +8 -0
  225. package/src/plugin-intent/intent-dispatcher.test.ts +299 -0
  226. package/src/plugin-intent/intent-dispatcher.ts +304 -0
  227. package/src/plugin-intent/intent.ts +146 -0
  228. package/src/plugin-settings/SettingsPlugin.ts +35 -0
  229. package/src/plugin-settings/actions.ts +27 -0
  230. package/src/plugin-settings/app-graph-builder.ts +122 -0
  231. package/src/plugin-settings/index.ts +6 -0
  232. package/src/plugin-settings/intent-resolver.ts +28 -0
  233. package/src/plugin-settings/store.ts +20 -0
  234. package/src/plugin-settings/translations.ts +17 -0
  235. package/src/react/IntentContext.tsx +34 -0
  236. package/src/react/PluginManagerProvider.ts +22 -0
  237. package/src/react/Surface.stories.tsx +96 -0
  238. package/src/react/Surface.tsx +75 -0
  239. package/src/react/common.ts +12 -0
  240. package/src/react/index.ts +10 -0
  241. package/src/react/useCapabilities.ts +40 -0
  242. package/src/react/useIntentResolver.ts +22 -0
  243. package/src/testing/index.ts +5 -0
  244. package/src/testing/withPluginManager.stories.tsx +47 -0
  245. package/src/testing/withPluginManager.tsx +75 -0
  246. package/src/worker.ts +11 -0
  247. package/tsconfig.json +54 -2
  248. package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
  249. package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
  250. package/dist/lib/browser/chunk-653Y45CL.mjs +0 -41
  251. package/dist/lib/browser/chunk-653Y45CL.mjs.map +0 -7
  252. package/dist/lib/browser/chunk-FRXJ25VI.mjs +0 -214
  253. package/dist/lib/browser/chunk-FRXJ25VI.mjs.map +0 -7
  254. package/dist/lib/browser/chunk-YXM35XRE.mjs +0 -213
  255. package/dist/lib/browser/chunk-YXM35XRE.mjs.map +0 -7
  256. package/dist/lib/browser/plugin-intent-LU4KL2RO.mjs +0 -22
  257. package/dist/lib/browser/plugin-settings-OM3G2QFY.mjs +0 -11
  258. package/dist/lib/browser/plugin-surface-LECZMKSQ.mjs +0 -24
  259. package/dist/lib/node/chunk-JZ2JVKRY.cjs +0 -58
  260. package/dist/lib/node/chunk-JZ2JVKRY.cjs.map +0 -7
  261. package/dist/lib/node/chunk-QBM42OQ6.cjs +0 -97
  262. package/dist/lib/node/chunk-QBM42OQ6.cjs.map +0 -7
  263. package/dist/lib/node/chunk-QSVP5HOW.cjs +0 -238
  264. package/dist/lib/node/chunk-QSVP5HOW.cjs.map +0 -7
  265. package/dist/lib/node/chunk-SOVLKUWI.cjs +0 -236
  266. package/dist/lib/node/chunk-SOVLKUWI.cjs.map +0 -7
  267. package/dist/lib/node/plugin-intent-FVFR2LKB.cjs +0 -43
  268. package/dist/lib/node/plugin-intent-FVFR2LKB.cjs.map +0 -7
  269. package/dist/lib/node/plugin-settings-OZ6IKAE5.cjs.map +0 -7
  270. package/dist/lib/node/plugin-surface-YWDRXQTD.cjs +0 -45
  271. package/dist/lib/node/plugin-surface-YWDRXQTD.cjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-2R4GVK7O.mjs +0 -215
  273. package/dist/lib/node-esm/chunk-2R4GVK7O.mjs.map +0 -7
  274. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs +0 -74
  275. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs.map +0 -7
  276. package/dist/lib/node-esm/chunk-YFMFQBB4.mjs +0 -214
  277. package/dist/lib/node-esm/chunk-YFMFQBB4.mjs.map +0 -7
  278. package/dist/lib/node-esm/chunk-YNU7FTGJ.mjs +0 -43
  279. package/dist/lib/node-esm/chunk-YNU7FTGJ.mjs.map +0 -7
  280. package/dist/lib/node-esm/plugin-intent-V7ER24Y6.mjs +0 -23
  281. package/dist/lib/node-esm/plugin-settings-37UVWF2V.mjs +0 -12
  282. package/dist/lib/node-esm/plugin-settings-37UVWF2V.mjs.map +0 -7
  283. package/dist/lib/node-esm/plugin-surface-TEU42XQN.mjs +0 -25
  284. package/dist/lib/node-esm/plugin-surface-TEU42XQN.mjs.map +0 -7
  285. package/dist/types/src/plugins/common/file.d.ts +0 -22
  286. package/dist/types/src/plugins/common/file.d.ts.map +0 -1
  287. package/dist/types/src/plugins/common/graph.d.ts +0 -51
  288. package/dist/types/src/plugins/common/graph.d.ts.map +0 -1
  289. package/dist/types/src/plugins/common/index.d.ts +0 -7
  290. package/dist/types/src/plugins/common/index.d.ts.map +0 -1
  291. package/dist/types/src/plugins/common/layout.d.ts +0 -202
  292. package/dist/types/src/plugins/common/layout.d.ts.map +0 -1
  293. package/dist/types/src/plugins/common/metadata.d.ts +0 -16
  294. package/dist/types/src/plugins/common/metadata.d.ts.map +0 -1
  295. package/dist/types/src/plugins/common/navigation.d.ts +0 -196
  296. package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
  297. package/dist/types/src/plugins/common/translations.d.ts +0 -22
  298. package/dist/types/src/plugins/common/translations.d.ts.map +0 -1
  299. package/dist/types/src/plugins/helpers.d.ts +0 -41
  300. package/dist/types/src/plugins/helpers.d.ts.map +0 -1
  301. package/dist/types/src/plugins/index.d.ts +0 -7
  302. package/dist/types/src/plugins/index.d.ts.map +0 -1
  303. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +0 -21
  304. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +0 -1
  305. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts +0 -14
  306. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts.map +0 -1
  307. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts +0 -47
  308. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts.map +0 -1
  309. package/dist/types/src/plugins/plugin-host/index.d.ts +0 -4
  310. package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
  311. package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -98
  312. package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +0 -1
  313. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts +0 -35
  314. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts.map +0 -1
  315. package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts +0 -21
  316. package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +0 -1
  317. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts +0 -8
  318. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +0 -1
  319. package/dist/types/src/plugins/plugin-intent/helpers.d.ts +0 -6
  320. package/dist/types/src/plugins/plugin-intent/helpers.d.ts.map +0 -1
  321. package/dist/types/src/plugins/plugin-intent/index.d.ts +0 -6
  322. package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
  323. package/dist/types/src/plugins/plugin-intent/intent.d.ts +0 -81
  324. package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
  325. package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -5
  326. package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
  327. package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -20
  328. package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +0 -1
  329. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts +0 -4
  330. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  331. package/dist/types/src/plugins/plugin-settings/index.d.ts +0 -4
  332. package/dist/types/src/plugins/plugin-settings/index.d.ts.map +0 -1
  333. package/dist/types/src/plugins/plugin-settings/meta.d.ts +0 -5
  334. package/dist/types/src/plugins/plugin-settings/meta.d.ts.map +0 -1
  335. package/dist/types/src/plugins/plugin-settings/provides.d.ts +0 -13
  336. package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +0 -1
  337. package/dist/types/src/plugins/plugin-surface/ErrorBoundary.d.ts.map +0 -1
  338. package/dist/types/src/plugins/plugin-surface/Surface.d.ts +0 -62
  339. package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
  340. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts +0 -7
  341. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +0 -1
  342. package/dist/types/src/plugins/plugin-surface/SurfaceRootContext.d.ts +0 -39
  343. package/dist/types/src/plugins/plugin-surface/SurfaceRootContext.d.ts.map +0 -1
  344. package/dist/types/src/plugins/plugin-surface/helpers.d.ts +0 -21
  345. package/dist/types/src/plugins/plugin-surface/helpers.d.ts.map +0 -1
  346. package/dist/types/src/plugins/plugin-surface/index.d.ts +0 -8
  347. package/dist/types/src/plugins/plugin-surface/index.d.ts.map +0 -1
  348. package/dist/types/src/plugins/plugin-surface/meta.d.ts +0 -5
  349. package/dist/types/src/plugins/plugin-surface/meta.d.ts.map +0 -1
  350. package/dist/types/src/plugins/plugin-surface/provides.d.ts +0 -16
  351. package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +0 -1
  352. package/src/plugins/common/file.ts +0 -36
  353. package/src/plugins/common/graph.ts +0 -70
  354. package/src/plugins/common/layout.ts +0 -155
  355. package/src/plugins/common/metadata.ts +0 -29
  356. package/src/plugins/common/navigation.ts +0 -185
  357. package/src/plugins/common/translations.ts +0 -36
  358. package/src/plugins/helpers.ts +0 -92
  359. package/src/plugins/index.ts +0 -11
  360. package/src/plugins/plugin-host/HostPlugin.tsx +0 -96
  361. package/src/plugins/plugin-host/PluginContainer.tsx +0 -120
  362. package/src/plugins/plugin-host/PluginContext.tsx +0 -79
  363. package/src/plugins/plugin-host/index.ts +0 -8
  364. package/src/plugins/plugin-host/plugin.test.ts +0 -158
  365. package/src/plugins/plugin-host/plugin.ts +0 -126
  366. package/src/plugins/plugin-intent/IntentContext.tsx +0 -49
  367. package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -151
  368. package/src/plugins/plugin-intent/helpers.ts +0 -11
  369. package/src/plugins/plugin-intent/index.ts +0 -12
  370. package/src/plugins/plugin-intent/intent.ts +0 -101
  371. package/src/plugins/plugin-intent/meta.ts +0 -9
  372. package/src/plugins/plugin-intent/provides.ts +0 -38
  373. package/src/plugins/plugin-settings/SettingsPlugin.tsx +0 -22
  374. package/src/plugins/plugin-settings/index.ts +0 -9
  375. package/src/plugins/plugin-settings/meta.ts +0 -9
  376. package/src/plugins/plugin-settings/provides.ts +0 -29
  377. package/src/plugins/plugin-surface/Surface.tsx +0 -195
  378. package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -33
  379. package/src/plugins/plugin-surface/SurfaceRootContext.tsx +0 -60
  380. package/src/plugins/plugin-surface/helpers.ts +0 -22
  381. package/src/plugins/plugin-surface/index.ts +0 -14
  382. package/src/plugins/plugin-surface/meta.ts +0 -9
  383. package/src/plugins/plugin-surface/provides.ts +0 -26
  384. /package/dist/lib/browser/{plugin-intent-LU4KL2RO.mjs.map → intent-dispatcher-LJKNIGAM.mjs.map} +0 -0
  385. /package/dist/lib/browser/{plugin-settings-OM3G2QFY.mjs.map → worker.mjs.map} +0 -0
  386. /package/dist/lib/{browser/plugin-surface-LECZMKSQ.mjs.map → node-esm/intent-dispatcher-RZAWA4XD.mjs.map} +0 -0
  387. /package/dist/lib/node-esm/{plugin-intent-V7ER24Y6.mjs.map → worker.mjs.map} +0 -0
  388. /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
  389. /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
@@ -1,572 +1,164 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- IntentAction,
4
- IntentProvider,
5
- meta_default,
6
- parseIntentPlugin,
7
- parseIntentResolverPlugin,
8
- useIntent,
9
- useIntentDispatcher,
10
- useIntentResolver
11
- } from "./chunk-YFMFQBB4.mjs";
12
2
  import {
13
3
  ErrorBoundary,
4
+ PluginManagerProvider,
14
5
  Surface,
15
- SurfaceProvider,
16
- isObject,
17
- meta_default as meta_default2,
18
- parseRootSurfacePlugin,
19
- parseSurfacePlugin,
20
- useSurface,
21
- useSurfaceRoot
22
- } from "./chunk-2R4GVK7O.mjs";
6
+ createApp,
7
+ isSurfaceAvailable,
8
+ useAppGraph,
9
+ useCapabilities,
10
+ useCapability,
11
+ useIntentDispatcher,
12
+ useIntentResolver,
13
+ useLayout,
14
+ usePluginManager,
15
+ useSurfaces
16
+ } from "./chunk-47FG42II.mjs";
23
17
  import {
24
- definePlugin,
25
- filterPlugins,
26
- findPlugin,
27
- getPlugin,
28
- resolvePlugin
29
- } from "./chunk-EYCTSFEJ.mjs";
18
+ SETTINGS_ACTION,
19
+ SETTINGS_ID,
20
+ SETTINGS_KEY,
21
+ SETTINGS_PLUGIN,
22
+ SettingsAction
23
+ } from "./chunk-CNJYZNSL.mjs";
30
24
  import {
31
- SettingsAction,
32
- meta_default as meta_default3,
33
- parseSettingsPlugin
34
- } from "./chunk-YNU7FTGJ.mjs";
35
-
36
- // packages/sdk/app-framework/src/plugins/common/file.ts
37
- var defaultFileTypes = {
38
- images: [
39
- "png",
40
- "jpg",
41
- "jpeg",
42
- "gif"
43
- ],
44
- media: [
45
- "mp3",
46
- "mp4",
47
- "mov",
48
- "avi"
49
- ],
50
- text: [
51
- "pdf",
52
- "txt",
53
- "md"
54
- ]
55
- };
56
- var parseFileManagerPlugin = (plugin) => {
57
- return plugin.provides.file ? plugin : void 0;
58
- };
59
-
60
- // packages/sdk/app-framework/src/plugins/common/graph.ts
61
- var parseGraphPlugin = (plugin) => plugin.provides.graph?.root ? plugin : void 0;
62
- var parseGraphBuilderPlugin = (plugin) => plugin.provides.graph?.builder ? plugin : void 0;
63
- var parseGraphSerializerPlugin = (plugin) => plugin.provides.graph?.serializer ? plugin : void 0;
64
-
65
- // packages/sdk/app-framework/src/plugins/common/layout.ts
66
- import { z } from "zod";
67
- var Toast = z.object({
68
- id: z.string(),
69
- title: z.string().optional(),
70
- description: z.string().optional(),
71
- // TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.
72
- icon: z.any().optional(),
73
- duration: z.number().optional(),
74
- closeLabel: z.string().optional(),
75
- actionLabel: z.string().optional(),
76
- actionAlt: z.string().optional(),
77
- onAction: z.function().optional()
78
- });
79
- var LayoutMode = z.union([
80
- z.literal("deck"),
81
- z.literal("solo"),
82
- z.literal("fullscreen")
83
- ]);
84
- var isLayoutMode = (value) => LayoutMode.safeParse(value).success;
85
- var Layout = z.object({
86
- layoutMode: z.union([
87
- z.literal("deck"),
88
- z.literal("solo"),
89
- z.literal("fullscreen")
90
- ]),
91
- sidebarOpen: z.boolean(),
92
- complementarySidebarOpen: z.boolean(),
93
- /**
94
- * @deprecated
95
- */
96
- complementarySidebarContent: z.any().optional().describe("DEPRECATED. Data to be passed to the complementary sidebar Surface."),
97
- dialogOpen: z.boolean(),
98
- dialogContent: z.any().optional().describe("Data to be passed to the dialog Surface."),
99
- // TODO(wittjosiah): Custom properties?
100
- dialogBlockAlign: z.union([
101
- z.literal("start"),
102
- z.literal("center")
103
- ]).optional(),
104
- dialogType: z.union([
105
- z.literal("default"),
106
- z.literal("alert")
107
- ]).optional(),
108
- popoverOpen: z.boolean(),
109
- popoverContent: z.any().optional().describe("Data to be passed to the popover Surface."),
110
- popoverAnchorId: z.string().optional(),
111
- toasts: z.array(Toast),
112
- scrollIntoView: z.string().optional().describe("The identifier of a component to scroll into view when it is mounted.")
113
- });
114
- var parseLayoutPlugin = (plugin) => {
115
- const { success } = Layout.safeParse(plugin.provides.layout);
116
- return success ? plugin : void 0;
117
- };
118
- var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
119
- var LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
120
- var LayoutAction;
121
- (function(LayoutAction2) {
122
- LayoutAction2[LayoutAction2["SET_LAYOUT"] = `${LAYOUT_ACTION}/set-layout`] = "SET_LAYOUT";
123
- LayoutAction2[LayoutAction2["SET_LAYOUT_MODE"] = `${LAYOUT_ACTION}/set-layout-mode`] = "SET_LAYOUT_MODE";
124
- LayoutAction2[LayoutAction2["SCROLL_INTO_VIEW"] = `${LAYOUT_ACTION}/scroll-into-view`] = "SCROLL_INTO_VIEW";
125
- LayoutAction2[LayoutAction2["UPDATE_PLANK_SIZE"] = `${LAYOUT_ACTION}/update-plank-size`] = "UPDATE_PLANK_SIZE";
126
- })(LayoutAction || (LayoutAction = {}));
127
-
128
- // packages/sdk/app-framework/src/plugins/common/metadata.ts
129
- var parseMetadataRecordsPlugin = (plugin) => {
130
- return plugin.provides.metadata?.records ? plugin : void 0;
131
- };
132
- var parseMetadataResolverPlugin = (plugin) => {
133
- return plugin.provides.metadata?.resolver ? plugin : void 0;
134
- };
135
-
136
- // packages/sdk/app-framework/src/plugins/common/navigation.ts
137
- import { Schema as S } from "@effect/schema";
138
- import { z as z2 } from "zod";
139
- import { pick } from "@dxos/util";
140
- var SLUG_LIST_SEPARATOR = "+";
141
- var SLUG_ENTRY_SEPARATOR = "_";
142
- var SLUG_KEY_VALUE_SEPARATOR = "-";
143
- var SLUG_PATH_SEPARATOR = "~";
144
- var SLUG_COLLECTION_INDICATOR = "";
145
- var LayoutEntrySchema = S.mutable(S.Struct({
146
- id: S.String,
147
- path: S.optional(S.String)
148
- }));
149
- var LayoutPartSchema = S.Union(S.Literal("sidebar"), S.Literal("main"), S.Literal("solo"), S.Literal("complementary"), S.Literal("fullScreen"));
150
- var LayoutPartsSchema = S.partial(S.mutable(S.Record({
151
- key: LayoutPartSchema,
152
- value: S.mutable(S.Array(LayoutEntrySchema))
153
- })));
154
- var LayoutCoordinateSchema = S.mutable(S.Struct({
155
- part: LayoutPartSchema,
156
- entryId: S.String
157
- }));
158
- var PartAdjustmentSchema = S.Union(S.Literal("increment-start"), S.Literal("increment-end"), S.Literal("solo"));
159
- var LayoutAdjustmentSchema = S.mutable(S.Struct({
160
- layoutCoordinate: LayoutCoordinateSchema,
161
- type: PartAdjustmentSchema
162
- }));
163
- var ActiveParts = z2.record(z2.string(), z2.union([
164
- z2.string(),
165
- z2.array(z2.string())
166
- ]));
167
- var LocationProvidesSchema = S.mutable(S.Struct({
168
- location: S.Struct({
169
- active: LayoutPartsSchema,
170
- closed: S.Array(S.String)
171
- })
172
- }));
173
- var isLayoutParts = (value) => {
174
- return S.is(LayoutPartsSchema)(value);
175
- };
176
- var isLayoutAdjustment = (value) => {
177
- return S.is(LayoutAdjustmentSchema)(value);
178
- };
179
- var parseNavigationPlugin = (plugin) => {
180
- const location = plugin.provides?.location;
181
- if (!location) {
182
- return void 0;
183
- }
184
- if (S.is(LocationProvidesSchema)({
185
- location
186
- })) {
187
- return plugin;
188
- }
189
- return void 0;
190
- };
191
- var openIds = (layout, parts) => {
192
- return Object.values(parts ? pick(layout, parts) : layout).flatMap((part) => part?.map((entry) => entry.id) ?? []).filter((id) => id !== void 0);
193
- };
194
- var firstIdInPart = (layout, part) => {
195
- if (!layout) {
196
- return void 0;
197
- }
198
- return layout[part]?.at(0)?.id;
199
- };
200
- var indexInPart = (layout, layoutCoordinate) => {
201
- if (!layout || !layoutCoordinate) {
202
- return void 0;
203
- }
204
- const { part, entryId } = layoutCoordinate;
205
- return layout[part]?.findIndex((entry) => entry.id === entryId);
206
- };
207
- var partLength = (layout, part) => {
208
- if (!layout || !part) {
209
- return 0;
210
- }
211
- return layout[part]?.length ?? 0;
212
- };
213
- var NAVIGATION_PLUGIN = "dxos.org/plugin/navigation";
214
- var NAVIGATION_ACTION = `${NAVIGATION_PLUGIN}/action`;
215
- var NavigationAction;
216
- (function(NavigationAction2) {
217
- NavigationAction2[NavigationAction2["OPEN"] = `${NAVIGATION_ACTION}/open`] = "OPEN";
218
- NavigationAction2[NavigationAction2["ADD_TO_ACTIVE"] = `${NAVIGATION_ACTION}/add-to-active`] = "ADD_TO_ACTIVE";
219
- NavigationAction2[NavigationAction2["SET"] = `${NAVIGATION_ACTION}/set`] = "SET";
220
- NavigationAction2[NavigationAction2["ADJUST"] = `${NAVIGATION_ACTION}/adjust`] = "ADJUST";
221
- NavigationAction2[NavigationAction2["CLOSE"] = `${NAVIGATION_ACTION}/close`] = "CLOSE";
222
- NavigationAction2[NavigationAction2["EXPOSE"] = `${NAVIGATION_ACTION}/expose`] = "EXPOSE";
223
- })(NavigationAction || (NavigationAction = {}));
224
-
225
- // packages/sdk/app-framework/src/plugins/common/translations.ts
226
- import { z as z3 } from "zod";
227
- var ResourceKey = z3.union([
228
- z3.string(),
229
- z3.record(z3.any())
230
- ]);
231
- var ResourceLanguage = z3.record(ResourceKey);
232
- var Resource = z3.record(ResourceLanguage);
233
- var parseTranslationsPlugin = (plugin) => {
234
- const { success } = z3.array(Resource).safeParse(plugin.provides.translations);
235
- return success ? plugin : void 0;
236
- };
237
-
238
- // packages/sdk/app-framework/src/plugins/plugin-host/plugin.ts
239
- var Plugin;
240
- (function(Plugin2) {
241
- Plugin2.lazy = (p, props) => {
242
- return () => p().then(({ default: definition }) => {
243
- return definition(props);
244
- });
245
- };
246
- })(Plugin || (Plugin = {}));
247
-
248
- // packages/sdk/app-framework/src/plugins/plugin-host/HostPlugin.tsx
249
- import React2 from "react";
250
- import { LocalStorageStore } from "@dxos/local-storage";
251
-
252
- // packages/sdk/app-framework/src/plugins/plugin-host/PluginContainer.tsx
253
- import React, { useEffect, useState } from "react";
254
- import { log } from "@dxos/log";
255
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/plugins/plugin-host/PluginContainer.tsx";
256
- var PluginContainer = ({ plugins: definitions, core, state, placeholder }) => {
257
- const [error, setError] = useState();
258
- useEffect(() => {
259
- log("initializing plugins", {
260
- enabled: state.enabled
261
- }, {
262
- F: __dxlog_file,
263
- L: 26,
264
- S: void 0,
265
- C: (f, a) => f(...a)
266
- });
267
- const t = setTimeout(async () => {
268
- try {
269
- const enabledIds = [
270
- ...core,
271
- ...state.enabled
272
- ];
273
- const enabled = await Promise.all(enabledIds.map((id) => definitions[id]).filter((definition) => Boolean(definition)).map((definition) => definition()));
274
- const plugins = await Promise.all(enabled.map(async (definition) => {
275
- const plugin = await initializePlugin(definition).catch((err) => {
276
- log.error("Failed to initialize plugin:", {
277
- id: definition.meta.id,
278
- err
279
- }, {
280
- F: __dxlog_file,
281
- L: 41,
282
- S: void 0,
283
- C: (f, a) => f(...a)
284
- });
285
- });
286
- log("initialized", {
287
- plugin: definition.meta.id
288
- }, {
289
- F: __dxlog_file,
290
- L: 44,
291
- S: void 0,
292
- C: (f, a) => f(...a)
293
- });
294
- return plugin;
295
- }));
296
- const initialized = plugins.filter((plugin) => Boolean(plugin));
297
- log("plugins initialized", {
298
- plugins: initialized
299
- }, {
300
- F: __dxlog_file,
301
- L: 50,
302
- S: void 0,
303
- C: (f, a) => f(...a)
304
- });
305
- await Promise.all(enabled.map((plugin) => plugin.ready?.(initialized)));
306
- log("plugins ready", {
307
- plugins: initialized
308
- }, {
309
- F: __dxlog_file,
310
- L: 53,
311
- S: void 0,
312
- C: (f, a) => f(...a)
313
- });
314
- state.plugins = initialized;
315
- state.ready = true;
316
- } catch (err) {
317
- setError(err);
318
- }
319
- });
320
- return () => {
321
- clearTimeout(t);
322
- state.ready = false;
323
- };
324
- }, []);
325
- if (error) {
326
- throw error;
327
- }
328
- if (!state.ready) {
329
- return /* @__PURE__ */ React.createElement(React.Fragment, null, placeholder);
330
- }
331
- const ComposedContext = composeContext(state.plugins);
332
- return /* @__PURE__ */ React.createElement(ComposedContext, null, rootComponents(state.plugins));
333
- };
334
- var initializePlugin = async (pluginDefinition) => {
335
- const provides = await pluginDefinition.initialize?.();
336
- return {
337
- ...pluginDefinition,
338
- provides: {
339
- ...pluginDefinition.provides,
340
- ...provides
341
- }
342
- };
343
- };
344
- var rootComponents = (plugins) => {
345
- return plugins.map((plugin) => {
346
- const Component = plugin.provides.root;
347
- if (Component) {
348
- return /* @__PURE__ */ React.createElement(Component, {
349
- key: plugin.meta.id
350
- });
351
- } else {
352
- return null;
353
- }
354
- }).filter((node) => Boolean(node));
355
- };
356
- var composeContext = (plugins) => {
357
- return compose(plugins.map((p) => p.provides.context).filter(Boolean));
358
- };
359
- var compose = (contexts) => {
360
- return [
361
- ...contexts
362
- ].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ React.createElement(Acc, null, /* @__PURE__ */ React.createElement(Next, null, children)));
363
- };
364
-
365
- // packages/sdk/app-framework/src/plugins/plugin-host/PluginContext.tsx
366
- import { createContext, useContext, useMemo } from "react";
367
- import { raise } from "@dxos/debug";
368
- import { nonNullable } from "@dxos/util";
369
- var PluginContext = /* @__PURE__ */ createContext(void 0);
370
- var usePlugins = () => useContext(PluginContext) ?? raise(new Error("Missing PluginContext"));
371
- var usePlugin = (id) => {
372
- const { plugins } = usePlugins();
373
- return findPlugin(plugins, id);
374
- };
375
- var useResolvePlugin = (predicate) => {
376
- const { plugins } = usePlugins();
377
- return resolvePlugin(plugins, predicate);
378
- };
379
- var useResolvePlugins = (predicate) => {
380
- const { plugins } = usePlugins();
381
- return useMemo(() => plugins.map(predicate).filter(nonNullable), [
382
- plugins,
383
- predicate
384
- ]);
385
- };
386
- var PluginProvider = PluginContext.Provider;
25
+ Capabilities,
26
+ Events,
27
+ FileInfoSchema,
28
+ INTENT_ACTION,
29
+ INTENT_PLUGIN,
30
+ IntentAction,
31
+ IntentPlugin,
32
+ LAYOUT_ACTION,
33
+ LAYOUT_PLUGIN,
34
+ Label,
35
+ LayoutAction,
36
+ Plugin,
37
+ PluginManager,
38
+ PluginModule,
39
+ PluginsContext,
40
+ Resource,
41
+ ResourceKey,
42
+ ResourceLanguage,
43
+ allOf,
44
+ chain,
45
+ contributes,
46
+ createDispatcher,
47
+ createIntent,
48
+ createResolver,
49
+ createSurface,
50
+ defaultFileTypes,
51
+ defineCapability,
52
+ defineEvent,
53
+ defineModule,
54
+ definePlugin,
55
+ eventKey,
56
+ getEvents,
57
+ isAllOf,
58
+ isOneOf,
59
+ lazy,
60
+ oneOf
61
+ } from "./chunk-ZTB4TA6Q.mjs";
387
62
 
388
- // packages/sdk/app-framework/src/plugins/plugin-host/HostPlugin.tsx
389
- var parsePluginHost = (plugin) => plugin.provides.plugins ? plugin : void 0;
390
- var HOST_PLUGIN = "dxos.org/plugin/host";
391
- var HostPlugin = ({ plugins, meta, core, defaults = [], fallback = DefaultFallback, placeholder = null }) => {
392
- const state = new LocalStorageStore(HOST_PLUGIN, {
393
- ready: false,
394
- core,
395
- enabled: [
396
- ...defaults
397
- ],
398
- plugins: [],
399
- available: meta.filter(({ id }) => !core.includes(id)),
400
- // TODO(burdon): Functions should not be part of the settings type.
401
- setPlugin: (id, enabled) => {
402
- if (enabled) {
403
- state.values.enabled.push(id);
404
- } else {
405
- const index = state.values.enabled.findIndex((enabled2) => enabled2 === id);
406
- index !== -1 && state.values.enabled.splice(index, 1);
407
- }
408
- }
409
- });
410
- state.prop({
411
- key: "enabled",
412
- type: LocalStorageStore.json()
413
- });
414
- return {
415
- meta: {
416
- id: HOST_PLUGIN,
417
- name: "Plugin host"
418
- },
419
- provides: {
420
- plugins: state.values,
421
- context: ({ children }) => {
422
- return /* @__PURE__ */ React2.createElement(PluginProvider, {
423
- value: state.values
424
- }, children);
425
- },
426
- root: () => {
427
- return /* @__PURE__ */ React2.createElement(ErrorBoundary, {
428
- fallback
429
- }, /* @__PURE__ */ React2.createElement(PluginContainer, {
430
- plugins,
431
- core,
432
- state: state.values,
433
- placeholder
434
- }));
63
+ // packages/sdk/app-framework/src/plugin-settings/translations.ts
64
+ var translations_default = [
65
+ {
66
+ "en-US": {
67
+ [SETTINGS_PLUGIN]: {
68
+ "open settings label": "Open settings",
69
+ "app settings label": "Settings",
70
+ "custom plugins label": "Plugins"
435
71
  }
436
72
  }
437
- };
438
- };
439
- var DefaultFallback = ({ error }) => {
440
- return /* @__PURE__ */ React2.createElement("div", {
441
- style: {
442
- padding: "1rem"
443
- }
444
- }, /* @__PURE__ */ React2.createElement("h1", {
445
- style: {
446
- fontSize: "1.2rem",
447
- fontWeight: 700,
448
- margin: "0.5rem 0"
449
- }
450
- }, error.message), /* @__PURE__ */ React2.createElement("pre", null, error.stack));
451
- };
73
+ }
74
+ ];
452
75
 
453
- // packages/sdk/app-framework/src/App.tsx
454
- import React3 from "react";
455
- import { invariant } from "@dxos/invariant";
456
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
457
- var createApp = ({ meta, plugins, core, ...params }) => {
458
- const hostPlugin = HostPlugin({
459
- plugins: {
460
- ...plugins,
461
- [meta_default.id]: Plugin.lazy(() => import("./plugin-intent-V7ER24Y6.mjs")),
462
- [meta_default3.id]: Plugin.lazy(() => import("./plugin-settings-37UVWF2V.mjs")),
463
- [meta_default2.id]: Plugin.lazy(() => import("./plugin-surface-TEU42XQN.mjs"))
464
- },
465
- meta: [
466
- meta_default,
467
- meta_default3,
468
- meta_default2,
469
- ...meta
76
+ // packages/sdk/app-framework/src/plugin-settings/SettingsPlugin.ts
77
+ var SettingsPlugin = () => definePlugin({
78
+ id: SETTINGS_PLUGIN
79
+ }, [
80
+ defineModule({
81
+ id: `${SETTINGS_PLUGIN}/module/store`,
82
+ activatesOn: Events.Startup,
83
+ activatesBefore: [
84
+ Events.SetupSettings
470
85
  ],
471
- core: [
472
- meta_default.id,
473
- meta_default3.id,
474
- meta_default2.id,
475
- ...core
86
+ activatesAfter: [
87
+ Events.SettingsReady
476
88
  ],
477
- ...params
478
- });
479
- invariant(hostPlugin.provides, void 0, {
480
- F: __dxlog_file2,
481
- L: 53,
482
- S: void 0,
483
- A: [
484
- "hostPlugin.provides",
485
- ""
486
- ]
487
- });
488
- const { context: Context, root: Root } = hostPlugin.provides;
489
- invariant(Context, void 0, {
490
- F: __dxlog_file2,
491
- L: 55,
492
- S: void 0,
493
- A: [
494
- "Context",
495
- ""
496
- ]
497
- });
498
- invariant(Root, void 0, {
499
- F: __dxlog_file2,
500
- L: 56,
501
- S: void 0,
502
- A: [
503
- "Root",
504
- ""
505
- ]
506
- });
507
- return () => /* @__PURE__ */ React3.createElement(Context, null, /* @__PURE__ */ React3.createElement(Root, null));
508
- };
89
+ activate: lazy(() => import("./store-YUWINFBN.mjs"))
90
+ }),
91
+ defineModule({
92
+ id: `${SETTINGS_PLUGIN}/module/translations`,
93
+ activatesOn: Events.SetupTranslations,
94
+ activate: () => contributes(Capabilities.Translations, translations_default)
95
+ }),
96
+ defineModule({
97
+ id: `${SETTINGS_PLUGIN}/module/intent-resolver`,
98
+ activatesOn: Events.SetupIntents,
99
+ activate: lazy(() => import("./intent-resolver-UIU37CKJ.mjs"))
100
+ }),
101
+ defineModule({
102
+ id: `${SETTINGS_PLUGIN}/module/app-graph-builder`,
103
+ activatesOn: Events.SetupAppGraph,
104
+ activate: lazy(() => import("./app-graph-builder-MKLYH3NE.mjs"))
105
+ })
106
+ ]);
509
107
  export {
510
- ActiveParts,
108
+ Capabilities,
511
109
  ErrorBoundary,
512
- HostPlugin,
110
+ Events,
111
+ FileInfoSchema,
112
+ INTENT_ACTION,
113
+ INTENT_PLUGIN,
513
114
  IntentAction,
514
- IntentProvider,
515
- Layout,
115
+ IntentPlugin,
116
+ LAYOUT_ACTION,
117
+ LAYOUT_PLUGIN,
118
+ Label,
516
119
  LayoutAction,
517
- NavigationAction,
518
120
  Plugin,
519
- PluginProvider,
121
+ PluginManager,
122
+ PluginManagerProvider,
123
+ PluginModule,
124
+ PluginsContext,
520
125
  Resource,
521
126
  ResourceKey,
522
127
  ResourceLanguage,
523
- SLUG_COLLECTION_INDICATOR,
524
- SLUG_ENTRY_SEPARATOR,
525
- SLUG_KEY_VALUE_SEPARATOR,
526
- SLUG_LIST_SEPARATOR,
527
- SLUG_PATH_SEPARATOR,
128
+ SETTINGS_ACTION,
129
+ SETTINGS_ID,
130
+ SETTINGS_KEY,
131
+ SETTINGS_PLUGIN,
528
132
  SettingsAction,
133
+ SettingsPlugin,
529
134
  Surface,
530
- SurfaceProvider,
531
- Toast,
135
+ allOf,
136
+ chain,
137
+ contributes,
532
138
  createApp,
139
+ createDispatcher,
140
+ createIntent,
141
+ createResolver,
142
+ createSurface,
533
143
  defaultFileTypes,
144
+ defineCapability,
145
+ defineEvent,
146
+ defineModule,
534
147
  definePlugin,
535
- filterPlugins,
536
- findPlugin,
537
- firstIdInPart,
538
- getPlugin,
539
- indexInPart,
540
- isLayoutAdjustment,
541
- isLayoutMode,
542
- isLayoutParts,
543
- isObject,
544
- openIds,
545
- parseFileManagerPlugin,
546
- parseGraphBuilderPlugin,
547
- parseGraphPlugin,
548
- parseGraphSerializerPlugin,
549
- parseIntentPlugin,
550
- parseIntentResolverPlugin,
551
- parseLayoutPlugin,
552
- parseMetadataRecordsPlugin,
553
- parseMetadataResolverPlugin,
554
- parseNavigationPlugin,
555
- parsePluginHost,
556
- parseRootSurfacePlugin,
557
- parseSettingsPlugin,
558
- parseSurfacePlugin,
559
- parseTranslationsPlugin,
560
- partLength,
561
- resolvePlugin,
562
- useIntent,
148
+ eventKey,
149
+ getEvents,
150
+ isAllOf,
151
+ isOneOf,
152
+ isSurfaceAvailable,
153
+ lazy,
154
+ oneOf,
155
+ useAppGraph,
156
+ useCapabilities,
157
+ useCapability,
563
158
  useIntentDispatcher,
564
159
  useIntentResolver,
565
- usePlugin,
566
- usePlugins,
567
- useResolvePlugin,
568
- useResolvePlugins,
569
- useSurface,
570
- useSurfaceRoot
160
+ useLayout,
161
+ usePluginManager,
162
+ useSurfaces
571
163
  };
572
164
  //# sourceMappingURL=index.mjs.map