@dxos/plugin-attention 0.8.4-main.c85a9c8dae → 0.8.4-main.d05539e30a
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/AttentionPlugin.mjs +9 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DPUSNLAH.mjs +60 -0
- package/dist/lib/neutral/chunk-DPUSNLAH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DTGSOFCE.mjs +41 -0
- package/dist/lib/neutral/chunk-DTGSOFCE.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QSTYRKHK.mjs +8 -0
- package/dist/lib/neutral/chunk-QSTYRKHK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TNTMPZ3O.mjs +19 -0
- package/dist/lib/neutral/chunk-TNTMPZ3O.mjs.map +7 -0
- package/dist/lib/{browser/types → neutral}/index.mjs +6 -4
- package/dist/lib/{browser/keyboard-DI2TQRGK.mjs → neutral/keyboard-6CPNUR24.mjs} +5 -15
- package/dist/lib/neutral/keyboard-6CPNUR24.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +7 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-O5PDEBTC.mjs +11 -0
- package/dist/lib/neutral/operation-handler-O5PDEBTC.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +7 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +15 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-context-WX2SNCOW.mjs → neutral/react-context-W7BGQDHK.mjs} +4 -7
- package/dist/lib/neutral/react-context-W7BGQDHK.mjs.map +7 -0
- package/dist/lib/neutral/select-CI2OLVWT.mjs +46 -0
- package/dist/lib/neutral/select-CI2OLVWT.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +7 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +11 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/AttentionPlugin.d.ts +1 -0
- package/dist/types/src/AttentionPlugin.d.ts.map +1 -1
- package/dist/types/src/AttentionPlugin.test.d.ts +2 -0
- package/dist/types/src/AttentionPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +9 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/select.d.ts +5 -0
- package/dist/types/src/operations/select.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -38
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -29
- package/src/AttentionPlugin.test.ts +32 -0
- package/src/AttentionPlugin.ts +11 -9
- package/src/capabilities/index.ts +9 -3
- package/src/capabilities/{keyboard/keyboard.ts → keyboard.ts} +3 -8
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-context/react-context.tsx → react-context.tsx} +2 -2
- package/src/index.ts +0 -3
- package/src/meta.ts +3 -1
- package/src/operations/index.ts +7 -0
- package/src/operations/select.ts +43 -0
- package/src/plugin.ts +11 -0
- package/src/testing.ts +7 -0
- package/src/types/capabilities.ts +3 -3
- package/src/types/events.ts +2 -2
- package/src/types/types.ts +3 -23
- package/dist/lib/browser/chunk-ME5PHTSM.mjs +0 -79
- package/dist/lib/browser/chunk-ME5PHTSM.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -83
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/keyboard-DI2TQRGK.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-7VEZFZOX.mjs +0 -52
- package/dist/lib/browser/operation-resolver-7VEZFZOX.mjs.map +0 -7
- package/dist/lib/browser/react-context-WX2SNCOW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MIO5EA55.mjs +0 -81
- package/dist/lib/node-esm/chunk-MIO5EA55.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -84
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/keyboard-T6BIKQYG.mjs +0 -30
- package/dist/lib/node-esm/keyboard-T6BIKQYG.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-4YES2MF3.mjs +0 -53
- package/dist/lib/node-esm/operation-resolver-4YES2MF3.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-LNH7DILM.mjs +0 -30
- package/dist/lib/node-esm/react-context-LNH7DILM.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -14
- package/dist/types/src/capabilities/keyboard/index.d.ts +0 -3
- package/dist/types/src/capabilities/keyboard/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/keyboard/keyboard.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/index.d.ts +0 -7
- package/dist/types/src/capabilities/react-context/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +0 -1
- package/src/capabilities/keyboard/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -45
- package/src/capabilities/react-context/index.ts +0 -7
- /package/dist/lib/{browser/types/index.mjs.map → neutral/AttentionPlugin.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{keyboard/keyboard.d.ts → keyboard.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-context/react-context.d.ts → react-context.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-attention",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.d05539e30a",
|
|
4
4
|
"description": "Plugin for attention",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,46 +8,69 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#meta": {
|
|
22
|
+
"source": "./src/meta.ts",
|
|
23
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#operations": {
|
|
27
|
+
"source": "./src/operations/index.ts",
|
|
28
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/operations/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#plugin": {
|
|
32
|
+
"source": "./src/AttentionPlugin.ts",
|
|
33
|
+
"types": "./dist/types/src/AttentionPlugin.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/AttentionPlugin.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#types": {
|
|
37
|
+
"source": "./src/types/index.ts",
|
|
38
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
15
42
|
"exports": {
|
|
16
43
|
".": {
|
|
17
44
|
"source": "./src/index.ts",
|
|
18
45
|
"types": "./dist/types/src/index.d.ts",
|
|
19
|
-
"
|
|
20
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
46
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
21
47
|
},
|
|
22
|
-
"./
|
|
23
|
-
"source": "./src/
|
|
24
|
-
"types": "./dist/types/src/
|
|
25
|
-
"
|
|
26
|
-
|
|
48
|
+
"./plugin": {
|
|
49
|
+
"source": "./src/plugin.ts",
|
|
50
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
51
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./testing": {
|
|
54
|
+
"source": "./src/testing.ts",
|
|
55
|
+
"types": "./dist/types/src/testing.d.ts",
|
|
56
|
+
"default": "./dist/lib/neutral/testing.mjs"
|
|
27
57
|
}
|
|
28
58
|
},
|
|
29
59
|
"types": "dist/types/src/index.d.ts",
|
|
30
|
-
"typesVersions": {
|
|
31
|
-
"*": {
|
|
32
|
-
"types": [
|
|
33
|
-
"dist/types/src/types/index.d.ts"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
60
|
"files": [
|
|
38
61
|
"dist",
|
|
39
62
|
"src"
|
|
40
63
|
],
|
|
41
64
|
"dependencies": {
|
|
42
|
-
"effect": "3.
|
|
43
|
-
"@dxos/app-toolkit": "0.8.4-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/util": "0.8.4-main.
|
|
65
|
+
"effect": "3.20.0",
|
|
66
|
+
"@dxos/app-toolkit": "0.8.4-main.d05539e30a",
|
|
67
|
+
"@dxos/compute": "0.8.4-main.d05539e30a",
|
|
68
|
+
"@dxos/app-framework": "0.8.4-main.d05539e30a",
|
|
69
|
+
"@dxos/echo": "0.8.4-main.d05539e30a",
|
|
70
|
+
"@dxos/plugin-graph": "0.8.4-main.d05539e30a",
|
|
71
|
+
"@dxos/keyboard": "0.8.4-main.d05539e30a",
|
|
72
|
+
"@dxos/react-ui-attention": "0.8.4-main.d05539e30a",
|
|
73
|
+
"@dxos/util": "0.8.4-main.d05539e30a"
|
|
51
74
|
},
|
|
52
75
|
"devDependencies": {
|
|
53
76
|
"@types/react": "~19.2.7",
|
|
@@ -55,11 +78,8 @@
|
|
|
55
78
|
"react-dom": "~19.2.3"
|
|
56
79
|
},
|
|
57
80
|
"peerDependencies": {
|
|
58
|
-
"effect": "3.
|
|
81
|
+
"effect": "3.20.0",
|
|
59
82
|
"react": "~19.2.3",
|
|
60
83
|
"react-dom": "~19.2.3"
|
|
61
|
-
},
|
|
62
|
-
"publishConfig": {
|
|
63
|
-
"access": "public"
|
|
64
84
|
}
|
|
65
85
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { ActivationEvents, ProcessManagerPlugin } from '@dxos/app-framework';
|
|
8
|
+
import { createTestApp } from '@dxos/app-framework/testing';
|
|
9
|
+
import { GraphPlugin } from '@dxos/plugin-graph/plugin';
|
|
10
|
+
|
|
11
|
+
import { AttentionPlugin } from '#plugin';
|
|
12
|
+
|
|
13
|
+
import { meta } from './meta';
|
|
14
|
+
|
|
15
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
16
|
+
|
|
17
|
+
describe('AttentionPlugin', () => {
|
|
18
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
19
|
+
await using harness = await createTestApp({
|
|
20
|
+
plugins: [GraphPlugin(), ProcessManagerPlugin(), AttentionPlugin()],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Modules expected to be active after a normal startup.
|
|
24
|
+
expect(harness.manager.getActive()).toEqual(
|
|
25
|
+
expect.arrayContaining([moduleId('attention'), moduleId('ReactContext'), moduleId('Keyboard')]),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// OperationHandler fires lazily when an operation is invoked.
|
|
29
|
+
await harness.fire(ActivationEvents.SetupProcessManager);
|
|
30
|
+
expect(harness.manager.getActive()).toContain(moduleId('OperationHandler'));
|
|
31
|
+
});
|
|
32
|
+
});
|
package/src/AttentionPlugin.ts
CHANGED
|
@@ -8,17 +8,17 @@ import { ActivationEvent, ActivationEvents, Capabilities, Capability, Plugin } f
|
|
|
8
8
|
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
9
9
|
import { AttentionManager, SelectionManager } from '@dxos/react-ui-attention';
|
|
10
10
|
|
|
11
|
-
import { Keyboard,
|
|
12
|
-
import { meta } from '
|
|
13
|
-
import { AttentionEvents } from '
|
|
14
|
-
import { AttentionCapabilities } from '
|
|
11
|
+
import { Keyboard, OperationHandler, ReactContext } from '#capabilities';
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { AttentionEvents } from '#types';
|
|
14
|
+
import { AttentionCapabilities } from '#types';
|
|
15
15
|
|
|
16
16
|
export const AttentionPlugin = Plugin.define(meta).pipe(
|
|
17
|
-
AppPlugin.
|
|
17
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
18
18
|
Plugin.addModule({
|
|
19
19
|
id: 'attention',
|
|
20
20
|
activatesOn: ActivationEvents.Startup,
|
|
21
|
-
|
|
21
|
+
firesAfterActivation: [AttentionEvents.AttentionReady],
|
|
22
22
|
activate: () =>
|
|
23
23
|
Effect.gen(function* () {
|
|
24
24
|
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
@@ -54,11 +54,13 @@ const setupDevtools = (attention: AttentionManager) => {
|
|
|
54
54
|
},
|
|
55
55
|
get currentSpace() {
|
|
56
56
|
for (const id of attention.getCurrent()) {
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
return
|
|
57
|
+
const segments = id.split('/');
|
|
58
|
+
if (segments.length > 1 && segments[1].length === 33) {
|
|
59
|
+
return segments[1];
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
+
|
|
66
|
+
export default AttentionPlugin;
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
export const Keyboard = Capability.lazy('Keyboard', () => import('./keyboard'));
|
|
9
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
10
|
+
'OperationHandler',
|
|
11
|
+
() => import('./operation-handler'),
|
|
12
|
+
);
|
|
13
|
+
export const ReactContext = Capability.lazy('ReactContext', () => import('./react-context'));
|
|
@@ -3,25 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Option from 'effect/Option';
|
|
7
6
|
|
|
8
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
-
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
10
8
|
import { Keyboard } from '@dxos/keyboard';
|
|
11
|
-
import { Graph } from '@dxos/plugin-graph';
|
|
12
9
|
|
|
13
|
-
import { AttentionCapabilities } from '
|
|
10
|
+
import { AttentionCapabilities } from '#types';
|
|
14
11
|
|
|
15
12
|
export default Capability.makeModule(
|
|
16
13
|
Effect.fnUntraced(function* () {
|
|
17
|
-
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
18
14
|
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
19
15
|
|
|
20
16
|
const unsubscribe = attention.subscribeCurrent((current) => {
|
|
21
17
|
const id = current[0];
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Keyboard.singleton.setCurrentContext(path.join('/'));
|
|
18
|
+
if (id) {
|
|
19
|
+
Keyboard.singleton.setCurrentContext(id);
|
|
25
20
|
}
|
|
26
21
|
});
|
|
27
22
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { AttentionOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, AttentionOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -9,8 +9,8 @@ import { Capabilities, Capability } from '@dxos/app-framework';
|
|
|
9
9
|
import { useCapability } from '@dxos/app-framework/ui';
|
|
10
10
|
import { RootAttentionProvider, SelectionProvider } from '@dxos/react-ui-attention';
|
|
11
11
|
|
|
12
|
-
import { meta } from '
|
|
13
|
-
import { AttentionCapabilities } from '
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { AttentionCapabilities } from '#types';
|
|
14
14
|
|
|
15
15
|
export default Capability.makeModule(() =>
|
|
16
16
|
Effect.succeed(
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -6,10 +6,12 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.attention',
|
|
10
10
|
name: 'Attention',
|
|
11
|
+
author: 'DXOS',
|
|
11
12
|
description: trim`
|
|
12
13
|
Track and manage focused attention on objects across your workspace.
|
|
13
14
|
Highlight items requiring action and coordinate team focus on priority work.
|
|
14
15
|
`,
|
|
16
|
+
tags: ['system'],
|
|
15
17
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Match from 'effect/Match';
|
|
7
|
+
|
|
8
|
+
import { Capability } from '@dxos/app-framework';
|
|
9
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
|
|
12
|
+
import { AttentionCapabilities } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.Select> = LayoutOperation.Select.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fnUntraced(function* (input) {
|
|
17
|
+
const selection = yield* Capability.get(AttentionCapabilities.Selection);
|
|
18
|
+
Match.value(input.subject).pipe(
|
|
19
|
+
Match.when({ mode: 'single', id: undefined }, () => {
|
|
20
|
+
selection.clearSelection(input.contextId);
|
|
21
|
+
}),
|
|
22
|
+
Match.when({ mode: 'single' }, (s) => {
|
|
23
|
+
selection.updateSingle(input.contextId, s.id!);
|
|
24
|
+
}),
|
|
25
|
+
Match.when({ mode: 'multi' }, (s) => {
|
|
26
|
+
selection.updateMulti(input.contextId, s.ids);
|
|
27
|
+
}),
|
|
28
|
+
Match.when({ mode: 'range', from: undefined, to: undefined }, () => {
|
|
29
|
+
selection.clearSelection(input.contextId);
|
|
30
|
+
}),
|
|
31
|
+
Match.when({ mode: 'range' }, (s) => {
|
|
32
|
+
selection.updateRange(input.contextId, s.from!, s.to!);
|
|
33
|
+
}),
|
|
34
|
+
Match.when({ mode: 'multi-range' }, (s) => {
|
|
35
|
+
selection.updateMultiRange(input.contextId, s.ranges);
|
|
36
|
+
}),
|
|
37
|
+
Match.exhaustive,
|
|
38
|
+
);
|
|
39
|
+
}),
|
|
40
|
+
),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const AttentionPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { AttentionOperationHandlerSet } from './operations';
|
package/src/testing.ts
ADDED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
6
|
import { type AttentionManager, type SelectionManager } from '@dxos/react-ui-attention';
|
|
7
7
|
|
|
8
|
-
import { meta } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
9
9
|
|
|
10
10
|
export namespace AttentionCapabilities {
|
|
11
|
-
export const Attention = Capability.make<AttentionManager>(`${meta.id}
|
|
12
|
-
export const Selection = Capability.make<SelectionManager>(`${meta.id}
|
|
11
|
+
export const Attention = Capability.make<AttentionManager>(`${meta.id}.capability.attention`);
|
|
12
|
+
export const Selection = Capability.make<SelectionManager>(`${meta.id}.capability.selection`);
|
|
13
13
|
}
|
package/src/types/events.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { ActivationEvent } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export namespace AttentionEvents {
|
|
10
|
-
export const AttentionReady = ActivationEvent.make(`${meta.id}
|
|
10
|
+
export const AttentionReady = ActivationEvent.make(`${meta.id}.event.attention-ready`);
|
|
11
11
|
}
|
package/src/types/types.ts
CHANGED
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
import { Operation } from '@dxos/operation';
|
|
9
7
|
import { SelectionSchema } from '@dxos/react-ui-attention';
|
|
10
8
|
|
|
11
|
-
import { meta } from '
|
|
9
|
+
import { meta } from '#meta';
|
|
12
10
|
|
|
13
11
|
export namespace AttentionAction {
|
|
14
|
-
const ATTENTION_ACTION = `${meta.id}
|
|
12
|
+
const ATTENTION_ACTION = `${meta.id}.action`;
|
|
15
13
|
|
|
16
|
-
export class Select extends Schema.TaggedClass<Select>()(`${ATTENTION_ACTION}
|
|
14
|
+
export class Select extends Schema.TaggedClass<Select>()(`${ATTENTION_ACTION}.select`, {
|
|
17
15
|
input: Schema.Struct({
|
|
18
16
|
contextId: Schema.String,
|
|
19
17
|
selection: SelectionSchema,
|
|
@@ -21,21 +19,3 @@ export namespace AttentionAction {
|
|
|
21
19
|
output: Schema.Void,
|
|
22
20
|
}) {}
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
export namespace AttentionOperation {
|
|
26
|
-
export const Select = Operation.make({
|
|
27
|
-
meta: {
|
|
28
|
-
key: `${meta.id}/operation/select`,
|
|
29
|
-
name: 'Select',
|
|
30
|
-
description: 'Select items in an attention context.',
|
|
31
|
-
},
|
|
32
|
-
services: [Capability.Service],
|
|
33
|
-
schema: {
|
|
34
|
-
input: Schema.Struct({
|
|
35
|
-
contextId: Schema.String.annotations({ description: 'The id of the attention context.' }),
|
|
36
|
-
selection: SelectionSchema.annotations({ description: 'The selection to apply.' }),
|
|
37
|
-
}),
|
|
38
|
-
output: Schema.Void,
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// src/types/capabilities.ts
|
|
2
|
-
import { Capability } from "@dxos/app-framework";
|
|
3
|
-
|
|
4
|
-
// src/meta.ts
|
|
5
|
-
import { trim } from "@dxos/util";
|
|
6
|
-
var meta = {
|
|
7
|
-
id: "dxos.org/plugin/attention",
|
|
8
|
-
name: "Attention",
|
|
9
|
-
description: trim`
|
|
10
|
-
Track and manage focused attention on objects across your workspace.
|
|
11
|
-
Highlight items requiring action and coordinate team focus on priority work.
|
|
12
|
-
`
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// src/types/capabilities.ts
|
|
16
|
-
(function(AttentionCapabilities2) {
|
|
17
|
-
AttentionCapabilities2.Attention = Capability.make(`${meta.id}/capability/attention`);
|
|
18
|
-
AttentionCapabilities2.Selection = Capability.make(`${meta.id}/capability/selection`);
|
|
19
|
-
})(AttentionCapabilities || (AttentionCapabilities = {}));
|
|
20
|
-
var AttentionCapabilities;
|
|
21
|
-
|
|
22
|
-
// src/types/events.ts
|
|
23
|
-
import { ActivationEvent } from "@dxos/app-framework";
|
|
24
|
-
(function(AttentionEvents2) {
|
|
25
|
-
AttentionEvents2.AttentionReady = ActivationEvent.make(`${meta.id}/event/attention-ready`);
|
|
26
|
-
})(AttentionEvents || (AttentionEvents = {}));
|
|
27
|
-
var AttentionEvents;
|
|
28
|
-
|
|
29
|
-
// src/types/types.ts
|
|
30
|
-
import * as Schema from "effect/Schema";
|
|
31
|
-
import { Capability as Capability2 } from "@dxos/app-framework";
|
|
32
|
-
import { Operation } from "@dxos/operation";
|
|
33
|
-
import { SelectionSchema } from "@dxos/react-ui-attention";
|
|
34
|
-
(function(AttentionAction2) {
|
|
35
|
-
const ATTENTION_ACTION = `${meta.id}/action`;
|
|
36
|
-
class Select extends Schema.TaggedClass()(`${ATTENTION_ACTION}/select`, {
|
|
37
|
-
input: Schema.Struct({
|
|
38
|
-
contextId: Schema.String,
|
|
39
|
-
selection: SelectionSchema
|
|
40
|
-
}),
|
|
41
|
-
output: Schema.Void
|
|
42
|
-
}) {
|
|
43
|
-
}
|
|
44
|
-
AttentionAction2.Select = Select;
|
|
45
|
-
})(AttentionAction || (AttentionAction = {}));
|
|
46
|
-
(function(AttentionOperation2) {
|
|
47
|
-
AttentionOperation2.Select = Operation.make({
|
|
48
|
-
meta: {
|
|
49
|
-
key: `${meta.id}/operation/select`,
|
|
50
|
-
name: "Select",
|
|
51
|
-
description: "Select items in an attention context."
|
|
52
|
-
},
|
|
53
|
-
services: [
|
|
54
|
-
Capability2.Service
|
|
55
|
-
],
|
|
56
|
-
schema: {
|
|
57
|
-
input: Schema.Struct({
|
|
58
|
-
contextId: Schema.String.annotations({
|
|
59
|
-
description: "The id of the attention context."
|
|
60
|
-
}),
|
|
61
|
-
selection: SelectionSchema.annotations({
|
|
62
|
-
description: "The selection to apply."
|
|
63
|
-
})
|
|
64
|
-
}),
|
|
65
|
-
output: Schema.Void
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
})(AttentionOperation || (AttentionOperation = {}));
|
|
69
|
-
var AttentionAction;
|
|
70
|
-
var AttentionOperation;
|
|
71
|
-
|
|
72
|
-
export {
|
|
73
|
-
meta,
|
|
74
|
-
AttentionCapabilities,
|
|
75
|
-
AttentionEvents,
|
|
76
|
-
AttentionAction,
|
|
77
|
-
AttentionOperation
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=chunk-ME5PHTSM.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/capabilities.ts", "../../../src/meta.ts", "../../../src/types/events.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { type AttentionManager, type SelectionManager } from '@dxos/react-ui-attention';\n\nimport { meta } from '../meta';\n\nexport namespace AttentionCapabilities {\n export const Attention = Capability.make<AttentionManager>(`${meta.id}/capability/attention`);\n export const Selection = Capability.make<SelectionManager>(`${meta.id}/capability/selection`);\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/attention',\n name: 'Attention',\n description: trim`\n Track and manage focused attention on objects across your workspace.\n Highlight items requiring action and coordinate team focus on priority work.\n `,\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\n\nexport namespace AttentionEvents {\n export const AttentionReady = ActivationEvent.make(`${meta.id}/event/attention-ready`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\nimport { SelectionSchema } from '@dxos/react-ui-attention';\n\nimport { meta } from '../meta';\n\nexport namespace AttentionAction {\n const ATTENTION_ACTION = `${meta.id}/action`;\n\n export class Select extends Schema.TaggedClass<Select>()(`${ATTENTION_ACTION}/select`, {\n input: Schema.Struct({\n contextId: Schema.String,\n selection: SelectionSchema,\n }),\n output: Schema.Void,\n }) {}\n}\n\nexport namespace AttentionOperation {\n export const Select = Operation.make({\n meta: {\n key: `${meta.id}/operation/select`,\n name: 'Select',\n description: 'Select items in an attention context.',\n },\n services: [Capability.Service],\n schema: {\n input: Schema.Struct({\n contextId: Schema.String.annotations({ description: 'The id of the attention context.' }),\n selection: SelectionSchema.annotations({ description: 'The selection to apply.' }),\n }),\n output: Schema.Void,\n },\n });\n}\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,kBAAkB;;;ACC3B,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;;;UDLiBC,wBAAAA;yBACFC,YAAYC,WAAWC,KAAuB,GAAGC,KAAKC,EAAE,uBAAuB;yBAC/EC,YAAYJ,WAAWC,KAAuB,GAAGC,KAAKC,EAAE,uBAAuB;AAC9F,GAHiBL,0BAAAA,wBAAAA,CAAAA,EAAAA;;;;AELjB,SAASO,uBAAuB;UAIfC,kBAAAA;mBACFC,iBAAiBC,gBAAgBC,KAAK,GAAGC,KAAKC,EAAE,wBAAwB;AACvF,GAFiBL,oBAAAA,kBAAAA,CAAAA,EAAAA;;;;ACJjB,YAAYM,YAAY;AAExB,SAASC,cAAAA,mBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;UAIfC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,KAAKC,EAAE;EAE5B,MAAMC,eAAsBC,mBAAW,EAAW,GAAGJ,gBAAAA,WAA2B;IACrFK,OAAcC,cAAO;MACnBC,WAAkBC;MAClBC,WAAWC;IACb,CAAA;IACAC,QAAeC;EACjB,CAAA,EAAA;EAAI;mBANST,SAAAA;AAOf,GAViBJ,oBAAAA,kBAAAA,CAAAA,EAAAA;UAYAc,qBAAAA;sBACFV,SAASW,UAAUC,KAAK;IACnCd,MAAM;MACJe,KAAK,GAAGf,KAAKC,EAAE;MACfe,MAAM;MACNC,aAAa;IACf;IACAC,UAAU;MAACC,YAAWC;;IACtBC,QAAQ;MACNjB,OAAcC,cAAO;QACnBC,WAAkBC,cAAOe,YAAY;UAAEL,aAAa;QAAmC,CAAA;QACvFT,WAAWC,gBAAgBa,YAAY;UAAEL,aAAa;QAA0B,CAAA;MAClF,CAAA;MACAP,QAAeC;IACjB;EACF,CAAA;AACF,GAhBiBC,uBAAAA,qBAAAA,CAAAA,EAAAA;;;",
|
|
6
|
-
"names": ["Capability", "trim", "meta", "id", "name", "description", "trim", "AttentionCapabilities", "Attention", "Capability", "make", "meta", "id", "Selection", "ActivationEvent", "AttentionEvents", "AttentionReady", "ActivationEvent", "make", "meta", "id", "Schema", "Capability", "Operation", "SelectionSchema", "AttentionAction", "ATTENTION_ACTION", "meta", "id", "Select", "TaggedClass", "input", "Struct", "contextId", "String", "selection", "SelectionSchema", "output", "Void", "AttentionOperation", "Operation", "make", "key", "name", "description", "services", "Capability", "Service", "schema", "annotations"]
|
|
7
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AttentionAction,
|
|
3
|
-
AttentionCapabilities,
|
|
4
|
-
AttentionEvents,
|
|
5
|
-
AttentionOperation,
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-ME5PHTSM.mjs";
|
|
8
|
-
|
|
9
|
-
// src/index.ts
|
|
10
|
-
export * from "@dxos/react-ui-attention";
|
|
11
|
-
|
|
12
|
-
// src/AttentionPlugin.ts
|
|
13
|
-
import * as Effect from "effect/Effect";
|
|
14
|
-
import { ActivationEvent, ActivationEvents, Capabilities, Capability as Capability4, Plugin } from "@dxos/app-framework";
|
|
15
|
-
import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
|
|
16
|
-
import { AttentionManager, SelectionManager } from "@dxos/react-ui-attention";
|
|
17
|
-
|
|
18
|
-
// src/capabilities/keyboard/index.ts
|
|
19
|
-
import { Capability } from "@dxos/app-framework";
|
|
20
|
-
var Keyboard = Capability.lazy("Keyboard", () => import("./keyboard-DI2TQRGK.mjs"));
|
|
21
|
-
|
|
22
|
-
// src/capabilities/operation-resolver/index.ts
|
|
23
|
-
import { Capability as Capability2 } from "@dxos/app-framework";
|
|
24
|
-
var OperationResolver = Capability2.lazy("OperationResolver", () => import("./operation-resolver-7VEZFZOX.mjs"));
|
|
25
|
-
|
|
26
|
-
// src/capabilities/react-context/index.ts
|
|
27
|
-
import { Capability as Capability3 } from "@dxos/app-framework";
|
|
28
|
-
var ReactContext = Capability3.lazy("ReactContext", () => import("./react-context-WX2SNCOW.mjs"));
|
|
29
|
-
|
|
30
|
-
// src/AttentionPlugin.ts
|
|
31
|
-
var AttentionPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationResolverModule({
|
|
32
|
-
activate: OperationResolver
|
|
33
|
-
}), Plugin.addModule({
|
|
34
|
-
id: "attention",
|
|
35
|
-
activatesOn: ActivationEvents.Startup,
|
|
36
|
-
activatesAfter: [
|
|
37
|
-
AttentionEvents.AttentionReady
|
|
38
|
-
],
|
|
39
|
-
activate: () => Effect.gen(function* () {
|
|
40
|
-
const registry = yield* Capability4.get(Capabilities.AtomRegistry);
|
|
41
|
-
const attention = new AttentionManager(registry);
|
|
42
|
-
const selection = new SelectionManager(registry);
|
|
43
|
-
setupDevtools(attention);
|
|
44
|
-
return [
|
|
45
|
-
Capability4.contributes(AttentionCapabilities.Attention, attention),
|
|
46
|
-
Capability4.contributes(AttentionCapabilities.Selection, selection)
|
|
47
|
-
];
|
|
48
|
-
})
|
|
49
|
-
}), Plugin.addModule({
|
|
50
|
-
activatesOn: ActivationEvents.Startup,
|
|
51
|
-
activate: ReactContext
|
|
52
|
-
}), Plugin.addModule({
|
|
53
|
-
activatesOn: ActivationEvent.allOf(AppActivationEvents.AppGraphReady, AttentionEvents.AttentionReady),
|
|
54
|
-
activate: Keyboard
|
|
55
|
-
}), Plugin.make);
|
|
56
|
-
var setupDevtools = (attention) => {
|
|
57
|
-
globalThis.composer ??= {};
|
|
58
|
-
globalThis.composer.attention = {
|
|
59
|
-
get manager() {
|
|
60
|
-
return attention;
|
|
61
|
-
},
|
|
62
|
-
get attended() {
|
|
63
|
-
return attention.getCurrent();
|
|
64
|
-
},
|
|
65
|
-
get currentSpace() {
|
|
66
|
-
for (const id of attention.getCurrent()) {
|
|
67
|
-
const [spaceId, objectId] = id.split(":");
|
|
68
|
-
if (spaceId && objectId && spaceId.length === 33) {
|
|
69
|
-
return spaceId;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
export {
|
|
76
|
-
AttentionAction,
|
|
77
|
-
AttentionCapabilities,
|
|
78
|
-
AttentionEvents,
|
|
79
|
-
AttentionOperation,
|
|
80
|
-
AttentionPlugin,
|
|
81
|
-
meta
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/AttentionPlugin.ts", "../../../src/capabilities/keyboard/index.ts", "../../../src/capabilities/operation-resolver/index.ts", "../../../src/capabilities/react-context/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport * from '@dxos/react-ui-attention';\n\nexport * from './AttentionPlugin';\nexport * from './meta';\nexport * from './types';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { ActivationEvent, ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { AttentionManager, SelectionManager } from '@dxos/react-ui-attention';\n\nimport { Keyboard, OperationResolver, ReactContext } from './capabilities';\nimport { meta } from './meta';\nimport { AttentionEvents } from './types';\nimport { AttentionCapabilities } from './types';\n\nexport const AttentionPlugin = Plugin.define(meta).pipe(\n AppPlugin.addOperationResolverModule({ activate: OperationResolver }),\n Plugin.addModule({\n id: 'attention',\n activatesOn: ActivationEvents.Startup,\n activatesAfter: [AttentionEvents.AttentionReady],\n activate: () =>\n Effect.gen(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const attention = new AttentionManager(registry);\n const selection = new SelectionManager(registry);\n setupDevtools(attention);\n return [\n Capability.contributes(AttentionCapabilities.Attention, attention),\n Capability.contributes(AttentionCapabilities.Selection, selection),\n ];\n }),\n }),\n Plugin.addModule({\n activatesOn: ActivationEvents.Startup,\n activate: ReactContext,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(AppActivationEvents.AppGraphReady, AttentionEvents.AttentionReady),\n activate: Keyboard,\n }),\n Plugin.make,\n);\n\nconst setupDevtools = (attention: AttentionManager) => {\n (globalThis as any).composer ??= {};\n\n (globalThis as any).composer.attention = {\n get manager() {\n return attention;\n },\n get attended() {\n return attention.getCurrent();\n },\n get currentSpace() {\n for (const id of attention.getCurrent()) {\n const [spaceId, objectId] = id.split(':');\n if (spaceId && objectId && spaceId.length === 33) {\n return spaceId;\n }\n }\n },\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const Keyboard = Capability.lazy('Keyboard', () => import('./keyboard'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const OperationResolver = Capability.lazy('OperationResolver', () => import('./operation-resolver'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactContext = Capability.lazy('ReactContext', () => import('./react-context'));\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,cAAc;;;ACAd,YAAYA,YAAY;AAExB,SAASC,iBAAiBC,kBAAkBC,cAAcC,cAAAA,aAAYC,cAAc;AACpF,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,kBAAkBC,wBAAwB;;;ACJnD,SAASC,kBAAkB;AAEpB,IAAMC,WAAWC,WAAWC,KAAK,YAAY,MAAM,OAAO,yBAAA,CAAA;;;ACFjE,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,oBAAoBC,YAAWC,KAAK,qBAAqB,MAAM,OAAO,mCAAA,CAAA;;;ACFnF,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,eAAeC,YAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;AHSlE,IAAMC,kBAAkBC,OAAOC,OAAOC,IAAAA,EAAMC,KACjDC,UAAUC,2BAA2B;EAAEC,UAAUC;AAAkB,CAAA,GACnEP,OAAOQ,UAAU;EACfC,IAAI;EACJC,aAAaC,iBAAiBC;EAC9BC,gBAAgB;IAACC,gBAAgBC;;EACjCT,UAAU,MACDU,WAAI,aAAA;AACT,UAAMC,WAAW,OAAOC,YAAWC,IAAIC,aAAaC,YAAY;AAChE,UAAMC,YAAY,IAAIC,iBAAiBN,QAAAA;AACvC,UAAMO,YAAY,IAAIC,iBAAiBR,QAAAA;AACvCS,kBAAcJ,SAAAA;AACd,WAAO;MACLJ,YAAWS,YAAYC,sBAAsBC,WAAWP,SAAAA;MACxDJ,YAAWS,YAAYC,sBAAsBE,WAAWN,SAAAA;;EAE5D,CAAA;AACJ,CAAA,GACAxB,OAAOQ,UAAU;EACfE,aAAaC,iBAAiBC;EAC9BN,UAAUyB;AACZ,CAAA,GACA/B,OAAOQ,UAAU;EACfE,aAAasB,gBAAgBC,MAAMC,oBAAoBC,eAAerB,gBAAgBC,cAAc;EACpGT,UAAU8B;AACZ,CAAA,GACApC,OAAOqC,IAAI;AAGb,IAAMX,gBAAgB,CAACJ,cAAAA;AACpBgB,aAAmBC,aAAa,CAAC;AAEjCD,aAAmBC,SAASjB,YAAY;IACvC,IAAIkB,UAAU;AACZ,aAAOlB;IACT;IACA,IAAImB,WAAW;AACb,aAAOnB,UAAUoB,WAAU;IAC7B;IACA,IAAIC,eAAe;AACjB,iBAAWlC,MAAMa,UAAUoB,WAAU,GAAI;AACvC,cAAM,CAACE,SAASC,QAAAA,IAAYpC,GAAGqC,MAAM,GAAA;AACrC,YAAIF,WAAWC,YAAYD,QAAQG,WAAW,IAAI;AAChD,iBAAOH;QACT;MACF;IACF;EACF;AACF;",
|
|
6
|
-
"names": ["Effect", "ActivationEvent", "ActivationEvents", "Capabilities", "Capability", "Plugin", "AppActivationEvents", "AppPlugin", "AttentionManager", "SelectionManager", "Capability", "Keyboard", "Capability", "lazy", "Capability", "OperationResolver", "Capability", "lazy", "Capability", "ReactContext", "Capability", "lazy", "AttentionPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addOperationResolverModule", "activate", "OperationResolver", "addModule", "id", "activatesOn", "ActivationEvents", "Startup", "activatesAfter", "AttentionEvents", "AttentionReady", "gen", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "attention", "AttentionManager", "selection", "SelectionManager", "setupDevtools", "contributes", "AttentionCapabilities", "Attention", "Selection", "ReactContext", "ActivationEvent", "allOf", "AppActivationEvents", "AppGraphReady", "Keyboard", "make", "globalThis", "composer", "manager", "attended", "getCurrent", "currentSpace", "spaceId", "objectId", "split", "length"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/keyboard/keyboard.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Keyboard } from '@dxos/keyboard';\nimport { Graph } from '@dxos/plugin-graph';\n\nimport { AttentionCapabilities } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n\n const unsubscribe = attention.subscribeCurrent((current) => {\n const id = current[0];\n const path = id && Graph.getPath(graph, { target: id }).pipe(Option.getOrNull);\n if (path) {\n Keyboard.singleton.setCurrentContext(path.join('/'));\n }\n });\n\n return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => unsubscribe()));\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,aAAa;AAItB,IAAA,mBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAM,EAAEC,MAAK,IAAK,OAAOH,WAAWI,IAAIC,gBAAgBC,QAAQ;AAChE,QAAMC,YAAY,OAAOP,WAAWI,IAAII,sBAAsBC,SAAS;AAEvE,QAAMC,cAAcH,UAAUI,iBAAiB,CAACC,YAAAA;AAC9C,UAAMC,KAAKD,QAAQ,CAAA;AACnB,UAAME,OAAOD,MAAME,MAAMC,QAAQb,OAAO;MAAEc,QAAQJ;IAAG,CAAA,EAAGK,KAAYC,gBAAS;AAC7E,QAAIL,MAAM;AACRM,eAASC,UAAUC,kBAAkBR,KAAKS,KAAK,GAAA,CAAA;IACjD;EACF,CAAA;AAEA,SAAOvB,WAAWwB,YAAYC,aAAaC,MAAM,MAAM,MAAaC,YAAK,MAAMjB,YAAAA,CAAAA,CAAAA;AACjF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Option", "Capabilities", "Capability", "AppCapabilities", "Keyboard", "Graph", "Capability", "makeModule", "fnUntraced", "graph", "get", "AppCapabilities", "AppGraph", "attention", "AttentionCapabilities", "Attention", "unsubscribe", "subscribeCurrent", "current", "id", "path", "Graph", "getPath", "target", "pipe", "getOrNull", "Keyboard", "singleton", "setCurrentContext", "join", "contributes", "Capabilities", "Null", "sync"]
|
|
7
|
-
}
|