@dxos/app-framework 0.8.4-main.3f58842 → 0.8.4-main.548089c

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 (224) hide show
  1. package/.storybook/main.mts +11 -0
  2. package/.storybook/preview.mts +8 -0
  3. package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
  4. package/.swc/plugins/{v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 → linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7} +0 -0
  5. package/dist/lib/browser/{app-graph-builder-LYF7EKNN.mjs → app-graph-builder-JPUFNED5.mjs} +32 -31
  6. package/dist/lib/browser/app-graph-builder-JPUFNED5.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-FMN65HSW.mjs → chunk-LVSO2N4X.mjs} +351 -263
  8. package/dist/lib/browser/chunk-LVSO2N4X.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-ORWHM7CO.mjs → chunk-SCPE4ZO2.mjs} +11 -8
  10. package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-FO2PH7M3.mjs → chunk-XRAWIHTQ.mjs} +247 -184
  12. package/dist/lib/browser/chunk-XRAWIHTQ.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +20 -56
  14. package/dist/lib/browser/index.mjs.map +3 -3
  15. package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs → intent-dispatcher-TNEVDPI6.mjs} +2 -2
  16. package/dist/lib/browser/{intent-resolver-ZTNOSO3A.mjs → intent-resolver-SYLXP62Y.mjs} +7 -7
  17. package/dist/lib/browser/intent-resolver-SYLXP62Y.mjs.map +7 -0
  18. package/dist/lib/browser/meta.json +1 -1
  19. package/dist/lib/browser/react/index.mjs +32 -0
  20. package/dist/lib/browser/{store-KML2R4IE.mjs → store-3HDXKFXP.mjs} +4 -4
  21. package/dist/lib/browser/{store-KML2R4IE.mjs.map → store-3HDXKFXP.mjs.map} +2 -2
  22. package/dist/lib/browser/testing/index.mjs +17 -21
  23. package/dist/lib/browser/testing/index.mjs.map +3 -3
  24. package/dist/lib/node-esm/{app-graph-builder-SAOWGJDK.mjs → app-graph-builder-VO6RTSOS.mjs} +32 -31
  25. package/dist/lib/node-esm/app-graph-builder-VO6RTSOS.mjs.map +7 -0
  26. package/dist/lib/node-esm/{chunk-ZEZ4FVEU.mjs → chunk-FO5NIDOR.mjs} +351 -263
  27. package/dist/lib/node-esm/chunk-FO5NIDOR.mjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-73HGSHKE.mjs → chunk-JH3SFOXA.mjs} +247 -184
  29. package/dist/lib/node-esm/chunk-JH3SFOXA.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-UMZQERLE.mjs → chunk-ZX63QUGE.mjs} +11 -8
  31. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +7 -0
  32. package/dist/lib/node-esm/index.mjs +20 -56
  33. package/dist/lib/node-esm/index.mjs.map +3 -3
  34. package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs → intent-dispatcher-WUNOPJES.mjs} +2 -2
  35. package/dist/lib/node-esm/{intent-resolver-W7Z7WFFM.mjs → intent-resolver-VTZI3NO7.mjs} +7 -7
  36. package/dist/lib/node-esm/intent-resolver-VTZI3NO7.mjs.map +7 -0
  37. package/dist/lib/node-esm/meta.json +1 -1
  38. package/dist/lib/node-esm/react/index.mjs +33 -0
  39. package/dist/lib/node-esm/{store-QEXGXLWZ.mjs → store-PAJPVOLG.mjs} +4 -4
  40. package/dist/lib/node-esm/{store-QEXGXLWZ.mjs.map → store-PAJPVOLG.mjs.map} +2 -2
  41. package/dist/lib/node-esm/testing/index.mjs +17 -21
  42. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  43. package/dist/types/src/common/capabilities.d.ts +110 -39
  44. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  45. package/dist/types/src/common/collaboration.d.ts +10 -9
  46. package/dist/types/src/common/collaboration.d.ts.map +1 -1
  47. package/dist/types/src/common/events.d.ts.map +1 -1
  48. package/dist/types/src/common/file.d.ts +1 -1
  49. package/dist/types/src/common/file.d.ts.map +1 -1
  50. package/dist/types/src/common/index.d.ts +1 -1
  51. package/dist/types/src/common/index.d.ts.map +1 -1
  52. package/dist/types/src/common/layout.d.ts +1 -3
  53. package/dist/types/src/common/layout.d.ts.map +1 -1
  54. package/dist/types/src/common/surface.d.ts +8 -13
  55. package/dist/types/src/common/surface.d.ts.map +1 -1
  56. package/dist/types/src/common/translations.d.ts +1 -1
  57. package/dist/types/src/common/translations.d.ts.map +1 -1
  58. package/dist/types/src/core/capabilities.d.ts +17 -14
  59. package/dist/types/src/core/capabilities.d.ts.map +1 -1
  60. package/dist/types/src/core/manager.d.ts +7 -3
  61. package/dist/types/src/core/manager.d.ts.map +1 -1
  62. package/dist/types/src/core/plugin.d.ts +8 -1
  63. package/dist/types/src/core/plugin.d.ts.map +1 -1
  64. package/dist/types/src/index.d.ts +0 -2
  65. package/dist/types/src/index.d.ts.map +1 -1
  66. package/dist/types/src/playground/debug/Debug.d.ts +1 -1
  67. package/dist/types/src/playground/debug/plugin.d.ts +1 -1
  68. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
  69. package/dist/types/src/playground/generator/Main.d.ts +1 -1
  70. package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
  71. package/dist/types/src/playground/generator/Toolbar.d.ts +1 -1
  72. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
  73. package/dist/types/src/playground/generator/generator.d.ts +1 -1
  74. package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
  75. package/dist/types/src/playground/generator/plugin.d.ts +1 -1
  76. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
  77. package/dist/types/src/playground/layout/Layout.d.ts +2 -2
  78. package/dist/types/src/playground/layout/plugin.d.ts +1 -1
  79. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
  80. package/dist/types/src/playground/logger/Toolbar.d.ts +1 -1
  81. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
  82. package/dist/types/src/playground/logger/plugin.d.ts +1 -1
  83. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
  84. package/dist/types/src/playground/logger/schema.d.ts +1 -1
  85. package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
  86. package/dist/types/src/playground/playground.stories.d.ts +5 -4
  87. package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
  88. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +1 -1
  89. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
  90. package/dist/types/src/plugin-intent/actions.d.ts +5 -7
  91. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
  92. package/dist/types/src/plugin-intent/errors.d.ts.map +1 -1
  93. package/dist/types/src/plugin-intent/index.d.ts +1 -0
  94. package/dist/types/src/plugin-intent/index.d.ts.map +1 -1
  95. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +7 -7
  96. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
  97. package/dist/types/src/plugin-intent/intent.d.ts +1 -1
  98. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
  99. package/dist/types/src/plugin-intent/meta.d.ts +3 -0
  100. package/dist/types/src/plugin-intent/meta.d.ts.map +1 -0
  101. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +1 -1
  102. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
  103. package/dist/types/src/plugin-settings/actions.d.ts +5 -7
  104. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
  105. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +1 -1
  106. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
  107. package/dist/types/src/plugin-settings/intent-resolver.d.ts +1 -1
  108. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -1
  109. package/dist/types/src/plugin-settings/meta.d.ts +3 -0
  110. package/dist/types/src/plugin-settings/meta.d.ts.map +1 -0
  111. package/dist/types/src/plugin-settings/store.d.ts +1 -1
  112. package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
  113. package/dist/types/src/plugin-settings/translations.d.ts +2 -1
  114. package/dist/types/src/plugin-settings/translations.d.ts.map +1 -1
  115. package/dist/types/src/react/App.d.ts +10 -0
  116. package/dist/types/src/react/App.d.ts.map +1 -0
  117. package/dist/types/src/react/App.stories.d.ts +14 -0
  118. package/dist/types/src/react/App.stories.d.ts.map +1 -0
  119. package/dist/types/src/react/DefaultFallback.d.ts +8 -0
  120. package/dist/types/src/react/DefaultFallback.d.ts.map +1 -0
  121. package/dist/types/src/react/ErrorBoundary.d.ts +13 -14
  122. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
  123. package/dist/types/src/react/IntentContext.d.ts.map +1 -1
  124. package/dist/types/src/react/Surface.d.ts +5 -5
  125. package/dist/types/src/react/Surface.d.ts.map +1 -1
  126. package/dist/types/src/react/Surface.stories.d.ts +8 -10
  127. package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
  128. package/dist/types/src/react/common.d.ts.map +1 -1
  129. package/dist/types/src/react/index.d.ts +2 -0
  130. package/dist/types/src/react/index.d.ts.map +1 -1
  131. package/dist/types/src/react/types.d.ts +6 -0
  132. package/dist/types/src/react/types.d.ts.map +1 -0
  133. package/dist/types/src/{App.d.ts → react/useApp.d.ts} +7 -6
  134. package/dist/types/src/react/useApp.d.ts.map +1 -0
  135. package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
  136. package/dist/types/src/react/useLoading.d.ts +19 -0
  137. package/dist/types/src/react/useLoading.d.ts.map +1 -0
  138. package/dist/types/src/testing/withPluginManager.d.ts +9 -8
  139. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  140. package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
  141. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  142. package/dist/types/tsconfig.tsbuildinfo +1 -1
  143. package/moon.yml +5 -1
  144. package/package.json +46 -38
  145. package/src/common/capabilities.ts +116 -18
  146. package/src/common/collaboration.ts +6 -9
  147. package/src/common/events.ts +3 -1
  148. package/src/common/file.ts +1 -1
  149. package/src/common/index.ts +1 -1
  150. package/src/common/layout.ts +3 -4
  151. package/src/common/surface.ts +16 -18
  152. package/src/common/translations.ts +1 -1
  153. package/src/core/capabilities.test.ts +3 -3
  154. package/src/core/capabilities.ts +34 -25
  155. package/src/core/manager.test.ts +22 -21
  156. package/src/core/manager.ts +141 -56
  157. package/src/core/plugin.ts +13 -2
  158. package/src/helpers.test.ts +1 -1
  159. package/src/index.ts +0 -2
  160. package/src/playground/debug/Debug.tsx +1 -1
  161. package/src/playground/debug/plugin.ts +7 -8
  162. package/src/playground/generator/Main.tsx +0 -1
  163. package/src/playground/generator/Toolbar.tsx +2 -1
  164. package/src/playground/generator/generator.ts +4 -4
  165. package/src/playground/generator/plugin.ts +12 -13
  166. package/src/playground/layout/plugin.ts +10 -9
  167. package/src/playground/logger/Toolbar.tsx +2 -1
  168. package/src/playground/logger/plugin.ts +30 -25
  169. package/src/playground/logger/schema.ts +1 -1
  170. package/src/playground/playground.stories.tsx +20 -16
  171. package/src/plugin-intent/IntentPlugin.ts +13 -13
  172. package/src/plugin-intent/actions.ts +4 -6
  173. package/src/plugin-intent/errors.ts +2 -1
  174. package/src/plugin-intent/index.ts +1 -0
  175. package/src/plugin-intent/intent-dispatcher.test.ts +10 -3
  176. package/src/plugin-intent/intent-dispatcher.ts +16 -12
  177. package/src/plugin-intent/intent.ts +1 -1
  178. package/src/plugin-intent/meta.ts +10 -0
  179. package/src/plugin-settings/SettingsPlugin.ts +27 -28
  180. package/src/plugin-settings/actions.ts +9 -13
  181. package/src/plugin-settings/app-graph-builder.ts +25 -22
  182. package/src/plugin-settings/intent-resolver.ts +5 -4
  183. package/src/plugin-settings/meta.ts +10 -0
  184. package/src/plugin-settings/store.ts +1 -1
  185. package/src/plugin-settings/translations.ts +4 -4
  186. package/src/react/App.stories.tsx +33 -0
  187. package/src/react/App.tsx +59 -0
  188. package/src/react/DefaultFallback.tsx +26 -0
  189. package/src/react/ErrorBoundary.tsx +26 -15
  190. package/src/react/IntentContext.tsx +3 -2
  191. package/src/react/Surface.stories.tsx +81 -52
  192. package/src/react/Surface.tsx +70 -38
  193. package/src/react/common.ts +2 -1
  194. package/src/react/index.ts +4 -0
  195. package/src/react/types.ts +13 -0
  196. package/src/react/useApp.tsx +165 -0
  197. package/src/react/useCapabilities.ts +4 -3
  198. package/src/react/useLoading.tsx +70 -0
  199. package/src/testing/withPluginManager.stories.tsx +9 -5
  200. package/src/testing/withPluginManager.tsx +33 -32
  201. package/tsconfig.json +11 -9
  202. package/vitest.config.ts +8 -6
  203. package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
  204. package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs.map +0 -7
  205. package/dist/lib/browser/chunk-FMN65HSW.mjs.map +0 -7
  206. package/dist/lib/browser/chunk-FO2PH7M3.mjs.map +0 -7
  207. package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
  208. package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs.map +0 -7
  209. package/dist/lib/browser/worker.mjs +0 -79
  210. package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs.map +0 -7
  211. package/dist/lib/node-esm/chunk-73HGSHKE.mjs.map +0 -7
  212. package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
  213. package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs.map +0 -7
  214. package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs.map +0 -7
  215. package/dist/lib/node-esm/worker.mjs +0 -80
  216. package/dist/types/src/App.d.ts.map +0 -1
  217. package/dist/types/src/worker.d.ts +0 -4
  218. package/dist/types/src/worker.d.ts.map +0 -1
  219. package/src/App.tsx +0 -276
  220. package/src/worker.ts +0 -11
  221. /package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs.map → intent-dispatcher-TNEVDPI6.mjs.map} +0 -0
  222. /package/dist/lib/browser/{worker.mjs.map → react/index.mjs.map} +0 -0
  223. /package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs.map → intent-dispatcher-WUNOPJES.mjs.map} +0 -0
  224. /package/dist/lib/node-esm/{worker.mjs.map → react/index.mjs.map} +0 -0
@@ -1,30 +1,29 @@
1
- import React, { Component, type FC, type PropsWithChildren } from 'react';
2
- type Props = PropsWithChildren<{
1
+ import { Component, type FC, type PropsWithChildren, type ReactNode } from 'react';
2
+ type State = {
3
+ error: Error | undefined;
4
+ };
5
+ export type ErrorBoundaryProps = PropsWithChildren<{
3
6
  data?: any;
4
- fallback: FC<{
7
+ fallback?: FC<{
5
8
  data?: any;
6
9
  error: Error;
7
- reset: () => void;
8
10
  }>;
9
11
  }>;
10
- type State = {
11
- error: Error | undefined;
12
- };
13
12
  /**
14
13
  * Surface error boundary.
15
- *
16
14
  * For basic usage prefer providing a fallback component to `Surface`.
17
15
  *
18
- * For more information on error boundaries, see:
19
- * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
16
+ * Ref: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
20
17
  */
21
- export declare class ErrorBoundary extends Component<Props, State> {
22
- constructor(props: Props);
18
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
23
19
  static getDerivedStateFromError(error: Error): {
24
20
  error: Error;
25
21
  };
26
- componentDidUpdate(prevProps: Props): void;
27
- render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
22
+ state: {
23
+ error: undefined;
24
+ };
25
+ componentDidUpdate(prevProps: ErrorBoundaryProps): void;
26
+ render(): ReactNode;
28
27
  private resetError;
29
28
  }
30
29
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/react/ErrorBoundary.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1E,KAAK,KAAK,GAAG,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAC;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAC9G,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;CAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE;IAItD,kBAAkB,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI;IAM1C,MAAM,IAAI,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS;IAQ/G,OAAO,CAAC,UAAU;CAGnB"}
1
+ {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/react/ErrorBoundary.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1F,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IACjD,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,CAAC,EAAE,EAAE,CAAC;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE,KAAK,CAAC;IACrE,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE;IAItD,KAAK;;MAAwB;IAE7B,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI;IAMvD,MAAM,IAAI,SAAS;IAS5B,OAAO,CAAC,UAAU;CAGnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"IntentContext.d.ts","sourceRoot":"","sources":["../../../../src/react/IntentContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAA6B,KAAK,QAAQ,EAAa,MAAM,OAAO,CAAC;AAO1F,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9E,QAAA,MAAM,aAAa,EAAE,OAAO,CAAC,aAAa,GAAG,SAAS,CAAuD,CAAC;AAE9G,eAAO,MAAM,mBAAmB,QAAO,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,iBAAiB,CAGxF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,UAAU,iBAAiB,SAW5E,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,CAA0B,CAAC"}
1
+ {"version":3,"file":"IntentContext.d.ts","sourceRoot":"","sources":["../../../../src/react/IntentContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAwC,MAAM,OAAO,CAAC;AAM1F,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAI9E,QAAA,MAAM,aAAa,EAAE,OAAO,CAAC,aAAa,GAAG,SAAS,CAAuD,CAAC;AAE9G,eAAO,MAAM,mBAAmB,QAAO,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,iBAAiB,CAGxF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,UAAU,iBAAiB,SAW5E,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,CAA0B,CAAC"}
@@ -1,12 +1,12 @@
1
- import React from 'react';
1
+ import { type NamedExoticComponent, type RefAttributes } from 'react';
2
2
  import { type SurfaceProps } from '../common';
3
3
  import { type PluginContext } from '../core';
4
4
  /**
5
- * @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.
5
+ * A surface is a named region of the screen that can be populated by plugins.
6
6
  */
7
- export declare const isSurfaceAvailable: (context: PluginContext, { role, data }: Pick<SurfaceProps, "role" | "data">) => boolean;
7
+ export declare const Surface: NamedExoticComponent<SurfaceProps & RefAttributes<HTMLElement>>;
8
8
  /**
9
- * A surface is a named region of the screen that can be populated by plugins.
9
+ * @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.
10
10
  */
11
- export declare const Surface: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SurfaceProps, "ref"> & React.RefAttributes<HTMLElement>>>;
11
+ export declare const isSurfaceAvailable: (context: PluginContext, { role, data }: Pick<SurfaceProps, "role" | "data">) => boolean;
12
12
  //# sourceMappingURL=Surface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAO7E,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAqB7C;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,aAAa,EAAE,gBAAgB,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,YAI7G,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,0HA6BnB,CAAC"}
1
+ {"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.tsx"],"names":[],"mappings":"AAIA,OAAc,EAEZ,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAKnB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,oBAAoB,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CA+BnF,CAAC;AA+BF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,aAAa,EAAE,gBAAgB,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,YAI7G,CAAC"}
@@ -1,16 +1,14 @@
1
- import '@dxos-theme';
1
+ import { type StoryObj } from '@storybook/react-vite';
2
2
  import React from 'react';
3
- import { type PluginManager } from '../core';
4
- declare const _default: {
3
+ declare const meta: {
5
4
  title: string;
6
- render: ({ manager }: {
7
- manager: PluginManager;
8
- }) => React.JSX.Element;
5
+ render: () => React.JSX.Element;
9
6
  decorators: import("@storybook/react").Decorator[];
10
- args: {
11
- manager: PluginManager;
7
+ parameters: {
8
+ layout: string;
12
9
  };
13
10
  };
14
- export default _default;
15
- export declare const Default: {};
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Default: Story;
16
14
  //# sourceMappingURL=Surface.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.stories.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;;;0BAkErB;QAAE,OAAO,EAAE,aAAa,CAAA;KAAE;;;;;;AAFlD,wBAcE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
1
+ {"version":3,"file":"Surface.stories.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA2C,MAAM,OAAO,CAAC;AA0GhE,QAAA,MAAM,IAAI;;;;;;;CAO2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/react/common.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,kCAAqD,CAAC;AAEtF,eAAO,MAAM,WAAW,mFAA6C,CAAC;AAEtE,eAAO,MAAM,SAAS;;;;;;;;;EAA2C,CAAC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/react/common.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,kCAAqD,CAAC;AAEtF,eAAO,MAAM,WAAW,mFAA6C,CAAC;AAEtE,eAAO,MAAM,SAAS;;;;;;;;;EAA2C,CAAC"}
@@ -1,7 +1,9 @@
1
1
  export * from './common';
2
+ export * from './types';
2
3
  export * from './ErrorBoundary';
3
4
  export * from './PluginManagerProvider';
4
5
  export * from './Surface';
6
+ export * from './useApp';
5
7
  export * from './useCapabilities';
6
8
  export * from './useIntentResolver';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAE1B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type Obj } from '@dxos/echo';
2
+ export type SurfaceComponentProps<T extends Obj.Any = Obj.Any, Props = {}> = {
3
+ role?: 'article' | 'section' | 'card';
4
+ object: T;
5
+ } & Props;
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/react/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAKtC,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,EAAE,IAAI;IAC3E,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC;CACX,GAAG,KAAK,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React, { type FC } from 'react';
2
- import { PluginManager, type PluginManagerOptions, type Plugin } from './core';
3
- import { ErrorBoundary } from './react';
4
- export type CreateAppOptions = {
2
+ import { type Plugin, PluginManager, type PluginManagerOptions } from '../core';
3
+ import { ErrorBoundary } from './ErrorBoundary';
4
+ export type UseAppOptions = {
5
5
  pluginManager?: PluginManager;
6
6
  pluginLoader?: PluginManagerOptions['pluginLoader'];
7
7
  plugins?: Plugin[];
@@ -13,6 +13,7 @@ export type CreateAppOptions = {
13
13
  fallback?: ErrorBoundary['props']['fallback'];
14
14
  cacheEnabled?: boolean;
15
15
  safeMode?: boolean;
16
+ debounce?: number;
16
17
  };
17
18
  /**
18
19
  * Expected usage is for this to be the entrypoint of the application.
@@ -23,7 +24,7 @@ export type CreateAppOptions = {
23
24
  * const core = [LayoutPluginId];
24
25
  * const default = [MyPluginId];
25
26
  * const fallback = <div>Initializing Plugins...</div>;
26
- * const App = createApp({ plugins, core, default, fallback });
27
+ * const App = useApp({ plugins, core, default, fallback });
27
28
  * createRoot(document.getElementById('root')!).render(
28
29
  * <StrictMode>
29
30
  * <App />
@@ -39,5 +40,5 @@ export type CreateAppOptions = {
39
40
  * @param params.cacheEnabled Whether to cache enabled plugins in localStorage.
40
41
  * @param params.safeMode Whether to enable safe mode, which disables optional plugins.
41
42
  */
42
- export declare const useApp: ({ pluginManager, pluginLoader: _pluginLoader, plugins: _plugins, core: _core, defaults: _defaults, placeholder, fallback, cacheEnabled, safeMode, }: CreateAppOptions) => () => React.JSX.Element;
43
- //# sourceMappingURL=App.d.ts.map
43
+ export declare const useApp: ({ pluginManager, pluginLoader: pluginLoaderParam, plugins: pluginsParam, core: coreParam, defaults: defaultsParam, placeholder, fallback, cacheEnabled, safeMode, debounce, }: UseAppOptions) => () => React.JSX.Element;
44
+ //# sourceMappingURL=useApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useApp.d.ts","sourceRoot":"","sources":["../../../../src/react/useApp.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAmC,MAAM,OAAO,CAAC;AAOxE,OAAO,EAAE,KAAK,MAAM,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAIhF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,EAAE,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,MAAM,GAAI,+KAWpB,aAAa,4BAwFf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/react/useCapabilities.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,QAG/D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,MAI7D,CAAC"}
1
+ {"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/react/useCapabilities.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,QAG/D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,MAI7D,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type AppProps } from './App';
2
+ export declare enum LoadingState {
3
+ Loading = 0,
4
+ FadeIn = 1,
5
+ FadeOut = 2,
6
+ Done = 3
7
+ }
8
+ /**
9
+ * To avoid "flashing" the placeholder, we wait a period of time before starting the loading animation.
10
+ * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.
11
+ *
12
+ * States:
13
+ * 0: Loading - Wait for a period of time before starting the loading animation.
14
+ * 1: Fade-in - Display a loading animation.
15
+ * 2: Fade-out - Fade out the loading animation.
16
+ * 3: Done - Remove the placeholder.
17
+ */
18
+ export declare const useLoading: (state: AppProps["state"], debounce?: number) => LoadingState;
19
+ //# sourceMappingURL=useLoading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLoading.d.ts","sourceRoot":"","sources":["../../../../src/react/useLoading.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,oBAAY,YAAY;IACtB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,IAAI,IAAI;CACT;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAY,iBA4ChE,CAAC"}
@@ -1,16 +1,17 @@
1
- import { type Decorator } from '@storybook/react';
2
- import { type CreateAppOptions } from '../App';
1
+ import { type Decorator, type StoryContext } from '@storybook/react';
2
+ import { type MaybeProvider } from '@dxos/util';
3
3
  import { type ActivationEvent, type AnyCapability, type PluginContext } from '../core';
4
- export type Provider<C, R> = (context: C) => R;
5
- export type ProviderOrValue<C, R> = Provider<C, R> | R;
6
- export declare const getValue: <C, R>(providerOrValue: ProviderOrValue<C, R>, context: C) => R;
7
- export type WithPluginManagerOptions = CreateAppOptions & {
8
- capabilities?: ProviderOrValue<PluginContext, AnyCapability[]>;
4
+ import { type UseAppOptions } from '../react';
5
+ export type WithPluginManagerOptions = UseAppOptions & {
6
+ /** @deprecated */
7
+ capabilities?: MaybeProvider<AnyCapability[], PluginContext>;
8
+ /** @deprecated */
9
9
  fireEvents?: (ActivationEvent | string)[];
10
10
  };
11
+ export type WithPluginManagerInitializer<Args = void> = WithPluginManagerOptions | ((context: StoryContext<Args>) => WithPluginManagerOptions);
11
12
  /**
12
13
  * Wraps a story with a plugin manager.
13
14
  * NOTE: This builds up and tears down the plugin manager on every render.
14
15
  */
15
- export declare const withPluginManager: (options?: WithPluginManagerOptions) => Decorator;
16
+ export declare const withPluginManager: <Args>(init?: WithPluginManagerInitializer<Args>) => Decorator;
16
17
  //# sourceMappingURL=withPluginManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,EAAU,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAEvD,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;AAC/C,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AACvD,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,EAAE,iBAAiB,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,KAAG,CAEnF,CAAC;AA+BF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IACxD,YAAY,CAAC,EAAE,eAAe,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC;IAC/D,UAAU,CAAC,EAAE,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;CAC3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAS,wBAA6B,KAAG,SAmC1E,CAAC"}
1
+ {"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrE,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,YAAY,CAAC;AAGlE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,aAAa,EAKnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,aAAa,EAAU,MAAM,UAAU,CAAC;AA+BtD,MAAM,MAAM,wBAAwB,GAAG,aAAa,GAAG;IACrD,kBAAkB;IAClB,YAAY,CAAC,EAAE,aAAa,CAAC,aAAa,EAAE,EAAE,aAAa,CAAC,CAAC;IAC7D,kBAAkB;IAClB,UAAU,CAAC,EAAE,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,4BAA4B,CAAC,IAAI,GAAG,IAAI,IAChD,wBAAwB,GACxB,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,wBAAwB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,IAAI,EAAG,OAAM,4BAA4B,CAAC,IAAI,CAAM,KAAG,SAgCxF,CAAC"}
@@ -1,5 +1,11 @@
1
- import { type Meta } from '@dxos/storybook-utils';
2
- declare const meta: Meta;
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ declare const meta: {
4
+ title: string;
5
+ render: () => React.JSX.Element;
6
+ decorators: import("@storybook/react").Decorator[];
7
+ };
3
8
  export default meta;
4
- export declare const Default: {};
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
5
11
  //# sourceMappingURL=withPluginManager.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withPluginManager.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAiB7D,QAAA,MAAM,IAAI,EAAE,IAkBX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC"}
1
+ {"version":3,"file":"withPluginManager.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,QAAA,MAAM,IAAI;;;;CAkB2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}