@dxos/plugin-attention 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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 +47 -52
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/keyboard-DI2TQRGK.mjs +29 -0
- package/dist/lib/browser/keyboard-DI2TQRGK.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-7VEZFZOX.mjs +52 -0
- package/dist/lib/browser/operation-resolver-7VEZFZOX.mjs.map +7 -0
- package/dist/lib/browser/{react-context-7HCRTOWZ.mjs → react-context-WX2SNCOW.mjs} +9 -9
- package/dist/lib/browser/react-context-WX2SNCOW.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +9 -4
- 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 +47 -52
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/keyboard-T6BIKQYG.mjs +30 -0
- package/dist/lib/node-esm/keyboard-T6BIKQYG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-4YES2MF3.mjs +53 -0
- package/dist/lib/node-esm/operation-resolver-4YES2MF3.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-7RDGSUXD.mjs → react-context-LNH7DILM.mjs} +9 -9
- package/dist/lib/node-esm/react-context-LNH7DILM.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +9 -4
- 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 -8
- 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 -2
- 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 +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +36 -0
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -15
- package/src/AttentionPlugin.ts +31 -30
- package/src/capabilities/index.ts +3 -7
- package/src/capabilities/keyboard/index.ts +7 -0
- package/src/capabilities/keyboard/keyboard.ts +30 -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 +7 -2
- package/src/types/capabilities.ts +13 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +2 -0
- package/src/types/types.ts +20 -0
- package/dist/lib/browser/chunk-EJ4ELAEO.mjs +0 -16
- package/dist/lib/browser/chunk-EJ4ELAEO.mjs.map +0 -7
- package/dist/lib/browser/chunk-NMXGUHSU.mjs +0 -10
- package/dist/lib/browser/chunk-NMXGUHSU.mjs.map +0 -7
- package/dist/lib/browser/chunk-SBLZSJTD.mjs +0 -25
- package/dist/lib/browser/chunk-SBLZSJTD.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-C3JE25O5.mjs +0 -51
- package/dist/lib/browser/intent-resolver-C3JE25O5.mjs.map +0 -7
- package/dist/lib/browser/keyboard-H7IAAFBN.mjs +0 -28
- package/dist/lib/browser/keyboard-H7IAAFBN.mjs.map +0 -7
- package/dist/lib/browser/react-context-7HCRTOWZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FKQHPGTA.mjs +0 -17
- package/dist/lib/node-esm/chunk-FKQHPGTA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GC4PRMVZ.mjs +0 -12
- package/dist/lib/node-esm/chunk-GC4PRMVZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YNOCLBTT.mjs +0 -26
- package/dist/lib/node-esm/chunk-YNOCLBTT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-2IB4I23V.mjs +0 -52
- package/dist/lib/node-esm/intent-resolver-2IB4I23V.mjs.map +0 -7
- package/dist/lib/node-esm/keyboard-Y32WSEOC.mjs +0 -29
- package/dist/lib/node-esm/keyboard-Y32WSEOC.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-7RDGSUXD.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/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.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/intent-resolver.ts +0 -43
- package/src/capabilities/keyboard.ts +0 -26
- package/src/capabilities/react-context.tsx +0 -35
- package/src/events.ts +0 -11
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/attention',\n name: 'Attention',\n};\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,OAAmB;EAC9BC,IAAI;EACJC,MAAM;AACR;",
|
|
6
|
-
"names": ["meta", "id", "name"]
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-GC4PRMVZ.mjs";
|
|
5
|
-
|
|
6
|
-
// src/types/types.ts
|
|
7
|
-
import * as Schema from "effect/Schema";
|
|
8
|
-
import { SelectionSchema } from "@dxos/react-ui-attention";
|
|
9
|
-
(function(AttentionAction2) {
|
|
10
|
-
const ATTENTION_ACTION = `${meta.id}/action`;
|
|
11
|
-
class Select extends Schema.TaggedClass()(`${ATTENTION_ACTION}/select`, {
|
|
12
|
-
input: Schema.Struct({
|
|
13
|
-
contextId: Schema.String,
|
|
14
|
-
selection: SelectionSchema
|
|
15
|
-
}),
|
|
16
|
-
output: Schema.Void
|
|
17
|
-
}) {
|
|
18
|
-
}
|
|
19
|
-
AttentionAction2.Select = Select;
|
|
20
|
-
})(AttentionAction || (AttentionAction = {}));
|
|
21
|
-
var AttentionAction;
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
AttentionAction
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=chunk-YNOCLBTT.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\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"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,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;;",
|
|
6
|
-
"names": ["Schema", "SelectionSchema", "AttentionAction", "ATTENTION_ACTION", "meta", "id", "Select", "TaggedClass", "input", "Struct", "contextId", "String", "selection", "SelectionSchema", "output", "Void"]
|
|
7
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AttentionAction
|
|
4
|
-
} from "./chunk-YNOCLBTT.mjs";
|
|
5
|
-
import {
|
|
6
|
-
AttentionCapabilities
|
|
7
|
-
} from "./chunk-FKQHPGTA.mjs";
|
|
8
|
-
import "./chunk-GC4PRMVZ.mjs";
|
|
9
|
-
|
|
10
|
-
// src/capabilities/intent-resolver.ts
|
|
11
|
-
import * as Match from "effect/Match";
|
|
12
|
-
import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
|
|
13
|
-
var intent_resolver_default = ((context) => contributes(Capabilities.IntentResolver, [
|
|
14
|
-
createResolver({
|
|
15
|
-
intent: AttentionAction.Select,
|
|
16
|
-
resolve: (data) => {
|
|
17
|
-
const selection = context.getCapability(AttentionCapabilities.Selection);
|
|
18
|
-
Match.type().pipe(Match.when({
|
|
19
|
-
mode: "single",
|
|
20
|
-
id: void 0
|
|
21
|
-
}, () => {
|
|
22
|
-
selection.clearSelection(data.contextId);
|
|
23
|
-
}), Match.when({
|
|
24
|
-
mode: "single"
|
|
25
|
-
}, (s) => {
|
|
26
|
-
selection.updateSingle(data.contextId, s.id);
|
|
27
|
-
}), Match.when({
|
|
28
|
-
mode: "multi"
|
|
29
|
-
}, (s) => {
|
|
30
|
-
selection.updateMulti(data.contextId, s.ids);
|
|
31
|
-
}), Match.when({
|
|
32
|
-
mode: "range",
|
|
33
|
-
from: void 0,
|
|
34
|
-
to: void 0
|
|
35
|
-
}, () => {
|
|
36
|
-
selection.clearSelection(data.contextId);
|
|
37
|
-
}), Match.when({
|
|
38
|
-
mode: "range"
|
|
39
|
-
}, (s) => {
|
|
40
|
-
selection.updateRange(data.contextId, s.from, s.to);
|
|
41
|
-
}), Match.when({
|
|
42
|
-
mode: "multi-range"
|
|
43
|
-
}, (s) => {
|
|
44
|
-
selection.updateMultiRange(data.contextId, s.ranges);
|
|
45
|
-
}), Match.exhaustive)(data.selection);
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
]));
|
|
49
|
-
export {
|
|
50
|
-
intent_resolver_default as default
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=intent-resolver-2IB4I23V.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\n\nimport { Capabilities, type PluginContext, contributes, createResolver } from '@dxos/app-framework';\nimport { type Selection } from '@dxos/react-ui-attention';\n\nimport { AttentionAction } from '../types';\n\nimport { AttentionCapabilities } from './capabilities';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: AttentionAction.Select,\n resolve: (data) => {\n const selection = context.getCapability(AttentionCapabilities.Selection);\n Match.type<Selection>().pipe(\n Match.when({ mode: 'single', id: undefined }, () => {\n selection.clearSelection(data.contextId);\n }),\n Match.when({ mode: 'single' }, (s) => {\n selection.updateSingle(data.contextId, s.id!);\n }),\n Match.when({ mode: 'multi' }, (s) => {\n selection.updateMulti(data.contextId, s.ids);\n }),\n Match.when({ mode: 'range', from: undefined, to: undefined }, () => {\n selection.clearSelection(data.contextId);\n }),\n Match.when({ mode: 'range' }, (s) => {\n selection.updateRange(data.contextId, s.from!, s.to!);\n }),\n Match.when({ mode: 'multi-range' }, (s) => {\n selection.updateMultiRange(data.contextId, s.ranges);\n }),\n Match.exhaustive,\n )(data.selection);\n },\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,YAAYA,WAAW;AAEvB,SAASC,cAAkCC,aAAaC,sBAAsB;AAO9E,IAAA,2BAAe,CAACC,YACdC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,gBAAgBC;IACxBC,SAAS,CAACC,SAAAA;AACR,YAAMC,YAAYV,QAAQW,cAAcC,sBAAsBC,SAAS;AACvEC,MAAMC,WAAI,EAAcC,KAChBC,WAAK;QAAEC,MAAM;QAAUC,IAAIC;MAAU,GAAG,MAAA;AAC5CV,kBAAUW,eAAeZ,KAAKa,SAAS;MACzC,CAAA,GACML,WAAK;QAAEC,MAAM;MAAS,GAAG,CAACK,MAAAA;AAC9Bb,kBAAUc,aAAaf,KAAKa,WAAWC,EAAEJ,EAAE;MAC7C,CAAA,GACMF,WAAK;QAAEC,MAAM;MAAQ,GAAG,CAACK,MAAAA;AAC7Bb,kBAAUe,YAAYhB,KAAKa,WAAWC,EAAEG,GAAG;MAC7C,CAAA,GACMT,WAAK;QAAEC,MAAM;QAASS,MAAMP;QAAWQ,IAAIR;MAAU,GAAG,MAAA;AAC5DV,kBAAUW,eAAeZ,KAAKa,SAAS;MACzC,CAAA,GACML,WAAK;QAAEC,MAAM;MAAQ,GAAG,CAACK,MAAAA;AAC7Bb,kBAAUmB,YAAYpB,KAAKa,WAAWC,EAAEI,MAAOJ,EAAEK,EAAE;MACrD,CAAA,GACMX,WAAK;QAAEC,MAAM;MAAc,GAAG,CAACK,MAAAA;AACnCb,kBAAUoB,iBAAiBrB,KAAKa,WAAWC,EAAEQ,MAAM;MACrD,CAAA,GACMC,gBAAU,EAChBvB,KAAKC,SAAS;IAClB;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["Match", "Capabilities", "contributes", "createResolver", "context", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "AttentionAction", "Select", "resolve", "data", "selection", "getCapability", "AttentionCapabilities", "Selection", "Match", "type", "pipe", "when", "mode", "id", "undefined", "clearSelection", "contextId", "s", "updateSingle", "updateMulti", "ids", "from", "to", "updateRange", "updateMultiRange", "ranges", "exhaustive"]
|
|
7
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AttentionCapabilities
|
|
4
|
-
} from "./chunk-FKQHPGTA.mjs";
|
|
5
|
-
import "./chunk-GC4PRMVZ.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/keyboard.ts
|
|
8
|
-
import { effect } from "@preact/signals-core";
|
|
9
|
-
import * as Option from "effect/Option";
|
|
10
|
-
import { Capabilities as AppCapabilities, contributes } from "@dxos/app-framework";
|
|
11
|
-
import { Keyboard } from "@dxos/keyboard";
|
|
12
|
-
var keyboard_default = ((context) => {
|
|
13
|
-
const { graph } = context.getCapability(AppCapabilities.AppGraph);
|
|
14
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
15
|
-
const unsubscribe = effect(() => {
|
|
16
|
-
const id = Array.from(attention.current)[0];
|
|
17
|
-
const path = id && graph.getPath({
|
|
18
|
-
target: id
|
|
19
|
-
}).pipe(Option.getOrNull);
|
|
20
|
-
if (path) {
|
|
21
|
-
Keyboard.singleton.setCurrentContext(path.join("/"));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return contributes(AppCapabilities.Null, null, () => unsubscribe());
|
|
25
|
-
});
|
|
26
|
-
export {
|
|
27
|
-
keyboard_default as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=keyboard-Y32WSEOC.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/keyboard.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities as AppCapabilities, type PluginContext, contributes } from '@dxos/app-framework';\nimport { Keyboard } from '@dxos/keyboard';\n\nimport { AttentionCapabilities } from './capabilities';\n\nexport default (context: PluginContext) => {\n const { graph } = context.getCapability(AppCapabilities.AppGraph);\n const attention = context.getCapability(AttentionCapabilities.Attention);\n\n const unsubscribe = effect(() => {\n const id = Array.from(attention.current)[0];\n const path = id && graph.getPath({ target: id }).pipe(Option.getOrNull);\n if (path) {\n Keyboard.singleton.setCurrentContext(path.join('/'));\n }\n });\n\n return contributes(AppCapabilities.Null, null, () => unsubscribe());\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,SAASA,cAAc;AACvB,YAAYC,YAAY;AAExB,SAASC,gBAAgBC,iBAAqCC,mBAAmB;AACjF,SAASC,gBAAgB;AAIzB,IAAA,oBAAe,CAACC,YAAAA;AACd,QAAM,EAAEC,MAAK,IAAKD,QAAQE,cAAcC,gBAAgBC,QAAQ;AAChE,QAAMC,YAAYL,QAAQE,cAAcI,sBAAsBC,SAAS;AAEvE,QAAMC,cAAcC,OAAO,MAAA;AACzB,UAAMC,KAAKC,MAAMC,KAAKP,UAAUQ,OAAO,EAAE,CAAA;AACzC,UAAMC,OAAOJ,MAAMT,MAAMc,QAAQ;MAAEC,QAAQN;IAAG,CAAA,EAAGO,KAAYC,gBAAS;AACtE,QAAIJ,MAAM;AACRK,eAASC,UAAUC,kBAAkBP,KAAKQ,KAAK,GAAA,CAAA;IACjD;EACF,CAAA;AAEA,SAAOC,YAAYpB,gBAAgBqB,MAAM,MAAM,MAAMhB,YAAAA,CAAAA;AACvD;",
|
|
6
|
-
"names": ["effect", "Option", "Capabilities", "AppCapabilities", "contributes", "Keyboard", "context", "graph", "getCapability", "AppCapabilities", "AppGraph", "attention", "AttentionCapabilities", "Attention", "unsubscribe", "effect", "id", "Array", "from", "current", "path", "getPath", "target", "pipe", "getOrNull", "Keyboard", "singleton", "setCurrentContext", "join", "contributes", "Null"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-context.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Capabilities, contributes, useCapability } from '@dxos/app-framework';\nimport { RootAttentionProvider, SelectionProvider } from '@dxos/react-ui-attention';\n\nimport { meta } from '../meta';\n\nimport { AttentionCapabilities } from './capabilities';\n\nexport default () =>\n 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"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,OAAOA,WAAuC;AAE9C,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,uBAAuBC,yBAAyB;AAMzD,IAAA,yBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,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;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "useCapability", "RootAttentionProvider", "SelectionProvider", "contributes", "Capabilities", "ReactContext", "id", "meta", "context", "props", "attention", "useCapability", "AttentionCapabilities", "Attention", "selection", "Selection", "RootAttentionProvider", "onChange", "nextAttended", "SelectionProvider", "children"]
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type AttentionManager, type SelectionManager } from '@dxos/react-ui-attention';
|
|
2
|
-
export declare namespace AttentionCapabilities {
|
|
3
|
-
const Attention: import("@dxos/app-framework").InterfaceDef<AttentionManager>;
|
|
4
|
-
const Selection: import("@dxos/app-framework").InterfaceDef<SelectionManager>;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/capabilities.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIxF,yBAAiB,qBAAqB,CAAC;IAC9B,MAAM,SAAS,8DAAwE,CAAC;IACxF,MAAM,SAAS,8DAAwE,CAAC;CAChG"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Capabilities, type PluginContext } from '@dxos/app-framework';
|
|
2
|
-
declare const _default: (context: PluginContext) => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Capabilities.IntentResolver>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
//# sourceMappingURL=intent-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAA+B,MAAM,qBAAqB,CAAC;yBAOpF,SAAS,aAAa;AAAtC,wBA6BK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/keyboard.ts"],"names":[],"mappings":"AAOA,OAAO,EAAmC,KAAK,aAAa,EAAe,MAAM,qBAAqB,CAAC;yBAKvF,SAAS,aAAa;AAAtC,wBAaE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Readonly<{
|
|
3
|
-
id: string;
|
|
4
|
-
dependsOn?: string[];
|
|
5
|
-
context: React.FC<PropsWithChildren>;
|
|
6
|
-
}>>>;
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=react-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-context.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-context.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;;;;;;AAStD,wBAqBK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/events.ts"],"names":[],"mappings":"AAQA,yBAAiB,eAAe,CAAC;IACxB,MAAM,cAAc,+CAAkD,CAAC;CAC/E"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type AttentionManager, type SelectionManager } from '@dxos/react-ui-attention';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
|
|
10
|
-
export namespace AttentionCapabilities {
|
|
11
|
-
export const Attention = defineCapability<AttentionManager>(`${meta.id}/capability/attention`);
|
|
12
|
-
export const Selection = defineCapability<SelectionManager>(`${meta.id}/capability/selection`);
|
|
13
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Match from 'effect/Match';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type PluginContext, contributes, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { type Selection } from '@dxos/react-ui-attention';
|
|
9
|
-
|
|
10
|
-
import { AttentionAction } from '../types';
|
|
11
|
-
|
|
12
|
-
import { AttentionCapabilities } from './capabilities';
|
|
13
|
-
|
|
14
|
-
export default (context: PluginContext) =>
|
|
15
|
-
contributes(Capabilities.IntentResolver, [
|
|
16
|
-
createResolver({
|
|
17
|
-
intent: AttentionAction.Select,
|
|
18
|
-
resolve: (data) => {
|
|
19
|
-
const selection = context.getCapability(AttentionCapabilities.Selection);
|
|
20
|
-
Match.type<Selection>().pipe(
|
|
21
|
-
Match.when({ mode: 'single', id: undefined }, () => {
|
|
22
|
-
selection.clearSelection(data.contextId);
|
|
23
|
-
}),
|
|
24
|
-
Match.when({ mode: 'single' }, (s) => {
|
|
25
|
-
selection.updateSingle(data.contextId, s.id!);
|
|
26
|
-
}),
|
|
27
|
-
Match.when({ mode: 'multi' }, (s) => {
|
|
28
|
-
selection.updateMulti(data.contextId, s.ids);
|
|
29
|
-
}),
|
|
30
|
-
Match.when({ mode: 'range', from: undefined, to: undefined }, () => {
|
|
31
|
-
selection.clearSelection(data.contextId);
|
|
32
|
-
}),
|
|
33
|
-
Match.when({ mode: 'range' }, (s) => {
|
|
34
|
-
selection.updateRange(data.contextId, s.from!, s.to!);
|
|
35
|
-
}),
|
|
36
|
-
Match.when({ mode: 'multi-range' }, (s) => {
|
|
37
|
-
selection.updateMultiRange(data.contextId, s.ranges);
|
|
38
|
-
}),
|
|
39
|
-
Match.exhaustive,
|
|
40
|
-
)(data.selection);
|
|
41
|
-
},
|
|
42
|
-
}),
|
|
43
|
-
]);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { effect } from '@preact/signals-core';
|
|
6
|
-
import * as Option from 'effect/Option';
|
|
7
|
-
|
|
8
|
-
import { Capabilities as AppCapabilities, type PluginContext, contributes } 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,35 +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 { meta } from '../meta';
|
|
11
|
-
|
|
12
|
-
import { AttentionCapabilities } from './capabilities';
|
|
13
|
-
|
|
14
|
-
export default () =>
|
|
15
|
-
contributes(Capabilities.ReactContext, {
|
|
16
|
-
id: meta.id,
|
|
17
|
-
context: (props: PropsWithChildren) => {
|
|
18
|
-
const attention = useCapability(AttentionCapabilities.Attention);
|
|
19
|
-
const selection = useCapability(AttentionCapabilities.Selection);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<RootAttentionProvider
|
|
23
|
-
attention={attention}
|
|
24
|
-
onChange={(nextAttended) => {
|
|
25
|
-
// TODO(Zan): Workout why this was in deck plugin. It didn't seem to work?
|
|
26
|
-
// if (layout.values.scrollIntoView && nextAttended.has(layout.values.scrollIntoView)) {
|
|
27
|
-
// layout.values.scrollIntoView = undefined;
|
|
28
|
-
// }
|
|
29
|
-
}}
|
|
30
|
-
>
|
|
31
|
-
<SelectionProvider selection={selection}>{props.children}</SelectionProvider>
|
|
32
|
-
</RootAttentionProvider>
|
|
33
|
-
);
|
|
34
|
-
},
|
|
35
|
-
});
|
package/src/events.ts
DELETED