@dxos/plugin-attention 0.8.4-main.f9ba587 → 0.8.4-main.fffef41

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.
Files changed (73) hide show
  1. package/dist/lib/browser/chunk-62F4J5KY.mjs +15 -0
  2. package/dist/lib/browser/chunk-62F4J5KY.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-NG4RYQK5.mjs +25 -0
  4. package/dist/lib/browser/chunk-NG4RYQK5.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-NIBJFU73.mjs +16 -0
  6. package/dist/lib/browser/chunk-NIBJFU73.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +15 -9
  8. package/dist/lib/browser/index.mjs.map +3 -3
  9. package/dist/lib/browser/intent-resolver-OE6EFE7U.mjs +51 -0
  10. package/dist/lib/browser/intent-resolver-OE6EFE7U.mjs.map +7 -0
  11. package/dist/lib/browser/{keyboard-IYF35Z4E.mjs → keyboard-QDSNLHR3.mjs} +6 -5
  12. package/dist/lib/browser/keyboard-QDSNLHR3.mjs.map +7 -0
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/{react-context-JVGQB2CO.mjs → react-context-HXORYGNN.mjs} +10 -7
  15. package/dist/lib/browser/react-context-HXORYGNN.mjs.map +7 -0
  16. package/dist/lib/browser/types/index.mjs +8 -0
  17. package/dist/lib/browser/types/index.mjs.map +7 -0
  18. package/dist/lib/node-esm/chunk-BH4E4TWY.mjs +17 -0
  19. package/dist/lib/node-esm/chunk-BH4E4TWY.mjs.map +7 -0
  20. package/dist/lib/node-esm/chunk-JJFC7PBD.mjs +26 -0
  21. package/dist/lib/node-esm/chunk-JJFC7PBD.mjs.map +7 -0
  22. package/dist/lib/node-esm/chunk-T6SUMOZA.mjs +17 -0
  23. package/dist/lib/node-esm/chunk-T6SUMOZA.mjs.map +7 -0
  24. package/dist/lib/node-esm/index.mjs +15 -9
  25. package/dist/lib/node-esm/index.mjs.map +3 -3
  26. package/dist/lib/node-esm/intent-resolver-QAU7TPNB.mjs +52 -0
  27. package/dist/lib/node-esm/intent-resolver-QAU7TPNB.mjs.map +7 -0
  28. package/dist/lib/node-esm/{keyboard-GSUNGWNE.mjs → keyboard-GWCD2NVU.mjs} +6 -5
  29. package/dist/lib/node-esm/keyboard-GWCD2NVU.mjs.map +7 -0
  30. package/dist/lib/node-esm/meta.json +1 -1
  31. package/dist/lib/node-esm/{react-context-SVXVOSRH.mjs → react-context-D5BP2M6I.mjs} +10 -7
  32. package/dist/lib/node-esm/react-context-D5BP2M6I.mjs.map +7 -0
  33. package/dist/lib/node-esm/types/index.mjs +9 -0
  34. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  35. package/dist/types/src/AttentionPlugin.d.ts +1 -1
  36. package/dist/types/src/AttentionPlugin.d.ts.map +1 -1
  37. package/dist/types/src/capabilities/capabilities.d.ts +1 -1
  38. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/index.d.ts +4 -3
  40. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
  42. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  43. package/dist/types/src/capabilities/keyboard.d.ts +1 -1
  44. package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/react-context.d.ts +2 -2
  46. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  47. package/dist/types/src/events.d.ts.map +1 -1
  48. package/dist/types/src/meta.d.ts +0 -1
  49. package/dist/types/src/meta.d.ts.map +1 -1
  50. package/dist/types/src/types/index.d.ts +2 -0
  51. package/dist/types/src/types/index.d.ts.map +1 -0
  52. package/dist/types/src/types/types.d.ts +32 -0
  53. package/dist/types/src/types/types.d.ts.map +1 -0
  54. package/dist/types/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +26 -15
  56. package/src/AttentionPlugin.ts +33 -29
  57. package/src/capabilities/capabilities.ts +4 -4
  58. package/src/capabilities/index.ts +1 -0
  59. package/src/capabilities/intent-resolver.ts +43 -0
  60. package/src/capabilities/keyboard.ts +2 -2
  61. package/src/capabilities/react-context.tsx +5 -3
  62. package/src/events.ts +2 -2
  63. package/src/meta.ts +6 -3
  64. package/src/types/index.ts +5 -0
  65. package/src/types/types.ts +21 -0
  66. package/dist/lib/browser/chunk-O6FNOKYX.mjs +0 -21
  67. package/dist/lib/browser/chunk-O6FNOKYX.mjs.map +0 -7
  68. package/dist/lib/browser/keyboard-IYF35Z4E.mjs.map +0 -7
  69. package/dist/lib/browser/react-context-JVGQB2CO.mjs.map +0 -7
  70. package/dist/lib/node-esm/chunk-SVV7GQYN.mjs +0 -23
  71. package/dist/lib/node-esm/chunk-SVV7GQYN.mjs.map +0 -7
  72. package/dist/lib/node-esm/keyboard-GSUNGWNE.mjs.map +0 -7
  73. package/dist/lib/node-esm/react-context-SVXVOSRH.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-attention",
3
- "version": "0.8.4-main.f9ba587",
3
+ "version": "0.8.4-main.fffef41",
4
4
  "description": "Plugin for attention",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,14 +10,25 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "source": "./src/index.ts",
13
14
  "types": "./dist/types/src/index.d.ts",
14
15
  "browser": "./dist/lib/browser/index.mjs",
15
16
  "node": "./dist/lib/node-esm/index.mjs"
17
+ },
18
+ "./types": {
19
+ "source": "./src/types/index.ts",
20
+ "types": "./dist/types/src/types/index.d.ts",
21
+ "browser": "./dist/lib/browser/types/index.mjs",
22
+ "node": "./dist/lib/node-esm/types/index.mjs"
16
23
  }
17
24
  },
18
25
  "types": "dist/types/src/index.d.ts",
19
26
  "typesVersions": {
20
- "*": {}
27
+ "*": {
28
+ "types": [
29
+ "dist/types/src/types/index.d.ts"
30
+ ]
31
+ }
21
32
  },
22
33
  "files": [
23
34
  "dist",
@@ -25,24 +36,24 @@
25
36
  ],
26
37
  "dependencies": {
27
38
  "@preact-signals/safe-react": "^0.9.0",
28
- "@preact/signals-core": "^1.9.0",
29
- "effect": "3.16.13",
30
- "@dxos/app-framework": "0.8.4-main.f9ba587",
31
- "@dxos/echo-schema": "0.8.4-main.f9ba587",
32
- "@dxos/echo": "0.8.4-main.f9ba587",
33
- "@dxos/echo-signals": "0.8.4-main.f9ba587",
34
- "@dxos/keyboard": "0.8.4-main.f9ba587",
35
- "@dxos/react-ui-attention": "0.8.4-main.f9ba587"
39
+ "@preact/signals-core": "^1.12.1",
40
+ "effect": "3.18.3",
41
+ "@dxos/app-framework": "0.8.4-main.fffef41",
42
+ "@dxos/echo": "0.8.4-main.fffef41",
43
+ "@dxos/react-ui-attention": "0.8.4-main.fffef41",
44
+ "@dxos/keyboard": "0.8.4-main.fffef41",
45
+ "@dxos/util": "0.8.4-main.fffef41",
46
+ "@dxos/echo-signals": "0.8.4-main.fffef41"
36
47
  },
37
48
  "devDependencies": {
38
- "@types/react": "~18.2.0",
39
- "react": "~18.2.0",
40
- "react-dom": "~18.2.0"
49
+ "@types/react": "~19.2.2",
50
+ "react": "~19.2.0",
51
+ "react-dom": "~19.2.0"
41
52
  },
42
53
  "peerDependencies": {
43
54
  "effect": "^3.13.3",
44
- "react": "~18.2.0",
45
- "react-dom": "~18.2.0"
55
+ "react": "^19.0.0",
56
+ "react-dom": "^19.0.0"
46
57
  },
47
58
  "publishConfig": {
48
59
  "access": "public"
@@ -2,40 +2,44 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { defineModule, definePlugin, Events, contributes, allOf } from '@dxos/app-framework';
5
+ import { Events, allOf, contributes, defineModule, definePlugin } from '@dxos/app-framework';
6
6
  import { AttentionManager, SelectionManager } from '@dxos/react-ui-attention';
7
7
 
8
- import { AttentionCapabilities, Keyboard, ReactContext } from './capabilities';
8
+ import { AttentionCapabilities, IntentResolver, Keyboard, ReactContext } from './capabilities';
9
9
  import { AttentionEvents } from './events';
10
10
  import { meta } from './meta';
11
11
 
12
- export const AttentionPlugin = () =>
13
- definePlugin(meta, [
14
- defineModule({
15
- id: `${meta.id}/module/attention`,
16
- activatesOn: Events.Startup,
17
- activatesAfter: [AttentionEvents.AttentionReady],
18
- activate: () => {
19
- const attention = new AttentionManager();
20
- const selection = new SelectionManager();
21
- setupDevtools(attention);
22
- return [
23
- contributes(AttentionCapabilities.Attention, attention),
24
- contributes(AttentionCapabilities.Selection, selection),
25
- ];
26
- },
27
- }),
28
- defineModule({
29
- id: `${meta.id}/module/react-context`,
30
- activatesOn: Events.Startup,
31
- activate: ReactContext,
32
- }),
33
- defineModule({
34
- id: `${meta.id}/module/keyboard`,
35
- activatesOn: allOf(Events.AppGraphReady, AttentionEvents.AttentionReady),
36
- activate: Keyboard,
37
- }),
38
- ]);
12
+ export const AttentionPlugin = definePlugin(meta, () => [
13
+ defineModule({
14
+ id: `${meta.id}/module/attention`,
15
+ activatesOn: Events.Startup,
16
+ activatesAfter: [AttentionEvents.AttentionReady],
17
+ activate: () => {
18
+ const attention = new AttentionManager();
19
+ const selection = new SelectionManager();
20
+ setupDevtools(attention);
21
+ return [
22
+ contributes(AttentionCapabilities.Attention, attention),
23
+ contributes(AttentionCapabilities.Selection, selection),
24
+ ];
25
+ },
26
+ }),
27
+ defineModule({
28
+ id: `${meta.id}/module/react-context`,
29
+ activatesOn: Events.Startup,
30
+ activate: ReactContext,
31
+ }),
32
+ defineModule({
33
+ id: `${meta.id}/module/keyboard`,
34
+ activatesOn: allOf(Events.AppGraphReady, AttentionEvents.AttentionReady),
35
+ activate: Keyboard,
36
+ }),
37
+ defineModule({
38
+ id: `${meta.id}/module/intent-resolver`,
39
+ activatesOn: Events.SetupIntentResolver,
40
+ activate: IntentResolver,
41
+ }),
42
+ ]);
39
43
 
40
44
  const setupDevtools = (attention: AttentionManager) => {
41
45
  (globalThis as any).composer ??= {};
@@ -3,11 +3,11 @@
3
3
  //
4
4
 
5
5
  import { defineCapability } from '@dxos/app-framework';
6
- import { type SelectionManager, type AttentionManager } from '@dxos/react-ui-attention';
6
+ import { type AttentionManager, type SelectionManager } from '@dxos/react-ui-attention';
7
7
 
8
- import { ATTENTION_PLUGIN } from '../meta';
8
+ import { meta } from '../meta';
9
9
 
10
10
  export namespace AttentionCapabilities {
11
- export const Attention = defineCapability<AttentionManager>(`${ATTENTION_PLUGIN}/capability/attention`);
12
- export const Selection = defineCapability<SelectionManager>(`${ATTENTION_PLUGIN}/capability/selection`);
11
+ export const Attention = defineCapability<AttentionManager>(`${meta.id}/capability/attention`);
12
+ export const Selection = defineCapability<SelectionManager>(`${meta.id}/capability/selection`);
13
13
  }
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { lazy } from '@dxos/app-framework';
6
6
 
7
+ export const IntentResolver = lazy(() => import('./intent-resolver'));
7
8
  export const Keyboard = lazy(() => import('./keyboard'));
8
9
  export const ReactContext = lazy(() => import('./react-context'));
9
10
 
@@ -0,0 +1,43 @@
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
+ ]);
@@ -3,9 +3,9 @@
3
3
  //
4
4
 
5
5
  import { effect } from '@preact/signals-core';
6
- import { Option } from 'effect';
6
+ import * as Option from 'effect/Option';
7
7
 
8
- import { Capabilities as AppCapabilities, contributes, type PluginContext } from '@dxos/app-framework';
8
+ import { Capabilities as AppCapabilities, type PluginContext, contributes } from '@dxos/app-framework';
9
9
  import { Keyboard } from '@dxos/keyboard';
10
10
 
11
11
  import { AttentionCapabilities } from './capabilities';
@@ -4,15 +4,17 @@
4
4
 
5
5
  import React, { type PropsWithChildren } from 'react';
6
6
 
7
- import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
7
+ import { Capabilities, contributes } from '@dxos/app-framework';
8
+ import { useCapability } from '@dxos/app-framework/react';
8
9
  import { RootAttentionProvider, SelectionProvider } from '@dxos/react-ui-attention';
9
10
 
11
+ import { meta } from '../meta';
12
+
10
13
  import { AttentionCapabilities } from './capabilities';
11
- import { ATTENTION_PLUGIN } from '../meta';
12
14
 
13
15
  export default () =>
14
16
  contributes(Capabilities.ReactContext, {
15
- id: ATTENTION_PLUGIN,
17
+ id: meta.id,
16
18
  context: (props: PropsWithChildren) => {
17
19
  const attention = useCapability(AttentionCapabilities.Attention);
18
20
  const selection = useCapability(AttentionCapabilities.Selection);
package/src/events.ts CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  import { defineEvent } from '@dxos/app-framework';
6
6
 
7
- import { ATTENTION_PLUGIN } from './meta';
7
+ import { meta } from './meta';
8
8
 
9
9
  export namespace AttentionEvents {
10
- export const AttentionReady = defineEvent(`${ATTENTION_PLUGIN}/event/attention-ready`);
10
+ export const AttentionReady = defineEvent(`${meta.id}/event/attention-ready`);
11
11
  }
package/src/meta.ts CHANGED
@@ -3,10 +3,13 @@
3
3
  //
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
-
7
- export const ATTENTION_PLUGIN = 'dxos.org/plugin/attention';
6
+ import { trim } from '@dxos/util';
8
7
 
9
8
  export const meta: PluginMeta = {
10
- id: ATTENTION_PLUGIN,
9
+ id: 'dxos.org/plugin/attention',
11
10
  name: 'Attention',
11
+ description: trim`
12
+ Track and manage focused attention on objects across your workspace.
13
+ Highlight items requiring action and coordinate team focus on priority work.
14
+ `,
12
15
  };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './types';
@@ -0,0 +1,21 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { SelectionSchema } from '@dxos/react-ui-attention';
8
+
9
+ import { meta } from '../meta';
10
+
11
+ export namespace AttentionAction {
12
+ const ATTENTION_ACTION = `${meta.id}/action`;
13
+
14
+ export class Select extends Schema.TaggedClass<Select>()(`${ATTENTION_ACTION}/select`, {
15
+ input: Schema.Struct({
16
+ contextId: Schema.String,
17
+ selection: SelectionSchema,
18
+ }),
19
+ output: Schema.Void,
20
+ }) {}
21
+ }
@@ -1,21 +0,0 @@
1
- // src/meta.ts
2
- var ATTENTION_PLUGIN = "dxos.org/plugin/attention";
3
- var meta = {
4
- id: ATTENTION_PLUGIN,
5
- name: "Attention"
6
- };
7
-
8
- // src/capabilities/capabilities.ts
9
- import { defineCapability } from "@dxos/app-framework";
10
- (function(AttentionCapabilities2) {
11
- AttentionCapabilities2.Attention = defineCapability(`${ATTENTION_PLUGIN}/capability/attention`);
12
- AttentionCapabilities2.Selection = defineCapability(`${ATTENTION_PLUGIN}/capability/selection`);
13
- })(AttentionCapabilities || (AttentionCapabilities = {}));
14
- var AttentionCapabilities;
15
-
16
- export {
17
- ATTENTION_PLUGIN,
18
- meta,
19
- AttentionCapabilities
20
- };
21
- //# sourceMappingURL=chunk-O6FNOKYX.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts", "../../../src/capabilities/capabilities.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const ATTENTION_PLUGIN = 'dxos.org/plugin/attention';\n\nexport const meta: PluginMeta = {\n id: ATTENTION_PLUGIN,\n name: 'Attention',\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type SelectionManager, type AttentionManager } from '@dxos/react-ui-attention';\n\nimport { ATTENTION_PLUGIN } from '../meta';\n\nexport namespace AttentionCapabilities {\n export const Attention = defineCapability<AttentionManager>(`${ATTENTION_PLUGIN}/capability/attention`);\n export const Selection = defineCapability<SelectionManager>(`${ATTENTION_PLUGIN}/capability/selection`);\n}\n"],
5
- "mappings": ";AAMO,IAAMA,mBAAmB;AAEzB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;AACR;;;ACPA,SAASC,wBAAwB;UAKhBC,wBAAAA;yBACFC,YAAYC,iBAAmC,GAAGC,gBAAAA,uBAAuC;yBACzFC,YAAYF,iBAAmC,GAAGC,gBAAAA,uBAAuC;AACxG,GAHiBH,0BAAAA,wBAAAA,CAAAA,EAAAA;;",
6
- "names": ["ATTENTION_PLUGIN", "meta", "id", "name", "defineCapability", "AttentionCapabilities", "Attention", "defineCapability", "ATTENTION_PLUGIN", "Selection"]
7
- }
@@ -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 { Option } from 'effect';\n\nimport { Capabilities as AppCapabilities, contributes, type PluginContext } 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,iBAAiBC,mBAAuC;AACjF,SAASC,gBAAgB;AAIzB,IAAA,mBAAe,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
- "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
- }
@@ -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 { AttentionCapabilities } from './capabilities';\nimport { ATTENTION_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactContext, {\n id: ATTENTION_PLUGIN,\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;AAKzD,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,IAAIC;EACJC,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", "ATTENTION_PLUGIN", "context", "props", "attention", "useCapability", "AttentionCapabilities", "Attention", "selection", "Selection", "RootAttentionProvider", "onChange", "nextAttended", "SelectionProvider", "children"]
7
- }
@@ -1,23 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/meta.ts
4
- var ATTENTION_PLUGIN = "dxos.org/plugin/attention";
5
- var meta = {
6
- id: ATTENTION_PLUGIN,
7
- name: "Attention"
8
- };
9
-
10
- // src/capabilities/capabilities.ts
11
- import { defineCapability } from "@dxos/app-framework";
12
- (function(AttentionCapabilities2) {
13
- AttentionCapabilities2.Attention = defineCapability(`${ATTENTION_PLUGIN}/capability/attention`);
14
- AttentionCapabilities2.Selection = defineCapability(`${ATTENTION_PLUGIN}/capability/selection`);
15
- })(AttentionCapabilities || (AttentionCapabilities = {}));
16
- var AttentionCapabilities;
17
-
18
- export {
19
- ATTENTION_PLUGIN,
20
- meta,
21
- AttentionCapabilities
22
- };
23
- //# sourceMappingURL=chunk-SVV7GQYN.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts", "../../../src/capabilities/capabilities.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const ATTENTION_PLUGIN = 'dxos.org/plugin/attention';\n\nexport const meta: PluginMeta = {\n id: ATTENTION_PLUGIN,\n name: 'Attention',\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type SelectionManager, type AttentionManager } from '@dxos/react-ui-attention';\n\nimport { ATTENTION_PLUGIN } from '../meta';\n\nexport namespace AttentionCapabilities {\n export const Attention = defineCapability<AttentionManager>(`${ATTENTION_PLUGIN}/capability/attention`);\n export const Selection = defineCapability<SelectionManager>(`${ATTENTION_PLUGIN}/capability/selection`);\n}\n"],
5
- "mappings": ";;;AAMO,IAAMA,mBAAmB;AAEzB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;AACR;;;ACPA,SAASC,wBAAwB;UAKhBC,wBAAAA;yBACFC,YAAYC,iBAAmC,GAAGC,gBAAAA,uBAAuC;yBACzFC,YAAYF,iBAAmC,GAAGC,gBAAAA,uBAAuC;AACxG,GAHiBH,0BAAAA,wBAAAA,CAAAA,EAAAA;;",
6
- "names": ["ATTENTION_PLUGIN", "meta", "id", "name", "defineCapability", "AttentionCapabilities", "Attention", "defineCapability", "ATTENTION_PLUGIN", "Selection"]
7
- }
@@ -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 { Option } from 'effect';\n\nimport { Capabilities as AppCapabilities, contributes, type PluginContext } 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,iBAAiBC,mBAAuC;AACjF,SAASC,gBAAgB;AAIzB,IAAA,mBAAe,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
- "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
- }
@@ -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 { AttentionCapabilities } from './capabilities';\nimport { ATTENTION_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactContext, {\n id: ATTENTION_PLUGIN,\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;AAKzD,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,IAAIC;EACJC,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", "ATTENTION_PLUGIN", "context", "props", "attention", "useCapability", "AttentionCapabilities", "Attention", "selection", "Selection", "RootAttentionProvider", "onChange", "nextAttended", "SelectionProvider", "children"]
7
- }