@dxos/plugin-search 0.7.5-main.9cb18ac → 0.7.5-main.9d2a38b

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 (53) hide show
  1. package/dist/lib/browser/app-graph-builder-4C2ZPCED.mjs +41 -0
  2. package/dist/lib/browser/app-graph-builder-4C2ZPCED.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-4L4PWJYC.mjs → chunk-B532NWHM.mjs} +3 -3
  4. package/dist/lib/browser/chunk-B532NWHM.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-GGOOQO2C.mjs +133 -0
  6. package/dist/lib/browser/chunk-GGOOQO2C.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-Z745WIBH.mjs +21 -0
  8. package/dist/lib/browser/chunk-Z745WIBH.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +67 -557
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/intent-resolver-XUWUYVFT.mjs +19 -0
  12. package/dist/lib/browser/intent-resolver-XUWUYVFT.mjs.map +7 -0
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/react-context-IIHWUFU6.mjs +18 -0
  15. package/dist/lib/browser/react-context-IIHWUFU6.mjs.map +7 -0
  16. package/dist/lib/browser/react-surface-242JU6MW.mjs +360 -0
  17. package/dist/lib/browser/react-surface-242JU6MW.mjs.map +7 -0
  18. package/dist/types/src/SearchPlugin.d.ts +1 -3
  19. package/dist/types/src/SearchPlugin.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
  21. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  22. package/dist/types/src/capabilities/index.d.ts +185 -0
  23. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  24. package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
  25. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/react-context.d.ts +8 -0
  27. package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
  28. package/dist/types/src/capabilities/react-surface.d.ts +4 -0
  29. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  30. package/dist/types/src/components/SearchDialog.d.ts.map +1 -1
  31. package/dist/types/src/index.d.ts +1 -2
  32. package/dist/types/src/index.d.ts.map +1 -1
  33. package/dist/types/src/meta.d.ts +1 -2
  34. package/dist/types/src/meta.d.ts.map +1 -1
  35. package/dist/types/src/types.d.ts +0 -2
  36. package/dist/types/src/types.d.ts.map +1 -1
  37. package/dist/types/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +20 -27
  39. package/src/SearchPlugin.tsx +40 -91
  40. package/src/capabilities/app-graph-builder.ts +36 -0
  41. package/src/capabilities/index.ts +10 -0
  42. package/src/capabilities/intent-resolver.ts +15 -0
  43. package/src/capabilities/react-context.tsx +16 -0
  44. package/src/capabilities/react-surface.tsx +30 -0
  45. package/src/components/SearchDialog.tsx +6 -8
  46. package/src/index.ts +1 -4
  47. package/src/meta.ts +1 -1
  48. package/src/search-sync.ts +1 -1
  49. package/src/search.ts +1 -1
  50. package/src/types.tsx +0 -13
  51. package/dist/lib/browser/chunk-4L4PWJYC.mjs.map +0 -7
  52. package/dist/lib/browser/meta.mjs +0 -11
  53. package/dist/lib/browser/meta.mjs.map +0 -7
@@ -5,15 +5,14 @@
5
5
  import React, { forwardRef, useCallback, useState } from 'react';
6
6
 
7
7
  import {
8
- useResolvePlugin,
9
- parseNavigationPlugin,
10
- parseGraphPlugin,
11
8
  NavigationAction,
12
9
  LayoutAction,
13
10
  type LayoutCoordinate,
14
11
  isLayoutParts,
15
12
  useIntentDispatcher,
16
13
  createIntent,
14
+ useCapability,
15
+ Capabilities,
17
16
  } from '@dxos/app-framework';
18
17
  import { type Node } from '@dxos/plugin-graph';
19
18
  import { useClient } from '@dxos/react-client';
@@ -54,14 +53,13 @@ export type SearchDialogProps = {
54
53
 
55
54
  export const SearchDialog = ({ layoutCoordinate }: SearchDialogProps) => {
56
55
  const { t } = useTranslation(SEARCH_PLUGIN);
57
- const graphPlugin = useResolvePlugin(parseGraphPlugin);
58
- const graph = graphPlugin?.provides.graph;
59
- const navigationPlugin = useResolvePlugin(parseNavigationPlugin);
60
- const providedClosed = navigationPlugin?.provides.location.closed ?? [];
56
+ const location = useCapability(Capabilities.Location);
57
+ const { graph } = useCapability(Capabilities.AppGraph);
58
+ const providedClosed = location.closed ?? [];
61
59
  const closed = (Array.isArray(providedClosed) ? providedClosed : [providedClosed])
62
60
  .map((id) => graph?.findNode(id))
63
61
  .filter(Boolean);
64
- const active = navigationPlugin?.provides.location.active;
62
+ const active = location.active;
65
63
  const [queryString, setQueryString] = useState('');
66
64
  const client = useClient();
67
65
  const dangerouslyLoadAllObjects = useQuery(client.spaces, Filter.all());
package/src/index.ts CHANGED
@@ -2,11 +2,8 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { SearchPlugin } from './SearchPlugin';
6
-
7
- export default SearchPlugin;
8
-
9
5
  export * from './context';
6
+ export * from './meta';
10
7
  export * from './search-sync';
11
8
 
12
9
  export * from './SearchPlugin';
package/src/meta.ts CHANGED
@@ -7,7 +7,7 @@ import { type PluginMeta } from '@dxos/app-framework';
7
7
  export const SEARCH_PLUGIN = 'dxos.org/plugin/search';
8
8
  export const SEARCH_RESULT = `${SEARCH_PLUGIN}/result`;
9
9
 
10
- export default {
10
+ export const meta = {
11
11
  id: SEARCH_PLUGIN,
12
12
  name: 'Search',
13
13
  description: 'Search ECHO spaces for content.',
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { AST, type S } from '@dxos/echo-schema';
6
6
  import { getSchema } from '@dxos/live-object';
7
- import { TextType } from '@dxos/plugin-markdown/types';
7
+ import { TextType } from '@dxos/schema';
8
8
 
9
9
  export const queryStringToMatch = (queryString?: string): RegExp | undefined => {
10
10
  const trimmed = queryString?.trim();
package/src/search.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  import { yieldOrContinue } from 'main-thread-scheduling';
6
6
  import { useEffect, useState } from 'react';
7
7
 
8
- import { TextType } from '@dxos/plugin-markdown/types';
8
+ import { TextType } from '@dxos/schema';
9
9
 
10
10
  // TODO(thure): Deprecate search-sync, move still-relevant utilities elsewhere (here, probably).
11
11
  import { mapObjectToTextFields, queryStringToMatch } from './search-sync';
package/src/types.tsx CHANGED
@@ -2,13 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import type {
6
- GraphBuilderProvides,
7
- IntentResolverProvides,
8
- MetadataRecordsProvides,
9
- SurfaceProvides,
10
- TranslationsProvides,
11
- } from '@dxos/app-framework';
12
5
  import { S } from '@dxos/echo-schema';
13
6
 
14
7
  import { SEARCH_PLUGIN } from './meta';
@@ -21,9 +14,3 @@ export namespace SearchAction {
21
14
  output: S.Void,
22
15
  }) {}
23
16
  }
24
-
25
- export type SearchPluginProvides = SurfaceProvides &
26
- IntentResolverProvides &
27
- GraphBuilderProvides &
28
- MetadataRecordsProvides &
29
- TranslationsProvides;
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SEARCH_PLUGIN = 'dxos.org/plugin/search';\nexport const SEARCH_RESULT = `${SEARCH_PLUGIN}/result`;\n\nexport default {\n id: SEARCH_PLUGIN,\n name: 'Search',\n description: 'Search ECHO spaces for content.',\n icon: 'ph--magnifying-glass--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-search',\n tags: ['experimental'],\n} satisfies PluginMeta;\n"],
5
- "mappings": ";AAMO,IAAMA,gBAAgB;AACtB,IAAMC,gBAAgB,GAAGD,aAAAA;AAEhC,IAAA,eAAe;EACbE,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;",
6
- "names": ["SEARCH_PLUGIN", "SEARCH_RESULT", "id", "name", "description", "icon", "source", "tags"]
7
- }
@@ -1,11 +0,0 @@
1
- import {
2
- SEARCH_PLUGIN,
3
- SEARCH_RESULT,
4
- meta_default
5
- } from "./chunk-4L4PWJYC.mjs";
6
- export {
7
- SEARCH_PLUGIN,
8
- SEARCH_RESULT,
9
- meta_default as default
10
- };
11
- //# sourceMappingURL=meta.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }