@dxos/app-framework 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
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/dist/lib/browser/{app-graph-builder-OHM2Z6YQ.mjs → app-graph-builder-576BHZC7.mjs} +2 -2
- package/dist/lib/browser/{chunk-DVNSCQJ5.mjs → chunk-6AVTZPMT.mjs} +159 -190
- package/dist/lib/browser/chunk-6AVTZPMT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X2YC645Z.mjs → chunk-PPIBZ5N4.mjs} +4 -4
- package/dist/lib/{node-esm/chunk-QHXUTJHE.mjs.map → browser/chunk-PPIBZ5N4.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +5 -7
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/{intent-dispatcher-J7QIFHLO.mjs → intent-dispatcher-3Q67MHZZ.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-QV5MDMDV.mjs → intent-resolver-O763LCLG.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-XMPVLJOQ.mjs → store-URSN7DZI.mjs} +2 -2
- package/dist/lib/browser/testing/index.mjs +2 -2
- package/dist/lib/browser/worker.mjs +1 -3
- package/dist/lib/node/{app-graph-builder-Z45FKS52.cjs → app-graph-builder-JZCSKYPY.cjs} +12 -12
- package/dist/lib/node/{chunk-I3CJYEBC.cjs → chunk-YIFTVCOR.cjs} +150 -180
- package/dist/lib/node/chunk-YIFTVCOR.cjs.map +7 -0
- package/dist/lib/node/{chunk-5UOVF3OR.cjs → chunk-YNTKVTVX.cjs} +20 -20
- package/dist/lib/node/{chunk-5UOVF3OR.cjs.map → chunk-YNTKVTVX.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +66 -68
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/{intent-dispatcher-FQPJNKIZ.cjs → intent-dispatcher-H334XLFD.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-FQPJNKIZ.cjs.map → intent-dispatcher-H334XLFD.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-PBAOGJS6.cjs → intent-resolver-3F4POWAM.cjs} +8 -8
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-N7JLYYDI.cjs → store-OFDHTDCB.cjs} +7 -7
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node/worker.cjs +37 -39
- package/dist/lib/node/worker.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-OMH534A4.mjs → app-graph-builder-VYKLSMSZ.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-GSDBF2CK.mjs → chunk-AHKIPS2L.mjs} +159 -190
- package/dist/lib/node-esm/chunk-AHKIPS2L.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QHXUTJHE.mjs → chunk-R6A7Z4LU.mjs} +4 -4
- package/dist/lib/node-esm/chunk-R6A7Z4LU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +5 -7
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/{intent-dispatcher-QDUGA7NT.mjs → intent-dispatcher-YDE2ONZA.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-P7TC5RBD.mjs → intent-resolver-LAGJ7LXM.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-M2BYJL6K.mjs → store-EYSUVNCS.mjs} +2 -2
- package/dist/lib/node-esm/testing/index.mjs +2 -2
- package/dist/lib/node-esm/worker.mjs +1 -3
- package/dist/types/src/common/index.d.ts +0 -1
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +4 -10
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +2 -5
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/events.d.ts +1 -4
- package/dist/types/src/core/events.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +8 -8
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +1 -2
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +1 -27
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/package.json +18 -22
- package/project.json +1 -2
- package/src/App.tsx +2 -2
- package/src/common/index.ts +0 -1
- package/src/common/layout.ts +3 -22
- package/src/core/capabilities.ts +5 -9
- package/src/core/events.ts +1 -4
- package/src/core/manager.test.ts +3 -3
- package/src/core/manager.ts +10 -10
- package/src/core/plugin.ts +1 -2
- package/src/plugin-intent/intent-dispatcher.ts +2 -18
- package/dist/lib/browser/chunk-DVNSCQJ5.mjs.map +0 -7
- package/dist/lib/browser/chunk-X2YC645Z.mjs.map +0 -7
- package/dist/lib/node/chunk-I3CJYEBC.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GSDBF2CK.mjs.map +0 -7
- package/dist/types/src/common/collaboration.d.ts +0 -19
- package/dist/types/src/common/collaboration.d.ts.map +0 -1
- package/src/common/collaboration.ts +0 -21
- package/typedoc/.nojekyll +0 -1
- package/typedoc/assets/hierarchy.js +0 -1
- package/typedoc/assets/highlight.css +0 -106
- package/typedoc/assets/icons.js +0 -18
- package/typedoc/assets/icons.svg +0 -1
- package/typedoc/assets/main.js +0 -60
- package/typedoc/assets/navigation.js +0 -1
- package/typedoc/assets/search.js +0 -1
- package/typedoc/assets/style.css +0 -1640
- package/typedoc/classes/CollaborationActions.InsertContent.html +0 -421
- package/typedoc/classes/ErrorBoundary.html +0 -125
- package/typedoc/classes/IntentAction.ShowUndo.html +0 -227
- package/typedoc/classes/IntentAction.Track.html +0 -266
- package/typedoc/classes/LayoutAction.AddToast.html +0 -265
- package/typedoc/classes/LayoutAction.Close.html +0 -382
- package/typedoc/classes/LayoutAction.Expose.html +0 -265
- package/typedoc/classes/LayoutAction.Open.html +0 -967
- package/typedoc/classes/LayoutAction.RevertWorkspace.html +0 -343
- package/typedoc/classes/LayoutAction.ScrollIntoView.html +0 -460
- package/typedoc/classes/LayoutAction.Set.html +0 -382
- package/typedoc/classes/LayoutAction.SetLayoutMode.html +0 -421
- package/typedoc/classes/LayoutAction.SwitchWorkspace.html +0 -265
- package/typedoc/classes/LayoutAction.UpdateComplementary.html +0 -616
- package/typedoc/classes/LayoutAction.UpdateDialog.html +0 -733
- package/typedoc/classes/LayoutAction.UpdateLayout.html +0 -461
- package/typedoc/classes/LayoutAction.UpdatePopover.html +0 -1435
- package/typedoc/classes/LayoutAction.UpdateSidebar.html +0 -538
- package/typedoc/classes/Plugin.html +0 -6
- package/typedoc/classes/PluginManager.html +0 -42
- package/typedoc/classes/PluginModule.html +0 -18
- package/typedoc/classes/PluginsContext.html +0 -25
- package/typedoc/classes/SettingsAction.Open.html +0 -226
- package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +0 -265
- package/typedoc/functions/Events.createStateEvent.html +0 -2
- package/typedoc/functions/IntentPlugin.html +0 -1
- package/typedoc/functions/SettingsPlugin.html +0 -1
- package/typedoc/functions/allOf.html +0 -2
- package/typedoc/functions/chain.html +0 -3
- package/typedoc/functions/contributes.html +0 -2
- package/typedoc/functions/createApp.html +0 -6
- package/typedoc/functions/createDispatcher.html +0 -3
- package/typedoc/functions/createIntent.html +0 -6
- package/typedoc/functions/createResolver.html +0 -2
- package/typedoc/functions/createSurface.html +0 -2
- package/typedoc/functions/defineCapability.html +0 -2
- package/typedoc/functions/defineEvent.html +0 -2
- package/typedoc/functions/defineModule.html +0 -2
- package/typedoc/functions/definePlugin.html +0 -2
- package/typedoc/functions/eventKey.html +0 -2
- package/typedoc/functions/getEvents.html +0 -2
- package/typedoc/functions/isAllOf.html +0 -2
- package/typedoc/functions/isOneOf.html +0 -2
- package/typedoc/functions/isSurfaceAvailable.html +0 -2
- package/typedoc/functions/lazy.html +0 -2
- package/typedoc/functions/oneOf.html +0 -2
- package/typedoc/functions/useAppGraph.html +0 -1
- package/typedoc/functions/useCapabilities.html +0 -3
- package/typedoc/functions/useCapability.html +0 -4
- package/typedoc/functions/useIntentDispatcher.html +0 -1
- package/typedoc/functions/useIntentResolver.html +0 -1
- package/typedoc/functions/useLayout.html +0 -1
- package/typedoc/functions/usePluginManager.html +0 -2
- package/typedoc/hierarchy.html +0 -1
- package/typedoc/index.html +0 -16
- package/typedoc/interfaces/LayoutAction.Toast.html +0 -10
- package/typedoc/media/LICENSE +0 -8
- package/typedoc/modules/Capabilities.html +0 -1
- package/typedoc/modules/CollaborationActions.html +0 -1
- package/typedoc/modules/Events.html +0 -1
- package/typedoc/modules/IntentAction.html +0 -1
- package/typedoc/modules/LayoutAction.html +0 -2
- package/typedoc/modules/SettingsAction.html +0 -1
- package/typedoc/modules.html +0 -1
- package/typedoc/types/ActivationEvent.html +0 -8
- package/typedoc/types/ActivationEvents.html +0 -2
- package/typedoc/types/AnyCapability.html +0 -1
- package/typedoc/types/AnyIntent.html +0 -1
- package/typedoc/types/AnyIntentChain.html +0 -1
- package/typedoc/types/AnyIntentEffectResult.html +0 -1
- package/typedoc/types/AnyIntentResolver.html +0 -1
- package/typedoc/types/AnyIntentResult.html +0 -1
- package/typedoc/types/Capabilities.FileUploader.html +0 -1
- package/typedoc/types/Capabilities.IntentResolver.html +0 -1
- package/typedoc/types/Capabilities.Layout.html +0 -1
- package/typedoc/types/Capabilities.Metadata.html +0 -1
- package/typedoc/types/Capabilities.ReactContext.html +0 -1
- package/typedoc/types/Capabilities.ReactRoot.html +0 -1
- package/typedoc/types/Capabilities.ReactSurface.html +0 -1
- package/typedoc/types/Capabilities.Settings.html +0 -4
- package/typedoc/types/Capability.html +0 -9
- package/typedoc/types/CreateAppOptions.html +0 -9
- package/typedoc/types/FileInfo.html +0 -1
- package/typedoc/types/Intent.html +0 -14
- package/typedoc/types/IntentChain.html +0 -6
- package/typedoc/types/IntentContext.html +0 -5
- package/typedoc/types/IntentData.html +0 -1
- package/typedoc/types/IntentDispatcher.html +0 -2
- package/typedoc/types/IntentDispatcherResult.html +0 -2
- package/typedoc/types/IntentEffectDefinition.html +0 -2
- package/typedoc/types/IntentEffectResult.html +0 -15
- package/typedoc/types/IntentParams.html +0 -3
- package/typedoc/types/IntentResolver.html +0 -2
- package/typedoc/types/IntentResultData.html +0 -1
- package/typedoc/types/IntentSchema.html +0 -1
- package/typedoc/types/IntentUndo.html +0 -2
- package/typedoc/types/InterfaceDef.html +0 -4
- package/typedoc/types/Label.html +0 -1
- package/typedoc/types/NodeSerializer.html +0 -8
- package/typedoc/types/PluginManagerOptions.html +0 -5
- package/typedoc/types/PluginMeta.html +0 -21
- package/typedoc/types/PromiseIntentDispatcher.html +0 -2
- package/typedoc/types/PromiseIntentUndo.html +0 -2
- package/typedoc/types/Resource.html +0 -1
- package/typedoc/types/ResourceKey.html +0 -1
- package/typedoc/types/ResourceLanguage.html +0 -1
- package/typedoc/types/SerializedNode.html +0 -4
- package/typedoc/types/SurfaceComponent.html +0 -2
- package/typedoc/types/SurfaceDefinition.html +0 -2
- package/typedoc/types/SurfaceProps.html +0 -4
- package/typedoc/variables/Capabilities.AppGraph.html +0 -1
- package/typedoc/variables/Capabilities.AppGraphBuilder.html +0 -1
- package/typedoc/variables/Capabilities.AppGraphSerializer.html +0 -1
- package/typedoc/variables/Capabilities.ArtifactDefinition.html +0 -1
- package/typedoc/variables/Capabilities.FileUploader.html +0 -1
- package/typedoc/variables/Capabilities.IntentDispatcher.html +0 -1
- package/typedoc/variables/Capabilities.IntentResolver.html +0 -1
- package/typedoc/variables/Capabilities.Layout.html +0 -1
- package/typedoc/variables/Capabilities.Metadata.html +0 -1
- package/typedoc/variables/Capabilities.Null.html +0 -1
- package/typedoc/variables/Capabilities.PluginManager.html +0 -1
- package/typedoc/variables/Capabilities.ReactContext.html +0 -1
- package/typedoc/variables/Capabilities.ReactRoot.html +0 -1
- package/typedoc/variables/Capabilities.ReactSurface.html +0 -1
- package/typedoc/variables/Capabilities.Settings.html +0 -1
- package/typedoc/variables/Capabilities.SettingsStore.html +0 -1
- package/typedoc/variables/Capabilities.Tools.html +0 -1
- package/typedoc/variables/Capabilities.Translations.html +0 -1
- package/typedoc/variables/Events.AppGraphReady.html +0 -2
- package/typedoc/variables/Events.DispatcherReady.html +0 -2
- package/typedoc/variables/Events.LayoutReady.html +0 -1
- package/typedoc/variables/Events.SettingsReady.html +0 -2
- package/typedoc/variables/Events.SetupAppGraph.html +0 -2
- package/typedoc/variables/Events.SetupArtifactDefinition.html +0 -2
- package/typedoc/variables/Events.SetupIntentResolver.html +0 -2
- package/typedoc/variables/Events.SetupMetadata.html +0 -2
- package/typedoc/variables/Events.SetupReactSurface.html +0 -2
- package/typedoc/variables/Events.SetupSettings.html +0 -2
- package/typedoc/variables/Events.SetupTranslations.html +0 -2
- package/typedoc/variables/Events.Startup.html +0 -2
- package/typedoc/variables/FileInfoSchema.html +0 -1
- package/typedoc/variables/INTENT_ACTION.html +0 -1
- package/typedoc/variables/INTENT_PLUGIN.html +0 -1
- package/typedoc/variables/LAYOUT_ACTION.html +0 -1
- package/typedoc/variables/LAYOUT_PLUGIN.html +0 -1
- package/typedoc/variables/Label.html +0 -1
- package/typedoc/variables/LayoutAction.Toast.html +0 -1
- package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +0 -1
- package/typedoc/variables/PluginManagerProvider.html +0 -2
- package/typedoc/variables/Resource.html +0 -2
- package/typedoc/variables/ResourceKey.html +0 -1
- package/typedoc/variables/ResourceLanguage.html +0 -1
- package/typedoc/variables/SETTINGS_ACTION.html +0 -1
- package/typedoc/variables/SETTINGS_ID.html +0 -1
- package/typedoc/variables/SETTINGS_KEY.html +0 -1
- package/typedoc/variables/SETTINGS_PLUGIN.html +0 -1
- package/typedoc/variables/Surface.html +0 -2
- package/typedoc/variables/defaultFileTypes.html +0 -1
- /package/dist/lib/browser/{app-graph-builder-OHM2Z6YQ.mjs.map → app-graph-builder-576BHZC7.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-J7QIFHLO.mjs.map → intent-dispatcher-3Q67MHZZ.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-QV5MDMDV.mjs.map → intent-resolver-O763LCLG.mjs.map} +0 -0
- /package/dist/lib/browser/{store-XMPVLJOQ.mjs.map → store-URSN7DZI.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-builder-Z45FKS52.cjs.map → app-graph-builder-JZCSKYPY.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-PBAOGJS6.cjs.map → intent-resolver-3F4POWAM.cjs.map} +0 -0
- /package/dist/lib/node/{store-N7JLYYDI.cjs.map → store-OFDHTDCB.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-OMH534A4.mjs.map → app-graph-builder-VYKLSMSZ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-QDUGA7NT.mjs.map → intent-dispatcher-YDE2ONZA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-P7TC5RBD.mjs.map → intent-resolver-LAGJ7LXM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{store-M2BYJL6K.mjs.map → store-EYSUVNCS.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.7ac8446",
|
|
4
4
|
"description": "A framework for building applications from composible plugins.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -38,30 +38,29 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@preact/signals-core": "^1.6.0",
|
|
41
|
-
"@dxos/app-graph": "0.8.2-
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/invariant": "0.8.2-
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/log": "0.8.2-
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-hooks": "0.8.2-
|
|
52
|
-
"@dxos/util": "0.8.2-main.f11618f"
|
|
41
|
+
"@dxos/app-graph": "0.8.2-staging.7ac8446",
|
|
42
|
+
"@dxos/async": "0.8.2-staging.7ac8446",
|
|
43
|
+
"@dxos/debug": "0.8.2-staging.7ac8446",
|
|
44
|
+
"@dxos/artifact": "0.8.2-staging.7ac8446",
|
|
45
|
+
"@dxos/client-protocol": "0.8.2-staging.7ac8446",
|
|
46
|
+
"@dxos/invariant": "0.8.2-staging.7ac8446",
|
|
47
|
+
"@dxos/live-object": "0.8.2-staging.7ac8446",
|
|
48
|
+
"@dxos/local-storage": "0.8.2-staging.7ac8446",
|
|
49
|
+
"@dxos/log": "0.8.2-staging.7ac8446",
|
|
50
|
+
"@dxos/util": "0.8.2-staging.7ac8446",
|
|
51
|
+
"@dxos/react-hooks": "0.8.2-staging.7ac8446"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
54
|
"@phosphor-icons/react": "^2.1.5",
|
|
56
55
|
"@types/react": "~18.2.0",
|
|
57
56
|
"effect": "3.13.3",
|
|
58
57
|
"react": "~18.2.0",
|
|
59
|
-
"
|
|
60
|
-
"@dxos/echo-signals": "0.8.2-
|
|
61
|
-
"@dxos/random": "0.8.2-
|
|
62
|
-
"@dxos/react-ui": "0.8.2-
|
|
63
|
-
"@dxos/react-ui-syntax-highlighter": "0.8.2-
|
|
64
|
-
"@dxos/storybook-utils": "0.8.2-
|
|
58
|
+
"@dxos/echo-schema": "0.8.2-staging.7ac8446",
|
|
59
|
+
"@dxos/echo-signals": "0.8.2-staging.7ac8446",
|
|
60
|
+
"@dxos/random": "0.8.2-staging.7ac8446",
|
|
61
|
+
"@dxos/react-ui": "0.8.2-staging.7ac8446",
|
|
62
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-staging.7ac8446",
|
|
63
|
+
"@dxos/storybook-utils": "0.8.2-staging.7ac8446"
|
|
65
64
|
},
|
|
66
65
|
"peerDependencies": {
|
|
67
66
|
"effect": "3.13.3",
|
|
@@ -69,8 +68,5 @@
|
|
|
69
68
|
},
|
|
70
69
|
"publishConfig": {
|
|
71
70
|
"access": "public"
|
|
72
|
-
},
|
|
73
|
-
"scripts": {
|
|
74
|
-
"typedoc": "typedoc --out typedoc"
|
|
75
71
|
}
|
|
76
72
|
}
|
package/project.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { effect } from '@preact/signals-core';
|
|
|
6
6
|
import React, { useEffect, useState, type FC, type PropsWithChildren } from 'react';
|
|
7
7
|
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
|
-
import {
|
|
9
|
+
import { create } from '@dxos/live-object';
|
|
10
10
|
|
|
11
11
|
import { Capabilities, Events } from './common';
|
|
12
12
|
import { PluginManager, type PluginManagerOptions, type Plugin } from './core';
|
|
@@ -69,7 +69,7 @@ export const createApp = ({
|
|
|
69
69
|
return plugin;
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
const state =
|
|
72
|
+
const state = create({ ready: false, error: null });
|
|
73
73
|
const cached: string[] = JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]');
|
|
74
74
|
const enabled = cacheEnabled && cached.length > 0 ? cached : defaults;
|
|
75
75
|
const manager = pluginManager ?? new PluginManager({ pluginLoader, plugins, core, enabled });
|
package/src/common/index.ts
CHANGED
package/src/common/layout.ts
CHANGED
|
@@ -108,12 +108,9 @@ export namespace LayoutAction {
|
|
|
108
108
|
export class UpdatePopover extends S.TaggedClass<UpdatePopover>()(UPDATE_LAYOUT, {
|
|
109
109
|
input: S.Struct({
|
|
110
110
|
part: S.Literal('popover').annotations({ description: 'Updating the popover.' }),
|
|
111
|
-
subject: S.optional(
|
|
112
|
-
S.Any.annotations({
|
|
113
|
-
description: 'URI of the component to display in the popover or data to pass to the popover.',
|
|
114
|
-
}),
|
|
115
|
-
),
|
|
111
|
+
subject: S.optional(S.String.annotations({ description: 'URI of the component to display in the popover.' })),
|
|
116
112
|
options: S.Struct({
|
|
113
|
+
anchorId: S.String.annotations({ description: 'The id of the element to anchor the popover to.' }),
|
|
117
114
|
side: S.optional(
|
|
118
115
|
S.Literal('top', 'right', 'bottom', 'left').annotations({ description: 'The side of the anchor.' }),
|
|
119
116
|
),
|
|
@@ -123,22 +120,7 @@ export namespace LayoutAction {
|
|
|
123
120
|
description: 'Additional props for the popover.',
|
|
124
121
|
}),
|
|
125
122
|
),
|
|
126
|
-
})
|
|
127
|
-
S.extend(
|
|
128
|
-
S.Union(
|
|
129
|
-
S.Struct({
|
|
130
|
-
variant: S.Literal('virtual'),
|
|
131
|
-
anchor: S.Any.annotations({ description: 'The DOM element to anchor the popover to.' }),
|
|
132
|
-
}),
|
|
133
|
-
S.Struct({
|
|
134
|
-
variant: S.optional(S.Literal('react')),
|
|
135
|
-
anchorId: S.String.annotations({
|
|
136
|
-
description: 'An id that can be used to determine whether to render the anchor subcomponent.',
|
|
137
|
-
}),
|
|
138
|
-
}),
|
|
139
|
-
),
|
|
140
|
-
),
|
|
141
|
-
),
|
|
123
|
+
}),
|
|
142
124
|
}),
|
|
143
125
|
output: S.Void,
|
|
144
126
|
}) {}
|
|
@@ -198,7 +180,6 @@ export namespace LayoutAction {
|
|
|
198
180
|
key: S.optional(
|
|
199
181
|
S.String.annotations({ description: 'If provided, will replace item with a matching key (id prefix).' }),
|
|
200
182
|
),
|
|
201
|
-
workspace: S.optional(S.String.annotations({ description: 'The workspace to open the items in.' })),
|
|
202
183
|
scrollIntoView: S.optional(S.Boolean.annotations({ description: 'Scroll the items into view.' })),
|
|
203
184
|
pivotId: S.optional(S.String.annotations({ description: 'The id of the item to place new items next to.' })),
|
|
204
185
|
positioning: S.optional(
|
package/src/core/capabilities.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { Effect } from 'effect';
|
|
|
10
10
|
|
|
11
11
|
import { Trigger } from '@dxos/async';
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import {
|
|
13
|
+
import { create } from '@dxos/live-object';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
15
15
|
import { type MaybePromise } from '@dxos/util';
|
|
16
16
|
|
|
@@ -34,8 +34,7 @@ export const defineCapability = <T>(identifier: string) => {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
* When a capability is contributed to the application an implementation of the interface is provided.
|
|
37
|
+
* Functionality contributed to the application by a plugin module.
|
|
39
38
|
*/
|
|
40
39
|
export type Capability<T> = {
|
|
41
40
|
/**
|
|
@@ -96,11 +95,8 @@ export const lazy =
|
|
|
96
95
|
};
|
|
97
96
|
|
|
98
97
|
/**
|
|
99
|
-
*
|
|
100
|
-
* It tracks the capabilities that are contributed in an in-memory live object.
|
|
101
|
-
* This allows the application to subscribe to this state and incorporate plugins which are added dynamically.
|
|
98
|
+
* Context which is passed to plugins, allowing them to interact with each other.
|
|
102
99
|
*/
|
|
103
|
-
// TOOD(burdon): Rename PluginContext.
|
|
104
100
|
export class PluginsContext {
|
|
105
101
|
private readonly _definedCapabilities = new Map<string, CapabilityImpl<unknown>[]>();
|
|
106
102
|
|
|
@@ -137,7 +133,7 @@ export class PluginsContext {
|
|
|
137
133
|
}) {
|
|
138
134
|
let current = this._definedCapabilities.get(interfaceDef.identifier);
|
|
139
135
|
if (!current) {
|
|
140
|
-
const object =
|
|
136
|
+
const object = create<{ value: CapabilityImpl<unknown>[] }>({ value: [] });
|
|
141
137
|
current = untracked(() => object.value);
|
|
142
138
|
this._definedCapabilities.set(interfaceDef.identifier, current);
|
|
143
139
|
}
|
|
@@ -179,7 +175,7 @@ export class PluginsContext {
|
|
|
179
175
|
): U[] {
|
|
180
176
|
let current = this._definedCapabilities.get(interfaceDef.identifier);
|
|
181
177
|
if (!current) {
|
|
182
|
-
const object =
|
|
178
|
+
const object = create<{ value: CapabilityImpl<unknown>[] }>({ value: [] });
|
|
183
179
|
current = untracked(() => object.value);
|
|
184
180
|
this._definedCapabilities.set(interfaceDef.identifier, current);
|
|
185
181
|
}
|
package/src/core/events.ts
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* This is expected to be a URI, where initial parts are often the id of the plugin whose package defines the event.
|
|
8
|
-
*
|
|
9
|
-
* @example dxos.org/plugin/example/event/ready
|
|
6
|
+
* An event which activates a plugin module.
|
|
10
7
|
*/
|
|
11
8
|
export type ActivationEvent = {
|
|
12
9
|
id: string;
|
package/src/core/manager.test.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { raise } from '@dxos/debug';
|
|
|
11
11
|
import { updateCounter } from '@dxos/echo-schema/testing';
|
|
12
12
|
import { registerSignalsRuntime } from '@dxos/echo-signals';
|
|
13
13
|
import { invariant } from '@dxos/invariant';
|
|
14
|
-
import {
|
|
14
|
+
import { create } from '@dxos/live-object';
|
|
15
15
|
|
|
16
16
|
import { contributes, defineCapability, type PluginsContext } from './capabilities';
|
|
17
17
|
import { allOf, defineEvent, oneOf } from './events';
|
|
@@ -358,14 +358,14 @@ describe('PluginManager', () => {
|
|
|
358
358
|
id,
|
|
359
359
|
activatesOn: Events.Startup,
|
|
360
360
|
activatesAfter: [stateEvent],
|
|
361
|
-
activate: () => contributes(Number,
|
|
361
|
+
activate: () => contributes(Number, create({ number: 1 })),
|
|
362
362
|
}),
|
|
363
363
|
defineModule({
|
|
364
364
|
id: 'dxos.org/test/doubler',
|
|
365
365
|
activatesOn: stateEvent,
|
|
366
366
|
activate: (context) => {
|
|
367
367
|
const counter = context.requestCapability(Number);
|
|
368
|
-
const state =
|
|
368
|
+
const state = create({ total: counter.number * 2 });
|
|
369
369
|
const unsubscribe = effect(() => {
|
|
370
370
|
state.total = counter.number * 2;
|
|
371
371
|
});
|
package/src/core/manager.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { untracked } from '@preact/signals-core';
|
|
|
6
6
|
import { Array as A, Effect, Either, Match, pipe } from 'effect';
|
|
7
7
|
|
|
8
8
|
import { Event } from '@dxos/async';
|
|
9
|
-
import {
|
|
9
|
+
import { create, type ReactiveObject } from '@dxos/live-object';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { type MaybePromise } from '@dxos/util';
|
|
12
12
|
|
|
@@ -49,7 +49,7 @@ export class PluginManager {
|
|
|
49
49
|
reset: (id) => this._reset(id),
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
private readonly _state:
|
|
52
|
+
private readonly _state: ReactiveObject<PluginManagerState>;
|
|
53
53
|
private readonly _pluginLoader: PluginManagerOptions['pluginLoader'];
|
|
54
54
|
private readonly _capabilities = new Map<string, AnyCapability[]>();
|
|
55
55
|
|
|
@@ -60,7 +60,7 @@ export class PluginManager {
|
|
|
60
60
|
enabled = [],
|
|
61
61
|
}: PluginManagerOptions) {
|
|
62
62
|
this._pluginLoader = pluginLoader;
|
|
63
|
-
this._state =
|
|
63
|
+
this._state = create({
|
|
64
64
|
plugins,
|
|
65
65
|
core,
|
|
66
66
|
enabled,
|
|
@@ -79,7 +79,7 @@ export class PluginManager {
|
|
|
79
79
|
*
|
|
80
80
|
* @reactive
|
|
81
81
|
*/
|
|
82
|
-
get plugins():
|
|
82
|
+
get plugins(): ReactiveObject<readonly Plugin[]> {
|
|
83
83
|
return this._state.plugins;
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -88,7 +88,7 @@ export class PluginManager {
|
|
|
88
88
|
*
|
|
89
89
|
* @reactive
|
|
90
90
|
*/
|
|
91
|
-
get core():
|
|
91
|
+
get core(): ReactiveObject<readonly string[]> {
|
|
92
92
|
return this._state.core;
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -97,7 +97,7 @@ export class PluginManager {
|
|
|
97
97
|
*
|
|
98
98
|
* @reactive
|
|
99
99
|
*/
|
|
100
|
-
get enabled():
|
|
100
|
+
get enabled(): ReactiveObject<readonly string[]> {
|
|
101
101
|
return this._state.enabled;
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -106,7 +106,7 @@ export class PluginManager {
|
|
|
106
106
|
*
|
|
107
107
|
* @reactive
|
|
108
108
|
*/
|
|
109
|
-
get modules():
|
|
109
|
+
get modules(): ReactiveObject<readonly PluginModule[]> {
|
|
110
110
|
return this._state.modules;
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -115,7 +115,7 @@ export class PluginManager {
|
|
|
115
115
|
*
|
|
116
116
|
* @reactive
|
|
117
117
|
*/
|
|
118
|
-
get active():
|
|
118
|
+
get active(): ReactiveObject<readonly string[]> {
|
|
119
119
|
return this._state.active;
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -124,7 +124,7 @@ export class PluginManager {
|
|
|
124
124
|
*
|
|
125
125
|
* @reactive
|
|
126
126
|
*/
|
|
127
|
-
get eventsFired():
|
|
127
|
+
get eventsFired(): ReactiveObject<readonly string[]> {
|
|
128
128
|
return this._state.eventsFired;
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -133,7 +133,7 @@ export class PluginManager {
|
|
|
133
133
|
*
|
|
134
134
|
* @reactive
|
|
135
135
|
*/
|
|
136
|
-
get pendingReset():
|
|
136
|
+
get pendingReset(): ReactiveObject<readonly string[]> {
|
|
137
137
|
return this._state.pendingReset;
|
|
138
138
|
}
|
|
139
139
|
|
package/src/core/plugin.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface PluginModuleInterface {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* A unit of containment of modular functionality that can be provided to an application.
|
|
45
|
-
*
|
|
45
|
+
* Plugins provide things like components, state, actions, etc. to the application.
|
|
46
46
|
*/
|
|
47
47
|
// NOTE: This is implemented as a class to prevent it from being proxied by PluginManager state.
|
|
48
48
|
export class PluginModule implements PluginModuleInterface {
|
|
@@ -114,7 +114,6 @@ export type PluginMeta = {
|
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* A collection of modules that are be enabled/disabled as a unit.
|
|
117
|
-
* Plugins provide things such as components, state, actions, etc. to the application.
|
|
118
117
|
*/
|
|
119
118
|
// NOTE: This is implemented as a class to prevent it from being proxied by PluginManager state.
|
|
120
119
|
export class Plugin {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Effect, Option, pipe, Ref } from 'effect';
|
|
6
6
|
import { type Simplify } from 'effect/Types';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { create } from '@dxos/live-object';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { byPosition, type MaybePromise, type Position, type GuardedType } from '@dxos/util';
|
|
11
11
|
|
|
@@ -91,25 +91,9 @@ export type IntentEffectDefinition<Input, Output> = (
|
|
|
91
91
|
* Intent resolver to match intents to their effects.
|
|
92
92
|
*/
|
|
93
93
|
export type IntentResolver<Tag extends string, Fields extends IntentParams, Data = IntentData<Fields>> = Readonly<{
|
|
94
|
-
/**
|
|
95
|
-
* The schema of the intent to be resolved.
|
|
96
|
-
*/
|
|
97
94
|
intent: IntentSchema<Tag, Fields>;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Hint to determine the order the resolvers are processed if multiple resolvers are defined for the same intent.
|
|
101
|
-
* Only one resolver will be used.
|
|
102
|
-
*/
|
|
103
95
|
position?: Position;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Optional filter to determine if the resolver should be used.
|
|
107
|
-
*/
|
|
108
96
|
filter?: (data: IntentData<Fields>) => data is Data;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The effect to be performed when the intent is resolved.
|
|
112
|
-
*/
|
|
113
97
|
resolve: IntentEffectDefinition<GuardedType<IntentResolver<Tag, Fields, Data>['filter']>, IntentResultData<Fields>>;
|
|
114
98
|
}>;
|
|
115
99
|
|
|
@@ -303,7 +287,7 @@ const defaultEffect = () => Effect.fail(new Error('Intent runtime not ready'));
|
|
|
303
287
|
const defaultPromise = () => Effect.runPromise(defaultEffect());
|
|
304
288
|
|
|
305
289
|
export default (context: PluginsContext) => {
|
|
306
|
-
const state =
|
|
290
|
+
const state = create<IntentContext>({
|
|
307
291
|
dispatch: defaultEffect,
|
|
308
292
|
dispatchPromise: defaultPromise,
|
|
309
293
|
undo: defaultEffect,
|