@dxos/plugin-attention 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/chunk-55HTXC2G.mjs +39 -0
- package/dist/lib/browser/chunk-55HTXC2G.mjs.map +7 -0
- package/dist/lib/browser/chunk-BDLH2DQU.mjs +41 -0
- package/dist/lib/browser/chunk-BDLH2DQU.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +31 -42
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/select-HQCLOXD6.mjs +49 -0
- package/dist/lib/browser/select-HQCLOXD6.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -5
- package/dist/lib/node-esm/chunk-GWUE2YCZ.mjs +43 -0
- package/dist/lib/node-esm/chunk-GWUE2YCZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HQWPPQXC.mjs +40 -0
- package/dist/lib/node-esm/chunk-HQWPPQXC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +31 -42
- 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 +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/select-GLRAU6S2.mjs +50 -0
- package/dist/lib/node-esm/select-GLRAU6S2.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -5
- package/dist/types/src/AttentionPlugin.d.ts.map +1 -1
- 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 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +23 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -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/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 +26 -10
- package/src/AttentionPlugin.ts +14 -13
- package/src/capabilities/index.ts +9 -3
- package/src/capabilities/keyboard.ts +25 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-context/react-context.tsx → react-context.tsx} +5 -5
- package/src/index.ts +2 -5
- package/src/meta.ts +1 -1
- package/src/operations/definitions.ts +25 -0
- package/src/operations/index.ts +9 -0
- package/src/operations/select.ts +43 -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-TAZJL34O.mjs +0 -28
- package/dist/lib/browser/keyboard-TAZJL34O.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-ASXEHN3Z.mjs +0 -52
- package/dist/lib/browser/operation-resolver-ASXEHN3Z.mjs.map +0 -7
- package/dist/lib/browser/react-context-W4M7FAGI.mjs +0 -29
- package/dist/lib/browser/react-context-W4M7FAGI.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-BJQSQPEP.mjs +0 -29
- package/dist/lib/node-esm/keyboard-BJQSQPEP.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-EDMBCLWA.mjs +0 -53
- package/dist/lib/node-esm/operation-resolver-EDMBCLWA.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-JIC4NJXE.mjs +0 -30
- package/dist/lib/node-esm/react-context-JIC4NJXE.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/keyboard/keyboard.ts +0 -29
- 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.9be5663bfe",
|
|
4
4
|
"description": "Plugin for attention",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#meta": "./src/meta.ts",
|
|
18
|
+
"#operations": "./src/operations/index.ts",
|
|
19
|
+
"#types": "./src/types/index.ts"
|
|
20
|
+
},
|
|
15
21
|
"exports": {
|
|
16
22
|
".": {
|
|
17
23
|
"source": "./src/index.ts",
|
|
@@ -19,6 +25,12 @@
|
|
|
19
25
|
"browser": "./dist/lib/browser/index.mjs",
|
|
20
26
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
21
27
|
},
|
|
28
|
+
"./operations": {
|
|
29
|
+
"source": "./src/operations/index.ts",
|
|
30
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
31
|
+
"browser": "./dist/lib/browser/operations/index.mjs",
|
|
32
|
+
"node": "./dist/lib/node-esm/operations/index.mjs"
|
|
33
|
+
},
|
|
22
34
|
"./types": {
|
|
23
35
|
"source": "./src/types/index.ts",
|
|
24
36
|
"types": "./dist/types/src/types/index.d.ts",
|
|
@@ -31,6 +43,9 @@
|
|
|
31
43
|
"*": {
|
|
32
44
|
"types": [
|
|
33
45
|
"dist/types/src/types/index.d.ts"
|
|
46
|
+
],
|
|
47
|
+
"operations": [
|
|
48
|
+
"dist/types/src/operations/index.d.ts"
|
|
34
49
|
]
|
|
35
50
|
}
|
|
36
51
|
},
|
|
@@ -39,14 +54,15 @@
|
|
|
39
54
|
"src"
|
|
40
55
|
],
|
|
41
56
|
"dependencies": {
|
|
42
|
-
"effect": "3.
|
|
43
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
44
|
-
"@dxos/echo": "0.8.4-main.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
57
|
+
"effect": "3.20.0",
|
|
58
|
+
"@dxos/app-framework": "0.8.4-main.9be5663bfe",
|
|
59
|
+
"@dxos/echo": "0.8.4-main.9be5663bfe",
|
|
60
|
+
"@dxos/app-toolkit": "0.8.4-main.9be5663bfe",
|
|
61
|
+
"@dxos/plugin-graph": "0.8.4-main.9be5663bfe",
|
|
62
|
+
"@dxos/operation": "0.8.4-main.9be5663bfe",
|
|
63
|
+
"@dxos/react-ui-attention": "0.8.4-main.9be5663bfe",
|
|
64
|
+
"@dxos/keyboard": "0.8.4-main.9be5663bfe",
|
|
65
|
+
"@dxos/util": "0.8.4-main.9be5663bfe"
|
|
50
66
|
},
|
|
51
67
|
"devDependencies": {
|
|
52
68
|
"@types/react": "~19.2.7",
|
|
@@ -54,7 +70,7 @@
|
|
|
54
70
|
"react-dom": "~19.2.3"
|
|
55
71
|
},
|
|
56
72
|
"peerDependencies": {
|
|
57
|
-
"effect": "3.
|
|
73
|
+
"effect": "3.20.0",
|
|
58
74
|
"react": "~19.2.3",
|
|
59
75
|
"react-dom": "~19.2.3"
|
|
60
76
|
},
|
package/src/AttentionPlugin.ts
CHANGED
|
@@ -4,22 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { ActivationEvent,
|
|
7
|
+
import { ActivationEvent, ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
8
|
+
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
8
9
|
import { AttentionManager, SelectionManager } from '@dxos/react-ui-attention';
|
|
9
10
|
|
|
10
|
-
import { Keyboard,
|
|
11
|
-
import { meta } from '
|
|
12
|
-
import { AttentionEvents } from '
|
|
13
|
-
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';
|
|
14
15
|
|
|
15
16
|
export const AttentionPlugin = Plugin.define(meta).pipe(
|
|
17
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
16
18
|
Plugin.addModule({
|
|
17
19
|
id: 'attention',
|
|
18
|
-
activatesOn:
|
|
20
|
+
activatesOn: ActivationEvents.Startup,
|
|
19
21
|
activatesAfter: [AttentionEvents.AttentionReady],
|
|
20
22
|
activate: () =>
|
|
21
23
|
Effect.gen(function* () {
|
|
22
|
-
const registry = yield* Capability.get(
|
|
24
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
23
25
|
const attention = new AttentionManager(registry);
|
|
24
26
|
const selection = new SelectionManager(registry);
|
|
25
27
|
setupDevtools(attention);
|
|
@@ -30,14 +32,13 @@ export const AttentionPlugin = Plugin.define(meta).pipe(
|
|
|
30
32
|
}),
|
|
31
33
|
}),
|
|
32
34
|
Plugin.addModule({
|
|
33
|
-
activatesOn:
|
|
35
|
+
activatesOn: ActivationEvents.Startup,
|
|
34
36
|
activate: ReactContext,
|
|
35
37
|
}),
|
|
36
38
|
Plugin.addModule({
|
|
37
|
-
activatesOn: ActivationEvent.allOf(
|
|
39
|
+
activatesOn: ActivationEvent.allOf(AppActivationEvents.AppGraphReady, AttentionEvents.AttentionReady),
|
|
38
40
|
activate: Keyboard,
|
|
39
41
|
}),
|
|
40
|
-
Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
41
42
|
Plugin.make,
|
|
42
43
|
);
|
|
43
44
|
|
|
@@ -53,9 +54,9 @@ const setupDevtools = (attention: AttentionManager) => {
|
|
|
53
54
|
},
|
|
54
55
|
get currentSpace() {
|
|
55
56
|
for (const id of attention.getCurrent()) {
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
return
|
|
57
|
+
const segments = id.split('/');
|
|
58
|
+
if (segments.length > 1 && segments[1].length === 33) {
|
|
59
|
+
return segments[1];
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
},
|
|
@@ -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/operation';
|
|
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'));
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { Keyboard } from '@dxos/keyboard';
|
|
9
|
+
|
|
10
|
+
import { AttentionCapabilities } from '#types';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
15
|
+
|
|
16
|
+
const unsubscribe = attention.subscribeCurrent((current) => {
|
|
17
|
+
const id = current[0];
|
|
18
|
+
if (id) {
|
|
19
|
+
Keyboard.singleton.setCurrentContext(id);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => unsubscribe()));
|
|
24
|
+
}),
|
|
25
|
+
);
|
|
@@ -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/operation';
|
|
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
|
+
);
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React, { type PropsWithChildren } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { useCapability } from '@dxos/app-framework/
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
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(
|
|
17
|
-
Capability.contributes(
|
|
17
|
+
Capability.contributes(Capabilities.ReactContext, {
|
|
18
18
|
id: meta.id,
|
|
19
19
|
context: (props: PropsWithChildren) => {
|
|
20
20
|
const attention = useCapability(AttentionCapabilities.Attention);
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ 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.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/operation';
|
|
9
|
+
import { SelectionSchema } from '@dxos/react-ui-attention';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
13
|
+
export const Select = Operation.make({
|
|
14
|
+
meta: {
|
|
15
|
+
key: `${meta.id}.operation.select`,
|
|
16
|
+
name: 'Select',
|
|
17
|
+
description: 'Select items in an attention context.',
|
|
18
|
+
},
|
|
19
|
+
services: [Capability.Service],
|
|
20
|
+
input: Schema.Struct({
|
|
21
|
+
contextId: Schema.String.annotations({ description: 'The id of the attention context.' }),
|
|
22
|
+
selection: SelectionSchema.annotations({ description: 'The selection to apply.' }),
|
|
23
|
+
}),
|
|
24
|
+
output: Schema.Void,
|
|
25
|
+
});
|
|
@@ -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 { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { AttentionCapabilities } from '../types';
|
|
12
|
+
import { Select } from './definitions';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof Select> = Select.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fnUntraced(function* (input) {
|
|
17
|
+
const selection = yield* Capability.get(AttentionCapabilities.Selection);
|
|
18
|
+
Match.value(input.selection).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;
|
|
@@ -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,28 +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 { Capability, Common } from "@dxos/app-framework";
|
|
9
|
-
import { Keyboard } from "@dxos/keyboard";
|
|
10
|
-
import { Graph } from "@dxos/plugin-graph";
|
|
11
|
-
var keyboard_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
12
|
-
const { graph } = yield* Capability.get(Common.Capability.AppGraph);
|
|
13
|
-
const attention = yield* Capability.get(AttentionCapabilities.Attention);
|
|
14
|
-
const unsubscribe = attention.subscribeCurrent((current) => {
|
|
15
|
-
const id = current[0];
|
|
16
|
-
const path = id && Graph.getPath(graph, {
|
|
17
|
-
target: id
|
|
18
|
-
}).pipe(Option.getOrNull);
|
|
19
|
-
if (path) {
|
|
20
|
-
Keyboard.singleton.setCurrentContext(path.join("/"));
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return Capability.contributes(Common.Capability.Null, null, () => Effect.sync(() => unsubscribe()));
|
|
24
|
-
}));
|
|
25
|
-
export {
|
|
26
|
-
keyboard_default as default
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=keyboard-TAZJL34O.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 { Capability, Common } from '@dxos/app-framework';\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(Common.Capability.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(Common.Capability.Null, null, () => Effect.sync(() => unsubscribe()));\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,gBAAgB;AACzB,SAASC,aAAa;AAItB,IAAA,mBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAM,EAAEC,MAAK,IAAK,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,QAAQ;AAClE,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,YAAYnB,OAAOL,WAAWyB,MAAM,MAAM,MAAaC,YAAK,MAAMhB,YAAAA,CAAAA,CAAAA;AACtF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Option", "Capability", "Common", "Keyboard", "Graph", "Capability", "makeModule", "fnUntraced", "graph", "get", "Common", "AppGraph", "attention", "AttentionCapabilities", "Attention", "unsubscribe", "subscribeCurrent", "current", "id", "path", "Graph", "getPath", "target", "pipe", "getOrNull", "Keyboard", "singleton", "setCurrentContext", "join", "contributes", "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 { Capability, Common } from "@dxos/app-framework";
|
|
10
|
-
import { OperationResolver } from "@dxos/operation";
|
|
11
|
-
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
12
|
-
return Capability.contributes(Common.Capability.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-ASXEHN3Z.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 { Capability, Common } 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(Common.Capability.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,YAAYC,cAAc;AACnC,SAASC,yBAAyB;AAIlC,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,OAAOJ,WAAWK,mBAAmB;IACjEA,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", "Capability", "Common", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Common", "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 { Capability, Common } from "@dxos/app-framework";
|
|
10
|
-
import { useCapability } from "@dxos/app-framework/react";
|
|
11
|
-
import { RootAttentionProvider, SelectionProvider } from "@dxos/react-ui-attention";
|
|
12
|
-
var react_context_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.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-W4M7FAGI.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 { Capability, Common } from '@dxos/app-framework';\nimport { useCapability } from '@dxos/app-framework/react';\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(Common.Capability.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,YAAYC,cAAc;AACnC,SAASC,qBAAqB;AAC9B,SAASC,uBAAuBC,yBAAyB;AAKzD,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,cAAc;EACrDC,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", "Capability", "Common", "useCapability", "RootAttentionProvider", "SelectionProvider", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactContext", "id", "meta", "context", "props", "attention", "useCapability", "AttentionCapabilities", "Attention", "selection", "Selection", "RootAttentionProvider", "onChange", "nextAttended", "SelectionProvider", "children"]
|
|
7
|
-
}
|