@dxos/app-framework 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs +137 -0
- package/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs.map +7 -0
- package/dist/lib/browser/chunk-ATRNTMSS.mjs +1399 -0
- package/dist/lib/browser/chunk-ATRNTMSS.mjs.map +7 -0
- package/dist/lib/browser/chunk-LDJ3T4V3.mjs +32 -0
- package/dist/lib/browser/chunk-LDJ3T4V3.mjs.map +7 -0
- package/dist/lib/browser/chunk-WS6SU6HI.mjs +285 -0
- package/dist/lib/browser/chunk-WS6SU6HI.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +119 -642
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-dispatcher-E6J7E5Y5.mjs +11 -0
- package/dist/lib/browser/intent-resolver-XLE4L3LS.mjs +38 -0
- package/dist/lib/browser/intent-resolver-XLE4L3LS.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/store-QU2IKFAI.mjs +19 -0
- package/dist/lib/browser/store-QU2IKFAI.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +74 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/browser/worker.mjs +77 -0
- package/dist/lib/node/app-graph-builder-JGBADFF7.cjs +146 -0
- package/dist/lib/node/app-graph-builder-JGBADFF7.cjs.map +7 -0
- package/dist/lib/node/{chunk-FCMHRU3M.cjs → chunk-QLVQ6PND.cjs} +23 -35
- package/dist/lib/node/chunk-QLVQ6PND.cjs.map +7 -0
- package/dist/lib/node/chunk-WKC6YMEQ.cjs +1433 -0
- package/dist/lib/node/chunk-WKC6YMEQ.cjs.map +7 -0
- package/dist/lib/node/chunk-WRWRZKZU.cjs +308 -0
- package/dist/lib/node/chunk-WRWRZKZU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +125 -665
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{plugin-settings-W6UHMH5M.cjs → intent-dispatcher-CFBKDZQR.cjs} +10 -14
- package/dist/lib/node/intent-dispatcher-CFBKDZQR.cjs.map +7 -0
- package/dist/lib/node/intent-resolver-3TKCXP4S.cjs +45 -0
- package/dist/lib/node/intent-resolver-3TKCXP4S.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/store-4QMUUU2A.cjs +34 -0
- package/dist/lib/node/store-4QMUUU2A.cjs.map +7 -0
- package/dist/lib/node/testing/index.cjs +98 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node/worker.cjs +99 -0
- package/dist/lib/node/worker.cjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-2QEX57NX.mjs +138 -0
- package/dist/lib/node-esm/app-graph-builder-2QEX57NX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-44J2VZBB.mjs +1401 -0
- package/dist/lib/node-esm/chunk-44J2VZBB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CNJYZNSL.mjs +34 -0
- package/dist/lib/node-esm/chunk-CNJYZNSL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HTLXL32I.mjs +286 -0
- package/dist/lib/node-esm/chunk-HTLXL32I.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +119 -642
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-dispatcher-LDQGDZ62.mjs +12 -0
- package/dist/lib/node-esm/intent-resolver-7VJWN67U.mjs +39 -0
- package/dist/lib/node-esm/intent-resolver-7VJWN67U.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/store-VWDAYUQY.mjs +20 -0
- package/dist/lib/node-esm/store-VWDAYUQY.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +75 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/lib/node-esm/worker.mjs +78 -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 +293 -0
- package/dist/types/src/common/capabilities.d.ts.map +1 -0
- package/dist/types/src/common/events.d.ts +48 -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/common/index.d.ts +8 -0
- package/dist/types/src/common/index.d.ts.map +1 -0
- package/dist/types/src/common/layout.d.ts +248 -0
- package/dist/types/src/common/layout.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/common/translations.d.ts +11 -0
- package/dist/types/src/common/translations.d.ts.map +1 -0
- package/dist/types/src/core/capabilities.d.ts +94 -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 +119 -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 +97 -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 +7 -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/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 +5 -0
- package/dist/types/src/plugin-intent/index.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +113 -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.map +1 -0
- package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent.d.ts +8 -28
- 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 +27 -0
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +197 -0
- package/dist/types/src/plugin-settings/app-graph-builder.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/plugin-settings/intent-resolver.d.ts +4 -0
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/store.d.ts +5 -0
- package/dist/types/src/plugin-settings/store.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/translations.d.ts +11 -0
- package/dist/types/src/plugin-settings/translations.d.ts.map +1 -0
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
- package/dist/types/src/{plugins/plugin-intent → react}/IntentContext.d.ts +2 -2
- package/dist/types/src/react/IntentContext.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/Surface.stories.d.ts +16 -0
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -0
- package/dist/types/src/react/common.d.ts +12 -0
- package/dist/types/src/react/common.d.ts.map +1 -0
- package/dist/types/src/react/index.d.ts +7 -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/react/useIntentResolver.d.ts +3 -0
- package/dist/types/src/react/useIntentResolver.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/src/worker.d.ts +4 -0
- package/dist/types/src/worker.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -18
- package/project.json +4 -3
- package/src/App.tsx +139 -34
- package/src/common/capabilities.ts +91 -0
- package/src/common/events.ts +72 -0
- package/src/common/file.ts +22 -0
- package/src/common/graph.ts +30 -0
- package/src/{plugins/common → common}/index.ts +3 -2
- package/src/common/layout.ts +225 -0
- package/src/{plugins/plugin-surface/SurfaceContext.ts → common/surface.ts} +6 -37
- package/src/common/translations.ts +17 -0
- package/src/core/capabilities.test.ts +116 -0
- package/src/core/capabilities.ts +222 -0
- package/src/core/events.ts +58 -0
- package/src/core/index.ts +8 -0
- package/src/core/manager.test.ts +516 -0
- package/src/core/manager.ts +511 -0
- package/src/core/plugin.ts +131 -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 +48 -0
- package/src/playground/generator/index.ts +6 -0
- package/src/playground/generator/plugin.ts +23 -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 +29 -0
- package/src/playground/logger/index.ts +5 -0
- package/src/playground/logger/plugin.ts +36 -0
- package/src/playground/logger/schema.ts +12 -0
- package/src/playground/playground.stories.tsx +34 -0
- package/src/plugin-intent/IntentPlugin.tsx +20 -0
- package/src/plugin-intent/actions.ts +22 -0
- package/src/plugin-intent/errors.ts +39 -0
- package/src/plugin-intent/index.ts +8 -0
- package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.ts +83 -63
- package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.ts +114 -95
- package/src/{plugins/plugin-intent → plugin-intent}/intent.ts +10 -26
- package/src/plugin-settings/SettingsPlugin.ts +35 -0
- package/src/plugin-settings/actions.ts +27 -0
- package/src/plugin-settings/app-graph-builder.ts +122 -0
- package/src/plugin-settings/index.ts +6 -0
- package/src/plugin-settings/intent-resolver.ts +28 -0
- package/src/plugin-settings/store.ts +20 -0
- package/src/plugin-settings/translations.ts +17 -0
- package/src/{plugins/plugin-intent → react}/IntentContext.tsx +13 -5
- package/src/react/PluginManagerProvider.ts +22 -0
- package/src/react/Surface.stories.tsx +96 -0
- package/src/react/Surface.tsx +75 -0
- package/src/react/common.ts +12 -0
- package/src/react/index.ts +10 -0
- package/src/react/useCapabilities.ts +39 -0
- package/src/react/useIntentResolver.ts +22 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/withPluginManager.stories.tsx +47 -0
- package/src/testing/withPluginManager.tsx +75 -0
- package/src/worker.ts +11 -0
- package/tsconfig.json +16 -4
- 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-settings-5U2L2NRU.mjs +0 -15
- package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs +0 -24
- 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.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.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-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 +0 -7
- package/dist/types/src/plugins/common/index.d.ts.map +0 -1
- package/dist/types/src/plugins/common/layout.d.ts +0 -176
- 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 +0 -243
- package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
- package/dist/types/src/plugins/common/translations.d.ts +0 -22
- 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 +0 -107
- 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 +0 -26
- 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/layout.ts +0 -173
- package/src/plugins/common/metadata.ts +0 -29
- package/src/plugins/common/navigation.ts +0 -214
- 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/index.ts +0 -13
- 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/lib/browser/{plugin-intent-T7Y3MJ5C.mjs.map → intent-dispatcher-E6J7E5Y5.mjs.map} +0 -0
- /package/dist/lib/browser/{plugin-settings-5U2L2NRU.mjs.map → worker.mjs.map} +0 -0
- /package/dist/lib/{browser/plugin-surface-OKPF3EQI.mjs.map → node-esm/intent-dispatcher-LDQGDZ62.mjs.map} +0 -0
- /package/dist/lib/node-esm/{plugin-intent-W2HQC6LC.mjs.map → worker.mjs.map} +0 -0
- /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
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import { type MaybePromise } from '@dxos/util';
|
|
3
|
-
import { type AnyIntentChain, type IntentChain, type IntentData, type IntentParams, type IntentResultData, type IntentSchema, type Label } from './intent';
|
|
4
|
-
/**
|
|
5
|
-
* The return value of an intent effect.
|
|
6
|
-
*/
|
|
7
|
-
export type IntentEffectResult<Fields extends IntentParams> = {
|
|
8
|
-
/**
|
|
9
|
-
* The output of the action that was performed.
|
|
10
|
-
*
|
|
11
|
-
* If the intent is apart of a chain of intents, the data will be passed to the next intent.
|
|
12
|
-
*/
|
|
13
|
-
data?: IntentResultData<Fields>;
|
|
14
|
-
/**
|
|
15
|
-
* If provided, the action will be undoable.
|
|
16
|
-
*/
|
|
17
|
-
undoable?: {
|
|
18
|
-
/**
|
|
19
|
-
* Message to display to the user when indicating that the action can be undone.
|
|
20
|
-
*/
|
|
21
|
-
message: Label;
|
|
22
|
-
/**
|
|
23
|
-
* Will be merged with the original intent data when firing the undo intent.
|
|
24
|
-
*/
|
|
25
|
-
data?: Partial<IntentData<Fields>>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* An error that occurred while performing the action.
|
|
29
|
-
*
|
|
30
|
-
* If the intent is apart of a chain of intents and an error occurs, the chain will be aborted.
|
|
31
|
-
*/
|
|
32
|
-
error?: Error;
|
|
33
|
-
/**
|
|
34
|
-
* Other intent chains to be triggered.
|
|
35
|
-
*/
|
|
36
|
-
intents?: AnyIntentChain[];
|
|
37
|
-
};
|
|
38
|
-
export type AnyIntentEffectResult = IntentEffectResult<any>;
|
|
39
|
-
/**
|
|
40
|
-
* The result of an intent dispatcher.
|
|
41
|
-
*/
|
|
42
|
-
export type IntentDispatcherResult<Fields extends IntentParams> = Pick<IntentEffectResult<Fields>, 'data' | 'error'>;
|
|
43
|
-
/**
|
|
44
|
-
* Determines the priority of the effect when multiple intent resolvers are matched.
|
|
45
|
-
*
|
|
46
|
-
* - `static` - The effect is selected in the order it was resolved.
|
|
47
|
-
* - `hoist` - The effect is selected before `static` effects.
|
|
48
|
-
* - `fallback` - The effect is selected after `static` effects.
|
|
49
|
-
*/
|
|
50
|
-
export type IntentDisposition = 'static' | 'hoist' | 'fallback';
|
|
51
|
-
/**
|
|
52
|
-
* The implementation of an intent effect.
|
|
53
|
-
*/
|
|
54
|
-
export type IntentEffectDefinition<Fields extends IntentParams> = (data: IntentData<Fields>, undo: boolean) => MaybePromise<IntentEffectResult<Fields> | void> | Effect.Effect<IntentEffectResult<Fields> | void>;
|
|
55
|
-
/**
|
|
56
|
-
* Intent resolver to match intents to their effects.
|
|
57
|
-
*/
|
|
58
|
-
export type IntentResolver<Tag extends string, Fields extends IntentParams> = {
|
|
59
|
-
action: Tag;
|
|
60
|
-
disposition?: IntentDisposition;
|
|
61
|
-
filter?: (data: IntentData<Fields>) => boolean;
|
|
62
|
-
effect: IntentEffectDefinition<Fields>;
|
|
63
|
-
};
|
|
64
|
-
export type AnyIntentResolver = IntentResolver<any, any>;
|
|
65
|
-
/**
|
|
66
|
-
* Creates an intent resolver to match intents to their effects.
|
|
67
|
-
* @param schema Schema of the intent. Must be a tagged class with input and output schemas.
|
|
68
|
-
* @param effect Effect to be performed when the intent is resolved.
|
|
69
|
-
* @param params.disposition Determines the priority of the resolver when multiple are resolved.
|
|
70
|
-
* @param params.filter Optional filter to determine if the resolver should be used.
|
|
71
|
-
*/
|
|
72
|
-
export declare const createResolver: <Tag extends string, Fields extends IntentParams>(schema: IntentSchema<Tag, Fields>, effect: IntentEffectDefinition<Fields>, params?: Pick<IntentResolver<Tag, Fields>, "disposition" | "filter">) => IntentResolver<Tag, Fields>;
|
|
73
|
-
/**
|
|
74
|
-
* Invokes intents and returns the result.
|
|
75
|
-
*/
|
|
76
|
-
export type PromiseIntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>) => Promise<IntentDispatcherResult<Fields>>;
|
|
77
|
-
/**
|
|
78
|
-
* Creates an effect for intents.
|
|
79
|
-
*/
|
|
80
|
-
export type IntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>, depth?: number) => Effect.Effect<IntentDispatcherResult<Fields>, Error>;
|
|
81
|
-
/**
|
|
82
|
-
* Invokes the most recent undoable intent with undo flags.
|
|
83
|
-
*/
|
|
84
|
-
export type PromiseIntentUndo = () => Promise<IntentDispatcherResult<any> | undefined>;
|
|
85
|
-
/**
|
|
86
|
-
* Creates an effect which undoes the last intent.
|
|
87
|
-
*/
|
|
88
|
-
export type IntentUndo = () => Effect.Effect<IntentDispatcherResult<any> | undefined, Error>;
|
|
89
|
-
export type IntentContext = {
|
|
90
|
-
dispatch: IntentDispatcher;
|
|
91
|
-
dispatchPromise: PromiseIntentDispatcher;
|
|
92
|
-
undo: IntentUndo;
|
|
93
|
-
undoPromise: PromiseIntentUndo;
|
|
94
|
-
registerResolver: (id: string, resolver: AnyIntentResolver) => () => void;
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Sets of an intent dispatcher.
|
|
98
|
-
*
|
|
99
|
-
* @param resolvers An array of available intent resolvers.
|
|
100
|
-
* @param params.historyLimit The maximum number of intent results to keep in history.
|
|
101
|
-
* @param params.executionLimit The maximum recursion depth of intent chains.
|
|
102
|
-
*/
|
|
103
|
-
export declare const createDispatcher: (resolvers: Record<string, AnyIntentResolver[]>, { executionLimit, historyLimit }?: {
|
|
104
|
-
executionLimit?: number | undefined;
|
|
105
|
-
historyLimit?: number | undefined;
|
|
106
|
-
}) => IntentContext;
|
|
107
|
-
//# sourceMappingURL=intent-dispatcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-dispatcher.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/intent-dispatcher.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAO,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,KAAK,YAAY,EAAQ,MAAM,YAAY,CAAC;AAErD,OAAO,EAIL,KAAK,cAAc,EAEnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,KAAK,EACX,MAAM,UAAU,CAAC;AAKlB;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,YAAY,IAAI;IAC5D;;;;OAIG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC;QAEf;;WAEG;QACH,IAAI,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;KACpC,CAAC;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7C,aA+GF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-dispatcher.test.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/intent-dispatcher.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/intent.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAItC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,MAAM,SAAS,YAAY,IAChD,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAA;CAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;AAEnH,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,YAAY,IACtD,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAA;CAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAErH,MAAM,MAAM,YAAY,CAAC,GAAG,SAAS,MAAM,EAAE,MAAM,SAAS,YAAY,IAAI,CAAC,CAAC,WAAW,CAAC,GAAG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,SAAS,MAAM,EACvB,OAAO,SAAS,MAAM,EACtB,WAAW,SAAS,YAAY,EAChC,UAAU,SAAS,YAAY,EAC/B,UAAU,SAAS,YAAY,UAEvB,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,SACnC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC,WAC9D,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,cAGlC,WAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,KAC1D,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAexD,CAAC;AAQJ,eAAO,MAAM,KAAK;;;QAGjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;AAEhD,eAAO,MAAM,aAAa,kCAA4B,CAAC;AAEvD,yBAAiB,YAAY,CAAC;;;;;;;;;;;;IAC5B;;OAEG;IACH,MAAM,OAAO,QAAS,SAAQ,aAK5B;KAAG;;CACN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/meta.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,2BAA2B,CAAC;AAEtD,QAAA,MAAM,UAAU;;CAEf,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type IntentContext, type AnyIntentResolver } from './intent-dispatcher';
|
|
2
|
-
import { type HostContext, type Plugin } from '../plugin-host';
|
|
3
|
-
type Context = HostContext & IntentContext;
|
|
4
|
-
export type ResolverDefinitions = AnyIntentResolver | AnyIntentResolver[] | ResolverDefinitions[];
|
|
5
|
-
export type IntentResolverProvides = {
|
|
6
|
-
intent: {
|
|
7
|
-
resolvers: (context: Context) => ResolverDefinitions;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export type IntentPluginProvides = {
|
|
11
|
-
intent: IntentContext;
|
|
12
|
-
};
|
|
13
|
-
export declare const parseIntentPlugin: (plugin: Plugin) => Plugin<IntentPluginProvides> | undefined;
|
|
14
|
-
export declare const parseIntentResolverPlugin: (plugin: Plugin) => Plugin<IntentResolverProvides> | undefined;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=provides.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE/D,KAAK,OAAO,GAAG,WAAW,GAAG,aAAa,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,iBAAiB,EAAE,GAAG,mBAAmB,EAAE,CAAC;AAElG,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE;QACN,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,mBAAmB,CAAC;KACtD,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,WAAY,MAAM,6CACkD,CAAC;AAEnG,eAAO,MAAM,yBAAyB,WAAY,MAAM,+CAC6C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPlugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/SettingsPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,eAAO,MAAM,cAAc,QAAO,gBAAgB,CAAC,sBAAsB,CAWxE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc,YAAY,CAAC;AAE3B,eAAe,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/meta.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,YAAY;;CAEjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { S } from '@dxos/echo-schema';
|
|
2
|
-
import { type SettingsStoreFactory, type SettingsValue } from '@dxos/local-storage';
|
|
3
|
-
import { type Plugin } from '../plugin-host';
|
|
4
|
-
export type SettingsProvides<T extends SettingsValue> = {
|
|
5
|
-
settings: T;
|
|
6
|
-
};
|
|
7
|
-
export type SettingsPluginProvides = {
|
|
8
|
-
settingsStore: SettingsStoreFactory;
|
|
9
|
-
};
|
|
10
|
-
export declare const parseSettingsPlugin: (plugin: Plugin) => Plugin<SettingsPluginProvides> | undefined;
|
|
11
|
-
export declare const SETTINGS_PLUGIN = "dxos.org/plugin/settings";
|
|
12
|
-
export declare const SETTINGS_ACTION = "dxos.org/plugin/settings/action";
|
|
13
|
-
export declare namespace SettingsAction {
|
|
14
|
-
const Open_base: S.TaggedClass<Open, "dxos.org/plugin/settings/action/open", {
|
|
15
|
-
readonly _tag: S.tag<"dxos.org/plugin/settings/action/open">;
|
|
16
|
-
} & {
|
|
17
|
-
input: S.Struct<{
|
|
18
|
-
plugin: S.optional<typeof S.String>;
|
|
19
|
-
}>;
|
|
20
|
-
output: typeof S.Void;
|
|
21
|
-
}>;
|
|
22
|
-
export class Open extends Open_base {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=provides.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,IAAI;IACtD,QAAQ,EAAE,CAAC,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,WAAY,MAAM,+CAIjD,CAAC;AAEF,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,eAAe,oCAA8B,CAAC;AAE3D,yBAAiB,cAAc,CAAC;;;;;;;;;IAC9B,MAAM,OAAO,IAAK,SAAQ,SAKxB;KAAG;;CACN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/ErrorBoundary.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1E,KAAK,KAAK,GAAG,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAC;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAC9G,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;CAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAInC,kBAAkB,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI;IAM1C,MAAM;IAQf,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type SurfaceProps } from './SurfaceContext';
|
|
3
|
-
/**
|
|
4
|
-
* A surface is a named region of the screen that can be populated by plugins.
|
|
5
|
-
*/
|
|
6
|
-
export declare const Surface: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SurfaceProps, "ref"> & React.RefAttributes<HTMLElement>>>;
|
|
7
|
-
//# sourceMappingURL=Surface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAKrF,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,kBAAkB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,OAAO,0HA+CnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceContext.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/SurfaceContext.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6B,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvH,OAAO,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AAiF,CAAC;AAE7G,eAAO,MAAM,eAAe,2DAA0B,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type SurfacePluginProvides } from './provides';
|
|
2
|
-
import { type PluginDefinition } from '../plugin-host';
|
|
3
|
-
/**
|
|
4
|
-
* Provides a registry of surface components.
|
|
5
|
-
*/
|
|
6
|
-
export declare const SurfacePlugin: () => PluginDefinition<SurfacePluginProvides>;
|
|
7
|
-
//# sourceMappingURL=SurfacePlugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurfacePlugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/SurfacePlugin.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,qBAAqB,EAA2B,MAAM,YAAY,CAAC;AAErG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,gBAAgB,CAAC,qBAAqB,CAgBtE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the given data is an object and not null.
|
|
3
|
-
*
|
|
4
|
-
* Useful inside surface component resolvers as a type guard.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* const old =
|
|
9
|
-
* data.content &&
|
|
10
|
-
* typeof data.content === 'object' &&
|
|
11
|
-
* 'id' in data.content &&
|
|
12
|
-
* typeof data.content.id === 'string';
|
|
13
|
-
*
|
|
14
|
-
* // becomes
|
|
15
|
-
* const new = isObject(data.content) && typeof data.content.id === 'string';
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare const isObject: (data: unknown) => data is {
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/helpers.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,SAAU,OAAO,KAAG,IAAI,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAwC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SurfacePlugin } from './SurfacePlugin';
|
|
2
|
-
export * from './helpers';
|
|
3
|
-
export * from './provides';
|
|
4
|
-
export * from './ErrorBoundary';
|
|
5
|
-
export * from './Surface';
|
|
6
|
-
export * from './SurfaceContext';
|
|
7
|
-
export default SurfacePlugin;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AAEjC,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/meta.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,WAAW;;CAEhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type SurfaceDefinition, type SurfaceContextValue } from './SurfaceContext';
|
|
2
|
-
import { type HostContext, type Plugin } from '../plugin-host';
|
|
3
|
-
export type SurfaceDefinitions = SurfaceDefinition | SurfaceDefinition[] | SurfaceDefinitions[];
|
|
4
|
-
export type SurfaceProvides = {
|
|
5
|
-
surface: {
|
|
6
|
-
/**
|
|
7
|
-
* Used by the `Surface` resolver to find a component to render.
|
|
8
|
-
*/
|
|
9
|
-
definitions: (context: HostContext) => SurfaceDefinitions;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export type SurfacePluginProvides = {
|
|
13
|
-
surface: SurfaceContextValue;
|
|
14
|
-
};
|
|
15
|
-
export declare const parseRootSurfacePlugin: (plugin?: Plugin) => Plugin<SurfacePluginProvides> | undefined;
|
|
16
|
-
export declare const parseSurfacePlugin: (plugin?: Plugin) => Plugin<SurfaceProvides> | undefined;
|
|
17
|
-
//# sourceMappingURL=provides.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG,iBAAiB,EAAE,GAAG,kBAAkB,EAAE,CAAC;AAEhG,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE;QACP;;WAEG;QACH,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,kBAAkB,CAAC;KAC3D,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAAa,MAAM,8CACgD,CAAC;AAEvG,eAAO,MAAM,kBAAkB,YAAa,MAAM,wCACiD,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Space } from '@dxos/client-protocol';
|
|
6
|
-
|
|
7
|
-
import { type Plugin } from '../plugin-host';
|
|
8
|
-
|
|
9
|
-
// TODO(burdon): See Accept attribute (uses MIME types).
|
|
10
|
-
// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],
|
|
11
|
-
export const defaultFileTypes = {
|
|
12
|
-
images: ['png', 'jpg', 'jpeg', 'gif'],
|
|
13
|
-
media: ['mp3', 'mp4', 'mov', 'avi'],
|
|
14
|
-
text: ['pdf', 'txt', 'md'],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type FileInfo = {
|
|
18
|
-
url?: string;
|
|
19
|
-
cid?: string; // TODO(burdon): Meta key? Or other common properties with other file management system? (e.g., WNFS).
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Generic interface provided by file plugins (e.g., IPFS, WNFS).
|
|
26
|
-
*/
|
|
27
|
-
export type FileManagerProvides = {
|
|
28
|
-
file: {
|
|
29
|
-
upload?: FileUploader;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// TODO(burdon): Better match against interface? and Return provided service type. What if multiple?
|
|
34
|
-
export const parseFileManagerPlugin = (plugin: Plugin) => {
|
|
35
|
-
return (plugin.provides as any).file ? (plugin as Plugin<FileManagerProvides>) : undefined;
|
|
36
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import type { Graph, GraphBuilder, Node } from '@dxos/app-graph';
|
|
6
|
-
import { type MaybePromise } from '@dxos/util';
|
|
7
|
-
|
|
8
|
-
import type { Plugin } from '../plugin-host';
|
|
9
|
-
|
|
10
|
-
// TODO(wittjosiah): Factor out.
|
|
11
|
-
export type SerializedNode = {
|
|
12
|
-
name: string;
|
|
13
|
-
data: string;
|
|
14
|
-
type?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// TODO(wittjosiah): Factor out.
|
|
18
|
-
export type NodeSerializer<T = any> = {
|
|
19
|
-
inputType: string;
|
|
20
|
-
outputType: string;
|
|
21
|
-
disposition?: 'hoist' | 'fallback';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Takes a node and serializes it into a format that can be stored.
|
|
25
|
-
*/
|
|
26
|
-
serialize: (node: Node<T>) => MaybePromise<SerializedNode>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Takes a serialized node and deserializes it into the application.
|
|
30
|
-
*/
|
|
31
|
-
deserialize: (data: SerializedNode, ancestors: unknown[]) => MaybePromise<T>;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Provides for a plugin that exposes the application graph.
|
|
36
|
-
*/
|
|
37
|
-
export type GraphProvides = {
|
|
38
|
-
graph: Graph;
|
|
39
|
-
explore: GraphBuilder['explore'];
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type GraphBuilderProvides = {
|
|
43
|
-
graph: {
|
|
44
|
-
builder: (plugins: Plugin[]) => Parameters<GraphBuilder['addExtension']>[0];
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export type GraphSerializerProvides = {
|
|
49
|
-
graph: {
|
|
50
|
-
serializer: (plugins: Plugin[]) => NodeSerializer[];
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Type guard for graph plugins.
|
|
56
|
-
*/
|
|
57
|
-
export const parseGraphPlugin = (plugin: Plugin) =>
|
|
58
|
-
(plugin.provides as any).graph?.root ? (plugin as Plugin<GraphProvides>) : undefined;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Type guard for graph builder plugins.
|
|
62
|
-
*/
|
|
63
|
-
export const parseGraphBuilderPlugin = (plugin: Plugin) =>
|
|
64
|
-
(plugin.provides as any).graph?.builder ? (plugin as Plugin<GraphBuilderProvides>) : undefined;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Type guard for graph serializer plugins.
|
|
68
|
-
*/
|
|
69
|
-
export const parseGraphSerializerPlugin = (plugin: Plugin) =>
|
|
70
|
-
(plugin.provides as any).graph?.serializer ? (plugin as Plugin<GraphSerializerProvides>) : undefined;
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { S } from '@dxos/echo-schema';
|
|
6
|
-
|
|
7
|
-
import { type Plugin } from '../plugin-host';
|
|
8
|
-
import { Label } from '../plugin-intent';
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
// Provides
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
export const Toast = S.Struct({
|
|
15
|
-
id: S.String,
|
|
16
|
-
title: S.optional(Label),
|
|
17
|
-
description: S.optional(Label),
|
|
18
|
-
icon: S.optional(S.String),
|
|
19
|
-
duration: S.optional(S.Number),
|
|
20
|
-
closeLabel: S.optional(Label),
|
|
21
|
-
actionLabel: S.optional(Label),
|
|
22
|
-
actionAlt: S.optional(Label),
|
|
23
|
-
// TODO(wittjosiah): Make class with customizable method?
|
|
24
|
-
onAction: S.optional(S.Any),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export type Toast = S.Schema.Type<typeof Toast>;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Basic state provided by a layout plugin.
|
|
31
|
-
*
|
|
32
|
-
* Layout provides the state of global UI landmarks, such as the sidebar, dialog, and popover.
|
|
33
|
-
* Generally only one dialog or popover should be open at a time, a layout plugin should manage this.
|
|
34
|
-
* For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
const LayoutMode = S.Union(S.Literal('deck'), S.Literal('solo'), S.Literal('fullscreen'));
|
|
38
|
-
export const isLayoutMode = (value: any): value is LayoutMode => S.is(LayoutMode)(value);
|
|
39
|
-
export type LayoutMode = S.Schema.Type<typeof LayoutMode>;
|
|
40
|
-
|
|
41
|
-
export const Layout = S.mutable(
|
|
42
|
-
S.Struct({
|
|
43
|
-
layoutMode: LayoutMode,
|
|
44
|
-
|
|
45
|
-
sidebarOpen: S.Boolean,
|
|
46
|
-
complementarySidebarOpen: S.Boolean,
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated Data to be passed to the complementary sidebar Surface.
|
|
49
|
-
*/
|
|
50
|
-
complementarySidebarContent: S.optional(S.Any),
|
|
51
|
-
|
|
52
|
-
dialogOpen: S.Boolean,
|
|
53
|
-
/**
|
|
54
|
-
* Data to be passed to the dialog Surface.
|
|
55
|
-
*/
|
|
56
|
-
dialogContent: S.optional(S.Any),
|
|
57
|
-
// TODO(wittjosiah): Custom properties?
|
|
58
|
-
dialogBlockAlign: S.optional(S.Literal('start', 'center')),
|
|
59
|
-
dialogType: S.optional(S.Literal('default', 'alert')),
|
|
60
|
-
|
|
61
|
-
popoverOpen: S.Boolean,
|
|
62
|
-
/**
|
|
63
|
-
* Data to be passed to the popover Surface.
|
|
64
|
-
*/
|
|
65
|
-
popoverContent: S.optional(S.Any),
|
|
66
|
-
popoverAnchorId: S.optional(S.String),
|
|
67
|
-
|
|
68
|
-
toasts: S.mutable(S.Array(Toast)),
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The identifier of a component to scroll into view when it is mounted.
|
|
72
|
-
*/
|
|
73
|
-
scrollIntoView: S.optional(S.String),
|
|
74
|
-
}),
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
export type Layout = S.Schema.Type<typeof Layout>;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Provides for a plugin that can manage the app layout.
|
|
81
|
-
*/
|
|
82
|
-
export type LayoutProvides = {
|
|
83
|
-
layout: Readonly<Layout>;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Type guard for layout plugins.
|
|
88
|
-
*/
|
|
89
|
-
export const parseLayoutPlugin = (plugin: Plugin) => {
|
|
90
|
-
const success = S.is(Layout)((plugin.provides as any).layout);
|
|
91
|
-
return success ? (plugin as Plugin<LayoutProvides>) : undefined;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
//
|
|
95
|
-
// Intents
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
export const LAYOUT_PLUGIN = 'dxos.org/plugin/layout';
|
|
99
|
-
export const LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Expected payload for layout actions.
|
|
103
|
-
*/
|
|
104
|
-
export namespace LayoutAction {
|
|
105
|
-
export class SetLayout extends S.TaggedClass<SetLayout>()(`${LAYOUT_ACTION}/set-layout`, {
|
|
106
|
-
input: S.Struct({
|
|
107
|
-
/**
|
|
108
|
-
* Element to set the state of.
|
|
109
|
-
*/
|
|
110
|
-
element: S.Literal('fullscreen', 'sidebar', 'complementary', 'dialog', 'popover', 'toast'),
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Whether the element is on or off.
|
|
114
|
-
*
|
|
115
|
-
* If omitted, the element's state will be toggled or set based on other provided data.
|
|
116
|
-
* For example, if `component` is provided, the state will be set to `true`.
|
|
117
|
-
*/
|
|
118
|
-
state: S.optional(S.Boolean),
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Component to render in the dialog or popover.
|
|
122
|
-
*/
|
|
123
|
-
component: S.optional(S.String),
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Data to be passed to the dialog or popover Surface.
|
|
127
|
-
*/
|
|
128
|
-
subject: S.optional(S.Any),
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Anchor ID for the popover.
|
|
132
|
-
*/
|
|
133
|
-
anchorId: S.optional(S.String),
|
|
134
|
-
|
|
135
|
-
// TODO(wittjosiah): Custom properties?
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Block alignment for the dialog.
|
|
139
|
-
*/
|
|
140
|
-
dialogBlockAlign: S.optional(S.Literal('start', 'center')),
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Type of dialog.
|
|
144
|
-
*/
|
|
145
|
-
dialogType: S.optional(S.Literal('default', 'alert')),
|
|
146
|
-
}),
|
|
147
|
-
output: S.Void,
|
|
148
|
-
}) {}
|
|
149
|
-
|
|
150
|
-
// TODO(wittjosiah): Do all these need to be separate actions?
|
|
151
|
-
|
|
152
|
-
export class SetLayoutMode extends S.TaggedClass<SetLayoutMode>()(`${LAYOUT_ACTION}/set-layout-mode`, {
|
|
153
|
-
input: S.Union(
|
|
154
|
-
S.Struct({
|
|
155
|
-
layoutMode: LayoutMode,
|
|
156
|
-
}),
|
|
157
|
-
S.Struct({
|
|
158
|
-
revert: S.Literal(true),
|
|
159
|
-
}),
|
|
160
|
-
),
|
|
161
|
-
output: S.Void,
|
|
162
|
-
}) {}
|
|
163
|
-
|
|
164
|
-
export class ScrollIntoView extends S.TaggedClass<ScrollIntoView>()(`${LAYOUT_ACTION}/scroll-into-view`, {
|
|
165
|
-
input: S.Struct({
|
|
166
|
-
id: S.optional(S.String),
|
|
167
|
-
// TODO(wittjosiah): Factor out to thread scroll into view action?
|
|
168
|
-
cursor: S.optional(S.String),
|
|
169
|
-
ref: S.optional(S.String),
|
|
170
|
-
}),
|
|
171
|
-
output: S.Void,
|
|
172
|
-
}) {}
|
|
173
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Plugin } from '../plugin-host';
|
|
6
|
-
|
|
7
|
-
export type Metadata = Record<string, any>;
|
|
8
|
-
|
|
9
|
-
export type MetadataRecordsProvides = {
|
|
10
|
-
metadata: {
|
|
11
|
-
records: Record<string, Metadata>;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type MetadataResolver = (type: string) => Metadata;
|
|
16
|
-
|
|
17
|
-
export type MetadataResolverProvides = {
|
|
18
|
-
metadata: {
|
|
19
|
-
resolver: MetadataResolver;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const parseMetadataRecordsPlugin = (plugin: Plugin) => {
|
|
24
|
-
return (plugin.provides as any).metadata?.records ? (plugin as Plugin<MetadataRecordsProvides>) : undefined;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const parseMetadataResolverPlugin = (plugin: Plugin) => {
|
|
28
|
-
return (plugin.provides as any).metadata?.resolver ? (plugin as Plugin<MetadataResolverProvides>) : undefined;
|
|
29
|
-
};
|