@dxos/plugin-search 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0
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/app-graph-builder-N6QQA637.mjs +77 -0
- package/dist/lib/browser/app-graph-builder-N6QQA637.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LXHJVTYG.mjs → chunk-4KPMT56H.mjs} +5 -5
- package/dist/lib/browser/chunk-4KPMT56H.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QNZWTMYF.mjs → chunk-SNU4XR5T.mjs} +9 -8
- package/dist/lib/browser/chunk-SNU4XR5T.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/{intent-resolver-G76A35DX.mjs → intent-resolver-QKBYLREY.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-O56YMWJT.mjs → react-surface-MG2K2YZ3.mjs} +27 -29
- package/dist/lib/browser/react-surface-MG2K2YZ3.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -177
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/SearchDialog.d.ts.map +1 -1
- package/dist/types/src/components/SearchResults/SearchResults.d.ts.map +1 -1
- package/dist/types/src/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/types/src/hooks/sync.d.ts.map +1 -1
- package/dist/types/src/hooks/useGlobalSearch.d.ts.map +1 -1
- package/dist/types/src/hooks/useSearchResults.d.ts.map +1 -1
- package/dist/types/src/hooks/useWebSearch.d.ts.map +1 -1
- package/dist/types/src/search/exa.d.ts +3 -3
- package/dist/types/src/search/exa.d.ts.map +1 -1
- package/dist/types/src/types/action.d.ts +5 -5
- package/dist/types/src/types/action.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -27
- package/src/capabilities/app-graph-builder.ts +59 -41
- package/src/capabilities/react-surface.tsx +4 -7
- package/src/components/SearchDialog.tsx +8 -7
- package/src/components/SearchMain.tsx +1 -1
- package/src/hooks/sync.ts +8 -6
- package/src/hooks/useSearchResults.ts +2 -2
- package/src/search/exa.ts +19 -19
- package/src/types/action.tsx +4 -4
- package/dist/lib/browser/app-graph-builder-RHZORTY2.mjs +0 -76
- package/dist/lib/browser/app-graph-builder-RHZORTY2.mjs.map +0 -7
- package/dist/lib/browser/chunk-LXHJVTYG.mjs.map +0 -7
- package/dist/lib/browser/chunk-QNZWTMYF.mjs.map +0 -7
- package/dist/lib/browser/react-surface-O56YMWJT.mjs.map +0 -7
- /package/dist/lib/browser/{intent-resolver-G76A35DX.mjs.map → intent-resolver-QKBYLREY.mjs.map} +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SearchAction
|
|
3
|
+
} from "./chunk-4KPMT56H.mjs";
|
|
4
|
+
import {
|
|
5
|
+
SEARCH_PLUGIN
|
|
6
|
+
} from "./chunk-J6YWSQTW.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts
|
|
9
|
+
import { Rx } from "@effect-rx/rx-react";
|
|
10
|
+
import { Option, pipe } from "effect";
|
|
11
|
+
import { Capabilities, contributes, createIntent } from "@dxos/app-framework";
|
|
12
|
+
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
13
|
+
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
14
|
+
import { createExtension, ROOT_ID, rxFromSignal } from "@dxos/plugin-graph";
|
|
15
|
+
import { parseId } from "@dxos/react-client/echo";
|
|
16
|
+
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
|
|
17
|
+
createExtension({
|
|
18
|
+
id: `${SEARCH_PLUGIN}/space-search`,
|
|
19
|
+
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map((node2) => {
|
|
20
|
+
const workspace = get(rxFromSignal(() => context.getCapability(Capabilities.Layout).workspace));
|
|
21
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
22
|
+
const { spaceId } = parseId(workspace);
|
|
23
|
+
const space = spaceId ? client.spaces.get(spaceId) : null;
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
id: [
|
|
27
|
+
node2.id,
|
|
28
|
+
"search"
|
|
29
|
+
].join(ATTENDABLE_PATH_SEPARATOR),
|
|
30
|
+
type: DECK_COMPANION_TYPE,
|
|
31
|
+
data: space,
|
|
32
|
+
properties: {
|
|
33
|
+
label: [
|
|
34
|
+
"search label",
|
|
35
|
+
{
|
|
36
|
+
ns: SEARCH_PLUGIN
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
icon: "ph--magnifying-glass--regular",
|
|
40
|
+
disposition: "hidden"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
}), Option.getOrElse(() => [])))
|
|
45
|
+
}),
|
|
46
|
+
createExtension({
|
|
47
|
+
id: SEARCH_PLUGIN,
|
|
48
|
+
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
id: SearchAction.OpenSearch._tag,
|
|
52
|
+
data: async () => {
|
|
53
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
54
|
+
await dispatch(createIntent(SearchAction.OpenSearch));
|
|
55
|
+
},
|
|
56
|
+
properties: {
|
|
57
|
+
label: [
|
|
58
|
+
"search action label",
|
|
59
|
+
{
|
|
60
|
+
ns: SEARCH_PLUGIN
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
icon: "ph--magnifying-glass--regular",
|
|
64
|
+
keyBinding: {
|
|
65
|
+
macos: "shift+meta+f",
|
|
66
|
+
windows: "shift+alt+f"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
}), Option.getOrElse(() => [])))
|
|
72
|
+
})
|
|
73
|
+
]);
|
|
74
|
+
export {
|
|
75
|
+
app_graph_builder_default as default
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=app-graph-builder-N6QQA637.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, type PluginContext } from '@dxos/app-framework';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { createExtension, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';\nimport { parseId } from '@dxos/react-client/echo';\n\nimport { SEARCH_PLUGIN } from '../meta';\nimport { SearchAction } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${SEARCH_PLUGIN}/space-search`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map((node) => {\n const workspace = get(rxFromSignal(() => context.getCapability(Capabilities.Layout).workspace));\n const client = context.getCapability(ClientCapabilities.Client);\n const { spaceId } = parseId(workspace);\n const space = spaceId ? client.spaces.get(spaceId) : null;\n\n return [\n {\n id: [node.id, 'search'].join(ATTENDABLE_PATH_SEPARATOR),\n type: DECK_COMPANION_TYPE,\n data: space,\n properties: {\n label: ['search label', { ns: SEARCH_PLUGIN }],\n icon: 'ph--magnifying-glass--regular',\n disposition: 'hidden',\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: SEARCH_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n return [\n {\n id: SearchAction.OpenSearch._tag,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(SearchAction.OpenSearch));\n },\n properties: {\n label: ['search action label', { ns: SEARCH_PLUGIN }],\n icon: 'ph--magnifying-glass--regular',\n keyBinding: {\n macos: 'shift+meta+f',\n windows: 'shift+alt+f',\n },\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,aAAaC,oBAAwC;AAC5E,SAASC,0BAA0B;AACnC,SAASC,2BAA2BC,2BAA2B;AAC/D,SAASC,iBAAiBC,SAASC,oBAAoB;AACvD,SAASC,eAAe;AAKxB,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,aAAAA;IACPC,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAOU,UAAUF,OAAOG,KAAKR,KAAAA,IAAQK,OAAOI,KAAI,CAAA,GAC/EJ,OAAOK,IAAI,CAACV,UAAAA;AACV,YAAMW,YAAYR,IAAIS,aAAa,MAAMpB,QAAQqB,cAAcnB,aAAaoB,MAAM,EAAEH,SAAS,CAAA;AAC7F,YAAMI,SAASvB,QAAQqB,cAAcG,mBAAmBC,MAAM;AAC9D,YAAM,EAAEC,QAAO,IAAKC,QAAQR,SAAAA;AAC5B,YAAMS,QAAQF,UAAUH,OAAOM,OAAOlB,IAAIe,OAAAA,IAAW;AAErD,aAAO;QACL;UACErB,IAAI;YAACG,MAAKH;YAAI;YAAUyB,KAAKC,yBAAAA;UAC7BC,MAAMC;UACNC,MAAMN;UACNO,YAAY;YACVC,OAAO;cAAC;cAAgB;gBAAEC,IAAI/B;cAAc;;YAC5CgC,MAAM;YACNC,aAAa;UACf;QACF;;IAEJ,CAAA,GACA1B,OAAO2B,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACApC,gBAAgB;IACdC,IAAIC;IACJmC,SAAS,CAACjC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAOU,UAAUF,OAAOG,KAAKR,KAAAA,IAAQK,OAAOI,KAAI,CAAA,GAC/EJ,OAAOK,IAAI,MAAA;AACT,aAAO;QACL;UACEb,IAAIqC,aAAaC,WAAWC;UAC5BV,MAAM,YAAA;AACJ,kBAAM,EAAEW,iBAAiBC,SAAQ,IAAK9C,QAAQqB,cAAcnB,aAAa6C,gBAAgB;AACzF,kBAAMD,SAASE,aAAaN,aAAaC,UAAU,CAAA;UACrD;UACAR,YAAY;YACVC,OAAO;cAAC;cAAuB;gBAAEC,IAAI/B;cAAc;;YACnDgC,MAAM;YACNW,YAAY;cACVC,OAAO;cACPC,SAAS;YACX;UACF;QACF;;IAEJ,CAAA,GACAtC,OAAO2B,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
|
|
6
|
+
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "ClientCapabilities", "ATTENDABLE_PATH_SEPARATOR", "DECK_COMPANION_TYPE", "createExtension", "ROOT_ID", "rxFromSignal", "parseId", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "SEARCH_PLUGIN", "connector", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "workspace", "rxFromSignal", "getCapability", "Layout", "client", "ClientCapabilities", "Client", "spaceId", "parseId", "space", "spaces", "join", "ATTENDABLE_PATH_SEPARATOR", "type", "DECK_COMPANION_TYPE", "data", "properties", "label", "ns", "icon", "disposition", "getOrElse", "actions", "SearchAction", "OpenSearch", "_tag", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "keyBinding", "macos", "windows"]
|
|
7
|
+
}
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-J6YWSQTW.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/plugins/plugin-search/src/types/action.tsx
|
|
6
|
-
import {
|
|
6
|
+
import { Schema } from "effect";
|
|
7
7
|
var SearchAction;
|
|
8
8
|
(function(SearchAction2) {
|
|
9
9
|
const SEARCH_ACTION = `${SEARCH_PLUGIN}/action`;
|
|
10
|
-
class OpenSearch extends
|
|
11
|
-
input:
|
|
12
|
-
output:
|
|
10
|
+
class OpenSearch extends Schema.TaggedClass()(`${SEARCH_ACTION}/open-search`, {
|
|
11
|
+
input: Schema.Void,
|
|
12
|
+
output: Schema.Void
|
|
13
13
|
}) {
|
|
14
14
|
}
|
|
15
15
|
SearchAction2.OpenSearch = OpenSearch;
|
|
@@ -18,4 +18,4 @@ var SearchAction;
|
|
|
18
18
|
export {
|
|
19
19
|
SearchAction
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-4KPMT56H.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/action.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { SEARCH_PLUGIN } from '../meta';\n\nexport namespace SearchAction {\n const SEARCH_ACTION = `${SEARCH_PLUGIN}/action`;\n\n export class OpenSearch extends Schema.TaggedClass<OpenSearch>()(`${SEARCH_ACTION}/open-search`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,cAAc;;UAINC,eAAAA;AACf,QAAMC,gBAAgB,GAAGC,aAAAA;EAElB,MAAMC,mBAAmBC,OAAOC,YAAW,EAAe,GAAGJ,aAAAA,gBAA6B;IAC/FK,OAAOF,OAAOG;IACdC,QAAQJ,OAAOG;EACjB,CAAA,EAAA;EAAI;gBAHSJ,aAAAA;AAIf,GAPiBH,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["Schema", "SearchAction", "SEARCH_ACTION", "SEARCH_PLUGIN", "OpenSearch", "Schema", "TaggedClass", "input", "Void", "output"]
|
|
7
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// packages/plugins/plugin-search/src/hooks/sync.ts
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SchemaAST } from "effect";
|
|
3
|
+
import { getSchema } from "@dxos/echo-schema";
|
|
4
|
+
import { DataType } from "@dxos/schema";
|
|
4
5
|
var queryStringToMatch = (queryString) => {
|
|
5
6
|
const trimmed = queryString?.trim();
|
|
6
7
|
return trimmed ? new RegExp(trimmed, "i") : void 0;
|
|
7
8
|
};
|
|
8
9
|
var getIcon = (schema) => {
|
|
9
|
-
if (!(schema &&
|
|
10
|
+
if (!(schema && SchemaAST.isTypeLiteral(schema.ast))) {
|
|
10
11
|
return void 0;
|
|
11
12
|
}
|
|
12
13
|
const keys = schema.ast.propertySignatures.map((p) => p.name);
|
|
@@ -26,7 +27,7 @@ var filterObjectsSync = (objects, match) => {
|
|
|
26
27
|
return [];
|
|
27
28
|
}
|
|
28
29
|
return objects.reduce((results, object) => {
|
|
29
|
-
if (object instanceof
|
|
30
|
+
if (object instanceof DataType.Text) {
|
|
30
31
|
return results;
|
|
31
32
|
}
|
|
32
33
|
const fields = mapObjectToTextFields(object);
|
|
@@ -78,7 +79,7 @@ var getKeys = (object) => {
|
|
|
78
79
|
var mapObjectToTextFields = (object) => {
|
|
79
80
|
return getKeys(object).reduce((fields, key) => {
|
|
80
81
|
const value = object[key];
|
|
81
|
-
if (typeof value === "string" || value instanceof
|
|
82
|
+
if (typeof value === "string" || value instanceof DataType.Text) {
|
|
82
83
|
try {
|
|
83
84
|
fields[key] = String(value);
|
|
84
85
|
} catch (err) {
|
|
@@ -123,13 +124,13 @@ var useGlobalFilteredObjects = (objects) => {
|
|
|
123
124
|
// packages/plugins/plugin-search/src/hooks/useSearchResults.ts
|
|
124
125
|
import { yieldOrContinue } from "main-thread-scheduling";
|
|
125
126
|
import { useEffect, useState as useState2 } from "react";
|
|
126
|
-
import {
|
|
127
|
+
import { DataType as DataType2 } from "@dxos/schema";
|
|
127
128
|
var filterObjects = async (objects, match) => {
|
|
128
129
|
const result = /* @__PURE__ */ new Map();
|
|
129
130
|
if (!match) {
|
|
130
131
|
return result;
|
|
131
132
|
}
|
|
132
|
-
await Promise.all(objects.filter((object) => !(object instanceof
|
|
133
|
+
await Promise.all(objects.filter((object) => !(object instanceof DataType2.Text)).map(async (object) => {
|
|
133
134
|
await yieldOrContinue("interactive");
|
|
134
135
|
const fields = mapObjectToTextFields(object);
|
|
135
136
|
Object.entries(fields).filter(([_, value]) => value.match(match)).forEach(([key, value]) => {
|
|
@@ -180,4 +181,4 @@ export {
|
|
|
180
181
|
filterObjects,
|
|
181
182
|
useSearchResults
|
|
182
183
|
};
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-SNU4XR5T.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/hooks/sync.ts", "../../../src/hooks/useGlobalSearch.tsx", "../../../src/hooks/useSearchResults.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Schema, SchemaAST } from 'effect';\n\nimport { getSchema } from '@dxos/echo-schema';\nimport { DataType } from '@dxos/schema';\n\nimport { type SearchResult } from '../types';\n\nexport const queryStringToMatch = (queryString?: string): RegExp | undefined => {\n const trimmed = queryString?.trim();\n return trimmed ? new RegExp(trimmed, 'i') : undefined;\n};\n\n// TODO(burdon): Type name registry linked to schema?\nconst getIcon = (schema: Schema.Schema.AnyNoContext | undefined): string | undefined => {\n if (!(schema && SchemaAST.isTypeLiteral(schema.ast))) {\n return undefined;\n }\n const keys = schema.ast.propertySignatures.map((p) => p.name);\n if (keys.indexOf('email') !== -1) {\n return 'user';\n }\n if (keys.indexOf('website') !== -1) {\n return 'organization';\n }\n if (keys.indexOf('repo') !== -1) {\n return 'project';\n }\n\n return undefined;\n};\n\n// Plain text fields.\n// TODO(burdon): Reconcile with agent index.\nexport type TextFields = Record<string, string>;\n\n// TODO(thure): This returns `SearchResult[]` which is not just a narrower set of objects as the name implies.\nexport const filterObjectsSync = <T extends Record<string, any>>(objects: T[], match?: RegExp): SearchResult[] => {\n if (!match) {\n return [];\n }\n\n return objects.reduce<SearchResult[]>((results, object) => {\n // TODO(burdon): Hack to ignore Text objects.\n if (object instanceof DataType.Text) {\n return results;\n }\n\n const fields = mapObjectToTextFields(object);\n Object.entries(fields).some(([, value]) => {\n const result = value.match(match);\n if (result) {\n // TODO(burdon): Use schema.\n const label = getStringProperty(object, ['label', 'name', 'title']);\n\n results.push({\n id: object.id,\n type: getIcon(getSchema(object)),\n label,\n match,\n // TODO(burdon): Truncate.\n // TODO(burdon): Issue with sketch documents.\n snippet: value !== label ? value : fields.content ?? fields.description ?? undefined,\n object,\n });\n\n return true;\n }\n\n return false;\n });\n\n return results;\n }, []);\n};\n\n// TODO(burdon): Use schema?\nexport const getStringProperty = (object: Record<string, unknown>, keys: string[]): string | undefined => {\n let label;\n keys.some((key) => {\n const value = object[key];\n if (typeof value === 'string') {\n label = value;\n return true;\n }\n\n return false;\n });\n\n return label;\n};\n\n// TODO(burdon): Filter system fields.\nconst getKeys = (object: Record<string, unknown>): string[] => {\n try {\n const obj = JSON.parse(JSON.stringify(object));\n return Object.keys(obj).filter(\n (key) => key !== 'id' && key !== 'identityKey' && key[0] !== '_' && key[0] !== '@',\n ) as string[];\n } catch (err) {\n // TODO(burdon): Error with TLDraw sketch.\n // Uncaught Error: Type with the name content has already been defined with a different constructor\n return [];\n }\n};\n\n// TODO(burdon): Use ECHO schema.\nexport const mapObjectToTextFields = <T extends Record<string, unknown>>(object: T): TextFields => {\n return getKeys(object).reduce<TextFields>((fields, key) => {\n const value = object[key] as any;\n if (typeof value === 'string' || value instanceof DataType.Text) {\n try {\n fields[key] = String(value);\n } catch (err) {\n // TODO(burdon): Exception when parsing sketch document.\n }\n }\n\n return fields;\n }, {});\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { createContext, type PropsWithChildren, useContext, useMemo, useState } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { filterObjectsSync, queryStringToMatch } from './sync';\nimport { type SearchResult } from '../types';\n\ntype SearchContextType = {\n match?: RegExp;\n setMatch?: (text?: string) => void;\n};\n\nconst SearchContext = createContext<SearchContextType>({});\n\nexport const SearchContextProvider = ({ children }: PropsWithChildren) => {\n const [match, setMatch] = useState<RegExp>();\n const handleMatch = (text?: string) => setMatch(queryStringToMatch(text));\n return <SearchContext.Provider value={{ match, setMatch: handleMatch }}>{children}</SearchContext.Provider>;\n};\n\nexport const useGlobalSearch = () => {\n return useContext(SearchContext) ?? raise(new Error('Missing SearchContext.'));\n};\n\nexport const useGlobalSearchResults = <T extends Record<string, any>>(objects?: T[]): SearchResult[] => {\n const { match } = useGlobalSearch();\n return objects && match ? filterObjectsSync(objects, match) : [];\n};\n\nexport const useGlobalFilteredObjects = <T extends Record<string, any>>(objects?: T[]): T[] => {\n const { match } = useGlobalSearch();\n if (!match || !objects) {\n return objects ?? [];\n }\n\n return useMemo(() => filterObjectsSync(objects, match).map((result) => result.object), [objects, match]);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { yieldOrContinue } from 'main-thread-scheduling';\nimport { useEffect, useState } from 'react';\n\nimport { DataType } from '@dxos/schema';\n\n// TODO(thure): Deprecate search-sync, move still-relevant utilities elsewhere (here, probably).\nimport { mapObjectToTextFields, queryStringToMatch } from './sync';\n\nexport const filterObjects = async <T extends Record<string, any>>(\n objects: T[],\n match?: RegExp,\n): Promise<Map<T, string[][]>> => {\n const result = new Map<T, string[][]>();\n if (!match) {\n return result;\n }\n await Promise.all(\n objects\n .filter((object) => !(object instanceof DataType.Text))\n .map(async (object) => {\n await yieldOrContinue('interactive');\n const fields = mapObjectToTextFields<T>(object);\n Object.entries(fields)\n .filter(([_, value]) => value.match(match))\n .forEach(([key, value]) => {\n if (!result.has(object)) {\n result.set(object, []);\n }\n result.set(object, [...result.get(object)!, [key, value]]);\n });\n }),\n );\n return result;\n};\n\nexport const useSearchResults = <T extends Record<string, any>>(\n queryString?: string,\n objects?: T[],\n delay: number = 400,\n): [boolean, Map<T, string[][]>] => {\n const [results, setResults] = useState<Map<T, string[][]>>(new Map());\n const [pending, setPending] = useState(false);\n\n useEffect(() => {\n setPending(!!(objects && queryString));\n const timeoutId = setTimeout(async () => {\n const nextResults =\n objects && queryString ? await filterObjects(objects, queryStringToMatch(queryString)) : new Map();\n setResults(nextResults);\n setPending(false);\n }, delay);\n\n return () => clearTimeout(timeoutId);\n }, [queryString, objects]);\n\n return [pending, results];\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["SchemaAST", "getSchema", "DataType", "queryStringToMatch", "queryString", "trimmed", "trim", "RegExp", "undefined", "getIcon", "schema", "SchemaAST", "isTypeLiteral", "ast", "keys", "propertySignatures", "map", "p", "name", "indexOf", "filterObjectsSync", "objects", "match", "reduce", "results", "object", "DataType", "Text", "fields", "mapObjectToTextFields", "Object", "entries", "some", "value", "result", "label", "getStringProperty", "push", "id", "type", "getSchema", "snippet", "content", "description", "key", "getKeys", "obj", "JSON", "parse", "stringify", "filter", "err", "String", "React", "createContext", "useContext", "useMemo", "useState", "raise", "SearchContext", "createContext", "SearchContextProvider", "children", "match", "setMatch", "useState", "handleMatch", "text", "queryStringToMatch", "Provider", "value", "useGlobalSearch", "useContext", "raise", "Error", "useGlobalSearchResults", "objects", "filterObjectsSync", "useGlobalFilteredObjects", "useMemo", "map", "result", "object", "yieldOrContinue", "useEffect", "useState", "DataType", "filterObjects", "objects", "match", "result", "Map", "Promise", "all", "filter", "object", "DataType", "Text", "map", "yieldOrContinue", "fields", "mapObjectToTextFields", "Object", "entries", "_", "value", "forEach", "key", "has", "set", "get", "useSearchResults", "queryString", "delay", "results", "setResults", "useState", "pending", "setPending", "useEffect", "timeoutId", "setTimeout", "nextResults", "queryStringToMatch", "clearTimeout"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SearchAction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4KPMT56H.mjs";
|
|
4
4
|
import {
|
|
5
5
|
SearchContextProvider,
|
|
6
6
|
filterObjects,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
useGlobalSearch,
|
|
13
13
|
useGlobalSearchResults,
|
|
14
14
|
useSearchResults
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SNU4XR5T.mjs";
|
|
16
16
|
import {
|
|
17
17
|
SEARCH_PLUGIN,
|
|
18
18
|
SEARCH_RESULT,
|
|
@@ -24,9 +24,9 @@ import { contributes, Events, defineModule, definePlugin, Capabilities } from "@
|
|
|
24
24
|
|
|
25
25
|
// packages/plugins/plugin-search/src/capabilities/index.ts
|
|
26
26
|
import { lazy } from "@dxos/app-framework";
|
|
27
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
28
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
29
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
27
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-N6QQA637.mjs"));
|
|
28
|
+
var IntentResolver = lazy(() => import("./intent-resolver-QKBYLREY.mjs"));
|
|
29
|
+
var ReactSurface = lazy(() => import("./react-surface-MG2K2YZ3.mjs"));
|
|
30
30
|
|
|
31
31
|
// packages/plugins/plugin-search/src/translations.ts
|
|
32
32
|
var translations_default = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SearchAction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4KPMT56H.mjs";
|
|
4
4
|
import "./chunk-J6YWSQTW.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-search/src/capabilities/intent-resolver.ts
|
|
@@ -19,4 +19,4 @@ var intent_resolver_default = () => contributes(Capabilities.IntentResolver, cre
|
|
|
19
19
|
export {
|
|
20
20
|
intent_resolver_default as default
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=intent-resolver-
|
|
22
|
+
//# sourceMappingURL=intent-resolver-QKBYLREY.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-search/src/hooks/sync.ts":{"bytes":11936,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-search/src/hooks/useGlobalSearch.tsx":{"bytes":5009,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/hooks/sync.ts","kind":"import-statement","original":"./sync"}],"format":"esm"},"packages/plugins/plugin-search/src/hooks/useSearchResults.ts":{"bytes":6756,"imports":[{"path":"main-thread-scheduling","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/hooks/sync.ts","kind":"import-statement","original":"./sync"}],"format":"esm"},"packages/plugins/plugin-search/src/hooks/index.ts":{"bytes":719,"imports":[{"path":"packages/plugins/plugin-search/src/hooks/sync.ts","kind":"import-statement","original":"./sync"},{"path":"packages/plugins/plugin-search/src/hooks/useGlobalSearch.tsx","kind":"import-statement","original":"./useGlobalSearch"},{"path":"packages/plugins/plugin-search/src/hooks/useSearchResults.ts","kind":"import-statement","original":"./useSearchResults"}],"format":"esm"},"packages/plugins/plugin-search/src/meta.ts":{"bytes":1846,"imports":[],"format":"esm"},"packages/plugins/plugin-search/src/types/action.tsx":{"bytes":1765,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-search/src/types/search.ts":{"bytes":961,"imports":[],"format":"esm"},"packages/plugins/plugin-search/src/types/index.ts":{"bytes":588,"imports":[{"path":"packages/plugins/plugin-search/src/types/action.tsx","kind":"import-statement","original":"./action"},{"path":"packages/plugins/plugin-search/src/types/search.ts","kind":"import-statement","original":"./search"}],"format":"esm"},"packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts":{"bytes":8747,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-search/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-search/src/capabilities/intent-resolver.ts":{"bytes":2269,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-search/src/components/Searchbar/Searchbar.tsx":{"bytes":6420,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-search/src/components/Searchbar/index.ts":{"bytes":524,"imports":[{"path":"packages/plugins/plugin-search/src/components/Searchbar/Searchbar.tsx","kind":"import-statement","original":"./Searchbar"}],"format":"esm"},"packages/plugins/plugin-search/src/components/SearchResults/SearchResults.tsx":{"bytes":9780,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-card","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/plugin-search/src/components/SearchResults/index.ts":{"bytes":540,"imports":[{"path":"packages/plugins/plugin-search/src/components/SearchResults/SearchResults.tsx","kind":"import-statement","original":"./SearchResults"}],"format":"esm"},"packages/plugins/plugin-search/src/search/exa.ts":{"bytes":24991,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"exa-js","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-search/src/search/index.ts":{"bytes":496,"imports":[{"path":"packages/plugins/plugin-search/src/search/exa.ts","kind":"import-statement","original":"./exa"}],"format":"esm"},"packages/plugins/plugin-search/src/hooks/useWebSearch.ts":{"bytes":7595,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/assistant/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/schema/testing","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/hooks/sync.ts","kind":"import-statement","original":"./sync"},{"path":"packages/plugins/plugin-search/src/search/index.ts","kind":"import-statement","original":"../search"}],"format":"esm"},"packages/plugins/plugin-search/src/components/SearchMain.tsx":{"bytes":8430,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/components/SearchResults/index.ts","kind":"import-statement","original":"./SearchResults"},{"path":"packages/plugins/plugin-search/src/components/Searchbar/index.ts","kind":"import-statement","original":"./Searchbar"},{"path":"packages/plugins/plugin-search/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-search/src/hooks/useWebSearch.ts","kind":"import-statement","original":"../hooks/useWebSearch"},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-search/src/components/SearchDialog.tsx":{"bytes":16596,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-search/src/components/index.ts":{"bytes":712,"imports":[{"path":"packages/plugins/plugin-search/src/components/Searchbar/index.ts","kind":"import-statement","original":"./Searchbar"},{"path":"packages/plugins/plugin-search/src/components/SearchMain.tsx","kind":"import-statement","original":"./SearchMain"},{"path":"packages/plugins/plugin-search/src/components/SearchDialog.tsx","kind":"import-statement","original":"./SearchDialog"}],"format":"esm"},"packages/plugins/plugin-search/src/capabilities/react-surface.tsx":{"bytes":6559,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-search/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/plugins/plugin-search/src/capabilities/index.ts":{"bytes":1349,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts","kind":"dynamic-import","original":"./app-graph-builder"},{"path":"packages/plugins/plugin-search/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-search/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-search/src/translations.ts":{"bytes":2017,"imports":[{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-search/src/SearchPlugin.tsx":{"bytes":6695,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-search/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-search/src/index.ts":{"bytes":760,"imports":[{"path":"packages/plugins/plugin-search/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-search/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-search/src/SearchPlugin.tsx","kind":"import-statement","original":"./SearchPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-search/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4477},"packages/plugins/plugin-search/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-LXHJVTYG.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-QNZWTMYF.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/dist/lib/browser/app-graph-builder-RHZORTY2.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-search/dist/lib/browser/intent-resolver-G76A35DX.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-search/dist/lib/browser/react-surface-O56YMWJT.mjs","kind":"dynamic-import"}],"exports":["SEARCH_PLUGIN","SEARCH_RESULT","SearchAction","SearchContextProvider","SearchPlugin","filterObjects","filterObjectsSync","getStringProperty","mapObjectToTextFields","meta","queryStringToMatch","useGlobalFilteredObjects","useGlobalSearch","useGlobalSearchResults","useSearchResults"],"entryPoint":"packages/plugins/plugin-search/src/index.ts","inputs":{"packages/plugins/plugin-search/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/SearchPlugin.tsx":{"bytesInOutput":1335},"packages/plugins/plugin-search/src/capabilities/index.ts":{"bytesInOutput":268},"packages/plugins/plugin-search/src/translations.ts":{"bytesInOutput":470}},"bytes":3044},"packages/plugins/plugin-search/dist/lib/browser/app-graph-builder-RHZORTY2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4104},"packages/plugins/plugin-search/dist/lib/browser/app-graph-builder-RHZORTY2.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-LXHJVTYG.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts","inputs":{"packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts":{"bytesInOutput":2033}},"bytes":2324},"packages/plugins/plugin-search/dist/lib/browser/intent-resolver-G76A35DX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1139},"packages/plugins/plugin-search/dist/lib/browser/intent-resolver-G76A35DX.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-LXHJVTYG.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-search/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-search/src/capabilities/intent-resolver.ts":{"bytesInOutput":410}},"bytes":670},"packages/plugins/plugin-search/dist/lib/browser/chunk-LXHJVTYG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":827},"packages/plugins/plugin-search/dist/lib/browser/chunk-LXHJVTYG.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["SearchAction"],"inputs":{"packages/plugins/plugin-search/src/types/action.tsx":{"bytesInOutput":343},"packages/plugins/plugin-search/src/types/index.ts":{"bytesInOutput":0}},"bytes":527},"packages/plugins/plugin-search/dist/lib/browser/react-surface-O56YMWJT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":41119},"packages/plugins/plugin-search/dist/lib/browser/react-surface-O56YMWJT.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-QNZWTMYF.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-card","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/assistant/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/schema/testing","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"exa-js","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-search/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-search/src/capabilities/react-surface.tsx":{"bytesInOutput":1545},"packages/plugins/plugin-search/src/components/Searchbar/Searchbar.tsx":{"bytesInOutput":1477},"packages/plugins/plugin-search/src/components/Searchbar/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/components/SearchMain.tsx":{"bytesInOutput":1990},"packages/plugins/plugin-search/src/components/SearchResults/SearchResults.tsx":{"bytesInOutput":2410},"packages/plugins/plugin-search/src/components/SearchResults/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/hooks/useWebSearch.ts":{"bytesInOutput":1968},"packages/plugins/plugin-search/src/search/exa.ts":{"bytesInOutput":6307},"packages/plugins/plugin-search/src/search/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/components/SearchDialog.tsx":{"bytesInOutput":4344}},"bytes":21031},"packages/plugins/plugin-search/dist/lib/browser/chunk-QNZWTMYF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12334},"packages/plugins/plugin-search/dist/lib/browser/chunk-QNZWTMYF.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"main-thread-scheduling","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["SearchContextProvider","filterObjects","filterObjectsSync","getStringProperty","mapObjectToTextFields","queryStringToMatch","useGlobalFilteredObjects","useGlobalSearch","useGlobalSearchResults","useSearchResults"],"inputs":{"packages/plugins/plugin-search/src/hooks/sync.ts":{"bytesInOutput":2310},"packages/plugins/plugin-search/src/hooks/useGlobalSearch.tsx":{"bytesInOutput":1010},"packages/plugins/plugin-search/src/hooks/useSearchResults.ts":{"bytesInOutput":1457},"packages/plugins/plugin-search/src/hooks/index.ts":{"bytesInOutput":0}},"bytes":5239},"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":867},"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs":{"imports":[],"exports":["SEARCH_PLUGIN","SEARCH_RESULT","meta"],"inputs":{"packages/plugins/plugin-search/src/meta.ts":{"bytesInOutput":368}},"bytes":512}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-search/src/hooks/sync.ts":{"bytes":12131,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-search/src/hooks/useGlobalSearch.tsx":{"bytes":5009,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/hooks/sync.ts","kind":"import-statement","original":"./sync"}],"format":"esm"},"packages/plugins/plugin-search/src/hooks/useSearchResults.ts":{"bytes":6793,"imports":[{"path":"main-thread-scheduling","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/hooks/sync.ts","kind":"import-statement","original":"./sync"}],"format":"esm"},"packages/plugins/plugin-search/src/hooks/index.ts":{"bytes":719,"imports":[{"path":"packages/plugins/plugin-search/src/hooks/sync.ts","kind":"import-statement","original":"./sync"},{"path":"packages/plugins/plugin-search/src/hooks/useGlobalSearch.tsx","kind":"import-statement","original":"./useGlobalSearch"},{"path":"packages/plugins/plugin-search/src/hooks/useSearchResults.ts","kind":"import-statement","original":"./useSearchResults"}],"format":"esm"},"packages/plugins/plugin-search/src/meta.ts":{"bytes":1846,"imports":[],"format":"esm"},"packages/plugins/plugin-search/src/types/action.tsx":{"bytes":1790,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-search/src/types/search.ts":{"bytes":961,"imports":[],"format":"esm"},"packages/plugins/plugin-search/src/types/index.ts":{"bytes":588,"imports":[{"path":"packages/plugins/plugin-search/src/types/action.tsx","kind":"import-statement","original":"./action"},{"path":"packages/plugins/plugin-search/src/types/search.ts","kind":"import-statement","original":"./search"}],"format":"esm"},"packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts":{"bytes":11097,"imports":[{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-search/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-search/src/capabilities/intent-resolver.ts":{"bytes":2269,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-search/src/components/Searchbar/Searchbar.tsx":{"bytes":6420,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-search/src/components/Searchbar/index.ts":{"bytes":524,"imports":[{"path":"packages/plugins/plugin-search/src/components/Searchbar/Searchbar.tsx","kind":"import-statement","original":"./Searchbar"}],"format":"esm"},"packages/plugins/plugin-search/src/components/SearchResults/SearchResults.tsx":{"bytes":9780,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-card","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/plugin-search/src/components/SearchResults/index.ts":{"bytes":540,"imports":[{"path":"packages/plugins/plugin-search/src/components/SearchResults/SearchResults.tsx","kind":"import-statement","original":"./SearchResults"}],"format":"esm"},"packages/plugins/plugin-search/src/search/exa.ts":{"bytes":25165,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"exa-js","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-search/src/search/index.ts":{"bytes":496,"imports":[{"path":"packages/plugins/plugin-search/src/search/exa.ts","kind":"import-statement","original":"./exa"}],"format":"esm"},"packages/plugins/plugin-search/src/hooks/useWebSearch.ts":{"bytes":7595,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/assistant/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/schema/testing","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/hooks/sync.ts","kind":"import-statement","original":"./sync"},{"path":"packages/plugins/plugin-search/src/search/index.ts","kind":"import-statement","original":"../search"}],"format":"esm"},"packages/plugins/plugin-search/src/components/SearchMain.tsx":{"bytes":8453,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/components/SearchResults/index.ts","kind":"import-statement","original":"./SearchResults"},{"path":"packages/plugins/plugin-search/src/components/Searchbar/index.ts","kind":"import-statement","original":"./Searchbar"},{"path":"packages/plugins/plugin-search/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-search/src/hooks/useWebSearch.ts","kind":"import-statement","original":"../hooks/useWebSearch"},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-search/src/components/SearchDialog.tsx":{"bytes":16997,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-search/src/components/index.ts":{"bytes":712,"imports":[{"path":"packages/plugins/plugin-search/src/components/Searchbar/index.ts","kind":"import-statement","original":"./Searchbar"},{"path":"packages/plugins/plugin-search/src/components/SearchMain.tsx","kind":"import-statement","original":"./SearchMain"},{"path":"packages/plugins/plugin-search/src/components/SearchDialog.tsx","kind":"import-statement","original":"./SearchDialog"}],"format":"esm"},"packages/plugins/plugin-search/src/capabilities/react-surface.tsx":{"bytes":5892,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-search/src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"packages/plugins/plugin-search/src/capabilities/index.ts":{"bytes":1349,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts","kind":"dynamic-import","original":"./app-graph-builder"},{"path":"packages/plugins/plugin-search/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-search/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-search/src/translations.ts":{"bytes":2017,"imports":[{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-search/src/SearchPlugin.tsx":{"bytes":6695,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-search/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-search/src/index.ts":{"bytes":760,"imports":[{"path":"packages/plugins/plugin-search/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/plugins/plugin-search/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-search/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-search/src/SearchPlugin.tsx","kind":"import-statement","original":"./SearchPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-search/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4477},"packages/plugins/plugin-search/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-4KPMT56H.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-SNU4XR5T.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-search/dist/lib/browser/app-graph-builder-N6QQA637.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-search/dist/lib/browser/intent-resolver-QKBYLREY.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-search/dist/lib/browser/react-surface-MG2K2YZ3.mjs","kind":"dynamic-import"}],"exports":["SEARCH_PLUGIN","SEARCH_RESULT","SearchAction","SearchContextProvider","SearchPlugin","filterObjects","filterObjectsSync","getStringProperty","mapObjectToTextFields","meta","queryStringToMatch","useGlobalFilteredObjects","useGlobalSearch","useGlobalSearchResults","useSearchResults"],"entryPoint":"packages/plugins/plugin-search/src/index.ts","inputs":{"packages/plugins/plugin-search/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/SearchPlugin.tsx":{"bytesInOutput":1335},"packages/plugins/plugin-search/src/capabilities/index.ts":{"bytesInOutput":268},"packages/plugins/plugin-search/src/translations.ts":{"bytesInOutput":470}},"bytes":3044},"packages/plugins/plugin-search/dist/lib/browser/app-graph-builder-N6QQA637.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5392},"packages/plugins/plugin-search/dist/lib/browser/app-graph-builder-N6QQA637.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-4KPMT56H.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts","inputs":{"packages/plugins/plugin-search/src/capabilities/app-graph-builder.ts":{"bytesInOutput":2435}},"bytes":2726},"packages/plugins/plugin-search/dist/lib/browser/intent-resolver-QKBYLREY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1139},"packages/plugins/plugin-search/dist/lib/browser/intent-resolver-QKBYLREY.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-4KPMT56H.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-search/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-search/src/capabilities/intent-resolver.ts":{"bytesInOutput":410}},"bytes":670},"packages/plugins/plugin-search/dist/lib/browser/chunk-4KPMT56H.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":847},"packages/plugins/plugin-search/dist/lib/browser/chunk-4KPMT56H.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true}],"exports":["SearchAction"],"inputs":{"packages/plugins/plugin-search/src/types/action.tsx":{"bytesInOutput":352},"packages/plugins/plugin-search/src/types/index.ts":{"bytesInOutput":0}},"bytes":536},"packages/plugins/plugin-search/dist/lib/browser/react-surface-MG2K2YZ3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":41055},"packages/plugins/plugin-search/dist/lib/browser/react-surface-MG2K2YZ3.mjs":{"imports":[{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-SNU4XR5T.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-card","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/assistant/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/schema/testing","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"exa-js","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-search/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-search/src/capabilities/react-surface.tsx":{"bytesInOutput":1349},"packages/plugins/plugin-search/src/components/Searchbar/Searchbar.tsx":{"bytesInOutput":1477},"packages/plugins/plugin-search/src/components/Searchbar/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/components/SearchMain.tsx":{"bytesInOutput":1997},"packages/plugins/plugin-search/src/components/SearchResults/SearchResults.tsx":{"bytesInOutput":2410},"packages/plugins/plugin-search/src/components/SearchResults/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/hooks/useWebSearch.ts":{"bytesInOutput":1968},"packages/plugins/plugin-search/src/search/exa.ts":{"bytesInOutput":6357},"packages/plugins/plugin-search/src/search/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-search/src/components/SearchDialog.tsx":{"bytesInOutput":4458}},"bytes":21006},"packages/plugins/plugin-search/dist/lib/browser/chunk-SNU4XR5T.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12461},"packages/plugins/plugin-search/dist/lib/browser/chunk-SNU4XR5T.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"main-thread-scheduling","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["SearchContextProvider","filterObjects","filterObjectsSync","getStringProperty","mapObjectToTextFields","queryStringToMatch","useGlobalFilteredObjects","useGlobalSearch","useGlobalSearchResults","useSearchResults"],"inputs":{"packages/plugins/plugin-search/src/hooks/sync.ts":{"bytesInOutput":2357},"packages/plugins/plugin-search/src/hooks/useGlobalSearch.tsx":{"bytesInOutput":1010},"packages/plugins/plugin-search/src/hooks/useSearchResults.ts":{"bytesInOutput":1462},"packages/plugins/plugin-search/src/hooks/index.ts":{"bytesInOutput":0}},"bytes":5291},"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":867},"packages/plugins/plugin-search/dist/lib/browser/chunk-J6YWSQTW.mjs":{"imports":[],"exports":["SEARCH_PLUGIN","SEARCH_RESULT","meta"],"inputs":{"packages/plugins/plugin-search/src/meta.ts":{"bytesInOutput":368}},"bytes":512}}}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
useGlobalSearch,
|
|
5
5
|
useGlobalSearchResults,
|
|
6
6
|
useSearchResults
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SNU4XR5T.mjs";
|
|
8
8
|
import {
|
|
9
9
|
SEARCH_PLUGIN,
|
|
10
10
|
SEARCH_RESULT
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
|
|
13
13
|
// packages/plugins/plugin-search/src/capabilities/react-surface.tsx
|
|
14
14
|
import React5 from "react";
|
|
15
|
-
import { Capabilities, contributes, createSurface
|
|
16
|
-
import {
|
|
15
|
+
import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
16
|
+
import { useActiveSpace } from "@dxos/plugin-space";
|
|
17
17
|
import { isSpace } from "@dxos/react-client/echo";
|
|
18
18
|
|
|
19
19
|
// packages/plugins/plugin-search/src/components/Searchbar/Searchbar.tsx
|
|
@@ -143,12 +143,12 @@ import { getIconAnnotation } from "@dxos/schema";
|
|
|
143
143
|
import { Testing } from "@dxos/schema/testing";
|
|
144
144
|
|
|
145
145
|
// packages/plugins/plugin-search/src/search/exa.ts
|
|
146
|
-
import { Option, SchemaAST
|
|
146
|
+
import { Option, Schema, SchemaAST } from "effect";
|
|
147
147
|
import Exa from "exa-js";
|
|
148
148
|
import { defineTool, Message } from "@dxos/artifact";
|
|
149
149
|
import { MixedStreamParser } from "@dxos/assistant";
|
|
150
150
|
import { isEncodedReference } from "@dxos/echo-protocol";
|
|
151
|
-
import { create, getTypeAnnotation, ObjectId, ReferenceAnnotationId
|
|
151
|
+
import { create, getTypeAnnotation, ObjectId, ReferenceAnnotationId } from "@dxos/echo-schema";
|
|
152
152
|
import { mapAst } from "@dxos/effect";
|
|
153
153
|
import { assertArgument, failedInvariant } from "@dxos/invariant";
|
|
154
154
|
import { log } from "@dxos/log";
|
|
@@ -211,11 +211,11 @@ ${r.text}`
|
|
|
211
211
|
}))
|
|
212
212
|
})
|
|
213
213
|
],
|
|
214
|
-
schema:
|
|
214
|
+
schema: Schema.Struct({
|
|
215
215
|
...Object.fromEntries(mappedSchema.map((schema, index) => [
|
|
216
216
|
`objects_${index}`,
|
|
217
|
-
|
|
218
|
-
description: `The objects to answer the query of type ${getTypeAnnotation(schema)?.typename ??
|
|
217
|
+
Schema.Array(schema).annotations({
|
|
218
|
+
description: `The objects to answer the query of type ${getTypeAnnotation(schema)?.typename ?? SchemaAST.getIdentifierAnnotation(schema.ast).pipe(Option.getOrNull)}`
|
|
219
219
|
})
|
|
220
220
|
]))
|
|
221
221
|
})
|
|
@@ -296,8 +296,8 @@ ${context}`
|
|
|
296
296
|
]
|
|
297
297
|
})
|
|
298
298
|
],
|
|
299
|
-
schema:
|
|
300
|
-
terms:
|
|
299
|
+
schema: Schema.Struct({
|
|
300
|
+
terms: Schema.Array(Schema.String).annotations({
|
|
301
301
|
description: "The search terms to use to find the objects. 0-10 terms."
|
|
302
302
|
})
|
|
303
303
|
})
|
|
@@ -329,19 +329,19 @@ var sanitizeObjects = (entries) => {
|
|
|
329
329
|
return create(entry.schema, data);
|
|
330
330
|
});
|
|
331
331
|
};
|
|
332
|
-
var SoftRef =
|
|
333
|
-
"/":
|
|
332
|
+
var SoftRef = Schema.Struct({
|
|
333
|
+
"/": Schema.String
|
|
334
334
|
}).annotations({
|
|
335
335
|
description: "Reference to another object."
|
|
336
336
|
});
|
|
337
337
|
var mapSchemaRefs = (schema) => {
|
|
338
338
|
const go = (ast) => {
|
|
339
|
-
if (
|
|
339
|
+
if (SchemaAST.getAnnotation(ast, ReferenceAnnotationId).pipe(Option.isSome)) {
|
|
340
340
|
return SoftRef.ast;
|
|
341
341
|
}
|
|
342
342
|
return mapAst(ast, go);
|
|
343
343
|
};
|
|
344
|
-
return
|
|
344
|
+
return Schema.make(mapAst(schema.ast, go));
|
|
345
345
|
};
|
|
346
346
|
|
|
347
347
|
// packages/plugins/plugin-search/src/hooks/useWebSearch.ts
|
|
@@ -416,7 +416,7 @@ var SearchMain = ({ classNames, space }) => {
|
|
|
416
416
|
const { setMatch } = useGlobalSearch();
|
|
417
417
|
const [query, setQuery] = useState3();
|
|
418
418
|
const allSpaces = false;
|
|
419
|
-
const objects = useQuery(allSpaces ? client.spaces : space, Filter.
|
|
419
|
+
const objects = useQuery(allSpaces ? client.spaces : space, Filter.everything());
|
|
420
420
|
const results = useGlobalSearchResults(objects);
|
|
421
421
|
const { runSearch, results: webResults, isLoading } = useWebSearch({
|
|
422
422
|
query
|
|
@@ -459,6 +459,7 @@ var SearchMain = ({ classNames, space }) => {
|
|
|
459
459
|
};
|
|
460
460
|
|
|
461
461
|
// packages/plugins/plugin-search/src/components/SearchDialog.tsx
|
|
462
|
+
import { Option as Option2 } from "effect";
|
|
462
463
|
import React4, { forwardRef as forwardRef2, useCallback, useState as useState4 } from "react";
|
|
463
464
|
import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher, useLayout } from "@dxos/app-framework";
|
|
464
465
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
@@ -489,10 +490,10 @@ var SearchDialog = ({ pivotId }) => {
|
|
|
489
490
|
const layout = useLayout();
|
|
490
491
|
const closed = (Array.isArray(layout.inactive) ? layout.inactive : [
|
|
491
492
|
layout.inactive
|
|
492
|
-
]).map((id) => graph?.
|
|
493
|
+
]).map((id) => graph?.getNode(id)).filter(Boolean);
|
|
493
494
|
const [queryString, setQueryString] = useState4("");
|
|
494
495
|
const client = useClient2();
|
|
495
|
-
const dangerouslyLoadAllObjects = useQuery2(client.spaces, Filter2.
|
|
496
|
+
const dangerouslyLoadAllObjects = useQuery2(client.spaces, Filter2.everything());
|
|
496
497
|
const [pending, results] = useSearchResults(queryString, dangerouslyLoadAllObjects);
|
|
497
498
|
const resultObjects = Array.from(results.keys());
|
|
498
499
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
@@ -542,17 +543,17 @@ var SearchDialog = ({ pivotId }) => {
|
|
|
542
543
|
classNames: "px-1 my-2"
|
|
543
544
|
}), /* @__PURE__ */ React4.createElement(SearchList.Content, {
|
|
544
545
|
classNames: "max-bs-[24rem] overflow-auto"
|
|
545
|
-
}, queryString.length > 0 ? resultObjects.length > 0 ? resultObjects.map((object) => graph
|
|
546
|
-
key: node.id,
|
|
547
|
-
node,
|
|
546
|
+
}, queryString.length > 0 ? resultObjects.length > 0 ? resultObjects.map((object) => graph.getNode(fullyQualifiedId(object))).filter(Option2.isSome).map((node) => /* @__PURE__ */ React4.createElement(SearchListResult, {
|
|
547
|
+
key: node.value.id,
|
|
548
|
+
node: node.value,
|
|
548
549
|
onSelect: handleSelect
|
|
549
550
|
})) : /* @__PURE__ */ React4.createElement("p", {
|
|
550
551
|
className: "pli-1"
|
|
551
552
|
}, t(pending ? "pending results message" : "empty results message")) : /* @__PURE__ */ React4.createElement(React4.Fragment, null, closed.length > 0 && /* @__PURE__ */ React4.createElement("h2", {
|
|
552
553
|
className: mx4("mlb-1", descriptionText)
|
|
553
|
-
}, t("recently closed heading")), closed.map((node) => /* @__PURE__ */ React4.createElement(SearchListResult, {
|
|
554
|
-
key: node.id,
|
|
555
|
-
node,
|
|
554
|
+
}, t("recently closed heading")), closed.filter(Option2.isSome).map((node) => /* @__PURE__ */ React4.createElement(SearchListResult, {
|
|
555
|
+
key: node.value.id,
|
|
556
|
+
node: node.value,
|
|
556
557
|
onSelect: handleSelect
|
|
557
558
|
}))))), /* @__PURE__ */ React4.createElement(Dialog.Close, {
|
|
558
559
|
asChild: true
|
|
@@ -573,13 +574,10 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
|
573
574
|
component: ({ data }) => /* @__PURE__ */ React5.createElement(SearchContextProvider, null, /* @__PURE__ */ React5.createElement(SearchDialog, data.props))
|
|
574
575
|
}),
|
|
575
576
|
createSurface({
|
|
576
|
-
|
|
577
|
-
id: "search-input",
|
|
577
|
+
id: `${SEARCH_DIALOG}/search-input`,
|
|
578
578
|
role: "search-input",
|
|
579
579
|
component: () => {
|
|
580
|
-
const
|
|
581
|
-
const { graph } = useAppGraph2();
|
|
582
|
-
const space = graph ? getActiveSpace(graph, layout.active[0]) : void 0;
|
|
580
|
+
const space = useActiveSpace();
|
|
583
581
|
if (!space) {
|
|
584
582
|
return null;
|
|
585
583
|
}
|
|
@@ -606,4 +604,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
|
606
604
|
export {
|
|
607
605
|
react_surface_default as default
|
|
608
606
|
};
|
|
609
|
-
//# sourceMappingURL=react-surface-
|
|
607
|
+
//# sourceMappingURL=react-surface-MG2K2YZ3.mjs.map
|