@dxos/plugin-attention 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef

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 (65) hide show
  1. package/dist/lib/browser/AttentionPlugin-74FLOEWA.mjs +59 -0
  2. package/dist/lib/browser/AttentionPlugin-74FLOEWA.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-BDLH2DQU.mjs → chunk-DTGSOFCE.mjs} +1 -1
  4. package/dist/lib/browser/{chunk-BDLH2DQU.mjs.map → chunk-DTGSOFCE.mjs.map} +2 -2
  5. package/dist/lib/browser/index.mjs +7 -57
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/operations/index.mjs +2 -8
  9. package/dist/lib/browser/operations/index.mjs.map +3 -3
  10. package/dist/lib/browser/{select-HQCLOXD6.mjs → select-CI2OLVWT.mjs} +6 -9
  11. package/dist/lib/browser/select-CI2OLVWT.mjs.map +7 -0
  12. package/dist/lib/browser/types/index.mjs +1 -2
  13. package/dist/lib/node-esm/AttentionPlugin-XWSCV227.mjs +61 -0
  14. package/dist/lib/node-esm/AttentionPlugin-XWSCV227.mjs.map +7 -0
  15. package/dist/lib/node-esm/{chunk-GWUE2YCZ.mjs → chunk-HMHKU4FO.mjs} +1 -1
  16. package/dist/lib/node-esm/{chunk-GWUE2YCZ.mjs.map → chunk-HMHKU4FO.mjs.map} +2 -2
  17. package/dist/lib/node-esm/index.mjs +7 -56
  18. package/dist/lib/node-esm/index.mjs.map +4 -4
  19. package/dist/lib/node-esm/meta.json +1 -1
  20. package/dist/lib/node-esm/operations/index.mjs +2 -7
  21. package/dist/lib/node-esm/operations/index.mjs.map +3 -3
  22. package/dist/lib/node-esm/{select-GLRAU6S2.mjs → select-QNJSO4Q5.mjs} +6 -9
  23. package/dist/lib/node-esm/select-QNJSO4Q5.mjs.map +7 -0
  24. package/dist/lib/node-esm/types/index.mjs +1 -2
  25. package/dist/types/src/AttentionPlugin.d.ts +1 -0
  26. package/dist/types/src/AttentionPlugin.d.ts.map +1 -1
  27. package/dist/types/src/AttentionPlugin.test.d.ts +2 -0
  28. package/dist/types/src/AttentionPlugin.test.d.ts.map +1 -0
  29. package/dist/types/src/capabilities/index.d.ts +1 -1
  30. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  31. package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
  32. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  33. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  35. package/dist/types/src/index.d.ts +3 -2
  36. package/dist/types/src/index.d.ts.map +1 -1
  37. package/dist/types/src/operations/index.d.ts +1 -2
  38. package/dist/types/src/operations/index.d.ts.map +1 -1
  39. package/dist/types/src/operations/select.d.ts +3 -3
  40. package/dist/types/src/operations/select.d.ts.map +1 -1
  41. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  42. package/dist/types/src/types/events.d.ts.map +1 -1
  43. package/dist/types/src/types/types.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +12 -20
  46. package/src/AttentionPlugin.test.ts +32 -0
  47. package/src/AttentionPlugin.ts +3 -1
  48. package/src/capabilities/index.ts +1 -1
  49. package/src/capabilities/operation-handler.ts +1 -1
  50. package/src/index.ts +7 -2
  51. package/src/operations/index.ts +1 -3
  52. package/src/operations/select.ts +4 -4
  53. package/dist/lib/browser/chunk-55HTXC2G.mjs +0 -39
  54. package/dist/lib/browser/chunk-55HTXC2G.mjs.map +0 -7
  55. package/dist/lib/browser/chunk-J5LGTIGS.mjs +0 -10
  56. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +0 -7
  57. package/dist/lib/browser/select-HQCLOXD6.mjs.map +0 -7
  58. package/dist/lib/node-esm/chunk-HQWPPQXC.mjs +0 -40
  59. package/dist/lib/node-esm/chunk-HQWPPQXC.mjs.map +0 -7
  60. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  61. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
  62. package/dist/lib/node-esm/select-GLRAU6S2.mjs.map +0 -7
  63. package/dist/types/src/operations/definitions.d.ts +0 -23
  64. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  65. package/src/operations/definitions.ts +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-attention",
3
- "version": "0.8.4-main.9be5663bfe",
3
+ "version": "0.8.4-main.abd8ff62ef",
4
4
  "description": "Plugin for attention",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -13,6 +13,7 @@
13
13
  "sideEffects": true,
14
14
  "type": "module",
15
15
  "imports": {
16
+ "#plugin": "./src/AttentionPlugin.ts",
16
17
  "#capabilities": "./src/capabilities/index.ts",
17
18
  "#meta": "./src/meta.ts",
18
19
  "#operations": "./src/operations/index.ts",
@@ -39,35 +40,26 @@
39
40
  }
40
41
  },
41
42
  "types": "dist/types/src/index.d.ts",
42
- "typesVersions": {
43
- "*": {
44
- "types": [
45
- "dist/types/src/types/index.d.ts"
46
- ],
47
- "operations": [
48
- "dist/types/src/operations/index.d.ts"
49
- ]
50
- }
51
- },
52
43
  "files": [
53
44
  "dist",
54
45
  "src"
55
46
  ],
56
47
  "dependencies": {
57
48
  "effect": "3.20.0",
58
- "@dxos/app-framework": "0.8.4-main.9be5663bfe",
59
- "@dxos/echo": "0.8.4-main.9be5663bfe",
60
- "@dxos/app-toolkit": "0.8.4-main.9be5663bfe",
61
- "@dxos/plugin-graph": "0.8.4-main.9be5663bfe",
62
- "@dxos/operation": "0.8.4-main.9be5663bfe",
63
- "@dxos/react-ui-attention": "0.8.4-main.9be5663bfe",
64
- "@dxos/keyboard": "0.8.4-main.9be5663bfe",
65
- "@dxos/util": "0.8.4-main.9be5663bfe"
49
+ "@dxos/app-framework": "0.8.4-main.abd8ff62ef",
50
+ "@dxos/compute": "0.8.4-main.abd8ff62ef",
51
+ "@dxos/echo": "0.8.4-main.abd8ff62ef",
52
+ "@dxos/app-toolkit": "0.8.4-main.abd8ff62ef",
53
+ "@dxos/plugin-graph": "0.8.4-main.abd8ff62ef",
54
+ "@dxos/util": "0.8.4-main.abd8ff62ef",
55
+ "@dxos/react-ui-attention": "0.8.4-main.abd8ff62ef",
56
+ "@dxos/keyboard": "0.8.4-main.abd8ff62ef"
66
57
  },
67
58
  "devDependencies": {
68
59
  "@types/react": "~19.2.7",
69
60
  "react": "~19.2.3",
70
- "react-dom": "~19.2.3"
61
+ "react-dom": "~19.2.3",
62
+ "@dxos/plugin-graph": "0.8.4-main.abd8ff62ef"
71
63
  },
72
64
  "peerDependencies": {
73
65
  "effect": "3.20.0",
@@ -0,0 +1,32 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { describe, test } from 'vitest';
6
+
7
+ import { ActivationEvents, OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
8
+ import { createTestApp } from '@dxos/app-framework/testing';
9
+ import { GraphPlugin } from '@dxos/plugin-graph';
10
+
11
+ import { AttentionPlugin } from '#plugin';
12
+
13
+ import { meta } from './meta';
14
+
15
+ const moduleId = (name: string) => `${meta.id}.module.${name}`;
16
+
17
+ describe('AttentionPlugin', () => {
18
+ test('modules activate on the expected events', async ({ expect }) => {
19
+ await using harness = await createTestApp({
20
+ plugins: [GraphPlugin(), OperationPlugin(), RuntimePlugin(), AttentionPlugin()],
21
+ });
22
+
23
+ // Modules expected to be active after a normal startup.
24
+ expect(harness.manager.getActive()).toEqual(
25
+ expect.arrayContaining([moduleId('attention'), moduleId('ReactContext'), moduleId('Keyboard')]),
26
+ );
27
+
28
+ // OperationHandler fires lazily when an operation is invoked.
29
+ await harness.fire(ActivationEvents.SetupOperationHandler);
30
+ expect(harness.manager.getActive()).toContain(moduleId('OperationHandler'));
31
+ });
32
+ });
@@ -18,7 +18,7 @@ export const AttentionPlugin = Plugin.define(meta).pipe(
18
18
  Plugin.addModule({
19
19
  id: 'attention',
20
20
  activatesOn: ActivationEvents.Startup,
21
- activatesAfter: [AttentionEvents.AttentionReady],
21
+ firesAfterActivation: [AttentionEvents.AttentionReady],
22
22
  activate: () =>
23
23
  Effect.gen(function* () {
24
24
  const registry = yield* Capability.get(Capabilities.AtomRegistry);
@@ -62,3 +62,5 @@ const setupDevtools = (attention: AttentionManager) => {
62
62
  },
63
63
  };
64
64
  };
65
+
66
+ export default AttentionPlugin;
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { Capability } from '@dxos/app-framework';
6
- import { OperationHandlerSet } from '@dxos/operation';
6
+ import { OperationHandlerSet } from '@dxos/compute';
7
7
 
8
8
  export const Keyboard = Capability.lazy('Keyboard', () => import('./keyboard'));
9
9
  export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
@@ -5,7 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability } from '@dxos/app-framework';
8
- import type { OperationHandlerSet } from '@dxos/operation';
8
+ import type { OperationHandlerSet } from '@dxos/compute';
9
9
 
10
10
  import { AttentionOperationHandlerSet } from '#operations';
11
11
 
package/src/index.ts CHANGED
@@ -2,5 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export { AttentionPlugin } from './AttentionPlugin';
6
- export { meta } from './meta';
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const AttentionPlugin = Plugin.lazy(meta, () => import('./AttentionPlugin'));
10
+
11
+ export * from './meta';
@@ -2,8 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { OperationHandlerSet } from '@dxos/operation';
6
-
7
- export * as AttentionOperation from './definitions';
5
+ import { OperationHandlerSet } from '@dxos/compute';
8
6
 
9
7
  export const AttentionOperationHandlerSet = OperationHandlerSet.lazy(() => import('./select'));
@@ -6,16 +6,16 @@ import * as Effect from 'effect/Effect';
6
6
  import * as Match from 'effect/Match';
7
7
 
8
8
  import { Capability } from '@dxos/app-framework';
9
- import { Operation } from '@dxos/operation';
9
+ import { LayoutOperation } from '@dxos/app-toolkit';
10
+ import { Operation } from '@dxos/compute';
10
11
 
11
12
  import { AttentionCapabilities } from '../types';
12
- import { Select } from './definitions';
13
13
 
14
- const handler: Operation.WithHandler<typeof Select> = Select.pipe(
14
+ const handler: Operation.WithHandler<typeof LayoutOperation.Select> = LayoutOperation.Select.pipe(
15
15
  Operation.withHandler(
16
16
  Effect.fnUntraced(function* (input) {
17
17
  const selection = yield* Capability.get(AttentionCapabilities.Selection);
18
- Match.value(input.selection).pipe(
18
+ Match.value(input.subject).pipe(
19
19
  Match.when({ mode: 'single', id: undefined }, () => {
20
20
  selection.clearSelection(input.contextId);
21
21
  }),
@@ -1,39 +0,0 @@
1
- import {
2
- __export
3
- } from "./chunk-J5LGTIGS.mjs";
4
-
5
- // src/operations/definitions.ts
6
- var definitions_exports = {};
7
- __export(definitions_exports, {
8
- Select: () => Select
9
- });
10
- import * as Schema from "effect/Schema";
11
- import { Capability } from "@dxos/app-framework";
12
- import { Operation } from "@dxos/operation";
13
- import { SelectionSchema } from "@dxos/react-ui-attention";
14
- import { meta } from "#meta";
15
- var Select = Operation.make({
16
- meta: {
17
- key: `${meta.id}.operation.select`,
18
- name: "Select",
19
- description: "Select items in an attention context."
20
- },
21
- services: [
22
- Capability.Service
23
- ],
24
- input: Schema.Struct({
25
- contextId: Schema.String.annotations({
26
- description: "The id of the attention context."
27
- }),
28
- selection: SelectionSchema.annotations({
29
- description: "The selection to apply."
30
- })
31
- }),
32
- output: Schema.Void
33
- });
34
-
35
- export {
36
- Select,
37
- definitions_exports
38
- };
39
- //# sourceMappingURL=chunk-55HTXC2G.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\nimport { SelectionSchema } from '@dxos/react-ui-attention';\n\nimport { meta } from '#meta';\n\nexport const Select = Operation.make({\n meta: {\n key: `${meta.id}.operation.select`,\n name: 'Select',\n description: 'Select items in an attention context.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n contextId: Schema.String.annotations({ description: 'The id of the attention context.' }),\n selection: SelectionSchema.annotations({ description: 'The selection to apply.' }),\n }),\n output: Schema.Void,\n});\n"],
5
- "mappings": ";;;;;AAAA;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAEhC,SAASC,YAAY;AAEd,IAAMC,SAASC,UAAUC,KAAK;EACnCC,MAAM;IACJC,KAAK,GAAGD,KAAKE,EAAE;IACfC,MAAM;IACNC,aAAa;EACf;EACAC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBC,WAAkBC,cAAOC,YAAY;MAAER,aAAa;IAAmC,CAAA;IACvFS,WAAWC,gBAAgBF,YAAY;MAAER,aAAa;IAA0B,CAAA;EAClF,CAAA;EACAW,QAAeC;AACjB,CAAA;",
6
- "names": ["Schema", "Capability", "Operation", "SelectionSchema", "meta", "Select", "Operation", "make", "meta", "key", "id", "name", "description", "services", "Capability", "Service", "input", "Struct", "contextId", "String", "annotations", "selection", "SelectionSchema", "output", "Void"]
7
- }
@@ -1,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- export {
8
- __export
9
- };
10
- //# sourceMappingURL=chunk-J5LGTIGS.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/select.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Match from 'effect/Match';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\n\nimport { AttentionCapabilities } from '../types';\nimport { Select } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Select> = Select.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const selection = yield* Capability.get(AttentionCapabilities.Selection);\n Match.value(input.selection).pipe(\n Match.when({ mode: 'single', id: undefined }, () => {\n selection.clearSelection(input.contextId);\n }),\n Match.when({ mode: 'single' }, (s) => {\n selection.updateSingle(input.contextId, s.id!);\n }),\n Match.when({ mode: 'multi' }, (s) => {\n selection.updateMulti(input.contextId, s.ids);\n }),\n Match.when({ mode: 'range', from: undefined, to: undefined }, () => {\n selection.clearSelection(input.contextId);\n }),\n Match.when({ mode: 'range' }, (s) => {\n selection.updateRange(input.contextId, s.from!, s.to!);\n }),\n Match.when({ mode: 'multi-range' }, (s) => {\n selection.updateMultiRange(input.contextId, s.ranges);\n }),\n Match.exhaustive,\n );\n }),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AAEvB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAK1B,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,YAAY,OAAOC,WAAWC,IAAIC,sBAAsBC,SAAS;AACvEC,EAAMC,YAAMP,MAAMC,SAAS,EAAEL,KACrBY,WAAK;IAAEC,MAAM;IAAUC,IAAIC;EAAU,GAAG,MAAA;AAC5CV,cAAUW,eAAeZ,MAAMa,SAAS;EAC1C,CAAA,GACML,WAAK;IAAEC,MAAM;EAAS,GAAG,CAACK,MAAAA;AAC9Bb,cAAUc,aAAaf,MAAMa,WAAWC,EAAEJ,EAAE;EAC9C,CAAA,GACMF,WAAK;IAAEC,MAAM;EAAQ,GAAG,CAACK,MAAAA;AAC7Bb,cAAUe,YAAYhB,MAAMa,WAAWC,EAAEG,GAAG;EAC9C,CAAA,GACMT,WAAK;IAAEC,MAAM;IAASS,MAAMP;IAAWQ,IAAIR;EAAU,GAAG,MAAA;AAC5DV,cAAUW,eAAeZ,MAAMa,SAAS;EAC1C,CAAA,GACML,WAAK;IAAEC,MAAM;EAAQ,GAAG,CAACK,MAAAA;AAC7Bb,cAAUmB,YAAYpB,MAAMa,WAAWC,EAAEI,MAAOJ,EAAEK,EAAE;EACtD,CAAA,GACMX,WAAK;IAAEC,MAAM;EAAc,GAAG,CAACK,MAAAA;AACnCb,cAAUoB,iBAAiBrB,MAAMa,WAAWC,EAAEQ,MAAM;EACtD,CAAA,GACMC,gBAAU;AAEpB,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAe7B;",
6
- "names": ["Effect", "Match", "Capability", "Operation", "handler", "Select", "pipe", "Operation", "withHandler", "fnUntraced", "input", "selection", "Capability", "get", "AttentionCapabilities", "Selection", "Match", "value", "when", "mode", "id", "undefined", "clearSelection", "contextId", "s", "updateSingle", "updateMulti", "ids", "from", "to", "updateRange", "updateMultiRange", "ranges", "exhaustive"]
7
- }
@@ -1,40 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- __export
4
- } from "./chunk-HSLMI22Q.mjs";
5
-
6
- // src/operations/definitions.ts
7
- var definitions_exports = {};
8
- __export(definitions_exports, {
9
- Select: () => Select
10
- });
11
- import * as Schema from "effect/Schema";
12
- import { Capability } from "@dxos/app-framework";
13
- import { Operation } from "@dxos/operation";
14
- import { SelectionSchema } from "@dxos/react-ui-attention";
15
- import { meta } from "#meta";
16
- var Select = Operation.make({
17
- meta: {
18
- key: `${meta.id}.operation.select`,
19
- name: "Select",
20
- description: "Select items in an attention context."
21
- },
22
- services: [
23
- Capability.Service
24
- ],
25
- input: Schema.Struct({
26
- contextId: Schema.String.annotations({
27
- description: "The id of the attention context."
28
- }),
29
- selection: SelectionSchema.annotations({
30
- description: "The selection to apply."
31
- })
32
- }),
33
- output: Schema.Void
34
- });
35
-
36
- export {
37
- Select,
38
- definitions_exports
39
- };
40
- //# sourceMappingURL=chunk-HQWPPQXC.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\nimport { SelectionSchema } from '@dxos/react-ui-attention';\n\nimport { meta } from '#meta';\n\nexport const Select = Operation.make({\n meta: {\n key: `${meta.id}.operation.select`,\n name: 'Select',\n description: 'Select items in an attention context.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n contextId: Schema.String.annotations({ description: 'The id of the attention context.' }),\n selection: SelectionSchema.annotations({ description: 'The selection to apply.' }),\n }),\n output: Schema.Void,\n});\n"],
5
- "mappings": ";;;;;;AAAA;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAEhC,SAASC,YAAY;AAEd,IAAMC,SAASC,UAAUC,KAAK;EACnCC,MAAM;IACJC,KAAK,GAAGD,KAAKE,EAAE;IACfC,MAAM;IACNC,aAAa;EACf;EACAC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBC,WAAkBC,cAAOC,YAAY;MAAER,aAAa;IAAmC,CAAA;IACvFS,WAAWC,gBAAgBF,YAAY;MAAER,aAAa;IAA0B,CAAA;EAClF,CAAA;EACAW,QAAeC;AACjB,CAAA;",
6
- "names": ["Schema", "Capability", "Operation", "SelectionSchema", "meta", "Select", "Operation", "make", "meta", "key", "id", "name", "description", "services", "Capability", "Service", "input", "Struct", "contextId", "String", "annotations", "selection", "SelectionSchema", "output", "Void"]
7
- }
@@ -1,11 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- var __defProp = Object.defineProperty;
3
- var __export = (target, all) => {
4
- for (var name in all)
5
- __defProp(target, name, { get: all[name], enumerable: true });
6
- };
7
-
8
- export {
9
- __export
10
- };
11
- //# sourceMappingURL=chunk-HSLMI22Q.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/select.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Match from 'effect/Match';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\n\nimport { AttentionCapabilities } from '../types';\nimport { Select } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Select> = Select.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const selection = yield* Capability.get(AttentionCapabilities.Selection);\n Match.value(input.selection).pipe(\n Match.when({ mode: 'single', id: undefined }, () => {\n selection.clearSelection(input.contextId);\n }),\n Match.when({ mode: 'single' }, (s) => {\n selection.updateSingle(input.contextId, s.id!);\n }),\n Match.when({ mode: 'multi' }, (s) => {\n selection.updateMulti(input.contextId, s.ids);\n }),\n Match.when({ mode: 'range', from: undefined, to: undefined }, () => {\n selection.clearSelection(input.contextId);\n }),\n Match.when({ mode: 'range' }, (s) => {\n selection.updateRange(input.contextId, s.from!, s.to!);\n }),\n Match.when({ mode: 'multi-range' }, (s) => {\n selection.updateMultiRange(input.contextId, s.ranges);\n }),\n Match.exhaustive,\n );\n }),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AAEvB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAK1B,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,YAAY,OAAOC,WAAWC,IAAIC,sBAAsBC,SAAS;AACvEC,EAAMC,YAAMP,MAAMC,SAAS,EAAEL,KACrBY,WAAK;IAAEC,MAAM;IAAUC,IAAIC;EAAU,GAAG,MAAA;AAC5CV,cAAUW,eAAeZ,MAAMa,SAAS;EAC1C,CAAA,GACML,WAAK;IAAEC,MAAM;EAAS,GAAG,CAACK,MAAAA;AAC9Bb,cAAUc,aAAaf,MAAMa,WAAWC,EAAEJ,EAAE;EAC9C,CAAA,GACMF,WAAK;IAAEC,MAAM;EAAQ,GAAG,CAACK,MAAAA;AAC7Bb,cAAUe,YAAYhB,MAAMa,WAAWC,EAAEG,GAAG;EAC9C,CAAA,GACMT,WAAK;IAAEC,MAAM;IAASS,MAAMP;IAAWQ,IAAIR;EAAU,GAAG,MAAA;AAC5DV,cAAUW,eAAeZ,MAAMa,SAAS;EAC1C,CAAA,GACML,WAAK;IAAEC,MAAM;EAAQ,GAAG,CAACK,MAAAA;AAC7Bb,cAAUmB,YAAYpB,MAAMa,WAAWC,EAAEI,MAAOJ,EAAEK,EAAE;EACtD,CAAA,GACMX,WAAK;IAAEC,MAAM;EAAc,GAAG,CAACK,MAAAA;AACnCb,cAAUoB,iBAAiBrB,MAAMa,WAAWC,EAAEQ,MAAM;EACtD,CAAA,GACMC,gBAAU;AAEpB,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAe7B;",
6
- "names": ["Effect", "Match", "Capability", "Operation", "handler", "Select", "pipe", "Operation", "withHandler", "fnUntraced", "input", "selection", "Capability", "get", "AttentionCapabilities", "Selection", "Match", "value", "when", "mode", "id", "undefined", "clearSelection", "contextId", "s", "updateSingle", "updateMulti", "ids", "from", "to", "updateRange", "updateMultiRange", "ranges", "exhaustive"]
7
- }
@@ -1,23 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- import { Operation } from '@dxos/operation';
3
- export declare const Select: Operation.Definition<{
4
- readonly contextId: string;
5
- readonly selection: {
6
- mode: "single";
7
- id?: string | undefined;
8
- } | {
9
- mode: "multi";
10
- ids: string[];
11
- } | {
12
- mode: "range";
13
- from?: string | undefined;
14
- to?: string | undefined;
15
- } | {
16
- mode: "multi-range";
17
- ranges: {
18
- readonly from: string;
19
- readonly to: string;
20
- }[];
21
- };
22
- }, void, Capability.Service>;
23
- //# sourceMappingURL=definitions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../../src/operations/definitions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;4BAYjB,CAAC"}
@@ -1,25 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Schema from 'effect/Schema';
6
-
7
- import { Capability } from '@dxos/app-framework';
8
- import { Operation } from '@dxos/operation';
9
- import { SelectionSchema } from '@dxos/react-ui-attention';
10
-
11
- import { meta } from '#meta';
12
-
13
- export const Select = Operation.make({
14
- meta: {
15
- key: `${meta.id}.operation.select`,
16
- name: 'Select',
17
- description: 'Select items in an attention context.',
18
- },
19
- services: [Capability.Service],
20
- input: Schema.Struct({
21
- contextId: Schema.String.annotations({ description: 'The id of the attention context.' }),
22
- selection: SelectionSchema.annotations({ description: 'The selection to apply.' }),
23
- }),
24
- output: Schema.Void,
25
- });