@dxos/plugin-search 0.8.4-main.8360d9e660 → 0.8.4-main.8baae0fced

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.
Files changed (180) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/neutral/SearchArticle-CQMZ46ZS.mjs +51 -0
  3. package/dist/lib/neutral/SearchArticle-CQMZ46ZS.mjs.map +7 -0
  4. package/dist/lib/neutral/SearchDialog-UM27KP5U.mjs +74 -0
  5. package/dist/lib/neutral/SearchDialog-UM27KP5U.mjs.map +7 -0
  6. package/dist/lib/neutral/SearchPlugin.mjs +10 -0
  7. package/dist/lib/neutral/SearchPlugin.mjs.map +7 -0
  8. package/dist/lib/{browser/app-graph-builder-FHVM5QV7.mjs → neutral/app-graph-builder-B3W3UWHV.mjs} +22 -29
  9. package/dist/lib/neutral/app-graph-builder-B3W3UWHV.mjs.map +7 -0
  10. package/dist/lib/neutral/capabilities/index.mjs +13 -0
  11. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  12. package/dist/lib/neutral/chunk-7VNJDD75.mjs +22 -0
  13. package/dist/lib/neutral/chunk-7VNJDD75.mjs.map +7 -0
  14. package/dist/lib/neutral/chunk-EBXWOGAD.mjs +26 -0
  15. package/dist/lib/neutral/chunk-EBXWOGAD.mjs.map +7 -0
  16. package/dist/lib/neutral/chunk-IXRPYAX5.mjs +8 -0
  17. package/dist/lib/neutral/chunk-IXRPYAX5.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  19. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  20. package/dist/lib/{browser/chunk-PZ67KFRU.mjs → neutral/chunk-LND2U5W4.mjs} +2 -1
  21. package/dist/lib/neutral/chunk-LND2U5W4.mjs.map +7 -0
  22. package/dist/lib/{browser/chunk-NB4JZIOE.mjs → neutral/chunk-LUDADYMK.mjs} +9 -14
  23. package/dist/lib/neutral/chunk-LUDADYMK.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-NAKPT2JM.mjs +8 -0
  25. package/dist/lib/neutral/chunk-NAKPT2JM.mjs.map +7 -0
  26. package/dist/lib/neutral/components/index.mjs +97 -0
  27. package/dist/lib/neutral/components/index.mjs.map +7 -0
  28. package/dist/lib/neutral/containers/index.mjs +11 -0
  29. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  30. package/dist/lib/neutral/hooks/index.mjs +30 -0
  31. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  32. package/dist/lib/neutral/index.mjs +40 -0
  33. package/dist/lib/neutral/index.mjs.map +7 -0
  34. package/dist/lib/neutral/meta.json +1 -0
  35. package/dist/lib/neutral/meta.mjs +10 -0
  36. package/dist/lib/neutral/meta.mjs.map +7 -0
  37. package/dist/lib/neutral/open-search-DY6ZGVKR.mjs +23 -0
  38. package/dist/lib/neutral/open-search-DY6ZGVKR.mjs.map +7 -0
  39. package/dist/lib/neutral/operation-handler-DY624P2R.mjs +13 -0
  40. package/dist/lib/neutral/operation-handler-DY624P2R.mjs.map +7 -0
  41. package/dist/lib/neutral/operations/index.mjs +8 -0
  42. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  43. package/dist/lib/neutral/plugin.mjs +16 -0
  44. package/dist/lib/neutral/plugin.mjs.map +7 -0
  45. package/dist/lib/{browser/react-surface-EZX43GMG.mjs → neutral/react-surface-ER7Q4W6Y.mjs} +24 -23
  46. package/dist/lib/neutral/react-surface-ER7Q4W6Y.mjs.map +7 -0
  47. package/dist/lib/neutral/testing.mjs +8 -0
  48. package/dist/lib/neutral/testing.mjs.map +7 -0
  49. package/dist/lib/neutral/translations.mjs +25 -0
  50. package/dist/lib/neutral/translations.mjs.map +7 -0
  51. package/dist/lib/neutral/types/index.mjs +8 -0
  52. package/dist/lib/neutral/types/index.mjs.map +7 -0
  53. package/dist/types/src/SearchPlugin.d.ts +1 -0
  54. package/dist/types/src/SearchPlugin.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  56. package/dist/types/src/capabilities/index.d.ts +5 -3
  57. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  59. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  60. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  61. package/dist/types/src/components/SearchResultStack/SearchResultStack.d.ts +9 -0
  62. package/dist/types/src/components/SearchResultStack/SearchResultStack.d.ts.map +1 -0
  63. package/dist/types/src/components/SearchResultStack/index.d.ts +2 -0
  64. package/dist/types/src/components/SearchResultStack/index.d.ts.map +1 -0
  65. package/dist/types/src/components/index.d.ts +1 -0
  66. package/dist/types/src/components/index.d.ts.map +1 -1
  67. package/dist/types/src/containers/SearchArticle/SearchArticle.d.ts +4 -0
  68. package/dist/types/src/containers/SearchArticle/SearchArticle.d.ts.map +1 -0
  69. package/dist/types/src/containers/SearchArticle/SearchArticle.stories.d.ts +14 -0
  70. package/dist/types/src/containers/SearchArticle/SearchArticle.stories.d.ts.map +1 -0
  71. package/dist/types/src/containers/SearchArticle/index.d.ts +2 -0
  72. package/dist/types/src/containers/SearchArticle/index.d.ts.map +1 -0
  73. package/dist/types/src/containers/SearchDialog/SearchDialog.d.ts +5 -4
  74. package/dist/types/src/containers/SearchDialog/SearchDialog.d.ts.map +1 -1
  75. package/dist/types/src/containers/SearchDialog/SearchDialog.stories.d.ts +16 -0
  76. package/dist/types/src/containers/SearchDialog/SearchDialog.stories.d.ts.map +1 -0
  77. package/dist/types/src/containers/SearchDialog/index.d.ts +0 -1
  78. package/dist/types/src/containers/SearchDialog/index.d.ts.map +1 -1
  79. package/dist/types/src/containers/index.d.ts +1 -2
  80. package/dist/types/src/containers/index.d.ts.map +1 -1
  81. package/dist/types/src/hooks/sync.d.ts +2 -2
  82. package/dist/types/src/hooks/sync.d.ts.map +1 -1
  83. package/dist/types/src/hooks/useGlobalSearch.d.ts +2 -2
  84. package/dist/types/src/hooks/useGlobalSearch.d.ts.map +1 -1
  85. package/dist/types/src/hooks/useSearchResults.d.ts.map +1 -1
  86. package/dist/types/src/hooks/useWebSearch.d.ts +1 -1
  87. package/dist/types/src/hooks/useWebSearch.d.ts.map +1 -1
  88. package/dist/types/src/index.d.ts +0 -1
  89. package/dist/types/src/index.d.ts.map +1 -1
  90. package/dist/types/src/meta.d.ts.map +1 -1
  91. package/dist/types/src/operations/index.d.ts +3 -0
  92. package/dist/types/src/operations/index.d.ts.map +1 -0
  93. package/dist/types/src/operations/open-search.d.ts +5 -0
  94. package/dist/types/src/operations/open-search.d.ts.map +1 -0
  95. package/dist/types/src/plugin.d.ts +4 -0
  96. package/dist/types/src/plugin.d.ts.map +1 -0
  97. package/dist/types/src/search/exa.d.ts.map +1 -1
  98. package/dist/types/src/testing.d.ts +2 -0
  99. package/dist/types/src/testing.d.ts.map +1 -0
  100. package/dist/types/src/translations.d.ts +15 -10
  101. package/dist/types/src/translations.d.ts.map +1 -1
  102. package/dist/types/src/types/SearchOperation.d.ts +3 -0
  103. package/dist/types/src/types/SearchOperation.d.ts.map +1 -0
  104. package/dist/types/src/types/index.d.ts +1 -1
  105. package/dist/types/src/types/index.d.ts.map +1 -1
  106. package/dist/types/src/types/search.d.ts +1 -16
  107. package/dist/types/src/types/search.d.ts.map +1 -1
  108. package/dist/types/tsconfig.tsbuildinfo +1 -1
  109. package/package.json +104 -42
  110. package/src/SearchPlugin.tsx +6 -22
  111. package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +13 -17
  112. package/src/capabilities/index.ts +9 -3
  113. package/src/capabilities/operation-handler.ts +16 -0
  114. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +24 -14
  115. package/src/components/SearchResultStack/SearchResultStack.tsx +118 -0
  116. package/src/components/SearchResultStack/index.ts +5 -0
  117. package/src/components/index.ts +2 -0
  118. package/src/constants.ts +1 -1
  119. package/src/containers/SearchArticle/SearchArticle.stories.tsx +79 -0
  120. package/src/containers/SearchArticle/SearchArticle.tsx +60 -0
  121. package/src/containers/SearchArticle/index.ts +5 -0
  122. package/src/containers/SearchDialog/SearchDialog.stories.tsx +108 -0
  123. package/src/containers/SearchDialog/SearchDialog.tsx +67 -94
  124. package/src/containers/SearchDialog/index.ts +0 -1
  125. package/src/containers/index.ts +1 -3
  126. package/src/hooks/sync.test.ts +4 -4
  127. package/src/hooks/sync.ts +3 -3
  128. package/src/hooks/useGlobalSearch.tsx +3 -3
  129. package/src/hooks/useWebSearch.ts +4 -4
  130. package/src/index.ts +2 -2
  131. package/src/meta.ts +1 -0
  132. package/src/operations/index.ts +7 -0
  133. package/src/operations/open-search.ts +24 -0
  134. package/src/plugin.ts +11 -0
  135. package/src/search/exa.ts +1 -1
  136. package/src/testing.ts +7 -0
  137. package/src/translations.ts +10 -9
  138. package/src/types/SearchOperation.ts +19 -0
  139. package/src/types/index.ts +2 -1
  140. package/src/types/search.ts +1 -19
  141. package/dist/lib/browser/SearchDialog-KJL6C2OF.mjs +0 -108
  142. package/dist/lib/browser/SearchDialog-KJL6C2OF.mjs.map +0 -7
  143. package/dist/lib/browser/SearchMain-VOEEHUCW.mjs +0 -97
  144. package/dist/lib/browser/SearchMain-VOEEHUCW.mjs.map +0 -7
  145. package/dist/lib/browser/app-graph-builder-FHVM5QV7.mjs.map +0 -7
  146. package/dist/lib/browser/chunk-I3633KKK.mjs +0 -26
  147. package/dist/lib/browser/chunk-I3633KKK.mjs.map +0 -7
  148. package/dist/lib/browser/chunk-NB4JZIOE.mjs.map +0 -7
  149. package/dist/lib/browser/chunk-PZ67KFRU.mjs.map +0 -7
  150. package/dist/lib/browser/index.mjs +0 -105
  151. package/dist/lib/browser/index.mjs.map +0 -7
  152. package/dist/lib/browser/meta.json +0 -1
  153. package/dist/lib/browser/operation-resolver-H4X6BNWR.mjs +0 -26
  154. package/dist/lib/browser/operation-resolver-H4X6BNWR.mjs.map +0 -7
  155. package/dist/lib/browser/react-surface-EZX43GMG.mjs.map +0 -7
  156. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  157. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  158. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  159. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  160. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  161. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  162. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  163. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  164. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  165. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  166. package/dist/types/src/containers/SearchMain/SearchMain.d.ts +0 -6
  167. package/dist/types/src/containers/SearchMain/SearchMain.d.ts.map +0 -1
  168. package/dist/types/src/containers/SearchMain/index.d.ts +0 -3
  169. package/dist/types/src/containers/SearchMain/index.d.ts.map +0 -1
  170. package/dist/types/src/types/action.d.ts +0 -16
  171. package/dist/types/src/types/action.d.ts.map +0 -1
  172. package/src/capabilities/app-graph-builder/index.ts +0 -7
  173. package/src/capabilities/operation-resolver/index.ts +0 -7
  174. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -24
  175. package/src/capabilities/react-surface/index.ts +0 -7
  176. package/src/containers/SearchMain/SearchMain.tsx +0 -100
  177. package/src/containers/SearchMain/index.ts +0 -7
  178. package/src/types/action.tsx +0 -18
  179. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  180. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
package/LICENSE CHANGED
@@ -1,8 +1,105 @@
1
- MIT License
2
- Copyright (c) 2022 DXOS
1
+ # Functional Source License, Version 1.1, ALv2 Future License
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ ## Abbreviation
5
4
 
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ FSL-1.1-Apache-2.0
7
6
 
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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.
@@ -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,74 @@
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.CloseIconButton, null))), /* @__PURE__ */ React.createElement(SearchList.Root, {
55
+ onSearch: handleSearch
56
+ }, /* @__PURE__ */ React.createElement(SearchList.Input, {
57
+ classNames: "px-0",
58
+ autoFocus: true,
59
+ placeholder: t("search.placeholder")
60
+ }), /* @__PURE__ */ React.createElement(SearchList.Viewport, {
61
+ classNames: "max-h-[24rem]"
62
+ }, allResults.map((result) => /* @__PURE__ */ React.createElement(SearchList.Item, {
63
+ key: result.id,
64
+ classNames: "flex gap-2 items-center",
65
+ value: result.id,
66
+ label: result.label ?? (result.object ? Entity.getLabel(result.object) : void 0) ?? result.id,
67
+ icon: result.icon,
68
+ onSelect: () => void handleSelect(result)
69
+ })), query && allResults.length === 0 && /* @__PURE__ */ React.createElement(SearchList.Empty, null))));
70
+ };
71
+ export {
72
+ SearchDialog as default
73
+ };
74
+ //# sourceMappingURL=SearchDialog-UM27KP5U.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.CloseIconButton />\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,iBAAe,IAAA,CAAA,CAAA,GAG3B,sBAAA,cAAC9C,WAAW+C,MAAI;IAACC,UAAUlB;KACzB,sBAAA,cAAC9B,WAAWiD,OAAK;IAACC,YAAW;IAAOC,WAAAA;IAAUC,aAAa3C,EAAE,oBAAA;MAC7D,sBAAA,cAACT,WAAWqD,UAAQ;IAACH,YAAW;KAC7BxB,WAAW4B,IAAI,CAACrB,WACf,sBAAA,cAACjC,WAAWuD,MAAI;IACdC,KAAKvB,OAAOvB;IACZwC,YAAW;IACXO,OAAOxB,OAAOvB;IACdgD,OAAOzB,OAAOyB,UAAUzB,OAAOL,SAASnC,OAAOoC,SAASI,OAAOL,MAAM,IAAIR,WAAca,OAAOvB;IAC9FiD,MAAM1B,OAAO0B;IACbC,UAAU,MAAM,KAAK5B,aAAaC,MAAAA;OAGrCjB,SAASU,WAAWX,WAAW,KAAK,sBAAA,cAACf,WAAW6D,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", "CloseIconButton", "Root", "onSearch", "Input", "classNames", "autoFocus", "placeholder", "Viewport", "map", "Item", "key", "value", "label", "icon", "onSelect", "Empty"]
7
+ }
@@ -0,0 +1,10 @@
1
+ import {
2
+ SearchPlugin,
3
+ SearchPlugin_default
4
+ } from "./chunk-7VNJDD75.mjs";
5
+ import "./chunk-J5LGTIGS.mjs";
6
+ export {
7
+ SearchPlugin,
8
+ SearchPlugin_default as default
9
+ };
10
+ //# sourceMappingURL=SearchPlugin.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,22 +1,19 @@
1
- import {
2
- SearchOperation
3
- } from "./chunk-I3633KKK.mjs";
4
- import {
5
- meta
6
- } from "./chunk-PZ67KFRU.mjs";
1
+ import "./chunk-J5LGTIGS.mjs";
7
2
 
8
- // src/capabilities/app-graph-builder/app-graph-builder.ts
3
+ // src/capabilities/app-graph-builder.ts
9
4
  import * as Effect from "effect/Effect";
10
5
  import { Capability } from "@dxos/app-framework";
11
- import { AppCapabilities, COMPANION_PREFIX, getSpaceIdFromPath } from "@dxos/app-toolkit";
12
- import { Operation } from "@dxos/operation";
6
+ import { AppCapabilities, AppNode, getSpaceIdFromPath } from "@dxos/app-toolkit";
7
+ import { Operation } from "@dxos/compute";
13
8
  import { ClientCapabilities } from "@dxos/plugin-client";
14
- import { DECK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
15
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";
16
13
  var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
17
14
  const extensions = yield* Effect.all([
18
15
  GraphBuilder.createExtension({
19
- id: `${meta.id}.space-search`,
16
+ id: "space-search",
20
17
  match: NodeMatcher.whenRoot,
21
18
  connector: Effect.fnUntraced(function* (node, get) {
22
19
  const client = yield* Capability.get(ClientCapabilities.Client);
@@ -25,26 +22,22 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
25
22
  const spaceId = layout?.workspace ? getSpaceIdFromPath(layout.workspace) : void 0;
26
23
  const space = spaceId ? client.spaces.get(spaceId) : null;
27
24
  return [
28
- {
29
- id: `${COMPANION_PREFIX}search`,
30
- type: DECK_COMPANION_TYPE,
31
- data: space,
32
- properties: {
33
- label: [
34
- "search label",
35
- {
36
- ns: meta.id
37
- }
38
- ],
39
- icon: "ph--magnifying-glass--regular",
40
- disposition: "hidden"
41
- }
42
- }
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
+ })
43
36
  ];
44
37
  })
45
38
  }),
46
39
  GraphBuilder.createExtension({
47
- id: meta.id,
40
+ id: "root",
48
41
  match: NodeMatcher.whenRoot,
49
42
  actions: () => Effect.succeed([
50
43
  {
@@ -55,7 +48,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
55
48
  }),
56
49
  properties: {
57
50
  label: [
58
- "search action label",
51
+ "search-action.label",
59
52
  {
60
53
  ns: meta.id
61
54
  }
@@ -75,4 +68,4 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
75
68
  export {
76
69
  app_graph_builder_default as default
77
70
  };
78
- //# sourceMappingURL=app-graph-builder-FHVM5QV7.mjs.map
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,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,26 @@
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
+ },
19
+ input: Schema.Void,
20
+ output: Schema.Void
21
+ });
22
+
23
+ export {
24
+ SearchOperation_exports
25
+ };
26
+ //# sourceMappingURL=chunk-EBXWOGAD.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' },\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;EAAc;EACpEC,OAAcC;EACdC,QAAeD;AACjB,CAAA;",
6
+ "names": ["Schema", "Operation", "meta", "SEARCH_OPERATION", "id", "OpenSearch", "make", "key", "name", "input", "Void", "output"]
7
+ }
@@ -0,0 +1,8 @@
1
+ // src/operations/index.ts
2
+ import { OperationHandlerSet } from "@dxos/compute";
3
+ var SearchOperationHandlerSet = OperationHandlerSet.lazy(() => import("./open-search-DY6ZGVKR.mjs"));
4
+
5
+ export {
6
+ SearchOperationHandlerSet
7
+ };
8
+ //# sourceMappingURL=chunk-IXRPYAX5.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,10 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
10
+ //# sourceMappingURL=chunk-J5LGTIGS.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -3,6 +3,7 @@ import { trim } from "@dxos/util";
3
3
  var meta = {
4
4
  id: "org.dxos.plugin.search",
5
5
  name: "Search",
6
+ author: "DXOS",
6
7
  description: trim`
7
8
  Full-text search engine for finding content across all spaces and object types.
8
9
  Quickly locate documents, tables, and other objects with instant results and relevance ranking.
@@ -19,4 +20,4 @@ export {
19
20
  meta,
20
21
  SEARCH_RESULT
21
22
  };
22
- //# sourceMappingURL=chunk-PZ67KFRU.mjs.map
23
+ //# sourceMappingURL=chunk-LND2U5W4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.search',\n name: 'Search',\n author: 'DXOS',\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,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,aAAaL;;;;EAIbM,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;AAEO,IAAMC,gBAAgB,GAAGR,KAAKC,EAAE;",
6
+ "names": ["trim", "meta", "id", "name", "author", "description", "icon", "source", "tags", "SEARCH_RESULT"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  // src/hooks/sync.ts
2
2
  import * as SchemaAST from "effect/SchemaAST";
3
- import { Obj } from "@dxos/echo";
3
+ import { Entity, Obj } from "@dxos/echo";
4
4
  import { Text } from "@dxos/schema";
5
5
  var queryStringToMatch = (queryString) => {
6
6
  const trimmed = queryString?.trim();
@@ -35,7 +35,7 @@ var filterObjectsSync = (objects, match) => {
35
35
  const label = Obj.getLabel(object);
36
36
  results.push({
37
37
  id: object.id,
38
- type: getIcon(Obj.getSchema(object)),
38
+ type: getIcon(Entity.getSchema(object)),
39
39
  label,
40
40
  match,
41
41
  // TODO(burdon): Truncate.
@@ -84,8 +84,8 @@ var mapObjectToTextFields = (object) => {
84
84
  // src/hooks/useGlobalSearch.tsx
85
85
  import React, { createContext, useCallback, useContext, useState } from "react";
86
86
  import { raise } from "@dxos/debug";
87
- import { GlobalFilterProvider } from "@dxos/react-ui-searchlist";
88
- import { useGlobalFilteredObjects, GlobalFilterProvider as GlobalFilterProvider2 } from "@dxos/react-ui-searchlist";
87
+ import { GlobalFilterProvider } from "@dxos/react-ui-search";
88
+ import { useGlobalFilteredObjects, GlobalFilterProvider as GlobalFilterProvider2 } from "@dxos/react-ui-search";
89
89
  var SearchContext = /* @__PURE__ */ createContext({});
90
90
  var SearchContextProvider = ({ children }) => {
91
91
  const [match, setMatch] = useState();
@@ -166,7 +166,7 @@ var useSearchResults = (queryString, objects, delay = 400) => {
166
166
  // src/hooks/useWebSearch.ts
167
167
  import { useCallback as useCallback2, useState as useState3 } from "react";
168
168
  import { EXA_API_KEY } from "@dxos/ai/testing";
169
- import { Obj as Obj3 } from "@dxos/echo";
169
+ import { Entity as Entity2 } from "@dxos/echo";
170
170
  import { log } from "@dxos/log";
171
171
  import { getIconAnnotation } from "@dxos/schema";
172
172
  import { TestSchema } from "@dxos/schema/testing";
@@ -176,8 +176,8 @@ import * as Option from "effect/Option";
176
176
  import * as Schema from "effect/Schema";
177
177
  import * as SchemaAST2 from "effect/SchemaAST";
178
178
  import { Key, Obj as Obj2 } from "@dxos/echo";
179
- import { ReferenceAnnotationId } from "@dxos/echo/internal";
180
179
  import { isEncodedReference } from "@dxos/echo-protocol";
180
+ import { ReferenceAnnotationId } from "@dxos/echo/internal";
181
181
  import { mapAst } from "@dxos/effect";
182
182
  import { deepMapValues, trim } from "@dxos/util";
183
183
  var search = async (options) => {
@@ -215,12 +215,7 @@ var useWebSearch = ({ query, context }) => {
215
215
  log.info("Running web search", {
216
216
  query,
217
217
  context
218
- }, {
219
- F: __dxlog_file,
220
- L: 38,
221
- S: void 0,
222
- C: (f, a) => f(...a)
223
- });
218
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 19, S: void 0 });
224
219
  const results2 = await search({
225
220
  query,
226
221
  context,
@@ -232,7 +227,7 @@ var useWebSearch = ({ query, context }) => {
232
227
  exaApiKey: EXA_API_KEY
233
228
  });
234
229
  const mappedResults = results2.data.map((result) => {
235
- const schema = Obj3.getSchema(result);
230
+ const schema = Entity2.getSchema(result);
236
231
  return {
237
232
  id: result.id,
238
233
  label: getStringProperty(result, [
@@ -279,4 +274,4 @@ export {
279
274
  useSearchResults,
280
275
  useWebSearch
281
276
  };
282
- //# sourceMappingURL=chunk-NB4JZIOE.mjs.map
277
+ //# sourceMappingURL=chunk-LUDADYMK.mjs.map