@dxos/plugin-attention 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
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-7NDMCDGN.mjs +25 -0
- package/dist/lib/browser/chunk-7NDMCDGN.mjs.map +7 -0
- package/dist/lib/browser/chunk-EJ4ELAEO.mjs +16 -0
- package/dist/lib/browser/chunk-EJ4ELAEO.mjs.map +7 -0
- package/dist/lib/browser/chunk-NMXGUHSU.mjs +10 -0
- package/dist/lib/browser/chunk-NMXGUHSU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +17 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-OKED4HZY.mjs +51 -0
- package/dist/lib/browser/intent-resolver-OKED4HZY.mjs.map +7 -0
- package/dist/lib/browser/{keyboard-IYF35Z4E.mjs → keyboard-W57BF67Q.mjs} +5 -4
- package/dist/lib/{node-esm/keyboard-GSUNGWNE.mjs.map → browser/keyboard-W57BF67Q.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-JVGQB2CO.mjs → react-context-7HCRTOWZ.mjs} +8 -6
- package/dist/lib/browser/react-context-7HCRTOWZ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FKQHPGTA.mjs +17 -0
- package/dist/lib/node-esm/chunk-FKQHPGTA.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GC4PRMVZ.mjs +12 -0
- package/dist/lib/node-esm/chunk-GC4PRMVZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ICOLCHKJ.mjs +26 -0
- package/dist/lib/node-esm/chunk-ICOLCHKJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +17 -10
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-BCFMWW34.mjs +52 -0
- package/dist/lib/node-esm/intent-resolver-BCFMWW34.mjs.map +7 -0
- package/dist/lib/node-esm/{keyboard-GSUNGWNE.mjs → keyboard-HCCT23BE.mjs} +5 -4
- package/dist/lib/{browser/keyboard-IYF35Z4E.mjs.map → node-esm/keyboard-HCCT23BE.mjs.map} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-context-SVXVOSRH.mjs → react-context-7RDGSUXD.mjs} +8 -6
- package/dist/lib/node-esm/react-context-7RDGSUXD.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +9 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/AttentionPlugin.d.ts +1 -1
- package/dist/types/src/AttentionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/keyboard.d.ts +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +2 -2
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +32 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -15
- package/src/AttentionPlugin.ts +33 -29
- package/src/capabilities/capabilities.ts +4 -4
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +43 -0
- package/src/capabilities/keyboard.ts +1 -1
- package/src/capabilities/react-context.tsx +3 -2
- package/src/events.ts +2 -2
- package/src/meta.ts +1 -3
- package/src/types/index.ts +5 -0
- package/src/types/types.ts +21 -0
- package/dist/lib/browser/chunk-O6FNOKYX.mjs +0 -21
- package/dist/lib/browser/chunk-O6FNOKYX.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/react-context-SVXVOSRH.mjs.map +0 -7
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-NMXGUHSU.mjs";
|
|
4
|
+
|
|
5
|
+
// src/types/types.ts
|
|
6
|
+
import { Schema } from "effect";
|
|
7
|
+
import { SelectionSchema } from "@dxos/react-ui-attention";
|
|
8
|
+
(function(AttentionAction2) {
|
|
9
|
+
const ATTENTION_ACTION = `${meta.id}/action`;
|
|
10
|
+
class Select extends Schema.TaggedClass()(`${ATTENTION_ACTION}/select`, {
|
|
11
|
+
input: Schema.Struct({
|
|
12
|
+
contextId: Schema.String,
|
|
13
|
+
selection: SelectionSchema
|
|
14
|
+
}),
|
|
15
|
+
output: Schema.Void
|
|
16
|
+
}) {
|
|
17
|
+
}
|
|
18
|
+
AttentionAction2.Select = Select;
|
|
19
|
+
})(AttentionAction || (AttentionAction = {}));
|
|
20
|
+
var AttentionAction;
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
AttentionAction
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-7NDMCDGN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\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,SAASA,cAAc;AAEvB,SAASC,uBAAuB;UAIfC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,KAAKC,EAAE;EAE5B,MAAMC,eAAeC,OAAOC,YAAW,EAAW,GAAGL,gBAAAA,WAA2B;IACrFM,OAAOF,OAAOG,OAAO;MACnBC,WAAWJ,OAAOK;MAClBC,WAAWC;IACb,CAAA;IACAC,QAAQR,OAAOS;EACjB,CAAA,EAAA;EAAI;mBANSV,SAAAA;AAOf,GAViBJ,oBAAAA,kBAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["Schema", "SelectionSchema", "AttentionAction", "ATTENTION_ACTION", "meta", "id", "Select", "Schema", "TaggedClass", "input", "Struct", "contextId", "String", "selection", "SelectionSchema", "output", "Void"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-NMXGUHSU.mjs";
|
|
4
|
+
|
|
5
|
+
// src/capabilities/capabilities.ts
|
|
6
|
+
import { defineCapability } from "@dxos/app-framework";
|
|
7
|
+
(function(AttentionCapabilities2) {
|
|
8
|
+
AttentionCapabilities2.Attention = defineCapability(`${meta.id}/capability/attention`);
|
|
9
|
+
AttentionCapabilities2.Selection = defineCapability(`${meta.id}/capability/selection`);
|
|
10
|
+
})(AttentionCapabilities || (AttentionCapabilities = {}));
|
|
11
|
+
var AttentionCapabilities;
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
AttentionCapabilities
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk-EJ4ELAEO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } 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 = defineCapability<AttentionManager>(`${meta.id}/capability/attention`);\n export const Selection = defineCapability<SelectionManager>(`${meta.id}/capability/selection`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,wBAAwB;UAKhBC,wBAAAA;yBACFC,YAAYC,iBAAmC,GAAGC,KAAKC,EAAE,uBAAuB;yBAChFC,YAAYH,iBAAmC,GAAGC,KAAKC,EAAE,uBAAuB;AAC/F,GAHiBJ,0BAAAA,wBAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["defineCapability", "AttentionCapabilities", "Attention", "defineCapability", "meta", "id", "Selection"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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,30 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
AttentionCapabilities
|
|
3
|
+
} from "./chunk-EJ4ELAEO.mjs";
|
|
4
|
+
import {
|
|
4
5
|
meta
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NMXGUHSU.mjs";
|
|
6
7
|
|
|
7
8
|
// src/index.ts
|
|
8
9
|
export * from "@dxos/react-ui-attention";
|
|
9
10
|
|
|
10
11
|
// src/AttentionPlugin.ts
|
|
11
|
-
import {
|
|
12
|
+
import { Events, allOf, contributes, defineModule, definePlugin } from "@dxos/app-framework";
|
|
12
13
|
import { AttentionManager, SelectionManager } from "@dxos/react-ui-attention";
|
|
13
14
|
|
|
14
15
|
// src/capabilities/index.ts
|
|
15
16
|
import { lazy } from "@dxos/app-framework";
|
|
16
|
-
var
|
|
17
|
-
var
|
|
17
|
+
var IntentResolver = lazy(() => import("./intent-resolver-OKED4HZY.mjs"));
|
|
18
|
+
var Keyboard = lazy(() => import("./keyboard-W57BF67Q.mjs"));
|
|
19
|
+
var ReactContext = lazy(() => import("./react-context-7HCRTOWZ.mjs"));
|
|
18
20
|
|
|
19
21
|
// src/events.ts
|
|
20
22
|
import { defineEvent } from "@dxos/app-framework";
|
|
21
23
|
(function(AttentionEvents2) {
|
|
22
|
-
AttentionEvents2.AttentionReady = defineEvent(`${
|
|
24
|
+
AttentionEvents2.AttentionReady = defineEvent(`${meta.id}/event/attention-ready`);
|
|
23
25
|
})(AttentionEvents || (AttentionEvents = {}));
|
|
24
26
|
var AttentionEvents;
|
|
25
27
|
|
|
26
28
|
// src/AttentionPlugin.ts
|
|
27
|
-
var AttentionPlugin = () =>
|
|
29
|
+
var AttentionPlugin = definePlugin(meta, () => [
|
|
28
30
|
defineModule({
|
|
29
31
|
id: `${meta.id}/module/attention`,
|
|
30
32
|
activatesOn: Events.Startup,
|
|
@@ -50,10 +52,16 @@ var AttentionPlugin = () => definePlugin(meta, [
|
|
|
50
52
|
id: `${meta.id}/module/keyboard`,
|
|
51
53
|
activatesOn: allOf(Events.AppGraphReady, AttentionEvents.AttentionReady),
|
|
52
54
|
activate: Keyboard
|
|
55
|
+
}),
|
|
56
|
+
defineModule({
|
|
57
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
58
|
+
activatesOn: Events.SetupIntentResolver,
|
|
59
|
+
activate: IntentResolver
|
|
53
60
|
})
|
|
54
61
|
]);
|
|
55
62
|
var setupDevtools = (attention) => {
|
|
56
|
-
|
|
63
|
+
var _globalThis;
|
|
64
|
+
(_globalThis = globalThis).composer ?? (_globalThis.composer = {});
|
|
57
65
|
globalThis.composer.attention = {
|
|
58
66
|
get manager() {
|
|
59
67
|
return attention;
|
|
@@ -72,7 +80,6 @@ var setupDevtools = (attention) => {
|
|
|
72
80
|
};
|
|
73
81
|
};
|
|
74
82
|
export {
|
|
75
|
-
ATTENTION_PLUGIN,
|
|
76
83
|
AttentionCapabilities,
|
|
77
84
|
AttentionEvents,
|
|
78
85
|
AttentionPlugin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts", "../../../src/AttentionPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/events.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport * from '@dxos/react-ui-attention';\n\nexport * from './AttentionPlugin';\nexport { AttentionCapabilities } from './capabilities';\nexport * from './events';\nexport * from './meta';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport * from '@dxos/react-ui-attention';\n\nexport * from './AttentionPlugin';\nexport { AttentionCapabilities } from './capabilities';\nexport * from './events';\nexport * from './meta';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Events, allOf, contributes, defineModule, definePlugin } from '@dxos/app-framework';\nimport { AttentionManager, SelectionManager } from '@dxos/react-ui-attention';\n\nimport { AttentionCapabilities, IntentResolver, Keyboard, ReactContext } from './capabilities';\nimport { AttentionEvents } from './events';\nimport { meta } from './meta';\n\nexport const AttentionPlugin = definePlugin(meta, () => [\n defineModule({\n id: `${meta.id}/module/attention`,\n activatesOn: Events.Startup,\n activatesAfter: [AttentionEvents.AttentionReady],\n activate: () => {\n const attention = new AttentionManager();\n const selection = new SelectionManager();\n setupDevtools(attention);\n return [\n contributes(AttentionCapabilities.Attention, attention),\n contributes(AttentionCapabilities.Selection, selection),\n ];\n },\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/keyboard`,\n activatesOn: allOf(Events.AppGraphReady, AttentionEvents.AttentionReady),\n activate: Keyboard,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n]);\n\nconst setupDevtools = (attention: AttentionManager) => {\n (globalThis as any).composer ??= {};\n\n (globalThis as any).composer.attention = {\n get manager() {\n return attention;\n },\n get attended() {\n return attention.current;\n },\n get currentSpace() {\n for (const id of attention.current) {\n const [spaceId, objectId] = id.split(':');\n if (spaceId && objectId && spaceId.length === 33) {\n return spaceId;\n }\n }\n },\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const Keyboard = lazy(() => import('./keyboard'));\nexport const ReactContext = lazy(() => import('./react-context'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport namespace AttentionEvents {\n export const AttentionReady = defineEvent(`${meta.id}/event/attention-ready`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,cAAc;;;ACAd,SAASA,QAAQC,OAAOC,aAAaC,cAAcC,oBAAoB;AACvE,SAASC,kBAAkBC,wBAAwB;;;ACDnD,SAASC,YAAY;AAEd,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,WAAWD,KAAK,MAAM,OAAO,yBAAA,CAAA;AACnC,IAAME,eAAeF,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACJ9C,SAASG,mBAAmB;UAIXC,kBAAAA;mBACFC,iBAAiBC,YAAY,GAAGC,KAAKC,EAAE,wBAAwB;AAC9E,GAFiBJ,oBAAAA,kBAAAA,CAAAA,EAAAA;;;;AFGV,IAAMK,kBAAkBC,aAAaC,MAAM,MAAM;EACtDC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,gBAAgB;MAACC,gBAAgBC;;IACjCC,UAAU,MAAA;AACR,YAAMC,YAAY,IAAIC,iBAAAA;AACtB,YAAMC,YAAY,IAAIC,iBAAAA;AACtBC,oBAAcJ,SAAAA;AACd,aAAO;QACLK,YAAYC,sBAAsBC,WAAWP,SAAAA;QAC7CK,YAAYC,sBAAsBE,WAAWN,SAAAA;;IAEjD;EACF,CAAA;EACAX,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBI,UAAUU;EACZ,CAAA;EACAlB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaiB,MAAMhB,OAAOiB,eAAed,gBAAgBC,cAAc;IACvEC,UAAUa;EACZ,CAAA;EACArB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOmB;IACpBd,UAAUe;EACZ,CAAA;CACD;AAED,IAAMV,gBAAgB,CAACJ,cAAAA;MACpBe;AAAD,GAACA,cAAAA,YAAmBC,aAAnBD,YAAmBC,WAAa,CAAC;AAEjCD,aAAmBC,SAAShB,YAAY;IACvC,IAAIiB,UAAU;AACZ,aAAOjB;IACT;IACA,IAAIkB,WAAW;AACb,aAAOlB,UAAUmB;IACnB;IACA,IAAIC,eAAe;AACjB,iBAAW5B,MAAMQ,UAAUmB,SAAS;AAClC,cAAM,CAACE,SAASC,QAAAA,IAAY9B,GAAG+B,MAAM,GAAA;AACrC,YAAIF,WAAWC,YAAYD,QAAQG,WAAW,IAAI;AAChD,iBAAOH;QACT;MACF;IACF;EACF;AACF;",
|
|
6
|
+
"names": ["Events", "allOf", "contributes", "defineModule", "definePlugin", "AttentionManager", "SelectionManager", "lazy", "IntentResolver", "lazy", "Keyboard", "ReactContext", "defineEvent", "AttentionEvents", "AttentionReady", "defineEvent", "meta", "id", "AttentionPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "Startup", "activatesAfter", "AttentionEvents", "AttentionReady", "activate", "attention", "AttentionManager", "selection", "SelectionManager", "setupDevtools", "contributes", "AttentionCapabilities", "Attention", "Selection", "ReactContext", "allOf", "AppGraphReady", "Keyboard", "SetupIntentResolver", "IntentResolver", "globalThis", "composer", "manager", "attended", "current", "currentSpace", "spaceId", "objectId", "split", "length"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AttentionAction
|
|
3
|
+
} from "./chunk-7NDMCDGN.mjs";
|
|
4
|
+
import {
|
|
5
|
+
AttentionCapabilities
|
|
6
|
+
} from "./chunk-EJ4ELAEO.mjs";
|
|
7
|
+
import "./chunk-NMXGUHSU.mjs";
|
|
8
|
+
|
|
9
|
+
// src/capabilities/intent-resolver.ts
|
|
10
|
+
import { Match } from "effect";
|
|
11
|
+
import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
|
|
12
|
+
var intent_resolver_default = ((context) => contributes(Capabilities.IntentResolver, [
|
|
13
|
+
createResolver({
|
|
14
|
+
intent: AttentionAction.Select,
|
|
15
|
+
resolve: (data) => {
|
|
16
|
+
const selection = context.getCapability(AttentionCapabilities.Selection);
|
|
17
|
+
Match.type().pipe(Match.when({
|
|
18
|
+
mode: "single",
|
|
19
|
+
id: void 0
|
|
20
|
+
}, () => {
|
|
21
|
+
selection.clearSelection(data.contextId);
|
|
22
|
+
}), Match.when({
|
|
23
|
+
mode: "single"
|
|
24
|
+
}, (s) => {
|
|
25
|
+
selection.updateSingle(data.contextId, s.id);
|
|
26
|
+
}), Match.when({
|
|
27
|
+
mode: "multi"
|
|
28
|
+
}, (s) => {
|
|
29
|
+
selection.updateMulti(data.contextId, s.ids);
|
|
30
|
+
}), Match.when({
|
|
31
|
+
mode: "range",
|
|
32
|
+
from: void 0,
|
|
33
|
+
to: void 0
|
|
34
|
+
}, () => {
|
|
35
|
+
selection.clearSelection(data.contextId);
|
|
36
|
+
}), Match.when({
|
|
37
|
+
mode: "range"
|
|
38
|
+
}, (s) => {
|
|
39
|
+
selection.updateRange(data.contextId, s.from, s.to);
|
|
40
|
+
}), Match.when({
|
|
41
|
+
mode: "multi-range"
|
|
42
|
+
}, (s) => {
|
|
43
|
+
selection.updateMultiRange(data.contextId, s.ranges);
|
|
44
|
+
}), Match.exhaustive)(data.selection);
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
]));
|
|
48
|
+
export {
|
|
49
|
+
intent_resolver_default as default
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=intent-resolver-OKED4HZY.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Match } from 'effect';\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,SAASA,aAAa;AAEtB,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,YAAMC,KAAI,EAAcC,KACtBF,MAAMG,KAAK;QAAEC,MAAM;QAAUC,IAAIC;MAAU,GAAG,MAAA;AAC5CV,kBAAUW,eAAeZ,KAAKa,SAAS;MACzC,CAAA,GACAR,MAAMG,KAAK;QAAEC,MAAM;MAAS,GAAG,CAACK,MAAAA;AAC9Bb,kBAAUc,aAAaf,KAAKa,WAAWC,EAAEJ,EAAE;MAC7C,CAAA,GACAL,MAAMG,KAAK;QAAEC,MAAM;MAAQ,GAAG,CAACK,MAAAA;AAC7Bb,kBAAUe,YAAYhB,KAAKa,WAAWC,EAAEG,GAAG;MAC7C,CAAA,GACAZ,MAAMG,KAAK;QAAEC,MAAM;QAASS,MAAMP;QAAWQ,IAAIR;MAAU,GAAG,MAAA;AAC5DV,kBAAUW,eAAeZ,KAAKa,SAAS;MACzC,CAAA,GACAR,MAAMG,KAAK;QAAEC,MAAM;MAAQ,GAAG,CAACK,MAAAA;AAC7Bb,kBAAUmB,YAAYpB,KAAKa,WAAWC,EAAEI,MAAOJ,EAAEK,EAAE;MACrD,CAAA,GACAd,MAAMG,KAAK;QAAEC,MAAM;MAAc,GAAG,CAACK,MAAAA;AACnCb,kBAAUoB,iBAAiBrB,KAAKa,WAAWC,EAAEQ,MAAM;MACrD,CAAA,GACAjB,MAAMkB,UAAU,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,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AttentionCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EJ4ELAEO.mjs";
|
|
4
|
+
import "./chunk-NMXGUHSU.mjs";
|
|
4
5
|
|
|
5
6
|
// src/capabilities/keyboard.ts
|
|
6
7
|
import { effect } from "@preact/signals-core";
|
|
7
8
|
import { Option } from "effect";
|
|
8
9
|
import { Capabilities as AppCapabilities, contributes } from "@dxos/app-framework";
|
|
9
10
|
import { Keyboard } from "@dxos/keyboard";
|
|
10
|
-
var keyboard_default = (context) => {
|
|
11
|
+
var keyboard_default = ((context) => {
|
|
11
12
|
const { graph } = context.getCapability(AppCapabilities.AppGraph);
|
|
12
13
|
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
13
14
|
const unsubscribe = effect(() => {
|
|
@@ -20,8 +21,8 @@ var keyboard_default = (context) => {
|
|
|
20
21
|
}
|
|
21
22
|
});
|
|
22
23
|
return contributes(AppCapabilities.Null, null, () => unsubscribe());
|
|
23
|
-
};
|
|
24
|
+
});
|
|
24
25
|
export {
|
|
25
26
|
keyboard_default as default
|
|
26
27
|
};
|
|
27
|
-
//# sourceMappingURL=keyboard-
|
|
28
|
+
//# sourceMappingURL=keyboard-W57BF67Q.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/keyboard.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport { Option } from 'effect';\n\nimport { Capabilities as AppCapabilities,
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,cAAc;AACvB,SAASC,cAAc;AAEvB,SAASC,gBAAgBC,
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport { Option } from 'effect';\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,SAASC,cAAc;AAEvB,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,KAAKC,OAAOC,SAAS;AACtE,QAAIL,MAAM;AACRM,eAASC,UAAUC,kBAAkBR,KAAKS,KAAK,GAAA,CAAA;IACjD;EACF,CAAA;AAEA,SAAOC,YAAYrB,gBAAgBsB,MAAM,MAAM,MAAMjB,YAAAA,CAAAA;AACvD;",
|
|
6
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", "Option", "getOrNull", "Keyboard", "singleton", "setCurrentContext", "join", "contributes", "Null"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":759,"imports":[],"format":"esm"},"src/capabilities/capabilities.ts":{"bytes":1730,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/types/types.ts":{"bytes":2215,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/types/index.ts":{"bytes":459,"imports":[{"path":"src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":5997,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"src/capabilities/capabilities.ts","kind":"import-statement","original":"./capabilities"}],"format":"esm"},"src/capabilities/keyboard.ts":{"bytes":3527,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/keyboard","kind":"import-statement","external":true},{"path":"src/capabilities/capabilities.ts","kind":"import-statement","original":"./capabilities"}],"format":"esm"},"src/capabilities/react-context.tsx":{"bytes":4129,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/capabilities/capabilities.ts","kind":"import-statement","original":"./capabilities"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1355,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/capabilities.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/keyboard.ts","kind":"dynamic-import","original":"./keyboard"},{"path":"src/capabilities/react-context.tsx","kind":"dynamic-import","original":"./react-context"}],"format":"esm"},"src/events.ts":{"bytes":1189,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/AttentionPlugin.ts":{"bytes":7402,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/events.ts","kind":"import-statement","original":"./events"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/index.ts":{"bytes":971,"imports":[{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"src/AttentionPlugin.ts","kind":"import-statement","original":"./AttentionPlugin"},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/events.ts","kind":"import-statement","original":"./events"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5005},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-EJ4ELAEO.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-NMXGUHSU.mjs","kind":"import-statement"},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/intent-resolver-OKED4HZY.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/keyboard-W57BF67Q.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/react-context-7HCRTOWZ.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["AttentionCapabilities","AttentionEvents","AttentionPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":42},"src/AttentionPlugin.ts":{"bytesInOutput":1636},"src/capabilities/index.ts":{"bytesInOutput":252},"src/events.ts":{"bytesInOutput":234}},"bytes":2511},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-7NDMCDGN.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-NMXGUHSU.mjs","kind":"import-statement"}],"exports":["AttentionAction"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":156},"dist/lib/browser/intent-resolver-OKED4HZY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3070},"dist/lib/browser/intent-resolver-OKED4HZY.mjs":{"imports":[{"path":"dist/lib/browser/chunk-7NDMCDGN.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-EJ4ELAEO.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-NMXGUHSU.mjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":1212}},"bytes":1508},"dist/lib/browser/chunk-7NDMCDGN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1123},"dist/lib/browser/chunk-7NDMCDGN.mjs":{"imports":[{"path":"dist/lib/browser/chunk-NMXGUHSU.mjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true}],"exports":["AttentionAction"],"inputs":{"src/types/types.ts":{"bytesInOutput":486},"src/types/index.ts":{"bytesInOutput":0}},"bytes":631},"dist/lib/browser/keyboard-W57BF67Q.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1910},"dist/lib/browser/keyboard-W57BF67Q.mjs":{"imports":[{"path":"dist/lib/browser/chunk-EJ4ELAEO.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-NMXGUHSU.mjs","kind":"import-statement"},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/keyboard","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/keyboard.ts","inputs":{"src/capabilities/keyboard.ts":{"bytesInOutput":727}},"bytes":944},"dist/lib/browser/react-context-7HCRTOWZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2075},"dist/lib/browser/react-context-7HCRTOWZ.mjs":{"imports":[{"path":"dist/lib/browser/chunk-EJ4ELAEO.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-NMXGUHSU.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-context.tsx","inputs":{"src/capabilities/react-context.tsx":{"bytesInOutput":694}},"bytes":943},"dist/lib/browser/chunk-EJ4ELAEO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":872},"dist/lib/browser/chunk-EJ4ELAEO.mjs":{"imports":[{"path":"dist/lib/browser/chunk-NMXGUHSU.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["AttentionCapabilities"],"inputs":{"src/capabilities/capabilities.ts":{"bytesInOutput":358}},"bytes":523},"dist/lib/browser/chunk-NMXGUHSU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":376},"dist/lib/browser/chunk-NMXGUHSU.mjs":{"imports":[],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":71}},"bytes":150}}}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ATTENTION_PLUGIN,
|
|
3
2
|
AttentionCapabilities
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EJ4ELAEO.mjs";
|
|
4
|
+
import {
|
|
5
|
+
meta
|
|
6
|
+
} from "./chunk-NMXGUHSU.mjs";
|
|
5
7
|
|
|
6
8
|
// src/capabilities/react-context.tsx
|
|
7
9
|
import React from "react";
|
|
8
10
|
import { Capabilities, contributes, useCapability } from "@dxos/app-framework";
|
|
9
11
|
import { RootAttentionProvider, SelectionProvider } from "@dxos/react-ui-attention";
|
|
10
|
-
var react_context_default = () => contributes(Capabilities.ReactContext, {
|
|
11
|
-
id:
|
|
12
|
+
var react_context_default = (() => contributes(Capabilities.ReactContext, {
|
|
13
|
+
id: meta.id,
|
|
12
14
|
context: (props) => {
|
|
13
15
|
const attention = useCapability(AttentionCapabilities.Attention);
|
|
14
16
|
const selection = useCapability(AttentionCapabilities.Selection);
|
|
@@ -20,8 +22,8 @@ var react_context_default = () => contributes(Capabilities.ReactContext, {
|
|
|
20
22
|
selection
|
|
21
23
|
}, props.children));
|
|
22
24
|
}
|
|
23
|
-
});
|
|
25
|
+
}));
|
|
24
26
|
export {
|
|
25
27
|
react_context_default as default
|
|
26
28
|
};
|
|
27
|
-
//# sourceMappingURL=react-context-
|
|
29
|
+
//# sourceMappingURL=react-context-7HCRTOWZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
meta
|
|
4
|
+
} from "./chunk-GC4PRMVZ.mjs";
|
|
5
|
+
|
|
6
|
+
// src/capabilities/capabilities.ts
|
|
7
|
+
import { defineCapability } from "@dxos/app-framework";
|
|
8
|
+
(function(AttentionCapabilities2) {
|
|
9
|
+
AttentionCapabilities2.Attention = defineCapability(`${meta.id}/capability/attention`);
|
|
10
|
+
AttentionCapabilities2.Selection = defineCapability(`${meta.id}/capability/selection`);
|
|
11
|
+
})(AttentionCapabilities || (AttentionCapabilities = {}));
|
|
12
|
+
var AttentionCapabilities;
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
AttentionCapabilities
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-FKQHPGTA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } 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 = defineCapability<AttentionManager>(`${meta.id}/capability/attention`);\n export const Selection = defineCapability<SelectionManager>(`${meta.id}/capability/selection`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,wBAAwB;UAKhBC,wBAAAA;yBACFC,YAAYC,iBAAmC,GAAGC,KAAKC,EAAE,uBAAuB;yBAChFC,YAAYH,iBAAmC,GAAGC,KAAKC,EAAE,uBAAuB;AAC/F,GAHiBJ,0BAAAA,wBAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["defineCapability", "AttentionCapabilities", "Attention", "defineCapability", "meta", "id", "Selection"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/meta.ts
|
|
4
|
+
var meta = {
|
|
5
|
+
id: "dxos.org/plugin/attention",
|
|
6
|
+
name: "Attention"
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
meta
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chunk-GC4PRMVZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { Schema } from "effect";
|
|
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-ICOLCHKJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\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,SAASA,cAAc;AAEvB,SAASC,uBAAuB;UAIfC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,KAAKC,EAAE;EAE5B,MAAMC,eAAeC,OAAOC,YAAW,EAAW,GAAGL,gBAAAA,WAA2B;IACrFM,OAAOF,OAAOG,OAAO;MACnBC,WAAWJ,OAAOK;MAClBC,WAAWC;IACb,CAAA;IACAC,QAAQR,OAAOS;EACjB,CAAA,EAAA;EAAI;mBANSV,SAAAA;AAOf,GAViBJ,oBAAAA,kBAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["Schema", "SelectionSchema", "AttentionAction", "ATTENTION_ACTION", "meta", "id", "Select", "Schema", "TaggedClass", "input", "Struct", "contextId", "String", "selection", "SelectionSchema", "output", "Void"]
|
|
7
|
+
}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
AttentionCapabilities
|
|
4
|
+
} from "./chunk-FKQHPGTA.mjs";
|
|
5
|
+
import {
|
|
5
6
|
meta
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GC4PRMVZ.mjs";
|
|
7
8
|
|
|
8
9
|
// src/index.ts
|
|
9
10
|
export * from "@dxos/react-ui-attention";
|
|
10
11
|
|
|
11
12
|
// src/AttentionPlugin.ts
|
|
12
|
-
import {
|
|
13
|
+
import { Events, allOf, contributes, defineModule, definePlugin } from "@dxos/app-framework";
|
|
13
14
|
import { AttentionManager, SelectionManager } from "@dxos/react-ui-attention";
|
|
14
15
|
|
|
15
16
|
// src/capabilities/index.ts
|
|
16
17
|
import { lazy } from "@dxos/app-framework";
|
|
17
|
-
var
|
|
18
|
-
var
|
|
18
|
+
var IntentResolver = lazy(() => import("./intent-resolver-BCFMWW34.mjs"));
|
|
19
|
+
var Keyboard = lazy(() => import("./keyboard-HCCT23BE.mjs"));
|
|
20
|
+
var ReactContext = lazy(() => import("./react-context-7RDGSUXD.mjs"));
|
|
19
21
|
|
|
20
22
|
// src/events.ts
|
|
21
23
|
import { defineEvent } from "@dxos/app-framework";
|
|
22
24
|
(function(AttentionEvents2) {
|
|
23
|
-
AttentionEvents2.AttentionReady = defineEvent(`${
|
|
25
|
+
AttentionEvents2.AttentionReady = defineEvent(`${meta.id}/event/attention-ready`);
|
|
24
26
|
})(AttentionEvents || (AttentionEvents = {}));
|
|
25
27
|
var AttentionEvents;
|
|
26
28
|
|
|
27
29
|
// src/AttentionPlugin.ts
|
|
28
|
-
var AttentionPlugin = () =>
|
|
30
|
+
var AttentionPlugin = definePlugin(meta, () => [
|
|
29
31
|
defineModule({
|
|
30
32
|
id: `${meta.id}/module/attention`,
|
|
31
33
|
activatesOn: Events.Startup,
|
|
@@ -51,10 +53,16 @@ var AttentionPlugin = () => definePlugin(meta, [
|
|
|
51
53
|
id: `${meta.id}/module/keyboard`,
|
|
52
54
|
activatesOn: allOf(Events.AppGraphReady, AttentionEvents.AttentionReady),
|
|
53
55
|
activate: Keyboard
|
|
56
|
+
}),
|
|
57
|
+
defineModule({
|
|
58
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
59
|
+
activatesOn: Events.SetupIntentResolver,
|
|
60
|
+
activate: IntentResolver
|
|
54
61
|
})
|
|
55
62
|
]);
|
|
56
63
|
var setupDevtools = (attention) => {
|
|
57
|
-
|
|
64
|
+
var _globalThis;
|
|
65
|
+
(_globalThis = globalThis).composer ?? (_globalThis.composer = {});
|
|
58
66
|
globalThis.composer.attention = {
|
|
59
67
|
get manager() {
|
|
60
68
|
return attention;
|
|
@@ -73,7 +81,6 @@ var setupDevtools = (attention) => {
|
|
|
73
81
|
};
|
|
74
82
|
};
|
|
75
83
|
export {
|
|
76
|
-
ATTENTION_PLUGIN,
|
|
77
84
|
AttentionCapabilities,
|
|
78
85
|
AttentionEvents,
|
|
79
86
|
AttentionPlugin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts", "../../../src/AttentionPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/events.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport * from '@dxos/react-ui-attention';\n\nexport * from './AttentionPlugin';\nexport { AttentionCapabilities } from './capabilities';\nexport * from './events';\nexport * from './meta';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport * from '@dxos/react-ui-attention';\n\nexport * from './AttentionPlugin';\nexport { AttentionCapabilities } from './capabilities';\nexport * from './events';\nexport * from './meta';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Events, allOf, contributes, defineModule, definePlugin } from '@dxos/app-framework';\nimport { AttentionManager, SelectionManager } from '@dxos/react-ui-attention';\n\nimport { AttentionCapabilities, IntentResolver, Keyboard, ReactContext } from './capabilities';\nimport { AttentionEvents } from './events';\nimport { meta } from './meta';\n\nexport const AttentionPlugin = definePlugin(meta, () => [\n defineModule({\n id: `${meta.id}/module/attention`,\n activatesOn: Events.Startup,\n activatesAfter: [AttentionEvents.AttentionReady],\n activate: () => {\n const attention = new AttentionManager();\n const selection = new SelectionManager();\n setupDevtools(attention);\n return [\n contributes(AttentionCapabilities.Attention, attention),\n contributes(AttentionCapabilities.Selection, selection),\n ];\n },\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/keyboard`,\n activatesOn: allOf(Events.AppGraphReady, AttentionEvents.AttentionReady),\n activate: Keyboard,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n]);\n\nconst setupDevtools = (attention: AttentionManager) => {\n (globalThis as any).composer ??= {};\n\n (globalThis as any).composer.attention = {\n get manager() {\n return attention;\n },\n get attended() {\n return attention.current;\n },\n get currentSpace() {\n for (const id of attention.current) {\n const [spaceId, objectId] = id.split(':');\n if (spaceId && objectId && spaceId.length === 33) {\n return spaceId;\n }\n }\n },\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const Keyboard = lazy(() => import('./keyboard'));\nexport const ReactContext = lazy(() => import('./react-context'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport namespace AttentionEvents {\n export const AttentionReady = defineEvent(`${meta.id}/event/attention-ready`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,cAAc;;;ACAd,SAASA,QAAQC,OAAOC,aAAaC,cAAcC,oBAAoB;AACvE,SAASC,kBAAkBC,wBAAwB;;;ACDnD,SAASC,YAAY;AAEd,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,WAAWD,KAAK,MAAM,OAAO,yBAAA,CAAA;AACnC,IAAME,eAAeF,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACJ9C,SAASG,mBAAmB;UAIXC,kBAAAA;mBACFC,iBAAiBC,YAAY,GAAGC,KAAKC,EAAE,wBAAwB;AAC9E,GAFiBJ,oBAAAA,kBAAAA,CAAAA,EAAAA;;;;AFGV,IAAMK,kBAAkBC,aAAaC,MAAM,MAAM;EACtDC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,gBAAgB;MAACC,gBAAgBC;;IACjCC,UAAU,MAAA;AACR,YAAMC,YAAY,IAAIC,iBAAAA;AACtB,YAAMC,YAAY,IAAIC,iBAAAA;AACtBC,oBAAcJ,SAAAA;AACd,aAAO;QACLK,YAAYC,sBAAsBC,WAAWP,SAAAA;QAC7CK,YAAYC,sBAAsBE,WAAWN,SAAAA;;IAEjD;EACF,CAAA;EACAX,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBI,UAAUU;EACZ,CAAA;EACAlB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaiB,MAAMhB,OAAOiB,eAAed,gBAAgBC,cAAc;IACvEC,UAAUa;EACZ,CAAA;EACArB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOmB;IACpBd,UAAUe;EACZ,CAAA;CACD;AAED,IAAMV,gBAAgB,CAACJ,cAAAA;MACpBe;AAAD,GAACA,cAAAA,YAAmBC,aAAnBD,YAAmBC,WAAa,CAAC;AAEjCD,aAAmBC,SAAShB,YAAY;IACvC,IAAIiB,UAAU;AACZ,aAAOjB;IACT;IACA,IAAIkB,WAAW;AACb,aAAOlB,UAAUmB;IACnB;IACA,IAAIC,eAAe;AACjB,iBAAW5B,MAAMQ,UAAUmB,SAAS;AAClC,cAAM,CAACE,SAASC,QAAAA,IAAY9B,GAAG+B,MAAM,GAAA;AACrC,YAAIF,WAAWC,YAAYD,QAAQG,WAAW,IAAI;AAChD,iBAAOH;QACT;MACF;IACF;EACF;AACF;",
|
|
6
|
+
"names": ["Events", "allOf", "contributes", "defineModule", "definePlugin", "AttentionManager", "SelectionManager", "lazy", "IntentResolver", "lazy", "Keyboard", "ReactContext", "defineEvent", "AttentionEvents", "AttentionReady", "defineEvent", "meta", "id", "AttentionPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "Startup", "activatesAfter", "AttentionEvents", "AttentionReady", "activate", "attention", "AttentionManager", "selection", "SelectionManager", "setupDevtools", "contributes", "AttentionCapabilities", "Attention", "Selection", "ReactContext", "allOf", "AppGraphReady", "Keyboard", "SetupIntentResolver", "IntentResolver", "globalThis", "composer", "manager", "attended", "current", "currentSpace", "spaceId", "objectId", "split", "length"]
|
|
7
7
|
}
|