@dxos/app-framework 0.7.4 → 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,571 +1,180 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ActiveParts,
|
|
3
|
+
Capabilities,
|
|
4
|
+
ErrorBoundary,
|
|
5
|
+
Events,
|
|
6
|
+
FileInfoSchema,
|
|
7
|
+
INTENT_ACTION,
|
|
8
|
+
INTENT_PLUGIN,
|
|
2
9
|
IntentAction,
|
|
10
|
+
IntentPlugin,
|
|
3
11
|
IntentProvider,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
LAYOUT_ACTION,
|
|
13
|
+
LAYOUT_PLUGIN,
|
|
14
|
+
Label,
|
|
15
|
+
Layout,
|
|
16
|
+
LayoutAction,
|
|
17
|
+
NAVIGATION_ACTION,
|
|
18
|
+
NAVIGATION_PLUGIN,
|
|
19
|
+
NavigationAction,
|
|
20
|
+
Plugin,
|
|
21
|
+
PluginManager,
|
|
22
|
+
PluginManagerProvider,
|
|
23
|
+
PluginModule,
|
|
24
|
+
PluginsContext,
|
|
25
|
+
Resource,
|
|
26
|
+
ResourceKey,
|
|
27
|
+
ResourceLanguage,
|
|
28
|
+
SLUG_COLLECTION_INDICATOR,
|
|
29
|
+
SLUG_ENTRY_SEPARATOR,
|
|
30
|
+
SLUG_KEY_VALUE_SEPARATOR,
|
|
31
|
+
SLUG_LIST_SEPARATOR,
|
|
32
|
+
SLUG_PATH_SEPARATOR,
|
|
13
33
|
Surface,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
Toast,
|
|
35
|
+
allOf,
|
|
36
|
+
chain,
|
|
37
|
+
contributes,
|
|
38
|
+
createApp,
|
|
39
|
+
createDispatcher,
|
|
40
|
+
createIntent,
|
|
41
|
+
createResolver,
|
|
42
|
+
createSurface,
|
|
43
|
+
defaultFileTypes,
|
|
44
|
+
defineCapability,
|
|
45
|
+
defineEvent,
|
|
46
|
+
defineModule,
|
|
23
47
|
definePlugin,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"mp3",
|
|
45
|
-
"mp4",
|
|
46
|
-
"mov",
|
|
47
|
-
"avi"
|
|
48
|
-
],
|
|
49
|
-
text: [
|
|
50
|
-
"pdf",
|
|
51
|
-
"txt",
|
|
52
|
-
"md"
|
|
53
|
-
]
|
|
54
|
-
};
|
|
55
|
-
var parseFileManagerPlugin = (plugin) => {
|
|
56
|
-
return plugin.provides.file ? plugin : void 0;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// packages/sdk/app-framework/src/plugins/common/graph.ts
|
|
60
|
-
var parseGraphPlugin = (plugin) => plugin.provides.graph?.root ? plugin : void 0;
|
|
61
|
-
var parseGraphBuilderPlugin = (plugin) => plugin.provides.graph?.builder ? plugin : void 0;
|
|
62
|
-
var parseGraphSerializerPlugin = (plugin) => plugin.provides.graph?.serializer ? plugin : void 0;
|
|
63
|
-
|
|
64
|
-
// packages/sdk/app-framework/src/plugins/common/layout.ts
|
|
65
|
-
import { z } from "zod";
|
|
66
|
-
var Toast = z.object({
|
|
67
|
-
id: z.string(),
|
|
68
|
-
title: z.string().optional(),
|
|
69
|
-
description: z.string().optional(),
|
|
70
|
-
// TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.
|
|
71
|
-
icon: z.any().optional(),
|
|
72
|
-
duration: z.number().optional(),
|
|
73
|
-
closeLabel: z.string().optional(),
|
|
74
|
-
actionLabel: z.string().optional(),
|
|
75
|
-
actionAlt: z.string().optional(),
|
|
76
|
-
onAction: z.function().optional()
|
|
77
|
-
});
|
|
78
|
-
var LayoutMode = z.union([
|
|
79
|
-
z.literal("deck"),
|
|
80
|
-
z.literal("solo"),
|
|
81
|
-
z.literal("fullscreen")
|
|
82
|
-
]);
|
|
83
|
-
var isLayoutMode = (value) => LayoutMode.safeParse(value).success;
|
|
84
|
-
var Layout = z.object({
|
|
85
|
-
layoutMode: z.union([
|
|
86
|
-
z.literal("deck"),
|
|
87
|
-
z.literal("solo"),
|
|
88
|
-
z.literal("fullscreen")
|
|
89
|
-
]),
|
|
90
|
-
sidebarOpen: z.boolean(),
|
|
91
|
-
complementarySidebarOpen: z.boolean(),
|
|
92
|
-
/**
|
|
93
|
-
* @deprecated
|
|
94
|
-
*/
|
|
95
|
-
complementarySidebarContent: z.any().optional().describe("DEPRECATED. Data to be passed to the complementary sidebar Surface."),
|
|
96
|
-
dialogOpen: z.boolean(),
|
|
97
|
-
dialogContent: z.any().optional().describe("Data to be passed to the dialog Surface."),
|
|
98
|
-
// TODO(wittjosiah): Custom properties?
|
|
99
|
-
dialogBlockAlign: z.union([
|
|
100
|
-
z.literal("start"),
|
|
101
|
-
z.literal("center")
|
|
102
|
-
]).optional(),
|
|
103
|
-
dialogType: z.union([
|
|
104
|
-
z.literal("default"),
|
|
105
|
-
z.literal("alert")
|
|
106
|
-
]).optional(),
|
|
107
|
-
popoverOpen: z.boolean(),
|
|
108
|
-
popoverContent: z.any().optional().describe("Data to be passed to the popover Surface."),
|
|
109
|
-
popoverAnchorId: z.string().optional(),
|
|
110
|
-
toasts: z.array(Toast),
|
|
111
|
-
scrollIntoView: z.string().optional().describe("The identifier of a component to scroll into view when it is mounted.")
|
|
112
|
-
});
|
|
113
|
-
var parseLayoutPlugin = (plugin) => {
|
|
114
|
-
const { success } = Layout.safeParse(plugin.provides.layout);
|
|
115
|
-
return success ? plugin : void 0;
|
|
116
|
-
};
|
|
117
|
-
var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
|
|
118
|
-
var LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
|
|
119
|
-
var LayoutAction;
|
|
120
|
-
(function(LayoutAction2) {
|
|
121
|
-
LayoutAction2[LayoutAction2["SET_LAYOUT"] = `${LAYOUT_ACTION}/set-layout`] = "SET_LAYOUT";
|
|
122
|
-
LayoutAction2[LayoutAction2["SET_LAYOUT_MODE"] = `${LAYOUT_ACTION}/set-layout-mode`] = "SET_LAYOUT_MODE";
|
|
123
|
-
LayoutAction2[LayoutAction2["SCROLL_INTO_VIEW"] = `${LAYOUT_ACTION}/scroll-into-view`] = "SCROLL_INTO_VIEW";
|
|
124
|
-
LayoutAction2[LayoutAction2["UPDATE_PLANK_SIZE"] = `${LAYOUT_ACTION}/update-plank-size`] = "UPDATE_PLANK_SIZE";
|
|
125
|
-
})(LayoutAction || (LayoutAction = {}));
|
|
126
|
-
|
|
127
|
-
// packages/sdk/app-framework/src/plugins/common/metadata.ts
|
|
128
|
-
var parseMetadataRecordsPlugin = (plugin) => {
|
|
129
|
-
return plugin.provides.metadata?.records ? plugin : void 0;
|
|
130
|
-
};
|
|
131
|
-
var parseMetadataResolverPlugin = (plugin) => {
|
|
132
|
-
return plugin.provides.metadata?.resolver ? plugin : void 0;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
// packages/sdk/app-framework/src/plugins/common/navigation.ts
|
|
136
|
-
import { Schema as S } from "@effect/schema";
|
|
137
|
-
import { z as z2 } from "zod";
|
|
138
|
-
import { pick } from "@dxos/util";
|
|
139
|
-
var SLUG_LIST_SEPARATOR = "+";
|
|
140
|
-
var SLUG_ENTRY_SEPARATOR = "_";
|
|
141
|
-
var SLUG_KEY_VALUE_SEPARATOR = "-";
|
|
142
|
-
var SLUG_PATH_SEPARATOR = "~";
|
|
143
|
-
var SLUG_COLLECTION_INDICATOR = "";
|
|
144
|
-
var LayoutEntrySchema = S.mutable(S.Struct({
|
|
145
|
-
id: S.String,
|
|
146
|
-
path: S.optional(S.String)
|
|
147
|
-
}));
|
|
148
|
-
var LayoutPartSchema = S.Union(S.Literal("sidebar"), S.Literal("main"), S.Literal("solo"), S.Literal("complementary"), S.Literal("fullScreen"));
|
|
149
|
-
var LayoutPartsSchema = S.partial(S.mutable(S.Record({
|
|
150
|
-
key: LayoutPartSchema,
|
|
151
|
-
value: S.mutable(S.Array(LayoutEntrySchema))
|
|
152
|
-
})));
|
|
153
|
-
var LayoutCoordinateSchema = S.mutable(S.Struct({
|
|
154
|
-
part: LayoutPartSchema,
|
|
155
|
-
entryId: S.String
|
|
156
|
-
}));
|
|
157
|
-
var PartAdjustmentSchema = S.Union(S.Literal("increment-start"), S.Literal("increment-end"), S.Literal("solo"));
|
|
158
|
-
var LayoutAdjustmentSchema = S.mutable(S.Struct({
|
|
159
|
-
layoutCoordinate: LayoutCoordinateSchema,
|
|
160
|
-
type: PartAdjustmentSchema
|
|
161
|
-
}));
|
|
162
|
-
var ActiveParts = z2.record(z2.string(), z2.union([
|
|
163
|
-
z2.string(),
|
|
164
|
-
z2.array(z2.string())
|
|
165
|
-
]));
|
|
166
|
-
var LocationProvidesSchema = S.mutable(S.Struct({
|
|
167
|
-
location: S.Struct({
|
|
168
|
-
active: LayoutPartsSchema,
|
|
169
|
-
closed: S.Array(S.String)
|
|
170
|
-
})
|
|
171
|
-
}));
|
|
172
|
-
var isLayoutParts = (value) => {
|
|
173
|
-
return S.is(LayoutPartsSchema)(value);
|
|
174
|
-
};
|
|
175
|
-
var isLayoutAdjustment = (value) => {
|
|
176
|
-
return S.is(LayoutAdjustmentSchema)(value);
|
|
177
|
-
};
|
|
178
|
-
var parseNavigationPlugin = (plugin) => {
|
|
179
|
-
const location = plugin.provides?.location;
|
|
180
|
-
if (!location) {
|
|
181
|
-
return void 0;
|
|
182
|
-
}
|
|
183
|
-
if (S.is(LocationProvidesSchema)({
|
|
184
|
-
location
|
|
185
|
-
})) {
|
|
186
|
-
return plugin;
|
|
187
|
-
}
|
|
188
|
-
return void 0;
|
|
189
|
-
};
|
|
190
|
-
var openIds = (layout, parts) => {
|
|
191
|
-
return Object.values(parts ? pick(layout, parts) : layout).flatMap((part) => part?.map((entry) => entry.id) ?? []).filter((id) => id !== void 0);
|
|
192
|
-
};
|
|
193
|
-
var firstIdInPart = (layout, part) => {
|
|
194
|
-
if (!layout) {
|
|
195
|
-
return void 0;
|
|
196
|
-
}
|
|
197
|
-
return layout[part]?.at(0)?.id;
|
|
198
|
-
};
|
|
199
|
-
var indexInPart = (layout, layoutCoordinate) => {
|
|
200
|
-
if (!layout || !layoutCoordinate) {
|
|
201
|
-
return void 0;
|
|
202
|
-
}
|
|
203
|
-
const { part, entryId } = layoutCoordinate;
|
|
204
|
-
return layout[part]?.findIndex((entry) => entry.id === entryId);
|
|
205
|
-
};
|
|
206
|
-
var partLength = (layout, part) => {
|
|
207
|
-
if (!layout || !part) {
|
|
208
|
-
return 0;
|
|
209
|
-
}
|
|
210
|
-
return layout[part]?.length ?? 0;
|
|
211
|
-
};
|
|
212
|
-
var NAVIGATION_PLUGIN = "dxos.org/plugin/navigation";
|
|
213
|
-
var NAVIGATION_ACTION = `${NAVIGATION_PLUGIN}/action`;
|
|
214
|
-
var NavigationAction;
|
|
215
|
-
(function(NavigationAction2) {
|
|
216
|
-
NavigationAction2[NavigationAction2["OPEN"] = `${NAVIGATION_ACTION}/open`] = "OPEN";
|
|
217
|
-
NavigationAction2[NavigationAction2["ADD_TO_ACTIVE"] = `${NAVIGATION_ACTION}/add-to-active`] = "ADD_TO_ACTIVE";
|
|
218
|
-
NavigationAction2[NavigationAction2["SET"] = `${NAVIGATION_ACTION}/set`] = "SET";
|
|
219
|
-
NavigationAction2[NavigationAction2["ADJUST"] = `${NAVIGATION_ACTION}/adjust`] = "ADJUST";
|
|
220
|
-
NavigationAction2[NavigationAction2["CLOSE"] = `${NAVIGATION_ACTION}/close`] = "CLOSE";
|
|
221
|
-
NavigationAction2[NavigationAction2["EXPOSE"] = `${NAVIGATION_ACTION}/expose`] = "EXPOSE";
|
|
222
|
-
})(NavigationAction || (NavigationAction = {}));
|
|
223
|
-
|
|
224
|
-
// packages/sdk/app-framework/src/plugins/common/translations.ts
|
|
225
|
-
import { z as z3 } from "zod";
|
|
226
|
-
var ResourceKey = z3.union([
|
|
227
|
-
z3.string(),
|
|
228
|
-
z3.record(z3.any())
|
|
229
|
-
]);
|
|
230
|
-
var ResourceLanguage = z3.record(ResourceKey);
|
|
231
|
-
var Resource = z3.record(ResourceLanguage);
|
|
232
|
-
var parseTranslationsPlugin = (plugin) => {
|
|
233
|
-
const { success } = z3.array(Resource).safeParse(plugin.provides.translations);
|
|
234
|
-
return success ? plugin : void 0;
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
// packages/sdk/app-framework/src/plugins/plugin-host/plugin.ts
|
|
238
|
-
var Plugin;
|
|
239
|
-
(function(Plugin2) {
|
|
240
|
-
Plugin2.lazy = (p, props) => {
|
|
241
|
-
return () => p().then(({ default: definition }) => {
|
|
242
|
-
return definition(props);
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
})(Plugin || (Plugin = {}));
|
|
246
|
-
|
|
247
|
-
// packages/sdk/app-framework/src/plugins/plugin-host/HostPlugin.tsx
|
|
248
|
-
import React2 from "react";
|
|
249
|
-
import { LocalStorageStore } from "@dxos/local-storage";
|
|
48
|
+
eventKey,
|
|
49
|
+
firstIdInPart,
|
|
50
|
+
getEvents,
|
|
51
|
+
indexInPart,
|
|
52
|
+
isAllOf,
|
|
53
|
+
isLayoutAdjustment,
|
|
54
|
+
isLayoutMode,
|
|
55
|
+
isLayoutParts,
|
|
56
|
+
isOneOf,
|
|
57
|
+
isSurfaceAvailable,
|
|
58
|
+
lazy,
|
|
59
|
+
oneOf,
|
|
60
|
+
openIds,
|
|
61
|
+
partLength,
|
|
62
|
+
useCapabilities,
|
|
63
|
+
useCapability,
|
|
64
|
+
useIntentDispatcher,
|
|
65
|
+
useIntentResolver,
|
|
66
|
+
usePluginManager
|
|
67
|
+
} from "./chunk-EGGZVV7Q.mjs";
|
|
250
68
|
|
|
251
|
-
// packages/sdk/app-framework/src/
|
|
252
|
-
import
|
|
253
|
-
|
|
254
|
-
var
|
|
255
|
-
var
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
S: void 0,
|
|
264
|
-
C: (f, a) => f(...a)
|
|
265
|
-
});
|
|
266
|
-
const t = setTimeout(async () => {
|
|
267
|
-
try {
|
|
268
|
-
const enabledIds = [
|
|
269
|
-
...core,
|
|
270
|
-
...state.enabled
|
|
271
|
-
];
|
|
272
|
-
const enabled = await Promise.all(enabledIds.map((id) => definitions[id]).filter((definition) => Boolean(definition)).map((definition) => definition()));
|
|
273
|
-
const plugins = await Promise.all(enabled.map(async (definition) => {
|
|
274
|
-
const plugin = await initializePlugin(definition).catch((err) => {
|
|
275
|
-
log.error("Failed to initialize plugin:", {
|
|
276
|
-
id: definition.meta.id,
|
|
277
|
-
err
|
|
278
|
-
}, {
|
|
279
|
-
F: __dxlog_file,
|
|
280
|
-
L: 41,
|
|
281
|
-
S: void 0,
|
|
282
|
-
C: (f, a) => f(...a)
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
log("initialized", {
|
|
286
|
-
plugin: definition.meta.id
|
|
287
|
-
}, {
|
|
288
|
-
F: __dxlog_file,
|
|
289
|
-
L: 44,
|
|
290
|
-
S: void 0,
|
|
291
|
-
C: (f, a) => f(...a)
|
|
292
|
-
});
|
|
293
|
-
return plugin;
|
|
294
|
-
}));
|
|
295
|
-
const initialized = plugins.filter((plugin) => Boolean(plugin));
|
|
296
|
-
log("plugins initialized", {
|
|
297
|
-
plugins: initialized
|
|
298
|
-
}, {
|
|
299
|
-
F: __dxlog_file,
|
|
300
|
-
L: 50,
|
|
301
|
-
S: void 0,
|
|
302
|
-
C: (f, a) => f(...a)
|
|
303
|
-
});
|
|
304
|
-
await Promise.all(enabled.map((plugin) => plugin.ready?.(initialized)));
|
|
305
|
-
log("plugins ready", {
|
|
306
|
-
plugins: initialized
|
|
307
|
-
}, {
|
|
308
|
-
F: __dxlog_file,
|
|
309
|
-
L: 53,
|
|
310
|
-
S: void 0,
|
|
311
|
-
C: (f, a) => f(...a)
|
|
312
|
-
});
|
|
313
|
-
state.plugins = initialized;
|
|
314
|
-
state.ready = true;
|
|
315
|
-
} catch (err) {
|
|
316
|
-
setError(err);
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
return () => {
|
|
320
|
-
clearTimeout(t);
|
|
321
|
-
state.ready = false;
|
|
322
|
-
};
|
|
323
|
-
}, []);
|
|
324
|
-
if (error) {
|
|
325
|
-
throw error;
|
|
69
|
+
// packages/sdk/app-framework/src/plugin-settings/actions.ts
|
|
70
|
+
import { S } from "@dxos/echo-schema";
|
|
71
|
+
var SETTINGS_PLUGIN = "dxos.org/plugin/settings";
|
|
72
|
+
var SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;
|
|
73
|
+
var SettingsAction;
|
|
74
|
+
(function(SettingsAction2) {
|
|
75
|
+
class Open extends S.TaggedClass()(`${SETTINGS_ACTION}/open`, {
|
|
76
|
+
input: S.Struct({
|
|
77
|
+
plugin: S.optional(S.String)
|
|
78
|
+
}),
|
|
79
|
+
output: S.Void
|
|
80
|
+
}) {
|
|
326
81
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
const ComposedContext = composeContext(state.plugins);
|
|
331
|
-
return /* @__PURE__ */ React.createElement(ComposedContext, null, rootComponents(state.plugins));
|
|
332
|
-
};
|
|
333
|
-
var initializePlugin = async (pluginDefinition) => {
|
|
334
|
-
const provides = await pluginDefinition.initialize?.();
|
|
335
|
-
return {
|
|
336
|
-
...pluginDefinition,
|
|
337
|
-
provides: {
|
|
338
|
-
...pluginDefinition.provides,
|
|
339
|
-
...provides
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
};
|
|
343
|
-
var rootComponents = (plugins) => {
|
|
344
|
-
return plugins.map((plugin) => {
|
|
345
|
-
const Component = plugin.provides.root;
|
|
346
|
-
if (Component) {
|
|
347
|
-
return /* @__PURE__ */ React.createElement(Component, {
|
|
348
|
-
key: plugin.meta.id
|
|
349
|
-
});
|
|
350
|
-
} else {
|
|
351
|
-
return null;
|
|
352
|
-
}
|
|
353
|
-
}).filter((node) => Boolean(node));
|
|
354
|
-
};
|
|
355
|
-
var composeContext = (plugins) => {
|
|
356
|
-
return compose(plugins.map((p) => p.provides.context).filter(Boolean));
|
|
357
|
-
};
|
|
358
|
-
var compose = (contexts) => {
|
|
359
|
-
return [
|
|
360
|
-
...contexts
|
|
361
|
-
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ React.createElement(Acc, null, /* @__PURE__ */ React.createElement(Next, null, children)));
|
|
362
|
-
};
|
|
82
|
+
SettingsAction2.Open = Open;
|
|
83
|
+
})(SettingsAction || (SettingsAction = {}));
|
|
363
84
|
|
|
364
|
-
// packages/sdk/app-framework/src/
|
|
365
|
-
import {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
var useResolvePlugin = (predicate) => {
|
|
375
|
-
const { plugins } = usePlugins();
|
|
376
|
-
return resolvePlugin(plugins, predicate);
|
|
377
|
-
};
|
|
378
|
-
var useResolvePlugins = (predicate) => {
|
|
379
|
-
const { plugins } = usePlugins();
|
|
380
|
-
return useMemo(() => plugins.map(predicate).filter(nonNullable), [
|
|
381
|
-
plugins,
|
|
382
|
-
predicate
|
|
383
|
-
]);
|
|
384
|
-
};
|
|
385
|
-
var PluginProvider = PluginContext.Provider;
|
|
386
|
-
|
|
387
|
-
// packages/sdk/app-framework/src/plugins/plugin-host/HostPlugin.tsx
|
|
388
|
-
var parsePluginHost = (plugin) => plugin.provides.plugins ? plugin : void 0;
|
|
389
|
-
var HOST_PLUGIN = "dxos.org/plugin/host";
|
|
390
|
-
var HostPlugin = ({ plugins, meta, core, defaults = [], fallback = DefaultFallback, placeholder = null }) => {
|
|
391
|
-
const state = new LocalStorageStore(HOST_PLUGIN, {
|
|
392
|
-
ready: false,
|
|
393
|
-
core,
|
|
394
|
-
enabled: [
|
|
395
|
-
...defaults
|
|
85
|
+
// packages/sdk/app-framework/src/plugin-settings/SettingsPlugin.ts
|
|
86
|
+
import { RootSettingsStore } from "@dxos/local-storage";
|
|
87
|
+
var SettingsPlugin = () => definePlugin({
|
|
88
|
+
id: SETTINGS_PLUGIN
|
|
89
|
+
}, [
|
|
90
|
+
defineModule({
|
|
91
|
+
id: `${SETTINGS_PLUGIN}/module/store`,
|
|
92
|
+
activatesOn: Events.Startup,
|
|
93
|
+
activatesBefore: [
|
|
94
|
+
Events.SetupSettings
|
|
396
95
|
],
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
// TODO(burdon): Functions should not be part of the settings type.
|
|
400
|
-
setPlugin: (id, enabled) => {
|
|
401
|
-
if (enabled) {
|
|
402
|
-
state.values.enabled.push(id);
|
|
403
|
-
} else {
|
|
404
|
-
const index = state.values.enabled.findIndex((enabled2) => enabled2 === id);
|
|
405
|
-
index !== -1 && state.values.enabled.splice(index, 1);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
state.prop({
|
|
410
|
-
key: "enabled",
|
|
411
|
-
type: LocalStorageStore.json()
|
|
412
|
-
});
|
|
413
|
-
return {
|
|
414
|
-
meta: {
|
|
415
|
-
id: HOST_PLUGIN,
|
|
416
|
-
name: "Plugin host"
|
|
417
|
-
},
|
|
418
|
-
provides: {
|
|
419
|
-
plugins: state.values,
|
|
420
|
-
context: ({ children }) => {
|
|
421
|
-
return /* @__PURE__ */ React2.createElement(PluginProvider, {
|
|
422
|
-
value: state.values
|
|
423
|
-
}, children);
|
|
424
|
-
},
|
|
425
|
-
root: () => {
|
|
426
|
-
return /* @__PURE__ */ React2.createElement(ErrorBoundary, {
|
|
427
|
-
fallback
|
|
428
|
-
}, /* @__PURE__ */ React2.createElement(PluginContainer, {
|
|
429
|
-
plugins,
|
|
430
|
-
core,
|
|
431
|
-
state: state.values,
|
|
432
|
-
placeholder
|
|
433
|
-
}));
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
};
|
|
438
|
-
var DefaultFallback = ({ error }) => {
|
|
439
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
440
|
-
style: {
|
|
441
|
-
padding: "1rem"
|
|
442
|
-
}
|
|
443
|
-
}, /* @__PURE__ */ React2.createElement("h1", {
|
|
444
|
-
style: {
|
|
445
|
-
fontSize: "1.2rem",
|
|
446
|
-
fontWeight: 700,
|
|
447
|
-
margin: "0.5rem 0"
|
|
448
|
-
}
|
|
449
|
-
}, error.message), /* @__PURE__ */ React2.createElement("pre", null, error.stack));
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
// packages/sdk/app-framework/src/App.tsx
|
|
453
|
-
import React3 from "react";
|
|
454
|
-
import { invariant } from "@dxos/invariant";
|
|
455
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
|
|
456
|
-
var createApp = ({ meta, plugins, core, ...params }) => {
|
|
457
|
-
const hostPlugin = HostPlugin({
|
|
458
|
-
plugins: {
|
|
459
|
-
...plugins,
|
|
460
|
-
[meta_default.id]: Plugin.lazy(() => import("./plugin-intent-LU4KL2RO.mjs")),
|
|
461
|
-
[meta_default3.id]: Plugin.lazy(() => import("./plugin-settings-OM3G2QFY.mjs")),
|
|
462
|
-
[meta_default2.id]: Plugin.lazy(() => import("./plugin-surface-LECZMKSQ.mjs"))
|
|
463
|
-
},
|
|
464
|
-
meta: [
|
|
465
|
-
meta_default,
|
|
466
|
-
meta_default3,
|
|
467
|
-
meta_default2,
|
|
468
|
-
...meta
|
|
469
|
-
],
|
|
470
|
-
core: [
|
|
471
|
-
meta_default.id,
|
|
472
|
-
meta_default3.id,
|
|
473
|
-
meta_default2.id,
|
|
474
|
-
...core
|
|
96
|
+
activatesAfter: [
|
|
97
|
+
Events.SettingsReady
|
|
475
98
|
],
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
});
|
|
487
|
-
const { context: Context, root: Root } = hostPlugin.provides;
|
|
488
|
-
invariant(Context, void 0, {
|
|
489
|
-
F: __dxlog_file2,
|
|
490
|
-
L: 55,
|
|
491
|
-
S: void 0,
|
|
492
|
-
A: [
|
|
493
|
-
"Context",
|
|
494
|
-
""
|
|
495
|
-
]
|
|
496
|
-
});
|
|
497
|
-
invariant(Root, void 0, {
|
|
498
|
-
F: __dxlog_file2,
|
|
499
|
-
L: 56,
|
|
500
|
-
S: void 0,
|
|
501
|
-
A: [
|
|
502
|
-
"Root",
|
|
503
|
-
""
|
|
504
|
-
]
|
|
505
|
-
});
|
|
506
|
-
return () => /* @__PURE__ */ React3.createElement(Context, null, /* @__PURE__ */ React3.createElement(Root, null));
|
|
507
|
-
};
|
|
99
|
+
activate: (context) => {
|
|
100
|
+
const allSettings = context.requestCapabilities(Capabilities.Settings);
|
|
101
|
+
const settingsStore = new RootSettingsStore();
|
|
102
|
+
allSettings.forEach((setting) => {
|
|
103
|
+
settingsStore.createStore(setting);
|
|
104
|
+
});
|
|
105
|
+
return contributes(Capabilities.SettingsStore, settingsStore);
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
]);
|
|
508
109
|
export {
|
|
509
110
|
ActiveParts,
|
|
111
|
+
Capabilities,
|
|
510
112
|
ErrorBoundary,
|
|
511
|
-
|
|
113
|
+
Events,
|
|
114
|
+
FileInfoSchema,
|
|
115
|
+
INTENT_ACTION,
|
|
116
|
+
INTENT_PLUGIN,
|
|
512
117
|
IntentAction,
|
|
118
|
+
IntentPlugin,
|
|
513
119
|
IntentProvider,
|
|
120
|
+
LAYOUT_ACTION,
|
|
121
|
+
LAYOUT_PLUGIN,
|
|
122
|
+
Label,
|
|
514
123
|
Layout,
|
|
515
124
|
LayoutAction,
|
|
125
|
+
NAVIGATION_ACTION,
|
|
126
|
+
NAVIGATION_PLUGIN,
|
|
516
127
|
NavigationAction,
|
|
517
128
|
Plugin,
|
|
518
|
-
|
|
129
|
+
PluginManager,
|
|
130
|
+
PluginManagerProvider,
|
|
131
|
+
PluginModule,
|
|
132
|
+
PluginsContext,
|
|
519
133
|
Resource,
|
|
520
134
|
ResourceKey,
|
|
521
135
|
ResourceLanguage,
|
|
136
|
+
SETTINGS_ACTION,
|
|
137
|
+
SETTINGS_PLUGIN,
|
|
522
138
|
SLUG_COLLECTION_INDICATOR,
|
|
523
139
|
SLUG_ENTRY_SEPARATOR,
|
|
524
140
|
SLUG_KEY_VALUE_SEPARATOR,
|
|
525
141
|
SLUG_LIST_SEPARATOR,
|
|
526
142
|
SLUG_PATH_SEPARATOR,
|
|
527
143
|
SettingsAction,
|
|
144
|
+
SettingsPlugin,
|
|
528
145
|
Surface,
|
|
529
|
-
SurfaceProvider,
|
|
530
146
|
Toast,
|
|
147
|
+
allOf,
|
|
148
|
+
chain,
|
|
149
|
+
contributes,
|
|
531
150
|
createApp,
|
|
151
|
+
createDispatcher,
|
|
152
|
+
createIntent,
|
|
153
|
+
createResolver,
|
|
154
|
+
createSurface,
|
|
532
155
|
defaultFileTypes,
|
|
156
|
+
defineCapability,
|
|
157
|
+
defineEvent,
|
|
158
|
+
defineModule,
|
|
533
159
|
definePlugin,
|
|
534
|
-
|
|
535
|
-
findPlugin,
|
|
160
|
+
eventKey,
|
|
536
161
|
firstIdInPart,
|
|
537
|
-
|
|
162
|
+
getEvents,
|
|
538
163
|
indexInPart,
|
|
164
|
+
isAllOf,
|
|
539
165
|
isLayoutAdjustment,
|
|
540
166
|
isLayoutMode,
|
|
541
167
|
isLayoutParts,
|
|
542
|
-
|
|
168
|
+
isOneOf,
|
|
169
|
+
isSurfaceAvailable,
|
|
170
|
+
lazy,
|
|
171
|
+
oneOf,
|
|
543
172
|
openIds,
|
|
544
|
-
parseFileManagerPlugin,
|
|
545
|
-
parseGraphBuilderPlugin,
|
|
546
|
-
parseGraphPlugin,
|
|
547
|
-
parseGraphSerializerPlugin,
|
|
548
|
-
parseIntentPlugin,
|
|
549
|
-
parseIntentResolverPlugin,
|
|
550
|
-
parseLayoutPlugin,
|
|
551
|
-
parseMetadataRecordsPlugin,
|
|
552
|
-
parseMetadataResolverPlugin,
|
|
553
|
-
parseNavigationPlugin,
|
|
554
|
-
parsePluginHost,
|
|
555
|
-
parseRootSurfacePlugin,
|
|
556
|
-
parseSettingsPlugin,
|
|
557
|
-
parseSurfacePlugin,
|
|
558
|
-
parseTranslationsPlugin,
|
|
559
173
|
partLength,
|
|
560
|
-
|
|
561
|
-
|
|
174
|
+
useCapabilities,
|
|
175
|
+
useCapability,
|
|
562
176
|
useIntentDispatcher,
|
|
563
177
|
useIntentResolver,
|
|
564
|
-
|
|
565
|
-
usePlugins,
|
|
566
|
-
useResolvePlugin,
|
|
567
|
-
useResolvePlugins,
|
|
568
|
-
useSurface,
|
|
569
|
-
useSurfaceRoot
|
|
178
|
+
usePluginManager
|
|
570
179
|
};
|
|
571
180
|
//# sourceMappingURL=index.mjs.map
|