@dxos/app-framework 0.8.2-main.fbd8ed0 → 0.8.2-staging.4d6ad0f

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 (249) hide show
  1. package/dist/lib/browser/{app-graph-builder-6E7NCZ77.mjs → app-graph-builder-DYEAGZPS.mjs} +3 -3
  2. package/dist/lib/browser/{chunk-2KSDY3EZ.mjs → chunk-5GE2ERNU.mjs} +24 -17
  3. package/dist/lib/browser/chunk-5GE2ERNU.mjs.map +7 -0
  4. package/dist/lib/browser/{chunk-KPRHX73H.mjs → chunk-WWEJRWFX.mjs} +2 -2
  5. package/dist/lib/browser/{chunk-KPRHX73H.mjs.map → chunk-WWEJRWFX.mjs.map} +1 -1
  6. package/dist/lib/browser/{chunk-K3HOLGVH.mjs → chunk-ZMXJV64L.mjs} +95 -47
  7. package/dist/lib/browser/chunk-ZMXJV64L.mjs.map +7 -0
  8. package/dist/lib/browser/index.mjs +8 -8
  9. package/dist/lib/browser/{intent-dispatcher-VGUJBPPN.mjs → intent-dispatcher-ELZN5EM7.mjs} +2 -2
  10. package/dist/lib/browser/{intent-resolver-QLFZY5R5.mjs → intent-resolver-SGWLINTO.mjs} +3 -3
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/{store-QGVXOY4T.mjs → store-YIU6IPZ2.mjs} +2 -2
  13. package/dist/lib/browser/testing/index.mjs +25 -13
  14. package/dist/lib/browser/testing/index.mjs.map +3 -3
  15. package/dist/lib/browser/worker.mjs +1 -1
  16. package/dist/lib/node/{app-graph-builder-4IWMG67O.cjs → app-graph-builder-GBLISL7L.cjs} +28 -28
  17. package/dist/lib/node/{chunk-JQMNABMK.cjs → chunk-G774ASXO.cjs} +5 -5
  18. package/dist/lib/node/{chunk-JQMNABMK.cjs.map → chunk-G774ASXO.cjs.map} +1 -1
  19. package/dist/lib/node/{chunk-2EBZ2ICH.cjs → chunk-HIVITTZD.cjs} +26 -19
  20. package/dist/lib/node/chunk-HIVITTZD.cjs.map +7 -0
  21. package/dist/lib/node/{chunk-7J66KH2T.cjs → chunk-Z2PMVDJ5.cjs} +107 -59
  22. package/dist/lib/node/chunk-Z2PMVDJ5.cjs.map +7 -0
  23. package/dist/lib/node/index.cjs +80 -80
  24. package/dist/lib/node/{intent-dispatcher-TASJBG5M.cjs → intent-dispatcher-LFXZJTAS.cjs} +8 -8
  25. package/dist/lib/node/{intent-dispatcher-TASJBG5M.cjs.map → intent-dispatcher-LFXZJTAS.cjs.map} +2 -2
  26. package/dist/lib/node/{intent-resolver-5CG5NIJY.cjs → intent-resolver-EPSFTHL6.cjs} +12 -12
  27. package/dist/lib/node/meta.json +1 -1
  28. package/dist/lib/node/{store-IF3UR2KA.cjs → store-CVVRXUTH.cjs} +8 -8
  29. package/dist/lib/node/testing/index.cjs +28 -16
  30. package/dist/lib/node/testing/index.cjs.map +3 -3
  31. package/dist/lib/node/worker.cjs +38 -38
  32. package/dist/lib/node/worker.cjs.map +1 -1
  33. package/dist/lib/node-esm/{app-graph-builder-LYCG5CO3.mjs → app-graph-builder-LUBDEIT6.mjs} +3 -3
  34. package/dist/lib/node-esm/{chunk-ISNBS46Y.mjs → chunk-6IKYKERU.mjs} +95 -47
  35. package/dist/lib/node-esm/chunk-6IKYKERU.mjs.map +7 -0
  36. package/dist/lib/node-esm/{chunk-JUJF5L4G.mjs → chunk-I6BVZMAH.mjs} +2 -2
  37. package/dist/lib/node-esm/{chunk-JUJF5L4G.mjs.map → chunk-I6BVZMAH.mjs.map} +1 -1
  38. package/dist/lib/node-esm/{chunk-BOEJMAVK.mjs → chunk-Z2ZHH4HN.mjs} +24 -17
  39. package/dist/lib/node-esm/chunk-Z2ZHH4HN.mjs.map +7 -0
  40. package/dist/lib/node-esm/index.mjs +8 -8
  41. package/dist/lib/node-esm/{intent-dispatcher-ZUSNX2OY.mjs → intent-dispatcher-A2JCMWRD.mjs} +2 -2
  42. package/dist/lib/node-esm/{intent-resolver-NGDHUKDD.mjs → intent-resolver-5C4O43GK.mjs} +3 -3
  43. package/dist/lib/node-esm/meta.json +1 -1
  44. package/dist/lib/node-esm/{store-NCRSE25X.mjs → store-HRZXZ2D2.mjs} +2 -2
  45. package/dist/lib/node-esm/testing/index.mjs +25 -13
  46. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  47. package/dist/lib/node-esm/worker.mjs +1 -1
  48. package/dist/types/src/App.d.ts +1 -1
  49. package/dist/types/src/App.d.ts.map +1 -1
  50. package/dist/types/src/common/capabilities.d.ts +36 -28
  51. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  52. package/dist/types/src/common/collaboration.d.ts +2 -9
  53. package/dist/types/src/common/collaboration.d.ts.map +1 -1
  54. package/dist/types/src/common/layout.d.ts +3 -1
  55. package/dist/types/src/common/layout.d.ts.map +1 -1
  56. package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
  57. package/dist/types/src/react/ErrorBoundary.d.ts +1 -1
  58. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
  59. package/dist/types/src/testing/withPluginManager.d.ts +1 -0
  60. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  61. package/package.json +22 -20
  62. package/src/App.tsx +93 -55
  63. package/src/common/capabilities.ts +11 -3
  64. package/src/common/collaboration.ts +4 -7
  65. package/src/common/layout.ts +9 -1
  66. package/src/core/capabilities.ts +2 -2
  67. package/src/core/manager.ts +10 -10
  68. package/src/playground/playground.stories.tsx +12 -8
  69. package/src/react/ErrorBoundary.tsx +3 -3
  70. package/src/testing/withPluginManager.tsx +24 -13
  71. package/tsconfig.json +1 -56
  72. package/typedoc/assets/navigation.js +1 -1
  73. package/typedoc/assets/search.js +1 -1
  74. package/typedoc/classes/CollaborationActions.InsertContent.html +131 -170
  75. package/typedoc/classes/ErrorBoundary.html +6 -6
  76. package/typedoc/classes/IntentAction.ShowUndo.html +5 -5
  77. package/typedoc/classes/IntentAction.Track.html +5 -5
  78. package/typedoc/classes/LayoutAction.AddToast.html +4 -4
  79. package/typedoc/classes/LayoutAction.Close.html +4 -4
  80. package/typedoc/classes/LayoutAction.Expose.html +4 -4
  81. package/typedoc/classes/LayoutAction.Open.html +4 -4
  82. package/typedoc/classes/LayoutAction.RevertWorkspace.html +4 -4
  83. package/typedoc/classes/LayoutAction.ScrollIntoView.html +4 -4
  84. package/typedoc/classes/LayoutAction.Set.html +4 -4
  85. package/typedoc/classes/LayoutAction.SetLayoutMode.html +4 -4
  86. package/typedoc/classes/LayoutAction.SwitchWorkspace.html +4 -4
  87. package/typedoc/classes/LayoutAction.UpdateComplementary.html +4 -4
  88. package/typedoc/classes/LayoutAction.UpdateDialog.html +365 -53
  89. package/typedoc/classes/LayoutAction.UpdateLayout.html +5 -5
  90. package/typedoc/classes/LayoutAction.UpdatePopover.html +4 -4
  91. package/typedoc/classes/LayoutAction.UpdateSidebar.html +4 -4
  92. package/typedoc/classes/Plugin.html +3 -3
  93. package/typedoc/classes/PluginContext.html +10 -10
  94. package/typedoc/classes/PluginManager.html +16 -16
  95. package/typedoc/classes/PluginModule.html +8 -8
  96. package/typedoc/classes/SettingsAction.Open.html +4 -4
  97. package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +4 -4
  98. package/typedoc/functions/Events.createStateEvent.html +2 -2
  99. package/typedoc/functions/IntentPlugin.html +1 -1
  100. package/typedoc/functions/SettingsPlugin.html +1 -1
  101. package/typedoc/functions/allOf.html +2 -2
  102. package/typedoc/functions/chain.html +2 -2
  103. package/typedoc/functions/contributes.html +2 -2
  104. package/typedoc/functions/createDispatcher.html +2 -2
  105. package/typedoc/functions/createIntent.html +2 -2
  106. package/typedoc/functions/createResolver.html +2 -2
  107. package/typedoc/functions/createSurface.html +2 -2
  108. package/typedoc/functions/defineCapability.html +2 -2
  109. package/typedoc/functions/defineEvent.html +2 -2
  110. package/typedoc/functions/defineModule.html +2 -2
  111. package/typedoc/functions/definePlugin.html +2 -2
  112. package/typedoc/functions/eventKey.html +2 -2
  113. package/typedoc/functions/getEvents.html +2 -2
  114. package/typedoc/functions/isAllOf.html +2 -2
  115. package/typedoc/functions/isOneOf.html +2 -2
  116. package/typedoc/functions/isSurfaceAvailable.html +2 -2
  117. package/typedoc/functions/lazy.html +2 -2
  118. package/typedoc/functions/oneOf.html +2 -2
  119. package/typedoc/functions/{createApp.html → useApp.html} +2 -2
  120. package/typedoc/functions/useAppGraph.html +1 -1
  121. package/typedoc/functions/useCapabilities.html +2 -2
  122. package/typedoc/functions/useCapability.html +2 -2
  123. package/typedoc/functions/useIntentDispatcher.html +1 -1
  124. package/typedoc/functions/useIntentResolver.html +1 -1
  125. package/typedoc/functions/useLayout.html +1 -1
  126. package/typedoc/functions/usePluginManager.html +2 -2
  127. package/typedoc/hierarchy.html +1 -1
  128. package/typedoc/index.html +2 -2
  129. package/typedoc/interfaces/LayoutAction.Toast.html +2 -2
  130. package/typedoc/modules/Capabilities.html +1 -1
  131. package/typedoc/modules/CollaborationActions.html +1 -1
  132. package/typedoc/modules/Events.html +1 -1
  133. package/typedoc/modules/IntentAction.html +1 -1
  134. package/typedoc/modules/LayoutAction.html +2 -2
  135. package/typedoc/modules/SettingsAction.html +1 -1
  136. package/typedoc/modules.html +1 -1
  137. package/typedoc/types/ActivationEvent.html +3 -3
  138. package/typedoc/types/ActivationEvents.html +2 -2
  139. package/typedoc/types/AnyCapability.html +1 -1
  140. package/typedoc/types/AnyIntent.html +1 -1
  141. package/typedoc/types/AnyIntentChain.html +1 -1
  142. package/typedoc/types/AnyIntentEffectResult.html +1 -1
  143. package/typedoc/types/AnyIntentResolver.html +1 -1
  144. package/typedoc/types/AnyIntentResult.html +1 -1
  145. package/typedoc/types/Capabilities.FileUploader.html +1 -1
  146. package/typedoc/types/Capabilities.IntentResolver.html +1 -1
  147. package/typedoc/types/Capabilities.Layout.html +1 -1
  148. package/typedoc/types/Capabilities.Metadata.html +1 -1
  149. package/typedoc/types/Capabilities.ReactContext.html +1 -1
  150. package/typedoc/types/Capabilities.ReactRoot.html +1 -1
  151. package/typedoc/types/Capabilities.ReactSurface.html +1 -1
  152. package/typedoc/types/Capabilities.Settings.html +2 -2
  153. package/typedoc/types/Capability.html +5 -5
  154. package/typedoc/types/CreateAppOptions.html +2 -2
  155. package/typedoc/types/FileInfo.html +1 -1
  156. package/typedoc/types/Intent.html +6 -6
  157. package/typedoc/types/IntentChain.html +3 -3
  158. package/typedoc/types/IntentContext.html +2 -2
  159. package/typedoc/types/IntentData.html +1 -1
  160. package/typedoc/types/IntentDispatcher.html +2 -2
  161. package/typedoc/types/IntentDispatcherResult.html +2 -2
  162. package/typedoc/types/IntentEffectDefinition.html +2 -2
  163. package/typedoc/types/IntentEffectResult.html +6 -6
  164. package/typedoc/types/IntentParams.html +2 -2
  165. package/typedoc/types/IntentResolver.html +2 -2
  166. package/typedoc/types/IntentResultData.html +1 -1
  167. package/typedoc/types/IntentSchema.html +1 -1
  168. package/typedoc/types/IntentUndo.html +2 -2
  169. package/typedoc/types/InterfaceDef.html +3 -3
  170. package/typedoc/types/Label.html +1 -1
  171. package/typedoc/types/NodeSerializer.html +3 -3
  172. package/typedoc/types/PluginManagerOptions.html +2 -2
  173. package/typedoc/types/PluginMeta.html +9 -9
  174. package/typedoc/types/PromiseIntentDispatcher.html +2 -2
  175. package/typedoc/types/PromiseIntentUndo.html +2 -2
  176. package/typedoc/types/Resource.html +1 -1
  177. package/typedoc/types/ResourceKey.html +1 -1
  178. package/typedoc/types/ResourceLanguage.html +1 -1
  179. package/typedoc/types/SerializedNode.html +2 -2
  180. package/typedoc/types/SurfaceComponent.html +2 -2
  181. package/typedoc/types/SurfaceDefinition.html +2 -2
  182. package/typedoc/types/SurfaceProps.html +2 -2
  183. package/typedoc/variables/Capabilities.AnchorSort.html +1 -0
  184. package/typedoc/variables/Capabilities.AppGraph.html +1 -1
  185. package/typedoc/variables/Capabilities.AppGraphBuilder.html +1 -1
  186. package/typedoc/variables/Capabilities.AppGraphSerializer.html +1 -1
  187. package/typedoc/variables/Capabilities.ArtifactDefinition.html +1 -1
  188. package/typedoc/variables/Capabilities.FileUploader.html +1 -1
  189. package/typedoc/variables/Capabilities.IntentDispatcher.html +1 -1
  190. package/typedoc/variables/Capabilities.IntentResolver.html +1 -1
  191. package/typedoc/variables/Capabilities.Layout.html +1 -1
  192. package/typedoc/variables/Capabilities.Metadata.html +1 -1
  193. package/typedoc/variables/Capabilities.Null.html +1 -1
  194. package/typedoc/variables/Capabilities.PluginManager.html +1 -1
  195. package/typedoc/variables/Capabilities.ReactContext.html +1 -1
  196. package/typedoc/variables/Capabilities.ReactRoot.html +1 -1
  197. package/typedoc/variables/Capabilities.ReactSurface.html +1 -1
  198. package/typedoc/variables/Capabilities.RxRegistry.html +1 -1
  199. package/typedoc/variables/Capabilities.Settings.html +1 -1
  200. package/typedoc/variables/Capabilities.SettingsStore.html +1 -1
  201. package/typedoc/variables/Capabilities.Tools.html +1 -1
  202. package/typedoc/variables/Capabilities.Translations.html +1 -1
  203. package/typedoc/variables/Events.AppGraphReady.html +2 -2
  204. package/typedoc/variables/Events.DispatcherReady.html +2 -2
  205. package/typedoc/variables/Events.LayoutReady.html +1 -1
  206. package/typedoc/variables/Events.SettingsReady.html +2 -2
  207. package/typedoc/variables/Events.SetupAppGraph.html +2 -2
  208. package/typedoc/variables/Events.SetupArtifactDefinition.html +2 -2
  209. package/typedoc/variables/Events.SetupIntentResolver.html +2 -2
  210. package/typedoc/variables/Events.SetupMetadata.html +2 -2
  211. package/typedoc/variables/Events.SetupReactSurface.html +2 -2
  212. package/typedoc/variables/Events.SetupSettings.html +2 -2
  213. package/typedoc/variables/Events.SetupTranslations.html +2 -2
  214. package/typedoc/variables/Events.Startup.html +2 -2
  215. package/typedoc/variables/FileInfoSchema.html +1 -1
  216. package/typedoc/variables/INTENT_ACTION.html +1 -1
  217. package/typedoc/variables/INTENT_PLUGIN.html +1 -1
  218. package/typedoc/variables/LAYOUT_ACTION.html +1 -1
  219. package/typedoc/variables/LAYOUT_PLUGIN.html +1 -1
  220. package/typedoc/variables/Label.html +1 -1
  221. package/typedoc/variables/LayoutAction.Toast.html +1 -1
  222. package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +1 -1
  223. package/typedoc/variables/PluginManagerProvider.html +2 -2
  224. package/typedoc/variables/Resource.html +2 -2
  225. package/typedoc/variables/ResourceKey.html +1 -1
  226. package/typedoc/variables/ResourceLanguage.html +1 -1
  227. package/typedoc/variables/SETTINGS_ACTION.html +1 -1
  228. package/typedoc/variables/SETTINGS_ID.html +1 -1
  229. package/typedoc/variables/SETTINGS_KEY.html +1 -1
  230. package/typedoc/variables/SETTINGS_PLUGIN.html +1 -1
  231. package/typedoc/variables/Surface.html +2 -2
  232. package/typedoc/variables/defaultFileTypes.html +1 -1
  233. package/dist/lib/browser/chunk-2KSDY3EZ.mjs.map +0 -7
  234. package/dist/lib/browser/chunk-K3HOLGVH.mjs.map +0 -7
  235. package/dist/lib/node/chunk-2EBZ2ICH.cjs.map +0 -7
  236. package/dist/lib/node/chunk-7J66KH2T.cjs.map +0 -7
  237. package/dist/lib/node-esm/chunk-BOEJMAVK.mjs.map +0 -7
  238. package/dist/lib/node-esm/chunk-ISNBS46Y.mjs.map +0 -7
  239. /package/dist/lib/browser/{app-graph-builder-6E7NCZ77.mjs.map → app-graph-builder-DYEAGZPS.mjs.map} +0 -0
  240. /package/dist/lib/browser/{intent-dispatcher-VGUJBPPN.mjs.map → intent-dispatcher-ELZN5EM7.mjs.map} +0 -0
  241. /package/dist/lib/browser/{intent-resolver-QLFZY5R5.mjs.map → intent-resolver-SGWLINTO.mjs.map} +0 -0
  242. /package/dist/lib/browser/{store-QGVXOY4T.mjs.map → store-YIU6IPZ2.mjs.map} +0 -0
  243. /package/dist/lib/node/{app-graph-builder-4IWMG67O.cjs.map → app-graph-builder-GBLISL7L.cjs.map} +0 -0
  244. /package/dist/lib/node/{intent-resolver-5CG5NIJY.cjs.map → intent-resolver-EPSFTHL6.cjs.map} +0 -0
  245. /package/dist/lib/node/{store-IF3UR2KA.cjs.map → store-CVVRXUTH.cjs.map} +0 -0
  246. /package/dist/lib/node-esm/{app-graph-builder-LYCG5CO3.mjs.map → app-graph-builder-LUBDEIT6.mjs.map} +0 -0
  247. /package/dist/lib/node-esm/{intent-dispatcher-ZUSNX2OY.mjs.map → intent-dispatcher-A2JCMWRD.mjs.map} +0 -0
  248. /package/dist/lib/node-esm/{intent-resolver-NGDHUKDD.mjs.map → intent-resolver-5C4O43GK.mjs.map} +0 -0
  249. /package/dist/lib/node-esm/{store-NCRSE25X.mjs.map → store-HRZXZ2D2.mjs.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Capabilities,
3
3
  contributes
4
- } from "./chunk-2KSDY3EZ.mjs";
4
+ } from "./chunk-5GE2ERNU.mjs";
5
5
 
6
6
  // packages/sdk/app-framework/src/plugin-settings/store.ts
7
7
  import { RootSettingsStore } from "@dxos/local-storage";
@@ -27,4 +27,4 @@ var store_default = (context) => {
27
27
  export {
28
28
  store_default as default
29
29
  };
30
- //# sourceMappingURL=store-QGVXOY4T.mjs.map
30
+ //# sourceMappingURL=store-YIU6IPZ2.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
- createApp
3
- } from "../chunk-K3HOLGVH.mjs";
2
+ useApp
3
+ } from "../chunk-ZMXJV64L.mjs";
4
4
  import {
5
5
  Capabilities,
6
6
  Events,
@@ -8,10 +8,10 @@ import {
8
8
  contributes,
9
9
  defineModule,
10
10
  definePlugin
11
- } from "../chunk-2KSDY3EZ.mjs";
11
+ } from "../chunk-5GE2ERNU.mjs";
12
12
 
13
13
  // packages/sdk/app-framework/src/testing/withPluginManager.tsx
14
- import React, { useEffect } from "react";
14
+ import React, { useEffect, useMemo } from "react";
15
15
  import { raise } from "@dxos/debug";
16
16
  var getValue = (providerOrValue, context) => {
17
17
  return typeof providerOrValue === "function" ? providerOrValue(context) : providerOrValue;
@@ -41,14 +41,10 @@ var setupPluginManager = ({ capabilities, plugins = [], core = plugins.map(({ me
41
41
  return pluginManager;
42
42
  };
43
43
  var withPluginManager = (options = {}) => {
44
- const pluginManager = setupPluginManager(options);
45
- const App = createApp({
46
- pluginManager
47
- });
48
- options.fireEvents?.forEach((event) => {
49
- void pluginManager.activate(event);
50
- });
51
44
  return (Story, context) => {
45
+ const pluginManager = useMemo(() => setupPluginManager(options), [
46
+ options
47
+ ]);
52
48
  useEffect(() => {
53
49
  const capability = contributes(Capabilities.ReactRoot, {
54
50
  id: context.id,
@@ -58,8 +54,24 @@ var withPluginManager = (options = {}) => {
58
54
  ...capability,
59
55
  module: "dxos.org/app-framework/withPluginManager"
60
56
  });
61
- return () => pluginManager.context.removeCapability(capability.interface, capability.implementation);
62
- }, []);
57
+ return () => {
58
+ pluginManager.context.removeCapability(capability.interface, capability.implementation);
59
+ };
60
+ }, [
61
+ pluginManager,
62
+ context
63
+ ]);
64
+ useEffect(() => {
65
+ const timeout = setTimeout(async () => {
66
+ await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);
67
+ });
68
+ return () => clearTimeout(timeout);
69
+ }, [
70
+ pluginManager
71
+ ]);
72
+ const App = useApp({
73
+ pluginManager
74
+ });
63
75
  return /* @__PURE__ */ React.createElement(App, null);
64
76
  };
65
77
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/withPluginManager.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { useEffect } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { createApp, type CreateAppOptions } from '../App';\nimport { Capabilities, Events } from '../common';\nimport {\n type ActivationEvent,\n type AnyCapability,\n contributes,\n defineModule,\n definePlugin,\n PluginManager,\n type PluginContext,\n} from '../core';\n\n// TODO(burdon): Factor out (use consistently in plugin framework?)\nexport type Provider<C, R> = (context: C) => R;\nexport type ProviderOrValue<C, R> = Provider<C, R> | R;\nexport const getValue = <C, R>(providerOrValue: ProviderOrValue<C, R>, context: C): R => {\n return typeof providerOrValue === 'function' ? (providerOrValue as Provider<C, R>)(context) : providerOrValue;\n};\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n ...options\n}: CreateAppOptions & Pick<WithPluginManagerOptions, 'capabilities'> = {}) => {\n const pluginManager = new PluginManager({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [StoryPlugin(), ...plugins],\n core: [STORY_PLUGIN, ...core],\n ...options,\n });\n\n if (capabilities) {\n getValue(capabilities, pluginManager.context).forEach((capability) => {\n pluginManager.context.contributeCapability({\n interface: capability.interface,\n implementation: capability.implementation,\n module: 'story',\n });\n });\n }\n\n return pluginManager;\n};\n\nexport type WithPluginManagerOptions = CreateAppOptions & {\n capabilities?: ProviderOrValue<PluginContext, AnyCapability[]>;\n fireEvents?: (ActivationEvent | string)[];\n};\n\n/**\n * Wraps a story with a plugin manager.\n */\nexport const withPluginManager = (options: WithPluginManagerOptions = {}): Decorator => {\n const pluginManager = setupPluginManager(options);\n const App = createApp({ pluginManager });\n\n options.fireEvents?.forEach((event) => {\n void pluginManager.activate(event);\n });\n\n return (Story, context) => {\n useEffect(() => {\n const capability = contributes(Capabilities.ReactRoot, {\n id: context.id,\n root: () => <Story />,\n });\n\n pluginManager.context.contributeCapability({\n ...capability,\n module: 'dxos.org/app-framework/withPluginManager',\n });\n\n return () => pluginManager.context.removeCapability(capability.interface, capability.implementation);\n }, []);\n\n return <App />;\n };\n};\n\n// No-op plugin to ensure there exists at least one plugin for the startup event.\n// This is necessary because `createApp` expects the startup event to complete before the app is ready.\nconst STORY_PLUGIN = 'dxos.org/app-framework/story';\nconst StoryPlugin = () =>\n definePlugin({ id: STORY_PLUGIN, name: 'Story' }, [\n defineModule({ id: STORY_PLUGIN, activatesOn: Events.Startup, activate: () => [] }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;;AAKA,OAAOA,SAASC,iBAAiB;AAEjC,SAASC,aAAa;AAiBf,IAAMC,WAAW,CAAOC,iBAAwCC,YAAAA;AACrE,SAAO,OAAOD,oBAAoB,aAAcA,gBAAmCC,OAAAA,IAAWD;AAChG;AAKO,IAAME,qBAAqB,CAAC,EACjCC,cACAC,UAAU,CAAA,GACVC,OAAOD,QAAQE,IAAI,CAAC,EAAEC,KAAI,MAAOA,KAAKC,EAAE,GACxC,GAAGC,QAAAA,IACkE,CAAC,MAAC;AACvE,QAAMC,gBAAgB,IAAIC,cAAc;IACtCC,cAAc,MAAMC,MAAM,IAAIC,MAAM,iBAAA,CAAA;IACpCV,SAAS;MAACW,YAAAA;SAAkBX;;IAC5BC,MAAM;MAACW;SAAiBX;;IACxB,GAAGI;EACL,CAAA;AAEA,MAAIN,cAAc;AAChBJ,aAASI,cAAcO,cAAcT,OAAO,EAAEgB,QAAQ,CAACC,eAAAA;AACrDR,oBAAcT,QAAQkB,qBAAqB;QACzCC,WAAWF,WAAWE;QACtBC,gBAAgBH,WAAWG;QAC3BC,QAAQ;MACV,CAAA;IACF,CAAA;EACF;AAEA,SAAOZ;AACT;AAUO,IAAMa,oBAAoB,CAACd,UAAoC,CAAC,MAAC;AACtE,QAAMC,gBAAgBR,mBAAmBO,OAAAA;AACzC,QAAMe,MAAMC,UAAU;IAAEf;EAAc,CAAA;AAEtCD,UAAQiB,YAAYT,QAAQ,CAACU,UAAAA;AAC3B,SAAKjB,cAAckB,SAASD,KAAAA;EAC9B,CAAA;AAEA,SAAO,CAACE,OAAO5B,YAAAA;AACb6B,cAAU,MAAA;AACR,YAAMZ,aAAaa,YAAYC,aAAaC,WAAW;QACrDzB,IAAIP,QAAQO;QACZ0B,MAAM,MAAM,sBAAA,cAACL,OAAAA,IAAAA;MACf,CAAA;AAEAnB,oBAAcT,QAAQkB,qBAAqB;QACzC,GAAGD;QACHI,QAAQ;MACV,CAAA;AAEA,aAAO,MAAMZ,cAAcT,QAAQkC,iBAAiBjB,WAAWE,WAAWF,WAAWG,cAAc;IACrG,GAAG,CAAA,CAAE;AAEL,WAAO,sBAAA,cAACG,KAAAA,IAAAA;EACV;AACF;AAIA,IAAMR,eAAe;AACrB,IAAMD,cAAc,MAClBqB,aAAa;EAAE5B,IAAIQ;EAAcqB,MAAM;AAAQ,GAAG;EAChDC,aAAa;IAAE9B,IAAIQ;IAAcuB,aAAaC,OAAOC;IAASb,UAAU,MAAM,CAAA;EAAG,CAAA;CAClF;",
6
- "names": ["React", "useEffect", "raise", "getValue", "providerOrValue", "context", "setupPluginManager", "capabilities", "plugins", "core", "map", "meta", "id", "options", "pluginManager", "PluginManager", "pluginLoader", "raise", "Error", "StoryPlugin", "STORY_PLUGIN", "forEach", "capability", "contributeCapability", "interface", "implementation", "module", "withPluginManager", "App", "createApp", "fireEvents", "event", "activate", "Story", "useEffect", "contributes", "Capabilities", "ReactRoot", "root", "removeCapability", "definePlugin", "name", "defineModule", "activatesOn", "Events", "Startup"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { useEffect, useMemo } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { useApp, type CreateAppOptions } from '../App';\nimport { Capabilities, Events } from '../common';\nimport {\n contributes,\n defineModule,\n definePlugin,\n type ActivationEvent,\n type AnyCapability,\n PluginManager,\n type PluginContext,\n} from '../core';\n\n// TODO(burdon): Factor out (use consistently in plugin framework?)\nexport type Provider<C, R> = (context: C) => R;\nexport type ProviderOrValue<C, R> = Provider<C, R> | R;\nexport const getValue = <C, R>(providerOrValue: ProviderOrValue<C, R>, context: C): R => {\n return typeof providerOrValue === 'function' ? (providerOrValue as Provider<C, R>)(context) : providerOrValue;\n};\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n ...options\n}: CreateAppOptions & Pick<WithPluginManagerOptions, 'capabilities'> = {}) => {\n const pluginManager = new PluginManager({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [StoryPlugin(), ...plugins],\n core: [STORY_PLUGIN, ...core],\n ...options,\n });\n\n if (capabilities) {\n getValue(capabilities, pluginManager.context).forEach((capability) => {\n pluginManager.context.contributeCapability({\n interface: capability.interface,\n implementation: capability.implementation,\n module: 'story',\n });\n });\n }\n\n return pluginManager;\n};\n\nexport type WithPluginManagerOptions = CreateAppOptions & {\n capabilities?: ProviderOrValue<PluginContext, AnyCapability[]>;\n fireEvents?: (ActivationEvent | string)[];\n};\n\n/**\n * Wraps a story with a plugin manager.\n * NOTE: This builds up and tears down the plugin manager on every render.\n */\nexport const withPluginManager = (options: WithPluginManagerOptions = {}): Decorator => {\n return (Story, context) => {\n const pluginManager = useMemo(() => setupPluginManager(options), [options]);\n\n // Set-up root capability.\n useEffect(() => {\n const capability = contributes(Capabilities.ReactRoot, {\n id: context.id,\n root: () => <Story />,\n });\n\n pluginManager.context.contributeCapability({\n ...capability,\n module: 'dxos.org/app-framework/withPluginManager',\n });\n\n return () => {\n pluginManager.context.removeCapability(capability.interface, capability.implementation);\n };\n }, [pluginManager, context]);\n\n // Fire events.\n useEffect(() => {\n const timeout = setTimeout(async () => {\n await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);\n });\n\n return () => clearTimeout(timeout);\n }, [pluginManager]);\n\n // Create app.\n const App = useApp({ pluginManager });\n\n return <App />;\n };\n};\n\n// No-op plugin to ensure there exists at least one plugin for the startup event.\n// This is necessary because `createApp` expects the startup event to complete before the app is ready.\nconst STORY_PLUGIN = 'dxos.org/app-framework/story';\nconst StoryPlugin = () =>\n definePlugin({ id: STORY_PLUGIN, name: 'Story' }, [\n defineModule({ id: STORY_PLUGIN, activatesOn: Events.Startup, activate: () => [] }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAKA,OAAOA,SAASC,WAAWC,eAAe;AAE1C,SAASC,aAAa;AAiBf,IAAMC,WAAW,CAAOC,iBAAwCC,YAAAA;AACrE,SAAO,OAAOD,oBAAoB,aAAcA,gBAAmCC,OAAAA,IAAWD;AAChG;AAKO,IAAME,qBAAqB,CAAC,EACjCC,cACAC,UAAU,CAAA,GACVC,OAAOD,QAAQE,IAAI,CAAC,EAAEC,KAAI,MAAOA,KAAKC,EAAE,GACxC,GAAGC,QAAAA,IACkE,CAAC,MAAC;AACvE,QAAMC,gBAAgB,IAAIC,cAAc;IACtCC,cAAc,MAAMC,MAAM,IAAIC,MAAM,iBAAA,CAAA;IACpCV,SAAS;MAACW,YAAAA;SAAkBX;;IAC5BC,MAAM;MAACW;SAAiBX;;IACxB,GAAGI;EACL,CAAA;AAEA,MAAIN,cAAc;AAChBJ,aAASI,cAAcO,cAAcT,OAAO,EAAEgB,QAAQ,CAACC,eAAAA;AACrDR,oBAAcT,QAAQkB,qBAAqB;QACzCC,WAAWF,WAAWE;QACtBC,gBAAgBH,WAAWG;QAC3BC,QAAQ;MACV,CAAA;IACF,CAAA;EACF;AAEA,SAAOZ;AACT;AAWO,IAAMa,oBAAoB,CAACd,UAAoC,CAAC,MAAC;AACtE,SAAO,CAACe,OAAOvB,YAAAA;AACb,UAAMS,gBAAgBe,QAAQ,MAAMvB,mBAAmBO,OAAAA,GAAU;MAACA;KAAQ;AAG1EiB,cAAU,MAAA;AACR,YAAMR,aAAaS,YAAYC,aAAaC,WAAW;QACrDrB,IAAIP,QAAQO;QACZsB,MAAM,MAAM,sBAAA,cAACN,OAAAA,IAAAA;MACf,CAAA;AAEAd,oBAAcT,QAAQkB,qBAAqB;QACzC,GAAGD;QACHI,QAAQ;MACV,CAAA;AAEA,aAAO,MAAA;AACLZ,sBAAcT,QAAQ8B,iBAAiBb,WAAWE,WAAWF,WAAWG,cAAc;MACxF;IACF,GAAG;MAACX;MAAeT;KAAQ;AAG3ByB,cAAU,MAAA;AACR,YAAMM,UAAUC,WAAW,YAAA;AACzB,cAAMC,QAAQC,IAAI1B,QAAQ2B,YAAY9B,IAAI,CAAC+B,UAAU3B,cAAc4B,SAASD,KAAAA,CAAAA,KAAW,CAAA,CAAE;MAC3F,CAAA;AAEA,aAAO,MAAME,aAAaP,OAAAA;IAC5B,GAAG;MAACtB;KAAc;AAGlB,UAAM8B,MAAMC,OAAO;MAAE/B;IAAc,CAAA;AAEnC,WAAO,sBAAA,cAAC8B,KAAAA,IAAAA;EACV;AACF;AAIA,IAAMxB,eAAe;AACrB,IAAMD,cAAc,MAClB2B,aAAa;EAAElC,IAAIQ;EAAc2B,MAAM;AAAQ,GAAG;EAChDC,aAAa;IAAEpC,IAAIQ;IAAc6B,aAAaC,OAAOC;IAAST,UAAU,MAAM,CAAA;EAAG,CAAA;CAClF;",
6
+ "names": ["React", "useEffect", "useMemo", "raise", "getValue", "providerOrValue", "context", "setupPluginManager", "capabilities", "plugins", "core", "map", "meta", "id", "options", "pluginManager", "PluginManager", "pluginLoader", "raise", "Error", "StoryPlugin", "STORY_PLUGIN", "forEach", "capability", "contributeCapability", "interface", "implementation", "module", "withPluginManager", "Story", "useMemo", "useEffect", "contributes", "Capabilities", "ReactRoot", "root", "removeCapability", "timeout", "setTimeout", "Promise", "all", "fireEvents", "event", "activate", "clearTimeout", "App", "useApp", "definePlugin", "name", "defineModule", "activatesOn", "Events", "Startup"]
7
7
  }
@@ -36,7 +36,7 @@ import {
36
36
  isOneOf,
37
37
  lazy,
38
38
  oneOf
39
- } from "./chunk-2KSDY3EZ.mjs";
39
+ } from "./chunk-5GE2ERNU.mjs";
40
40
  export {
41
41
  Capabilities,
42
42
  CollaborationActions,
@@ -16,32 +16,32 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var app_graph_builder_4IWMG67O_exports = {};
20
- __export(app_graph_builder_4IWMG67O_exports, {
19
+ var app_graph_builder_GBLISL7L_exports = {};
20
+ __export(app_graph_builder_GBLISL7L_exports, {
21
21
  default: () => app_graph_builder_default
22
22
  });
23
- module.exports = __toCommonJS(app_graph_builder_4IWMG67O_exports);
24
- var import_chunk_JQMNABMK = require("./chunk-JQMNABMK.cjs");
25
- var import_chunk_2EBZ2ICH = require("./chunk-2EBZ2ICH.cjs");
23
+ module.exports = __toCommonJS(app_graph_builder_GBLISL7L_exports);
24
+ var import_chunk_G774ASXO = require("./chunk-G774ASXO.cjs");
25
+ var import_chunk_HIVITTZD = require("./chunk-HIVITTZD.cjs");
26
26
  var import_rx_react = require("@effect-rx/rx-react");
27
27
  var import_effect = require("effect");
28
28
  var import_app_graph = require("@dxos/app-graph");
29
29
  var import_util = require("@dxos/util");
30
- var app_graph_builder_default = (context) => (0, import_chunk_2EBZ2ICH.contributes)(import_chunk_2EBZ2ICH.Capabilities.AppGraphBuilder, [
30
+ var app_graph_builder_default = (context) => (0, import_chunk_HIVITTZD.contributes)(import_chunk_HIVITTZD.Capabilities.AppGraphBuilder, [
31
31
  (0, import_app_graph.createExtension)({
32
- id: `${import_chunk_JQMNABMK.SETTINGS_PLUGIN}/action`,
32
+ id: `${import_chunk_G774ASXO.SETTINGS_PLUGIN}/action`,
33
33
  actions: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id === import_app_graph.ROOT_ID ? import_effect.Option.some(node2) : import_effect.Option.none()), import_effect.Option.map(() => [
34
34
  {
35
- id: import_chunk_JQMNABMK.SETTINGS_PLUGIN,
35
+ id: import_chunk_G774ASXO.SETTINGS_PLUGIN,
36
36
  data: async () => {
37
- const { dispatchPromise: dispatch } = context.getCapability(import_chunk_2EBZ2ICH.Capabilities.IntentDispatcher);
38
- await dispatch((0, import_chunk_2EBZ2ICH.createIntent)(import_chunk_JQMNABMK.SettingsAction.Open));
37
+ const { dispatchPromise: dispatch } = context.getCapability(import_chunk_HIVITTZD.Capabilities.IntentDispatcher);
38
+ await dispatch((0, import_chunk_HIVITTZD.createIntent)(import_chunk_G774ASXO.SettingsAction.Open));
39
39
  },
40
40
  properties: {
41
41
  label: [
42
42
  "open settings label",
43
43
  {
44
- ns: import_chunk_JQMNABMK.SETTINGS_PLUGIN
44
+ ns: import_chunk_G774ASXO.SETTINGS_PLUGIN
45
45
  }
46
46
  ],
47
47
  icon: "ph--gear--regular",
@@ -55,16 +55,16 @@ var app_graph_builder_default = (context) => (0, import_chunk_2EBZ2ICH.contribut
55
55
  ]), import_effect.Option.getOrElse(() => [])))
56
56
  }),
57
57
  (0, import_app_graph.createExtension)({
58
- id: `${import_chunk_JQMNABMK.SETTINGS_PLUGIN}/core`,
58
+ id: `${import_chunk_G774ASXO.SETTINGS_PLUGIN}/core`,
59
59
  connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id === import_app_graph.ROOT_ID ? import_effect.Option.some(node2) : import_effect.Option.none()), import_effect.Option.map(() => [
60
60
  {
61
- id: import_chunk_JQMNABMK.SETTINGS_ID,
62
- type: import_chunk_JQMNABMK.SETTINGS_PLUGIN,
61
+ id: import_chunk_G774ASXO.SETTINGS_ID,
62
+ type: import_chunk_G774ASXO.SETTINGS_PLUGIN,
63
63
  properties: {
64
64
  label: [
65
65
  "app settings label",
66
66
  {
67
- ns: import_chunk_JQMNABMK.SETTINGS_PLUGIN
67
+ ns: import_chunk_G774ASXO.SETTINGS_PLUGIN
68
68
  }
69
69
  ],
70
70
  icon: "ph--gear--regular",
@@ -76,10 +76,10 @@ var app_graph_builder_default = (context) => (0, import_chunk_2EBZ2ICH.contribut
76
76
  ]), import_effect.Option.getOrElse(() => [])))
77
77
  }),
78
78
  (0, import_app_graph.createExtension)({
79
- id: `${import_chunk_JQMNABMK.SETTINGS_PLUGIN}/core-plugins`,
80
- connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id !== import_chunk_JQMNABMK.SETTINGS_ID ? import_effect.Option.none() : import_effect.Option.some(node2)), import_effect.Option.map(() => {
81
- const manager = get(context.capability(import_chunk_2EBZ2ICH.Capabilities.PluginManager));
82
- const [settingsStore] = get(context.capabilities(import_chunk_2EBZ2ICH.Capabilities.SettingsStore));
79
+ id: `${import_chunk_G774ASXO.SETTINGS_PLUGIN}/core-plugins`,
80
+ connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id !== import_chunk_G774ASXO.SETTINGS_ID ? import_effect.Option.none() : import_effect.Option.some(node2)), import_effect.Option.map(() => {
81
+ const manager = get(context.capability(import_chunk_HIVITTZD.Capabilities.PluginManager));
82
+ const [settingsStore] = get(context.capabilities(import_chunk_HIVITTZD.Capabilities.SettingsStore));
83
83
  return [
84
84
  ...manager.plugins.filter((plugin) => manager.core.includes(plugin.meta.id)).map((plugin) => {
85
85
  const settings = settingsStore?.getStore(plugin.meta.id);
@@ -91,7 +91,7 @@ var app_graph_builder_default = (context) => (0, import_chunk_2EBZ2ICH.contribut
91
91
  settings
92
92
  ];
93
93
  }).filter(import_util.isNonNullable).map(([meta, settings]) => ({
94
- id: `${import_chunk_JQMNABMK.SETTINGS_KEY}:${meta.id.replaceAll("/", ":")}`,
94
+ id: `${import_chunk_G774ASXO.SETTINGS_KEY}:${meta.id.replaceAll("/", ":")}`,
95
95
  type: "category",
96
96
  data: settings,
97
97
  properties: {
@@ -100,13 +100,13 @@ var app_graph_builder_default = (context) => (0, import_chunk_2EBZ2ICH.contribut
100
100
  }
101
101
  })),
102
102
  {
103
- id: `${import_chunk_JQMNABMK.SETTINGS_KEY}:custom-plugins`,
103
+ id: `${import_chunk_G774ASXO.SETTINGS_KEY}:custom-plugins`,
104
104
  type: "category",
105
105
  properties: {
106
106
  label: [
107
107
  "custom plugins label",
108
108
  {
109
- ns: import_chunk_JQMNABMK.SETTINGS_PLUGIN
109
+ ns: import_chunk_G774ASXO.SETTINGS_PLUGIN
110
110
  }
111
111
  ],
112
112
  icon: "ph--squares-four--regular",
@@ -118,10 +118,10 @@ var app_graph_builder_default = (context) => (0, import_chunk_2EBZ2ICH.contribut
118
118
  }), import_effect.Option.getOrElse(() => [])))
119
119
  }),
120
120
  (0, import_app_graph.createExtension)({
121
- id: `${import_chunk_JQMNABMK.SETTINGS_PLUGIN}/custom-plugins`,
122
- connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id !== `${import_chunk_JQMNABMK.SETTINGS_KEY}:custom-plugins` ? import_effect.Option.none() : import_effect.Option.some(node2)), import_effect.Option.map(() => {
123
- const manager = get(context.capability(import_chunk_2EBZ2ICH.Capabilities.PluginManager));
124
- const [settingsStore] = get(context.capabilities(import_chunk_2EBZ2ICH.Capabilities.SettingsStore));
121
+ id: `${import_chunk_G774ASXO.SETTINGS_PLUGIN}/custom-plugins`,
122
+ connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id !== `${import_chunk_G774ASXO.SETTINGS_KEY}:custom-plugins` ? import_effect.Option.none() : import_effect.Option.some(node2)), import_effect.Option.map(() => {
123
+ const manager = get(context.capability(import_chunk_HIVITTZD.Capabilities.PluginManager));
124
+ const [settingsStore] = get(context.capabilities(import_chunk_HIVITTZD.Capabilities.SettingsStore));
125
125
  return manager.plugins.filter((plugin) => !manager.core.includes(plugin.meta.id)).map((plugin) => {
126
126
  const settings = settingsStore?.getStore(plugin.meta.id);
127
127
  if (!settings) {
@@ -132,7 +132,7 @@ var app_graph_builder_default = (context) => (0, import_chunk_2EBZ2ICH.contribut
132
132
  settings
133
133
  ];
134
134
  }).filter(import_util.isNonNullable).map(([meta, settings]) => ({
135
- id: `${import_chunk_JQMNABMK.SETTINGS_KEY}:${meta.id.replaceAll("/", ":")}`,
135
+ id: `${import_chunk_G774ASXO.SETTINGS_KEY}:${meta.id.replaceAll("/", ":")}`,
136
136
  type: "category",
137
137
  data: settings,
138
138
  properties: {
@@ -143,4 +143,4 @@ var app_graph_builder_default = (context) => (0, import_chunk_2EBZ2ICH.contribut
143
143
  }), import_effect.Option.getOrElse(() => [])))
144
144
  })
145
145
  ]);
146
- //# sourceMappingURL=app-graph-builder-4IWMG67O.cjs.map
146
+ //# sourceMappingURL=app-graph-builder-GBLISL7L.cjs.map
@@ -16,21 +16,20 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_JQMNABMK_exports = {};
20
- __export(chunk_JQMNABMK_exports, {
19
+ var chunk_G774ASXO_exports = {};
20
+ __export(chunk_G774ASXO_exports, {
21
21
  SETTINGS_ACTION: () => SETTINGS_ACTION,
22
22
  SETTINGS_ID: () => SETTINGS_ID,
23
23
  SETTINGS_KEY: () => SETTINGS_KEY,
24
24
  SETTINGS_PLUGIN: () => SETTINGS_PLUGIN,
25
25
  SettingsAction: () => SettingsAction
26
26
  });
27
- module.exports = __toCommonJS(chunk_JQMNABMK_exports);
27
+ module.exports = __toCommonJS(chunk_G774ASXO_exports);
28
28
  var import_effect = require("effect");
29
29
  var SETTINGS_PLUGIN = "dxos.org/plugin/settings";
30
30
  var SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;
31
31
  var SETTINGS_ID = "!dxos:settings";
32
32
  var SETTINGS_KEY = "settings";
33
- var SettingsAction;
34
33
  (function(SettingsAction2) {
35
34
  class Open extends import_effect.Schema.TaggedClass()(`${SETTINGS_ACTION}/open`, {
36
35
  input: import_effect.Schema.Struct({
@@ -47,6 +46,7 @@ var SettingsAction;
47
46
  }
48
47
  SettingsAction2.OpenPluginRegistry = OpenPluginRegistry;
49
48
  })(SettingsAction || (SettingsAction = {}));
49
+ var SettingsAction;
50
50
  // Annotate the CommonJS export names for ESM import in node:
51
51
  0 && (module.exports = {
52
52
  SETTINGS_ACTION,
@@ -55,4 +55,4 @@ var SettingsAction;
55
55
  SETTINGS_PLUGIN,
56
56
  SettingsAction
57
57
  });
58
- //# sourceMappingURL=chunk-JQMNABMK.cjs.map
58
+ //# sourceMappingURL=chunk-G774ASXO.cjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/plugin-settings/actions.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nexport const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';\nexport const SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;\n// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n// Ideally this should be worked into the data model in a generic way.\nexport const SETTINGS_ID = '!dxos:settings';\nexport const SETTINGS_KEY = 'settings';\n\nexport namespace SettingsAction {\n export class Open extends Schema.TaggedClass<Open>()(`${SETTINGS_ACTION}/open`, {\n input: Schema.Struct({\n plugin: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(\n `${SETTINGS_ACTION}/open-plugin-registry`,\n {\n input: Schema.Void,\n output: Schema.Void,\n },\n ) {}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEhB,IAAMA,kBAAkB;AACxB,IAAMC,kBAAkB,GAAGD,eAAAA;AAG3B,IAAME,cAAc;AACpB,IAAMC,eAAe;;UAEXC,iBAAAA;EACR,MAAMC,aAAaC,qBAAOC,YAAW,EAAS,GAAGN,eAAAA,SAAwB;IAC9EO,OAAOF,qBAAOG,OAAO;MACnBC,QAAQJ,qBAAOK,SAASL,qBAAOM,MAAM;IACvC,CAAA;IACAC,QAAQP,qBAAOQ;EACjB,CAAA,EAAA;EAAI;kBALST,OAAAA;EAON,MAAMU,2BAA2BT,qBAAOC,YAAW,EACxD,GAAGN,eAAAA,yBACH;IACEO,OAAOF,qBAAOQ;IACdD,QAAQP,qBAAOQ;EACjB,CAAA,EAAA;EACC;kBANUC,qBAAAA;AAOf,GAfiBX,mBAAAA,iBAAAA,CAAAA,EAAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEhB,IAAMA,kBAAkB;AACxB,IAAMC,kBAAkB,GAAGD,eAAAA;AAG3B,IAAME,cAAc;AACpB,IAAMC,eAAe;UAEXC,iBAAAA;EACR,MAAMC,aAAaC,qBAAOC,YAAW,EAAS,GAAGN,eAAAA,SAAwB;IAC9EO,OAAOF,qBAAOG,OAAO;MACnBC,QAAQJ,qBAAOK,SAASL,qBAAOM,MAAM;IACvC,CAAA;IACAC,QAAQP,qBAAOQ;EACjB,CAAA,EAAA;EAAI;kBALST,OAAAA;EAON,MAAMU,2BAA2BT,qBAAOC,YAAW,EACxD,GAAGN,eAAAA,yBACH;IACEO,OAAOF,qBAAOQ;IACdD,QAAQP,qBAAOQ;EACjB,CAAA,EAAA;EACC;kBANUC,qBAAAA;AAOf,GAfiBX,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
6
6
  "names": ["SETTINGS_PLUGIN", "SETTINGS_ACTION", "SETTINGS_ID", "SETTINGS_KEY", "SettingsAction", "Open", "Schema", "TaggedClass", "input", "Struct", "plugin", "optional", "String", "output", "Void", "OpenPluginRegistry"]
7
7
  }
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_2EBZ2ICH_exports = {};
30
- __export(chunk_2EBZ2ICH_exports, {
29
+ var chunk_HIVITTZD_exports = {};
30
+ __export(chunk_HIVITTZD_exports, {
31
31
  Capabilities: () => Capabilities,
32
32
  CollaborationActions: () => CollaborationActions,
33
33
  Events: () => Events,
@@ -67,7 +67,7 @@ __export(chunk_2EBZ2ICH_exports, {
67
67
  lazy: () => lazy,
68
68
  oneOf: () => oneOf
69
69
  });
70
- module.exports = __toCommonJS(chunk_2EBZ2ICH_exports);
70
+ module.exports = __toCommonJS(chunk_HIVITTZD_exports);
71
71
  var import_effect = require("effect");
72
72
  var import_live_object = require("@dxos/live-object");
73
73
  var import_log = require("@dxos/log");
@@ -87,7 +87,6 @@ var import_live_object2 = require("@dxos/live-object");
87
87
  var import_log3 = require("@dxos/log");
88
88
  var import_effect6 = require("effect");
89
89
  var import_echo_schema = require("@dxos/echo-schema");
90
- var import_keys = require("@dxos/keys");
91
90
  var import_effect7 = require("effect");
92
91
  var import_effect8 = require("effect");
93
92
  var import_effect9 = require("effect");
@@ -133,7 +132,6 @@ var Label = import_effect3.Schema.Union(import_effect3.Schema.String, import_eff
133
132
  })))));
134
133
  var INTENT_PLUGIN = "dxos.org/plugin/intent";
135
134
  var INTENT_ACTION = `${INTENT_PLUGIN}/action`;
136
- var IntentAction;
137
135
  (function(IntentAction2) {
138
136
  class Track extends import_effect2.Schema.TaggedClass()(`${INTENT_ACTION}/track`, {
139
137
  input: import_effect2.Schema.Struct({
@@ -153,13 +151,12 @@ var IntentAction;
153
151
  }
154
152
  IntentAction2.ShowUndo = ShowUndo;
155
153
  })(IntentAction || (IntentAction = {}));
154
+ var IntentAction;
156
155
  var BaseError = class extends Error {
157
156
  constructor(code, message, context) {
158
157
  super(message ?? code, {
159
158
  cause: context
160
- });
161
- this.code = code;
162
- this.context = context;
159
+ }), this.code = code, this.context = context;
163
160
  this.name = code;
164
161
  Object.setPrototypeOf(this, new.target.prototype);
165
162
  }
@@ -916,7 +913,6 @@ var Plugin = class {
916
913
  var definePlugin = (meta, modules) => {
917
914
  return new Plugin(meta, modules);
918
915
  };
919
- var Capabilities;
920
916
  (function(Capabilities2) {
921
917
  Capabilities2.PluginManager = defineCapability("dxos.org/app-framework/capability/plugin-manager");
922
918
  Capabilities2.Null = defineCapability("dxos.org/app-framework/capability/null");
@@ -937,24 +933,25 @@ var Capabilities;
937
933
  Capabilities2.Tools = defineCapability("dxos.org/app-framework/capability/tools");
938
934
  Capabilities2.ArtifactDefinition = defineCapability("dxos.org/app-framework/capability/artifact-definition");
939
935
  Capabilities2.FileUploader = defineCapability("dxos.org/app-framework/capability/file-uploader");
936
+ Capabilities2.AnchorSort = defineCapability("dxos.org/app-framework/capability/anchor-sort");
940
937
  })(Capabilities || (Capabilities = {}));
941
- var CollaborationActions;
938
+ var Capabilities;
942
939
  (function(CollaborationActions2) {
943
940
  class InsertContent extends import_effect6.Schema.TaggedClass()("assistant/intent-content", {
944
941
  input: import_effect6.Schema.Struct({
945
- spaceId: import_keys.SpaceId,
946
- target: (0, import_echo_schema.Ref)(import_echo_schema.Expando),
942
+ target: import_echo_schema.Expando,
947
943
  object: (0, import_echo_schema.Ref)(import_echo_schema.Expando),
944
+ at: import_effect6.Schema.optional(import_effect6.Schema.String),
948
945
  label: import_effect6.Schema.String.pipe(import_effect6.Schema.optional)
949
946
  }).annotations({
950
- [import_effect6.SchemaAST.DescriptionAnnotationId]: "Enables plugins to inject content blocks or references into a related entity."
947
+ description: "Enables plugins to inject content blocks or references into a related entity."
951
948
  }),
952
949
  output: import_effect6.Schema.Void
953
950
  }) {
954
951
  }
955
952
  CollaborationActions2.InsertContent = InsertContent;
956
953
  })(CollaborationActions || (CollaborationActions = {}));
957
- var Events;
954
+ var CollaborationActions;
958
955
  (function(Events2) {
959
956
  Events2.Startup = defineEvent("dxos.org/app-framework/event/startup");
960
957
  Events2.SetupReactSurface = defineEvent("dxos.org/app-framework/event/setup-react-surface");
@@ -970,6 +967,7 @@ var Events;
970
967
  Events2.createStateEvent = (specifier) => defineEvent("dxos.org/app-framework/event/state", specifier);
971
968
  Events2.LayoutReady = Events2.createStateEvent(Capabilities.Layout.identifier);
972
969
  })(Events || (Events = {}));
970
+ var Events;
973
971
  var defaultFileTypes = {
974
972
  images: [
975
973
  "png",
@@ -1008,12 +1006,11 @@ var IntentPlugin = () => definePlugin({
1008
1006
  activatesAfter: [
1009
1007
  Events.DispatcherReady
1010
1008
  ],
1011
- activate: lazy(() => import("./intent-dispatcher-TASJBG5M.cjs"))
1009
+ activate: lazy(() => import("./intent-dispatcher-LFXZJTAS.cjs"))
1012
1010
  })
1013
1011
  ]);
1014
1012
  var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
1015
1013
  var LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
1016
- var LayoutAction;
1017
1014
  (function(LayoutAction2) {
1018
1015
  LayoutAction2.UPDATE_LAYOUT = `${LAYOUT_ACTION}/update-layout`;
1019
1016
  class UpdateLayout extends import_effect8.Schema.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
@@ -1105,11 +1102,20 @@ var LayoutAction;
1105
1102
  state: import_effect8.Schema.optional(import_effect8.Schema.Boolean.annotations({
1106
1103
  description: "Whether the dialog is open or closed."
1107
1104
  })),
1105
+ type: import_effect8.Schema.optional(import_effect8.Schema.Literal("default", "alert").annotations({
1106
+ description: "The type of dialog."
1107
+ })),
1108
1108
  blockAlign: import_effect8.Schema.optional(import_effect8.Schema.Literal("start", "center", "end").annotations({
1109
1109
  description: "The alignment of the dialog."
1110
1110
  })),
1111
- type: import_effect8.Schema.optional(import_effect8.Schema.Literal("default", "alert").annotations({
1112
- description: "The type of dialog."
1111
+ overlayClasses: import_effect8.Schema.optional(import_effect8.Schema.String.annotations({
1112
+ description: "Additional classes for the dialog overlay."
1113
+ })),
1114
+ overlayStyle: import_effect8.Schema.optional(import_effect8.Schema.Record({
1115
+ key: import_effect8.Schema.String,
1116
+ value: import_effect8.Schema.Any
1117
+ }).annotations({
1118
+ description: "Additional styles for the dialog overlay."
1113
1119
  })),
1114
1120
  props: import_effect8.Schema.optional(import_effect8.Schema.Record({
1115
1121
  key: import_effect8.Schema.String,
@@ -1337,6 +1343,7 @@ var LayoutAction;
1337
1343
  }
1338
1344
  LayoutAction2.Expose = Expose;
1339
1345
  })(LayoutAction || (LayoutAction = {}));
1346
+ var LayoutAction;
1340
1347
  var createSurface = (definition) => definition;
1341
1348
  var ResourceKey = import_effect9.Schema.Union(import_effect9.Schema.String, import_effect9.Schema.Record({
1342
1349
  key: import_effect9.Schema.String,
@@ -1540,4 +1547,4 @@ var intent_dispatcher_default = (context) => {
1540
1547
  lazy,
1541
1548
  oneOf
1542
1549
  });
1543
- //# sourceMappingURL=chunk-2EBZ2ICH.cjs.map
1550
+ //# sourceMappingURL=chunk-HIVITTZD.cjs.map