@dxos/plugin-search 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446
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-RHZORTY2.mjs +76 -0
- package/dist/lib/browser/app-graph-builder-RHZORTY2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4KPMT56H.mjs → chunk-LXHJVTYG.mjs} +5 -5
- package/dist/lib/browser/chunk-LXHJVTYG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SNU4XR5T.mjs → chunk-NFZSXZMP.mjs} +9 -9
- package/dist/lib/browser/chunk-NFZSXZMP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/{intent-resolver-QKBYLREY.mjs → intent-resolver-G76A35DX.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-MG2K2YZ3.mjs → react-surface-QBBLEI2Q.mjs} +34 -32
- package/dist/lib/browser/react-surface-QBBLEI2Q.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +179 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +177 -1
- 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 +28 -33
- package/src/capabilities/app-graph-builder.ts +41 -59
- package/src/capabilities/react-surface.tsx +7 -4
- package/src/components/SearchDialog.tsx +7 -8
- package/src/components/SearchMain.tsx +1 -1
- package/src/components/Searchbar/Searchbar.tsx +2 -2
- package/src/hooks/sync.test.ts +2 -2
- package/src/hooks/sync.ts +7 -8
- package/src/hooks/useSearchResults.ts +2 -2
- package/src/hooks/useWebSearch.ts +1 -1
- package/src/search/exa.test.ts +5 -5
- package/src/search/exa.ts +23 -23
- package/src/types/action.tsx +4 -4
- package/dist/lib/browser/app-graph-builder-N6QQA637.mjs +0 -77
- package/dist/lib/browser/app-graph-builder-N6QQA637.mjs.map +0 -7
- package/dist/lib/browser/chunk-4KPMT56H.mjs.map +0 -7
- package/dist/lib/browser/chunk-SNU4XR5T.mjs.map +0 -7
- package/dist/lib/browser/react-surface-MG2K2YZ3.mjs.map +0 -7
- /package/dist/lib/browser/{intent-resolver-QKBYLREY.mjs.map → intent-resolver-G76A35DX.mjs.map} +0 -0
|
@@ -1,4 +1,180 @@
|
|
|
1
|
-
export declare const AppGraphBuilder: (props?: import("@dxos/app-framework").
|
|
1
|
+
export declare const AppGraphBuilder: (props?: import("@dxos/app-framework").PluginsContext | undefined) => Promise<() => Promise<import("@dxos/app-framework").Capability<Readonly<{
|
|
2
|
+
id: string;
|
|
3
|
+
position: import("@dxos/util").Position;
|
|
4
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
5
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
6
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
7
|
+
type?: string;
|
|
8
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
9
|
+
}> | Readonly<{
|
|
10
|
+
id: string;
|
|
11
|
+
position: import("@dxos/util").Position;
|
|
12
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
13
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
14
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
15
|
+
type?: string;
|
|
16
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
17
|
+
}>[] | (Readonly<{
|
|
18
|
+
id: string;
|
|
19
|
+
position: import("@dxos/util").Position;
|
|
20
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
21
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
22
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
23
|
+
type?: string;
|
|
24
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
25
|
+
}> | Readonly<{
|
|
26
|
+
id: string;
|
|
27
|
+
position: import("@dxos/util").Position;
|
|
28
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
29
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
30
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
31
|
+
type?: string;
|
|
32
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
33
|
+
}>[] | (Readonly<{
|
|
34
|
+
id: string;
|
|
35
|
+
position: import("@dxos/util").Position;
|
|
36
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
37
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
38
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
39
|
+
type?: string;
|
|
40
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
41
|
+
}> | Readonly<{
|
|
42
|
+
id: string;
|
|
43
|
+
position: import("@dxos/util").Position;
|
|
44
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
45
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
46
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
47
|
+
type?: string;
|
|
48
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
49
|
+
}>[] | (Readonly<{
|
|
50
|
+
id: string;
|
|
51
|
+
position: import("@dxos/util").Position;
|
|
52
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
53
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
54
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
55
|
+
type?: string;
|
|
56
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
57
|
+
}> | Readonly<{
|
|
58
|
+
id: string;
|
|
59
|
+
position: import("@dxos/util").Position;
|
|
60
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
61
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
62
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
63
|
+
type?: string;
|
|
64
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
65
|
+
}>[] | (Readonly<{
|
|
66
|
+
id: string;
|
|
67
|
+
position: import("@dxos/util").Position;
|
|
68
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
69
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
70
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
71
|
+
type?: string;
|
|
72
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
73
|
+
}> | Readonly<{
|
|
74
|
+
id: string;
|
|
75
|
+
position: import("@dxos/util").Position;
|
|
76
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
77
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
78
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
79
|
+
type?: string;
|
|
80
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
81
|
+
}>[] | (Readonly<{
|
|
82
|
+
id: string;
|
|
83
|
+
position: import("@dxos/util").Position;
|
|
84
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
85
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
86
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
87
|
+
type?: string;
|
|
88
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
89
|
+
}> | Readonly<{
|
|
90
|
+
id: string;
|
|
91
|
+
position: import("@dxos/util").Position;
|
|
92
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
93
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
94
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
95
|
+
type?: string;
|
|
96
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
97
|
+
}>[] | (Readonly<{
|
|
98
|
+
id: string;
|
|
99
|
+
position: import("@dxos/util").Position;
|
|
100
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
101
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
102
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
103
|
+
type?: string;
|
|
104
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
105
|
+
}> | Readonly<{
|
|
106
|
+
id: string;
|
|
107
|
+
position: import("@dxos/util").Position;
|
|
108
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
109
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
110
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
111
|
+
type?: string;
|
|
112
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
113
|
+
}>[] | (Readonly<{
|
|
114
|
+
id: string;
|
|
115
|
+
position: import("@dxos/util").Position;
|
|
116
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
117
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
118
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
119
|
+
type?: string;
|
|
120
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
121
|
+
}> | Readonly<{
|
|
122
|
+
id: string;
|
|
123
|
+
position: import("@dxos/util").Position;
|
|
124
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
125
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
126
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
127
|
+
type?: string;
|
|
128
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
129
|
+
}>[] | (Readonly<{
|
|
130
|
+
id: string;
|
|
131
|
+
position: import("@dxos/util").Position;
|
|
132
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
133
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
134
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
135
|
+
type?: string;
|
|
136
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
137
|
+
}> | Readonly<{
|
|
138
|
+
id: string;
|
|
139
|
+
position: import("@dxos/util").Position;
|
|
140
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
141
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
142
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
143
|
+
type?: string;
|
|
144
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
145
|
+
}>[] | (Readonly<{
|
|
146
|
+
id: string;
|
|
147
|
+
position: import("@dxos/util").Position;
|
|
148
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
149
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
150
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
151
|
+
type?: string;
|
|
152
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
153
|
+
}> | Readonly<{
|
|
154
|
+
id: string;
|
|
155
|
+
position: import("@dxos/util").Position;
|
|
156
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
157
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
158
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
159
|
+
type?: string;
|
|
160
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
161
|
+
}>[] | (any[] | Readonly<{
|
|
162
|
+
id: string;
|
|
163
|
+
position: import("@dxos/util").Position;
|
|
164
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
165
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
166
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
167
|
+
type?: string;
|
|
168
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
169
|
+
}> | Readonly<{
|
|
170
|
+
id: string;
|
|
171
|
+
position: import("@dxos/util").Position;
|
|
172
|
+
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
173
|
+
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
174
|
+
relation?: import("@dxos/app-graph").Relation;
|
|
175
|
+
type?: string;
|
|
176
|
+
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
177
|
+
}>[])[])[])[])[])[])[])[])[])[])[]> | import("@dxos/app-framework").AnyCapability[]>>;
|
|
2
178
|
export declare const IntentResolver: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.IntentResolver> | import("@dxos/app-framework").AnyCapability[]>>;
|
|
3
179
|
export declare const ReactSurface: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.ReactSurface> | import("@dxos/app-framework").AnyCapability[]>>;
|
|
4
180
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;qBAGklG,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;qFAH70V,CAAC;AACzE,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAsD,MAAM,qBAAqB,CAAC;;AAOvG,wBAgDK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/SearchDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/SearchDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAajE,eAAO,MAAM,aAAa,wCAAkC,CAAC;AAuB7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY,gBAAiB,iBAAiB,sBA8E1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAc,MAAM,OAAO,CAAC;AAMnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyBxD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAE1G,eAAO,MAAM,UAAU;cAFkC,OAAO;+EA+B9D,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAGF,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAc,MAAM,OAAO,CAAC;AAMnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyBxD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAE1G,eAAO,MAAM,UAAU;cAFkC,OAAO;+EA+B9D,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAGF,eAAO,MAAM,aAAa,kCAAmC,kBAAkB,sBAgB9E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG5D,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,aAAa,CAAC,GAAG;IAC7E,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,SAAS,iEAAkE,cAAc,sBA+CrG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/hooks/sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/hooks/sync.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,kBAAkB,iBAAkB,MAAM,KAAG,MAAM,GAAG,SAGlE,CAAC;AAuBF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAGhD,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,EAAE,UAAU,MAAM,KAAG,YAAY,EAqC3G,CAAC;AAGF,eAAO,MAAM,iBAAiB,WAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,MAAM,EAAE,KAAG,MAAM,GAAG,SAa5F,CAAC;AAiBF,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,KAAG,UAapF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGlobalSearch.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGlobalSearch.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAiB,KAAK,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAKpG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"useGlobalSearch.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGlobalSearch.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAiB,KAAK,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAKpG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,qBAAqB,iBAAkB,iBAAiB,sBAIpE,CAAC;AAEF,eAAO,MAAM,eAAe,yBAE3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,KAAG,YAAY,EAGjG,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,KAAG,CAAC,EAOxF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchResults.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSearchResults.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"useSearchResults.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSearchResults.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,WACtD,CAAC,EAAE,UACJ,MAAM,KACb,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAsB5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,gBAC9C,MAAM,YACV,CAAC,EAAE,UACN,MAAM,KACZ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAiB9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebSearch.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useWebSearch.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAK7C,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"useWebSearch.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useWebSearch.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAK7C,eAAO,MAAM,YAAY,uBAAwB;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;;;;CAsCpF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
1
|
import { type AIServiceClient } from '@dxos/assistant';
|
|
3
|
-
|
|
2
|
+
import { S } from '@dxos/echo-schema';
|
|
3
|
+
export type SearchOptions<Schema extends S.Schema.AnyNoContext> = {
|
|
4
4
|
query?: string;
|
|
5
5
|
context?: string;
|
|
6
6
|
schema: Schema[];
|
|
@@ -15,5 +15,5 @@ export type SearchResult<T = unknown> = {
|
|
|
15
15
|
dataExtractionTime: number;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
export declare const search: <Schema extends
|
|
18
|
+
export declare const search: <Schema extends S.Schema.AnyNoContext>(options: SearchOptions<Schema>) => Promise<SearchResult<S.Schema.Type<Schema>>>;
|
|
19
19
|
//# sourceMappingURL=exa.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exa.d.ts","sourceRoot":"","sources":["../../../../src/search/exa.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exa.d.ts","sourceRoot":"","sources":["../../../../src/search/exa.ts"],"names":[],"mappings":"AAQA,OAAO,EAAqB,KAAK,eAAe,EAAwB,MAAM,iBAAiB,CAAC;AAEhG,OAAO,EAAoE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAMxG,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,CAAC,CAAC,MAAM,CAAC,YAAY,IAAI;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI;IACtC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,MAAM,GAAU,MAAM,SAAS,CAAC,CAAC,MAAM,CAAC,YAAY,WACtD,aAAa,CAAC,MAAM,CAAC,KAC7B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CA0F7C,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S } from '@dxos/echo-schema';
|
|
2
2
|
export declare namespace SearchAction {
|
|
3
|
-
const OpenSearch_base:
|
|
4
|
-
readonly _tag:
|
|
3
|
+
const OpenSearch_base: S.TaggedClass<OpenSearch, "dxos.org/plugin/search/action/open-search", {
|
|
4
|
+
readonly _tag: S.tag<"dxos.org/plugin/search/action/open-search">;
|
|
5
5
|
} & {
|
|
6
|
-
input: typeof
|
|
7
|
-
output: typeof
|
|
6
|
+
input: typeof S.Void;
|
|
7
|
+
output: typeof S.Void;
|
|
8
8
|
}>;
|
|
9
9
|
export class OpenSearch extends OpenSearch_base {
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/types/action.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/types/action.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAItC,yBAAiB,YAAY,CAAC;;;;;;;IAG5B,MAAM,OAAO,UAAW,SAAQ,eAG9B;KAAG;;CACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-search",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.7ac8446",
|
|
4
4
|
"description": "Braneframe sketch plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -23,53 +23,48 @@
|
|
|
23
23
|
"src"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
+
"effect": "3.13.3",
|
|
26
27
|
"exa-js": "^1.5.12",
|
|
27
28
|
"main-thread-scheduling": "^14.1.1",
|
|
28
|
-
"@dxos/app-framework": "0.8.2-
|
|
29
|
-
"@dxos/assistant": "0.8.2-
|
|
30
|
-
"@dxos/artifact": "0.8.2-
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/live-object": "0.8.2-
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/plugin-
|
|
40
|
-
"@dxos/plugin-deck": "0.8.2-
|
|
41
|
-
"@dxos/plugin-
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/react-ui-card": "0.8.2-
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
29
|
+
"@dxos/app-framework": "0.8.2-staging.7ac8446",
|
|
30
|
+
"@dxos/assistant": "0.8.2-staging.7ac8446",
|
|
31
|
+
"@dxos/artifact": "0.8.2-staging.7ac8446",
|
|
32
|
+
"@dxos/echo-schema": "0.8.2-staging.7ac8446",
|
|
33
|
+
"@dxos/effect": "0.8.2-staging.7ac8446",
|
|
34
|
+
"@dxos/debug": "0.8.2-staging.7ac8446",
|
|
35
|
+
"@dxos/echo-protocol": "0.8.2-staging.7ac8446",
|
|
36
|
+
"@dxos/invariant": "0.8.2-staging.7ac8446",
|
|
37
|
+
"@dxos/log": "0.8.2-staging.7ac8446",
|
|
38
|
+
"@dxos/live-object": "0.8.2-staging.7ac8446",
|
|
39
|
+
"@dxos/plugin-client": "0.8.2-staging.7ac8446",
|
|
40
|
+
"@dxos/plugin-graph": "0.8.2-staging.7ac8446",
|
|
41
|
+
"@dxos/plugin-deck": "0.8.2-staging.7ac8446",
|
|
42
|
+
"@dxos/plugin-space": "0.8.2-staging.7ac8446",
|
|
43
|
+
"@dxos/react-client": "0.8.2-staging.7ac8446",
|
|
44
|
+
"@dxos/react-ui-card": "0.8.2-staging.7ac8446",
|
|
45
|
+
"@dxos/plugin-markdown": "0.8.2-staging.7ac8446",
|
|
46
|
+
"@dxos/react-ui-searchlist": "0.8.2-staging.7ac8446",
|
|
47
|
+
"@dxos/schema": "0.8.2-staging.7ac8446",
|
|
48
|
+
"@dxos/util": "0.8.2-staging.7ac8446"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
|
-
"@effect-rx/rx-react": "^0.34.1",
|
|
51
|
-
"@effect/platform": "0.80.12",
|
|
52
51
|
"@phosphor-icons/react": "^2.1.5",
|
|
53
52
|
"@types/react": "~18.2.0",
|
|
54
53
|
"@types/react-dom": "~18.2.0",
|
|
55
|
-
"effect": "3.14.21",
|
|
56
54
|
"react": "~18.2.0",
|
|
57
55
|
"react-dom": "~18.2.0",
|
|
58
56
|
"vite": "5.4.7",
|
|
59
|
-
"@dxos/random": "0.8.2-
|
|
60
|
-
"@dxos/react-ui": "0.8.2-
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
57
|
+
"@dxos/random": "0.8.2-staging.7ac8446",
|
|
58
|
+
"@dxos/react-ui-theme": "0.8.2-staging.7ac8446",
|
|
59
|
+
"@dxos/storybook-utils": "0.8.2-staging.7ac8446",
|
|
60
|
+
"@dxos/react-ui": "0.8.2-staging.7ac8446"
|
|
63
61
|
},
|
|
64
62
|
"peerDependencies": {
|
|
65
|
-
"@effect-rx/rx-react": "^0.34.1",
|
|
66
|
-
"@effect/platform": "0.80.12",
|
|
67
63
|
"@phosphor-icons/react": "^2.1.5",
|
|
68
|
-
"effect": "^3.13.3",
|
|
69
64
|
"react": "~18.2.0",
|
|
70
65
|
"react-dom": "~18.2.0",
|
|
71
|
-
"@dxos/react-ui": "0.8.2-
|
|
72
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
66
|
+
"@dxos/react-ui": "0.8.2-staging.7ac8446",
|
|
67
|
+
"@dxos/react-ui-theme": "0.8.2-staging.7ac8446"
|
|
73
68
|
},
|
|
74
69
|
"publishConfig": {
|
|
75
70
|
"access": "public"
|
|
@@ -2,78 +2,60 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { Option, pipe } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { Capabilities, contributes, createIntent, type PluginContext } from '@dxos/app-framework';
|
|
5
|
+
import { Capabilities, contributes, createIntent, type PluginsContext } from '@dxos/app-framework';
|
|
9
6
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
10
7
|
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
11
|
-
import { createExtension,
|
|
8
|
+
import { createExtension, type Node } from '@dxos/plugin-graph';
|
|
12
9
|
import { parseId } from '@dxos/react-client/echo';
|
|
13
10
|
|
|
14
11
|
import { SEARCH_PLUGIN } from '../meta';
|
|
15
12
|
import { SearchAction } from '../types';
|
|
16
13
|
|
|
17
|
-
export default (context:
|
|
14
|
+
export default (context: PluginsContext) =>
|
|
18
15
|
contributes(Capabilities.AppGraphBuilder, [
|
|
19
16
|
createExtension({
|
|
20
17
|
id: `${SEARCH_PLUGIN}/space-search`,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const workspace = get(rxFromSignal(() => context.getCapability(Capabilities.Layout).workspace));
|
|
28
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
29
|
-
const { spaceId } = parseId(workspace);
|
|
30
|
-
const space = spaceId ? client.spaces.get(spaceId) : null;
|
|
18
|
+
filter: (node): node is Node<null> => node.id === 'root',
|
|
19
|
+
connector: ({ node }) => {
|
|
20
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
21
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
22
|
+
const { spaceId } = parseId(layout.workspace);
|
|
23
|
+
const space = spaceId ? client.spaces.get(spaceId) : null;
|
|
31
24
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Option.getOrElse(() => []),
|
|
46
|
-
),
|
|
47
|
-
),
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
id: [node.id, 'search'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
28
|
+
type: DECK_COMPANION_TYPE,
|
|
29
|
+
data: space,
|
|
30
|
+
properties: {
|
|
31
|
+
label: ['search label', { ns: SEARCH_PLUGIN }],
|
|
32
|
+
icon: 'ph--magnifying-glass--regular',
|
|
33
|
+
disposition: 'hidden',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
},
|
|
48
38
|
}),
|
|
49
39
|
createExtension({
|
|
50
40
|
id: SEARCH_PLUGIN,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
}),
|
|
75
|
-
Option.getOrElse(() => []),
|
|
76
|
-
),
|
|
77
|
-
),
|
|
41
|
+
filter: (node): node is Node<null> => node.id === 'root',
|
|
42
|
+
actions: () => [
|
|
43
|
+
{
|
|
44
|
+
id: SearchAction.OpenSearch._tag,
|
|
45
|
+
data: async () => {
|
|
46
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
47
|
+
await dispatch(createIntent(SearchAction.OpenSearch));
|
|
48
|
+
},
|
|
49
|
+
properties: {
|
|
50
|
+
label: ['search action label', { ns: SEARCH_PLUGIN }],
|
|
51
|
+
icon: 'ph--magnifying-glass--regular',
|
|
52
|
+
keyBinding: {
|
|
53
|
+
macos: 'shift+meta+f',
|
|
54
|
+
windows: 'shift+alt+f',
|
|
55
|
+
},
|
|
56
|
+
testId: 'searchPlugin.search',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
78
60
|
}),
|
|
79
61
|
]);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
7
|
+
import { Capabilities, contributes, createSurface, useLayout, useAppGraph } from '@dxos/app-framework';
|
|
8
|
+
import { getActiveSpace } from '@dxos/plugin-space';
|
|
9
9
|
import { isSpace, type Space } from '@dxos/react-client/echo';
|
|
10
10
|
|
|
11
11
|
import { SEARCH_DIALOG, SearchDialog, type SearchDialogProps, SearchMain } from '../components';
|
|
@@ -24,10 +24,13 @@ export default () =>
|
|
|
24
24
|
),
|
|
25
25
|
}),
|
|
26
26
|
createSurface({
|
|
27
|
-
id: `${SEARCH_DIALOG}/search-input`,
|
|
27
|
+
// id: `${SEARCH_DIALOG}/search-input`,
|
|
28
|
+
id: 'search-input',
|
|
28
29
|
role: 'search-input',
|
|
29
30
|
component: () => {
|
|
30
|
-
const
|
|
31
|
+
const layout = useLayout();
|
|
32
|
+
const { graph } = useAppGraph();
|
|
33
|
+
const space = graph ? getActiveSpace(graph, layout.active[0]) : undefined;
|
|
31
34
|
if (!space) {
|
|
32
35
|
return null;
|
|
33
36
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Option } from 'effect';
|
|
6
5
|
import React, { forwardRef, useCallback, useState } from 'react';
|
|
7
6
|
|
|
8
7
|
import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher, useLayout } from '@dxos/app-framework';
|
|
@@ -48,11 +47,11 @@ export const SearchDialog = ({ pivotId }: SearchDialogProps) => {
|
|
|
48
47
|
const { graph } = useAppGraph();
|
|
49
48
|
const layout = useLayout();
|
|
50
49
|
const closed = (Array.isArray(layout.inactive) ? layout.inactive : [layout.inactive])
|
|
51
|
-
.map((id) => graph?.
|
|
50
|
+
.map((id) => graph?.findNode(id))
|
|
52
51
|
.filter(Boolean);
|
|
53
52
|
const [queryString, setQueryString] = useState('');
|
|
54
53
|
const client = useClient();
|
|
55
|
-
const dangerouslyLoadAllObjects = useQuery(client.spaces, Filter.
|
|
54
|
+
const dangerouslyLoadAllObjects = useQuery(client.spaces, Filter.all());
|
|
56
55
|
const [pending, results] = useSearchResults(queryString, dangerouslyLoadAllObjects);
|
|
57
56
|
const resultObjects = Array.from(results.keys());
|
|
58
57
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
@@ -97,17 +96,17 @@ export const SearchDialog = ({ pivotId }: SearchDialogProps) => {
|
|
|
97
96
|
{queryString.length > 0 ? (
|
|
98
97
|
resultObjects.length > 0 ? (
|
|
99
98
|
resultObjects
|
|
100
|
-
.map((object) => graph
|
|
101
|
-
.filter(
|
|
102
|
-
.map((node) => <SearchListResult key={node
|
|
99
|
+
.map((object) => graph?.findNode(fullyQualifiedId(object)))
|
|
100
|
+
.filter(Boolean)
|
|
101
|
+
.map((node) => <SearchListResult key={node!.id} node={node!} onSelect={handleSelect} />)
|
|
103
102
|
) : (
|
|
104
103
|
<p className='pli-1'>{t(pending ? 'pending results message' : 'empty results message')}</p>
|
|
105
104
|
)
|
|
106
105
|
) : (
|
|
107
106
|
<>
|
|
108
107
|
{closed.length > 0 && <h2 className={mx('mlb-1', descriptionText)}>{t('recently closed heading')}</h2>}
|
|
109
|
-
{closed.
|
|
110
|
-
<SearchListResult key={node
|
|
108
|
+
{closed.map((node) => (
|
|
109
|
+
<SearchListResult key={node!.id} node={node!} onSelect={handleSelect} />
|
|
111
110
|
))}
|
|
112
111
|
</>
|
|
113
112
|
)}
|
|
@@ -25,7 +25,7 @@ export const SearchMain: FC<ThemedClassName<{ space: Space }>> = ({ classNames,
|
|
|
25
25
|
const allSpaces = false;
|
|
26
26
|
|
|
27
27
|
// TODO(burdon): Returns ALL objects (e.g., incl. Text objects that are fields of parent objects).
|
|
28
|
-
const objects = useQuery(allSpaces ? client.spaces : space, Filter.
|
|
28
|
+
const objects = useQuery(allSpaces ? client.spaces : space, Filter.all());
|
|
29
29
|
const results = useGlobalSearchResults(objects);
|
|
30
30
|
|
|
31
31
|
const {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { MagnifyingGlass } from '@phosphor-icons/react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Input, type TextInputProps } from '@dxos/react-ui';
|
|
9
9
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
@@ -35,7 +35,7 @@ export const Searchbar = ({ classes, variant, placeholder, value, onChange, onSu
|
|
|
35
35
|
inputRef.current?.focus();
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
|
|
38
|
+
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
39
39
|
switch (event.key) {
|
|
40
40
|
case 'Enter':
|
|
41
41
|
onSubmit?.(text);
|
package/src/hooks/sync.test.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { describe, expect, test } from 'vitest';
|
|
|
6
6
|
|
|
7
7
|
import { Client } from '@dxos/client';
|
|
8
8
|
import { Expando } from '@dxos/echo-schema';
|
|
9
|
-
import {
|
|
9
|
+
import { create } from '@dxos/live-object';
|
|
10
10
|
import { faker } from '@dxos/random';
|
|
11
11
|
|
|
12
12
|
import { filterObjectsSync } from './sync';
|
|
@@ -26,7 +26,7 @@ describe('Search', () => {
|
|
|
26
26
|
Array.from({ length: 20 }).map((_, i) => {
|
|
27
27
|
const content =
|
|
28
28
|
i === 10 ? faker.lorem.sentence() + ` ${match}}. ` + faker.lorem.sentence() : faker.lorem.sentences();
|
|
29
|
-
return space.db.add(
|
|
29
|
+
return space.db.add(create(Expando, { title: faker.lorem.sentence(), content }));
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const { objects } = await space.db.query().run();
|