@dxos/app-framework 0.7.4-staging.f7e8224 → 0.7.5-feature-compute.4d9d99a
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/chunk-EGGZVV7Q.mjs +1595 -0
- package/dist/lib/browser/chunk-EGGZVV7Q.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +136 -527
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +67 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/node/chunk-UBX6GP2N.cjs +1639 -0
- package/dist/lib/node/chunk-UBX6GP2N.cjs.map +7 -0
- package/dist/lib/node/index.cjs +141 -551
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +91 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-HG5P55WF.mjs +1597 -0
- package/dist/lib/node-esm/chunk-HG5P55WF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +136 -527
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +68 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/types/src/App.d.ts +22 -13
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +340 -0
- package/dist/types/src/common/capabilities.d.ts.map +1 -0
- package/dist/types/src/common/events.d.ts +41 -0
- package/dist/types/src/common/events.d.ts.map +1 -0
- package/dist/types/src/common/file.d.ts +14 -0
- package/dist/types/src/common/file.d.ts.map +1 -0
- package/dist/types/src/common/graph.d.ts +21 -0
- package/dist/types/src/common/graph.d.ts.map +1 -0
- package/dist/types/src/{plugins/common → common}/index.d.ts +3 -1
- package/dist/types/src/common/index.d.ts.map +1 -0
- package/dist/types/src/common/layout.d.ts +165 -0
- package/dist/types/src/common/layout.d.ts.map +1 -0
- package/dist/types/src/{plugins/common → common}/navigation.d.ts +77 -32
- package/dist/types/src/common/navigation.d.ts.map +1 -0
- package/dist/types/src/common/surface.d.ts +68 -0
- package/dist/types/src/common/surface.d.ts.map +1 -0
- package/dist/types/src/{plugins/common → common}/translations.d.ts +0 -11
- package/dist/types/src/common/translations.d.ts.map +1 -0
- package/dist/types/src/core/capabilities.d.ts +90 -0
- package/dist/types/src/core/capabilities.d.ts.map +1 -0
- package/dist/types/src/core/capabilities.test.d.ts +2 -0
- package/dist/types/src/core/capabilities.test.d.ts.map +1 -0
- package/dist/types/src/core/events.d.ts +58 -0
- package/dist/types/src/core/events.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +5 -0
- package/dist/types/src/core/index.d.ts.map +1 -0
- package/dist/types/src/core/manager.d.ts +126 -0
- package/dist/types/src/core/manager.d.ts.map +1 -0
- package/dist/types/src/core/manager.test.d.ts +2 -0
- package/dist/types/src/core/manager.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +94 -0
- package/dist/types/src/core/plugin.d.ts.map +1 -0
- package/dist/types/src/helpers.d.ts +10 -0
- package/dist/types/src/helpers.d.ts.map +1 -0
- package/dist/types/src/helpers.test.d.ts +2 -0
- package/dist/types/src/helpers.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/debug/Debug.d.ts +6 -0
- package/dist/types/src/playground/debug/Debug.d.ts.map +1 -0
- package/dist/types/src/playground/debug/index.d.ts +2 -0
- package/dist/types/src/playground/debug/index.d.ts.map +1 -0
- package/dist/types/src/playground/debug/plugin.d.ts +2 -0
- package/dist/types/src/playground/debug/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/generator/Main.d.ts +6 -0
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -0
- package/dist/types/src/playground/generator/Toolbar.d.ts +6 -0
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -0
- package/dist/types/src/playground/generator/generator.d.ts +5 -0
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -0
- package/dist/types/src/playground/generator/index.d.ts +3 -0
- package/dist/types/src/playground/generator/index.d.ts.map +1 -0
- package/dist/types/src/playground/generator/plugin.d.ts +2 -0
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/layout/Layout.d.ts +8 -0
- package/dist/types/src/playground/layout/Layout.d.ts.map +1 -0
- package/dist/types/src/playground/layout/index.d.ts +2 -0
- package/dist/types/src/playground/layout/index.d.ts.map +1 -0
- package/dist/types/src/playground/layout/plugin.d.ts +2 -0
- package/dist/types/src/playground/layout/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/logger/Toolbar.d.ts +6 -0
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -0
- package/dist/types/src/playground/logger/index.d.ts +2 -0
- package/dist/types/src/playground/logger/index.d.ts.map +1 -0
- package/dist/types/src/playground/logger/plugin.d.ts +2 -0
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/logger/schema.d.ts +13 -0
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -0
- package/dist/types/src/playground/playground.stories.d.ts +10 -0
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/IntentContext.d.ts +8 -0
- package/dist/types/src/plugin-intent/IntentContext.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +2 -0
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/actions.d.ts +23 -0
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/errors.d.ts +16 -0
- package/dist/types/src/plugin-intent/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/index.d.ts +6 -0
- package/dist/types/src/plugin-intent/index.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +106 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +2 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent.d.ts +68 -0
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/actions.d.ts +17 -0
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/index.d.ts +3 -0
- package/dist/types/src/plugin-settings/index.d.ts.map +1 -0
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
- package/dist/types/src/react/PluginManagerProvider.d.ts +10 -0
- package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -0
- package/dist/types/src/react/Surface.d.ts +12 -0
- package/dist/types/src/react/Surface.d.ts.map +1 -0
- package/dist/types/src/react/index.d.ts +5 -0
- package/dist/types/src/react/index.d.ts.map +1 -0
- package/dist/types/src/react/useCapabilities.d.ts +13 -0
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +10 -0
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.stories.d.ts +5 -0
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +30 -14
- package/project.json +2 -1
- package/src/App.tsx +138 -34
- package/src/common/capabilities.ts +82 -0
- package/src/common/events.ts +63 -0
- package/src/common/file.ts +22 -0
- package/src/common/graph.ts +30 -0
- package/src/{plugins/common → common}/index.ts +3 -1
- package/src/common/layout.ts +157 -0
- package/src/{plugins/common → common}/navigation.ts +59 -45
- package/src/common/surface.ts +81 -0
- package/src/common/translations.ts +18 -0
- package/src/core/capabilities.test.ts +116 -0
- package/src/core/capabilities.ts +213 -0
- package/src/core/events.ts +58 -0
- package/src/core/index.ts +8 -0
- package/src/core/manager.test.ts +567 -0
- package/src/core/manager.ts +497 -0
- package/src/core/plugin.ts +128 -0
- package/src/helpers.test.ts +97 -0
- package/src/helpers.ts +45 -0
- package/src/index.ts +6 -3
- package/src/playground/debug/Debug.tsx +39 -0
- package/src/playground/debug/index.ts +5 -0
- package/src/playground/debug/plugin.ts +17 -0
- package/src/playground/generator/Main.tsx +71 -0
- package/src/playground/generator/Toolbar.tsx +46 -0
- package/src/playground/generator/generator.ts +23 -0
- package/src/playground/generator/index.ts +6 -0
- package/src/playground/generator/plugin.ts +18 -0
- package/src/playground/layout/Layout.tsx +33 -0
- package/src/playground/layout/index.ts +5 -0
- package/src/playground/layout/plugin.ts +17 -0
- package/src/playground/logger/Toolbar.tsx +28 -0
- package/src/playground/logger/index.ts +5 -0
- package/src/playground/logger/plugin.ts +33 -0
- package/src/playground/logger/schema.ts +12 -0
- package/src/playground/playground.stories.tsx +34 -0
- package/src/plugin-intent/IntentContext.tsx +34 -0
- package/src/plugin-intent/IntentPlugin.tsx +60 -0
- package/src/plugin-intent/actions.ts +22 -0
- package/src/plugin-intent/errors.ts +39 -0
- package/src/plugin-intent/index.ts +9 -0
- package/src/plugin-intent/intent-dispatcher.test.ts +280 -0
- package/src/plugin-intent/intent-dispatcher.ts +269 -0
- package/src/plugin-intent/intent.ts +146 -0
- package/src/plugin-settings/SettingsPlugin.ts +29 -0
- package/src/plugin-settings/actions.ts +17 -0
- package/src/plugin-settings/index.ts +6 -0
- package/src/react/PluginManagerProvider.ts +22 -0
- package/src/react/Surface.tsx +72 -0
- package/src/react/index.ts +8 -0
- package/src/react/useCapabilities.ts +40 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/withPluginManager.stories.tsx +47 -0
- package/src/testing/withPluginManager.tsx +67 -0
- package/tsconfig.json +51 -2
- package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
- package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
- package/dist/lib/browser/chunk-653Y45CL.mjs +0 -41
- package/dist/lib/browser/chunk-653Y45CL.mjs.map +0 -7
- package/dist/lib/browser/chunk-FRXJ25VI.mjs +0 -214
- package/dist/lib/browser/chunk-FRXJ25VI.mjs.map +0 -7
- package/dist/lib/browser/chunk-YXM35XRE.mjs +0 -213
- package/dist/lib/browser/chunk-YXM35XRE.mjs.map +0 -7
- package/dist/lib/browser/plugin-intent-LU4KL2RO.mjs +0 -22
- package/dist/lib/browser/plugin-intent-LU4KL2RO.mjs.map +0 -7
- package/dist/lib/browser/plugin-settings-OM3G2QFY.mjs +0 -11
- package/dist/lib/browser/plugin-settings-OM3G2QFY.mjs.map +0 -7
- package/dist/lib/browser/plugin-surface-LECZMKSQ.mjs +0 -24
- package/dist/lib/browser/plugin-surface-LECZMKSQ.mjs.map +0 -7
- package/dist/lib/node/chunk-JZ2JVKRY.cjs +0 -58
- package/dist/lib/node/chunk-JZ2JVKRY.cjs.map +0 -7
- package/dist/lib/node/chunk-QBM42OQ6.cjs +0 -97
- package/dist/lib/node/chunk-QBM42OQ6.cjs.map +0 -7
- package/dist/lib/node/chunk-QSVP5HOW.cjs +0 -238
- package/dist/lib/node/chunk-QSVP5HOW.cjs.map +0 -7
- package/dist/lib/node/chunk-SOVLKUWI.cjs +0 -236
- package/dist/lib/node/chunk-SOVLKUWI.cjs.map +0 -7
- package/dist/lib/node/plugin-intent-FVFR2LKB.cjs +0 -43
- package/dist/lib/node/plugin-intent-FVFR2LKB.cjs.map +0 -7
- package/dist/lib/node/plugin-settings-OZ6IKAE5.cjs +0 -32
- package/dist/lib/node/plugin-settings-OZ6IKAE5.cjs.map +0 -7
- package/dist/lib/node/plugin-surface-YWDRXQTD.cjs +0 -45
- package/dist/lib/node/plugin-surface-YWDRXQTD.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-2R4GVK7O.mjs +0 -215
- package/dist/lib/node-esm/chunk-2R4GVK7O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs +0 -74
- package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YFMFQBB4.mjs +0 -214
- package/dist/lib/node-esm/chunk-YFMFQBB4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YNU7FTGJ.mjs +0 -43
- package/dist/lib/node-esm/chunk-YNU7FTGJ.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-intent-V7ER24Y6.mjs +0 -23
- package/dist/lib/node-esm/plugin-intent-V7ER24Y6.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-settings-37UVWF2V.mjs +0 -12
- package/dist/lib/node-esm/plugin-settings-37UVWF2V.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-surface-TEU42XQN.mjs +0 -25
- package/dist/lib/node-esm/plugin-surface-TEU42XQN.mjs.map +0 -7
- package/dist/types/src/plugins/common/file.d.ts +0 -22
- package/dist/types/src/plugins/common/file.d.ts.map +0 -1
- package/dist/types/src/plugins/common/graph.d.ts +0 -51
- package/dist/types/src/plugins/common/graph.d.ts.map +0 -1
- package/dist/types/src/plugins/common/index.d.ts.map +0 -1
- package/dist/types/src/plugins/common/layout.d.ts +0 -202
- package/dist/types/src/plugins/common/layout.d.ts.map +0 -1
- package/dist/types/src/plugins/common/metadata.d.ts +0 -16
- package/dist/types/src/plugins/common/metadata.d.ts.map +0 -1
- package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
- package/dist/types/src/plugins/common/translations.d.ts.map +0 -1
- package/dist/types/src/plugins/helpers.d.ts +0 -41
- package/dist/types/src/plugins/helpers.d.ts.map +0 -1
- package/dist/types/src/plugins/index.d.ts +0 -7
- package/dist/types/src/plugins/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +0 -21
- package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts +0 -14
- package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/PluginContext.d.ts +0 -47
- package/dist/types/src/plugins/plugin-host/PluginContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/index.d.ts +0 -4
- package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -98
- package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/plugin.test.d.ts +0 -35
- package/dist/types/src/plugins/plugin-host/plugin.test.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts +0 -21
- package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts +0 -8
- package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/helpers.d.ts +0 -6
- package/dist/types/src/plugins/plugin-intent/helpers.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/index.d.ts +0 -6
- package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/intent.d.ts +0 -81
- package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -5
- package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -20
- package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts +0 -4
- package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/index.d.ts +0 -4
- package/dist/types/src/plugins/plugin-settings/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/meta.d.ts +0 -5
- package/dist/types/src/plugins/plugin-settings/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/provides.d.ts +0 -13
- package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/ErrorBoundary.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/Surface.d.ts +0 -62
- package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts +0 -7
- package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/SurfaceRootContext.d.ts +0 -39
- package/dist/types/src/plugins/plugin-surface/SurfaceRootContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/helpers.d.ts +0 -21
- package/dist/types/src/plugins/plugin-surface/helpers.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/index.d.ts +0 -8
- package/dist/types/src/plugins/plugin-surface/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/meta.d.ts +0 -5
- package/dist/types/src/plugins/plugin-surface/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/provides.d.ts +0 -16
- package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +0 -1
- package/src/plugins/common/file.ts +0 -36
- package/src/plugins/common/graph.ts +0 -70
- package/src/plugins/common/layout.ts +0 -155
- package/src/plugins/common/metadata.ts +0 -29
- package/src/plugins/common/translations.ts +0 -36
- package/src/plugins/helpers.ts +0 -92
- package/src/plugins/index.ts +0 -11
- package/src/plugins/plugin-host/HostPlugin.tsx +0 -96
- package/src/plugins/plugin-host/PluginContainer.tsx +0 -120
- package/src/plugins/plugin-host/PluginContext.tsx +0 -79
- package/src/plugins/plugin-host/index.ts +0 -8
- package/src/plugins/plugin-host/plugin.test.ts +0 -158
- package/src/plugins/plugin-host/plugin.ts +0 -126
- package/src/plugins/plugin-intent/IntentContext.tsx +0 -49
- package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -151
- package/src/plugins/plugin-intent/helpers.ts +0 -11
- package/src/plugins/plugin-intent/index.ts +0 -12
- package/src/plugins/plugin-intent/intent.ts +0 -101
- package/src/plugins/plugin-intent/meta.ts +0 -9
- package/src/plugins/plugin-intent/provides.ts +0 -38
- package/src/plugins/plugin-settings/SettingsPlugin.tsx +0 -22
- package/src/plugins/plugin-settings/index.ts +0 -9
- package/src/plugins/plugin-settings/meta.ts +0 -9
- package/src/plugins/plugin-settings/provides.ts +0 -29
- package/src/plugins/plugin-surface/Surface.tsx +0 -195
- package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -33
- package/src/plugins/plugin-surface/SurfaceRootContext.tsx +0 -60
- package/src/plugins/plugin-surface/helpers.ts +0 -22
- package/src/plugins/plugin-surface/index.ts +0 -14
- package/src/plugins/plugin-surface/meta.ts +0 -9
- package/src/plugins/plugin-surface/provides.ts +0 -26
- /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
- /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Schema as S } from '@effect/schema';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { type Plugin } from '../plugin-host';
|
|
4
|
-
import { type IntentData } from '../plugin-intent';
|
|
5
2
|
export declare const SLUG_LIST_SEPARATOR = "+";
|
|
6
3
|
export declare const SLUG_ENTRY_SEPARATOR = "_";
|
|
7
4
|
export declare const SLUG_KEY_VALUE_SEPARATOR = "-";
|
|
@@ -63,19 +60,19 @@ declare const LayoutCoordinateSchema: S.mutable<S.Struct<{
|
|
|
63
60
|
entryId: typeof S.String;
|
|
64
61
|
}>>;
|
|
65
62
|
export type LayoutCoordinate = S.Schema.Type<typeof LayoutCoordinateSchema>;
|
|
66
|
-
declare const PartAdjustmentSchema: S.Union<[S.Literal<["increment-start"]>, S.Literal<["increment-end"]>, S.Literal<["solo"]>]>;
|
|
63
|
+
declare const PartAdjustmentSchema: S.Union<[S.Literal<["increment-start"]>, S.Literal<["increment-end"]>, S.Literal<["pin-start"]>, S.Literal<["pin-end"]>, S.Literal<["close"]>, S.Literal<["solo"]>]>;
|
|
67
64
|
export type PartAdjustment = S.Schema.Type<typeof PartAdjustmentSchema>;
|
|
68
65
|
declare const LayoutAdjustmentSchema: S.mutable<S.Struct<{
|
|
69
66
|
layoutCoordinate: S.mutable<S.Struct<{
|
|
70
67
|
part: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["solo"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
71
68
|
entryId: typeof S.String;
|
|
72
69
|
}>>;
|
|
73
|
-
type: S.Union<[S.Literal<["increment-start"]>, S.Literal<["increment-end"]>, S.Literal<["solo"]>]>;
|
|
70
|
+
type: S.Union<[S.Literal<["increment-start"]>, S.Literal<["increment-end"]>, S.Literal<["pin-start"]>, S.Literal<["pin-end"]>, S.Literal<["close"]>, S.Literal<["solo"]>]>;
|
|
74
71
|
}>>;
|
|
75
72
|
export type LayoutAdjustment = S.Schema.Type<typeof LayoutAdjustmentSchema>;
|
|
76
73
|
/** @deprecated */
|
|
77
|
-
export declare const ActiveParts:
|
|
78
|
-
export type ActiveParts =
|
|
74
|
+
export declare const ActiveParts: S.Record$<typeof S.String, S.Union<[typeof S.String, S.mutable<S.Array$<typeof S.String>>]>>;
|
|
75
|
+
export type ActiveParts = S.Schema.Type<typeof ActiveParts>;
|
|
79
76
|
export type LayoutContainerProps<T> = T & {
|
|
80
77
|
role?: string;
|
|
81
78
|
coordinate?: LayoutCoordinate;
|
|
@@ -137,7 +134,6 @@ export type LocationProvides = S.Schema.Type<typeof LocationProvidesSchema>;
|
|
|
137
134
|
*/
|
|
138
135
|
export declare const isLayoutParts: (value: unknown) => value is LayoutParts;
|
|
139
136
|
export declare const isLayoutAdjustment: (value: unknown) => value is LayoutAdjustment;
|
|
140
|
-
export declare const parseNavigationPlugin: (plugin: Plugin) => Plugin<LocationProvides> | undefined;
|
|
141
137
|
/**
|
|
142
138
|
* Utilities.
|
|
143
139
|
*/
|
|
@@ -146,51 +142,100 @@ export declare const openIds: (layout: LayoutParts, parts?: LayoutPart[]) => str
|
|
|
146
142
|
export declare const firstIdInPart: (layout: LayoutParts | undefined, part: LayoutPart) => string | undefined;
|
|
147
143
|
export declare const indexInPart: (layout: LayoutParts | undefined, layoutCoordinate: LayoutCoordinate | undefined) => number | undefined;
|
|
148
144
|
export declare const partLength: (layout: LayoutParts | undefined, part: LayoutPart | undefined) => number;
|
|
149
|
-
export declare
|
|
150
|
-
|
|
151
|
-
ADD_TO_ACTIVE = "dxos.org/plugin/navigation/action/add-to-active",
|
|
152
|
-
SET = "dxos.org/plugin/navigation/action/set",
|
|
153
|
-
ADJUST = "dxos.org/plugin/navigation/action/adjust",
|
|
154
|
-
CLOSE = "dxos.org/plugin/navigation/action/close",
|
|
155
|
-
EXPOSE = "dxos.org/plugin/navigation/action/expose"
|
|
156
|
-
}
|
|
145
|
+
export declare const NAVIGATION_PLUGIN = "dxos.org/plugin/navigation";
|
|
146
|
+
export declare const NAVIGATION_ACTION = "dxos.org/plugin/navigation/action";
|
|
157
147
|
/**
|
|
158
148
|
* Expected payload for navigation actions.
|
|
159
149
|
*/
|
|
160
150
|
export declare namespace NavigationAction {
|
|
151
|
+
const Open_base: S.TaggedClass<Open, "dxos.org/plugin/navigation/action/open", {
|
|
152
|
+
readonly _tag: S.tag<"dxos.org/plugin/navigation/action/open">;
|
|
153
|
+
} & {
|
|
154
|
+
input: S.Struct<{
|
|
155
|
+
activeParts: S.Record$<typeof S.String, S.Union<[typeof S.String, S.mutable<S.Array$<typeof S.String>>]>>;
|
|
156
|
+
noToggle: S.optional<typeof S.Boolean>;
|
|
157
|
+
}>;
|
|
158
|
+
output: S.Struct<{
|
|
159
|
+
open: S.Array$<typeof S.String>;
|
|
160
|
+
}>;
|
|
161
|
+
}>;
|
|
161
162
|
/**
|
|
162
163
|
* An additive overlay to apply to `location.active` (i.e. the result is a union of previous active and the argument)
|
|
163
164
|
*/
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
export class Open extends Open_base {
|
|
166
|
+
}
|
|
167
|
+
const AddToActive_base: S.TaggedClass<AddToActive, "dxos.org/plugin/navigation/action/add-to-active", {
|
|
168
|
+
readonly _tag: S.tag<"dxos.org/plugin/navigation/action/add-to-active">;
|
|
169
|
+
} & {
|
|
170
|
+
input: S.Struct<{
|
|
171
|
+
id: typeof S.String;
|
|
172
|
+
part: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["solo"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
173
|
+
scrollIntoView: S.optional<typeof S.Boolean>;
|
|
174
|
+
pivotId: S.optional<typeof S.String>;
|
|
175
|
+
positioning: S.optional<S.Literal<["start", "end"]>>;
|
|
176
|
+
}>;
|
|
177
|
+
output: typeof S.Void;
|
|
166
178
|
}>;
|
|
167
179
|
/**
|
|
168
180
|
* Payload for adding an item to the active items.
|
|
169
181
|
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
182
|
+
export class AddToActive extends AddToActive_base {
|
|
183
|
+
}
|
|
184
|
+
const Set_base: S.TaggedClass<Set, "dxos.org/plugin/navigation/action/set", {
|
|
185
|
+
readonly _tag: S.tag<"dxos.org/plugin/navigation/action/set">;
|
|
186
|
+
} & {
|
|
187
|
+
input: S.Struct<{
|
|
188
|
+
activeParts: S.Record$<typeof S.String, S.Union<[typeof S.String, S.mutable<S.Array$<typeof S.String>>]>>;
|
|
189
|
+
}>;
|
|
190
|
+
output: typeof S.Void;
|
|
176
191
|
}>;
|
|
177
192
|
/**
|
|
178
|
-
*
|
|
193
|
+
* The active parts to directly set, to be used when working with URLs or restoring a specific state.
|
|
179
194
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
195
|
+
export class Set extends Set_base {
|
|
196
|
+
}
|
|
197
|
+
const Close_base: S.TaggedClass<Close, "dxos.org/plugin/navigation/action/close", {
|
|
198
|
+
readonly _tag: S.tag<"dxos.org/plugin/navigation/action/close">;
|
|
199
|
+
} & {
|
|
200
|
+
input: S.Struct<{
|
|
201
|
+
activeParts: S.Record$<typeof S.String, S.Union<[typeof S.String, S.mutable<S.Array$<typeof S.String>>]>>;
|
|
202
|
+
noToggle: S.optional<typeof S.Boolean>;
|
|
203
|
+
}>;
|
|
204
|
+
output: typeof S.Void;
|
|
183
205
|
}>;
|
|
184
206
|
/**
|
|
185
|
-
*
|
|
207
|
+
* A subtractive overlay to apply to `location.active` (i.e. the result is a subtraction from the previous active of the argument)
|
|
186
208
|
*/
|
|
187
|
-
|
|
188
|
-
|
|
209
|
+
export class Close extends Close_base {
|
|
210
|
+
}
|
|
211
|
+
const Adjust_base: S.TaggedClass<Adjust, "dxos.org/plugin/navigation/action/adjust", {
|
|
212
|
+
readonly _tag: S.tag<"dxos.org/plugin/navigation/action/adjust">;
|
|
213
|
+
} & {
|
|
214
|
+
input: S.mutable<S.Struct<{
|
|
215
|
+
layoutCoordinate: S.mutable<S.Struct<{
|
|
216
|
+
part: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["solo"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
217
|
+
entryId: typeof S.String;
|
|
218
|
+
}>>;
|
|
219
|
+
type: S.Union<[S.Literal<["increment-start"]>, S.Literal<["increment-end"]>, S.Literal<["pin-start"]>, S.Literal<["pin-end"]>, S.Literal<["close"]>, S.Literal<["solo"]>]>;
|
|
220
|
+
}>>;
|
|
221
|
+
output: typeof S.Void;
|
|
189
222
|
}>;
|
|
190
223
|
/**
|
|
191
224
|
* An atomic transaction to apply to `location.active`, describing which element to (attempt to) move to which location.
|
|
192
225
|
*/
|
|
193
|
-
|
|
226
|
+
export class Adjust extends Adjust_base {
|
|
227
|
+
}
|
|
228
|
+
const Expose_base: S.TaggedClass<Expose, "dxos.org/plugin/navigation/action/expose", {
|
|
229
|
+
readonly _tag: S.tag<"dxos.org/plugin/navigation/action/expose">;
|
|
230
|
+
} & {
|
|
231
|
+
input: S.Struct<{
|
|
232
|
+
id: typeof S.String;
|
|
233
|
+
}>;
|
|
234
|
+
output: typeof S.Void;
|
|
235
|
+
}>;
|
|
236
|
+
export class Expose extends Expose_base {
|
|
237
|
+
}
|
|
238
|
+
export {};
|
|
194
239
|
}
|
|
195
240
|
export {};
|
|
196
241
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../src/common/navigation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAK7C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,QAAA,MAAM,iBAAiB;;;GAAoE,CAAC;AAC5F,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAIlE,QAAA,MAAM,gBAAgB,sIAMrB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAEtB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,C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Y,WAAW,GAAG,SAAS,QAAQ,UAAU,KAAG,MAAM,GAAG,SAM1F,CAAC;AAEF,eAAO,MAAM,WAAW,WACd,WAAW,GAAG,SAAS,oBACb,gBAAgB,GAAG,SAAS,KAC7C,MAAM,GAAG,SAOX,CAAC;AAEF,eAAO,MAAM,UAAU,WAAY,WAAW,GAAG,SAAS,QAAQ,UAAU,GAAG,SAAS,KAAG,MAM1F,CAAC;AAMF,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,sCAAgC,CAAC;AAE/D;;GAEG;AAEH,yBAAiB,gBAAgB,CAAC;;;;;;;;;;;;IAChC;;OAEG;IACH,MAAM,OAAO,IAAK,SAAQ,SAQxB;KAAG;;;;;;;;;;;;;IAEL;;OAEG;IACH,MAAM,OAAO,WAAY,SAAQ,gBAS/B;KAAG;;;;;;;;;IAEL;;OAEG;IACH,MAAM,OAAO,GAAI,SAAQ,QAKvB;KAAG;;;;;;;;;;IAEL;;OAEG;IACH,MAAM,OAAO,KAAM,SAAQ,UAMzB;KAAG;;;;;;;;;;;;;IAEL;;OAEG;IACH,MAAM,OAAO,MAAO,SAAQ,WAG1B;KAAG;;;;;;;;;IAGL,MAAM,OAAO,MAAO,SAAQ,WAK1B;KAAG;;CACN"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type JSX, type ForwardedRef, type PropsWithChildren, type ReactNode } from 'react';
|
|
2
|
+
import { type GuardedType, type MakeOptional, type Disposition } from '@dxos/util';
|
|
3
|
+
import { type ErrorBoundary } from '../react';
|
|
4
|
+
/**
|
|
5
|
+
* SurfaceProps are the props that are passed to the Surface component.
|
|
6
|
+
*/
|
|
7
|
+
export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
|
|
8
|
+
/**
|
|
9
|
+
* If specified, the Surface will be wrapped in an error boundary.
|
|
10
|
+
* The fallback component will be rendered if an error occurs.
|
|
11
|
+
*/
|
|
12
|
+
fallback?: ErrorBoundary['props']['fallback'];
|
|
13
|
+
/**
|
|
14
|
+
* If specified, the Surface will be wrapped in a suspense boundary.
|
|
15
|
+
* The placeholder component will be rendered while the surface component is loading.
|
|
16
|
+
*/
|
|
17
|
+
placeholder?: ReactNode;
|
|
18
|
+
}> & MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> & {
|
|
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;
|
|
24
|
+
};
|
|
25
|
+
type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = {
|
|
26
|
+
/**
|
|
27
|
+
* ID for debugging.
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* Role defines how the data should be rendered.
|
|
32
|
+
*/
|
|
33
|
+
role: string;
|
|
34
|
+
/**
|
|
35
|
+
* The data to be rendered by the surface.
|
|
36
|
+
*/
|
|
37
|
+
data: T;
|
|
38
|
+
/**
|
|
39
|
+
* If more than one component is resolved, the limit determines how many are rendered.
|
|
40
|
+
*/
|
|
41
|
+
limit?: number | undefined;
|
|
42
|
+
};
|
|
43
|
+
type SurfaceComponentProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<CoreSurfaceProps<T> & {
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* React component used to render a surface once is has matched.
|
|
48
|
+
*/
|
|
49
|
+
export type SurfaceComponent<T extends Record<string, any> = Record<string, unknown>> = (props: SurfaceComponentProps<T>, forwardedRef: ForwardedRef<HTMLElement>) => JSX.Element | null;
|
|
50
|
+
/**
|
|
51
|
+
* Definition of when a SurfaceComponent should be rendered.
|
|
52
|
+
*/
|
|
53
|
+
export type SurfaceDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
54
|
+
id: string;
|
|
55
|
+
role: string | string[];
|
|
56
|
+
disposition?: Disposition;
|
|
57
|
+
filter?: (data: Record<string, unknown>) => data is T;
|
|
58
|
+
component: SurfaceComponent<GuardedType<SurfaceDefinition<T>['filter']>>;
|
|
59
|
+
}>;
|
|
60
|
+
export declare const createSurface: <T extends Record<string, any> = any>(definition: SurfaceDefinition<T>) => Readonly<{
|
|
61
|
+
id: string;
|
|
62
|
+
role: string | string[];
|
|
63
|
+
disposition?: Disposition;
|
|
64
|
+
filter?: ((data: Record<string, unknown>) => data is T) | undefined;
|
|
65
|
+
component: SurfaceComponent<T>;
|
|
66
|
+
}>;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../src/common/surface.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnF,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,iBAAiB,CAAC;IACpG;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IAE9C;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,CAAC,GACA,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG;IACjD;;;OAGG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAGJ,KA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,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;CAC1E,CAAC,CAAC;AAEH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,oBAAoB,iBAAiB,CAAC,CAAC,CAAC;QAP7F,MAAM;UACJ,MAAM,GAAG,MAAM,EAAE;kBACT,WAAW;qBACT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;;EAI2D,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type Plugin } from '../plugin-host';
|
|
3
2
|
export declare const ResourceKey: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
4
3
|
export type ResourceKey = z.infer<typeof ResourceKey>;
|
|
5
4
|
export declare const ResourceLanguage: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
|
|
@@ -9,14 +8,4 @@ export type ResourceLanguage = z.infer<typeof ResourceLanguage>;
|
|
|
9
8
|
*/
|
|
10
9
|
export declare const Resource: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>>;
|
|
11
10
|
export type Resource = z.infer<typeof Resource>;
|
|
12
|
-
/**
|
|
13
|
-
* Provides for a plugin that exposes translations.
|
|
14
|
-
*/
|
|
15
|
-
export type TranslationsProvides = {
|
|
16
|
-
translations: Readonly<Resource[]>;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Type guard for translation plugins.
|
|
20
|
-
*/
|
|
21
|
-
export declare const parseTranslationsPlugin: (plugin: Plugin) => Plugin<TranslationsProvides> | undefined;
|
|
22
11
|
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/common/translations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,WAAW,+DAA2C,CAAC;AACpE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,gBAAgB,yFAAwB,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,QAAQ,mHAA6B,CAAC;AACnD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface definition for a capability.
|
|
3
|
+
*/
|
|
4
|
+
import { type Effect } from 'effect';
|
|
5
|
+
import { type MaybePromise } from '@dxos/util';
|
|
6
|
+
import { type ActivationEvent } from './events';
|
|
7
|
+
declare const InterfaceDefTypeId: unique symbol;
|
|
8
|
+
/**
|
|
9
|
+
* The interface definition of a capability.
|
|
10
|
+
*/
|
|
11
|
+
export type InterfaceDef<T> = {
|
|
12
|
+
[InterfaceDefTypeId]: T;
|
|
13
|
+
identifier: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Helper to define the interface of a capability.
|
|
17
|
+
*/
|
|
18
|
+
export declare const defineCapability: <T>(identifier: string) => InterfaceDef<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Functionality contributed to the application by a plugin module.
|
|
21
|
+
*/
|
|
22
|
+
export type Capability<T> = {
|
|
23
|
+
/**
|
|
24
|
+
* The interface definition of the capability.
|
|
25
|
+
*/
|
|
26
|
+
interface: InterfaceDef<T>;
|
|
27
|
+
/**
|
|
28
|
+
* The implementation of the capability.
|
|
29
|
+
*/
|
|
30
|
+
implementation: T;
|
|
31
|
+
/**
|
|
32
|
+
* Called when the capability is deactivated.
|
|
33
|
+
*/
|
|
34
|
+
deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
|
|
35
|
+
};
|
|
36
|
+
export type AnyCapability = Capability<any>;
|
|
37
|
+
type PluginsContextOptions = {
|
|
38
|
+
activate: (event: ActivationEvent) => MaybePromise<boolean>;
|
|
39
|
+
reset: (event: ActivationEvent) => MaybePromise<boolean>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Helper to define the implementation of a capability.
|
|
43
|
+
*/
|
|
44
|
+
export declare const contributes: <T>(interfaceDef: Capability<T>["interface"], implementation: Capability<T>["implementation"], deactivate?: Capability<T>["deactivate"]) => Capability<T>;
|
|
45
|
+
type LazyCapability<T, U> = () => Promise<{
|
|
46
|
+
default: (props: T) => MaybePromise<Capability<U>>;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Helper to define a lazily loaded implementation of a capability.
|
|
50
|
+
*/
|
|
51
|
+
export declare const lazy: <T, U>(c: LazyCapability<T, U>) => (props?: T) => Promise<Capability<U>>;
|
|
52
|
+
/**
|
|
53
|
+
* Context which is passed to plugins, allowing them to interact with each other.
|
|
54
|
+
*/
|
|
55
|
+
export declare class PluginsContext {
|
|
56
|
+
private readonly _definedCapabilities;
|
|
57
|
+
/**
|
|
58
|
+
* Activates plugins based on the activation event.
|
|
59
|
+
* @param event The activation event.
|
|
60
|
+
* @returns Whether the activation was successful.
|
|
61
|
+
*/
|
|
62
|
+
readonly activate: PluginsContextOptions['activate'];
|
|
63
|
+
/**
|
|
64
|
+
* Re-activates the modules that were activated by the event.
|
|
65
|
+
* @param event The activation event.
|
|
66
|
+
* @returns Whether the reset was successful.
|
|
67
|
+
*/
|
|
68
|
+
readonly reset: PluginsContextOptions['reset'];
|
|
69
|
+
constructor({ activate, reset }: PluginsContextOptions);
|
|
70
|
+
/**
|
|
71
|
+
* Requests capabilities from the plugin context.
|
|
72
|
+
* @returns An array of capabilities.
|
|
73
|
+
* @reactive
|
|
74
|
+
*/
|
|
75
|
+
requestCapabilities<T, U extends T = T>(interfaceDef: InterfaceDef<T>, filter?: (capability: T, moduleId: string) => capability is U): U[];
|
|
76
|
+
/**
|
|
77
|
+
* Requests a single capability from the plugin context.
|
|
78
|
+
* @returns The capability.
|
|
79
|
+
* @throws If no capability is found.
|
|
80
|
+
* @reactive
|
|
81
|
+
*/
|
|
82
|
+
requestCapability<T, U extends T = T>(interfaceDef: InterfaceDef<T>, filter?: (capability: T, moduleId: string) => capability is U): U;
|
|
83
|
+
/**
|
|
84
|
+
* Waits for a capability to be contributed.
|
|
85
|
+
* @returns The capability.
|
|
86
|
+
*/
|
|
87
|
+
waitForCapability<T, U extends T = T>(interfaceDef: InterfaceDef<T>, filter?: (capability: T) => capability is U): Promise<U>;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/core/capabilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMrC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAA,MAAM,kBAAkB,EAAE,OAAO,MAAyC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,cAAc,MAAM,KAC3B,YAAY,CAAC,CAAC,CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAC1B;;OAEG;IACH,SAAS,EAAE,YAAY,CAA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AC,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;gBAEnC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,qBAAqB;IA4CtD;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EACpC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAC7B,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,GAC5D,CAAC,EAAE;IAaN;;;;;OAKG;IACH,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAClC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAC7B,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,GAC5D,CAAC;IAMJ;;;OAGG;IACG,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EACxC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAC7B,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,UAAU,IAAI,CAAC,GAC1C,OAAO,CAAC,CAAC,CAAC;CAYd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.test.d.ts","sourceRoot":"","sources":["../../../../src/core/capabilities.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An event which activates a plugin module.
|
|
3
|
+
*/
|
|
4
|
+
export type ActivationEvent = {
|
|
5
|
+
id: string;
|
|
6
|
+
specifier?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* An activation event that can be a single event, or a combination of events.
|
|
10
|
+
*/
|
|
11
|
+
export type ActivationEvents = ActivationEvent | {
|
|
12
|
+
type: 'one-of';
|
|
13
|
+
events: ActivationEvent[];
|
|
14
|
+
} | {
|
|
15
|
+
type: 'all-of';
|
|
16
|
+
events: ActivationEvent[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Helper to define an activation event.
|
|
20
|
+
*/
|
|
21
|
+
export declare const defineEvent: (id: string, specifier?: string) => ActivationEvent;
|
|
22
|
+
/**
|
|
23
|
+
* Helper to create an activation event key.
|
|
24
|
+
*/
|
|
25
|
+
export declare const eventKey: (event: ActivationEvent) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Helper to create an activation event that triggers when any of the given events are activated.
|
|
28
|
+
*/
|
|
29
|
+
export declare const oneOf: (...events: ActivationEvent[]) => {
|
|
30
|
+
type: "one-of";
|
|
31
|
+
events: ActivationEvent[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Helper to create an activation event that triggers when all of the given events are activated.
|
|
35
|
+
*/
|
|
36
|
+
export declare const allOf: (...events: ActivationEvent[]) => {
|
|
37
|
+
type: "all-of";
|
|
38
|
+
events: ActivationEvent[];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Helper to check if an activation event is a one-of event.
|
|
42
|
+
*/
|
|
43
|
+
export declare const isOneOf: (events: ActivationEvents) => events is {
|
|
44
|
+
type: "one-of";
|
|
45
|
+
events: ActivationEvent[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Helper to check if an activation event is an all-of event.
|
|
49
|
+
*/
|
|
50
|
+
export declare const isAllOf: (events: ActivationEvents) => events is {
|
|
51
|
+
type: "all-of";
|
|
52
|
+
events: ActivationEvent[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Helper to get the events from an activation event.
|
|
56
|
+
*/
|
|
57
|
+
export declare const getEvents: (events: ActivationEvents) => ActivationEvent[];
|
|
58
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/core/events.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126 @@
|
|
|
1
|
+
import { Event } from '@dxos/async';
|
|
2
|
+
import { type ReactiveObject } from '@dxos/live-object';
|
|
3
|
+
import { type MaybePromise } from '@dxos/util';
|
|
4
|
+
import { PluginsContext } from './capabilities';
|
|
5
|
+
import { type ActivationEvent } from './events';
|
|
6
|
+
import { type PluginModule, type Plugin } from './plugin';
|
|
7
|
+
export type PluginManagerOptions = {
|
|
8
|
+
pluginLoader: (id: string) => MaybePromise<Plugin>;
|
|
9
|
+
plugins?: Plugin[];
|
|
10
|
+
core?: string[];
|
|
11
|
+
enabled?: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare class PluginManager {
|
|
14
|
+
readonly activation: Event<{
|
|
15
|
+
event: string;
|
|
16
|
+
state: "activating" | "activated" | "error";
|
|
17
|
+
error?: any;
|
|
18
|
+
}>;
|
|
19
|
+
readonly context: PluginsContext;
|
|
20
|
+
private readonly _state;
|
|
21
|
+
private readonly _pluginLoader;
|
|
22
|
+
private readonly _capabilities;
|
|
23
|
+
constructor({ pluginLoader, plugins, core, enabled, }: PluginManagerOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Plugins that are currently registered.
|
|
26
|
+
*
|
|
27
|
+
* @reactive
|
|
28
|
+
*/
|
|
29
|
+
get plugins(): ReactiveObject<readonly Plugin[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Ids of plugins that are core and cannot be removed.
|
|
32
|
+
*
|
|
33
|
+
* @reactive
|
|
34
|
+
*/
|
|
35
|
+
get core(): ReactiveObject<readonly string[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Ids of plugins that are currently enabled.
|
|
38
|
+
*
|
|
39
|
+
* @reactive
|
|
40
|
+
*/
|
|
41
|
+
get enabled(): ReactiveObject<readonly string[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Modules of plugins which are currently enabled.
|
|
44
|
+
*
|
|
45
|
+
* @reactive
|
|
46
|
+
*/
|
|
47
|
+
get modules(): ReactiveObject<readonly PluginModule[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Ids of modules which are currently active.
|
|
50
|
+
*
|
|
51
|
+
* @reactive
|
|
52
|
+
*/
|
|
53
|
+
get active(): ReactiveObject<readonly string[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Ids of modules which are pending removal.
|
|
56
|
+
*
|
|
57
|
+
* @reactive
|
|
58
|
+
*/
|
|
59
|
+
get pendingRemoval(): ReactiveObject<readonly string[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Ids of events which have been fired.
|
|
62
|
+
*
|
|
63
|
+
* @reactive
|
|
64
|
+
*/
|
|
65
|
+
get eventsFired(): ReactiveObject<readonly string[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Ids of modules which are pending reset.
|
|
68
|
+
*
|
|
69
|
+
* @reactive
|
|
70
|
+
*/
|
|
71
|
+
get pendingReset(): ReactiveObject<readonly string[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Adds a plugin to the manager via the plugin loader.
|
|
74
|
+
* @param id The id of the plugin.
|
|
75
|
+
*/
|
|
76
|
+
add(id: string): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Enables a plugin.
|
|
79
|
+
* @param id The id of the plugin.
|
|
80
|
+
*/
|
|
81
|
+
enable(id: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Removes a plugin from the manager.
|
|
84
|
+
* @param id The id of the plugin.
|
|
85
|
+
*/
|
|
86
|
+
remove(id: string): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Disables a plugin.
|
|
89
|
+
* @param id The id of the plugin.
|
|
90
|
+
*/
|
|
91
|
+
disable(id: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Activates plugins based on the activation event.
|
|
94
|
+
* @param event The activation event.
|
|
95
|
+
* @returns Whether the activation was successful.
|
|
96
|
+
*/
|
|
97
|
+
activate(event: ActivationEvent | string): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* Deactivates all of the modules for a plugin.
|
|
100
|
+
* @param id The id of the plugin.
|
|
101
|
+
* @returns Whether the deactivation was successful.
|
|
102
|
+
*/
|
|
103
|
+
deactivate(id: string): Promise<boolean>;
|
|
104
|
+
/**
|
|
105
|
+
* Re-activates the modules that were activated by the event.
|
|
106
|
+
* @param event The activation event.
|
|
107
|
+
* @returns Whether the reset was successful.
|
|
108
|
+
*/
|
|
109
|
+
reset(event: ActivationEvent | string): Promise<boolean>;
|
|
110
|
+
private _addPlugin;
|
|
111
|
+
private _removePlugin;
|
|
112
|
+
private _addModule;
|
|
113
|
+
private _removeModule;
|
|
114
|
+
private _getPlugin;
|
|
115
|
+
private _getActiveModules;
|
|
116
|
+
private _getInactiveModules;
|
|
117
|
+
private _getActiveModulesByEvent;
|
|
118
|
+
private _getInactiveModulesByEvent;
|
|
119
|
+
private _setPendingResetByModule;
|
|
120
|
+
private _activate;
|
|
121
|
+
private _activateModule;
|
|
122
|
+
private _deactivate;
|
|
123
|
+
private _deactivateModule;
|
|
124
|
+
private _reset;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/core/manager.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAsB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,KAAK,eAAe,EAAgC,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAO1D,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,MAAM,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