@dxos/app-framework 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b

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 (382) hide show
  1. package/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs +137 -0
  2. package/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-ATRNTMSS.mjs +1399 -0
  4. package/dist/lib/browser/chunk-ATRNTMSS.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-WS6SU6HI.mjs +285 -0
  8. package/dist/lib/browser/chunk-WS6SU6HI.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +119 -642
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/intent-dispatcher-E6J7E5Y5.mjs +11 -0
  12. package/dist/lib/browser/intent-resolver-XLE4L3LS.mjs +38 -0
  13. package/dist/lib/browser/intent-resolver-XLE4L3LS.mjs.map +7 -0
  14. package/dist/lib/browser/meta.json +1 -1
  15. package/dist/lib/browser/store-QU2IKFAI.mjs +19 -0
  16. package/dist/lib/browser/store-QU2IKFAI.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-JGBADFF7.cjs +146 -0
  21. package/dist/lib/node/app-graph-builder-JGBADFF7.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-FCMHRU3M.cjs → chunk-QLVQ6PND.cjs} +23 -35
  23. package/dist/lib/node/chunk-QLVQ6PND.cjs.map +7 -0
  24. package/dist/lib/node/chunk-WKC6YMEQ.cjs +1433 -0
  25. package/dist/lib/node/chunk-WKC6YMEQ.cjs.map +7 -0
  26. package/dist/lib/node/chunk-WRWRZKZU.cjs +308 -0
  27. package/dist/lib/node/chunk-WRWRZKZU.cjs.map +7 -0
  28. package/dist/lib/node/index.cjs +125 -665
  29. package/dist/lib/node/index.cjs.map +4 -4
  30. package/dist/lib/node/{plugin-settings-W6UHMH5M.cjs → intent-dispatcher-CFBKDZQR.cjs} +10 -14
  31. package/dist/lib/node/intent-dispatcher-CFBKDZQR.cjs.map +7 -0
  32. package/dist/lib/node/intent-resolver-3TKCXP4S.cjs +45 -0
  33. package/dist/lib/node/intent-resolver-3TKCXP4S.cjs.map +7 -0
  34. package/dist/lib/node/meta.json +1 -1
  35. package/dist/lib/node/store-4QMUUU2A.cjs +34 -0
  36. package/dist/lib/node/store-4QMUUU2A.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-2QEX57NX.mjs +138 -0
  42. package/dist/lib/node-esm/app-graph-builder-2QEX57NX.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-44J2VZBB.mjs +1401 -0
  44. package/dist/lib/node-esm/chunk-44J2VZBB.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-HTLXL32I.mjs +286 -0
  48. package/dist/lib/node-esm/chunk-HTLXL32I.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +119 -642
  50. package/dist/lib/node-esm/index.mjs.map +4 -4
  51. package/dist/lib/node-esm/intent-dispatcher-LDQGDZ62.mjs +12 -0
  52. package/dist/lib/node-esm/intent-resolver-7VJWN67U.mjs +39 -0
  53. package/dist/lib/node-esm/intent-resolver-7VJWN67U.mjs.map +7 -0
  54. package/dist/lib/node-esm/meta.json +1 -1
  55. package/dist/lib/node-esm/store-VWDAYUQY.mjs +20 -0
  56. package/dist/lib/node-esm/store-VWDAYUQY.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 +293 -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/{plugins/plugin-surface/SurfaceContext.d.ts → common/surface.d.ts} +12 -29
  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.map +1 -0
  141. package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent.d.ts +8 -28
  142. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -0
  143. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -0
  144. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -0
  145. package/dist/types/src/plugin-settings/actions.d.ts +27 -0
  146. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
  147. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +197 -0
  148. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -0
  149. package/dist/types/src/plugin-settings/index.d.ts +3 -0
  150. package/dist/types/src/plugin-settings/index.d.ts.map +1 -0
  151. package/dist/types/src/plugin-settings/intent-resolver.d.ts +4 -0
  152. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -0
  153. package/dist/types/src/plugin-settings/store.d.ts +5 -0
  154. package/dist/types/src/plugin-settings/store.d.ts.map +1 -0
  155. package/dist/types/src/plugin-settings/translations.d.ts +11 -0
  156. package/dist/types/src/plugin-settings/translations.d.ts.map +1 -0
  157. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
  158. package/dist/types/src/{plugins/plugin-intent → react}/IntentContext.d.ts +2 -2
  159. package/dist/types/src/react/IntentContext.d.ts.map +1 -0
  160. package/dist/types/src/react/PluginManagerProvider.d.ts +10 -0
  161. package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -0
  162. package/dist/types/src/react/Surface.d.ts +12 -0
  163. package/dist/types/src/react/Surface.d.ts.map +1 -0
  164. package/dist/types/src/react/Surface.stories.d.ts +16 -0
  165. package/dist/types/src/react/Surface.stories.d.ts.map +1 -0
  166. package/dist/types/src/react/common.d.ts +12 -0
  167. package/dist/types/src/react/common.d.ts.map +1 -0
  168. package/dist/types/src/react/index.d.ts +7 -0
  169. package/dist/types/src/react/index.d.ts.map +1 -0
  170. package/dist/types/src/react/useCapabilities.d.ts +13 -0
  171. package/dist/types/src/react/useCapabilities.d.ts.map +1 -0
  172. package/dist/types/src/react/useIntentResolver.d.ts +3 -0
  173. package/dist/types/src/react/useIntentResolver.d.ts.map +1 -0
  174. package/dist/types/src/testing/index.d.ts +2 -0
  175. package/dist/types/src/testing/index.d.ts.map +1 -0
  176. package/dist/types/src/testing/withPluginManager.d.ts +10 -0
  177. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -0
  178. package/dist/types/src/testing/withPluginManager.stories.d.ts +5 -0
  179. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -0
  180. package/dist/types/src/worker.d.ts +4 -0
  181. package/dist/types/src/worker.d.ts.map +1 -0
  182. package/dist/types/tsconfig.tsbuildinfo +1 -1
  183. package/package.json +37 -18
  184. package/project.json +4 -3
  185. package/src/App.tsx +139 -34
  186. package/src/common/capabilities.ts +91 -0
  187. package/src/common/events.ts +72 -0
  188. package/src/common/file.ts +22 -0
  189. package/src/common/graph.ts +30 -0
  190. package/src/{plugins/common → common}/index.ts +3 -2
  191. package/src/common/layout.ts +225 -0
  192. package/src/{plugins/plugin-surface/SurfaceContext.ts → common/surface.ts} +6 -37
  193. package/src/common/translations.ts +17 -0
  194. package/src/core/capabilities.test.ts +116 -0
  195. package/src/core/capabilities.ts +222 -0
  196. package/src/core/events.ts +58 -0
  197. package/src/core/index.ts +8 -0
  198. package/src/core/manager.test.ts +516 -0
  199. package/src/core/manager.ts +511 -0
  200. package/src/core/plugin.ts +131 -0
  201. package/src/helpers.test.ts +97 -0
  202. package/src/helpers.ts +45 -0
  203. package/src/index.ts +6 -3
  204. package/src/playground/debug/Debug.tsx +39 -0
  205. package/src/playground/debug/index.ts +5 -0
  206. package/src/playground/debug/plugin.ts +17 -0
  207. package/src/playground/generator/Main.tsx +71 -0
  208. package/src/playground/generator/Toolbar.tsx +46 -0
  209. package/src/playground/generator/generator.ts +48 -0
  210. package/src/playground/generator/index.ts +6 -0
  211. package/src/playground/generator/plugin.ts +23 -0
  212. package/src/playground/layout/Layout.tsx +33 -0
  213. package/src/playground/layout/index.ts +5 -0
  214. package/src/playground/layout/plugin.ts +17 -0
  215. package/src/playground/logger/Toolbar.tsx +29 -0
  216. package/src/playground/logger/index.ts +5 -0
  217. package/src/playground/logger/plugin.ts +36 -0
  218. package/src/playground/logger/schema.ts +12 -0
  219. package/src/playground/playground.stories.tsx +34 -0
  220. package/src/plugin-intent/IntentPlugin.tsx +20 -0
  221. package/src/plugin-intent/actions.ts +22 -0
  222. package/src/plugin-intent/errors.ts +39 -0
  223. package/src/plugin-intent/index.ts +8 -0
  224. package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.ts +83 -63
  225. package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.ts +114 -95
  226. package/src/{plugins/plugin-intent → plugin-intent}/intent.ts +10 -26
  227. package/src/plugin-settings/SettingsPlugin.ts +35 -0
  228. package/src/plugin-settings/actions.ts +27 -0
  229. package/src/plugin-settings/app-graph-builder.ts +122 -0
  230. package/src/plugin-settings/index.ts +6 -0
  231. package/src/plugin-settings/intent-resolver.ts +28 -0
  232. package/src/plugin-settings/store.ts +20 -0
  233. package/src/plugin-settings/translations.ts +17 -0
  234. package/src/{plugins/plugin-intent → react}/IntentContext.tsx +13 -5
  235. package/src/react/PluginManagerProvider.ts +22 -0
  236. package/src/react/Surface.stories.tsx +96 -0
  237. package/src/react/Surface.tsx +75 -0
  238. package/src/react/common.ts +12 -0
  239. package/src/react/index.ts +10 -0
  240. package/src/react/useCapabilities.ts +39 -0
  241. package/src/react/useIntentResolver.ts +22 -0
  242. package/src/testing/index.ts +5 -0
  243. package/src/testing/withPluginManager.stories.tsx +47 -0
  244. package/src/testing/withPluginManager.tsx +75 -0
  245. package/src/worker.ts +11 -0
  246. package/tsconfig.json +16 -4
  247. package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
  248. package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
  249. package/dist/lib/browser/chunk-QG25ZU2N.mjs +0 -320
  250. package/dist/lib/browser/chunk-QG25ZU2N.mjs.map +0 -7
  251. package/dist/lib/browser/chunk-SPDTXTOV.mjs +0 -163
  252. package/dist/lib/browser/chunk-SPDTXTOV.mjs.map +0 -7
  253. package/dist/lib/browser/chunk-WBOXEHBE.mjs +0 -51
  254. package/dist/lib/browser/chunk-WBOXEHBE.mjs.map +0 -7
  255. package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs +0 -32
  256. package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs +0 -15
  257. package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs +0 -24
  258. package/dist/lib/node/chunk-BW3RNEVI.cjs +0 -185
  259. package/dist/lib/node/chunk-BW3RNEVI.cjs.map +0 -7
  260. package/dist/lib/node/chunk-FCMHRU3M.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-VWHAALIN.cjs +0 -344
  264. package/dist/lib/node/chunk-VWHAALIN.cjs.map +0 -7
  265. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs +0 -53
  266. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs.map +0 -7
  267. package/dist/lib/node/plugin-settings-W6UHMH5M.cjs.map +0 -7
  268. package/dist/lib/node/plugin-surface-CCSIONYW.cjs +0 -45
  269. package/dist/lib/node/plugin-surface-CCSIONYW.cjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs +0 -53
  271. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs +0 -164
  273. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs.map +0 -7
  274. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs +0 -321
  275. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs.map +0 -7
  276. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs +0 -74
  277. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs.map +0 -7
  278. package/dist/lib/node-esm/plugin-intent-W2HQC6LC.mjs +0 -33
  279. package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs +0 -16
  280. package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs.map +0 -7
  281. package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs +0 -25
  282. package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs.map +0 -7
  283. package/dist/types/src/plugins/common/file.d.ts +0 -22
  284. package/dist/types/src/plugins/common/file.d.ts.map +0 -1
  285. package/dist/types/src/plugins/common/graph.d.ts +0 -51
  286. package/dist/types/src/plugins/common/graph.d.ts.map +0 -1
  287. package/dist/types/src/plugins/common/index.d.ts +0 -7
  288. package/dist/types/src/plugins/common/index.d.ts.map +0 -1
  289. package/dist/types/src/plugins/common/layout.d.ts +0 -176
  290. package/dist/types/src/plugins/common/layout.d.ts.map +0 -1
  291. package/dist/types/src/plugins/common/metadata.d.ts +0 -16
  292. package/dist/types/src/plugins/common/metadata.d.ts.map +0 -1
  293. package/dist/types/src/plugins/common/navigation.d.ts +0 -243
  294. package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
  295. package/dist/types/src/plugins/common/translations.d.ts +0 -22
  296. package/dist/types/src/plugins/common/translations.d.ts.map +0 -1
  297. package/dist/types/src/plugins/helpers.d.ts +0 -41
  298. package/dist/types/src/plugins/helpers.d.ts.map +0 -1
  299. package/dist/types/src/plugins/index.d.ts +0 -7
  300. package/dist/types/src/plugins/index.d.ts.map +0 -1
  301. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +0 -16
  302. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +0 -1
  303. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts +0 -14
  304. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts.map +0 -1
  305. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts +0 -47
  306. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts.map +0 -1
  307. package/dist/types/src/plugins/plugin-host/index.d.ts +0 -6
  308. package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
  309. package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -104
  310. package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +0 -1
  311. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts +0 -35
  312. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts.map +0 -1
  313. package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +0 -1
  314. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts +0 -8
  315. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +0 -1
  316. package/dist/types/src/plugins/plugin-intent/index.d.ts +0 -7
  317. package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
  318. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts +0 -107
  319. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  320. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  321. package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
  322. package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -6
  323. package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
  324. package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -16
  325. package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +0 -1
  326. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts +0 -4
  327. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  328. package/dist/types/src/plugins/plugin-settings/index.d.ts +0 -4
  329. package/dist/types/src/plugins/plugin-settings/index.d.ts.map +0 -1
  330. package/dist/types/src/plugins/plugin-settings/meta.d.ts +0 -5
  331. package/dist/types/src/plugins/plugin-settings/meta.d.ts.map +0 -1
  332. package/dist/types/src/plugins/plugin-settings/provides.d.ts +0 -26
  333. package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +0 -1
  334. package/dist/types/src/plugins/plugin-surface/ErrorBoundary.d.ts.map +0 -1
  335. package/dist/types/src/plugins/plugin-surface/Surface.d.ts +0 -7
  336. package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
  337. package/dist/types/src/plugins/plugin-surface/SurfaceContext.d.ts.map +0 -1
  338. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts +0 -7
  339. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +0 -1
  340. package/dist/types/src/plugins/plugin-surface/helpers.d.ts +0 -21
  341. package/dist/types/src/plugins/plugin-surface/helpers.d.ts.map +0 -1
  342. package/dist/types/src/plugins/plugin-surface/index.d.ts +0 -8
  343. package/dist/types/src/plugins/plugin-surface/index.d.ts.map +0 -1
  344. package/dist/types/src/plugins/plugin-surface/meta.d.ts +0 -5
  345. package/dist/types/src/plugins/plugin-surface/meta.d.ts.map +0 -1
  346. package/dist/types/src/plugins/plugin-surface/provides.d.ts +0 -17
  347. package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +0 -1
  348. package/src/plugins/common/file.ts +0 -36
  349. package/src/plugins/common/graph.ts +0 -70
  350. package/src/plugins/common/layout.ts +0 -173
  351. package/src/plugins/common/metadata.ts +0 -29
  352. package/src/plugins/common/navigation.ts +0 -214
  353. package/src/plugins/common/translations.ts +0 -36
  354. package/src/plugins/helpers.ts +0 -92
  355. package/src/plugins/index.ts +0 -11
  356. package/src/plugins/plugin-host/HostPlugin.tsx +0 -88
  357. package/src/plugins/plugin-host/PluginContainer.tsx +0 -120
  358. package/src/plugins/plugin-host/PluginContext.tsx +0 -79
  359. package/src/plugins/plugin-host/index.ts +0 -12
  360. package/src/plugins/plugin-host/plugin.test.ts +0 -158
  361. package/src/plugins/plugin-host/plugin.ts +0 -133
  362. package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -75
  363. package/src/plugins/plugin-intent/index.ts +0 -13
  364. package/src/plugins/plugin-intent/meta.ts +0 -11
  365. package/src/plugins/plugin-intent/provides.ts +0 -26
  366. package/src/plugins/plugin-settings/SettingsPlugin.tsx +0 -22
  367. package/src/plugins/plugin-settings/index.ts +0 -9
  368. package/src/plugins/plugin-settings/meta.ts +0 -9
  369. package/src/plugins/plugin-settings/provides.ts +0 -34
  370. package/src/plugins/plugin-surface/Surface.tsx +0 -62
  371. package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -45
  372. package/src/plugins/plugin-surface/helpers.ts +0 -22
  373. package/src/plugins/plugin-surface/index.ts +0 -14
  374. package/src/plugins/plugin-surface/meta.ts +0 -9
  375. package/src/plugins/plugin-surface/provides.ts +0 -27
  376. /package/dist/lib/browser/{plugin-intent-T7Y3MJ5C.mjs.map → intent-dispatcher-E6J7E5Y5.mjs.map} +0 -0
  377. /package/dist/lib/browser/{plugin-settings-5U2L2NRU.mjs.map → worker.mjs.map} +0 -0
  378. /package/dist/lib/{browser/plugin-surface-OKPF3EQI.mjs.map → node-esm/intent-dispatcher-LDQGDZ62.mjs.map} +0 -0
  379. /package/dist/lib/node-esm/{plugin-intent-W2HQC6LC.mjs.map → worker.mjs.map} +0 -0
  380. /package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.d.ts +0 -0
  381. /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
  382. /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
@@ -28,703 +28,163 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var node_exports = {};
30
30
  __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
31
+ Capabilities: () => import_chunk_WKC6YMEQ.Capabilities,
32
+ ErrorBoundary: () => import_chunk_WRWRZKZU.ErrorBoundary,
33
+ Events: () => import_chunk_WKC6YMEQ.Events,
34
+ FileInfoSchema: () => import_chunk_WKC6YMEQ.FileInfoSchema,
35
+ INTENT_ACTION: () => import_chunk_WKC6YMEQ.INTENT_ACTION,
36
+ INTENT_PLUGIN: () => import_chunk_WKC6YMEQ.INTENT_PLUGIN,
37
+ IntentAction: () => import_chunk_WKC6YMEQ.IntentAction,
38
+ IntentPlugin: () => import_chunk_WKC6YMEQ.IntentPlugin,
39
+ LAYOUT_ACTION: () => import_chunk_WKC6YMEQ.LAYOUT_ACTION,
40
+ LAYOUT_PLUGIN: () => import_chunk_WKC6YMEQ.LAYOUT_PLUGIN,
41
+ Label: () => import_chunk_WKC6YMEQ.Label,
42
+ LayoutAction: () => import_chunk_WKC6YMEQ.LayoutAction,
43
+ Plugin: () => import_chunk_WKC6YMEQ.Plugin,
44
+ PluginManager: () => import_chunk_WKC6YMEQ.PluginManager,
45
+ PluginManagerProvider: () => import_chunk_WRWRZKZU.PluginManagerProvider,
46
+ PluginModule: () => import_chunk_WKC6YMEQ.PluginModule,
47
+ PluginsContext: () => import_chunk_WKC6YMEQ.PluginsContext,
48
+ Resource: () => import_chunk_WKC6YMEQ.Resource,
49
+ ResourceKey: () => import_chunk_WKC6YMEQ.ResourceKey,
50
+ ResourceLanguage: () => import_chunk_WKC6YMEQ.ResourceLanguage,
51
+ SETTINGS_ACTION: () => import_chunk_QLVQ6PND.SETTINGS_ACTION,
52
+ SETTINGS_ID: () => import_chunk_QLVQ6PND.SETTINGS_ID,
53
+ SETTINGS_KEY: () => import_chunk_QLVQ6PND.SETTINGS_KEY,
54
+ SETTINGS_PLUGIN: () => import_chunk_QLVQ6PND.SETTINGS_PLUGIN,
55
+ SettingsAction: () => import_chunk_QLVQ6PND.SettingsAction,
56
+ SettingsPlugin: () => SettingsPlugin,
57
+ Surface: () => import_chunk_WRWRZKZU.Surface,
58
+ allOf: () => import_chunk_WKC6YMEQ.allOf,
59
+ chain: () => import_chunk_WKC6YMEQ.chain,
60
+ contributes: () => import_chunk_WKC6YMEQ.contributes,
61
+ createApp: () => import_chunk_WRWRZKZU.createApp,
62
+ createDispatcher: () => import_chunk_WKC6YMEQ.createDispatcher,
63
+ createIntent: () => import_chunk_WKC6YMEQ.createIntent,
64
+ createResolver: () => import_chunk_WKC6YMEQ.createResolver,
65
+ createSurface: () => import_chunk_WKC6YMEQ.createSurface,
66
+ defaultFileTypes: () => import_chunk_WKC6YMEQ.defaultFileTypes,
67
+ defineCapability: () => import_chunk_WKC6YMEQ.defineCapability,
68
+ defineEvent: () => import_chunk_WKC6YMEQ.defineEvent,
69
+ defineModule: () => import_chunk_WKC6YMEQ.defineModule,
70
+ definePlugin: () => import_chunk_WKC6YMEQ.definePlugin,
71
+ eventKey: () => import_chunk_WKC6YMEQ.eventKey,
72
+ getEvents: () => import_chunk_WKC6YMEQ.getEvents,
73
+ isAllOf: () => import_chunk_WKC6YMEQ.isAllOf,
74
+ isOneOf: () => import_chunk_WKC6YMEQ.isOneOf,
75
+ isSurfaceAvailable: () => import_chunk_WRWRZKZU.isSurfaceAvailable,
76
+ lazy: () => import_chunk_WKC6YMEQ.lazy,
77
+ oneOf: () => import_chunk_WKC6YMEQ.oneOf,
78
+ useAppGraph: () => import_chunk_WRWRZKZU.useAppGraph,
79
+ useCapabilities: () => import_chunk_WRWRZKZU.useCapabilities,
80
+ useCapability: () => import_chunk_WRWRZKZU.useCapability,
81
+ useIntentDispatcher: () => import_chunk_WRWRZKZU.useIntentDispatcher,
82
+ useIntentResolver: () => import_chunk_WRWRZKZU.useIntentResolver,
83
+ useLayout: () => import_chunk_WRWRZKZU.useLayout,
84
+ usePluginManager: () => import_chunk_WRWRZKZU.usePluginManager,
85
+ useSurfaces: () => import_chunk_WRWRZKZU.useSurfaces
102
86
  });
103
87
  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");
108
- 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
- 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`, {
246
- 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)
251
- }),
252
- output: import_echo_schema.S.Void
253
- }) {
254
- }
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);
88
+ var import_chunk_WRWRZKZU = require("./chunk-WRWRZKZU.cjs");
89
+ var import_chunk_QLVQ6PND = require("./chunk-QLVQ6PND.cjs");
90
+ var import_chunk_WKC6YMEQ = require("./chunk-WKC6YMEQ.cjs");
91
+ var translations_default = [
92
+ {
93
+ "en-US": {
94
+ [import_chunk_QLVQ6PND.SETTINGS_PLUGIN]: {
95
+ "open settings label": "Open settings",
96
+ "app settings label": "Settings",
97
+ "custom plugins label": "Plugins"
470
98
  }
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
99
  }
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
100
+ }
101
+ ];
102
+ var SettingsPlugin = () => (0, import_chunk_WKC6YMEQ.definePlugin)({
103
+ id: import_chunk_QLVQ6PND.SETTINGS_PLUGIN
104
+ }, [
105
+ (0, import_chunk_WKC6YMEQ.defineModule)({
106
+ id: `${import_chunk_QLVQ6PND.SETTINGS_PLUGIN}/module/store`,
107
+ activatesOn: import_chunk_WKC6YMEQ.Events.Startup,
108
+ activatesBefore: [
109
+ import_chunk_WKC6YMEQ.Events.SetupSettings
617
110
  ],
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
111
+ activatesAfter: [
112
+ import_chunk_WKC6YMEQ.Events.SettingsReady
623
113
  ],
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
- };
114
+ activate: (0, import_chunk_WKC6YMEQ.lazy)(() => import("./store-4QMUUU2A.cjs"))
115
+ }),
116
+ (0, import_chunk_WKC6YMEQ.defineModule)({
117
+ id: `${import_chunk_QLVQ6PND.SETTINGS_PLUGIN}/module/translations`,
118
+ activatesOn: import_chunk_WKC6YMEQ.Events.SetupTranslations,
119
+ activate: () => (0, import_chunk_WKC6YMEQ.contributes)(import_chunk_WKC6YMEQ.Capabilities.Translations, translations_default)
120
+ }),
121
+ (0, import_chunk_WKC6YMEQ.defineModule)({
122
+ id: `${import_chunk_QLVQ6PND.SETTINGS_PLUGIN}/module/intent-resolver`,
123
+ activatesOn: import_chunk_WKC6YMEQ.Events.SetupIntents,
124
+ activate: (0, import_chunk_WKC6YMEQ.lazy)(() => import("./intent-resolver-3TKCXP4S.cjs"))
125
+ }),
126
+ (0, import_chunk_WKC6YMEQ.defineModule)({
127
+ id: `${import_chunk_QLVQ6PND.SETTINGS_PLUGIN}/module/app-graph-builder`,
128
+ activatesOn: import_chunk_WKC6YMEQ.Events.SetupAppGraph,
129
+ activate: (0, import_chunk_WKC6YMEQ.lazy)(() => import("./app-graph-builder-JGBADFF7.cjs"))
130
+ })
131
+ ]);
656
132
  // Annotate the CommonJS export names for ESM import in node:
657
133
  0 && (module.exports = {
658
- ActiveParts,
134
+ Capabilities,
659
135
  ErrorBoundary,
660
- HostPlugin,
136
+ Events,
137
+ FileInfoSchema,
661
138
  INTENT_ACTION,
139
+ INTENT_PLUGIN,
662
140
  IntentAction,
663
- IntentProvider,
141
+ IntentPlugin,
664
142
  LAYOUT_ACTION,
665
143
  LAYOUT_PLUGIN,
666
144
  Label,
667
- Layout,
668
145
  LayoutAction,
669
- NAVIGATION_ACTION,
670
- NAVIGATION_PLUGIN,
671
- NavigationAction,
672
146
  Plugin,
673
- PluginProvider,
147
+ PluginManager,
148
+ PluginManagerProvider,
149
+ PluginModule,
150
+ PluginsContext,
674
151
  Resource,
675
152
  ResourceKey,
676
153
  ResourceLanguage,
677
154
  SETTINGS_ACTION,
155
+ SETTINGS_ID,
156
+ SETTINGS_KEY,
678
157
  SETTINGS_PLUGIN,
679
- SLUG_COLLECTION_INDICATOR,
680
- SLUG_ENTRY_SEPARATOR,
681
- SLUG_KEY_VALUE_SEPARATOR,
682
- SLUG_LIST_SEPARATOR,
683
- SLUG_PATH_SEPARATOR,
684
158
  SettingsAction,
159
+ SettingsPlugin,
685
160
  Surface,
686
- SurfaceProvider,
687
- Toast,
161
+ allOf,
688
162
  chain,
163
+ contributes,
689
164
  createApp,
690
165
  createDispatcher,
691
166
  createIntent,
692
167
  createResolver,
693
168
  createSurface,
694
169
  defaultFileTypes,
170
+ defineCapability,
171
+ defineEvent,
172
+ defineModule,
695
173
  definePlugin,
696
- filterPlugins,
697
- findPlugin,
698
- firstIdInPart,
699
- getPlugin,
700
- indexInPart,
701
- isLayoutAdjustment,
702
- isLayoutMode,
703
- isLayoutParts,
704
- isObject,
705
- 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
- partLength,
721
- resolvePlugin,
174
+ eventKey,
175
+ getEvents,
176
+ isAllOf,
177
+ isOneOf,
178
+ isSurfaceAvailable,
179
+ lazy,
180
+ oneOf,
181
+ useAppGraph,
182
+ useCapabilities,
183
+ useCapability,
722
184
  useIntentDispatcher,
723
185
  useIntentResolver,
724
- usePlugin,
725
- usePlugins,
726
- useResolvePlugin,
727
- useResolvePlugins,
728
- useSurfaceRoot
186
+ useLayout,
187
+ usePluginManager,
188
+ useSurfaces
729
189
  });
730
190
  //# sourceMappingURL=index.cjs.map