@dxos/plugin-search 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b
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/README.md +0 -1
- package/dist/lib/neutral/SearchArticle-DBLOFRIL.mjs +51 -0
- package/dist/lib/neutral/SearchArticle-DBLOFRIL.mjs.map +7 -0
- package/dist/lib/neutral/SearchDialog-55XQUL6R.mjs +74 -0
- package/dist/lib/neutral/SearchDialog-55XQUL6R.mjs.map +7 -0
- package/dist/lib/neutral/SearchPlugin.mjs +23 -0
- package/dist/lib/neutral/SearchPlugin.mjs.map +7 -0
- package/dist/lib/{browser/app-graph-builder-NUJ2FOVQ.mjs → neutral/app-graph-builder-B3W3UWHV.mjs} +23 -34
- 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-EBXWOGAD.mjs +26 -0
- package/dist/lib/neutral/chunk-EBXWOGAD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IXRPYAX5.mjs +8 -0
- package/dist/lib/neutral/chunk-IXRPYAX5.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/{browser/chunk-ZRJJXRGF.mjs → neutral/chunk-LUDADYMK.mjs} +9 -14
- package/dist/lib/neutral/chunk-LUDADYMK.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-HRIWTRJV.mjs → neutral/chunk-NC3YYBHS.mjs} +3 -3
- package/dist/lib/{browser/chunk-HRIWTRJV.mjs.map → neutral/chunk-NC3YYBHS.mjs.map} +3 -3
- 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-DY6ZGVKR.mjs +23 -0
- package/dist/lib/neutral/open-search-DY6ZGVKR.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/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 +1 -0
- package/dist/types/src/SearchPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- 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 +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- 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/containers/SearchArticle/SearchArticle.stories.d.ts +14 -0
- 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/containers/SearchDialog/SearchDialog.stories.d.ts +16 -0
- 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 +2 -2
- package/dist/types/src/hooks/sync.d.ts.map +1 -1
- package/dist/types/src/hooks/useGlobalSearch.d.ts +2 -2
- 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 +1 -1
- 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/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.map +1 -1
- 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 -16
- package/dist/types/src/types/search.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +98 -40
- package/src/SearchPlugin.tsx +6 -22
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +14 -19
- package/src/capabilities/index.ts +9 -3
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +72 -0
- 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 +4 -4
- package/src/hooks/sync.ts +3 -3
- package/src/hooks/useGlobalSearch.tsx +3 -3
- package/src/hooks/useWebSearch.ts +4 -4
- package/src/index.ts +2 -2
- package/src/meta.ts +2 -2
- 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.ts +2 -2
- package/src/translations.ts +10 -9
- package/src/types/SearchOperation.ts +19 -0
- package/src/types/index.ts +2 -1
- package/src/types/search.ts +1 -19
- package/dist/lib/browser/app-graph-builder-NUJ2FOVQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-I7YWQSUZ.mjs +0 -26
- package/dist/lib/browser/chunk-I7YWQSUZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZRJJXRGF.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -105
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-QEGN4ZKN.mjs +0 -26
- package/dist/lib/browser/operation-resolver-QEGN4ZKN.mjs.map +0 -7
- package/dist/lib/browser/react-surface-QE45EVGF.mjs +0 -369
- package/dist/lib/browser/react-surface-QE45EVGF.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.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/SearchMain.stories.d.ts +0 -31
- package/dist/types/src/components/SearchMain.stories.d.ts.map +0 -1
- package/dist/types/src/components/SpaceMain.d.ts +0 -9
- package/dist/types/src/components/SpaceMain.d.ts.map +0 -1
- package/dist/types/src/types/action.d.ts +0 -16
- package/dist/types/src/types/action.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -24
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -71
- package/src/components/SearchDialog.tsx +0 -120
- package/src/components/SearchMain.stories.tsx +0 -90
- package/src/components/SearchMain.tsx +0 -85
- package/src/components/SpaceMain.tsx +0 -172
- package/src/types/action.tsx +0 -18
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Entity, Query } from '@dxos/echo';
|
|
9
|
+
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
10
|
+
import { Panel, Toolbar } from '@dxos/react-ui';
|
|
11
|
+
import { SearchList } from '@dxos/react-ui-search';
|
|
12
|
+
import { Text } from '@dxos/schema';
|
|
13
|
+
import { isTauri, getHostPlatform } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
import { SearchResultStack } from '#components';
|
|
16
|
+
import { useGlobalSearch, useGlobalSearchResults, useWebSearch } from '#hooks';
|
|
17
|
+
|
|
18
|
+
export const SearchArticle = ({ space }: AppSurface.SpaceArticleProps) => {
|
|
19
|
+
// TODO(burdon): Option to query across spaces.
|
|
20
|
+
const [query, setQuery] = useState<string>();
|
|
21
|
+
// TODO(burdon): Re-enable full-text search when indexer is available in all environments.
|
|
22
|
+
const objects = useQuery(
|
|
23
|
+
space.db,
|
|
24
|
+
query === undefined ? Query.select(Filter.nothing()) : Query.select(Filter.not(Filter.type(Text.Text))),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const { setMatch } = useGlobalSearch();
|
|
28
|
+
const results = useGlobalSearchResults(objects);
|
|
29
|
+
const { results: webResults } = useWebSearch({ query });
|
|
30
|
+
const allResults = useMemo(
|
|
31
|
+
() => [...results, ...webResults].filter(({ object }) => object && Entity.getLabel(object)),
|
|
32
|
+
[results, webResults],
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const handleSearch = useCallback(
|
|
36
|
+
(text: string) => {
|
|
37
|
+
setQuery(text);
|
|
38
|
+
setMatch?.(text);
|
|
39
|
+
},
|
|
40
|
+
[setMatch],
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const autoFocus = !isTauri() || getHostPlatform() !== 'ios';
|
|
44
|
+
|
|
45
|
+
// TODO(burdon): Move current up/down without losing focus.
|
|
46
|
+
return (
|
|
47
|
+
<SearchList.Root onSearch={handleSearch}>
|
|
48
|
+
<Panel.Root>
|
|
49
|
+
<Panel.Content asChild>
|
|
50
|
+
<SearchResultStack results={allResults} />
|
|
51
|
+
</Panel.Content>
|
|
52
|
+
<Panel.Statusbar asChild>
|
|
53
|
+
<Toolbar.Root>
|
|
54
|
+
<SearchList.Input placeholder='Search...' autoFocus={autoFocus} />
|
|
55
|
+
</Toolbar.Root>
|
|
56
|
+
</Panel.Statusbar>
|
|
57
|
+
</Panel.Root>
|
|
58
|
+
</SearchList.Root>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { expect, userEvent, waitFor, within } from 'storybook/test';
|
|
9
|
+
|
|
10
|
+
import { Capability } from '@dxos/app-framework';
|
|
11
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
13
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
14
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
15
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
16
|
+
import { random } from '@dxos/random';
|
|
17
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
18
|
+
import { Dialog } from '@dxos/react-ui';
|
|
19
|
+
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
20
|
+
import { createObjectFactory } from '@dxos/schema/testing';
|
|
21
|
+
import { Organization, Person } from '@dxos/types';
|
|
22
|
+
|
|
23
|
+
import { SearchContextProvider } from '#hooks';
|
|
24
|
+
import { translations } from '#translations';
|
|
25
|
+
|
|
26
|
+
import { SearchDialog } from './SearchDialog';
|
|
27
|
+
|
|
28
|
+
random.seed(0);
|
|
29
|
+
|
|
30
|
+
const DefaultStory = () => {
|
|
31
|
+
const spaces = useSpaces();
|
|
32
|
+
const space = spaces[spaces.length - 1];
|
|
33
|
+
if (!space) {
|
|
34
|
+
return <Loading />;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<SearchContextProvider>
|
|
39
|
+
<Dialog.Root defaultOpen>
|
|
40
|
+
<Dialog.Overlay>
|
|
41
|
+
<SearchDialog role='article' space={space} attendableId={space.id} pivotId='storybook' />
|
|
42
|
+
</Dialog.Overlay>
|
|
43
|
+
</Dialog.Root>
|
|
44
|
+
</SearchContextProvider>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const meta = {
|
|
49
|
+
title: 'plugins/plugin-search/containers/SearchDialog',
|
|
50
|
+
render: DefaultStory,
|
|
51
|
+
decorators: [
|
|
52
|
+
withLayout({ layout: 'fullscreen' }),
|
|
53
|
+
withPluginManager({
|
|
54
|
+
capabilities: [Capability.contributes(AppCapabilities.Translations, translations)],
|
|
55
|
+
plugins: [
|
|
56
|
+
...corePlugins(),
|
|
57
|
+
StorybookPlugin({}),
|
|
58
|
+
ClientPlugin({
|
|
59
|
+
types: [Organization.Organization, Person.Person],
|
|
60
|
+
onClientInitialized: ({ client }) =>
|
|
61
|
+
Effect.gen(function* () {
|
|
62
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
63
|
+
|
|
64
|
+
const factory = createObjectFactory(personalSpace.db, random as any);
|
|
65
|
+
yield* Effect.promise(() =>
|
|
66
|
+
factory([
|
|
67
|
+
{ type: Organization.Organization, count: 10 },
|
|
68
|
+
{ type: Person.Person, count: 50 },
|
|
69
|
+
]),
|
|
70
|
+
);
|
|
71
|
+
}),
|
|
72
|
+
}),
|
|
73
|
+
],
|
|
74
|
+
}),
|
|
75
|
+
],
|
|
76
|
+
tags: ['test'],
|
|
77
|
+
parameters: {
|
|
78
|
+
layout: 'fullscreen',
|
|
79
|
+
},
|
|
80
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
81
|
+
|
|
82
|
+
export default meta;
|
|
83
|
+
|
|
84
|
+
type Story = StoryObj<typeof meta>;
|
|
85
|
+
|
|
86
|
+
export const Default: Story = {};
|
|
87
|
+
|
|
88
|
+
export const Test: Story = {
|
|
89
|
+
play: async () => {
|
|
90
|
+
const body = within(document.body);
|
|
91
|
+
|
|
92
|
+
// Wait for the dialog to render and the search input to appear.
|
|
93
|
+
const searchInput = await body.findByRole('textbox', undefined, { timeout: 10_000 });
|
|
94
|
+
await expect(searchInput).toBeInTheDocument();
|
|
95
|
+
|
|
96
|
+
// Type a search term that should match generated Person/Organization names.
|
|
97
|
+
await userEvent.type(searchInput, 'a');
|
|
98
|
+
|
|
99
|
+
// Wait for search results to appear as options in the listbox.
|
|
100
|
+
await waitFor(
|
|
101
|
+
async () => {
|
|
102
|
+
const options = body.queryAllByRole('option');
|
|
103
|
+
await expect(options.length).toBeGreaterThan(0);
|
|
104
|
+
},
|
|
105
|
+
{ timeout: 10_000 },
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { getObjectPathFromObject, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
|
+
import { useLayout } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { Entity, Obj, Query } from '@dxos/echo';
|
|
12
|
+
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
13
|
+
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
import { SearchList } from '@dxos/react-ui-search';
|
|
15
|
+
import { Text } from '@dxos/schema';
|
|
16
|
+
|
|
17
|
+
import { useGlobalSearch, useGlobalSearchResults } from '#hooks';
|
|
18
|
+
import { meta } from '#meta';
|
|
19
|
+
import { type SearchResult } from '#types';
|
|
20
|
+
|
|
21
|
+
export type SearchDialogProps = AppSurface.SpaceArticleProps<{
|
|
22
|
+
pivotId?: string;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export const SearchDialog = ({ space, pivotId: pivotIdProp }: SearchDialogProps) => {
|
|
26
|
+
const { t } = useTranslation(meta.id);
|
|
27
|
+
const { invokePromise } = useOperationInvoker();
|
|
28
|
+
const { setMatch } = useGlobalSearch();
|
|
29
|
+
const layout = useLayout();
|
|
30
|
+
const pivotId = pivotIdProp ?? layout.active[layout.active.length - 1];
|
|
31
|
+
const [query, setQuery] = useState<string>();
|
|
32
|
+
|
|
33
|
+
// TODO(burdon): Re-enable full-text search when indexer is available in all environments.
|
|
34
|
+
const objects = useQuery(
|
|
35
|
+
space?.db,
|
|
36
|
+
query === undefined ? Query.select(Filter.nothing()) : Query.select(Filter.not(Filter.type(Text.Text))),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const results = useGlobalSearchResults(objects);
|
|
40
|
+
const allResults = useMemo(() => results.filter(({ object }) => object && Entity.getLabel(object)), [results]);
|
|
41
|
+
|
|
42
|
+
const handleSearch = useCallback(
|
|
43
|
+
(text: string) => {
|
|
44
|
+
setQuery(text);
|
|
45
|
+
setMatch?.(text);
|
|
46
|
+
},
|
|
47
|
+
[setMatch],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const handleSelect = useCallback(
|
|
51
|
+
async (result: SearchResult) => {
|
|
52
|
+
if (!result.object || !Obj.isObject(result.object)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const qualifiedPath = getObjectPathFromObject(result.object);
|
|
57
|
+
await invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
58
|
+
await invokePromise(LayoutOperation.Open, {
|
|
59
|
+
subject: [qualifiedPath],
|
|
60
|
+
pivotId,
|
|
61
|
+
positioning: 'end',
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
[pivotId, invokePromise],
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Dialog.Content>
|
|
69
|
+
<Dialog.Header>
|
|
70
|
+
<Dialog.Title>{t('search-dialog.title')}</Dialog.Title>
|
|
71
|
+
<Dialog.Close asChild>
|
|
72
|
+
<Dialog.CloseIconButton />
|
|
73
|
+
</Dialog.Close>
|
|
74
|
+
</Dialog.Header>
|
|
75
|
+
<SearchList.Root onSearch={handleSearch}>
|
|
76
|
+
<SearchList.Input classNames='px-0' autoFocus placeholder={t('search.placeholder')} />
|
|
77
|
+
<SearchList.Viewport classNames='max-h-[24rem]'>
|
|
78
|
+
{allResults.map((result) => (
|
|
79
|
+
<SearchList.Item
|
|
80
|
+
key={result.id}
|
|
81
|
+
classNames='flex gap-2 items-center'
|
|
82
|
+
value={result.id}
|
|
83
|
+
label={result.label ?? (result.object ? Entity.getLabel(result.object) : undefined) ?? result.id}
|
|
84
|
+
icon={result.icon}
|
|
85
|
+
onSelect={() => void handleSelect(result)}
|
|
86
|
+
/>
|
|
87
|
+
))}
|
|
88
|
+
{query && allResults.length === 0 && <SearchList.Empty />}
|
|
89
|
+
</SearchList.Viewport>
|
|
90
|
+
</SearchList.Root>
|
|
91
|
+
</Dialog.Content>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export const SearchDialog: ComponentType<any> = lazy(() => import('./SearchDialog'));
|
|
8
|
+
export const SearchArticle: ComponentType<any> = lazy(() => import('./SearchArticle'));
|
package/src/hooks/sync.test.ts
CHANGED
|
@@ -7,11 +7,11 @@ import { describe, expect, test } from 'vitest';
|
|
|
7
7
|
import { Client } from '@dxos/client';
|
|
8
8
|
import { Filter, Obj } from '@dxos/echo';
|
|
9
9
|
import { TestSchema } from '@dxos/echo/testing';
|
|
10
|
-
import {
|
|
10
|
+
import { random } from '@dxos/random';
|
|
11
11
|
|
|
12
12
|
import { filterObjectsSync } from './sync';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
random.seed(1);
|
|
15
15
|
|
|
16
16
|
// TODO(burdon): Reconcile with agent/minisearch.
|
|
17
17
|
|
|
@@ -26,8 +26,8 @@ describe('Search', () => {
|
|
|
26
26
|
const space = await client.spaces.create();
|
|
27
27
|
Array.from({ length: 20 }).map((_, i) => {
|
|
28
28
|
const content =
|
|
29
|
-
i === 10 ?
|
|
30
|
-
return space.db.add(Obj.make(TestSchema.Expando, { title:
|
|
29
|
+
i === 10 ? random.lorem.sentence() + ` ${match}}. ` + random.lorem.sentence() : random.lorem.sentences();
|
|
30
|
+
return space.db.add(Obj.make(TestSchema.Expando, { title: random.lorem.sentence(), content }));
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const objects = await space.db.query(Filter.everything()).run();
|
package/src/hooks/sync.ts
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import type * as Schema from 'effect/Schema';
|
|
6
6
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Entity, Obj } from '@dxos/echo';
|
|
9
9
|
import { Text } from '@dxos/schema';
|
|
10
10
|
|
|
11
|
-
import { type SearchResult } from '
|
|
11
|
+
import { type SearchResult } from '#types';
|
|
12
12
|
|
|
13
13
|
export const queryStringToMatch = (queryString?: string): RegExp | undefined => {
|
|
14
14
|
const trimmed = queryString?.trim();
|
|
@@ -57,7 +57,7 @@ export const filterObjectsSync = <T extends Entity.Unknown>(objects: T[], match?
|
|
|
57
57
|
|
|
58
58
|
results.push({
|
|
59
59
|
id: object.id,
|
|
60
|
-
type: getIcon(
|
|
60
|
+
type: getIcon(Entity.getSchema(object)),
|
|
61
61
|
label,
|
|
62
62
|
match,
|
|
63
63
|
// TODO(burdon): Truncate.
|
|
@@ -6,14 +6,14 @@ import React, { type PropsWithChildren, createContext, useCallback, useContext,
|
|
|
6
6
|
|
|
7
7
|
import { raise } from '@dxos/debug';
|
|
8
8
|
import { type Entity } from '@dxos/echo';
|
|
9
|
-
import { GlobalFilterProvider } from '@dxos/react-ui-
|
|
9
|
+
import { GlobalFilterProvider } from '@dxos/react-ui-search';
|
|
10
10
|
|
|
11
|
-
import { type SearchResult } from '
|
|
11
|
+
import { type SearchResult } from '#types';
|
|
12
12
|
|
|
13
13
|
import { filterObjectsSync, queryStringToMatch } from './sync';
|
|
14
14
|
|
|
15
15
|
// Re-export for backward compatibility.
|
|
16
|
-
export { useGlobalFilteredObjects, GlobalFilterProvider } from '@dxos/react-ui-
|
|
16
|
+
export { useGlobalFilteredObjects, GlobalFilterProvider } from '@dxos/react-ui-search';
|
|
17
17
|
|
|
18
18
|
type SearchContextType = {
|
|
19
19
|
match?: RegExp;
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { EXA_API_KEY } from '@dxos/ai/testing';
|
|
8
|
-
import {
|
|
8
|
+
import { Entity } from '@dxos/echo';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { getIconAnnotation } from '@dxos/schema';
|
|
11
11
|
import { TestSchema } from '@dxos/schema/testing';
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
import { type SearchResult } from '../types';
|
|
13
|
+
import { type SearchResult } from '#types';
|
|
15
14
|
|
|
15
|
+
import { search } from '../search';
|
|
16
16
|
import { getStringProperty } from './sync';
|
|
17
17
|
|
|
18
18
|
export type UseWebSearchProps = {
|
|
@@ -44,7 +44,7 @@ export const useWebSearch = ({ query, context }: UseWebSearchProps): UseWebSearc
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const mappedResults = results.data.map((result): SearchResult => {
|
|
47
|
-
const schema =
|
|
47
|
+
const schema = Entity.getSchema(result);
|
|
48
48
|
return {
|
|
49
49
|
id: result.id,
|
|
50
50
|
label: getStringProperty(result, ['name', 'title', 'label']),
|
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
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.search',
|
|
10
10
|
name: 'Search',
|
|
11
11
|
description: trim`
|
|
12
12
|
Full-text search engine for finding content across all spaces and object types.
|
|
@@ -17,4 +17,4 @@ export const meta: Plugin.Meta = {
|
|
|
17
17
|
tags: ['labs'],
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export const SEARCH_RESULT = `${meta.id}
|
|
20
|
+
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.ts
CHANGED
|
@@ -9,8 +9,8 @@ import * as Schema from 'effect/Schema';
|
|
|
9
9
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
10
10
|
|
|
11
11
|
import { type Entity, Key, Obj, type Type } from '@dxos/echo';
|
|
12
|
-
import { ReferenceAnnotationId } from '@dxos/echo/internal';
|
|
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
|
|
|
@@ -181,7 +181,7 @@ const DATA_EXTRACTION_INSTRUCTIONS = trim`
|
|
|
181
181
|
// return terms;
|
|
182
182
|
// };
|
|
183
183
|
|
|
184
|
-
const sanitizeObjects = (entries: { data: any; schema: Type.
|
|
184
|
+
const sanitizeObjects = (entries: { data: any; schema: Type.AnyObj }[]) => {
|
|
185
185
|
const idMap = new Map<string, string>();
|
|
186
186
|
|
|
187
187
|
return entries
|
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' },
|
|
17
|
+
input: Schema.Void,
|
|
18
|
+
output: Schema.Void,
|
|
19
|
+
});
|
package/src/types/index.ts
CHANGED
package/src/types/search.ts
CHANGED
|
@@ -2,22 +2,4 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type SearchResult<T extends Entity.Unknown = Entity.Unknown> = {
|
|
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
|
-
object?: T;
|
|
23
|
-
};
|
|
5
|
+
export type { SearchResult } from '@dxos/react-ui-search';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\nimport { parseId } from '@dxos/react-client/echo';\n\nimport { meta } from '../../meta';\nimport { SearchOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: `${meta.id}/space-search`,\n match: NodeMatcher.whenRoot,\n connector: Effect.fnUntraced(function* (node, get) {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const layoutAtom = get(yield* Capability.atom(AppCapabilities.Layout))[0];\n const layout = layoutAtom ? get(layoutAtom) : undefined;\n const { spaceId } = parseId(layout?.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 }),\n GraphBuilder.createExtension({\n id: meta.id,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: SearchOperation.OpenSearch.meta.key,\n data: Effect.fnUntraced(function* () {\n yield* Operation.invoke(SearchOperation.OpenSearch);\n return false;\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 ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,0BAA0B;AACnC,SAASC,2BAA2BC,2BAA2B;AAC/D,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,eAAe;AAKxB,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCC,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC;MACnBC,WAAkBV,kBAAW,WAAWW,MAAMC,KAAG;AAC/C,cAAMC,SAAS,OAAOf,WAAWc,IAAIE,mBAAmBC,MAAM;AAC9D,cAAMC,aAAaJ,IAAI,OAAOd,WAAWmB,KAAKC,gBAAgBC,MAAM,CAAA,EAAG,CAAA;AACvE,cAAMC,SAASJ,aAAaJ,IAAII,UAAAA,IAAcK;AAC9C,cAAM,EAAEC,QAAO,IAAKC,QAAQH,QAAQI,SAAAA;AACpC,cAAMC,QAAQH,UAAUT,OAAOa,OAAOd,IAAIU,OAAAA,IAAW;AAErD,eAAO;UACL;YACEjB,IAAI;cAACM,KAAKN;cAAI;cAAUsB,KAAKC,yBAAAA;YAC7BC,MAAMC;YACNC,MAAMN;YACNO,YAAY;cACVC,OAAO;gBAAC;gBAAgB;kBAAEC,IAAI5B,KAAKD;gBAAG;;cACtC8B,MAAM;cACNC,aAAa;YACf;UACF;;MAEJ,CAAA;IACF,CAAA;IACAjC,aAAaC,gBAAgB;MAC3BC,IAAIC,KAAKD;MACTE,OAAOC,YAAYC;MACnB4B,SAAS,MACAC,eAAQ;QACb;UACEjC,IAAIkC,gBAAgBC,WAAWlC,KAAKmC;UACpCV,MAAa/B,kBAAW,aAAA;AACtB,mBAAO0C,UAAUC,OAAOJ,gBAAgBC,UAAU;AAClD,mBAAO;UACT,CAAA;UACAR,YAAY;YACVC,OAAO;cAAC;cAAuB;gBAAEC,IAAI5B,KAAKD;cAAG;;YAC7C8B,MAAM;YACNS,YAAY;cACVC,OAAO;cACPC,SAAS;YACX;UACF;QACF;OACD;IACL,CAAA;GACD;AAED,SAAOhD,WAAWiD,YAAY7B,gBAAgB8B,iBAAiB/C,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "AppCapabilities", "Operation", "ClientCapabilities", "ATTENDABLE_PATH_SEPARATOR", "DECK_COMPANION_TYPE", "GraphBuilder", "NodeMatcher", "parseId", "Capability", "makeModule", "fnUntraced", "extensions", "all", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "connector", "node", "get", "client", "ClientCapabilities", "Client", "layoutAtom", "atom", "AppCapabilities", "Layout", "layout", "undefined", "spaceId", "parseId", "workspace", "space", "spaces", "join", "ATTENDABLE_PATH_SEPARATOR", "type", "DECK_COMPANION_TYPE", "data", "properties", "label", "ns", "icon", "disposition", "actions", "succeed", "SearchOperation", "OpenSearch", "key", "Operation", "invoke", "keyBinding", "macos", "windows", "contributes", "AppGraphBuilder"]
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-HRIWTRJV.mjs";
|
|
4
|
-
|
|
5
|
-
// src/types/action.tsx
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
|
-
import { Operation } from "@dxos/operation";
|
|
8
|
-
var SEARCH_OPERATION = `${meta.id}/operation`;
|
|
9
|
-
(function(SearchOperation2) {
|
|
10
|
-
SearchOperation2.OpenSearch = Operation.make({
|
|
11
|
-
meta: {
|
|
12
|
-
key: `${SEARCH_OPERATION}/open-search`,
|
|
13
|
-
name: "Open Search"
|
|
14
|
-
},
|
|
15
|
-
schema: {
|
|
16
|
-
input: Schema.Void,
|
|
17
|
-
output: Schema.Void
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
})(SearchOperation || (SearchOperation = {}));
|
|
21
|
-
var SearchOperation;
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
SearchOperation
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=chunk-I7YWQSUZ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/action.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '../meta';\n\nconst SEARCH_OPERATION = `${meta.id}/operation`;\n\nexport namespace SearchOperation {\n export const OpenSearch = Operation.make({\n meta: { key: `${SEARCH_OPERATION}/open-search`, name: 'Open Search' },\n schema: { input: Schema.Void, output: Schema.Void },\n });\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAI1B,IAAMC,mBAAmB,GAAGC,KAAKC,EAAE;UAElBC,kBAAAA;mBACFC,aAAaC,UAAUC,KAAK;IACvCL,MAAM;MAAEM,KAAK,GAAGP,gBAAAA;MAAgCQ,MAAM;IAAc;IACpEC,QAAQ;MAAEC,OAAcC;MAAMC,QAAeD;IAAK;EACpD,CAAA;AACF,GALiBR,oBAAAA,kBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "Operation", "SEARCH_OPERATION", "meta", "id", "SearchOperation", "OpenSearch", "Operation", "make", "key", "name", "schema", "input", "Void", "output"]
|
|
7
|
-
}
|