@dxos/plugin-deck 0.8.4-main.e098934 → 0.8.4-main.ead640a
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-DVEKLXB4.mjs → app-graph-builder-YYP67JHW.mjs} +15 -14
- package/dist/lib/browser/app-graph-builder-YYP67JHW.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-3BQJXWEY.mjs → check-app-scheme-GCOL6YDT.mjs} +6 -6
- package/dist/lib/browser/check-app-scheme-GCOL6YDT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F5BQOOEG.mjs → chunk-7I6H3N4Q.mjs} +8 -6
- package/dist/lib/browser/chunk-7I6H3N4Q.mjs.map +7 -0
- package/dist/lib/browser/chunk-HUWUYTOI.mjs +16 -0
- package/dist/lib/browser/chunk-HUWUYTOI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NU7H23SK.mjs → chunk-JQKOS2HB.mjs} +341 -308
- package/dist/lib/browser/chunk-JQKOS2HB.mjs.map +7 -0
- package/dist/lib/browser/chunk-MHP4GPX5.mjs +11 -0
- package/dist/lib/browser/chunk-MHP4GPX5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WILMPGDV.mjs → chunk-RJP5R7PY.mjs} +14 -14
- package/dist/lib/browser/{chunk-WILMPGDV.mjs.map → chunk-RJP5R7PY.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-NRCPV6AV.mjs → chunk-VX7MMQOW.mjs} +9 -9
- package/dist/lib/browser/chunk-VX7MMQOW.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-2SUIIV6N.mjs → intent-resolver-7XNOEPVN.mjs} +20 -17
- package/dist/lib/browser/intent-resolver-7XNOEPVN.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-7PRVDLF7.mjs → react-root-OJEF7YCH.mjs} +11 -11
- package/dist/lib/browser/react-root-OJEF7YCH.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-FNY2YC2F.mjs → react-surface-XN2NJYHO.mjs} +13 -13
- package/dist/lib/browser/react-surface-XN2NJYHO.mjs.map +7 -0
- package/dist/lib/browser/{settings-LUPQPZ27.mjs → settings-M3KSKRAP.mjs} +7 -6
- package/dist/lib/browser/{settings-LUPQPZ27.mjs.map → settings-M3KSKRAP.mjs.map} +3 -3
- package/dist/lib/browser/state-6ZSDTF6Q.mjs +12 -0
- package/dist/lib/browser/{toolkit-XGJSBY67.mjs → toolkit-L7C3UAEU.mjs} +14 -12
- package/dist/lib/browser/toolkit-L7C3UAEU.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/browser/{url-handler-LROZYQ26.mjs → url-handler-EHTLXZRR.mjs} +6 -6
- package/dist/lib/browser/{url-handler-LROZYQ26.mjs.map → url-handler-EHTLXZRR.mjs.map} +1 -1
- package/dist/types/src/DeckPlugin.d.ts +1 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +3 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +3 -2
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +74 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/Toast.d.ts +5 -0
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +2 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +4 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +43 -43
- package/src/DeckPlugin.ts +62 -63
- package/src/capabilities/app-graph-builder.ts +10 -9
- package/src/capabilities/capabilities.ts +3 -3
- package/src/capabilities/check-app-scheme.ts +2 -2
- package/src/capabilities/intent-resolver.ts +12 -9
- package/src/capabilities/react-root.tsx +2 -2
- package/src/capabilities/react-surface.tsx +4 -4
- package/src/capabilities/settings.ts +1 -0
- package/src/capabilities/state.ts +7 -4
- package/src/capabilities/toolkit.ts +9 -7
- package/src/capabilities/tools.ts +1 -1
- package/src/components/DeckLayout/Banner.tsx +2 -2
- package/src/components/DeckLayout/DeckLayout.stories.tsx +64 -0
- package/src/components/DeckLayout/DeckLayout.tsx +8 -278
- package/src/components/DeckLayout/DeckMain.tsx +285 -0
- package/src/components/DeckLayout/Fallback.tsx +2 -2
- package/src/components/DeckLayout/Toast.tsx +27 -2
- package/src/components/DeckSettings/DeckSettings.tsx +9 -3
- package/src/components/Plank/Plank.stories.tsx +3 -5
- package/src/components/Plank/Plank.tsx +25 -9
- package/src/components/Plank/PlankControls.tsx +3 -3
- package/src/components/Plank/PlankError.tsx +2 -2
- package/src/components/Plank/PlankHeading.tsx +5 -5
- package/src/components/Sidebar/ComplementarySidebar.tsx +5 -5
- package/src/components/Sidebar/Sidebar.tsx +2 -2
- package/src/components/Sidebar/SidebarButton.tsx +4 -4
- package/src/events.ts +2 -2
- package/src/hooks/useHoistStatusbar.ts +4 -3
- package/src/meta.ts +1 -3
- package/src/translations.ts +1 -0
- package/src/types/schema.ts +5 -3
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs.map +0 -7
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
- package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
- package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
- package/dist/lib/browser/chunk-NRCPV6AV.mjs.map +0 -7
- package/dist/lib/browser/chunk-NU7H23SK.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
- package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +0 -7
- package/dist/lib/browser/react-root-7PRVDLF7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FNY2YC2F.mjs.map +0 -7
- package/dist/lib/browser/state-CRXR7X63.mjs +0 -12
- package/dist/lib/browser/toolkit-XGJSBY67.mjs.map +0 -7
- /package/dist/lib/browser/{state-CRXR7X63.mjs.map → state-6ZSDTF6Q.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-deck",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ead640a",
|
|
4
4
|
"description": "DXOS Surface plugin for the main application layout.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -33,59 +33,59 @@
|
|
|
33
33
|
"src"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@effect/ai": "0.
|
|
36
|
+
"@effect/ai": "0.29.1",
|
|
37
|
+
"@effect/experimental": "0.56.0",
|
|
37
38
|
"@fluentui/react-tabster": "^9.24.2",
|
|
38
39
|
"@preact-signals/safe-react": "^0.9.0",
|
|
39
|
-
"@preact/signals-core": "^1.
|
|
40
|
+
"@preact/signals-core": "^1.12.1",
|
|
40
41
|
"@radix-ui/react-context": "1.1.1",
|
|
41
|
-
"effect": "3.17.7",
|
|
42
42
|
"immer": "^10.1.1",
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/echo
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/invariant": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/live-object": "0.8.4-main.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/plugin-
|
|
61
|
-
"@dxos/react-
|
|
62
|
-
"@dxos/react-ui-
|
|
63
|
-
"@dxos/react-ui-
|
|
64
|
-
"@dxos/react-ui-
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/react-ui-stack": "0.8.4-main.e098934"
|
|
43
|
+
"@dxos/app-framework": "0.8.4-main.ead640a",
|
|
44
|
+
"@dxos/assistant": "0.8.4-main.ead640a",
|
|
45
|
+
"@dxos/async": "0.8.4-main.ead640a",
|
|
46
|
+
"@dxos/blueprints": "0.8.4-main.ead640a",
|
|
47
|
+
"@dxos/debug": "0.8.4-main.ead640a",
|
|
48
|
+
"@dxos/ai": "0.8.4-main.ead640a",
|
|
49
|
+
"@dxos/echo": "0.8.4-main.ead640a",
|
|
50
|
+
"@dxos/echo-signals": "0.8.4-main.ead640a",
|
|
51
|
+
"@dxos/keyboard": "0.8.4-main.ead640a",
|
|
52
|
+
"@dxos/invariant": "0.8.4-main.ead640a",
|
|
53
|
+
"@dxos/local-storage": "0.8.4-main.ead640a",
|
|
54
|
+
"@dxos/live-object": "0.8.4-main.ead640a",
|
|
55
|
+
"@dxos/log": "0.8.4-main.ead640a",
|
|
56
|
+
"@dxos/plugin-attention": "0.8.4-main.ead640a",
|
|
57
|
+
"@dxos/plugin-graph": "0.8.4-main.ead640a",
|
|
58
|
+
"@dxos/react-client": "0.8.4-main.ead640a",
|
|
59
|
+
"@dxos/react-ui-attention": "0.8.4-main.ead640a",
|
|
60
|
+
"@dxos/plugin-theme": "0.8.4-main.ead640a",
|
|
61
|
+
"@dxos/react-ui-form": "0.8.4-main.ead640a",
|
|
62
|
+
"@dxos/react-ui-stack": "0.8.4-main.ead640a",
|
|
63
|
+
"@dxos/react-ui-tabs": "0.8.4-main.ead640a",
|
|
64
|
+
"@dxos/react-ui-text-tooltip": "0.8.4-main.ead640a",
|
|
65
|
+
"@dxos/util": "0.8.4-main.ead640a",
|
|
66
|
+
"@dxos/plugin-observability": "0.8.4-main.ead640a"
|
|
68
67
|
},
|
|
69
68
|
"devDependencies": {
|
|
70
|
-
"@effect-rx/rx-react": "0.
|
|
71
|
-
"@effect/platform": "0.
|
|
72
|
-
"@types/react": "~
|
|
73
|
-
"@types/react-dom": "~
|
|
74
|
-
"
|
|
75
|
-
"react
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
79
|
-
"@dxos/
|
|
69
|
+
"@effect-rx/rx-react": "0.42.4",
|
|
70
|
+
"@effect/platform": "0.92.1",
|
|
71
|
+
"@types/react": "~19.2.2",
|
|
72
|
+
"@types/react-dom": "~19.2.1",
|
|
73
|
+
"effect": "3.18.3",
|
|
74
|
+
"react": "~19.2.0",
|
|
75
|
+
"react-dom": "~19.2.0",
|
|
76
|
+
"vite": "7.1.9",
|
|
77
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
78
|
+
"@dxos/storybook-utils": "0.8.4-main.ead640a",
|
|
79
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@effect-rx/rx-react": "^0.34.1",
|
|
83
83
|
"@effect/platform": "^0.80.12",
|
|
84
84
|
"effect": "^3.13.3",
|
|
85
|
-
"react": "
|
|
86
|
-
"react-dom": "
|
|
87
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
88
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
85
|
+
"react": "^19.0.0",
|
|
86
|
+
"react-dom": "^19.0.0",
|
|
87
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
88
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a"
|
|
89
89
|
},
|
|
90
90
|
"publishConfig": {
|
|
91
91
|
"access": "public"
|
package/src/DeckPlugin.ts
CHANGED
|
@@ -27,66 +27,65 @@ import { translations } from './translations';
|
|
|
27
27
|
// TODO(Zan): Move this to a more global location if we use immer more broadly.
|
|
28
28
|
setAutoFreeze(false);
|
|
29
29
|
|
|
30
|
-
export const DeckPlugin = () =>
|
|
31
|
-
|
|
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
|
-
]);
|
|
30
|
+
export const DeckPlugin = definePlugin(meta, () => [
|
|
31
|
+
defineModule({
|
|
32
|
+
id: `${meta.id}/module/check-app-scheme`,
|
|
33
|
+
activatesOn: Events.SettingsReady,
|
|
34
|
+
activate: CheckAppScheme,
|
|
35
|
+
}),
|
|
36
|
+
defineModule({
|
|
37
|
+
id: `${meta.id}/module/settings`,
|
|
38
|
+
activatesOn: Events.SetupSettings,
|
|
39
|
+
activate: DeckSettings,
|
|
40
|
+
}),
|
|
41
|
+
defineModule({
|
|
42
|
+
id: `${meta.id}/module/layout`,
|
|
43
|
+
// TODO(wittjosiah): Does not integrate with settings store.
|
|
44
|
+
// Should this be a different event?
|
|
45
|
+
// Should settings store be renamed to be more generic?
|
|
46
|
+
activatesOn: oneOf(Events.SetupSettings, Events.SetupAppGraph),
|
|
47
|
+
activatesAfter: [Events.LayoutReady, DeckEvents.StateReady],
|
|
48
|
+
activate: DeckState,
|
|
49
|
+
}),
|
|
50
|
+
defineModule({
|
|
51
|
+
id: `${meta.id}/module/translations`,
|
|
52
|
+
activatesOn: Events.SetupTranslations,
|
|
53
|
+
activate: () => contributes(Capabilities.Translations, [...translations, ...stackTranslations]),
|
|
54
|
+
}),
|
|
55
|
+
defineModule({
|
|
56
|
+
id: `${meta.id}/module/react-root`,
|
|
57
|
+
activatesOn: Events.Startup,
|
|
58
|
+
activate: ReactRoot,
|
|
59
|
+
}),
|
|
60
|
+
defineModule({
|
|
61
|
+
id: `${meta.id}/module/react-surface`,
|
|
62
|
+
activatesOn: Events.SetupReactSurface,
|
|
63
|
+
activate: ReactSurface,
|
|
64
|
+
}),
|
|
65
|
+
defineModule({
|
|
66
|
+
id: `${meta.id}/module/layout-intent-resolver`,
|
|
67
|
+
activatesOn: Events.SetupIntentResolver,
|
|
68
|
+
activate: LayoutIntentResolver,
|
|
69
|
+
}),
|
|
70
|
+
defineModule({
|
|
71
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
72
|
+
activatesOn: Events.SetupAppGraph,
|
|
73
|
+
activate: AppGraphBuilder,
|
|
74
|
+
}),
|
|
75
|
+
// defineModule({
|
|
76
|
+
// id: `${meta.id}/module/tools`,
|
|
77
|
+
// activatesOn: Events.SetupArtifactDefinition,
|
|
78
|
+
// activate: Tools,
|
|
79
|
+
// }),
|
|
80
|
+
defineModule({
|
|
81
|
+
id: `${meta.id}/module/toolkit`,
|
|
82
|
+
// TODO(wittjosiah): Shouldn't use the startup event.
|
|
83
|
+
activatesOn: Events.Startup,
|
|
84
|
+
activate: Toolkit,
|
|
85
|
+
}),
|
|
86
|
+
defineModule({
|
|
87
|
+
id: `${meta.id}/module/url`,
|
|
88
|
+
activatesOn: allOf(Events.DispatcherReady, DeckEvents.StateReady),
|
|
89
|
+
activate: UrlHandler,
|
|
90
|
+
}),
|
|
91
|
+
]);
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
9
|
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
10
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
10
11
|
import { ROOT_ID, createExtension, rxFromSignal } from '@dxos/plugin-graph';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
+
import { meta } from '../meta';
|
|
13
14
|
|
|
14
15
|
import { DeckCapabilities } from './capabilities';
|
|
15
16
|
|
|
@@ -17,10 +18,10 @@ export default (context: PluginContext) =>
|
|
|
17
18
|
contributes(
|
|
18
19
|
Capabilities.AppGraphBuilder,
|
|
19
20
|
createExtension({
|
|
20
|
-
id:
|
|
21
|
+
id: meta.id,
|
|
21
22
|
actions: (node) =>
|
|
22
23
|
Rx.make((get) =>
|
|
23
|
-
pipe(
|
|
24
|
+
Function.pipe(
|
|
24
25
|
get(node),
|
|
25
26
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
26
27
|
Option.map(() => {
|
|
@@ -37,7 +38,7 @@ export default (context: PluginContext) =>
|
|
|
37
38
|
);
|
|
38
39
|
},
|
|
39
40
|
properties: {
|
|
40
|
-
label: ['toggle fullscreen label', { ns:
|
|
41
|
+
label: ['toggle fullscreen label', { ns: meta.id }],
|
|
41
42
|
icon: 'ph--arrows-out--regular',
|
|
42
43
|
keyBinding: {
|
|
43
44
|
macos: 'ctrl+meta+f',
|
|
@@ -63,7 +64,7 @@ export default (context: PluginContext) =>
|
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
66
|
properties: {
|
|
66
|
-
label: ['close current label', { ns:
|
|
67
|
+
label: ['close current label', { ns: meta.id }],
|
|
67
68
|
icon: 'ph--x--regular',
|
|
68
69
|
},
|
|
69
70
|
};
|
|
@@ -80,7 +81,7 @@ export default (context: PluginContext) =>
|
|
|
80
81
|
);
|
|
81
82
|
},
|
|
82
83
|
properties: {
|
|
83
|
-
label: ['close others label', { ns:
|
|
84
|
+
label: ['close others label', { ns: meta.id }],
|
|
84
85
|
icon: 'ph--x-square--regular',
|
|
85
86
|
},
|
|
86
87
|
};
|
|
@@ -98,7 +99,7 @@ export default (context: PluginContext) =>
|
|
|
98
99
|
);
|
|
99
100
|
},
|
|
100
101
|
properties: {
|
|
101
|
-
label: ['close all label', { ns:
|
|
102
|
+
label: ['close all label', { ns: meta.id }],
|
|
102
103
|
icon: 'ph--x-circle--regular',
|
|
103
104
|
},
|
|
104
105
|
};
|
|
@@ -117,7 +118,7 @@ export default (context: PluginContext) =>
|
|
|
117
118
|
: 'open navigation sidebar label',
|
|
118
119
|
),
|
|
119
120
|
),
|
|
120
|
-
{ ns:
|
|
121
|
+
{ ns: meta.id },
|
|
121
122
|
],
|
|
122
123
|
icon: 'ph--sidebar--regular',
|
|
123
124
|
keyBinding: {
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
6
|
import { type DeepReadonly } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { meta } from '../meta';
|
|
9
9
|
import { type DeckPluginState } from '../types';
|
|
10
10
|
|
|
11
11
|
export namespace DeckCapabilities {
|
|
12
|
-
export const DeckState = defineCapability<DeepReadonly<DeckPluginState>>(`${
|
|
13
|
-
export const MutableDeckState = defineCapability<DeckPluginState>(`${
|
|
12
|
+
export const DeckState = defineCapability<DeepReadonly<DeckPluginState>>(`${meta.id}/capability/state`);
|
|
13
|
+
export const MutableDeckState = defineCapability<DeckPluginState>(`${meta.id}/capability/state`);
|
|
14
14
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { meta } from '../meta';
|
|
8
8
|
import { type DeckSettingsProps } from '../types';
|
|
9
9
|
|
|
10
10
|
const isSocket = !!(globalThis as any).__args;
|
|
@@ -31,7 +31,7 @@ const checkAppScheme = (url: string) => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export default async (context: PluginContext) => {
|
|
34
|
-
const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(
|
|
34
|
+
const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(meta.id)?.value;
|
|
35
35
|
if (!isSocket && settings?.enableNativeRedirect) {
|
|
36
36
|
checkAppScheme(appScheme);
|
|
37
37
|
}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { batch } from '@preact/signals-core';
|
|
6
|
-
import
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Function from 'effect/Function';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
import * as Schema from 'effect/Schema';
|
|
7
10
|
|
|
8
11
|
import {
|
|
9
12
|
Capabilities,
|
|
@@ -25,7 +28,7 @@ import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
|
25
28
|
import { byPosition, isNonNullable } from '@dxos/util';
|
|
26
29
|
|
|
27
30
|
import { closeEntry, createEntryId, incrementPlank, openEntry } from '../layout';
|
|
28
|
-
import {
|
|
31
|
+
import { meta } from '../meta';
|
|
29
32
|
import {
|
|
30
33
|
DeckAction,
|
|
31
34
|
type DeckSettingsProps,
|
|
@@ -56,11 +59,11 @@ export default (context: PluginContext) =>
|
|
|
56
59
|
...layout.toasts,
|
|
57
60
|
{
|
|
58
61
|
id: layout.currentUndoId,
|
|
59
|
-
title: data.message ?? ['undo available label', { ns:
|
|
62
|
+
title: data.message ?? ['undo available label', { ns: meta.id }],
|
|
60
63
|
duration: 10_000,
|
|
61
|
-
actionLabel: ['undo action label', { ns:
|
|
62
|
-
actionAlt: ['undo action alt', { ns:
|
|
63
|
-
closeLabel: ['undo close label', { ns:
|
|
64
|
+
actionLabel: ['undo action label', { ns: meta.id }],
|
|
65
|
+
actionAlt: ['undo action alt', { ns: meta.id }],
|
|
66
|
+
closeLabel: ['undo close label', { ns: meta.id }],
|
|
64
67
|
onAction: () => undo(),
|
|
65
68
|
},
|
|
66
69
|
];
|
|
@@ -261,7 +264,7 @@ export default (context: PluginContext) =>
|
|
|
261
264
|
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
262
265
|
const settings = context
|
|
263
266
|
.getCapabilities(Capabilities.SettingsStore)[0]
|
|
264
|
-
?.getStore<DeckSettingsProps>(
|
|
267
|
+
?.getStore<DeckSettingsProps>(meta.id)?.value;
|
|
265
268
|
|
|
266
269
|
if (options?.workspace && state.activeDeck !== options?.workspace) {
|
|
267
270
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
@@ -403,7 +406,7 @@ export default (context: PluginContext) =>
|
|
|
403
406
|
}
|
|
404
407
|
|
|
405
408
|
if (adjustment.type === 'companion') {
|
|
406
|
-
return pipe(
|
|
409
|
+
return Function.pipe(
|
|
407
410
|
graph.getNode(adjustment.id),
|
|
408
411
|
Option.map((node) =>
|
|
409
412
|
graph
|
|
@@ -454,7 +457,7 @@ export default (context: PluginContext) =>
|
|
|
454
457
|
return {
|
|
455
458
|
intents: [
|
|
456
459
|
// NOTE: The order of these is important.
|
|
457
|
-
pipe(
|
|
460
|
+
Function.pipe(
|
|
458
461
|
createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'deck' } }),
|
|
459
462
|
chain(LayoutAction.Open, { part: 'main', subject: [entryId] }),
|
|
460
463
|
),
|
|
@@ -7,13 +7,13 @@ import React, { useCallback } from 'react';
|
|
|
7
7
|
import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
9
|
import { DeckLayout } from '../components';
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
|
|
12
12
|
import { DeckCapabilities } from './capabilities';
|
|
13
13
|
|
|
14
14
|
export default () =>
|
|
15
15
|
contributes(Capabilities.ReactRoot, {
|
|
16
|
-
id:
|
|
16
|
+
id: meta.id,
|
|
17
17
|
root: () => {
|
|
18
18
|
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
19
19
|
|
|
@@ -8,20 +8,20 @@ import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
|
8
8
|
import { SettingsStore } from '@dxos/local-storage';
|
|
9
9
|
|
|
10
10
|
import { Banner, DeckSettings } from '../components';
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
import { type DeckSettingsProps } from '../types';
|
|
13
13
|
|
|
14
14
|
export default () =>
|
|
15
15
|
contributes(Capabilities.ReactSurface, [
|
|
16
16
|
createSurface({
|
|
17
|
-
id: `${
|
|
17
|
+
id: `${meta.id}/plugin-settings`,
|
|
18
18
|
role: 'article',
|
|
19
19
|
filter: (data): data is { subject: SettingsStore<DeckSettingsProps> } =>
|
|
20
|
-
data.subject instanceof SettingsStore && data.subject.prefix ===
|
|
20
|
+
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
21
21
|
component: ({ data: { subject } }) => <DeckSettings settings={subject.value} />,
|
|
22
22
|
}),
|
|
23
23
|
createSurface({
|
|
24
|
-
id: `${
|
|
24
|
+
id: `${meta.id}/banner`,
|
|
25
25
|
role: 'banner',
|
|
26
26
|
component: ({ data }) => {
|
|
27
27
|
return <Banner variant={data.variant} />;
|
|
@@ -8,7 +8,7 @@ import { live } from '@dxos/live-object';
|
|
|
8
8
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
9
9
|
import { type SidebarState } from '@dxos/react-ui';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
import { type DeckPluginState, type DeckState, defaultDeck, getMode } from '../types';
|
|
13
13
|
|
|
14
14
|
import { DeckCapabilities } from './capabilities';
|
|
@@ -18,8 +18,8 @@ const boolean = /true|false/;
|
|
|
18
18
|
// TODO(thure, 18 Feb 2025): Remove after the next release.
|
|
19
19
|
|
|
20
20
|
const migrateSidebarStateDefaults = {
|
|
21
|
-
[`${
|
|
22
|
-
[`${
|
|
21
|
+
[`${meta.id}/complementary-sidebar-state`]: 'expanded',
|
|
22
|
+
[`${meta.id}/sidebar-state`]: 'collapsed',
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const migrateSidebarState = () => {
|
|
@@ -30,10 +30,13 @@ const migrateSidebarState = () => {
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated
|
|
35
|
+
*/
|
|
33
36
|
export const DeckStateFactory = () => {
|
|
34
37
|
migrateSidebarState();
|
|
35
38
|
|
|
36
|
-
const state = new LocalStorageStore<DeckPluginState>(
|
|
39
|
+
const state = new LocalStorageStore<DeckPluginState>(meta.id, {
|
|
37
40
|
sidebarState: 'expanded',
|
|
38
41
|
complementarySidebarState: 'collapsed',
|
|
39
42
|
complementarySidebarPanel: undefined,
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import * as Tool from '@effect/ai/Tool';
|
|
6
|
+
import * as Toolkit from '@effect/ai/Toolkit';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
7
9
|
|
|
8
10
|
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
11
|
import { ArtifactId } from '@dxos/assistant';
|
|
@@ -12,8 +14,8 @@ import { trim } from '@dxos/util';
|
|
|
12
14
|
|
|
13
15
|
import { DeckCapabilities } from './capabilities';
|
|
14
16
|
|
|
15
|
-
class
|
|
16
|
-
|
|
17
|
+
class DeckToolkit extends Toolkit.make(
|
|
18
|
+
Tool.make('open-item', {
|
|
17
19
|
description: trim`
|
|
18
20
|
Opens an item in the application.
|
|
19
21
|
`,
|
|
@@ -25,7 +27,7 @@ class Toolkit extends AiToolkit.make(
|
|
|
25
27
|
}),
|
|
26
28
|
) {
|
|
27
29
|
static layer = (context: PluginContext) =>
|
|
28
|
-
|
|
30
|
+
DeckToolkit.toLayer({
|
|
29
31
|
'open-item': ({ id }) =>
|
|
30
32
|
Effect.gen(function* () {
|
|
31
33
|
const state = context.getCapability(DeckCapabilities.DeckState);
|
|
@@ -50,6 +52,6 @@ class Toolkit extends AiToolkit.make(
|
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
export default (context: PluginContext) => [
|
|
53
|
-
contributes(Capabilities.Toolkit,
|
|
54
|
-
contributes(Capabilities.ToolkitHandler,
|
|
55
|
+
contributes(Capabilities.Toolkit, DeckToolkit),
|
|
56
|
+
contributes(Capabilities.ToolkitHandler, DeckToolkit.layer(context)),
|
|
55
57
|
];
|
|
@@ -8,11 +8,11 @@ import { Surface } from '@dxos/app-framework';
|
|
|
8
8
|
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../../meta';
|
|
12
12
|
import { CloseSidebarButton, ToggleSidebarButton } from '../Sidebar';
|
|
13
13
|
|
|
14
14
|
export const Banner = ({ variant, classNames }: ThemedClassName<{ variant?: 'topbar' | 'sidebar' }>) => {
|
|
15
|
-
const { t } = useTranslation(
|
|
15
|
+
const { t } = useTranslation(meta.id);
|
|
16
16
|
return (
|
|
17
17
|
<header
|
|
18
18
|
className={mx(
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Events, IntentPlugin, SettingsPlugin, defineModule, definePlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { AttentionPlugin } from '@dxos/plugin-attention';
|
|
11
|
+
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
12
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
|
+
|
|
14
|
+
import { DeckStateFactory, LayoutIntentResolver } from '../../capabilities';
|
|
15
|
+
import { meta as pluginMeta } from '../../meta';
|
|
16
|
+
import { translations } from '../../translations';
|
|
17
|
+
|
|
18
|
+
import { DeckLayout } from './DeckLayout';
|
|
19
|
+
|
|
20
|
+
const meta = {
|
|
21
|
+
title: 'plugins/plugin-deck/DeckLayout',
|
|
22
|
+
component: DeckLayout,
|
|
23
|
+
render: (args) => {
|
|
24
|
+
return <DeckLayout {...args} />;
|
|
25
|
+
},
|
|
26
|
+
decorators: [
|
|
27
|
+
withTheme,
|
|
28
|
+
withPluginManager({
|
|
29
|
+
plugins: [
|
|
30
|
+
AttentionPlugin(),
|
|
31
|
+
SettingsPlugin(),
|
|
32
|
+
IntentPlugin(),
|
|
33
|
+
GraphPlugin(),
|
|
34
|
+
definePlugin(
|
|
35
|
+
{
|
|
36
|
+
id: 'example.com/plutin/testing',
|
|
37
|
+
name: 'Testing',
|
|
38
|
+
},
|
|
39
|
+
() => [
|
|
40
|
+
defineModule({
|
|
41
|
+
id: `${pluginMeta.id}/module/layout-intent-resolver`,
|
|
42
|
+
activatesOn: Events.SetupIntentResolver,
|
|
43
|
+
activate: LayoutIntentResolver,
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
46
|
+
)(),
|
|
47
|
+
],
|
|
48
|
+
// TODO(burdon): Remove?
|
|
49
|
+
capabilities: () => DeckStateFactory(),
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
parameters: {
|
|
53
|
+
layout: 'fullscreen',
|
|
54
|
+
translations,
|
|
55
|
+
},
|
|
56
|
+
} satisfies Meta<typeof DeckLayout>;
|
|
57
|
+
|
|
58
|
+
export default meta;
|
|
59
|
+
|
|
60
|
+
type Story = StoryObj<typeof meta>;
|
|
61
|
+
|
|
62
|
+
export const Default: Story = {
|
|
63
|
+
args: {},
|
|
64
|
+
};
|