@dxos/app-framework 0.7.5-main.9cb18ac → 0.7.5-main.9d2a38b
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-GNLU3GAU.mjs +1595 -0
- package/dist/lib/browser/chunk-GNLU3GAU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +112 -618
- 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-FBA4BB3J.cjs +1639 -0
- package/dist/lib/node/chunk-FBA4BB3J.cjs.map +7 -0
- package/dist/lib/node/index.cjs +123 -651
- 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-KPMTPXQI.mjs +1597 -0
- package/dist/lib/node-esm/chunk-KPMTPXQI.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +112 -618
- 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/{plugins/common → common}/layout.d.ts +0 -11
- package/dist/types/src/common/layout.d.ts.map +1 -0
- package/dist/types/src/{plugins/common → common}/navigation.d.ts +0 -2
- package/dist/types/src/common/navigation.d.ts.map +1 -0
- package/dist/types/src/{plugins/plugin-surface/SurfaceContext.d.ts → common/surface.d.ts} +12 -29
- 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/{plugins/plugin-intent → plugin-intent}/IntentContext.d.ts +1 -1
- 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/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.d.ts +18 -19
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
- package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent.d.ts +5 -25
- 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/{plugins/plugin-settings/provides.d.ts → plugin-settings/actions.d.ts} +1 -10
- 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 -1
- package/package.json +28 -15
- 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/{plugins/common → common}/layout.ts +0 -16
- package/src/{plugins/common → common}/navigation.ts +0 -15
- package/src/{plugins/plugin-surface/SurfaceContext.ts → common/surface.ts} +6 -37
- 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/{plugins/plugin-intent → plugin-intent}/IntentContext.tsx +12 -4
- 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/{plugins/plugin-intent → plugin-intent}/index.ts +2 -6
- package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.ts +36 -35
- package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.ts +49 -65
- package/src/{plugins/plugin-intent → plugin-intent}/intent.ts +5 -21
- 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 +39 -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 +13 -1
- package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
- package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
- package/dist/lib/browser/chunk-QG25ZU2N.mjs +0 -320
- package/dist/lib/browser/chunk-QG25ZU2N.mjs.map +0 -7
- package/dist/lib/browser/chunk-SPDTXTOV.mjs +0 -163
- package/dist/lib/browser/chunk-SPDTXTOV.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBOXEHBE.mjs +0 -51
- package/dist/lib/browser/chunk-WBOXEHBE.mjs.map +0 -7
- package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs +0 -32
- package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs.map +0 -7
- package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs +0 -15
- package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs.map +0 -7
- package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs +0 -24
- package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs.map +0 -7
- package/dist/lib/node/chunk-BW3RNEVI.cjs +0 -185
- package/dist/lib/node/chunk-BW3RNEVI.cjs.map +0 -7
- package/dist/lib/node/chunk-FCMHRU3M.cjs +0 -70
- package/dist/lib/node/chunk-FCMHRU3M.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-VWHAALIN.cjs +0 -344
- package/dist/lib/node/chunk-VWHAALIN.cjs.map +0 -7
- package/dist/lib/node/plugin-intent-F3TQZIUR.cjs +0 -53
- package/dist/lib/node/plugin-intent-F3TQZIUR.cjs.map +0 -7
- package/dist/lib/node/plugin-settings-W6UHMH5M.cjs +0 -36
- package/dist/lib/node/plugin-settings-W6UHMH5M.cjs.map +0 -7
- package/dist/lib/node/plugin-surface-CCSIONYW.cjs +0 -45
- package/dist/lib/node/plugin-surface-CCSIONYW.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-3T5UIJY3.mjs +0 -53
- package/dist/lib/node-esm/chunk-3T5UIJY3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs +0 -164
- package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs +0 -321
- package/dist/lib/node-esm/chunk-CFOUYXQ6.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/plugin-intent-W2HQC6LC.mjs +0 -33
- package/dist/lib/node-esm/plugin-intent-W2HQC6LC.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs +0 -16
- package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs +0 -25
- package/dist/lib/node-esm/plugin-surface-V3YET3UL.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.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 -16
- 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 -6
- package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -104
- 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.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/index.d.ts +0 -7
- package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -6
- package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -16
- 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.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 -7
- package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/SurfaceContext.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/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 -17
- 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/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 -88
- 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 -12
- package/src/plugins/plugin-host/plugin.test.ts +0 -158
- package/src/plugins/plugin-host/plugin.ts +0 -133
- package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -75
- package/src/plugins/plugin-intent/meta.ts +0 -11
- package/src/plugins/plugin-intent/provides.ts +0 -26
- 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 -34
- package/src/plugins/plugin-surface/Surface.tsx +0 -62
- package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -45
- 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 -27
- /package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.d.ts +0 -0
- /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
- /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
package/dist/lib/node/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,649 +15,129 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var node_exports = {};
|
|
30
20
|
__export(node_exports, {
|
|
31
|
-
ActiveParts: () => ActiveParts,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
useResolvePlugins: () => useResolvePlugins,
|
|
101
|
-
useSurfaceRoot: () => import_chunk_BW3RNEVI.useSurfaceRoot
|
|
21
|
+
ActiveParts: () => import_chunk_FBA4BB3J.ActiveParts,
|
|
22
|
+
Capabilities: () => import_chunk_FBA4BB3J.Capabilities,
|
|
23
|
+
ErrorBoundary: () => import_chunk_FBA4BB3J.ErrorBoundary,
|
|
24
|
+
Events: () => import_chunk_FBA4BB3J.Events,
|
|
25
|
+
FileInfoSchema: () => import_chunk_FBA4BB3J.FileInfoSchema,
|
|
26
|
+
INTENT_ACTION: () => import_chunk_FBA4BB3J.INTENT_ACTION,
|
|
27
|
+
INTENT_PLUGIN: () => import_chunk_FBA4BB3J.INTENT_PLUGIN,
|
|
28
|
+
IntentAction: () => import_chunk_FBA4BB3J.IntentAction,
|
|
29
|
+
IntentPlugin: () => import_chunk_FBA4BB3J.IntentPlugin,
|
|
30
|
+
IntentProvider: () => import_chunk_FBA4BB3J.IntentProvider,
|
|
31
|
+
LAYOUT_ACTION: () => import_chunk_FBA4BB3J.LAYOUT_ACTION,
|
|
32
|
+
LAYOUT_PLUGIN: () => import_chunk_FBA4BB3J.LAYOUT_PLUGIN,
|
|
33
|
+
Label: () => import_chunk_FBA4BB3J.Label,
|
|
34
|
+
Layout: () => import_chunk_FBA4BB3J.Layout,
|
|
35
|
+
LayoutAction: () => import_chunk_FBA4BB3J.LayoutAction,
|
|
36
|
+
NAVIGATION_ACTION: () => import_chunk_FBA4BB3J.NAVIGATION_ACTION,
|
|
37
|
+
NAVIGATION_PLUGIN: () => import_chunk_FBA4BB3J.NAVIGATION_PLUGIN,
|
|
38
|
+
NavigationAction: () => import_chunk_FBA4BB3J.NavigationAction,
|
|
39
|
+
Plugin: () => import_chunk_FBA4BB3J.Plugin,
|
|
40
|
+
PluginManager: () => import_chunk_FBA4BB3J.PluginManager,
|
|
41
|
+
PluginManagerProvider: () => import_chunk_FBA4BB3J.PluginManagerProvider,
|
|
42
|
+
PluginModule: () => import_chunk_FBA4BB3J.PluginModule,
|
|
43
|
+
PluginsContext: () => import_chunk_FBA4BB3J.PluginsContext,
|
|
44
|
+
Resource: () => import_chunk_FBA4BB3J.Resource,
|
|
45
|
+
ResourceKey: () => import_chunk_FBA4BB3J.ResourceKey,
|
|
46
|
+
ResourceLanguage: () => import_chunk_FBA4BB3J.ResourceLanguage,
|
|
47
|
+
SETTINGS_ACTION: () => SETTINGS_ACTION,
|
|
48
|
+
SETTINGS_PLUGIN: () => SETTINGS_PLUGIN,
|
|
49
|
+
SLUG_COLLECTION_INDICATOR: () => import_chunk_FBA4BB3J.SLUG_COLLECTION_INDICATOR,
|
|
50
|
+
SLUG_ENTRY_SEPARATOR: () => import_chunk_FBA4BB3J.SLUG_ENTRY_SEPARATOR,
|
|
51
|
+
SLUG_KEY_VALUE_SEPARATOR: () => import_chunk_FBA4BB3J.SLUG_KEY_VALUE_SEPARATOR,
|
|
52
|
+
SLUG_LIST_SEPARATOR: () => import_chunk_FBA4BB3J.SLUG_LIST_SEPARATOR,
|
|
53
|
+
SLUG_PATH_SEPARATOR: () => import_chunk_FBA4BB3J.SLUG_PATH_SEPARATOR,
|
|
54
|
+
SettingsAction: () => SettingsAction,
|
|
55
|
+
SettingsPlugin: () => SettingsPlugin,
|
|
56
|
+
Surface: () => import_chunk_FBA4BB3J.Surface,
|
|
57
|
+
Toast: () => import_chunk_FBA4BB3J.Toast,
|
|
58
|
+
allOf: () => import_chunk_FBA4BB3J.allOf,
|
|
59
|
+
chain: () => import_chunk_FBA4BB3J.chain,
|
|
60
|
+
contributes: () => import_chunk_FBA4BB3J.contributes,
|
|
61
|
+
createApp: () => import_chunk_FBA4BB3J.createApp,
|
|
62
|
+
createDispatcher: () => import_chunk_FBA4BB3J.createDispatcher,
|
|
63
|
+
createIntent: () => import_chunk_FBA4BB3J.createIntent,
|
|
64
|
+
createResolver: () => import_chunk_FBA4BB3J.createResolver,
|
|
65
|
+
createSurface: () => import_chunk_FBA4BB3J.createSurface,
|
|
66
|
+
defaultFileTypes: () => import_chunk_FBA4BB3J.defaultFileTypes,
|
|
67
|
+
defineCapability: () => import_chunk_FBA4BB3J.defineCapability,
|
|
68
|
+
defineEvent: () => import_chunk_FBA4BB3J.defineEvent,
|
|
69
|
+
defineModule: () => import_chunk_FBA4BB3J.defineModule,
|
|
70
|
+
definePlugin: () => import_chunk_FBA4BB3J.definePlugin,
|
|
71
|
+
eventKey: () => import_chunk_FBA4BB3J.eventKey,
|
|
72
|
+
firstIdInPart: () => import_chunk_FBA4BB3J.firstIdInPart,
|
|
73
|
+
getEvents: () => import_chunk_FBA4BB3J.getEvents,
|
|
74
|
+
indexInPart: () => import_chunk_FBA4BB3J.indexInPart,
|
|
75
|
+
isAllOf: () => import_chunk_FBA4BB3J.isAllOf,
|
|
76
|
+
isLayoutAdjustment: () => import_chunk_FBA4BB3J.isLayoutAdjustment,
|
|
77
|
+
isLayoutMode: () => import_chunk_FBA4BB3J.isLayoutMode,
|
|
78
|
+
isLayoutParts: () => import_chunk_FBA4BB3J.isLayoutParts,
|
|
79
|
+
isOneOf: () => import_chunk_FBA4BB3J.isOneOf,
|
|
80
|
+
isSurfaceAvailable: () => import_chunk_FBA4BB3J.isSurfaceAvailable,
|
|
81
|
+
lazy: () => import_chunk_FBA4BB3J.lazy,
|
|
82
|
+
oneOf: () => import_chunk_FBA4BB3J.oneOf,
|
|
83
|
+
openIds: () => import_chunk_FBA4BB3J.openIds,
|
|
84
|
+
partLength: () => import_chunk_FBA4BB3J.partLength,
|
|
85
|
+
useCapabilities: () => import_chunk_FBA4BB3J.useCapabilities,
|
|
86
|
+
useCapability: () => import_chunk_FBA4BB3J.useCapability,
|
|
87
|
+
useIntentDispatcher: () => import_chunk_FBA4BB3J.useIntentDispatcher,
|
|
88
|
+
useIntentResolver: () => import_chunk_FBA4BB3J.useIntentResolver,
|
|
89
|
+
usePluginManager: () => import_chunk_FBA4BB3J.usePluginManager
|
|
102
90
|
});
|
|
103
91
|
module.exports = __toCommonJS(node_exports);
|
|
104
|
-
var
|
|
105
|
-
var import_chunk_BW3RNEVI = require("./chunk-BW3RNEVI.cjs");
|
|
106
|
-
var import_chunk_QBM42OQ6 = require("./chunk-QBM42OQ6.cjs");
|
|
107
|
-
var import_chunk_FCMHRU3M = require("./chunk-FCMHRU3M.cjs");
|
|
92
|
+
var import_chunk_FBA4BB3J = require("./chunk-FBA4BB3J.cjs");
|
|
108
93
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
109
|
-
var import_schema = require("@effect/schema");
|
|
110
|
-
var import_util = require("@dxos/util");
|
|
111
|
-
var import_zod = require("zod");
|
|
112
|
-
var import_react = __toESM(require("react"));
|
|
113
94
|
var import_local_storage = require("@dxos/local-storage");
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
var import_react4 = __toESM(require("react"));
|
|
120
|
-
var import_invariant = require("@dxos/invariant");
|
|
121
|
-
var defaultFileTypes = {
|
|
122
|
-
images: [
|
|
123
|
-
"png",
|
|
124
|
-
"jpg",
|
|
125
|
-
"jpeg",
|
|
126
|
-
"gif"
|
|
127
|
-
],
|
|
128
|
-
media: [
|
|
129
|
-
"mp3",
|
|
130
|
-
"mp4",
|
|
131
|
-
"mov",
|
|
132
|
-
"avi"
|
|
133
|
-
],
|
|
134
|
-
text: [
|
|
135
|
-
"pdf",
|
|
136
|
-
"txt",
|
|
137
|
-
"md"
|
|
138
|
-
]
|
|
139
|
-
};
|
|
140
|
-
var parseFileManagerPlugin = (plugin) => {
|
|
141
|
-
return plugin.provides.file ? plugin : void 0;
|
|
142
|
-
};
|
|
143
|
-
var parseGraphPlugin = (plugin) => plugin.provides.graph?.root ? plugin : void 0;
|
|
144
|
-
var parseGraphBuilderPlugin = (plugin) => plugin.provides.graph?.builder ? plugin : void 0;
|
|
145
|
-
var parseGraphSerializerPlugin = (plugin) => plugin.provides.graph?.serializer ? plugin : void 0;
|
|
146
|
-
var Toast = import_echo_schema.S.Struct({
|
|
147
|
-
id: import_echo_schema.S.String,
|
|
148
|
-
title: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
|
|
149
|
-
description: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
|
|
150
|
-
icon: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
151
|
-
duration: import_echo_schema.S.optional(import_echo_schema.S.Number),
|
|
152
|
-
closeLabel: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
|
|
153
|
-
actionLabel: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
|
|
154
|
-
actionAlt: import_echo_schema.S.optional(import_chunk_VWHAALIN.Label),
|
|
155
|
-
// TODO(wittjosiah): Make class with customizable method?
|
|
156
|
-
onAction: import_echo_schema.S.optional(import_echo_schema.S.Any)
|
|
157
|
-
});
|
|
158
|
-
var LayoutMode = import_echo_schema.S.Union(import_echo_schema.S.Literal("deck"), import_echo_schema.S.Literal("solo"), import_echo_schema.S.Literal("fullscreen"));
|
|
159
|
-
var isLayoutMode = (value) => import_echo_schema.S.is(LayoutMode)(value);
|
|
160
|
-
var Layout = import_echo_schema.S.mutable(import_echo_schema.S.Struct({
|
|
161
|
-
layoutMode: LayoutMode,
|
|
162
|
-
sidebarOpen: import_echo_schema.S.Boolean,
|
|
163
|
-
complementarySidebarOpen: import_echo_schema.S.Boolean,
|
|
164
|
-
/**
|
|
165
|
-
* @deprecated Data to be passed to the complementary sidebar Surface.
|
|
166
|
-
*/
|
|
167
|
-
complementarySidebarContent: import_echo_schema.S.optional(import_echo_schema.S.Any),
|
|
168
|
-
dialogOpen: import_echo_schema.S.Boolean,
|
|
169
|
-
/**
|
|
170
|
-
* Data to be passed to the dialog Surface.
|
|
171
|
-
*/
|
|
172
|
-
dialogContent: import_echo_schema.S.optional(import_echo_schema.S.Any),
|
|
173
|
-
// TODO(wittjosiah): Custom properties?
|
|
174
|
-
dialogBlockAlign: import_echo_schema.S.optional(import_echo_schema.S.Literal("start", "center")),
|
|
175
|
-
dialogType: import_echo_schema.S.optional(import_echo_schema.S.Literal("default", "alert")),
|
|
176
|
-
popoverOpen: import_echo_schema.S.Boolean,
|
|
177
|
-
/**
|
|
178
|
-
* Data to be passed to the popover Surface.
|
|
179
|
-
*/
|
|
180
|
-
popoverContent: import_echo_schema.S.optional(import_echo_schema.S.Any),
|
|
181
|
-
popoverAnchorId: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
182
|
-
toasts: import_echo_schema.S.mutable(import_echo_schema.S.Array(Toast)),
|
|
183
|
-
/**
|
|
184
|
-
* The identifier of a component to scroll into view when it is mounted.
|
|
185
|
-
*/
|
|
186
|
-
scrollIntoView: import_echo_schema.S.optional(import_echo_schema.S.String)
|
|
187
|
-
}));
|
|
188
|
-
var parseLayoutPlugin = (plugin) => {
|
|
189
|
-
const success = import_echo_schema.S.is(Layout)(plugin.provides.layout);
|
|
190
|
-
return success ? plugin : void 0;
|
|
191
|
-
};
|
|
192
|
-
var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
|
|
193
|
-
var LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
|
|
194
|
-
var LayoutAction;
|
|
195
|
-
(function(LayoutAction2) {
|
|
196
|
-
class SetLayout extends import_echo_schema.S.TaggedClass()(`${LAYOUT_ACTION}/set-layout`, {
|
|
197
|
-
input: import_echo_schema.S.Struct({
|
|
198
|
-
/**
|
|
199
|
-
* Element to set the state of.
|
|
200
|
-
*/
|
|
201
|
-
element: import_echo_schema.S.Literal("fullscreen", "sidebar", "complementary", "dialog", "popover", "toast"),
|
|
202
|
-
/**
|
|
203
|
-
* Whether the element is on or off.
|
|
204
|
-
*
|
|
205
|
-
* If omitted, the element's state will be toggled or set based on other provided data.
|
|
206
|
-
* For example, if `component` is provided, the state will be set to `true`.
|
|
207
|
-
*/
|
|
208
|
-
state: import_echo_schema.S.optional(import_echo_schema.S.Boolean),
|
|
209
|
-
/**
|
|
210
|
-
* Component to render in the dialog or popover.
|
|
211
|
-
*/
|
|
212
|
-
component: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
213
|
-
/**
|
|
214
|
-
* Data to be passed to the dialog or popover Surface.
|
|
215
|
-
*/
|
|
216
|
-
subject: import_echo_schema.S.optional(import_echo_schema.S.Any),
|
|
217
|
-
/**
|
|
218
|
-
* Anchor ID for the popover.
|
|
219
|
-
*/
|
|
220
|
-
anchorId: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
221
|
-
// TODO(wittjosiah): Custom properties?
|
|
222
|
-
/**
|
|
223
|
-
* Block alignment for the dialog.
|
|
224
|
-
*/
|
|
225
|
-
dialogBlockAlign: import_echo_schema.S.optional(import_echo_schema.S.Literal("start", "center")),
|
|
226
|
-
/**
|
|
227
|
-
* Type of dialog.
|
|
228
|
-
*/
|
|
229
|
-
dialogType: import_echo_schema.S.optional(import_echo_schema.S.Literal("default", "alert"))
|
|
230
|
-
}),
|
|
231
|
-
output: import_echo_schema.S.Void
|
|
232
|
-
}) {
|
|
233
|
-
}
|
|
234
|
-
LayoutAction2.SetLayout = SetLayout;
|
|
235
|
-
class SetLayoutMode extends import_echo_schema.S.TaggedClass()(`${LAYOUT_ACTION}/set-layout-mode`, {
|
|
236
|
-
input: import_echo_schema.S.Union(import_echo_schema.S.Struct({
|
|
237
|
-
layoutMode: LayoutMode
|
|
238
|
-
}), import_echo_schema.S.Struct({
|
|
239
|
-
revert: import_echo_schema.S.Literal(true)
|
|
240
|
-
})),
|
|
241
|
-
output: import_echo_schema.S.Void
|
|
242
|
-
}) {
|
|
243
|
-
}
|
|
244
|
-
LayoutAction2.SetLayoutMode = SetLayoutMode;
|
|
245
|
-
class ScrollIntoView extends import_echo_schema.S.TaggedClass()(`${LAYOUT_ACTION}/scroll-into-view`, {
|
|
95
|
+
var SETTINGS_PLUGIN = "dxos.org/plugin/settings";
|
|
96
|
+
var SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;
|
|
97
|
+
var SettingsAction;
|
|
98
|
+
(function(SettingsAction2) {
|
|
99
|
+
class Open extends import_echo_schema.S.TaggedClass()(`${SETTINGS_ACTION}/open`, {
|
|
246
100
|
input: import_echo_schema.S.Struct({
|
|
247
|
-
|
|
248
|
-
// TODO(wittjosiah): Factor out to thread scroll into view action?
|
|
249
|
-
cursor: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
250
|
-
ref: import_echo_schema.S.optional(import_echo_schema.S.String)
|
|
101
|
+
plugin: import_echo_schema.S.optional(import_echo_schema.S.String)
|
|
251
102
|
}),
|
|
252
103
|
output: import_echo_schema.S.Void
|
|
253
104
|
}) {
|
|
254
105
|
}
|
|
255
|
-
|
|
256
|
-
})(
|
|
257
|
-
var
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
var SLUG_KEY_VALUE_SEPARATOR = "-";
|
|
266
|
-
var SLUG_PATH_SEPARATOR = "~";
|
|
267
|
-
var SLUG_COLLECTION_INDICATOR = "";
|
|
268
|
-
var LayoutEntrySchema = import_schema.Schema.mutable(import_schema.Schema.Struct({
|
|
269
|
-
id: import_schema.Schema.String,
|
|
270
|
-
path: import_schema.Schema.optional(import_schema.Schema.String)
|
|
271
|
-
}));
|
|
272
|
-
var LayoutPartSchema = import_schema.Schema.Union(import_schema.Schema.Literal("sidebar"), import_schema.Schema.Literal("main"), import_schema.Schema.Literal("solo"), import_schema.Schema.Literal("complementary"), import_schema.Schema.Literal("fullScreen"));
|
|
273
|
-
var LayoutPartsSchema = import_schema.Schema.partial(import_schema.Schema.mutable(import_schema.Schema.Record({
|
|
274
|
-
key: LayoutPartSchema,
|
|
275
|
-
value: import_schema.Schema.mutable(import_schema.Schema.Array(LayoutEntrySchema))
|
|
276
|
-
})));
|
|
277
|
-
var LayoutCoordinateSchema = import_schema.Schema.mutable(import_schema.Schema.Struct({
|
|
278
|
-
part: LayoutPartSchema,
|
|
279
|
-
entryId: import_schema.Schema.String
|
|
280
|
-
}));
|
|
281
|
-
var PartAdjustmentSchema = import_schema.Schema.Union(import_schema.Schema.Literal("increment-start"), import_schema.Schema.Literal("increment-end"), import_schema.Schema.Literal("pin-start"), import_schema.Schema.Literal("pin-end"), import_schema.Schema.Literal("close"), import_schema.Schema.Literal("solo"));
|
|
282
|
-
var LayoutAdjustmentSchema = import_schema.Schema.mutable(import_schema.Schema.Struct({
|
|
283
|
-
layoutCoordinate: LayoutCoordinateSchema,
|
|
284
|
-
type: PartAdjustmentSchema
|
|
285
|
-
}));
|
|
286
|
-
var ActiveParts = import_schema.Schema.Record({
|
|
287
|
-
key: import_schema.Schema.String,
|
|
288
|
-
value: import_schema.Schema.Union(import_schema.Schema.String, import_schema.Schema.mutable(import_schema.Schema.Array(import_schema.Schema.String)))
|
|
289
|
-
});
|
|
290
|
-
var LocationProvidesSchema = import_schema.Schema.mutable(import_schema.Schema.Struct({
|
|
291
|
-
location: import_schema.Schema.Struct({
|
|
292
|
-
active: LayoutPartsSchema,
|
|
293
|
-
closed: import_schema.Schema.Array(import_schema.Schema.String)
|
|
294
|
-
})
|
|
295
|
-
}));
|
|
296
|
-
var isLayoutParts = (value) => {
|
|
297
|
-
return import_schema.Schema.is(LayoutPartsSchema)(value);
|
|
298
|
-
};
|
|
299
|
-
var isLayoutAdjustment = (value) => {
|
|
300
|
-
return import_schema.Schema.is(LayoutAdjustmentSchema)(value);
|
|
301
|
-
};
|
|
302
|
-
var parseNavigationPlugin = (plugin) => {
|
|
303
|
-
const location = plugin.provides?.location;
|
|
304
|
-
if (!location) {
|
|
305
|
-
return void 0;
|
|
306
|
-
}
|
|
307
|
-
if (import_schema.Schema.is(LocationProvidesSchema)({
|
|
308
|
-
location
|
|
309
|
-
})) {
|
|
310
|
-
return plugin;
|
|
311
|
-
}
|
|
312
|
-
return void 0;
|
|
313
|
-
};
|
|
314
|
-
var openIds = (layout, parts) => {
|
|
315
|
-
return Object.values(parts ? (0, import_util.pick)(layout, parts) : layout).flatMap((part) => part?.map((entry) => entry.id) ?? []).filter((id) => id !== void 0);
|
|
316
|
-
};
|
|
317
|
-
var firstIdInPart = (layout, part) => {
|
|
318
|
-
if (!layout) {
|
|
319
|
-
return void 0;
|
|
320
|
-
}
|
|
321
|
-
return layout[part]?.at(0)?.id;
|
|
322
|
-
};
|
|
323
|
-
var indexInPart = (layout, layoutCoordinate) => {
|
|
324
|
-
if (!layout || !layoutCoordinate) {
|
|
325
|
-
return void 0;
|
|
326
|
-
}
|
|
327
|
-
const { part, entryId } = layoutCoordinate;
|
|
328
|
-
return layout[part]?.findIndex((entry) => entry.id === entryId);
|
|
329
|
-
};
|
|
330
|
-
var partLength = (layout, part) => {
|
|
331
|
-
if (!layout || !part) {
|
|
332
|
-
return 0;
|
|
333
|
-
}
|
|
334
|
-
return layout[part]?.length ?? 0;
|
|
335
|
-
};
|
|
336
|
-
var NAVIGATION_PLUGIN = "dxos.org/plugin/navigation";
|
|
337
|
-
var NAVIGATION_ACTION = `${NAVIGATION_PLUGIN}/action`;
|
|
338
|
-
var NavigationAction;
|
|
339
|
-
(function(NavigationAction2) {
|
|
340
|
-
class Open extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/open`, {
|
|
341
|
-
input: import_schema.Schema.Struct({
|
|
342
|
-
activeParts: ActiveParts,
|
|
343
|
-
noToggle: import_schema.Schema.optional(import_schema.Schema.Boolean)
|
|
344
|
-
}),
|
|
345
|
-
output: import_schema.Schema.Struct({
|
|
346
|
-
open: import_schema.Schema.Array(import_schema.Schema.String)
|
|
347
|
-
})
|
|
348
|
-
}) {
|
|
349
|
-
}
|
|
350
|
-
NavigationAction2.Open = Open;
|
|
351
|
-
class AddToActive extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/add-to-active`, {
|
|
352
|
-
input: import_schema.Schema.Struct({
|
|
353
|
-
id: import_schema.Schema.String,
|
|
354
|
-
part: LayoutPartSchema,
|
|
355
|
-
scrollIntoView: import_schema.Schema.optional(import_schema.Schema.Boolean),
|
|
356
|
-
pivotId: import_schema.Schema.optional(import_schema.Schema.String),
|
|
357
|
-
positioning: import_schema.Schema.optional(import_schema.Schema.Literal("start", "end"))
|
|
358
|
-
}),
|
|
359
|
-
output: import_schema.Schema.Void
|
|
360
|
-
}) {
|
|
361
|
-
}
|
|
362
|
-
NavigationAction2.AddToActive = AddToActive;
|
|
363
|
-
class Set extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/set`, {
|
|
364
|
-
input: import_schema.Schema.Struct({
|
|
365
|
-
activeParts: ActiveParts
|
|
366
|
-
}),
|
|
367
|
-
output: import_schema.Schema.Void
|
|
368
|
-
}) {
|
|
369
|
-
}
|
|
370
|
-
NavigationAction2.Set = Set;
|
|
371
|
-
class Close extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/close`, {
|
|
372
|
-
input: import_schema.Schema.Struct({
|
|
373
|
-
activeParts: ActiveParts,
|
|
374
|
-
noToggle: import_schema.Schema.optional(import_schema.Schema.Boolean)
|
|
375
|
-
}),
|
|
376
|
-
output: import_schema.Schema.Void
|
|
377
|
-
}) {
|
|
378
|
-
}
|
|
379
|
-
NavigationAction2.Close = Close;
|
|
380
|
-
class Adjust extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/adjust`, {
|
|
381
|
-
input: LayoutAdjustmentSchema,
|
|
382
|
-
output: import_schema.Schema.Void
|
|
383
|
-
}) {
|
|
384
|
-
}
|
|
385
|
-
NavigationAction2.Adjust = Adjust;
|
|
386
|
-
class Expose extends import_schema.Schema.TaggedClass()(`${NAVIGATION_ACTION}/expose`, {
|
|
387
|
-
input: import_schema.Schema.Struct({
|
|
388
|
-
id: import_schema.Schema.String
|
|
389
|
-
}),
|
|
390
|
-
output: import_schema.Schema.Void
|
|
391
|
-
}) {
|
|
392
|
-
}
|
|
393
|
-
NavigationAction2.Expose = Expose;
|
|
394
|
-
})(NavigationAction || (NavigationAction = {}));
|
|
395
|
-
var ResourceKey = import_zod.z.union([
|
|
396
|
-
import_zod.z.string(),
|
|
397
|
-
import_zod.z.record(import_zod.z.any())
|
|
398
|
-
]);
|
|
399
|
-
var ResourceLanguage = import_zod.z.record(ResourceKey);
|
|
400
|
-
var Resource = import_zod.z.record(ResourceLanguage);
|
|
401
|
-
var parseTranslationsPlugin = (plugin) => {
|
|
402
|
-
const { success } = import_zod.z.array(Resource).safeParse(plugin.provides.translations);
|
|
403
|
-
return success ? plugin : void 0;
|
|
404
|
-
};
|
|
405
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/plugins/plugin-host/PluginContainer.tsx";
|
|
406
|
-
var PluginContainer = ({ plugins: definitions, core, state, placeholder }) => {
|
|
407
|
-
const [error, setError] = (0, import_react2.useState)();
|
|
408
|
-
(0, import_react2.useEffect)(() => {
|
|
409
|
-
(0, import_log.log)("initializing plugins", {
|
|
410
|
-
enabled: state.enabled
|
|
411
|
-
}, {
|
|
412
|
-
F: __dxlog_file,
|
|
413
|
-
L: 26,
|
|
414
|
-
S: void 0,
|
|
415
|
-
C: (f, a) => f(...a)
|
|
416
|
-
});
|
|
417
|
-
const t = setTimeout(async () => {
|
|
418
|
-
try {
|
|
419
|
-
const enabledIds = [
|
|
420
|
-
...core,
|
|
421
|
-
...state.enabled
|
|
422
|
-
];
|
|
423
|
-
const enabled = await Promise.all(enabledIds.map((id) => definitions[id]).filter((definition) => Boolean(definition)).map((definition) => definition()));
|
|
424
|
-
const plugins = await Promise.all(enabled.map(async (definition) => {
|
|
425
|
-
const plugin = await initializePlugin(definition).catch((err) => {
|
|
426
|
-
import_log.log.error("Failed to initialize plugin:", {
|
|
427
|
-
id: definition.meta.id,
|
|
428
|
-
err
|
|
429
|
-
}, {
|
|
430
|
-
F: __dxlog_file,
|
|
431
|
-
L: 41,
|
|
432
|
-
S: void 0,
|
|
433
|
-
C: (f, a) => f(...a)
|
|
434
|
-
});
|
|
435
|
-
});
|
|
436
|
-
(0, import_log.log)("initialized", {
|
|
437
|
-
plugin: definition.meta.id
|
|
438
|
-
}, {
|
|
439
|
-
F: __dxlog_file,
|
|
440
|
-
L: 44,
|
|
441
|
-
S: void 0,
|
|
442
|
-
C: (f, a) => f(...a)
|
|
443
|
-
});
|
|
444
|
-
return plugin;
|
|
445
|
-
}));
|
|
446
|
-
const initialized = plugins.filter((plugin) => Boolean(plugin));
|
|
447
|
-
(0, import_log.log)("plugins initialized", {
|
|
448
|
-
plugins: initialized
|
|
449
|
-
}, {
|
|
450
|
-
F: __dxlog_file,
|
|
451
|
-
L: 50,
|
|
452
|
-
S: void 0,
|
|
453
|
-
C: (f, a) => f(...a)
|
|
454
|
-
});
|
|
455
|
-
await Promise.all(enabled.map((plugin) => plugin.ready?.({
|
|
456
|
-
plugins: initialized
|
|
457
|
-
})));
|
|
458
|
-
(0, import_log.log)("plugins ready", {
|
|
459
|
-
plugins: initialized
|
|
460
|
-
}, {
|
|
461
|
-
F: __dxlog_file,
|
|
462
|
-
L: 53,
|
|
463
|
-
S: void 0,
|
|
464
|
-
C: (f, a) => f(...a)
|
|
465
|
-
});
|
|
466
|
-
state.plugins = initialized;
|
|
467
|
-
state.ready = true;
|
|
468
|
-
} catch (err) {
|
|
469
|
-
setError(err);
|
|
470
|
-
}
|
|
471
|
-
});
|
|
472
|
-
return () => {
|
|
473
|
-
clearTimeout(t);
|
|
474
|
-
state.ready = false;
|
|
475
|
-
};
|
|
476
|
-
}, []);
|
|
477
|
-
if (error) {
|
|
478
|
-
throw error;
|
|
479
|
-
}
|
|
480
|
-
if (!state.ready) {
|
|
481
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, placeholder);
|
|
482
|
-
}
|
|
483
|
-
const ComposedContext = composeContext(state.plugins);
|
|
484
|
-
return /* @__PURE__ */ import_react2.default.createElement(ComposedContext, null, rootComponents(state.plugins));
|
|
485
|
-
};
|
|
486
|
-
var initializePlugin = async (pluginDefinition) => {
|
|
487
|
-
const provides = await pluginDefinition.initialize?.();
|
|
488
|
-
return {
|
|
489
|
-
...pluginDefinition,
|
|
490
|
-
provides: {
|
|
491
|
-
...pluginDefinition.provides,
|
|
492
|
-
...provides
|
|
493
|
-
}
|
|
494
|
-
};
|
|
495
|
-
};
|
|
496
|
-
var rootComponents = (plugins) => {
|
|
497
|
-
return plugins.map((plugin) => {
|
|
498
|
-
const Component = plugin.provides.root;
|
|
499
|
-
if (Component) {
|
|
500
|
-
return /* @__PURE__ */ import_react2.default.createElement(Component, {
|
|
501
|
-
key: plugin.meta.id
|
|
502
|
-
});
|
|
503
|
-
} else {
|
|
504
|
-
return null;
|
|
505
|
-
}
|
|
506
|
-
}).filter((node) => Boolean(node));
|
|
507
|
-
};
|
|
508
|
-
var composeContext = (plugins) => {
|
|
509
|
-
return compose(plugins.map((p) => p.provides.context).filter(Boolean));
|
|
510
|
-
};
|
|
511
|
-
var compose = (contexts) => {
|
|
512
|
-
return [
|
|
513
|
-
...contexts
|
|
514
|
-
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ import_react2.default.createElement(Acc, null, /* @__PURE__ */ import_react2.default.createElement(Next, null, children)));
|
|
515
|
-
};
|
|
516
|
-
var PluginContext = /* @__PURE__ */ (0, import_react3.createContext)(void 0);
|
|
517
|
-
var usePlugins = () => (0, import_react3.useContext)(PluginContext) ?? (0, import_debug.raise)(new Error("Missing PluginContext"));
|
|
518
|
-
var usePlugin = (id) => {
|
|
519
|
-
const { plugins } = usePlugins();
|
|
520
|
-
return (0, import_chunk_QBM42OQ6.findPlugin)(plugins, id);
|
|
521
|
-
};
|
|
522
|
-
var useResolvePlugin = (predicate) => {
|
|
523
|
-
const { plugins } = usePlugins();
|
|
524
|
-
return (0, import_chunk_QBM42OQ6.resolvePlugin)(plugins, predicate);
|
|
525
|
-
};
|
|
526
|
-
var useResolvePlugins = (predicate) => {
|
|
527
|
-
const { plugins } = usePlugins();
|
|
528
|
-
return (0, import_react3.useMemo)(() => plugins.map(predicate).filter(import_util2.nonNullable), [
|
|
529
|
-
plugins,
|
|
530
|
-
predicate
|
|
531
|
-
]);
|
|
532
|
-
};
|
|
533
|
-
var PluginProvider = PluginContext.Provider;
|
|
534
|
-
var HOST_PLUGIN = "dxos.org/plugin/host";
|
|
535
|
-
var HostPlugin = ({ plugins, meta, core, defaults = [], fallback = DefaultFallback, placeholder = null }) => {
|
|
536
|
-
const state = new import_local_storage.LocalStorageStore(HOST_PLUGIN, {
|
|
537
|
-
ready: false,
|
|
538
|
-
core,
|
|
539
|
-
enabled: [
|
|
540
|
-
...defaults
|
|
541
|
-
],
|
|
542
|
-
plugins: [],
|
|
543
|
-
available: meta.filter(({ id }) => !core.includes(id)),
|
|
544
|
-
// TODO(burdon): Functions should not be part of the settings type.
|
|
545
|
-
setPlugin: (id, enabled) => {
|
|
546
|
-
if (enabled) {
|
|
547
|
-
state.values.enabled.push(id);
|
|
548
|
-
} else {
|
|
549
|
-
const index = state.values.enabled.findIndex((enabled2) => enabled2 === id);
|
|
550
|
-
index !== -1 && state.values.enabled.splice(index, 1);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
});
|
|
554
|
-
state.prop({
|
|
555
|
-
key: "enabled",
|
|
556
|
-
type: import_local_storage.LocalStorageStore.json()
|
|
557
|
-
});
|
|
558
|
-
return {
|
|
559
|
-
meta: {
|
|
560
|
-
id: HOST_PLUGIN,
|
|
561
|
-
name: "Plugin host"
|
|
562
|
-
},
|
|
563
|
-
provides: {
|
|
564
|
-
context: ({ children }) => {
|
|
565
|
-
return /* @__PURE__ */ import_react.default.createElement(PluginProvider, {
|
|
566
|
-
value: state.values
|
|
567
|
-
}, children);
|
|
568
|
-
},
|
|
569
|
-
root: () => {
|
|
570
|
-
return /* @__PURE__ */ import_react.default.createElement(import_chunk_BW3RNEVI.ErrorBoundary, {
|
|
571
|
-
fallback
|
|
572
|
-
}, /* @__PURE__ */ import_react.default.createElement(PluginContainer, {
|
|
573
|
-
plugins,
|
|
574
|
-
core,
|
|
575
|
-
state: state.values,
|
|
576
|
-
placeholder
|
|
577
|
-
}));
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
};
|
|
581
|
-
};
|
|
582
|
-
var DefaultFallback = ({ error }) => {
|
|
583
|
-
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
584
|
-
style: {
|
|
585
|
-
padding: "1rem"
|
|
586
|
-
}
|
|
587
|
-
}, /* @__PURE__ */ import_react.default.createElement("h1", {
|
|
588
|
-
style: {
|
|
589
|
-
fontSize: "1.2rem",
|
|
590
|
-
fontWeight: 700,
|
|
591
|
-
margin: "0.5rem 0"
|
|
592
|
-
}
|
|
593
|
-
}, error.message), /* @__PURE__ */ import_react.default.createElement("pre", null, error.stack));
|
|
594
|
-
};
|
|
595
|
-
var Plugin;
|
|
596
|
-
(function(Plugin2) {
|
|
597
|
-
Plugin2.lazy = (p, props) => {
|
|
598
|
-
return () => p().then(({ default: definition }) => {
|
|
599
|
-
return definition(props);
|
|
600
|
-
});
|
|
601
|
-
};
|
|
602
|
-
})(Plugin || (Plugin = {}));
|
|
603
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
|
|
604
|
-
var createApp = ({ meta, plugins, core, ...params }) => {
|
|
605
|
-
const hostPlugin = HostPlugin({
|
|
606
|
-
plugins: {
|
|
607
|
-
...plugins,
|
|
608
|
-
[import_chunk_VWHAALIN.meta_default.id]: Plugin.lazy(() => import("./plugin-intent-F3TQZIUR.cjs")),
|
|
609
|
-
[import_chunk_FCMHRU3M.meta_default.id]: Plugin.lazy(() => import("./plugin-settings-W6UHMH5M.cjs")),
|
|
610
|
-
[import_chunk_BW3RNEVI.meta_default.id]: Plugin.lazy(() => import("./plugin-surface-CCSIONYW.cjs"))
|
|
611
|
-
},
|
|
612
|
-
meta: [
|
|
613
|
-
import_chunk_VWHAALIN.meta_default,
|
|
614
|
-
import_chunk_FCMHRU3M.meta_default,
|
|
615
|
-
import_chunk_BW3RNEVI.meta_default,
|
|
616
|
-
...meta
|
|
106
|
+
SettingsAction2.Open = Open;
|
|
107
|
+
})(SettingsAction || (SettingsAction = {}));
|
|
108
|
+
var SettingsPlugin = () => (0, import_chunk_FBA4BB3J.definePlugin)({
|
|
109
|
+
id: SETTINGS_PLUGIN
|
|
110
|
+
}, [
|
|
111
|
+
(0, import_chunk_FBA4BB3J.defineModule)({
|
|
112
|
+
id: `${SETTINGS_PLUGIN}/module/store`,
|
|
113
|
+
activatesOn: import_chunk_FBA4BB3J.Events.Startup,
|
|
114
|
+
activatesBefore: [
|
|
115
|
+
import_chunk_FBA4BB3J.Events.SetupSettings
|
|
617
116
|
],
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
import_chunk_FCMHRU3M.meta_default.id,
|
|
621
|
-
import_chunk_BW3RNEVI.meta_default.id,
|
|
622
|
-
...core
|
|
117
|
+
activatesAfter: [
|
|
118
|
+
import_chunk_FBA4BB3J.Events.SettingsReady
|
|
623
119
|
],
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
});
|
|
635
|
-
const { context: Context, root: Root } = hostPlugin.provides;
|
|
636
|
-
(0, import_invariant.invariant)(Context, void 0, {
|
|
637
|
-
F: __dxlog_file2,
|
|
638
|
-
L: 55,
|
|
639
|
-
S: void 0,
|
|
640
|
-
A: [
|
|
641
|
-
"Context",
|
|
642
|
-
""
|
|
643
|
-
]
|
|
644
|
-
});
|
|
645
|
-
(0, import_invariant.invariant)(Root, void 0, {
|
|
646
|
-
F: __dxlog_file2,
|
|
647
|
-
L: 56,
|
|
648
|
-
S: void 0,
|
|
649
|
-
A: [
|
|
650
|
-
"Root",
|
|
651
|
-
""
|
|
652
|
-
]
|
|
653
|
-
});
|
|
654
|
-
return () => /* @__PURE__ */ import_react4.default.createElement(Context, null, /* @__PURE__ */ import_react4.default.createElement(Root, null));
|
|
655
|
-
};
|
|
120
|
+
activate: (context) => {
|
|
121
|
+
const allSettings = context.requestCapabilities(import_chunk_FBA4BB3J.Capabilities.Settings);
|
|
122
|
+
const settingsStore = new import_local_storage.RootSettingsStore();
|
|
123
|
+
allSettings.forEach((setting) => {
|
|
124
|
+
settingsStore.createStore(setting);
|
|
125
|
+
});
|
|
126
|
+
return (0, import_chunk_FBA4BB3J.contributes)(import_chunk_FBA4BB3J.Capabilities.SettingsStore, settingsStore);
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
]);
|
|
656
130
|
// Annotate the CommonJS export names for ESM import in node:
|
|
657
131
|
0 && (module.exports = {
|
|
658
132
|
ActiveParts,
|
|
133
|
+
Capabilities,
|
|
659
134
|
ErrorBoundary,
|
|
660
|
-
|
|
135
|
+
Events,
|
|
136
|
+
FileInfoSchema,
|
|
661
137
|
INTENT_ACTION,
|
|
138
|
+
INTENT_PLUGIN,
|
|
662
139
|
IntentAction,
|
|
140
|
+
IntentPlugin,
|
|
663
141
|
IntentProvider,
|
|
664
142
|
LAYOUT_ACTION,
|
|
665
143
|
LAYOUT_PLUGIN,
|
|
@@ -670,7 +148,10 @@ var createApp = ({ meta, plugins, core, ...params }) => {
|
|
|
670
148
|
NAVIGATION_PLUGIN,
|
|
671
149
|
NavigationAction,
|
|
672
150
|
Plugin,
|
|
673
|
-
|
|
151
|
+
PluginManager,
|
|
152
|
+
PluginManagerProvider,
|
|
153
|
+
PluginModule,
|
|
154
|
+
PluginsContext,
|
|
674
155
|
Resource,
|
|
675
156
|
ResourceKey,
|
|
676
157
|
ResourceLanguage,
|
|
@@ -682,49 +163,40 @@ var createApp = ({ meta, plugins, core, ...params }) => {
|
|
|
682
163
|
SLUG_LIST_SEPARATOR,
|
|
683
164
|
SLUG_PATH_SEPARATOR,
|
|
684
165
|
SettingsAction,
|
|
166
|
+
SettingsPlugin,
|
|
685
167
|
Surface,
|
|
686
|
-
SurfaceProvider,
|
|
687
168
|
Toast,
|
|
169
|
+
allOf,
|
|
688
170
|
chain,
|
|
171
|
+
contributes,
|
|
689
172
|
createApp,
|
|
690
173
|
createDispatcher,
|
|
691
174
|
createIntent,
|
|
692
175
|
createResolver,
|
|
693
176
|
createSurface,
|
|
694
177
|
defaultFileTypes,
|
|
178
|
+
defineCapability,
|
|
179
|
+
defineEvent,
|
|
180
|
+
defineModule,
|
|
695
181
|
definePlugin,
|
|
696
|
-
|
|
697
|
-
findPlugin,
|
|
182
|
+
eventKey,
|
|
698
183
|
firstIdInPart,
|
|
699
|
-
|
|
184
|
+
getEvents,
|
|
700
185
|
indexInPart,
|
|
186
|
+
isAllOf,
|
|
701
187
|
isLayoutAdjustment,
|
|
702
188
|
isLayoutMode,
|
|
703
189
|
isLayoutParts,
|
|
704
|
-
|
|
190
|
+
isOneOf,
|
|
191
|
+
isSurfaceAvailable,
|
|
192
|
+
lazy,
|
|
193
|
+
oneOf,
|
|
705
194
|
openIds,
|
|
706
|
-
parseFileManagerPlugin,
|
|
707
|
-
parseGraphBuilderPlugin,
|
|
708
|
-
parseGraphPlugin,
|
|
709
|
-
parseGraphSerializerPlugin,
|
|
710
|
-
parseIntentPlugin,
|
|
711
|
-
parseIntentResolverPlugin,
|
|
712
|
-
parseLayoutPlugin,
|
|
713
|
-
parseMetadataRecordsPlugin,
|
|
714
|
-
parseMetadataResolverPlugin,
|
|
715
|
-
parseNavigationPlugin,
|
|
716
|
-
parseRootSurfacePlugin,
|
|
717
|
-
parseSettingsPlugin,
|
|
718
|
-
parseSurfacePlugin,
|
|
719
|
-
parseTranslationsPlugin,
|
|
720
195
|
partLength,
|
|
721
|
-
|
|
196
|
+
useCapabilities,
|
|
197
|
+
useCapability,
|
|
722
198
|
useIntentDispatcher,
|
|
723
199
|
useIntentResolver,
|
|
724
|
-
|
|
725
|
-
usePlugins,
|
|
726
|
-
useResolvePlugin,
|
|
727
|
-
useResolvePlugins,
|
|
728
|
-
useSurfaceRoot
|
|
200
|
+
usePluginManager
|
|
729
201
|
});
|
|
730
202
|
//# sourceMappingURL=index.cjs.map
|