@dxos/plugin-search 0.8.4-main.e8ec1fe → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/README.md +0 -1
- package/dist/lib/neutral/SearchArticle-CQMZ46ZS.mjs +51 -0
- package/dist/lib/neutral/SearchArticle-CQMZ46ZS.mjs.map +7 -0
- package/dist/lib/neutral/SearchDialog-IFMA5UP5.mjs +76 -0
- package/dist/lib/neutral/SearchDialog-IFMA5UP5.mjs.map +7 -0
- package/dist/lib/neutral/SearchPlugin.mjs +10 -0
- package/dist/lib/neutral/SearchPlugin.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-B3W3UWHV.mjs +71 -0
- package/dist/lib/neutral/app-graph-builder-B3W3UWHV.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +13 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7ASS5WTT.mjs +8 -0
- package/dist/lib/neutral/chunk-7ASS5WTT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7VNJDD75.mjs +22 -0
- package/dist/lib/neutral/chunk-7VNJDD75.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FIZRI3JV.mjs +27 -0
- package/dist/lib/neutral/chunk-FIZRI3JV.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NAKPT2JM.mjs +8 -0
- package/dist/lib/neutral/chunk-NAKPT2JM.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ZEP4O5SU.mjs → neutral/chunk-NBE5GQ5J.mjs} +66 -75
- package/dist/lib/neutral/chunk-NBE5GQ5J.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QWFRJRPV.mjs +38 -0
- package/dist/lib/neutral/chunk-QWFRJRPV.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +97 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +11 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +30 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +40 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/open-search-ABE2Y6ZG.mjs +23 -0
- package/dist/lib/neutral/open-search-ABE2Y6ZG.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-DY624P2R.mjs +13 -0
- package/dist/lib/neutral/operation-handler-DY624P2R.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-ER7Q4W6Y.mjs +61 -0
- package/dist/lib/neutral/react-surface-ER7Q4W6Y.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +25 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +8 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/SearchPlugin.d.ts +3 -1
- package/dist/types/src/SearchPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/SearchResultStack/SearchResultStack.d.ts +9 -0
- package/dist/types/src/components/SearchResultStack/SearchResultStack.d.ts.map +1 -0
- package/dist/types/src/components/SearchResultStack/index.d.ts +2 -0
- package/dist/types/src/components/SearchResultStack/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/containers/SearchArticle/SearchArticle.d.ts +4 -0
- package/dist/types/src/containers/SearchArticle/SearchArticle.d.ts.map +1 -0
- package/dist/types/src/{components/Searchbar/Searchbar.stories.d.ts → containers/SearchArticle/SearchArticle.stories.d.ts} +3 -2
- package/dist/types/src/containers/SearchArticle/SearchArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/SearchArticle/index.d.ts +2 -0
- package/dist/types/src/containers/SearchArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/SearchDialog/SearchDialog.d.ts +7 -0
- package/dist/types/src/containers/SearchDialog/SearchDialog.d.ts.map +1 -0
- package/dist/types/src/{components/SearchResults/SearchResults.stories.d.ts → containers/SearchDialog/SearchDialog.stories.d.ts} +4 -4
- package/dist/types/src/containers/SearchDialog/SearchDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/SearchDialog/index.d.ts +2 -0
- package/dist/types/src/containers/SearchDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/sync.d.ts +4 -3
- package/dist/types/src/hooks/sync.d.ts.map +1 -1
- package/dist/types/src/hooks/useGlobalSearch.d.ts +8 -4
- package/dist/types/src/hooks/useGlobalSearch.d.ts.map +1 -1
- package/dist/types/src/hooks/useSearchResults.d.ts +3 -2
- package/dist/types/src/hooks/useSearchResults.d.ts.map +1 -1
- package/dist/types/src/hooks/useWebSearch.d.ts +7 -4
- package/dist/types/src/hooks/useWebSearch.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open-search.d.ts +5 -0
- package/dist/types/src/operations/open-search.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/search/exa.d.ts +5 -4
- package/dist/types/src/search/exa.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +15 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/SearchOperation.d.ts +3 -0
- package/dist/types/src/types/SearchOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/search.d.ts +1 -20
- package/dist/types/src/types/search.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +119 -48
- package/src/SearchPlugin.tsx +14 -47
- package/src/capabilities/app-graph-builder.ts +55 -69
- package/src/capabilities/index.ts +8 -4
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +65 -49
- package/src/components/SearchResultStack/SearchResultStack.tsx +118 -0
- package/src/components/SearchResultStack/index.ts +5 -0
- package/src/components/index.ts +1 -3
- package/src/constants.ts +7 -0
- package/src/containers/SearchArticle/SearchArticle.stories.tsx +79 -0
- package/src/containers/SearchArticle/SearchArticle.tsx +60 -0
- package/src/containers/SearchArticle/index.ts +5 -0
- package/src/containers/SearchDialog/SearchDialog.stories.tsx +108 -0
- package/src/containers/SearchDialog/SearchDialog.tsx +93 -0
- package/src/containers/SearchDialog/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/hooks/sync.test.ts +9 -7
- package/src/hooks/sync.ts +31 -33
- package/src/hooks/useGlobalSearch.tsx +32 -13
- package/src/hooks/useSearchResults.ts +6 -3
- package/src/hooks/useWebSearch.ts +25 -14
- package/src/index.ts +2 -2
- package/src/meta.ts +22 -6
- package/src/operations/index.ts +7 -0
- package/src/operations/open-search.ts +24 -0
- package/src/plugin.ts +11 -0
- package/src/search/exa.test.ts +7 -7
- package/src/search/exa.ts +9 -8
- package/src/testing.ts +7 -0
- package/src/translations.ts +10 -9
- package/src/types/SearchOperation.ts +19 -0
- package/src/types/command-score.d.ts +16 -0
- package/src/types/index.ts +2 -1
- package/src/types/search.ts +1 -25
- package/dist/lib/browser/app-graph-builder-HQR6P4C7.mjs +0 -78
- package/dist/lib/browser/app-graph-builder-HQR6P4C7.mjs.map +0 -7
- package/dist/lib/browser/chunk-GN2FSWTM.mjs +0 -22
- package/dist/lib/browser/chunk-GN2FSWTM.mjs.map +0 -7
- package/dist/lib/browser/chunk-TCVYYI44.mjs +0 -21
- package/dist/lib/browser/chunk-TCVYYI44.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZEP4O5SU.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -112
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-UYQA6UUQ.mjs +0 -22
- package/dist/lib/browser/intent-resolver-UYQA6UUQ.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-H5CKQVII.mjs +0 -307
- package/dist/lib/browser/react-surface-H5CKQVII.mjs.map +0 -7
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/Search.stories.d.ts +0 -16
- package/dist/types/src/components/Search.stories.d.ts.map +0 -1
- package/dist/types/src/components/SearchDialog.d.ts +0 -7
- package/dist/types/src/components/SearchDialog.d.ts.map +0 -1
- package/dist/types/src/components/SearchMain.d.ts +0 -6
- package/dist/types/src/components/SearchMain.d.ts.map +0 -1
- package/dist/types/src/components/SearchResults/SearchResults.d.ts +0 -20
- package/dist/types/src/components/SearchResults/SearchResults.d.ts.map +0 -1
- package/dist/types/src/components/SearchResults/SearchResults.stories.d.ts.map +0 -1
- package/dist/types/src/components/SearchResults/index.d.ts +0 -2
- package/dist/types/src/components/SearchResults/index.d.ts.map +0 -1
- package/dist/types/src/components/Searchbar/Searchbar.d.ts +0 -10
- package/dist/types/src/components/Searchbar/Searchbar.d.ts.map +0 -1
- package/dist/types/src/components/Searchbar/Searchbar.stories.d.ts.map +0 -1
- package/dist/types/src/components/Searchbar/index.d.ts +0 -2
- package/dist/types/src/components/Searchbar/index.d.ts.map +0 -1
- package/dist/types/src/types/action.d.ts +0 -13
- package/dist/types/src/types/action.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -18
- package/src/components/Search.stories.tsx +0 -64
- package/src/components/SearchDialog.tsx +0 -136
- package/src/components/SearchMain.tsx +0 -62
- package/src/components/SearchResults/SearchResults.stories.tsx +0 -59
- package/src/components/SearchResults/SearchResults.tsx +0 -83
- package/src/components/SearchResults/index.ts +0 -5
- package/src/components/Searchbar/Searchbar.stories.tsx +0 -28
- package/src/components/Searchbar/Searchbar.tsx +0 -48
- package/src/components/Searchbar/index.ts +0 -5
- package/src/types/action.tsx +0 -16
|
@@ -2,14 +2,19 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { type PropsWithChildren, createContext,
|
|
5
|
+
import React, { type PropsWithChildren, createContext, useCallback, useContext, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { raise } from '@dxos/debug';
|
|
8
|
+
import { type Entity } from '@dxos/echo';
|
|
9
|
+
import { GlobalFilterProvider } from '@dxos/react-ui-search';
|
|
8
10
|
|
|
9
|
-
import { type SearchResult } from '
|
|
11
|
+
import { type SearchResult } from '#types';
|
|
10
12
|
|
|
11
13
|
import { filterObjectsSync, queryStringToMatch } from './sync';
|
|
12
14
|
|
|
15
|
+
// Re-export for backward compatibility.
|
|
16
|
+
export { useGlobalFilteredObjects, GlobalFilterProvider } from '@dxos/react-ui-search';
|
|
17
|
+
|
|
13
18
|
type SearchContextType = {
|
|
14
19
|
match?: RegExp;
|
|
15
20
|
setMatch?: (text?: string) => void;
|
|
@@ -17,26 +22,40 @@ type SearchContextType = {
|
|
|
17
22
|
|
|
18
23
|
const SearchContext = createContext<SearchContextType>({});
|
|
19
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Provider for global search context.
|
|
27
|
+
* Also provides the GlobalFilterProvider for useGlobalFilteredObjects to work.
|
|
28
|
+
*/
|
|
20
29
|
export const SearchContextProvider = ({ children }: PropsWithChildren) => {
|
|
21
30
|
const [match, setMatch] = useState<RegExp>();
|
|
22
31
|
const handleMatch = (text?: string) => setMatch(queryStringToMatch(text));
|
|
23
|
-
|
|
32
|
+
|
|
33
|
+
// Provide a filter function for useGlobalFilteredObjects.
|
|
34
|
+
const filterFn = useCallback(
|
|
35
|
+
<T extends Entity.Any>(objects: T[]): T[] => {
|
|
36
|
+
if (!match) {
|
|
37
|
+
return objects;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return filterObjectsSync(objects, match)
|
|
41
|
+
.filter((result) => result.object)
|
|
42
|
+
.map((result) => result.object!);
|
|
43
|
+
},
|
|
44
|
+
[match],
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<SearchContext.Provider value={{ match, setMatch: handleMatch }}>
|
|
49
|
+
<GlobalFilterProvider filter={filterFn}>{children}</GlobalFilterProvider>
|
|
50
|
+
</SearchContext.Provider>
|
|
51
|
+
);
|
|
24
52
|
};
|
|
25
53
|
|
|
26
54
|
export const useGlobalSearch = () => {
|
|
27
55
|
return useContext(SearchContext) ?? raise(new Error('Missing SearchContext.'));
|
|
28
56
|
};
|
|
29
57
|
|
|
30
|
-
export const useGlobalSearchResults = <T extends
|
|
58
|
+
export const useGlobalSearchResults = <T extends Entity.Unknown>(objects?: T[]): SearchResult<T>[] => {
|
|
31
59
|
const { match } = useGlobalSearch();
|
|
32
60
|
return objects && match ? filterObjectsSync(objects, match) : [];
|
|
33
61
|
};
|
|
34
|
-
|
|
35
|
-
export const useGlobalFilteredObjects = <T extends Record<string, any>>(objects?: T[]): T[] => {
|
|
36
|
-
const { match } = useGlobalSearch();
|
|
37
|
-
if (!match || !objects) {
|
|
38
|
-
return objects ?? [];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return useMemo(() => filterObjectsSync(objects, match).map((result) => result.object), [objects, match]);
|
|
42
|
-
};
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import { yieldOrContinue } from 'main-thread-scheduling';
|
|
6
6
|
import { useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
|
+
import { type Entity, Obj } from '@dxos/echo';
|
|
8
9
|
import { Text } from '@dxos/schema';
|
|
9
10
|
|
|
10
11
|
// TODO(thure): Deprecate search-sync, move still-relevant utilities elsewhere (here, probably).
|
|
11
12
|
import { mapObjectToTextFields, queryStringToMatch } from './sync';
|
|
12
13
|
|
|
13
|
-
export const filterObjects = async <T extends
|
|
14
|
+
export const filterObjects = async <T extends Entity.Unknown>(
|
|
14
15
|
objects: T[],
|
|
15
16
|
match?: RegExp,
|
|
16
17
|
): Promise<Map<T, string[][]>> => {
|
|
@@ -18,9 +19,10 @@ export const filterObjects = async <T extends Record<string, any>>(
|
|
|
18
19
|
if (!match) {
|
|
19
20
|
return result;
|
|
20
21
|
}
|
|
22
|
+
|
|
21
23
|
await Promise.all(
|
|
22
24
|
objects
|
|
23
|
-
.filter((object) => !(
|
|
25
|
+
.filter((object) => !Obj.instanceOf(Text.Text, object))
|
|
24
26
|
.map(async (object) => {
|
|
25
27
|
await yieldOrContinue('interactive');
|
|
26
28
|
const fields = mapObjectToTextFields<T>(object);
|
|
@@ -34,10 +36,11 @@ export const filterObjects = async <T extends Record<string, any>>(
|
|
|
34
36
|
});
|
|
35
37
|
}),
|
|
36
38
|
);
|
|
39
|
+
|
|
37
40
|
return result;
|
|
38
41
|
};
|
|
39
42
|
|
|
40
|
-
export const useSearchResults = <T extends
|
|
43
|
+
export const useSearchResults = <T extends Entity.Unknown>(
|
|
41
44
|
queryString?: string,
|
|
42
45
|
objects?: T[],
|
|
43
46
|
delay: number = 400,
|
|
@@ -2,44 +2,55 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { useState } from 'react';
|
|
5
|
+
import { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { EXA_API_KEY } from '@dxos/ai/testing';
|
|
8
|
-
import {
|
|
9
|
-
import { type DXN } from '@dxos/keys';
|
|
8
|
+
import { Entity, Type } from '@dxos/echo';
|
|
10
9
|
import { log } from '@dxos/log';
|
|
11
10
|
import { getIconAnnotation } from '@dxos/schema';
|
|
12
|
-
import {
|
|
11
|
+
import { TestSchema } from '@dxos/schema/testing';
|
|
13
12
|
|
|
14
|
-
import {
|
|
15
|
-
import { type SearchResult } from '../types';
|
|
13
|
+
import { type SearchResult } from '#types';
|
|
16
14
|
|
|
15
|
+
import { search } from '../search';
|
|
17
16
|
import { getStringProperty } from './sync';
|
|
18
17
|
|
|
19
|
-
export
|
|
18
|
+
export type UseWebSearchProps = {
|
|
19
|
+
query?: string;
|
|
20
|
+
context?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type UseWebSearch = {
|
|
24
|
+
update: () => Promise<void>;
|
|
25
|
+
results: SearchResult[];
|
|
26
|
+
isLoading: boolean;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @deprecated */
|
|
30
|
+
// TODO(burdon): Remove testing deps.
|
|
31
|
+
export const useWebSearch = ({ query, context }: UseWebSearchProps): UseWebSearch => {
|
|
20
32
|
const [results, setResults] = useState<SearchResult[]>([]);
|
|
21
33
|
const [isLoading, setIsLoading] = useState(false);
|
|
22
34
|
|
|
23
|
-
const
|
|
35
|
+
const update = useCallback(async () => {
|
|
24
36
|
try {
|
|
25
37
|
setIsLoading(true);
|
|
26
38
|
log.info('Running web search', { query, context });
|
|
27
39
|
const results = await search({
|
|
28
40
|
query,
|
|
29
41
|
context,
|
|
30
|
-
|
|
42
|
+
types: [TestSchema.Person, TestSchema.Project, TestSchema.Organization], // TODO(burdon): ???
|
|
31
43
|
exaApiKey: EXA_API_KEY,
|
|
32
44
|
});
|
|
33
45
|
|
|
34
46
|
const mappedResults = results.data.map((result): SearchResult => {
|
|
35
|
-
const schema =
|
|
47
|
+
const schema = Entity.getType(result);
|
|
36
48
|
return {
|
|
37
49
|
id: result.id,
|
|
38
|
-
objectType: Obj.getTypename(result) as DXN.String | undefined,
|
|
39
50
|
label: getStringProperty(result, ['name', 'title', 'label']),
|
|
40
51
|
snippet: getStringProperty(result, ['description', 'content', 'website', 'email']),
|
|
41
52
|
object: result,
|
|
42
|
-
icon: schema
|
|
53
|
+
icon: schema ? getIconAnnotation(Type.getSchema(schema)) : undefined,
|
|
43
54
|
};
|
|
44
55
|
});
|
|
45
56
|
|
|
@@ -47,7 +58,7 @@ export const useWebSearch = ({ query, context }: { query?: string; context?: str
|
|
|
47
58
|
} finally {
|
|
48
59
|
setIsLoading(false);
|
|
49
60
|
}
|
|
50
|
-
};
|
|
61
|
+
}, [query, context]);
|
|
51
62
|
|
|
52
|
-
return {
|
|
63
|
+
return { update, results, isLoading };
|
|
53
64
|
};
|
package/src/index.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// TODO(wittjosiah): Hooks should not be exported from the plugin package at all.
|
|
6
|
+
// Either refactor callers to not need them or factor them out to a shared package.
|
|
5
7
|
export * from './hooks';
|
|
6
8
|
export * from './meta';
|
|
7
9
|
export * from './types';
|
|
8
|
-
|
|
9
|
-
export * from './SearchPlugin';
|
package/src/meta.ts
CHANGED
|
@@ -2,19 +2,35 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
export const meta:
|
|
9
|
-
id: 'dxos.
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
|
+
id: 'org.dxos.plugin.search',
|
|
10
10
|
name: 'Search',
|
|
11
|
+
author: 'DXOS',
|
|
11
12
|
description: trim`
|
|
12
|
-
Full-text search engine for finding content across all spaces and object types.
|
|
13
|
-
|
|
13
|
+
Full-text search engine for finding content across all spaces and object types in DXOS Composer.
|
|
14
|
+
The plugin provides a global command-palette style dialog (invoked via the OpenSearch operation)
|
|
15
|
+
that debounces user input and matches it against every field of every ECHO object in the active
|
|
16
|
+
space, returning ranked results with field-level match context.
|
|
17
|
+
|
|
18
|
+
A persistent SearchArticle panel can be pinned in the deck companion sidebar so the query stays
|
|
19
|
+
visible while navigating documents. Both surfaces share a SearchContextProvider that drives the
|
|
20
|
+
GlobalFilterProvider, allowing any view that uses useGlobalFilteredObjects to automatically show
|
|
21
|
+
only the objects matching the current query.
|
|
22
|
+
|
|
23
|
+
Web search is available through the Exa integration: when an API key is configured, the plugin
|
|
24
|
+
can fetch and rank external web results alongside local objects. The results are structured with
|
|
25
|
+
URL, title, and snippet fields ready for use in Composer documents.
|
|
26
|
+
|
|
27
|
+
All search operations are registered through the standard DXOS operations system and can be
|
|
28
|
+
wired into keyboard shortcuts, command palettes, and AI assistants via the OperationHandlerSet.
|
|
14
29
|
`,
|
|
15
30
|
icon: 'ph--magnifying-glass--regular',
|
|
16
31
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-search',
|
|
32
|
+
spec: 'PLUGIN.mdl',
|
|
17
33
|
tags: ['labs'],
|
|
18
34
|
};
|
|
19
35
|
|
|
20
|
-
export const SEARCH_RESULT = `${meta.id}
|
|
36
|
+
export const SEARCH_RESULT = `${meta.id}.result`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { SEARCH_DIALOG } from '../constants';
|
|
11
|
+
import { SearchOperation } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof SearchOperation.OpenSearch> = SearchOperation.OpenSearch.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
17
|
+
subject: SEARCH_DIALOG,
|
|
18
|
+
blockAlign: 'start',
|
|
19
|
+
});
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const SearchPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { SearchOperationHandlerSet } from './operations';
|
package/src/search/exa.test.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { describe, test } from 'vitest';
|
|
|
6
6
|
|
|
7
7
|
import { EXA_API_KEY } from '@dxos/ai/testing';
|
|
8
8
|
import { log } from '@dxos/log';
|
|
9
|
-
import {
|
|
9
|
+
import { TestSchema } from '@dxos/schema/testing';
|
|
10
10
|
|
|
11
11
|
import { search } from './exa';
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ describe.skip('Search', () => {
|
|
|
15
15
|
test.skip('contacts', { timeout: 60_000 }, async () => {
|
|
16
16
|
const objects = await search({
|
|
17
17
|
query: 'top executives at google',
|
|
18
|
-
|
|
18
|
+
types: [TestSchema.Person],
|
|
19
19
|
exaApiKey: EXA_API_KEY,
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ describe.skip('Search', () => {
|
|
|
25
25
|
test.skip('contacts projects and orgs', { timeout: 60_000 }, async () => {
|
|
26
26
|
const objects = await search({
|
|
27
27
|
query: 'top executives at google',
|
|
28
|
-
|
|
28
|
+
types: [TestSchema.Person, TestSchema.Project, TestSchema.Organization],
|
|
29
29
|
exaApiKey: EXA_API_KEY,
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -35,7 +35,7 @@ describe.skip('Search', () => {
|
|
|
35
35
|
test('a19z org, projects they invest in and team', { timeout: 60_000 }, async () => {
|
|
36
36
|
const objects = await search({
|
|
37
37
|
query: 'a19z org, projects they invest in and team',
|
|
38
|
-
|
|
38
|
+
types: [TestSchema.Project, TestSchema.Organization, TestSchema.Person],
|
|
39
39
|
exaApiKey: EXA_API_KEY,
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -45,7 +45,7 @@ describe.skip('Search', () => {
|
|
|
45
45
|
test('companies building CRDTs', { timeout: 60_000 }, async () => {
|
|
46
46
|
const objects = await search({
|
|
47
47
|
query: 'companies building CRDTs',
|
|
48
|
-
|
|
48
|
+
types: [TestSchema.Project, TestSchema.Organization, TestSchema.Person],
|
|
49
49
|
exaApiKey: EXA_API_KEY,
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ describe.skip('Search', () => {
|
|
|
57
57
|
test('composer context-based search', { timeout: 60_000 }, async () => {
|
|
58
58
|
const objects = await search({
|
|
59
59
|
context: COMPOSER_DXOS_DOC,
|
|
60
|
-
|
|
60
|
+
types: [TestSchema.Project, TestSchema.Organization, TestSchema.Person],
|
|
61
61
|
exaApiKey: EXA_API_KEY,
|
|
62
62
|
});
|
|
63
63
|
|
|
@@ -67,7 +67,7 @@ describe.skip('Search', () => {
|
|
|
67
67
|
test.only('edge architecture', { timeout: 60_000 }, async () => {
|
|
68
68
|
const objects = await search({
|
|
69
69
|
context: EDGE_ARCHITECTURE_DOC,
|
|
70
|
-
|
|
70
|
+
types: [TestSchema.Project, TestSchema.Organization, TestSchema.Person],
|
|
71
71
|
exaApiKey: EXA_API_KEY,
|
|
72
72
|
});
|
|
73
73
|
|
package/src/search/exa.ts
CHANGED
|
@@ -8,17 +8,17 @@ import * as Option from 'effect/Option';
|
|
|
8
8
|
import * as Schema from 'effect/Schema';
|
|
9
9
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
10
10
|
|
|
11
|
-
import { Key, Obj } from '@dxos/echo';
|
|
12
|
-
import { ReferenceAnnotationId } from '@dxos/echo/internal';
|
|
11
|
+
import { type Entity, Key, Obj, type Type } from '@dxos/echo';
|
|
13
12
|
import { isEncodedReference } from '@dxos/echo-protocol';
|
|
13
|
+
import { ReferenceAnnotationId } from '@dxos/echo/internal';
|
|
14
14
|
import { mapAst } from '@dxos/effect';
|
|
15
15
|
import { deepMapValues, trim } from '@dxos/util';
|
|
16
16
|
|
|
17
|
-
export type SearchOptions<
|
|
17
|
+
export type SearchOptions<T extends Type.AnyEntity> = {
|
|
18
18
|
query?: string;
|
|
19
19
|
// TODO(dmaretskyi): How can we pass this through.
|
|
20
20
|
context?: string;
|
|
21
|
-
|
|
21
|
+
types: T[];
|
|
22
22
|
exaApiKey: string;
|
|
23
23
|
liveCrawl?: boolean;
|
|
24
24
|
};
|
|
@@ -31,9 +31,10 @@ export type SearchResult<T = unknown> = {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
/** @deprecated Use MixedStreamParser */
|
|
35
|
+
export const search = async <T extends Type.AnyEntity>(
|
|
36
|
+
options: SearchOptions<T>,
|
|
37
|
+
): Promise<SearchResult<Entity.Unknown>> => {
|
|
37
38
|
throw new Error('Not implemented');
|
|
38
39
|
// assertArgument(options.query || options.context, "query or context", "query or context is required");
|
|
39
40
|
// let contextSearchTerms: readonly string[] = [];
|
|
@@ -180,7 +181,7 @@ const DATA_EXTRACTION_INSTRUCTIONS = trim`
|
|
|
180
181
|
// return terms;
|
|
181
182
|
// };
|
|
182
183
|
|
|
183
|
-
const sanitizeObjects = (entries: { data: any; schema:
|
|
184
|
+
const sanitizeObjects = (entries: { data: any; schema: Type.AnyObj }[]) => {
|
|
184
185
|
const idMap = new Map<string, string>();
|
|
185
186
|
|
|
186
187
|
return entries
|
package/src/testing.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
|
+
import { translations as searchTranslations } from '@dxos/react-ui-search/translations';
|
|
6
7
|
|
|
7
|
-
import { meta } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
8
9
|
|
|
9
10
|
export const translations = [
|
|
11
|
+
...searchTranslations,
|
|
10
12
|
{
|
|
11
13
|
'en-US': {
|
|
12
14
|
[meta.id]: {
|
|
13
|
-
'plugin
|
|
14
|
-
'search
|
|
15
|
-
'search
|
|
16
|
-
'search
|
|
17
|
-
'recently
|
|
18
|
-
'pending
|
|
19
|
-
'
|
|
20
|
-
'search label': 'Search',
|
|
15
|
+
'plugin.name': 'Search',
|
|
16
|
+
'search-action.label': 'Search spaces',
|
|
17
|
+
'search.placeholder': 'Search…',
|
|
18
|
+
'search-dialog.title': 'Search',
|
|
19
|
+
'recently-closed.heading': 'Recently closed',
|
|
20
|
+
'pending-results.message': 'Searching…',
|
|
21
|
+
'search.label': 'Search',
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
},
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
13
|
+
const SEARCH_OPERATION = `${meta.id}.operation`;
|
|
14
|
+
|
|
15
|
+
export const OpenSearch = Operation.make({
|
|
16
|
+
meta: { key: `${SEARCH_OPERATION}.open-search`, name: 'Open Search', icon: 'ph--magnifying-glass--regular' },
|
|
17
|
+
input: Schema.Void,
|
|
18
|
+
output: Schema.Void,
|
|
19
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
declare module 'command-score' {
|
|
6
|
+
/**
|
|
7
|
+
* Scores how well a string matches a query using a fuzzy matching algorithm.
|
|
8
|
+
* Used by cmdk for its built-in filtering.
|
|
9
|
+
*
|
|
10
|
+
* @param string - The string to score against.
|
|
11
|
+
* @param query - The search query.
|
|
12
|
+
* @returns A score between 0 and 1, where higher values indicate better matches.
|
|
13
|
+
*/
|
|
14
|
+
function commandScore(string: string, query: string): number;
|
|
15
|
+
export default commandScore;
|
|
16
|
+
}
|
package/src/types/index.ts
CHANGED
package/src/types/search.ts
CHANGED
|
@@ -2,28 +2,4 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type SearchResult = {
|
|
8
|
-
id: string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Type kind: "contact", "project", "org", etc.
|
|
12
|
-
*/
|
|
13
|
-
type?: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
match?: RegExp;
|
|
16
|
-
snippet?: string;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Icon id.
|
|
20
|
-
*/
|
|
21
|
-
icon?: string;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* DXN of the object type.
|
|
25
|
-
*/
|
|
26
|
-
objectType?: DXN.String;
|
|
27
|
-
|
|
28
|
-
object?: any;
|
|
29
|
-
};
|
|
5
|
+
export type { SearchResult } from '@dxos/react-ui-search';
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SearchAction
|
|
3
|
-
} from "./chunk-TCVYYI44.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-GN2FSWTM.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/app-graph-builder.ts
|
|
9
|
-
import { Atom } from "@effect-atom/atom-react";
|
|
10
|
-
import * as Function from "effect/Function";
|
|
11
|
-
import * as Option from "effect/Option";
|
|
12
|
-
import { Capabilities, contributes, createIntent } from "@dxos/app-framework";
|
|
13
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
14
|
-
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
15
|
-
import { ROOT_ID, atomFromSignal, createExtension } from "@dxos/plugin-graph";
|
|
16
|
-
import { parseId } from "@dxos/react-client/echo";
|
|
17
|
-
var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, [
|
|
18
|
-
createExtension({
|
|
19
|
-
id: `${meta.id}/space-search`,
|
|
20
|
-
connector: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map((node2) => {
|
|
21
|
-
const workspace = get(atomFromSignal(() => context.getCapability(Capabilities.Layout).workspace));
|
|
22
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
23
|
-
const { spaceId } = parseId(workspace);
|
|
24
|
-
const space = spaceId ? client.spaces.get(spaceId) : null;
|
|
25
|
-
return [
|
|
26
|
-
{
|
|
27
|
-
id: [
|
|
28
|
-
node2.id,
|
|
29
|
-
"search"
|
|
30
|
-
].join(ATTENDABLE_PATH_SEPARATOR),
|
|
31
|
-
type: DECK_COMPANION_TYPE,
|
|
32
|
-
data: space,
|
|
33
|
-
properties: {
|
|
34
|
-
label: [
|
|
35
|
-
"search label",
|
|
36
|
-
{
|
|
37
|
-
ns: meta.id
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
icon: "ph--magnifying-glass--regular",
|
|
41
|
-
disposition: "hidden"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
];
|
|
45
|
-
}), Option.getOrElse(() => [])))
|
|
46
|
-
}),
|
|
47
|
-
createExtension({
|
|
48
|
-
id: meta.id,
|
|
49
|
-
actions: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
50
|
-
return [
|
|
51
|
-
{
|
|
52
|
-
id: SearchAction.OpenSearch._tag,
|
|
53
|
-
data: async () => {
|
|
54
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
55
|
-
await dispatch(createIntent(SearchAction.OpenSearch));
|
|
56
|
-
},
|
|
57
|
-
properties: {
|
|
58
|
-
label: [
|
|
59
|
-
"search action label",
|
|
60
|
-
{
|
|
61
|
-
ns: meta.id
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
icon: "ph--magnifying-glass--regular",
|
|
65
|
-
keyBinding: {
|
|
66
|
-
macos: "shift+meta+f",
|
|
67
|
-
windows: "shift+alt+f"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
];
|
|
72
|
-
}), Option.getOrElse(() => [])))
|
|
73
|
-
})
|
|
74
|
-
]));
|
|
75
|
-
export {
|
|
76
|
-
app_graph_builder_default as default
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=app-graph-builder-HQR6P4C7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { ROOT_ID, atomFromSignal, createExtension } from '@dxos/plugin-graph';\nimport { parseId } from '@dxos/react-client/echo';\n\nimport { meta } from '../meta';\nimport { SearchAction } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/space-search`,\n connector: (node) =>\n Atom.make((get) =>\n Function.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(atomFromSignal(() => 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: meta.id }],\n icon: 'ph--magnifying-glass--regular',\n disposition: 'hidden',\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: meta.id,\n actions: (node) =>\n Atom.make((get) =>\n Function.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: meta.id }],\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,YAAY;AACrB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,cAAkCC,aAAaC,oBAAoB;AAC5E,SAASC,0BAA0B;AACnC,SAASC,2BAA2BC,2BAA2B;AAC/D,SAASC,SAASC,gBAAgBC,uBAAuB;AACzD,SAASC,eAAe;AAKxB,IAAA,6BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,KAAKC,KAAK,CAACC,QACAC,cACPD,IAAIH,IAAAA,GACGK,eAAQ,CAACL,UAAUA,MAAKH,OAAOS,UAAiBC,YAAKP,KAAAA,IAAeQ,YAAI,CAAA,GACxEC,WAAI,CAACT,UAAAA;AACV,YAAMU,YAAYP,IAAIQ,eAAe,MAAMnB,QAAQoB,cAAclB,aAAamB,MAAM,EAAEH,SAAS,CAAA;AAC/F,YAAMI,SAAStB,QAAQoB,cAAcG,mBAAmBC,MAAM;AAC9D,YAAM,EAAEC,QAAO,IAAKC,QAAQR,SAAAA;AAC5B,YAAMS,QAAQF,UAAUH,OAAOM,OAAOjB,IAAIc,OAAAA,IAAW;AAErD,aAAO;QACL;UACEpB,IAAI;YAACG,MAAKH;YAAI;YAAUwB,KAAKC,yBAAAA;UAC7BC,MAAMC;UACNC,MAAMN;UACNO,YAAY;YACVC,OAAO;cAAC;cAAgB;gBAAEC,IAAI9B,KAAKD;cAAG;;YACtCgC,MAAM;YACNC,aAAa;UACf;QACF;;IAEJ,CAAA,GACOC,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACAnC,gBAAgB;IACdC,IAAIC,KAAKD;IACTmC,SAAS,CAAChC,SACRC,KAAKC,KAAK,CAACC,QACAC,cACPD,IAAIH,IAAAA,GACGK,eAAQ,CAACL,UAAUA,MAAKH,OAAOS,UAAiBC,YAAKP,KAAAA,IAAeQ,YAAI,CAAA,GACxEC,WAAI,MAAA;AACT,aAAO;QACL;UACEZ,IAAIoC,aAAaC,WAAWC;UAC5BV,MAAM,YAAA;AACJ,kBAAM,EAAEW,iBAAiBC,SAAQ,IAAK7C,QAAQoB,cAAclB,aAAa4C,gBAAgB;AACzF,kBAAMD,SAASE,aAAaN,aAAaC,UAAU,CAAA;UACrD;UACAR,YAAY;YACVC,OAAO;cAAC;cAAuB;gBAAEC,IAAI9B,KAAKD;cAAG;;YAC7CgC,MAAM;YACNW,YAAY;cACVC,OAAO;cACPC,SAAS;YACX;UACF;QACF;;IAEJ,CAAA,GACOX,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
|
|
6
|
-
"names": ["Atom", "Function", "Option", "Capabilities", "contributes", "createIntent", "ClientCapabilities", "ATTENDABLE_PATH_SEPARATOR", "DECK_COMPANION_TYPE", "ROOT_ID", "atomFromSignal", "createExtension", "parseId", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "connector", "node", "Atom", "make", "get", "pipe", "flatMap", "ROOT_ID", "some", "none", "map", "workspace", "atomFromSignal", "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
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { trim } from "@dxos/util";
|
|
3
|
-
var meta = {
|
|
4
|
-
id: "dxos.org/plugin/search",
|
|
5
|
-
name: "Search",
|
|
6
|
-
description: trim`
|
|
7
|
-
Full-text search engine for finding content across all spaces and object types.
|
|
8
|
-
Quickly locate documents, tables, and other objects with instant results and relevance ranking.
|
|
9
|
-
`,
|
|
10
|
-
icon: "ph--magnifying-glass--regular",
|
|
11
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-search",
|
|
12
|
-
tags: [
|
|
13
|
-
"labs"
|
|
14
|
-
]
|
|
15
|
-
};
|
|
16
|
-
var SEARCH_RESULT = `${meta.id}/result`;
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
meta,
|
|
20
|
-
SEARCH_RESULT
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=chunk-GN2FSWTM.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/search',\n name: 'Search',\n description: trim`\n Full-text search engine for finding content across all spaces and object types.\n Quickly locate documents, tables, and other objects with instant results and relevance ranking.\n `,\n icon: 'ph--magnifying-glass--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-search',\n tags: ['labs'],\n};\n\nexport const SEARCH_RESULT = `${meta.id}/result`;\n"],
|
|
5
|
-
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;AAEO,IAAMC,gBAAgB,GAAGR,KAAKC,EAAE;",
|
|
6
|
-
"names": ["trim", "meta", "id", "name", "description", "trim", "icon", "source", "tags", "SEARCH_RESULT"]
|
|
7
|
-
}
|