@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.
- package/dist/lib/browser/app-graph-builder-4C2ZPCED.mjs +41 -0
- package/dist/lib/browser/app-graph-builder-4C2ZPCED.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4L4PWJYC.mjs → chunk-B532NWHM.mjs} +3 -3
- package/dist/lib/browser/chunk-B532NWHM.mjs.map +7 -0
- package/dist/lib/browser/chunk-GGOOQO2C.mjs +133 -0
- package/dist/lib/browser/chunk-GGOOQO2C.mjs.map +7 -0
- package/dist/lib/browser/chunk-Z745WIBH.mjs +21 -0
- package/dist/lib/browser/chunk-Z745WIBH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +67 -557
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-XUWUYVFT.mjs +19 -0
- package/dist/lib/browser/intent-resolver-XUWUYVFT.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-context-IIHWUFU6.mjs +18 -0
- package/dist/lib/browser/react-context-IIHWUFU6.mjs.map +7 -0
- package/dist/lib/browser/react-surface-242JU6MW.mjs +360 -0
- package/dist/lib/browser/react-surface-242JU6MW.mjs.map +7 -0
- package/dist/types/src/SearchPlugin.d.ts +1 -3
- package/dist/types/src/SearchPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +185 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts +8 -0
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/SearchDialog.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +0 -2
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -27
- package/src/SearchPlugin.tsx +40 -91
- package/src/capabilities/app-graph-builder.ts +36 -0
- package/src/capabilities/index.ts +10 -0
- package/src/capabilities/intent-resolver.ts +15 -0
- package/src/capabilities/react-context.tsx +16 -0
- package/src/capabilities/react-surface.tsx +30 -0
- package/src/components/SearchDialog.tsx +6 -8
- package/src/index.ts +1 -4
- package/src/meta.ts +1 -1
- package/src/search-sync.ts +1 -1
- package/src/search.ts +1 -1
- package/src/types.tsx +0 -13
- package/dist/lib/browser/chunk-4L4PWJYC.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -11
- 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
|
|
58
|
-
const graph =
|
|
59
|
-
const
|
|
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 =
|
|
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
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
|
|
10
|
+
export const meta = {
|
|
11
11
|
id: SEARCH_PLUGIN,
|
|
12
12
|
name: 'Search',
|
|
13
13
|
description: 'Search ECHO spaces for content.',
|
package/src/search-sync.ts
CHANGED
|
@@ -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/
|
|
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/
|
|
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
|
-
}
|