@dxos/app-framework 0.7.4 → 0.7.5-labs.5f04cf6
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-22MGDQXD.mjs +1621 -0
- package/dist/lib/browser/chunk-22MGDQXD.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-7PNEFY2G.cjs +1665 -0
- package/dist/lib/node/chunk-7PNEFY2G.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-ZFOOPWBG.mjs +1623 -0
- package/dist/lib/node-esm/chunk-ZFOOPWBG.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 +343 -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 +31 -14
- package/project.json +2 -1
- package/src/App.tsx +138 -34
- package/src/common/capabilities.ts +88 -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 +69 -50
- 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 +54 -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,81 +0,0 @@
|
|
|
1
|
-
import type { MaybePromise } from '@dxos/util';
|
|
2
|
-
import type { Plugin } from '../plugin-host';
|
|
3
|
-
/**
|
|
4
|
-
* Type of data returned from an intent.
|
|
5
|
-
*/
|
|
6
|
-
export type IntentData<T extends Record<string, any> = Record<string, any>> = T & {
|
|
7
|
-
/**
|
|
8
|
-
* The data from the result of the previous intent.
|
|
9
|
-
*/
|
|
10
|
-
result?: any;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* An intent is an abstract description of an operation to be performed.
|
|
14
|
-
* Intents allow actions to be performed across plugins.
|
|
15
|
-
*/
|
|
16
|
-
export type Intent = {
|
|
17
|
-
/**
|
|
18
|
-
* Plugin ID.
|
|
19
|
-
* If specified, the intent will be sent explicitly to the plugin.
|
|
20
|
-
* Otherwise, the intent will be sent to all plugins, in order and the first to resolve a non-null value will be used.
|
|
21
|
-
*/
|
|
22
|
-
plugin?: string;
|
|
23
|
-
/**
|
|
24
|
-
* The action to perform.
|
|
25
|
-
*/
|
|
26
|
-
action: string;
|
|
27
|
-
/**
|
|
28
|
-
* Whether or not the intent is being undone.
|
|
29
|
-
*/
|
|
30
|
-
undo?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Any data needed to perform the desired action.
|
|
33
|
-
*/
|
|
34
|
-
data?: IntentData;
|
|
35
|
-
};
|
|
36
|
-
export type IntentResult = {
|
|
37
|
-
/**
|
|
38
|
-
* The output of the action that was performed.
|
|
39
|
-
*
|
|
40
|
-
* If the intent is apart of a chain of intents, the data will be passed to the next intent.
|
|
41
|
-
*/
|
|
42
|
-
data?: any;
|
|
43
|
-
/**
|
|
44
|
-
* If provided, the action will be undoable.
|
|
45
|
-
*/
|
|
46
|
-
undoable?: {
|
|
47
|
-
/**
|
|
48
|
-
* Message to display to the user when indicating that the action can be undone.
|
|
49
|
-
*/
|
|
50
|
-
message: string;
|
|
51
|
-
/**
|
|
52
|
-
* Will be merged with the original intent data when firing the undo intent.
|
|
53
|
-
*/
|
|
54
|
-
data?: IntentData;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* An error that occurred while performing the action.
|
|
58
|
-
*
|
|
59
|
-
* If the intent is apart of a chain of intents and an error occurs, the chain will be aborted.
|
|
60
|
-
*/
|
|
61
|
-
error?: Error;
|
|
62
|
-
/**
|
|
63
|
-
* Other intent chains to be triggered.
|
|
64
|
-
*/
|
|
65
|
-
intents?: Intent[][];
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Trigger one or more intents to be sent.
|
|
69
|
-
* If multiple intents are specified, the result of each will be merged with the data to the next.
|
|
70
|
-
*
|
|
71
|
-
* @returns The result of the last intent.
|
|
72
|
-
*/
|
|
73
|
-
export type IntentDispatcher = (intent: Intent | Intent[]) => Promise<IntentResult | void>;
|
|
74
|
-
/**
|
|
75
|
-
* Resolves an intent that was dispatched.
|
|
76
|
-
* If the intent is not handled, nothing should be returned.
|
|
77
|
-
*
|
|
78
|
-
* @returns The result of the intent.
|
|
79
|
-
*/
|
|
80
|
-
export type IntentResolver = (intent: Intent, plugins: Plugin[]) => MaybePromise<IntentResult | void>;
|
|
81
|
-
//# sourceMappingURL=intent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/intent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG;IAChF;;OAEG;IAEH,MAAM,CAAC,EAAE,GAAG,CAAC;CACd,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IAEH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,CAAC,EAAE,UAAU,CAAC;KACnB,CAAC;IAEF;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;AAE3F;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/meta.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,UAAU;;CAEf,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type IntentContext } from './IntentContext';
|
|
2
|
-
import { type IntentResolver } from './intent';
|
|
3
|
-
import { type Plugin } from '../plugin-host';
|
|
4
|
-
export type IntentResolverProvides = {
|
|
5
|
-
intent: {
|
|
6
|
-
resolver: IntentResolver;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export type IntentPluginProvides = {
|
|
10
|
-
intent: IntentContext;
|
|
11
|
-
};
|
|
12
|
-
export declare const parseIntentPlugin: (plugin: Plugin) => Plugin<IntentPluginProvides> | undefined;
|
|
13
|
-
export declare const parseIntentResolverPlugin: (plugin: Plugin) => Plugin<IntentResolverProvides> | undefined;
|
|
14
|
-
export declare enum IntentAction {
|
|
15
|
-
/**
|
|
16
|
-
* Fired after an intent is dispatched if the intent is undoable.
|
|
17
|
-
*/
|
|
18
|
-
SHOW_UNDO = "dxos.org/plugin/intent/action/show-undo"
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=provides.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE;QACN,QAAQ,EAAE,cAAc,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,WAAY,MAAM,6CACkD,CAAC;AAEnG,eAAO,MAAM,yBAAyB,WAAY,MAAM,+CAC4C,CAAC;AAUrG,oBAAY,YAAY;IACtB;;OAEG;IACH,SAAS,4CAA+B;CACzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPlugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/SettingsPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,eAAO,MAAM,cAAc,QAAO,gBAAgB,CAAC,sBAAsB,CAWxE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc,YAAY,CAAC;AAE3B,eAAe,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/meta.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,YAAY;;CAEjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type SettingsStoreFactory, type SettingsValue } from '@dxos/local-storage';
|
|
2
|
-
import { type Plugin } from '../plugin-host';
|
|
3
|
-
export type SettingsProvides<T extends SettingsValue> = {
|
|
4
|
-
settings: T;
|
|
5
|
-
};
|
|
6
|
-
export type SettingsPluginProvides = {
|
|
7
|
-
settingsStore: SettingsStoreFactory;
|
|
8
|
-
};
|
|
9
|
-
export declare const parseSettingsPlugin: (plugin: Plugin) => Plugin<SettingsPluginProvides> | undefined;
|
|
10
|
-
export declare enum SettingsAction {
|
|
11
|
-
OPEN = "dxos.org/plugin/settings/action/open"
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=provides.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,IAAI;IACtD,QAAQ,EAAE,CAAC,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,WAAY,MAAM,+CAIjD,CAAC;AAMF,oBAAY,cAAc;IACxB,IAAI,yCAA4B;CACjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/ErrorBoundary.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1E,KAAK,KAAK,GAAG,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAC;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAC9G,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;CAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAInC,kBAAkB,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI;IAM1C,MAAM;IAQf,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { type PropsWithChildren, type ReactNode } from 'react';
|
|
2
|
-
import { ErrorBoundary } from './ErrorBoundary';
|
|
3
|
-
/**
|
|
4
|
-
* Direction determines how multiple components are laid out.
|
|
5
|
-
*/
|
|
6
|
-
export type Direction = 'inline' | 'inline-reverse' | 'block' | 'block-reverse';
|
|
7
|
-
/**
|
|
8
|
-
* SurfaceProps are the props that are passed to the Surface component.
|
|
9
|
-
*/
|
|
10
|
-
export type SurfaceProps = PropsWithChildren<{
|
|
11
|
-
/**
|
|
12
|
-
* Optional ID for debugging.
|
|
13
|
-
*/
|
|
14
|
-
id?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Role defines how the data should be rendered.
|
|
17
|
-
*/
|
|
18
|
-
role?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Names allow nested surfaces to be specified in the parent context, similar to a slot.
|
|
21
|
-
* Defaults to the value of `role` if not specified.
|
|
22
|
-
*/
|
|
23
|
-
name?: string;
|
|
24
|
-
/**
|
|
25
|
-
* The data to be rendered by the surface.
|
|
26
|
-
*/
|
|
27
|
-
data?: Record<string, unknown>;
|
|
28
|
-
/**
|
|
29
|
-
* Configure nested surfaces (indexed by the surface's `name`).
|
|
30
|
-
*/
|
|
31
|
-
surfaces?: Record<string, Pick<SurfaceProps, 'data' | 'surfaces'>>;
|
|
32
|
-
/**
|
|
33
|
-
* If specified, the Surface will be wrapped in an error boundary.
|
|
34
|
-
* The fallback component will be rendered if an error occurs.
|
|
35
|
-
*/
|
|
36
|
-
fallback?: ErrorBoundary['props']['fallback'];
|
|
37
|
-
/**
|
|
38
|
-
* If specified, the Surface will be wrapped in a suspense boundary.
|
|
39
|
-
* The placeholder component will be rendered while the surface component is loading.
|
|
40
|
-
*/
|
|
41
|
-
placeholder?: ReactNode;
|
|
42
|
-
/**
|
|
43
|
-
* If more than one component is resolved, the limit determines how many are rendered.
|
|
44
|
-
*/
|
|
45
|
-
limit?: number | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* If more than one component is resolved, the direction determines how they are laid out.
|
|
48
|
-
* NOTE: This is not yet implemented.
|
|
49
|
-
*/
|
|
50
|
-
direction?: Direction;
|
|
51
|
-
/**
|
|
52
|
-
* Additional props to pass to the component.
|
|
53
|
-
* These props are not used by Surface itself but may be used by components which resolve the surface.
|
|
54
|
-
*/
|
|
55
|
-
[key: string]: unknown;
|
|
56
|
-
}>;
|
|
57
|
-
/**
|
|
58
|
-
* A surface is a named region of the screen that can be populated by plugins.
|
|
59
|
-
*/
|
|
60
|
-
export declare const Surface: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SurfaceProps, "ref"> & React.RefAttributes<HTMLElement>>>;
|
|
61
|
-
export declare const useSurface: () => SurfaceProps;
|
|
62
|
-
//# sourceMappingURL=Surface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAGZ,KAAK,iBAAiB,EACtB,KAAK,SAAS,EASf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,gBAAgB,GAAG,OAAO,GAAG,eAAe,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;IAC3C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAEnE;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IAE9C;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,OAAO,0HAkCnB,CAAC;AAIF,eAAO,MAAM,UAAU,QAAO,YAC+C,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type SurfacePluginProvides } from './provides';
|
|
2
|
-
import { type PluginDefinition } from '../plugin-host';
|
|
3
|
-
/**
|
|
4
|
-
* Provides a registry of surface components.
|
|
5
|
-
*/
|
|
6
|
-
export declare const SurfacePlugin: () => PluginDefinition<SurfacePluginProvides>;
|
|
7
|
-
//# sourceMappingURL=SurfacePlugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurfacePlugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/SurfacePlugin.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,gBAAgB,CAAC,qBAAqB,CAetE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type JSX, type ForwardedRef } from 'react';
|
|
2
|
-
import { type SurfaceProps } from './Surface';
|
|
3
|
-
type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
|
|
4
|
-
[Property in Key]-?: Type[Property];
|
|
5
|
-
};
|
|
6
|
-
type SurfaceComponentProps = WithRequiredProperty<SurfaceProps, 'data'>;
|
|
7
|
-
/**
|
|
8
|
-
* Determines the priority of the surface when multiple components are resolved.
|
|
9
|
-
*/
|
|
10
|
-
export type SurfaceDisposition = 'hoist' | 'fallback';
|
|
11
|
-
/**
|
|
12
|
-
* Surface debug info.
|
|
13
|
-
* NOTE: Short-term measure to track perf issues.
|
|
14
|
-
*/
|
|
15
|
-
export type DebugInfo = {
|
|
16
|
-
id: string;
|
|
17
|
-
created: number;
|
|
18
|
-
renderCount: number;
|
|
19
|
-
} & Pick<SurfaceProps, 'role' | 'name'>;
|
|
20
|
-
export type SurfaceResult = {
|
|
21
|
-
node: JSX.Element;
|
|
22
|
-
disposition?: SurfaceDisposition;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Function that resolves a Surface.
|
|
26
|
-
* If a null value is returned, the rendering is deferred to other plugins.
|
|
27
|
-
*/
|
|
28
|
-
export type SurfaceComponent = (props: SurfaceComponentProps, forwardedRef: ForwardedRef<HTMLElement>) => JSX.Element | SurfaceResult | null;
|
|
29
|
-
export type SurfaceRootContext = {
|
|
30
|
-
components: Record<string, SurfaceComponent>;
|
|
31
|
-
/**
|
|
32
|
-
* Debug info.
|
|
33
|
-
*/
|
|
34
|
-
debugInfo?: Map<string, DebugInfo>;
|
|
35
|
-
};
|
|
36
|
-
export declare const useSurfaceRoot: () => SurfaceRootContext;
|
|
37
|
-
export declare const SurfaceProvider: import("react").Provider<SurfaceRootContext | undefined>;
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=SurfaceRootContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceRootContext.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/SurfaceRootContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA6B,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAI/E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,KAAK,oBAAoB,CAAC,IAAI,EAAE,GAAG,SAAS,MAAM,IAAI,IAAI,IAAI,GAAG;KAC9D,QAAQ,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;CACpC,CAAC;AAEF,KAAK,qBAAqB,GAAG,oBAAoB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,KAAK,EAAE,qBAAqB,EAC5B,YAAY,EAAE,YAAY,CAAC,WAAW,CAAC,KACpC,GAAG,CAAC,OAAO,GAAG,aAAa,GAAG,IAAI,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAE7C;;OAEG;IACH,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,cAAc,0BAAyF,CAAC;AAErH,eAAO,MAAM,eAAe,0DAA8B,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the given data is an object and not null.
|
|
3
|
-
*
|
|
4
|
-
* Useful inside surface component resolvers as a type guard.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* const old =
|
|
9
|
-
* data.content &&
|
|
10
|
-
* typeof data.content === 'object' &&
|
|
11
|
-
* 'id' in data.content &&
|
|
12
|
-
* typeof data.content.id === 'string';
|
|
13
|
-
*
|
|
14
|
-
* // becomes
|
|
15
|
-
* const new = isObject(data.content) && typeof data.content.id === 'string';
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare const isObject: (data: unknown) => data is {
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/helpers.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,SAAU,OAAO,KAAG,IAAI,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAwC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SurfacePlugin } from './SurfacePlugin';
|
|
2
|
-
export * from './helpers';
|
|
3
|
-
export * from './provides';
|
|
4
|
-
export * from './ErrorBoundary';
|
|
5
|
-
export * from './Surface';
|
|
6
|
-
export * from './SurfaceRootContext';
|
|
7
|
-
export default SurfacePlugin;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AAErC,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/meta.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,WAAW;;CAEhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type SurfaceComponent, type SurfaceRootContext } from './SurfaceRootContext';
|
|
2
|
-
import { type Plugin } from '../plugin-host';
|
|
3
|
-
export type SurfaceProvides = {
|
|
4
|
-
surface: {
|
|
5
|
-
/**
|
|
6
|
-
* Used by the `Surface` resolver to find a component to render.
|
|
7
|
-
*/
|
|
8
|
-
component: SurfaceComponent;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export type SurfacePluginProvides = {
|
|
12
|
-
surface: SurfaceRootContext;
|
|
13
|
-
};
|
|
14
|
-
export declare const parseRootSurfacePlugin: (plugin?: Plugin) => Plugin<SurfacePluginProvides> | undefined;
|
|
15
|
-
export declare const parseSurfacePlugin: (plugin?: Plugin) => Plugin<SurfaceProvides> | undefined;
|
|
16
|
-
//# sourceMappingURL=provides.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE;QACP;;WAEG;QACH,SAAS,EAAE,gBAAgB,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAAa,MAAM,8CACkD,CAAC;AAEzG,eAAO,MAAM,kBAAkB,YAAa,MAAM,wCAC+C,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Space } from '@dxos/client-protocol';
|
|
6
|
-
|
|
7
|
-
import { type Plugin } from '../plugin-host';
|
|
8
|
-
|
|
9
|
-
// TODO(burdon): See Accept attribute (uses MIME types).
|
|
10
|
-
// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],
|
|
11
|
-
export const defaultFileTypes = {
|
|
12
|
-
images: ['png', 'jpg', 'jpeg', 'gif'],
|
|
13
|
-
media: ['mp3', 'mp4', 'mov', 'avi'],
|
|
14
|
-
text: ['pdf', 'txt', 'md'],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type FileInfo = {
|
|
18
|
-
url?: string;
|
|
19
|
-
cid?: string; // TODO(burdon): Meta key? Or other common properties with other file management system? (e.g., WNFS).
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Generic interface provided by file plugins (e.g., IPFS, WNFS).
|
|
26
|
-
*/
|
|
27
|
-
export type FileManagerProvides = {
|
|
28
|
-
file: {
|
|
29
|
-
upload?: FileUploader;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// TODO(burdon): Better match against interface? and Return provided service type. What if multiple?
|
|
34
|
-
export const parseFileManagerPlugin = (plugin: Plugin) => {
|
|
35
|
-
return (plugin.provides as any).file ? (plugin as Plugin<FileManagerProvides>) : undefined;
|
|
36
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import type { Graph, GraphBuilder, Node } from '@dxos/app-graph';
|
|
6
|
-
import { type MaybePromise } from '@dxos/util';
|
|
7
|
-
|
|
8
|
-
import type { Plugin } from '../plugin-host';
|
|
9
|
-
|
|
10
|
-
// TODO(wittjosiah): Factor out.
|
|
11
|
-
export type SerializedNode = {
|
|
12
|
-
name: string;
|
|
13
|
-
data: string;
|
|
14
|
-
type?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// TODO(wittjosiah): Factor out.
|
|
18
|
-
export type NodeSerializer<T = any> = {
|
|
19
|
-
inputType: string;
|
|
20
|
-
outputType: string;
|
|
21
|
-
disposition?: 'hoist' | 'fallback';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Takes a node and serializes it into a format that can be stored.
|
|
25
|
-
*/
|
|
26
|
-
serialize: (node: Node<T>) => MaybePromise<SerializedNode>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Takes a serialized node and deserializes it into the application.
|
|
30
|
-
*/
|
|
31
|
-
deserialize: (data: SerializedNode, ancestors: unknown[]) => MaybePromise<T>;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Provides for a plugin that exposes the application graph.
|
|
36
|
-
*/
|
|
37
|
-
export type GraphProvides = {
|
|
38
|
-
graph: Graph;
|
|
39
|
-
explore: GraphBuilder['explore'];
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type GraphBuilderProvides = {
|
|
43
|
-
graph: {
|
|
44
|
-
builder: (plugins: Plugin[]) => Parameters<GraphBuilder['addExtension']>[0];
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export type GraphSerializerProvides = {
|
|
49
|
-
graph: {
|
|
50
|
-
serializer: (plugins: Plugin[]) => NodeSerializer[];
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Type guard for graph plugins.
|
|
56
|
-
*/
|
|
57
|
-
export const parseGraphPlugin = (plugin: Plugin) =>
|
|
58
|
-
(plugin.provides as any).graph?.root ? (plugin as Plugin<GraphProvides>) : undefined;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Type guard for graph builder plugins.
|
|
62
|
-
*/
|
|
63
|
-
export const parseGraphBuilderPlugin = (plugin: Plugin) =>
|
|
64
|
-
(plugin.provides as any).graph?.builder ? (plugin as Plugin<GraphBuilderProvides>) : undefined;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Type guard for graph serializer plugins.
|
|
68
|
-
*/
|
|
69
|
-
export const parseGraphSerializerPlugin = (plugin: Plugin) =>
|
|
70
|
-
(plugin.provides as any).graph?.serializer ? (plugin as Plugin<GraphSerializerProvides>) : undefined;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
import { type Plugin } from '../plugin-host';
|
|
8
|
-
import { type IntentData } from '../plugin-intent';
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
// Provides
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
export const Toast = z.object({
|
|
15
|
-
id: z.string(),
|
|
16
|
-
title: z.string().optional(),
|
|
17
|
-
description: z.string().optional(),
|
|
18
|
-
// TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.
|
|
19
|
-
icon: z.any().optional(),
|
|
20
|
-
duration: z.number().optional(),
|
|
21
|
-
closeLabel: z.string().optional(),
|
|
22
|
-
actionLabel: z.string().optional(),
|
|
23
|
-
actionAlt: z.string().optional(),
|
|
24
|
-
onAction: z.function().optional(),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export type Toast = z.infer<typeof Toast>;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Basic state provided by a layout plugin.
|
|
31
|
-
*
|
|
32
|
-
* Layout provides the state of global UI landmarks, such as the sidebar, dialog, and popover.
|
|
33
|
-
* Generally only one dialog or popover should be open at a time, a layout plugin should manage this.
|
|
34
|
-
* For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
const LayoutMode = z.union([z.literal('deck'), z.literal('solo'), z.literal('fullscreen')]);
|
|
38
|
-
export const isLayoutMode = (value: any): value is LayoutMode => LayoutMode.safeParse(value).success;
|
|
39
|
-
export type LayoutMode = z.infer<typeof LayoutMode>;
|
|
40
|
-
|
|
41
|
-
// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.
|
|
42
|
-
export const Layout = z.object({
|
|
43
|
-
layoutMode: z.union([z.literal('deck'), z.literal('solo'), z.literal('fullscreen')]),
|
|
44
|
-
|
|
45
|
-
sidebarOpen: z.boolean(),
|
|
46
|
-
complementarySidebarOpen: z.boolean(),
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated
|
|
49
|
-
*/
|
|
50
|
-
complementarySidebarContent: z
|
|
51
|
-
.any()
|
|
52
|
-
.optional()
|
|
53
|
-
.describe('DEPRECATED. Data to be passed to the complementary sidebar Surface.'),
|
|
54
|
-
|
|
55
|
-
dialogOpen: z.boolean(),
|
|
56
|
-
dialogContent: z.any().optional().describe('Data to be passed to the dialog Surface.'),
|
|
57
|
-
// TODO(wittjosiah): Custom properties?
|
|
58
|
-
dialogBlockAlign: z.union([z.literal('start'), z.literal('center')]).optional(),
|
|
59
|
-
dialogType: z.union([z.literal('default'), z.literal('alert')]).optional(),
|
|
60
|
-
|
|
61
|
-
popoverOpen: z.boolean(),
|
|
62
|
-
popoverContent: z.any().optional().describe('Data to be passed to the popover Surface.'),
|
|
63
|
-
popoverAnchorId: z.string().optional(),
|
|
64
|
-
|
|
65
|
-
toasts: z.array(Toast),
|
|
66
|
-
|
|
67
|
-
scrollIntoView: z
|
|
68
|
-
.string()
|
|
69
|
-
.optional()
|
|
70
|
-
.describe('The identifier of a component to scroll into view when it is mounted.'),
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export type Layout = z.infer<typeof Layout>;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Provides for a plugin that can manage the app layout.
|
|
77
|
-
*/
|
|
78
|
-
export type LayoutProvides = {
|
|
79
|
-
layout: Readonly<Layout>;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Type guard for layout plugins.
|
|
84
|
-
*/
|
|
85
|
-
export const parseLayoutPlugin = (plugin: Plugin) => {
|
|
86
|
-
const { success } = Layout.safeParse((plugin.provides as any).layout);
|
|
87
|
-
return success ? (plugin as Plugin<LayoutProvides>) : undefined;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
//
|
|
91
|
-
// Intents
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
const LAYOUT_PLUGIN = 'dxos.org/plugin/layout';
|
|
95
|
-
|
|
96
|
-
const LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
|
|
97
|
-
|
|
98
|
-
export enum LayoutAction {
|
|
99
|
-
SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,
|
|
100
|
-
SET_LAYOUT_MODE = `${LAYOUT_ACTION}/set-layout-mode`,
|
|
101
|
-
SCROLL_INTO_VIEW = `${LAYOUT_ACTION}/scroll-into-view`,
|
|
102
|
-
UPDATE_PLANK_SIZE = `${LAYOUT_ACTION}/update-plank-size`,
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Expected payload for layout actions.
|
|
107
|
-
*/
|
|
108
|
-
export namespace LayoutAction {
|
|
109
|
-
export type SetLayoutMode = IntentData<{
|
|
110
|
-
layoutMode?: LayoutMode;
|
|
111
|
-
revert?: boolean;
|
|
112
|
-
}>;
|
|
113
|
-
|
|
114
|
-
export type SetLayout = IntentData<{
|
|
115
|
-
/**
|
|
116
|
-
* Element to set the state of.
|
|
117
|
-
*/
|
|
118
|
-
element: 'fullscreen' | 'sidebar' | 'complementary' | 'dialog' | 'popover' | 'toast';
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Whether the element is on or off.
|
|
122
|
-
*
|
|
123
|
-
* If omitted, the element's state will be toggled or set based on other provided data.
|
|
124
|
-
* For example, if `component` is provided, the state will be set to `true`.
|
|
125
|
-
*/
|
|
126
|
-
state?: boolean;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Component to render in the dialog or popover.
|
|
130
|
-
*/
|
|
131
|
-
component?: string;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Data to be passed to the dialog or popover Surface.
|
|
135
|
-
*/
|
|
136
|
-
subject?: any;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Anchor ID for the popover.
|
|
140
|
-
*/
|
|
141
|
-
anchorId?: string;
|
|
142
|
-
|
|
143
|
-
// TODO(wittjosiah): Custom properties?
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Block alignment for the dialog.
|
|
147
|
-
*/
|
|
148
|
-
dialogBlockAlign?: 'start' | 'center';
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Type of dialog.
|
|
152
|
-
*/
|
|
153
|
-
dialogType?: 'default' | 'alert';
|
|
154
|
-
}>;
|
|
155
|
-
}
|