@dxos/plugin-attention 0.8.4-main.84f28bd → 0.8.4-main.937b3ca
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-ME5PHTSM.mjs +79 -0
- package/dist/lib/browser/chunk-ME5PHTSM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +44 -43
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/keyboard-TAZJL34O.mjs +28 -0
- package/dist/lib/browser/keyboard-TAZJL34O.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-ASXEHN3Z.mjs +52 -0
- package/dist/lib/browser/operation-resolver-ASXEHN3Z.mjs.map +7 -0
- package/dist/lib/browser/{react-context-JVGQB2CO.mjs → react-context-W4M7FAGI.mjs} +11 -9
- package/dist/lib/browser/react-context-W4M7FAGI.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +13 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MIO5EA55.mjs +81 -0
- package/dist/lib/node-esm/chunk-MIO5EA55.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +44 -43
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/keyboard-BJQSQPEP.mjs +29 -0
- package/dist/lib/node-esm/keyboard-BJQSQPEP.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-EDMBCLWA.mjs +53 -0
- package/dist/lib/node-esm/operation-resolver-EDMBCLWA.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-SVXVOSRH.mjs → react-context-JIC4NJXE.mjs} +11 -9
- package/dist/lib/node-esm/react-context-JIC4NJXE.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +14 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/AttentionPlugin.d.ts +2 -1
- package/dist/types/src/AttentionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard/index.d.ts +3 -0
- package/dist/types/src/capabilities/keyboard/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/keyboard/keyboard.d.ts +5 -0
- package/dist/types/src/capabilities/keyboard/keyboard.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
- package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +7 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +68 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -17
- package/src/AttentionPlugin.ts +33 -29
- package/src/capabilities/index.ts +3 -6
- package/src/capabilities/keyboard/index.ts +7 -0
- package/src/capabilities/keyboard/keyboard.ts +29 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +45 -0
- package/src/capabilities/react-context/index.ts +7 -0
- package/src/capabilities/react-context/react-context.tsx +39 -0
- package/src/index.ts +1 -2
- package/src/meta.ts +8 -5
- package/src/types/capabilities.ts +13 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +7 -0
- package/src/types/types.ts +41 -0
- package/dist/lib/browser/chunk-O6FNOKYX.mjs +0 -21
- package/dist/lib/browser/chunk-O6FNOKYX.mjs.map +0 -7
- package/dist/lib/browser/keyboard-IYF35Z4E.mjs +0 -27
- package/dist/lib/browser/keyboard-IYF35Z4E.mjs.map +0 -7
- package/dist/lib/browser/react-context-JVGQB2CO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SVV7GQYN.mjs +0 -23
- package/dist/lib/node-esm/chunk-SVV7GQYN.mjs.map +0 -7
- package/dist/lib/node-esm/keyboard-GSUNGWNE.mjs +0 -28
- package/dist/lib/node-esm/keyboard-GSUNGWNE.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-SVXVOSRH.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -6
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/keyboard.d.ts +0 -4
- package/dist/types/src/capabilities/keyboard.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context.d.ts +0 -8
- package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -13
- package/src/capabilities/keyboard.ts +0 -26
- package/src/capabilities/react-context.tsx +0 -34
- package/src/events.ts +0 -11
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/events.ts"],"names":[],"mappings":"AAQA,yBAAiB,eAAe,CAAC;IACxB,MAAM,cAAc,+CAA2D,CAAC;CACxF"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type SelectionManager, type AttentionManager } from '@dxos/react-ui-attention';
|
|
7
|
-
|
|
8
|
-
import { ATTENTION_PLUGIN } from '../meta';
|
|
9
|
-
|
|
10
|
-
export namespace AttentionCapabilities {
|
|
11
|
-
export const Attention = defineCapability<AttentionManager>(`${ATTENTION_PLUGIN}/capability/attention`);
|
|
12
|
-
export const Selection = defineCapability<SelectionManager>(`${ATTENTION_PLUGIN}/capability/selection`);
|
|
13
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { effect } from '@preact/signals-core';
|
|
6
|
-
import { Option } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { Capabilities as AppCapabilities, contributes, type PluginContext } from '@dxos/app-framework';
|
|
9
|
-
import { Keyboard } from '@dxos/keyboard';
|
|
10
|
-
|
|
11
|
-
import { AttentionCapabilities } from './capabilities';
|
|
12
|
-
|
|
13
|
-
export default (context: PluginContext) => {
|
|
14
|
-
const { graph } = context.getCapability(AppCapabilities.AppGraph);
|
|
15
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
16
|
-
|
|
17
|
-
const unsubscribe = effect(() => {
|
|
18
|
-
const id = Array.from(attention.current)[0];
|
|
19
|
-
const path = id && graph.getPath({ target: id }).pipe(Option.getOrNull);
|
|
20
|
-
if (path) {
|
|
21
|
-
Keyboard.singleton.setCurrentContext(path.join('/'));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
return contributes(AppCapabilities.Null, null, () => unsubscribe());
|
|
26
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { RootAttentionProvider, SelectionProvider } from '@dxos/react-ui-attention';
|
|
9
|
-
|
|
10
|
-
import { AttentionCapabilities } from './capabilities';
|
|
11
|
-
import { ATTENTION_PLUGIN } from '../meta';
|
|
12
|
-
|
|
13
|
-
export default () =>
|
|
14
|
-
contributes(Capabilities.ReactContext, {
|
|
15
|
-
id: ATTENTION_PLUGIN,
|
|
16
|
-
context: (props: PropsWithChildren) => {
|
|
17
|
-
const attention = useCapability(AttentionCapabilities.Attention);
|
|
18
|
-
const selection = useCapability(AttentionCapabilities.Selection);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<RootAttentionProvider
|
|
22
|
-
attention={attention}
|
|
23
|
-
onChange={(nextAttended) => {
|
|
24
|
-
// TODO(Zan): Workout why this was in deck plugin. It didn't seem to work?
|
|
25
|
-
// if (layout.values.scrollIntoView && nextAttended.has(layout.values.scrollIntoView)) {
|
|
26
|
-
// layout.values.scrollIntoView = undefined;
|
|
27
|
-
// }
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
<SelectionProvider selection={selection}>{props.children}</SelectionProvider>
|
|
31
|
-
</RootAttentionProvider>
|
|
32
|
-
);
|
|
33
|
-
},
|
|
34
|
-
});
|
package/src/events.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineEvent } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { ATTENTION_PLUGIN } from './meta';
|
|
8
|
-
|
|
9
|
-
export namespace AttentionEvents {
|
|
10
|
-
export const AttentionReady = defineEvent(`${ATTENTION_PLUGIN}/event/attention-ready`);
|
|
11
|
-
}
|