@dxos/plugin-attention 0.8.4-main.f5c0578 → 0.8.4-main.fcc0d83b33
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-DTGSOFCE.mjs +41 -0
- package/dist/lib/browser/chunk-DTGSOFCE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +48 -68
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +7 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/select-CI2OLVWT.mjs +46 -0
- package/dist/lib/browser/select-CI2OLVWT.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/chunk-HMHKU4FO.mjs +43 -0
- package/dist/lib/node-esm/chunk-HMHKU4FO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +48 -67
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +9 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/select-QNJSO4Q5.mjs +47 -0
- package/dist/lib/node-esm/select-QNJSO4Q5.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -4
- package/dist/types/src/AttentionPlugin.d.ts +2 -1
- package/dist/types/src/AttentionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts +3 -2
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts +4 -2
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/select.d.ts +5 -0
- package/dist/types/src/operations/select.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +7 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +3 -3
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -23
- package/src/AttentionPlugin.ts +38 -38
- package/src/capabilities/index.ts +8 -6
- package/src/capabilities/keyboard.ts +15 -16
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-context.tsx +29 -25
- package/src/index.ts +2 -6
- package/src/meta.ts +8 -5
- package/src/operations/index.ts +7 -0
- package/src/operations/select.ts +43 -0
- package/src/types/capabilities.ts +13 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +2 -0
- package/src/types/types.ts +4 -4
- package/dist/lib/browser/chunk-DF2PBRKK.mjs +0 -12
- package/dist/lib/browser/chunk-DF2PBRKK.mjs.map +0 -7
- package/dist/lib/browser/chunk-LRNGQJHD.mjs +0 -16
- package/dist/lib/browser/chunk-LRNGQJHD.mjs.map +0 -7
- package/dist/lib/browser/chunk-WOQAO42V.mjs +0 -25
- package/dist/lib/browser/chunk-WOQAO42V.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-E7G6R755.mjs +0 -51
- package/dist/lib/browser/intent-resolver-E7G6R755.mjs.map +0 -7
- package/dist/lib/browser/keyboard-JTQ2RGL7.mjs +0 -28
- package/dist/lib/browser/keyboard-JTQ2RGL7.mjs.map +0 -7
- package/dist/lib/browser/react-context-IUBFXFFZ.mjs +0 -29
- package/dist/lib/browser/react-context-IUBFXFFZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K3STXVKU.mjs +0 -17
- package/dist/lib/node-esm/chunk-K3STXVKU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MS46IMND.mjs +0 -26
- package/dist/lib/node-esm/chunk-MS46IMND.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YUJM7ABN.mjs +0 -14
- package/dist/lib/node-esm/chunk-YUJM7ABN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-ELLJ67CV.mjs +0 -52
- package/dist/lib/node-esm/intent-resolver-ELLJ67CV.mjs.map +0 -7
- package/dist/lib/node-esm/keyboard-S7SW6XBY.mjs +0 -29
- package/dist/lib/node-esm/keyboard-S7SW6XBY.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-2RSEVMNC.mjs +0 -30
- package/dist/lib/node-esm/react-context-2RSEVMNC.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -6
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -13
- package/src/capabilities/intent-resolver.ts +0 -43
- package/src/events.ts +0 -11
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AttentionCapabilities
|
|
3
|
-
} from "./chunk-LRNGQJHD.mjs";
|
|
4
|
-
import "./chunk-DF2PBRKK.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/keyboard.ts
|
|
7
|
-
import { effect } from "@preact/signals-core";
|
|
8
|
-
import { Option } from "effect";
|
|
9
|
-
import { Capabilities as AppCapabilities, contributes } from "@dxos/app-framework";
|
|
10
|
-
import { Keyboard } from "@dxos/keyboard";
|
|
11
|
-
var keyboard_default = (context) => {
|
|
12
|
-
const { graph } = context.getCapability(AppCapabilities.AppGraph);
|
|
13
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
14
|
-
const unsubscribe = effect(() => {
|
|
15
|
-
const id = Array.from(attention.current)[0];
|
|
16
|
-
const path = id && graph.getPath({
|
|
17
|
-
target: id
|
|
18
|
-
}).pipe(Option.getOrNull);
|
|
19
|
-
if (path) {
|
|
20
|
-
Keyboard.singleton.setCurrentContext(path.join("/"));
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return contributes(AppCapabilities.Null, null, () => unsubscribe());
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
keyboard_default as default
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=keyboard-JTQ2RGL7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/keyboard.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport { 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,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,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AttentionCapabilities
|
|
3
|
-
} from "./chunk-LRNGQJHD.mjs";
|
|
4
|
-
import {
|
|
5
|
-
ATTENTION_PLUGIN
|
|
6
|
-
} from "./chunk-DF2PBRKK.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/react-context.tsx
|
|
9
|
-
import React from "react";
|
|
10
|
-
import { Capabilities, contributes, useCapability } from "@dxos/app-framework";
|
|
11
|
-
import { RootAttentionProvider, SelectionProvider } from "@dxos/react-ui-attention";
|
|
12
|
-
var react_context_default = () => contributes(Capabilities.ReactContext, {
|
|
13
|
-
id: ATTENTION_PLUGIN,
|
|
14
|
-
context: (props) => {
|
|
15
|
-
const attention = useCapability(AttentionCapabilities.Attention);
|
|
16
|
-
const selection = useCapability(AttentionCapabilities.Selection);
|
|
17
|
-
return /* @__PURE__ */ React.createElement(RootAttentionProvider, {
|
|
18
|
-
attention,
|
|
19
|
-
onChange: (nextAttended) => {
|
|
20
|
-
}
|
|
21
|
-
}, /* @__PURE__ */ React.createElement(SelectionProvider, {
|
|
22
|
-
selection
|
|
23
|
-
}, props.children));
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
export {
|
|
27
|
-
react_context_default as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=react-context-IUBFXFFZ.mjs.map
|
|
@@ -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 { ATTENTION_PLUGIN } from '../meta';\n\nimport { AttentionCapabilities } from './capabilities';\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;AAMzD,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,17 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
ATTENTION_PLUGIN
|
|
4
|
-
} from "./chunk-YUJM7ABN.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/capabilities.ts
|
|
7
|
-
import { defineCapability } from "@dxos/app-framework";
|
|
8
|
-
(function(AttentionCapabilities2) {
|
|
9
|
-
AttentionCapabilities2.Attention = defineCapability(`${ATTENTION_PLUGIN}/capability/attention`);
|
|
10
|
-
AttentionCapabilities2.Selection = defineCapability(`${ATTENTION_PLUGIN}/capability/selection`);
|
|
11
|
-
})(AttentionCapabilities || (AttentionCapabilities = {}));
|
|
12
|
-
var AttentionCapabilities;
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
AttentionCapabilities
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-K3STXVKU.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { 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": ";;;;;;AAIA,SAASA,wBAAwB;UAKhBC,wBAAAA;yBACFC,YAAYC,iBAAmC,GAAGC,gBAAAA,uBAAuC;yBACzFC,YAAYF,iBAAmC,GAAGC,gBAAAA,uBAAuC;AACxG,GAHiBH,0BAAAA,wBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["defineCapability", "AttentionCapabilities", "Attention", "defineCapability", "ATTENTION_PLUGIN", "Selection"]
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
ATTENTION_PLUGIN
|
|
4
|
-
} from "./chunk-YUJM7ABN.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 = `${ATTENTION_PLUGIN}/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-MS46IMND.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { SelectionSchema } from '@dxos/react-ui-attention';\n\nimport { ATTENTION_PLUGIN } from '../meta';\n\nexport namespace AttentionAction {\n const ATTENTION_ACTION = `${ATTENTION_PLUGIN}/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,gBAAAA;EAErB,MAAMC,eAAeC,OAAOC,YAAW,EAAW,GAAGJ,gBAAAA,WAA2B;IACrFK,OAAOF,OAAOG,OAAO;MACnBC,WAAWJ,OAAOK;MAClBC,WAAWC;IACb,CAAA;IACAC,QAAQR,OAAOS;EACjB,CAAA,EAAA;EAAI;mBANSV,SAAAA;AAOf,GAViBH,oBAAAA,kBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "SelectionSchema", "AttentionAction", "ATTENTION_ACTION", "ATTENTION_PLUGIN", "Select", "Schema", "TaggedClass", "input", "Struct", "contextId", "String", "selection", "SelectionSchema", "output", "Void"]
|
|
7
|
-
}
|
|
@@ -1,14 +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
|
-
export {
|
|
11
|
-
ATTENTION_PLUGIN,
|
|
12
|
-
meta
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=chunk-YUJM7ABN.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const ATTENTION_PLUGIN = 'dxos.org/plugin/attention';\n\nexport const meta: PluginMeta = {\n id: ATTENTION_PLUGIN,\n name: 'Attention',\n};\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,mBAAmB;AAEzB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;AACR;",
|
|
6
|
-
"names": ["ATTENTION_PLUGIN", "meta", "id", "name"]
|
|
7
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AttentionAction
|
|
4
|
-
} from "./chunk-MS46IMND.mjs";
|
|
5
|
-
import {
|
|
6
|
-
AttentionCapabilities
|
|
7
|
-
} from "./chunk-K3STXVKU.mjs";
|
|
8
|
-
import "./chunk-YUJM7ABN.mjs";
|
|
9
|
-
|
|
10
|
-
// src/capabilities/intent-resolver.ts
|
|
11
|
-
import { Match } from "effect";
|
|
12
|
-
import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
|
|
13
|
-
var intent_resolver_default = (context) => contributes(Capabilities.IntentResolver, [
|
|
14
|
-
createResolver({
|
|
15
|
-
intent: AttentionAction.Select,
|
|
16
|
-
resolve: (data) => {
|
|
17
|
-
const selection = context.getCapability(AttentionCapabilities.Selection);
|
|
18
|
-
Match.type().pipe(Match.when({
|
|
19
|
-
mode: "single",
|
|
20
|
-
id: void 0
|
|
21
|
-
}, () => {
|
|
22
|
-
selection.clearSelection(data.contextId);
|
|
23
|
-
}), Match.when({
|
|
24
|
-
mode: "single"
|
|
25
|
-
}, (s) => {
|
|
26
|
-
selection.updateSingle(data.contextId, s.id);
|
|
27
|
-
}), Match.when({
|
|
28
|
-
mode: "multi"
|
|
29
|
-
}, (s) => {
|
|
30
|
-
selection.updateMulti(data.contextId, s.ids);
|
|
31
|
-
}), Match.when({
|
|
32
|
-
mode: "range",
|
|
33
|
-
from: void 0,
|
|
34
|
-
to: void 0
|
|
35
|
-
}, () => {
|
|
36
|
-
selection.clearSelection(data.contextId);
|
|
37
|
-
}), Match.when({
|
|
38
|
-
mode: "range"
|
|
39
|
-
}, (s) => {
|
|
40
|
-
selection.updateRange(data.contextId, s.from, s.to);
|
|
41
|
-
}), Match.when({
|
|
42
|
-
mode: "multi-range"
|
|
43
|
-
}, (s) => {
|
|
44
|
-
selection.updateMultiRange(data.contextId, s.ranges);
|
|
45
|
-
}), Match.exhaustive)(data.selection);
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
]);
|
|
49
|
-
export {
|
|
50
|
-
intent_resolver_default as default
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=intent-resolver-ELLJ67CV.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { 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,0BAAe,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,29 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AttentionCapabilities
|
|
4
|
-
} from "./chunk-K3STXVKU.mjs";
|
|
5
|
-
import "./chunk-YUJM7ABN.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/keyboard.ts
|
|
8
|
-
import { effect } from "@preact/signals-core";
|
|
9
|
-
import { Option } from "effect";
|
|
10
|
-
import { Capabilities as AppCapabilities, contributes } from "@dxos/app-framework";
|
|
11
|
-
import { Keyboard } from "@dxos/keyboard";
|
|
12
|
-
var keyboard_default = (context) => {
|
|
13
|
-
const { graph } = context.getCapability(AppCapabilities.AppGraph);
|
|
14
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
15
|
-
const unsubscribe = effect(() => {
|
|
16
|
-
const id = Array.from(attention.current)[0];
|
|
17
|
-
const path = id && graph.getPath({
|
|
18
|
-
target: id
|
|
19
|
-
}).pipe(Option.getOrNull);
|
|
20
|
-
if (path) {
|
|
21
|
-
Keyboard.singleton.setCurrentContext(path.join("/"));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return contributes(AppCapabilities.Null, null, () => unsubscribe());
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
keyboard_default as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=keyboard-S7SW6XBY.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/keyboard.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport { 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,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,30 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AttentionCapabilities
|
|
4
|
-
} from "./chunk-K3STXVKU.mjs";
|
|
5
|
-
import {
|
|
6
|
-
ATTENTION_PLUGIN
|
|
7
|
-
} from "./chunk-YUJM7ABN.mjs";
|
|
8
|
-
|
|
9
|
-
// src/capabilities/react-context.tsx
|
|
10
|
-
import React from "react";
|
|
11
|
-
import { Capabilities, contributes, useCapability } from "@dxos/app-framework";
|
|
12
|
-
import { RootAttentionProvider, SelectionProvider } from "@dxos/react-ui-attention";
|
|
13
|
-
var react_context_default = () => contributes(Capabilities.ReactContext, {
|
|
14
|
-
id: ATTENTION_PLUGIN,
|
|
15
|
-
context: (props) => {
|
|
16
|
-
const attention = useCapability(AttentionCapabilities.Attention);
|
|
17
|
-
const selection = useCapability(AttentionCapabilities.Selection);
|
|
18
|
-
return /* @__PURE__ */ React.createElement(RootAttentionProvider, {
|
|
19
|
-
attention,
|
|
20
|
-
onChange: (nextAttended) => {
|
|
21
|
-
}
|
|
22
|
-
}, /* @__PURE__ */ React.createElement(SelectionProvider, {
|
|
23
|
-
selection
|
|
24
|
-
}, props.children));
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
export {
|
|
28
|
-
react_context_default as default
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=react-context-2RSEVMNC.mjs.map
|
|
@@ -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 { ATTENTION_PLUGIN } from '../meta';\n\nimport { AttentionCapabilities } from './capabilities';\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;AAMzD,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,6 +0,0 @@
|
|
|
1
|
-
import { type AttentionManager, type SelectionManager } from '@dxos/react-ui-attention';
|
|
2
|
-
export declare namespace AttentionCapabilities {
|
|
3
|
-
const Attention: import("@dxos/app-framework").InterfaceDef<AttentionManager>;
|
|
4
|
-
const Selection: import("@dxos/app-framework").InterfaceDef<SelectionManager>;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/capabilities.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIxF,yBAAiB,qBAAqB,CAAC;IAC9B,MAAM,SAAS,8DAAiF,CAAC;IACjG,MAAM,SAAS,8DAAiF,CAAC;CACzG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAA+B,MAAM,qBAAqB,CAAC;yBAOpF,SAAS,aAAa;AAAtC,wBA6BK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/events.ts"],"names":[],"mappings":"AAQA,yBAAiB,eAAe,CAAC;IACxB,MAAM,cAAc,+CAA2D,CAAC;CACxF"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type AttentionManager, type SelectionManager } from '@dxos/react-ui-attention';
|
|
7
|
-
|
|
8
|
-
import { ATTENTION_PLUGIN } from '../meta';
|
|
9
|
-
|
|
10
|
-
export namespace AttentionCapabilities {
|
|
11
|
-
export const Attention = defineCapability<AttentionManager>(`${ATTENTION_PLUGIN}/capability/attention`);
|
|
12
|
-
export const Selection = defineCapability<SelectionManager>(`${ATTENTION_PLUGIN}/capability/selection`);
|
|
13
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Match } from 'effect';
|
|
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
|
-
]);
|
package/src/events.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineEvent } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { ATTENTION_PLUGIN } from './meta';
|
|
8
|
-
|
|
9
|
-
export namespace AttentionEvents {
|
|
10
|
-
export const AttentionReady = defineEvent(`${ATTENTION_PLUGIN}/event/attention-ready`);
|
|
11
|
-
}
|