@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
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/SearchArticle/SearchArticle.tsx
|
|
4
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
5
|
+
import { Entity, Filter, Query } from "@dxos/echo";
|
|
6
|
+
import { useQuery } from "@dxos/react-client/echo";
|
|
7
|
+
import { Panel, Toolbar } from "@dxos/react-ui";
|
|
8
|
+
import { SearchList } from "@dxos/react-ui-search";
|
|
9
|
+
import { Text } from "@dxos/schema";
|
|
10
|
+
import { isTauri, getHostPlatform } from "@dxos/util";
|
|
11
|
+
import { SearchResultStack } from "#components";
|
|
12
|
+
import { useGlobalSearch, useGlobalSearchResults, useWebSearch } from "#hooks";
|
|
13
|
+
var SearchArticle = ({ space }) => {
|
|
14
|
+
const [query, setQuery] = useState();
|
|
15
|
+
const objects = useQuery(space.db, query === void 0 ? Query.select(Filter.nothing()) : Query.select(Filter.not(Filter.type(Text.Text))));
|
|
16
|
+
const { setMatch } = useGlobalSearch();
|
|
17
|
+
const results = useGlobalSearchResults(objects);
|
|
18
|
+
const { results: webResults } = useWebSearch({
|
|
19
|
+
query
|
|
20
|
+
});
|
|
21
|
+
const allResults = useMemo(() => [
|
|
22
|
+
...results,
|
|
23
|
+
...webResults
|
|
24
|
+
].filter(({ object }) => object && Entity.getLabel(object)), [
|
|
25
|
+
results,
|
|
26
|
+
webResults
|
|
27
|
+
]);
|
|
28
|
+
const handleSearch = useCallback((text) => {
|
|
29
|
+
setQuery(text);
|
|
30
|
+
setMatch?.(text);
|
|
31
|
+
}, [
|
|
32
|
+
setMatch
|
|
33
|
+
]);
|
|
34
|
+
const autoFocus = !isTauri() || getHostPlatform() !== "ios";
|
|
35
|
+
return /* @__PURE__ */ React.createElement(SearchList.Root, {
|
|
36
|
+
onSearch: handleSearch
|
|
37
|
+
}, /* @__PURE__ */ React.createElement(Panel.Root, null, /* @__PURE__ */ React.createElement(Panel.Content, {
|
|
38
|
+
asChild: true
|
|
39
|
+
}, /* @__PURE__ */ React.createElement(SearchResultStack, {
|
|
40
|
+
results: allResults
|
|
41
|
+
})), /* @__PURE__ */ React.createElement(Panel.Statusbar, {
|
|
42
|
+
asChild: true
|
|
43
|
+
}, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(SearchList.Input, {
|
|
44
|
+
placeholder: "Search...",
|
|
45
|
+
autoFocus
|
|
46
|
+
})))));
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
SearchArticle as default
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=SearchArticle-CQMZ46ZS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/SearchArticle/SearchArticle.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Entity, Filter, Query } from '@dxos/echo';\nimport { useQuery } from '@dxos/react-client/echo';\nimport { Panel, Toolbar } from '@dxos/react-ui';\nimport { SearchList } from '@dxos/react-ui-search';\nimport { Text } from '@dxos/schema';\nimport { isTauri, getHostPlatform } from '@dxos/util';\n\nimport { SearchResultStack } from '#components';\nimport { useGlobalSearch, useGlobalSearchResults, useWebSearch } from '#hooks';\n\nexport const SearchArticle = ({ space }: AppSurface.SpaceArticleProps) => {\n // TODO(burdon): Option to query across spaces.\n const [query, setQuery] = useState<string>();\n // TODO(burdon): Re-enable full-text search when indexer is available in all environments.\n const objects = useQuery(\n space.db,\n query === undefined ? Query.select(Filter.nothing()) : Query.select(Filter.not(Filter.type(Text.Text))),\n );\n\n const { setMatch } = useGlobalSearch();\n const results = useGlobalSearchResults(objects);\n const { results: webResults } = useWebSearch({ query });\n const allResults = useMemo(\n () => [...results, ...webResults].filter(({ object }) => object && Entity.getLabel(object)),\n [results, webResults],\n );\n\n const handleSearch = useCallback(\n (text: string) => {\n setQuery(text);\n setMatch?.(text);\n },\n [setMatch],\n );\n\n const autoFocus = !isTauri() || getHostPlatform() !== 'ios';\n\n // TODO(burdon): Move current up/down without losing focus.\n return (\n <SearchList.Root onSearch={handleSearch}>\n <Panel.Root>\n <Panel.Content asChild>\n <SearchResultStack results={allResults} />\n </Panel.Content>\n <Panel.Statusbar asChild>\n <Toolbar.Root>\n <SearchList.Input placeholder='Search...' autoFocus={autoFocus} />\n </Toolbar.Root>\n </Panel.Statusbar>\n </Panel.Root>\n </SearchList.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,OAAOA,SAASC,aAAaC,SAASC,gBAAgB;AAGtD,SAASC,QAAQC,QAAQC,aAAa;AACtC,SAASC,gBAAgB;AACzB,SAASC,OAAOC,eAAe;AAC/B,SAASC,kBAAkB;AAC3B,SAASC,YAAY;AACrB,SAASC,SAASC,uBAAuB;AAEzC,SAASC,yBAAyB;AAClC,SAASC,iBAAiBC,wBAAwBC,oBAAoB;AAE/D,IAAMC,gBAAgB,CAAC,EAAEC,MAAK,MAAgC;AAEnE,QAAM,CAACC,OAAOC,QAAAA,IAAYlB,SAAAA;AAE1B,QAAMmB,UAAUf,SACdY,MAAMI,IACNH,UAAUI,SAAYlB,MAAMmB,OAAOpB,OAAOqB,QAAO,CAAA,IAAMpB,MAAMmB,OAAOpB,OAAOsB,IAAItB,OAAOuB,KAAKjB,KAAKA,IAAI,CAAA,CAAA,CAAA;AAGtG,QAAM,EAAEkB,SAAQ,IAAKd,gBAAAA;AACrB,QAAMe,UAAUd,uBAAuBM,OAAAA;AACvC,QAAM,EAAEQ,SAASC,WAAU,IAAKd,aAAa;IAAEG;EAAM,CAAA;AACrD,QAAMY,aAAa9B,QACjB,MAAM;OAAI4B;OAAYC;IAAYE,OAAO,CAAC,EAAEC,OAAM,MAAOA,UAAU9B,OAAO+B,SAASD,MAAAA,CAAAA,GACnF;IAACJ;IAASC;GAAW;AAGvB,QAAMK,eAAenC,YACnB,CAACoC,SAAAA;AACChB,aAASgB,IAAAA;AACTR,eAAWQ,IAAAA;EACb,GACA;IAACR;GAAS;AAGZ,QAAMS,YAAY,CAAC1B,QAAAA,KAAaC,gBAAAA,MAAsB;AAGtD,SACE,sBAAA,cAACH,WAAW6B,MAAI;IAACC,UAAUJ;KACzB,sBAAA,cAAC5B,MAAM+B,MAAI,MACT,sBAAA,cAAC/B,MAAMiC,SAAO;IAACC,SAAAA;KACb,sBAAA,cAAC5B,mBAAAA;IAAkBgB,SAASE;OAE9B,sBAAA,cAACxB,MAAMmC,WAAS;IAACD,SAAAA;KACf,sBAAA,cAACjC,QAAQ8B,MAAI,MACX,sBAAA,cAAC7B,WAAWkC,OAAK;IAACC,aAAY;IAAYP;;AAMtD;",
|
|
6
|
+
"names": ["React", "useCallback", "useMemo", "useState", "Entity", "Filter", "Query", "useQuery", "Panel", "Toolbar", "SearchList", "Text", "isTauri", "getHostPlatform", "SearchResultStack", "useGlobalSearch", "useGlobalSearchResults", "useWebSearch", "SearchArticle", "space", "query", "setQuery", "objects", "db", "undefined", "select", "nothing", "not", "type", "setMatch", "results", "webResults", "allResults", "filter", "object", "getLabel", "handleSearch", "text", "autoFocus", "Root", "onSearch", "Content", "asChild", "Statusbar", "Input", "placeholder"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/SearchDialog/SearchDialog.tsx
|
|
4
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
5
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
6
|
+
import { getObjectPathFromObject, LayoutOperation } from "@dxos/app-toolkit";
|
|
7
|
+
import { useLayout } from "@dxos/app-toolkit/ui";
|
|
8
|
+
import { Entity, Filter, Obj, Query } from "@dxos/echo";
|
|
9
|
+
import { useQuery } from "@dxos/react-client/echo";
|
|
10
|
+
import { Dialog, useTranslation } from "@dxos/react-ui";
|
|
11
|
+
import { SearchList } from "@dxos/react-ui-search";
|
|
12
|
+
import { Text } from "@dxos/schema";
|
|
13
|
+
import { useGlobalSearch, useGlobalSearchResults } from "#hooks";
|
|
14
|
+
import { meta } from "#meta";
|
|
15
|
+
var SearchDialog = ({ space, pivotId: pivotIdProp }) => {
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
|
+
const { invokePromise } = useOperationInvoker();
|
|
18
|
+
const { setMatch } = useGlobalSearch();
|
|
19
|
+
const layout = useLayout();
|
|
20
|
+
const pivotId = pivotIdProp ?? layout.active[layout.active.length - 1];
|
|
21
|
+
const [query, setQuery] = useState();
|
|
22
|
+
const objects = useQuery(space?.db, query === void 0 ? Query.select(Filter.nothing()) : Query.select(Filter.not(Filter.type(Text.Text))));
|
|
23
|
+
const results = useGlobalSearchResults(objects);
|
|
24
|
+
const allResults = useMemo(() => results.filter(({ object }) => object && Entity.getLabel(object)), [
|
|
25
|
+
results
|
|
26
|
+
]);
|
|
27
|
+
const handleSearch = useCallback((text) => {
|
|
28
|
+
setQuery(text);
|
|
29
|
+
setMatch?.(text);
|
|
30
|
+
}, [
|
|
31
|
+
setMatch
|
|
32
|
+
]);
|
|
33
|
+
const handleSelect = useCallback(async (result) => {
|
|
34
|
+
if (!result.object || !Obj.isObject(result.object)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const qualifiedPath = getObjectPathFromObject(result.object);
|
|
38
|
+
await invokePromise(LayoutOperation.UpdateDialog, {
|
|
39
|
+
state: false
|
|
40
|
+
});
|
|
41
|
+
await invokePromise(LayoutOperation.Open, {
|
|
42
|
+
subject: [
|
|
43
|
+
qualifiedPath
|
|
44
|
+
],
|
|
45
|
+
pivotId,
|
|
46
|
+
positioning: "end"
|
|
47
|
+
});
|
|
48
|
+
}, [
|
|
49
|
+
pivotId,
|
|
50
|
+
invokePromise
|
|
51
|
+
]);
|
|
52
|
+
return /* @__PURE__ */ React.createElement(Dialog.Content, null, /* @__PURE__ */ React.createElement(Dialog.Header, null, /* @__PURE__ */ React.createElement(Dialog.Title, null, t("search-dialog.title")), /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
53
|
+
asChild: true
|
|
54
|
+
}, /* @__PURE__ */ React.createElement(Dialog.ActionIconButton, {
|
|
55
|
+
action: "close"
|
|
56
|
+
}))), /* @__PURE__ */ React.createElement(SearchList.Root, {
|
|
57
|
+
onSearch: handleSearch
|
|
58
|
+
}, /* @__PURE__ */ React.createElement(SearchList.Input, {
|
|
59
|
+
classNames: "px-0",
|
|
60
|
+
autoFocus: true,
|
|
61
|
+
placeholder: t("search.placeholder")
|
|
62
|
+
}), /* @__PURE__ */ React.createElement(SearchList.Viewport, {
|
|
63
|
+
classNames: "max-h-[24rem]"
|
|
64
|
+
}, allResults.map((result) => /* @__PURE__ */ React.createElement(SearchList.Item, {
|
|
65
|
+
key: result.id,
|
|
66
|
+
classNames: "flex gap-2 items-center",
|
|
67
|
+
value: result.id,
|
|
68
|
+
label: result.label ?? (result.object ? Entity.getLabel(result.object) : void 0) ?? result.id,
|
|
69
|
+
icon: result.icon,
|
|
70
|
+
onSelect: () => void handleSelect(result)
|
|
71
|
+
})), query && allResults.length === 0 && /* @__PURE__ */ React.createElement(SearchList.Empty, null))));
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
SearchDialog as default
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=SearchDialog-IFMA5UP5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/SearchDialog/SearchDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { getObjectPathFromObject, LayoutOperation } from '@dxos/app-toolkit';\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { useLayout } from '@dxos/app-toolkit/ui';\nimport { Entity, Filter, Obj, Query } from '@dxos/echo';\nimport { useQuery } from '@dxos/react-client/echo';\nimport { Dialog, useTranslation } from '@dxos/react-ui';\nimport { SearchList } from '@dxos/react-ui-search';\nimport { Text } from '@dxos/schema';\n\nimport { useGlobalSearch, useGlobalSearchResults } from '#hooks';\nimport { meta } from '#meta';\nimport { type SearchResult } from '#types';\n\nexport type SearchDialogProps = AppSurface.SpaceArticleProps<{\n pivotId?: string;\n}>;\n\nexport const SearchDialog = ({ space, pivotId: pivotIdProp }: SearchDialogProps) => {\n const { t } = useTranslation(meta.id);\n const { invokePromise } = useOperationInvoker();\n const { setMatch } = useGlobalSearch();\n const layout = useLayout();\n const pivotId = pivotIdProp ?? layout.active[layout.active.length - 1];\n const [query, setQuery] = useState<string>();\n\n // TODO(burdon): Re-enable full-text search when indexer is available in all environments.\n const objects = useQuery(\n space?.db,\n query === undefined ? Query.select(Filter.nothing()) : Query.select(Filter.not(Filter.type(Text.Text))),\n );\n\n const results = useGlobalSearchResults(objects);\n const allResults = useMemo(() => results.filter(({ object }) => object && Entity.getLabel(object)), [results]);\n\n const handleSearch = useCallback(\n (text: string) => {\n setQuery(text);\n setMatch?.(text);\n },\n [setMatch],\n );\n\n const handleSelect = useCallback(\n async (result: SearchResult) => {\n if (!result.object || !Obj.isObject(result.object)) {\n return;\n }\n\n const qualifiedPath = getObjectPathFromObject(result.object);\n await invokePromise(LayoutOperation.UpdateDialog, { state: false });\n await invokePromise(LayoutOperation.Open, {\n subject: [qualifiedPath],\n pivotId,\n positioning: 'end',\n });\n },\n [pivotId, invokePromise],\n );\n\n return (\n <Dialog.Content>\n <Dialog.Header>\n <Dialog.Title>{t('search-dialog.title')}</Dialog.Title>\n <Dialog.Close asChild>\n <Dialog.ActionIconButton action='close' />\n </Dialog.Close>\n </Dialog.Header>\n <SearchList.Root onSearch={handleSearch}>\n <SearchList.Input classNames='px-0' autoFocus placeholder={t('search.placeholder')} />\n <SearchList.Viewport classNames='max-h-[24rem]'>\n {allResults.map((result) => (\n <SearchList.Item\n key={result.id}\n classNames='flex gap-2 items-center'\n value={result.id}\n label={result.label ?? (result.object ? Entity.getLabel(result.object) : undefined) ?? result.id}\n icon={result.icon}\n onSelect={() => void handleSelect(result)}\n />\n ))}\n {query && allResults.length === 0 && <SearchList.Empty />}\n </SearchList.Viewport>\n </SearchList.Root>\n </Dialog.Content>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,OAAOA,SAASC,aAAaC,SAASC,gBAAgB;AAEtD,SAASC,2BAA2B;AACpC,SAASC,yBAAyBC,uBAAuB;AAEzD,SAASC,iBAAiB;AAC1B,SAASC,QAAQC,QAAQC,KAAKC,aAAa;AAC3C,SAASC,gBAAgB;AACzB,SAASC,QAAQC,sBAAsB;AACvC,SAASC,kBAAkB;AAC3B,SAASC,YAAY;AAErB,SAASC,iBAAiBC,8BAA8B;AACxD,SAASC,YAAY;AAOd,IAAMC,eAAe,CAAC,EAAEC,OAAOC,SAASC,YAAW,MAAqB;AAC7E,QAAM,EAAEC,EAAC,IAAKV,eAAeK,KAAKM,EAAE;AACpC,QAAM,EAAEC,cAAa,IAAKtB,oBAAAA;AAC1B,QAAM,EAAEuB,SAAQ,IAAKV,gBAAAA;AACrB,QAAMW,SAASrB,UAAAA;AACf,QAAMe,UAAUC,eAAeK,OAAOC,OAAOD,OAAOC,OAAOC,SAAS,CAAA;AACpE,QAAM,CAACC,OAAOC,QAAAA,IAAY7B,SAAAA;AAG1B,QAAM8B,UAAUrB,SACdS,OAAOa,IACPH,UAAUI,SAAYxB,MAAMyB,OAAO3B,OAAO4B,QAAO,CAAA,IAAM1B,MAAMyB,OAAO3B,OAAO6B,IAAI7B,OAAO8B,KAAKvB,KAAKA,IAAI,CAAA,CAAA,CAAA;AAGtG,QAAMwB,UAAUtB,uBAAuBe,OAAAA;AACvC,QAAMQ,aAAavC,QAAQ,MAAMsC,QAAQE,OAAO,CAAC,EAAEC,OAAM,MAAOA,UAAUnC,OAAOoC,SAASD,MAAAA,CAAAA,GAAU;IAACH;GAAQ;AAE7G,QAAMK,eAAe5C,YACnB,CAAC6C,SAAAA;AACCd,aAASc,IAAAA;AACTnB,eAAWmB,IAAAA;EACb,GACA;IAACnB;GAAS;AAGZ,QAAMoB,eAAe9C,YACnB,OAAO+C,WAAAA;AACL,QAAI,CAACA,OAAOL,UAAU,CAACjC,IAAIuC,SAASD,OAAOL,MAAM,GAAG;AAClD;IACF;AAEA,UAAMO,gBAAgB7C,wBAAwB2C,OAAOL,MAAM;AAC3D,UAAMjB,cAAcpB,gBAAgB6C,cAAc;MAAEC,OAAO;IAAM,CAAA;AACjE,UAAM1B,cAAcpB,gBAAgB+C,MAAM;MACxCC,SAAS;QAACJ;;MACV5B;MACAiC,aAAa;IACf,CAAA;EACF,GACA;IAACjC;IAASI;GAAc;AAG1B,SACE,sBAAA,cAACb,OAAO2C,SAAO,MACb,sBAAA,cAAC3C,OAAO4C,QAAM,MACZ,sBAAA,cAAC5C,OAAO6C,OAAK,MAAElC,EAAE,qBAAA,CAAA,GACjB,sBAAA,cAACX,OAAO8C,OAAK;IAACC,SAAAA;KACZ,sBAAA,cAAC/C,OAAOgD,kBAAgB;IAACC,QAAO;QAGpC,sBAAA,cAAC/C,WAAWgD,MAAI;IAACC,UAAUnB;KACzB,sBAAA,cAAC9B,WAAWkD,OAAK;IAACC,YAAW;IAAOC,WAAAA;IAAUC,aAAa5C,EAAE,oBAAA;MAC7D,sBAAA,cAACT,WAAWsD,UAAQ;IAACH,YAAW;KAC7BzB,WAAW6B,IAAI,CAACtB,WACf,sBAAA,cAACjC,WAAWwD,MAAI;IACdC,KAAKxB,OAAOvB;IACZyC,YAAW;IACXO,OAAOzB,OAAOvB;IACdiD,OAAO1B,OAAO0B,UAAU1B,OAAOL,SAASnC,OAAOoC,SAASI,OAAOL,MAAM,IAAIR,WAAca,OAAOvB;IAC9FkD,MAAM3B,OAAO2B;IACbC,UAAU,MAAM,KAAK7B,aAAaC,MAAAA;OAGrCjB,SAASU,WAAWX,WAAW,KAAK,sBAAA,cAACf,WAAW8D,OAAK,IAAA,CAAA,CAAA,CAAA;AAKhE;",
|
|
6
|
+
"names": ["React", "useCallback", "useMemo", "useState", "useOperationInvoker", "getObjectPathFromObject", "LayoutOperation", "useLayout", "Entity", "Filter", "Obj", "Query", "useQuery", "Dialog", "useTranslation", "SearchList", "Text", "useGlobalSearch", "useGlobalSearchResults", "meta", "SearchDialog", "space", "pivotId", "pivotIdProp", "t", "id", "invokePromise", "setMatch", "layout", "active", "length", "query", "setQuery", "objects", "db", "undefined", "select", "nothing", "not", "type", "results", "allResults", "filter", "object", "getLabel", "handleSearch", "text", "handleSelect", "result", "isObject", "qualifiedPath", "UpdateDialog", "state", "Open", "subject", "positioning", "Content", "Header", "Title", "Close", "asChild", "ActionIconButton", "action", "Root", "onSearch", "Input", "classNames", "autoFocus", "placeholder", "Viewport", "map", "Item", "key", "value", "label", "icon", "onSelect", "Empty"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/app-graph-builder.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { Capability } from "@dxos/app-framework";
|
|
6
|
+
import { AppCapabilities, AppNode, getSpaceIdFromPath } from "@dxos/app-toolkit";
|
|
7
|
+
import { Operation } from "@dxos/compute";
|
|
8
|
+
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
9
|
+
import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
|
|
10
|
+
import { linkedSegment } from "@dxos/react-ui-attention";
|
|
11
|
+
import { meta } from "#meta";
|
|
12
|
+
import { SearchOperation } from "#types";
|
|
13
|
+
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
14
|
+
const extensions = yield* Effect.all([
|
|
15
|
+
GraphBuilder.createExtension({
|
|
16
|
+
id: "space-search",
|
|
17
|
+
match: NodeMatcher.whenRoot,
|
|
18
|
+
connector: Effect.fnUntraced(function* (node, get) {
|
|
19
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
20
|
+
const layoutAtom = get(yield* Capability.atom(AppCapabilities.Layout))[0];
|
|
21
|
+
const layout = layoutAtom ? get(layoutAtom) : void 0;
|
|
22
|
+
const spaceId = layout?.workspace ? getSpaceIdFromPath(layout.workspace) : void 0;
|
|
23
|
+
const space = spaceId ? client.spaces.get(spaceId) : null;
|
|
24
|
+
return [
|
|
25
|
+
AppNode.makeDeckCompanion({
|
|
26
|
+
id: linkedSegment("search"),
|
|
27
|
+
label: [
|
|
28
|
+
"search.label",
|
|
29
|
+
{
|
|
30
|
+
ns: meta.id
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
icon: "ph--magnifying-glass--regular",
|
|
34
|
+
data: space
|
|
35
|
+
})
|
|
36
|
+
];
|
|
37
|
+
})
|
|
38
|
+
}),
|
|
39
|
+
GraphBuilder.createExtension({
|
|
40
|
+
id: "root",
|
|
41
|
+
match: NodeMatcher.whenRoot,
|
|
42
|
+
actions: () => Effect.succeed([
|
|
43
|
+
{
|
|
44
|
+
id: SearchOperation.OpenSearch.meta.key,
|
|
45
|
+
data: Effect.fnUntraced(function* () {
|
|
46
|
+
yield* Operation.invoke(SearchOperation.OpenSearch);
|
|
47
|
+
return false;
|
|
48
|
+
}),
|
|
49
|
+
properties: {
|
|
50
|
+
label: [
|
|
51
|
+
"search-action.label",
|
|
52
|
+
{
|
|
53
|
+
ns: meta.id
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
icon: "ph--magnifying-glass--regular",
|
|
57
|
+
keyBinding: {
|
|
58
|
+
macos: "shift+meta+f",
|
|
59
|
+
windows: "shift+alt+f"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
])
|
|
64
|
+
})
|
|
65
|
+
]);
|
|
66
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
67
|
+
}));
|
|
68
|
+
export {
|
|
69
|
+
app_graph_builder_default as default
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=app-graph-builder-B3W3UWHV.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode, getSpaceIdFromPath } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\nimport { linkedSegment } from '@dxos/react-ui-attention';\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: '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 = layout?.workspace ? getSpaceIdFromPath(layout.workspace) : undefined;\n const space = spaceId ? client.spaces.get(spaceId) : null;\n\n return [\n AppNode.makeDeckCompanion({\n id: linkedSegment('search'),\n label: ['search.label', { ns: meta.id }],\n icon: 'ph--magnifying-glass--regular',\n data: space,\n }),\n ];\n }),\n }),\n GraphBuilder.createExtension({\n id: 'root',\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,iBAAiBC,SAASC,0BAA0B;AAC7D,SAASC,iBAAiB;AAC1B,SAASC,0BAA0B;AACnC,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,qBAAqB;AAE9B,SAASC,YAAY;AACrB,SAASC,uBAAuB;AAEhC,IAAA,4BAAeV,WAAWW,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCR,aAAaS,gBAAgB;MAC3BC,IAAI;MACJC,OAAOV,YAAYW;MACnBC,WAAkBP,kBAAW,WAAWQ,MAAMC,KAAG;AAC/C,cAAMC,SAAS,OAAOtB,WAAWqB,IAAIhB,mBAAmBkB,MAAM;AAC9D,cAAMC,aAAaH,IAAI,OAAOrB,WAAWyB,KAAKxB,gBAAgByB,MAAM,CAAA,EAAG,CAAA;AACvE,cAAMC,SAASH,aAAaH,IAAIG,UAAAA,IAAcI;AAC9C,cAAMC,UAAUF,QAAQG,YAAY3B,mBAAmBwB,OAAOG,SAAS,IAAIF;AAC3E,cAAMG,QAAQF,UAAUP,OAAOU,OAAOX,IAAIQ,OAAAA,IAAW;AAErD,eAAO;UACL3B,QAAQ+B,kBAAkB;YACxBjB,IAAIR,cAAc,QAAA;YAClB0B,OAAO;cAAC;cAAgB;gBAAEC,IAAI1B,KAAKO;cAAG;;YACtCoB,MAAM;YACNC,MAAMN;UACR,CAAA;;MAEJ,CAAA;IACF,CAAA;IACAzB,aAAaS,gBAAgB;MAC3BC,IAAI;MACJC,OAAOV,YAAYW;MACnBoB,SAAS,MACAC,eAAQ;QACb;UACEvB,IAAIN,gBAAgB8B,WAAW/B,KAAKgC;UACpCJ,MAAazB,kBAAW,aAAA;AACtB,mBAAOR,UAAUsC,OAAOhC,gBAAgB8B,UAAU;AAClD,mBAAO;UACT,CAAA;UACAG,YAAY;YACVT,OAAO;cAAC;cAAuB;gBAAEC,IAAI1B,KAAKO;cAAG;;YAC7CoB,MAAM;YACNQ,YAAY;cACVC,OAAO;cACPC,SAAS;YACX;UACF;QACF;OACD;IACL,CAAA;GACD;AAED,SAAO9C,WAAW+C,YAAY9C,gBAAgB+C,iBAAiBnC,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "AppNode", "getSpaceIdFromPath", "Operation", "ClientCapabilities", "GraphBuilder", "NodeMatcher", "linkedSegment", "meta", "SearchOperation", "makeModule", "fnUntraced", "extensions", "all", "createExtension", "id", "match", "whenRoot", "connector", "node", "get", "client", "Client", "layoutAtom", "atom", "Layout", "layout", "undefined", "spaceId", "workspace", "space", "spaces", "makeDeckCompanion", "label", "ns", "icon", "data", "actions", "succeed", "OpenSearch", "key", "invoke", "properties", "keyBinding", "macos", "windows", "contributes", "AppGraphBuilder"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/index.ts
|
|
4
|
+
import { Capability } from "@dxos/app-framework";
|
|
5
|
+
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-B3W3UWHV.mjs"));
|
|
6
|
+
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-DY624P2R.mjs"));
|
|
7
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-ER7Q4W6Y.mjs"));
|
|
8
|
+
export {
|
|
9
|
+
AppGraphBuilder,
|
|
10
|
+
OperationHandler,
|
|
11
|
+
ReactSurface
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,kBAAkBD,WAAWE,KAAK,mBAAmB,MAAM,OAAO,mCAAA,CAAA;AACxE,IAAMC,mBAAmBH,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAME,eAAeJ,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "AppGraphBuilder", "lazy", "OperationHandler", "ReactSurface"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// src/operations/index.ts
|
|
2
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
3
|
+
var SearchOperationHandlerSet = OperationHandlerSet.lazy(() => import("./open-search-ABE2Y6ZG.mjs"));
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
SearchOperationHandlerSet
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=chunk-7ASS5WTT.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const SearchOperationHandlerSet = OperationHandlerSet.lazy(() => import('./open-search'));\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,2BAA2B;AAE7B,IAAMC,4BAA4BD,oBAAoBE,KAAK,MAAM,OAAO,4BAAA,CAAA;",
|
|
6
|
+
"names": ["OperationHandlerSet", "SearchOperationHandlerSet", "lazy"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/SearchPlugin.tsx
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
4
|
+
import { AppGraphBuilder, OperationHandler, ReactSurface } from "#capabilities";
|
|
5
|
+
import { meta } from "#meta";
|
|
6
|
+
import { translations } from "#translations";
|
|
7
|
+
var SearchPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
|
|
8
|
+
activate: AppGraphBuilder
|
|
9
|
+
}), AppPlugin.addOperationHandlerModule({
|
|
10
|
+
activate: OperationHandler
|
|
11
|
+
}), AppPlugin.addSurfaceModule({
|
|
12
|
+
activate: ReactSurface
|
|
13
|
+
}), AppPlugin.addTranslationsModule({
|
|
14
|
+
translations
|
|
15
|
+
}), Plugin.make);
|
|
16
|
+
var SearchPlugin_default = SearchPlugin;
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
SearchPlugin,
|
|
20
|
+
SearchPlugin_default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-7VNJDD75.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/SearchPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { AppGraphBuilder, OperationHandler, ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\nexport const SearchPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n\nexport default SearchPlugin;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,iBAAiBC,kBAAkBC,oBAAoB;AAChE,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAEtB,IAAMC,eAAeP,OAAOQ,OAAOH,IAAAA,EAAMI,KAC9CR,UAAUS,kBAAkB;EAAEC,UAAUT;AAAgB,CAAA,GACxDD,UAAUW,0BAA0B;EAAED,UAAUR;AAAiB,CAAA,GACjEF,UAAUY,iBAAiB;EAAEF,UAAUP;AAAa,CAAA,GACpDH,UAAUa,sBAAsB;EAAER;AAAa,CAAA,GAC/CN,OAAOe,IAAI;AAGb,IAAA,uBAAeR;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "AppGraphBuilder", "OperationHandler", "ReactSurface", "meta", "translations", "SearchPlugin", "define", "pipe", "addAppGraphModule", "activate", "addOperationHandlerModule", "addSurfaceModule", "addTranslationsModule", "make"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/types/SearchOperation.ts
|
|
6
|
+
var SearchOperation_exports = {};
|
|
7
|
+
__export(SearchOperation_exports, {
|
|
8
|
+
OpenSearch: () => OpenSearch
|
|
9
|
+
});
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
11
|
+
import { Operation } from "@dxos/compute";
|
|
12
|
+
import { meta } from "#meta";
|
|
13
|
+
var SEARCH_OPERATION = `${meta.id}.operation`;
|
|
14
|
+
var OpenSearch = Operation.make({
|
|
15
|
+
meta: {
|
|
16
|
+
key: `${SEARCH_OPERATION}.open-search`,
|
|
17
|
+
name: "Open Search",
|
|
18
|
+
icon: "ph--magnifying-glass--regular"
|
|
19
|
+
},
|
|
20
|
+
input: Schema.Void,
|
|
21
|
+
output: Schema.Void
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
SearchOperation_exports
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=chunk-FIZRI3JV.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/SearchOperation.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation } from '@dxos/compute';\n\nimport { meta } from '#meta';\n\nconst SEARCH_OPERATION = `${meta.id}.operation`;\n\nexport const OpenSearch = Operation.make({\n meta: { key: `${SEARCH_OPERATION}.open-search`, name: 'Open Search', icon: 'ph--magnifying-glass--regular' },\n input: Schema.Void,\n output: Schema.Void,\n});\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;AAMA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAErB,IAAMC,mBAAmB,GAAGD,KAAKE,EAAE;AAE5B,IAAMC,aAAaJ,UAAUK,KAAK;EACvCJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAAgCK,MAAM;IAAeC,MAAM;EAAgC;EAC3GC,OAAcC;EACdC,QAAeD;AACjB,CAAA;",
|
|
6
|
+
"names": ["Schema", "Operation", "meta", "SEARCH_OPERATION", "id", "OpenSearch", "make", "key", "name", "icon", "input", "Void", "output"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { meta } from '#meta';\n\nexport const SEARCH_DIALOG = `${meta.id}.SearchDialog`;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,YAAY;AAEd,IAAMC,gBAAgB,GAAGD,KAAKE,EAAE;",
|
|
6
|
+
"names": ["meta", "SEARCH_DIALOG", "id"]
|
|
7
|
+
}
|