@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.
- package/.storybook/main.mts +11 -0
- package/.storybook/preview.mts +8 -0
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- package/.swc/plugins/{v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 → linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7} +0 -0
- package/dist/lib/browser/{app-graph-builder-LYF7EKNN.mjs → app-graph-builder-JPUFNED5.mjs} +32 -31
- package/dist/lib/browser/app-graph-builder-JPUFNED5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FMN65HSW.mjs → chunk-LVSO2N4X.mjs} +351 -263
- package/dist/lib/browser/chunk-LVSO2N4X.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ORWHM7CO.mjs → chunk-SCPE4ZO2.mjs} +11 -8
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FO2PH7M3.mjs → chunk-XRAWIHTQ.mjs} +247 -184
- package/dist/lib/browser/chunk-XRAWIHTQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +20 -56
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs → intent-dispatcher-TNEVDPI6.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-ZTNOSO3A.mjs → intent-resolver-SYLXP62Y.mjs} +7 -7
- package/dist/lib/browser/intent-resolver-SYLXP62Y.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react/index.mjs +32 -0
- package/dist/lib/browser/{store-KML2R4IE.mjs → store-3HDXKFXP.mjs} +4 -4
- package/dist/lib/browser/{store-KML2R4IE.mjs.map → store-3HDXKFXP.mjs.map} +2 -2
- package/dist/lib/browser/testing/index.mjs +17 -21
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{app-graph-builder-SAOWGJDK.mjs → app-graph-builder-VO6RTSOS.mjs} +32 -31
- package/dist/lib/node-esm/app-graph-builder-VO6RTSOS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZEZ4FVEU.mjs → chunk-FO5NIDOR.mjs} +351 -263
- package/dist/lib/node-esm/chunk-FO5NIDOR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-73HGSHKE.mjs → chunk-JH3SFOXA.mjs} +247 -184
- package/dist/lib/node-esm/chunk-JH3SFOXA.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UMZQERLE.mjs → chunk-ZX63QUGE.mjs} +11 -8
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +20 -56
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs → intent-dispatcher-WUNOPJES.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-W7Z7WFFM.mjs → intent-resolver-VTZI3NO7.mjs} +7 -7
- package/dist/lib/node-esm/intent-resolver-VTZI3NO7.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react/index.mjs +33 -0
- package/dist/lib/node-esm/{store-QEXGXLWZ.mjs → store-PAJPVOLG.mjs} +4 -4
- package/dist/lib/node-esm/{store-QEXGXLWZ.mjs.map → store-PAJPVOLG.mjs.map} +2 -2
- package/dist/lib/node-esm/testing/index.mjs +17 -21
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/common/capabilities.d.ts +110 -39
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/collaboration.d.ts +10 -9
- package/dist/types/src/common/collaboration.d.ts.map +1 -1
- package/dist/types/src/common/events.d.ts.map +1 -1
- package/dist/types/src/common/file.d.ts +1 -1
- package/dist/types/src/common/file.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +1 -1
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +1 -3
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/common/surface.d.ts +8 -13
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +1 -1
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +17 -14
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +7 -3
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +8 -1
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/debug/Debug.d.ts +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Main.d.ts +1 -1
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts +1 -1
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/layout/Layout.d.ts +2 -2
- package/dist/types/src/playground/layout/plugin.d.ts +1 -1
- package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts +1 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/schema.d.ts +1 -1
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts +5 -4
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/actions.d.ts +5 -7
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/errors.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/index.d.ts +1 -0
- package/dist/types/src/plugin-intent/index.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +7 -7
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/meta.d.ts +3 -0
- package/dist/types/src/plugin-intent/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +1 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts +5 -7
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +1 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/meta.d.ts +3 -0
- package/dist/types/src/plugin-settings/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/store.d.ts +1 -1
- package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/translations.d.ts +2 -1
- package/dist/types/src/plugin-settings/translations.d.ts.map +1 -1
- package/dist/types/src/react/App.d.ts +10 -0
- package/dist/types/src/react/App.d.ts.map +1 -0
- package/dist/types/src/react/App.stories.d.ts +14 -0
- package/dist/types/src/react/App.stories.d.ts.map +1 -0
- package/dist/types/src/react/DefaultFallback.d.ts +8 -0
- package/dist/types/src/react/DefaultFallback.d.ts.map +1 -0
- package/dist/types/src/react/ErrorBoundary.d.ts +13 -14
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
- package/dist/types/src/react/IntentContext.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts +5 -5
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/Surface.stories.d.ts +8 -10
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
- package/dist/types/src/react/common.d.ts.map +1 -1
- package/dist/types/src/react/index.d.ts +2 -0
- package/dist/types/src/react/index.d.ts.map +1 -1
- package/dist/types/src/react/types.d.ts +6 -0
- package/dist/types/src/react/types.d.ts.map +1 -0
- package/dist/types/src/{App.d.ts → react/useApp.d.ts} +7 -6
- package/dist/types/src/react/useApp.d.ts.map +1 -0
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
- package/dist/types/src/react/useLoading.d.ts +19 -0
- package/dist/types/src/react/useLoading.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +9 -8
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +5 -1
- package/package.json +46 -38
- package/src/common/capabilities.ts +116 -18
- package/src/common/collaboration.ts +6 -9
- package/src/common/events.ts +3 -1
- package/src/common/file.ts +1 -1
- package/src/common/index.ts +1 -1
- package/src/common/layout.ts +3 -4
- package/src/common/surface.ts +16 -18
- package/src/common/translations.ts +1 -1
- package/src/core/capabilities.test.ts +3 -3
- package/src/core/capabilities.ts +34 -25
- package/src/core/manager.test.ts +22 -21
- package/src/core/manager.ts +141 -56
- package/src/core/plugin.ts +13 -2
- package/src/helpers.test.ts +1 -1
- package/src/index.ts +0 -2
- package/src/playground/debug/Debug.tsx +1 -1
- package/src/playground/debug/plugin.ts +7 -8
- package/src/playground/generator/Main.tsx +0 -1
- package/src/playground/generator/Toolbar.tsx +2 -1
- package/src/playground/generator/generator.ts +4 -4
- package/src/playground/generator/plugin.ts +12 -13
- package/src/playground/layout/plugin.ts +10 -9
- package/src/playground/logger/Toolbar.tsx +2 -1
- package/src/playground/logger/plugin.ts +30 -25
- package/src/playground/logger/schema.ts +1 -1
- package/src/playground/playground.stories.tsx +20 -16
- package/src/plugin-intent/IntentPlugin.ts +13 -13
- package/src/plugin-intent/actions.ts +4 -6
- package/src/plugin-intent/errors.ts +2 -1
- package/src/plugin-intent/index.ts +1 -0
- package/src/plugin-intent/intent-dispatcher.test.ts +10 -3
- package/src/plugin-intent/intent-dispatcher.ts +16 -12
- package/src/plugin-intent/intent.ts +1 -1
- package/src/plugin-intent/meta.ts +10 -0
- package/src/plugin-settings/SettingsPlugin.ts +27 -28
- package/src/plugin-settings/actions.ts +9 -13
- package/src/plugin-settings/app-graph-builder.ts +25 -22
- package/src/plugin-settings/intent-resolver.ts +5 -4
- package/src/plugin-settings/meta.ts +10 -0
- package/src/plugin-settings/store.ts +1 -1
- package/src/plugin-settings/translations.ts +4 -4
- package/src/react/App.stories.tsx +33 -0
- package/src/react/App.tsx +59 -0
- package/src/react/DefaultFallback.tsx +26 -0
- package/src/react/ErrorBoundary.tsx +26 -15
- package/src/react/IntentContext.tsx +3 -2
- package/src/react/Surface.stories.tsx +81 -52
- package/src/react/Surface.tsx +70 -38
- package/src/react/common.ts +2 -1
- package/src/react/index.ts +4 -0
- package/src/react/types.ts +13 -0
- package/src/react/useApp.tsx +165 -0
- package/src/react/useCapabilities.ts +4 -3
- package/src/react/useLoading.tsx +70 -0
- package/src/testing/withPluginManager.stories.tsx +9 -5
- package/src/testing/withPluginManager.tsx +33 -32
- package/tsconfig.json +11 -9
- package/vitest.config.ts +8 -6
- package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
- package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs.map +0 -7
- package/dist/lib/browser/chunk-FMN65HSW.mjs.map +0 -7
- package/dist/lib/browser/chunk-FO2PH7M3.mjs.map +0 -7
- package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -79
- package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-73HGSHKE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -80
- package/dist/types/src/App.d.ts.map +0 -1
- package/dist/types/src/worker.d.ts +0 -4
- package/dist/types/src/worker.d.ts.map +0 -1
- package/src/App.tsx +0 -276
- package/src/worker.ts +0 -11
- /package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs.map → intent-dispatcher-TNEVDPI6.mjs.map} +0 -0
- /package/dist/lib/browser/{worker.mjs.map → react/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs.map → intent-dispatcher-WUNOPJES.mjs.map} +0 -0
- /package/dist/lib/node-esm/{worker.mjs.map → react/index.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
useApp
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-JH3SFOXA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Capabilities,
|
|
7
7
|
Events,
|
|
@@ -9,29 +9,28 @@ import {
|
|
|
9
9
|
contributes,
|
|
10
10
|
defineModule,
|
|
11
11
|
definePlugin
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-FO5NIDOR.mjs";
|
|
13
13
|
|
|
14
14
|
// src/testing/withPluginManager.tsx
|
|
15
15
|
import React, { useEffect, useMemo } from "react";
|
|
16
16
|
import { raise } from "@dxos/debug";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
17
|
+
import { useAsyncEffect } from "@dxos/react-hooks";
|
|
18
|
+
import { getProviderValue } from "@dxos/util";
|
|
20
19
|
var setupPluginManager = ({ capabilities, plugins = [], core = plugins.map(({ meta }) => meta.id), ...options } = {}) => {
|
|
21
20
|
const pluginManager = new PluginManager({
|
|
22
21
|
pluginLoader: () => raise(new Error("Not implemented")),
|
|
23
22
|
plugins: [
|
|
24
|
-
|
|
23
|
+
StoryPlugin(),
|
|
25
24
|
...plugins
|
|
26
25
|
],
|
|
27
26
|
core: [
|
|
28
|
-
|
|
27
|
+
StoryPlugin.meta.id,
|
|
29
28
|
...core
|
|
30
29
|
],
|
|
31
30
|
...options
|
|
32
31
|
});
|
|
33
32
|
if (capabilities) {
|
|
34
|
-
|
|
33
|
+
getProviderValue(capabilities, pluginManager.context).forEach((capability) => {
|
|
35
34
|
pluginManager.context.contributeCapability({
|
|
36
35
|
interface: capability.interface,
|
|
37
36
|
implementation: capability.implementation,
|
|
@@ -41,10 +40,11 @@ var setupPluginManager = ({ capabilities, plugins = [], core = plugins.map(({ me
|
|
|
41
40
|
}
|
|
42
41
|
return pluginManager;
|
|
43
42
|
};
|
|
44
|
-
var withPluginManager = (
|
|
43
|
+
var withPluginManager = (init = {}) => {
|
|
45
44
|
return (Story, context) => {
|
|
45
|
+
const options = typeof init === "function" ? init(context) : init;
|
|
46
46
|
const pluginManager = useMemo(() => setupPluginManager(options), [
|
|
47
|
-
|
|
47
|
+
init
|
|
48
48
|
]);
|
|
49
49
|
useEffect(() => {
|
|
50
50
|
const capability = contributes(Capabilities.ReactRoot, {
|
|
@@ -62,11 +62,8 @@ var withPluginManager = (options = {}) => {
|
|
|
62
62
|
pluginManager,
|
|
63
63
|
context
|
|
64
64
|
]);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);
|
|
68
|
-
});
|
|
69
|
-
return () => clearTimeout(timeout);
|
|
65
|
+
useAsyncEffect(async () => {
|
|
66
|
+
await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);
|
|
70
67
|
}, [
|
|
71
68
|
pluginManager
|
|
72
69
|
]);
|
|
@@ -76,19 +73,18 @@ var withPluginManager = (options = {}) => {
|
|
|
76
73
|
return /* @__PURE__ */ React.createElement(App, null);
|
|
77
74
|
};
|
|
78
75
|
};
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
id: STORY_PLUGIN,
|
|
76
|
+
var storyMeta = {
|
|
77
|
+
id: "dxos.org/app-framework/story",
|
|
82
78
|
name: "Story"
|
|
83
|
-
}
|
|
79
|
+
};
|
|
80
|
+
var StoryPlugin = definePlugin(storyMeta, () => [
|
|
84
81
|
defineModule({
|
|
85
|
-
id:
|
|
82
|
+
id: storyMeta.id,
|
|
86
83
|
activatesOn: Events.Startup,
|
|
87
84
|
activate: () => []
|
|
88
85
|
})
|
|
89
86
|
]);
|
|
90
87
|
export {
|
|
91
|
-
getValue,
|
|
92
88
|
setupPluginManager,
|
|
93
89
|
withPluginManager
|
|
94
90
|
};
|
|
@@ -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, useMemo } from 'react';\n\nimport { raise } from '@dxos/debug';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAKA,OAAOA,SAASC,WAAWC,eAAe;AAE1C,SAASC,aAAa;
|
|
6
|
-
"names": ["React", "useEffect", "useMemo", "raise", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator, type StoryContext } from '@storybook/react';\nimport React, { useEffect, useMemo } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { useAsyncEffect } from '@dxos/react-hooks';\nimport { type MaybeProvider, getProviderValue } from '@dxos/util';\n\nimport { Capabilities, Events } from '../common';\nimport {\n type ActivationEvent,\n type AnyCapability,\n type PluginContext,\n PluginManager,\n contributes,\n defineModule,\n definePlugin,\n} from '../core';\nimport { type UseAppOptions, useApp } from '../react';\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n ...options\n}: UseAppOptions & Pick<WithPluginManagerOptions, 'capabilities'> = {}) => {\n const pluginManager = new PluginManager({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [StoryPlugin(), ...plugins],\n core: [StoryPlugin.meta.id, ...core],\n ...options,\n });\n\n if (capabilities) {\n getProviderValue(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 = UseAppOptions & {\n /** @deprecated */\n capabilities?: MaybeProvider<AnyCapability[], PluginContext>;\n /** @deprecated */\n fireEvents?: (ActivationEvent | string)[];\n};\n\nexport type WithPluginManagerInitializer<Args = void> =\n | WithPluginManagerOptions\n | ((context: StoryContext<Args>) => WithPluginManagerOptions);\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 = <Args,>(init: WithPluginManagerInitializer<Args> = {}): Decorator => {\n return (Story, context) => {\n const options = typeof init === 'function' ? init(context as any) : init;\n const pluginManager = useMemo(() => setupPluginManager(options), [init]);\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 useAsyncEffect(async () => {\n await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);\n }, [pluginManager]);\n\n // Create app.\n const App = useApp({ pluginManager });\n\n return <App />;\n };\n};\n\nconst storyMeta = {\n id: 'dxos.org/app-framework/story',\n name: 'Story',\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 StoryPlugin = definePlugin(storyMeta, () => [\n defineModule({ id: storyMeta.id, activatesOn: Events.Startup, activate: () => [] }),\n]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAKA,OAAOA,SAASC,WAAWC,eAAe;AAE1C,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAA6BC,wBAAwB;AAiB9C,IAAMC,qBAAqB,CAAC,EACjCC,cACAC,UAAU,CAAA,GACVC,OAAOD,QAAQE,IAAI,CAAC,EAAEC,KAAI,MAAOA,KAAKC,EAAE,GACxC,GAAGC,QAAAA,IAC+D,CAAC,MAAC;AACpE,QAAMC,gBAAgB,IAAIC,cAAc;IACtCC,cAAc,MAAMC,MAAM,IAAIC,MAAM,iBAAA,CAAA;IACpCV,SAAS;MAACW,YAAAA;SAAkBX;;IAC5BC,MAAM;MAACU,YAAYR,KAAKC;SAAOH;;IAC/B,GAAGI;EACL,CAAA;AAEA,MAAIN,cAAc;AAChBa,qBAAiBb,cAAcO,cAAcO,OAAO,EAAEC,QAAQ,CAAC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", "capabilities", "plugins", "core", "map", "meta", "id", "options", "pluginManager", "PluginManager", "pluginLoader", "raise", "Error", "StoryPlugin", "getProviderValue", "context", "forEach", "capability", "contributeCapability", "interface", "implementation", "module", "withPluginManager", "init", "Story", "useMemo", "useEffect", "contributes", "Capabilities", "ReactRoot", "root", "removeCapability", "useAsyncEffect", "Promise", "all", "fireEvents", "event", "activate", "App", "useApp", "storyMeta", "name", "definePlugin", "defineModule", "activatesOn", "Events", "Startup"]
|
|
7
7
|
}
|
|
@@ -1,46 +1,73 @@
|
|
|
1
|
-
import { type Registry } from '@effect-
|
|
2
|
-
import
|
|
1
|
+
import { type Registry } from '@effect-atom/atom-react';
|
|
2
|
+
import type * as Layer from 'effect/Layer';
|
|
3
|
+
import type * as Schema from 'effect/Schema';
|
|
3
4
|
import { type FC, type PropsWithChildren } from 'react';
|
|
4
|
-
import { type
|
|
5
|
-
import
|
|
6
|
-
import { type
|
|
5
|
+
import { type AiService } from '@dxos/ai';
|
|
6
|
+
import type * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
7
|
+
import { type BuilderExtensions, type GraphBuilder } from '@dxos/app-graph';
|
|
8
|
+
import { type GenericToolkit } from '@dxos/assistant';
|
|
9
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
7
10
|
import { type Space } from '@dxos/client-protocol';
|
|
8
11
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
9
12
|
import { type RootSettingsStore } from '@dxos/local-storage';
|
|
10
|
-
import { type AnchoredTo } from '@dxos/
|
|
13
|
+
import { type AnchoredTo } from '@dxos/types';
|
|
14
|
+
import { type PluginManager } from '../core';
|
|
15
|
+
import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
|
|
11
16
|
import { type FileInfo } from './file';
|
|
12
17
|
import { type NodeSerializer } from './graph';
|
|
13
18
|
import { type SurfaceDefinition } from './surface';
|
|
14
|
-
import { type PluginManager } from '../core';
|
|
15
|
-
import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
|
|
16
19
|
export declare namespace Capabilities {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @category Capability
|
|
22
|
+
*/
|
|
23
|
+
const Null: import("..").InterfaceDef<null>;
|
|
24
|
+
/**
|
|
25
|
+
* @category Capability
|
|
26
|
+
*/
|
|
27
|
+
const PluginManager: import("..").InterfaceDef<PluginManager>;
|
|
28
|
+
/**
|
|
29
|
+
* @category Capability
|
|
30
|
+
*/
|
|
31
|
+
const RxRegistry: import("..").InterfaceDef<Registry.Registry>;
|
|
32
|
+
type ReactContext = Readonly<{
|
|
21
33
|
id: string;
|
|
22
34
|
dependsOn?: string[];
|
|
23
35
|
context: FC<PropsWithChildren>;
|
|
24
36
|
}>;
|
|
25
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @category Capability
|
|
39
|
+
*/
|
|
40
|
+
const ReactContext: import("..").InterfaceDef<Readonly<{
|
|
26
41
|
id: string;
|
|
27
42
|
dependsOn?: string[];
|
|
28
43
|
context: FC<PropsWithChildren>;
|
|
29
44
|
}>>;
|
|
30
|
-
|
|
45
|
+
type ReactRoot = Readonly<{
|
|
31
46
|
id: string;
|
|
32
47
|
root: FC<PropsWithChildren>;
|
|
33
48
|
}>;
|
|
34
|
-
|
|
49
|
+
/**
|
|
50
|
+
* @category Capability
|
|
51
|
+
*/
|
|
52
|
+
const ReactRoot: import("..").InterfaceDef<Readonly<{
|
|
35
53
|
id: string;
|
|
36
54
|
root: FC<PropsWithChildren>;
|
|
37
55
|
}>>;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
type ReactSurface = SurfaceDefinition | readonly SurfaceDefinition[];
|
|
57
|
+
/**
|
|
58
|
+
* @category Capability
|
|
59
|
+
*/
|
|
60
|
+
const ReactSurface: import("..").InterfaceDef<ReactSurface>;
|
|
61
|
+
type IntentResolver = AnyIntentResolver | readonly AnyIntentResolver[];
|
|
62
|
+
/**
|
|
63
|
+
* @category Capability
|
|
64
|
+
*/
|
|
65
|
+
const IntentResolver: import("..").InterfaceDef<IntentResolver>;
|
|
66
|
+
/**
|
|
67
|
+
* @category Capability
|
|
68
|
+
*/
|
|
69
|
+
const IntentDispatcher: import("..").InterfaceDef<IntentContext>;
|
|
70
|
+
type Layout = Readonly<{
|
|
44
71
|
mode: string;
|
|
45
72
|
dialogOpen: boolean;
|
|
46
73
|
sidebarOpen: boolean;
|
|
@@ -62,7 +89,10 @@ export declare namespace Capabilities {
|
|
|
62
89
|
*/
|
|
63
90
|
scrollIntoView: string | undefined;
|
|
64
91
|
}>;
|
|
65
|
-
|
|
92
|
+
/**
|
|
93
|
+
* @category Capability
|
|
94
|
+
*/
|
|
95
|
+
const Layout: import("..").InterfaceDef<Readonly<{
|
|
66
96
|
mode: string;
|
|
67
97
|
dialogOpen: boolean;
|
|
68
98
|
sidebarOpen: boolean;
|
|
@@ -84,41 +114,82 @@ export declare namespace Capabilities {
|
|
|
84
114
|
*/
|
|
85
115
|
scrollIntoView: string | undefined;
|
|
86
116
|
}>>;
|
|
87
|
-
|
|
117
|
+
/**
|
|
118
|
+
* @category Capability
|
|
119
|
+
*/
|
|
120
|
+
const Translations: import("..").InterfaceDef<readonly {
|
|
88
121
|
readonly [x: string]: {
|
|
89
122
|
readonly [x: string]: string | {
|
|
90
123
|
readonly [x: string]: any;
|
|
91
124
|
};
|
|
92
125
|
};
|
|
93
126
|
}[]>;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
127
|
+
/**
|
|
128
|
+
* @category Capability
|
|
129
|
+
*/
|
|
130
|
+
const AppGraph: import("..").InterfaceDef<Readonly<Pick<GraphBuilder, "graph" | "explore">>>;
|
|
131
|
+
/**
|
|
132
|
+
* @category Capability
|
|
133
|
+
*/
|
|
134
|
+
const AppGraphBuilder: import("..").InterfaceDef<BuilderExtensions>;
|
|
135
|
+
/**
|
|
136
|
+
* @category Capability
|
|
137
|
+
*/
|
|
138
|
+
const AppGraphSerializer: import("..").InterfaceDef<NodeSerializer[]>;
|
|
139
|
+
/**
|
|
140
|
+
* @category Capability
|
|
141
|
+
*/
|
|
142
|
+
const SettingsStore: import("..").InterfaceDef<RootSettingsStore>;
|
|
143
|
+
type Settings = {
|
|
99
144
|
prefix: string;
|
|
100
145
|
schema: Schema.Schema.All;
|
|
101
146
|
value?: Record<string, any>;
|
|
102
147
|
};
|
|
103
|
-
|
|
104
|
-
|
|
148
|
+
/**
|
|
149
|
+
* @category Capability
|
|
150
|
+
*/
|
|
151
|
+
const Settings: import("..").InterfaceDef<Settings>;
|
|
152
|
+
type Metadata = Readonly<{
|
|
105
153
|
id: string;
|
|
106
154
|
metadata: Record<string, any>;
|
|
107
155
|
}>;
|
|
108
|
-
|
|
156
|
+
/**
|
|
157
|
+
* @category Capability
|
|
158
|
+
*/
|
|
159
|
+
const Metadata: import("..").InterfaceDef<Readonly<{
|
|
109
160
|
id: string;
|
|
110
161
|
metadata: Record<string, any>;
|
|
111
162
|
}>>;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
163
|
+
/**
|
|
164
|
+
* @category Capability
|
|
165
|
+
*/
|
|
166
|
+
const Toolkit: import("..").InterfaceDef<GenericToolkit.GenericToolkit<never, never, never>>;
|
|
167
|
+
/**
|
|
168
|
+
* @category Capability
|
|
169
|
+
*/
|
|
170
|
+
const BlueprintDefinition: import("..").InterfaceDef<Blueprint.Blueprint>;
|
|
171
|
+
type AiServiceLayer = Layer.Layer<AiService.AiService>;
|
|
172
|
+
const AiServiceLayer: import("..").InterfaceDef<AiServiceLayer>;
|
|
173
|
+
/**
|
|
174
|
+
* Plugins can contribute them to provide model resolvers.
|
|
175
|
+
*/
|
|
176
|
+
const AiModelResolver: import("..").InterfaceDef<Layer.Layer<AiServiceRouter.AiModelResolver, never, never>>;
|
|
177
|
+
/**
|
|
178
|
+
* @category Capability
|
|
179
|
+
*/
|
|
180
|
+
const Functions: import("..").InterfaceDef<FunctionDefinition<any, any>[]>;
|
|
181
|
+
type FileUploader = (space: Space, file: File) => Promise<FileInfo | undefined>;
|
|
182
|
+
/**
|
|
183
|
+
* @category Capability
|
|
184
|
+
*/
|
|
185
|
+
const FileUploader: import("..").InterfaceDef<FileUploader>;
|
|
117
186
|
type AnchorSort = {
|
|
118
187
|
key: string;
|
|
119
|
-
sort: (anchorA: AnchoredTo, anchorB: AnchoredTo) => number;
|
|
188
|
+
sort: (anchorA: AnchoredTo.AnchoredTo, anchorB: AnchoredTo.AnchoredTo) => number;
|
|
120
189
|
};
|
|
121
|
-
|
|
122
|
-
|
|
190
|
+
/**
|
|
191
|
+
* @category Capability
|
|
192
|
+
*/
|
|
193
|
+
const AnchorSort: import("..").InterfaceDef<AnchorSort>;
|
|
123
194
|
}
|
|
124
195
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/common/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/common/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,KAAK,eAAe,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA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|
|
3
2
|
export declare namespace CollaborationActions {
|
|
4
|
-
const
|
|
5
|
-
readonly _tag: Schema.tag<"
|
|
3
|
+
const AcceptProposal_base: Schema.TaggedClass<AcceptProposal, "collaboration/accept-proposal", {
|
|
4
|
+
readonly _tag: Schema.tag<"collaboration/accept-proposal">;
|
|
6
5
|
} & {
|
|
7
6
|
input: Schema.Struct<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
subject: typeof Schema.Any;
|
|
8
|
+
anchor: typeof Schema.String;
|
|
9
|
+
proposal: Schema.mutable<Schema.TaggedStruct<"proposal", {
|
|
10
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
11
|
+
text: typeof Schema.String;
|
|
12
|
+
}>>;
|
|
12
13
|
}>;
|
|
13
14
|
output: typeof Schema.Void;
|
|
14
15
|
}>;
|
|
15
|
-
export class
|
|
16
|
+
export class AcceptProposal extends AcceptProposal_base {
|
|
16
17
|
}
|
|
17
18
|
export {};
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collaboration.d.ts","sourceRoot":"","sources":["../../../../src/common/collaboration.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"collaboration.d.ts","sourceRoot":"","sources":["../../../../src/common/collaboration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,yBAAiB,oBAAoB,CAAC;;;;;;;;;;;;;;IACpC,MAAM,OAAO,cAAe,SAAQ,mBAOlC;KAAG;;CACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/common/events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/common/events.ts"],"names":[],"mappings":"AAQA,yBAAiB,MAAM,CAAC;IACtB;;OAEG;IACI,MAAM,OAAO,8BAAsD,CAAC;IAM3E;;OAEG;IACI,MAAM,iBAAiB,8BAAkE,CAAC;IAEjG;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,mBAAmB,8BAAoE,CAAC;IAErG;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,aAAa,8BAA0D,CAAC;IAErF;;OAEG;IACI,MAAM,iBAAiB,8BAAiE,CAAC;IAEhG;;OAEG;IAEI,MAAM,uBAAuB,8BAAwE,CAAC;IAM7G;;OAEG;IACI,MAAM,eAAe,8BAA+D,CAAC;IAE5F;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,aAAa,8BAA0D,CAAC;IAErF;;OAEG;IACI,MAAM,gBAAgB,GAAI,WAAW,MAAM,iCAAiE,CAAC;IAC7G,MAAM,WAAW,8BAAmD,CAAC;CAC7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/common/file.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/common/file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;EAKzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ export * from './capabilities';
|
|
|
2
2
|
export * from './collaboration';
|
|
3
3
|
export * from './events';
|
|
4
4
|
export * from './file';
|
|
5
|
-
export
|
|
5
|
+
export * from './graph';
|
|
6
6
|
export * from './layout';
|
|
7
7
|
export * from './surface';
|
|
8
8
|
export * from './translations';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/common/layout.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/common/layout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC;;GAEG;AACH,yBAAiB,YAAY,CAAC;IAC5B,MAAM,CAAC,MAAM,aAAa,gDAA0C,CAAC;;;;;;;;;;;IAErE;;OAEG;IACH,MAAM,OAAO,YAAa,SAAQ,iBAWhC;KAAG;;;;;;;;;;;;;;;IAYL,MAAM,OAAO,aAAc,SAAQ,kBAYjC;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAejC;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,mBAAoB,SAAQ,wBAevC;KAAG;;;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBA4BhC;KAAG;;;;;;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAoCjC;KAAG;IAEL,MAAM,CAAC,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAYhB,CAAC;IAEH,MAAM,WAAW,KAAM,SAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,EAAE,UAAU,CAAC;QAC/E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;KACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAED,MAAM,OAAO,QAAS,SAAQ,aAM5B;KAAG;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAMnC;KAAG;;;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAQnC;KAAG;;;;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,IAAK,SAAQ,SA4BxB;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,GAAI,SAAQ,QAWvB;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,KAAM,SAAQ,UASzB;KAAG;;;;;;;;;;;IAEL,MAAM,OAAO,cAAe,SAAQ,mBAWlC;KAAG;;;;;;;;;;IAEL,MAAM,OAAO,MAAO,SAAQ,WAM1B;KAAG;;CACN"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { type GuardedType, type MakeOptional, type Position } from '@dxos/util';
|
|
3
3
|
import { type ErrorBoundary } from '../react';
|
|
4
4
|
/**
|
|
5
5
|
* SurfaceProps are the props that are passed to the Surface component.
|
|
6
6
|
*/
|
|
7
|
-
export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> =
|
|
7
|
+
export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> = {
|
|
8
8
|
/**
|
|
9
9
|
* If specified, the Surface will be wrapped in an error boundary.
|
|
10
10
|
* The fallback component will be rendered if an error occurs.
|
|
@@ -15,14 +15,10 @@ export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>
|
|
|
15
15
|
* The placeholder component will be rendered while the surface component is loading.
|
|
16
16
|
*/
|
|
17
17
|
placeholder?: ReactNode;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
* Additional props to pass to the component.
|
|
21
|
-
* These props are not used by Surface itself but may be used by components which resolve the surface.
|
|
22
|
-
*/
|
|
23
|
-
[key: string]: unknown;
|
|
18
|
+
} & MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> & {
|
|
19
|
+
[K in keyof Record<string, any>]: K extends keyof CoreSurfaceProps<T> | 'fallback' | 'placeholder' ? never : any;
|
|
24
20
|
};
|
|
25
|
-
type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = {
|
|
21
|
+
type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
|
|
26
22
|
/**
|
|
27
23
|
* ID for debugging.
|
|
28
24
|
*/
|
|
@@ -33,20 +29,19 @@ type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> =
|
|
|
33
29
|
role: string;
|
|
34
30
|
/**
|
|
35
31
|
* The data to be rendered by the surface.
|
|
32
|
+
* NOTE: This must be a stable value.
|
|
36
33
|
*/
|
|
37
34
|
data: T;
|
|
38
35
|
/**
|
|
39
36
|
* If more than one component is resolved, the limit determines how many are rendered.
|
|
40
37
|
*/
|
|
41
38
|
limit?: number | undefined;
|
|
42
|
-
};
|
|
43
|
-
type SurfaceComponentProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<CoreSurfaceProps<T> & {
|
|
44
|
-
[key: string]: unknown;
|
|
45
39
|
}>;
|
|
40
|
+
type SurfaceComponentProps<T extends Record<string, any> = Record<string, unknown>> = CoreSurfaceProps<T> & Record<string, any>;
|
|
46
41
|
/**
|
|
47
42
|
* React component used to render a surface once is has matched.
|
|
48
43
|
*/
|
|
49
|
-
export type SurfaceComponent<T extends Record<string, any> = Record<string, unknown>> =
|
|
44
|
+
export type SurfaceComponent<T extends Record<string, any> = Record<string, unknown>> = ComponentType<SurfaceComponentProps<T>>;
|
|
50
45
|
/**
|
|
51
46
|
* Definition of when a SurfaceComponent should be rendered.
|
|
52
47
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../src/common/surface.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../src/common/surface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAClF;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IAE9C;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,GAIlD;KACG,CAAC,IAAI,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,MAAM,gBAAgB,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,aAAa,GAAG,KAAK,GAAG,GAAG;CACjH,CAAC;AAGJ,KAAK,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,iBAAiB,CAAC;IACjG;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC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ema from 'effect/Schema';
|
|
2
2
|
export declare const ResourceKey: Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Any>]>;
|
|
3
3
|
export type ResourceKey = Schema.Schema.Type<typeof ResourceKey>;
|
|
4
4
|
export declare const ResourceLanguage: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Any>]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/common/translations.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/common/translations.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,WAAW,+FAAwF,CAAC;AACjH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,qIAA4D,CAAC;AAC1F,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,QAAQ,2KAAiE,CAAC;AACvF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Registry
|
|
2
|
-
import
|
|
1
|
+
import { Atom, type Registry } from '@effect-atom/atom-react';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
3
|
import { type MaybePromise } from '@dxos/util';
|
|
4
4
|
import { type ActivationEvent } from './events';
|
|
5
5
|
declare const InterfaceDefTypeId: unique symbol;
|
|
@@ -10,6 +10,9 @@ export type InterfaceDef<T> = {
|
|
|
10
10
|
[InterfaceDefTypeId]: T;
|
|
11
11
|
identifier: string;
|
|
12
12
|
};
|
|
13
|
+
export declare namespace InterfaceDef {
|
|
14
|
+
type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;
|
|
15
|
+
}
|
|
13
16
|
/**
|
|
14
17
|
* Helper to define the interface of a capability.
|
|
15
18
|
*/
|
|
@@ -22,15 +25,15 @@ export type Capability<T> = {
|
|
|
22
25
|
/**
|
|
23
26
|
* The interface definition of the capability.
|
|
24
27
|
*/
|
|
25
|
-
interface: InterfaceDef<T>;
|
|
28
|
+
readonly interface: InterfaceDef<T>;
|
|
26
29
|
/**
|
|
27
30
|
* The implementation of the capability.
|
|
28
31
|
*/
|
|
29
|
-
implementation: T;
|
|
32
|
+
readonly implementation: T;
|
|
30
33
|
/**
|
|
31
34
|
* Called when the capability is deactivated.
|
|
32
35
|
*/
|
|
33
|
-
deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
|
|
36
|
+
readonly deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
|
|
34
37
|
};
|
|
35
38
|
export type AnyCapability = Capability<any>;
|
|
36
39
|
type PluginsContextOptions = {
|
|
@@ -41,7 +44,7 @@ type PluginsContextOptions = {
|
|
|
41
44
|
/**
|
|
42
45
|
* Helper to define the implementation of a capability.
|
|
43
46
|
*/
|
|
44
|
-
export declare const contributes: <
|
|
47
|
+
export declare const contributes: <I extends InterfaceDef<any>>(interfaceDef: I, implementation: Capability<InterfaceDef.Implementation<I>>["implementation"], deactivate?: Capability<InterfaceDef.Implementation<I>>["deactivate"]) => Capability<I>;
|
|
45
48
|
type LoadCapability<T, U> = () => Promise<{
|
|
46
49
|
default: (props: T) => MaybePromise<Capability<U>>;
|
|
47
50
|
}>;
|
|
@@ -61,8 +64,8 @@ export declare const lazy: <T, U>(c: LoadCapability<T, U> | LoadCapabilities<T>)
|
|
|
61
64
|
export declare class PluginContext {
|
|
62
65
|
private readonly _registry;
|
|
63
66
|
private readonly _capabilityImpls;
|
|
64
|
-
readonly _capabilities: (arg: string) =>
|
|
65
|
-
readonly _capability: (arg: string) =>
|
|
67
|
+
readonly _capabilities: (arg: string) => Atom.Atom<unknown[]>;
|
|
68
|
+
readonly _capability: (arg: string) => Atom.Atom<unknown>;
|
|
66
69
|
/**
|
|
67
70
|
* Activates plugins based on the activation event.
|
|
68
71
|
* @param event The activation event.
|
|
@@ -77,20 +80,20 @@ export declare class PluginContext {
|
|
|
77
80
|
readonly reset: PluginsContextOptions['reset'];
|
|
78
81
|
constructor({ registry, activate, reset }: PluginsContextOptions);
|
|
79
82
|
/**
|
|
80
|
-
* Get the
|
|
81
|
-
* Primarily useful for deriving other
|
|
83
|
+
* Get the Atom reference to the available capabilities for a given interface.
|
|
84
|
+
* Primarily useful for deriving other Atom values based on the capabilities or
|
|
82
85
|
* for subscribing to changes in the capabilities.
|
|
83
86
|
* @returns An Rx reference to the available capabilities.
|
|
84
87
|
*/
|
|
85
|
-
capabilities<T>(interfaceDef: InterfaceDef<T>):
|
|
88
|
+
capabilities<T>(interfaceDef: InterfaceDef<T>): Atom.Atom<T[]>;
|
|
86
89
|
/**
|
|
87
|
-
* Get the
|
|
88
|
-
* Primarily useful for deriving other
|
|
90
|
+
* Get the Atom reference to the available capabilities for a given interface.
|
|
91
|
+
* Primarily useful for deriving other Atom values based on the capability or
|
|
89
92
|
* for subscribing to changes in the capability.
|
|
90
93
|
* @returns An Rx reference to the available capability.
|
|
91
94
|
* @throws If no capability is found.
|
|
92
95
|
*/
|
|
93
|
-
capability<T>(interfaceDef: InterfaceDef<T>):
|
|
96
|
+
capability<T>(interfaceDef: InterfaceDef<T>): Atom.Atom<T>;
|
|
94
97
|
/**
|
|
95
98
|
* Get capabilities from the plugin context.
|
|
96
99
|
* @returns An array of capabilities.
|