@dxos/plugin-attention 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41
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/AttentionPlugin-ZPILA2LV.mjs +9 -0
- package/dist/lib/browser/AttentionPlugin-ZPILA2LV.mjs.map +7 -0
- package/dist/lib/browser/chunk-DPUSNLAH.mjs +60 -0
- package/dist/lib/browser/chunk-DPUSNLAH.mjs.map +7 -0
- package/dist/lib/browser/chunk-DTGSOFCE.mjs +41 -0
- package/dist/lib/browser/chunk-DTGSOFCE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +16 -75
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +7 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/plugin.mjs +7 -0
- package/dist/lib/browser/plugin.mjs.map +7 -0
- package/dist/lib/browser/select-CI2OLVWT.mjs +46 -0
- package/dist/lib/browser/select-CI2OLVWT.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -5
- package/dist/lib/node-esm/AttentionPlugin-66CVORUX.mjs +10 -0
- package/dist/lib/node-esm/AttentionPlugin-66CVORUX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ELMCOBE6.mjs +62 -0
- package/dist/lib/node-esm/chunk-ELMCOBE6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HMHKU4FO.mjs +43 -0
- package/dist/lib/node-esm/chunk-HMHKU4FO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +16 -74
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +9 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/plugin.mjs +8 -0
- package/dist/lib/node-esm/plugin.mjs.map +7 -0
- package/dist/lib/node-esm/select-QNJSO4Q5.mjs +47 -0
- package/dist/lib/node-esm/select-QNJSO4Q5.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -5
- 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 +5 -0
- 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/react-context.d.ts → react-context.d.ts} +1 -1
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -3
- 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 +2 -0
- package/dist/types/src/plugin.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 +32 -19
- 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 +5 -3
- package/src/meta.ts +2 -1
- package/src/operations/index.ts +7 -0
- package/src/operations/select.ts +43 -0
- package/src/plugin.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/keyboard-DI2TQRGK.mjs +0 -29
- package/dist/lib/browser/keyboard-DI2TQRGK.mjs.map +0 -7
- 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 +0 -29
- 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/keyboard-T6BIKQYG.mjs +0 -30
- package/dist/lib/node-esm/keyboard-T6BIKQYG.mjs.map +0 -7
- 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/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 +0 -5
- 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/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.1c7ec43d41",
|
|
4
4
|
"description": "Plugin for attention",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#plugin": "./src/AttentionPlugin.ts",
|
|
17
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
18
|
+
"#meta": "./src/meta.ts",
|
|
19
|
+
"#operations": "./src/operations/index.ts",
|
|
20
|
+
"#types": "./src/types/index.ts"
|
|
21
|
+
},
|
|
15
22
|
"exports": {
|
|
16
23
|
".": {
|
|
17
24
|
"source": "./src/index.ts",
|
|
@@ -19,6 +26,18 @@
|
|
|
19
26
|
"browser": "./dist/lib/browser/index.mjs",
|
|
20
27
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
21
28
|
},
|
|
29
|
+
"./operations": {
|
|
30
|
+
"source": "./src/operations/index.ts",
|
|
31
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
32
|
+
"browser": "./dist/lib/browser/operations/index.mjs",
|
|
33
|
+
"node": "./dist/lib/node-esm/operations/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"./plugin": {
|
|
36
|
+
"source": "./src/plugin.ts",
|
|
37
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
38
|
+
"browser": "./dist/lib/browser/plugin.mjs",
|
|
39
|
+
"node": "./dist/lib/node-esm/plugin.mjs"
|
|
40
|
+
},
|
|
22
41
|
"./types": {
|
|
23
42
|
"source": "./src/types/index.ts",
|
|
24
43
|
"types": "./dist/types/src/types/index.d.ts",
|
|
@@ -27,35 +46,29 @@
|
|
|
27
46
|
}
|
|
28
47
|
},
|
|
29
48
|
"types": "dist/types/src/index.d.ts",
|
|
30
|
-
"typesVersions": {
|
|
31
|
-
"*": {
|
|
32
|
-
"types": [
|
|
33
|
-
"dist/types/src/types/index.d.ts"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
49
|
"files": [
|
|
38
50
|
"dist",
|
|
39
51
|
"src"
|
|
40
52
|
],
|
|
41
53
|
"dependencies": {
|
|
42
|
-
"effect": "3.
|
|
43
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/app-toolkit": "0.8.4-main.
|
|
46
|
-
"@dxos/echo": "0.8.4-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/util": "0.8.4-main.
|
|
50
|
-
"@dxos/
|
|
54
|
+
"effect": "3.20.0",
|
|
55
|
+
"@dxos/app-framework": "0.8.4-main.1c7ec43d41",
|
|
56
|
+
"@dxos/compute": "0.8.4-main.1c7ec43d41",
|
|
57
|
+
"@dxos/app-toolkit": "0.8.4-main.1c7ec43d41",
|
|
58
|
+
"@dxos/echo": "0.8.4-main.1c7ec43d41",
|
|
59
|
+
"@dxos/keyboard": "0.8.4-main.1c7ec43d41",
|
|
60
|
+
"@dxos/plugin-graph": "0.8.4-main.1c7ec43d41",
|
|
61
|
+
"@dxos/util": "0.8.4-main.1c7ec43d41",
|
|
62
|
+
"@dxos/react-ui-attention": "0.8.4-main.1c7ec43d41"
|
|
51
63
|
},
|
|
52
64
|
"devDependencies": {
|
|
53
65
|
"@types/react": "~19.2.7",
|
|
54
66
|
"react": "~19.2.3",
|
|
55
|
-
"react-dom": "~19.2.3"
|
|
67
|
+
"react-dom": "~19.2.3",
|
|
68
|
+
"@dxos/plugin-graph": "0.8.4-main.1c7ec43d41"
|
|
56
69
|
},
|
|
57
70
|
"peerDependencies": {
|
|
58
|
-
"effect": "3.
|
|
71
|
+
"effect": "3.20.0",
|
|
59
72
|
"react": "~19.2.3",
|
|
60
73
|
"react-dom": "~19.2.3"
|
|
61
74
|
},
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { ActivationEvents, OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
8
|
+
import { createTestApp } from '@dxos/app-framework/testing';
|
|
9
|
+
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
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(), OperationPlugin(), RuntimePlugin(), 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.SetupOperationHandler);
|
|
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
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const AttentionPlugin = Plugin.lazy(meta, () => import('./AttentionPlugin'));
|
|
6
10
|
|
|
7
|
-
export * from './AttentionPlugin';
|
|
8
11
|
export * from './meta';
|
|
9
|
-
export * from './types';
|
package/src/meta.ts
CHANGED
|
@@ -6,10 +6,11 @@ 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
11
|
description: trim`
|
|
12
12
|
Track and manage focused attention on objects across your workspace.
|
|
13
13
|
Highlight items requiring action and coordinate team focus on priority work.
|
|
14
14
|
`,
|
|
15
|
+
tags: ['system'],
|
|
15
16
|
};
|
|
@@ -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
|
@@ -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,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AttentionCapabilities
|
|
3
|
-
} from "./chunk-ME5PHTSM.mjs";
|
|
4
|
-
|
|
5
|
-
// src/capabilities/keyboard/keyboard.ts
|
|
6
|
-
import * as Effect from "effect/Effect";
|
|
7
|
-
import * as Option from "effect/Option";
|
|
8
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
9
|
-
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
10
|
-
import { Keyboard } from "@dxos/keyboard";
|
|
11
|
-
import { Graph } from "@dxos/plugin-graph";
|
|
12
|
-
var keyboard_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
|
-
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
14
|
-
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
15
|
-
const unsubscribe = attention.subscribeCurrent((current) => {
|
|
16
|
-
const id = current[0];
|
|
17
|
-
const path = id && Graph.getPath(graph, {
|
|
18
|
-
target: id
|
|
19
|
-
}).pipe(Option.getOrNull);
|
|
20
|
-
if (path) {
|
|
21
|
-
Keyboard.singleton.setCurrentContext(path.join("/"));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => unsubscribe()));
|
|
25
|
-
}));
|
|
26
|
-
export {
|
|
27
|
-
keyboard_default as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=keyboard-DI2TQRGK.mjs.map
|
|
@@ -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
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AttentionCapabilities,
|
|
3
|
-
AttentionOperation
|
|
4
|
-
} from "./chunk-ME5PHTSM.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import * as Match from "effect/Match";
|
|
9
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
10
|
-
import { OperationResolver } from "@dxos/operation";
|
|
11
|
-
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
12
|
-
return Capability.contributes(Capabilities.OperationResolver, [
|
|
13
|
-
OperationResolver.make({
|
|
14
|
-
operation: AttentionOperation.Select,
|
|
15
|
-
handler: Effect.fnUntraced(function* (input) {
|
|
16
|
-
const selection = yield* Capability.get(AttentionCapabilities.Selection);
|
|
17
|
-
Match.value(input.selection).pipe(Match.when({
|
|
18
|
-
mode: "single",
|
|
19
|
-
id: void 0
|
|
20
|
-
}, () => {
|
|
21
|
-
selection.clearSelection(input.contextId);
|
|
22
|
-
}), Match.when({
|
|
23
|
-
mode: "single"
|
|
24
|
-
}, (s) => {
|
|
25
|
-
selection.updateSingle(input.contextId, s.id);
|
|
26
|
-
}), Match.when({
|
|
27
|
-
mode: "multi"
|
|
28
|
-
}, (s) => {
|
|
29
|
-
selection.updateMulti(input.contextId, s.ids);
|
|
30
|
-
}), Match.when({
|
|
31
|
-
mode: "range",
|
|
32
|
-
from: void 0,
|
|
33
|
-
to: void 0
|
|
34
|
-
}, () => {
|
|
35
|
-
selection.clearSelection(input.contextId);
|
|
36
|
-
}), Match.when({
|
|
37
|
-
mode: "range"
|
|
38
|
-
}, (s) => {
|
|
39
|
-
selection.updateRange(input.contextId, s.from, s.to);
|
|
40
|
-
}), Match.when({
|
|
41
|
-
mode: "multi-range"
|
|
42
|
-
}, (s) => {
|
|
43
|
-
selection.updateMultiRange(input.contextId, s.ranges);
|
|
44
|
-
}), Match.exhaustive);
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
]);
|
|
48
|
-
}));
|
|
49
|
-
export {
|
|
50
|
-
operation_resolver_default as default
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=operation-resolver-7VEZFZOX.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Match from 'effect/Match';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { OperationResolver } from '@dxos/operation';\n\nimport { AttentionCapabilities, AttentionOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n OperationResolver.make({\n operation: AttentionOperation.Select,\n handler: Effect.fnUntraced(function* (input) {\n const selection = yield* Capability.get(AttentionCapabilities.Selection);\n Match.value(input.selection).pipe(\n Match.when({ mode: 'single', id: undefined }, () => {\n selection.clearSelection(input.contextId);\n }),\n Match.when({ mode: 'single' }, (s) => {\n selection.updateSingle(input.contextId, s.id!);\n }),\n Match.when({ mode: 'multi' }, (s) => {\n selection.updateMulti(input.contextId, s.ids);\n }),\n Match.when({ mode: 'range', from: undefined, to: undefined }, () => {\n selection.clearSelection(input.contextId);\n }),\n Match.when({ mode: 'range' }, (s) => {\n selection.updateRange(input.contextId, s.from!, s.to!);\n }),\n Match.when({ mode: 'multi-range' }, (s) => {\n selection.updateMultiRange(input.contextId, s.ranges);\n }),\n Match.exhaustive,\n );\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AAEvB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,yBAAyB;AAIlC,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,aAAaC,mBAAmB;IAC5DA,kBAAkBC,KAAK;MACrBC,WAAWC,mBAAmBC;MAC9BC,SAAgBR,kBAAW,WAAWS,OAAK;AACzC,cAAMC,YAAY,OAAOZ,WAAWa,IAAIC,sBAAsBC,SAAS;AACvEC,QAAMC,YAAMN,MAAMC,SAAS,EAAEM,KACrBC,WAAK;UAAEC,MAAM;UAAUC,IAAIC;QAAU,GAAG,MAAA;AAC5CV,oBAAUW,eAAeZ,MAAMa,SAAS;QAC1C,CAAA,GACML,WAAK;UAAEC,MAAM;QAAS,GAAG,CAACK,MAAAA;AAC9Bb,oBAAUc,aAAaf,MAAMa,WAAWC,EAAEJ,EAAE;QAC9C,CAAA,GACMF,WAAK;UAAEC,MAAM;QAAQ,GAAG,CAACK,MAAAA;AAC7Bb,oBAAUe,YAAYhB,MAAMa,WAAWC,EAAEG,GAAG;QAC9C,CAAA,GACMT,WAAK;UAAEC,MAAM;UAASS,MAAMP;UAAWQ,IAAIR;QAAU,GAAG,MAAA;AAC5DV,oBAAUW,eAAeZ,MAAMa,SAAS;QAC1C,CAAA,GACML,WAAK;UAAEC,MAAM;QAAQ,GAAG,CAACK,MAAAA;AAC7Bb,oBAAUmB,YAAYpB,MAAMa,WAAWC,EAAEI,MAAOJ,EAAEK,EAAE;QACtD,CAAA,GACMX,WAAK;UAAEC,MAAM;QAAc,GAAG,CAACK,MAAAA;AACnCb,oBAAUoB,iBAAiBrB,MAAMa,WAAWC,EAAEQ,MAAM;QACtD,CAAA,GACMC,gBAAU;MAEpB,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Match", "Capabilities", "Capability", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "AttentionOperation", "Select", "handler", "input", "selection", "get", "AttentionCapabilities", "Selection", "Match", "value", "pipe", "when", "mode", "id", "undefined", "clearSelection", "contextId", "s", "updateSingle", "updateMulti", "ids", "from", "to", "updateRange", "updateMultiRange", "ranges", "exhaustive"]
|
|
7
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AttentionCapabilities,
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-ME5PHTSM.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/react-context/react-context.tsx
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import React from "react";
|
|
9
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
10
|
-
import { useCapability } from "@dxos/app-framework/ui";
|
|
11
|
-
import { RootAttentionProvider, SelectionProvider } from "@dxos/react-ui-attention";
|
|
12
|
-
var react_context_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactContext, {
|
|
13
|
-
id: meta.id,
|
|
14
|
-
context: (props) => {
|
|
15
|
-
const attention = useCapability(AttentionCapabilities.Attention);
|
|
16
|
-
const selection = useCapability(AttentionCapabilities.Selection);
|
|
17
|
-
return /* @__PURE__ */ React.createElement(RootAttentionProvider, {
|
|
18
|
-
attention,
|
|
19
|
-
onChange: (nextAttended) => {
|
|
20
|
-
}
|
|
21
|
-
}, /* @__PURE__ */ React.createElement(SelectionProvider, {
|
|
22
|
-
selection
|
|
23
|
-
}, props.children));
|
|
24
|
-
}
|
|
25
|
-
})));
|
|
26
|
-
export {
|
|
27
|
-
react_context_default as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=react-context-WX2SNCOW.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-context/react-context.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { RootAttentionProvider, SelectionProvider } from '@dxos/react-ui-attention';\n\nimport { meta } from '../../meta';\nimport { AttentionCapabilities } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactContext, {\n id: meta.id,\n context: (props: PropsWithChildren) => {\n const attention = useCapability(AttentionCapabilities.Attention);\n const selection = useCapability(AttentionCapabilities.Selection);\n\n return (\n <RootAttentionProvider\n attention={attention}\n onChange={(nextAttended) => {\n // TODO(Zan): Workout why this was in deck plugin. It didn't seem to work?\n // if (layout.values.scrollIntoView && nextAttended.has(layout.values.scrollIntoView)) {\n // layout.values.scrollIntoView = undefined;\n // }\n }}\n >\n <SelectionProvider selection={selection}>{props.children}</SelectionProvider>\n </RootAttentionProvider>\n );\n },\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAuC;AAE9C,SAASC,cAAcC,kBAAkB;AACzC,SAASC,qBAAqB;AAC9B,SAASC,uBAAuBC,yBAAyB;AAKzD,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,IAAIC,KAAKD;EACTE,SAAS,CAACC,UAAAA;AACR,UAAMC,YAAYC,cAAcC,sBAAsBC,SAAS;AAC/D,UAAMC,YAAYH,cAAcC,sBAAsBG,SAAS;AAE/D,WACE,sBAAA,cAACC,uBAAAA;MACCN;MACAO,UAAU,CAACC,iBAAAA;MAKX;OAEA,sBAAA,cAACC,mBAAAA;MAAkBL;OAAuBL,MAAMW,QAAQ,CAAA;EAG9D;AACF,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capabilities", "Capability", "useCapability", "RootAttentionProvider", "SelectionProvider", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactContext", "id", "meta", "context", "props", "attention", "useCapability", "AttentionCapabilities", "Attention", "selection", "Selection", "RootAttentionProvider", "onChange", "nextAttended", "SelectionProvider", "children"]
|
|
7
|
-
}
|