@dxos/plugin-explorer 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6

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 (98) hide show
  1. package/dist/lib/browser/{chunk-YNQF4CPY.mjs → chunk-LSUP47BZ.mjs} +2 -2
  2. package/dist/lib/browser/{chunk-YNQF4CPY.mjs.map → chunk-LSUP47BZ.mjs.map} +1 -1
  3. package/dist/lib/browser/index.mjs +11331 -57
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/meta.mjs +1 -1
  7. package/dist/lib/browser/types/index.mjs +64 -4
  8. package/dist/lib/browser/types/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/{chunk-DK77RB6M.mjs → chunk-EN3JZNEY.mjs} +2 -2
  10. package/dist/lib/node-esm/{chunk-DK77RB6M.mjs.map → chunk-EN3JZNEY.mjs.map} +1 -1
  11. package/dist/lib/node-esm/index.mjs +11331 -57
  12. package/dist/lib/node-esm/index.mjs.map +4 -4
  13. package/dist/lib/node-esm/meta.json +1 -1
  14. package/dist/lib/node-esm/meta.mjs +1 -1
  15. package/dist/lib/node-esm/types/index.mjs +64 -4
  16. package/dist/lib/node-esm/types/index.mjs.map +4 -4
  17. package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
  18. package/dist/types/src/capabilities/index.d.ts +2 -1
  19. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  21. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  22. package/dist/types/src/components/Graph/D3ForceGraph.d.ts +10 -5
  23. package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -1
  24. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +8 -2
  25. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
  26. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +1 -1
  27. package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
  28. package/dist/types/src/components/Tree/types/tree.d.ts +3 -3
  29. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
  30. package/dist/types/src/components/index.d.ts +0 -2
  31. package/dist/types/src/components/index.d.ts.map +1 -1
  32. package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts +6 -0
  33. package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts.map +1 -0
  34. package/dist/types/src/containers/ExplorerContainer/index.d.ts +3 -0
  35. package/dist/types/src/containers/ExplorerContainer/index.d.ts.map +1 -0
  36. package/dist/types/src/containers/index.d.ts +3 -0
  37. package/dist/types/src/containers/index.d.ts.map +1 -0
  38. package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
  39. package/dist/types/src/translations.d.ts +28 -26
  40. package/dist/types/src/translations.d.ts.map +1 -1
  41. package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
  42. package/dist/types/src/types/Graph.d.ts +3 -10
  43. package/dist/types/src/types/Graph.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +46 -37
  46. package/src/ExplorerPlugin.tsx +29 -16
  47. package/src/capabilities/index.ts +3 -1
  48. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +9 -8
  49. package/src/components/Chart/Chart.stories.tsx +2 -2
  50. package/src/components/Globe/Globe.stories.tsx +2 -2
  51. package/src/components/Graph/D3ForceGraph.stories.tsx +13 -13
  52. package/src/components/Graph/D3ForceGraph.tsx +82 -74
  53. package/src/components/Graph/ForceGraph.stories.tsx +13 -13
  54. package/src/components/Graph/testing.ts +2 -2
  55. package/src/components/Tree/Tree.stories.tsx +5 -3
  56. package/src/components/Tree/types/tree.ts +9 -9
  57. package/src/components/index.ts +0 -4
  58. package/src/containers/ExplorerContainer/ExplorerContainer.tsx +53 -0
  59. package/src/containers/ExplorerContainer/index.ts +7 -0
  60. package/src/containers/index.ts +7 -0
  61. package/src/hooks/useGraphModel.ts +18 -13
  62. package/src/meta.ts +1 -1
  63. package/src/translations.ts +13 -12
  64. package/src/types/ExplorerAction.ts +0 -1
  65. package/src/types/Graph.ts +10 -23
  66. package/src/typings.d.ts +8 -0
  67. package/dist/lib/browser/ExplorerContainer-BFAWRIAJ.mjs +0 -45
  68. package/dist/lib/browser/ExplorerContainer-BFAWRIAJ.mjs.map +0 -7
  69. package/dist/lib/browser/chunk-AGZAGILW.mjs +0 -11076
  70. package/dist/lib/browser/chunk-AGZAGILW.mjs.map +0 -7
  71. package/dist/lib/browser/chunk-BZMTFAP3.mjs +0 -34
  72. package/dist/lib/browser/chunk-BZMTFAP3.mjs.map +0 -7
  73. package/dist/lib/browser/chunk-HIFLWHXR.mjs +0 -83
  74. package/dist/lib/browser/chunk-HIFLWHXR.mjs.map +0 -7
  75. package/dist/lib/browser/chunk-MGBT2ZFU.mjs +0 -177
  76. package/dist/lib/browser/chunk-MGBT2ZFU.mjs.map +0 -7
  77. package/dist/lib/browser/react-surface-RWVHQL3J.mjs +0 -35
  78. package/dist/lib/browser/react-surface-RWVHQL3J.mjs.map +0 -7
  79. package/dist/lib/node-esm/ExplorerContainer-YQ2KKBVS.mjs +0 -46
  80. package/dist/lib/node-esm/ExplorerContainer-YQ2KKBVS.mjs.map +0 -7
  81. package/dist/lib/node-esm/chunk-3OE6TBJI.mjs +0 -84
  82. package/dist/lib/node-esm/chunk-3OE6TBJI.mjs.map +0 -7
  83. package/dist/lib/node-esm/chunk-IPIGIQHX.mjs +0 -36
  84. package/dist/lib/node-esm/chunk-IPIGIQHX.mjs.map +0 -7
  85. package/dist/lib/node-esm/chunk-QLMTN2XI.mjs +0 -11078
  86. package/dist/lib/node-esm/chunk-QLMTN2XI.mjs.map +0 -7
  87. package/dist/lib/node-esm/chunk-YWJBDETV.mjs +0 -179
  88. package/dist/lib/node-esm/chunk-YWJBDETV.mjs.map +0 -7
  89. package/dist/lib/node-esm/react-surface-3REUS7KW.mjs +0 -36
  90. package/dist/lib/node-esm/react-surface-3REUS7KW.mjs.map +0 -7
  91. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  92. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  93. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  94. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  95. package/dist/types/src/components/ExplorerContainer.d.ts +0 -7
  96. package/dist/types/src/components/ExplorerContainer.d.ts.map +0 -1
  97. package/src/capabilities/react-surface/index.ts +0 -7
  98. package/src/components/ExplorerContainer.tsx +0 -52
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Key, Obj, Type } from '@dxos/echo';
7
+ import { Key, Obj, Ref, Type } from '@dxos/echo';
8
8
  import { TestSchema } from '@dxos/echo/testing';
9
9
  import { invariant } from '@dxos/invariant';
10
10
 
@@ -14,7 +14,7 @@ export const TreeNodeType = Schema.Struct({
14
14
  id: Key.ObjectId,
15
15
  children: Schema.mutable(Schema.Array(Key.ObjectId)),
16
16
  data: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.Any })),
17
- ref: Schema.optional(Type.Ref(TestSchema.Expando)),
17
+ ref: Schema.optional(Ref.Ref(TestSchema.Expando)),
18
18
  }).pipe(Schema.mutable);
19
19
 
20
20
  export interface TreeNodeType extends Schema.Schema.Type<typeof TreeNodeType> {}
@@ -24,7 +24,7 @@ export const TreeType = Schema.Struct({
24
24
  nodes: Schema.mutable(Schema.Record({ key: Key.ObjectId, value: TreeNodeType })),
25
25
  }).pipe(
26
26
  Type.object({
27
- typename: 'dxos.org/type/Tree',
27
+ typename: 'org.dxos.type.tree',
28
28
  version: '0.1.0',
29
29
  }),
30
30
  );
@@ -185,8 +185,8 @@ export class Tree {
185
185
  clear(): void {
186
186
  const root = this._tree.nodes[this._tree.root];
187
187
  root.children.length = 0;
188
- Obj.change(this._tree, (t) => {
189
- t.nodes = {
188
+ Obj.change(this._tree, (obj) => {
189
+ obj.nodes = {
190
190
  [root.id]: root,
191
191
  };
192
192
  });
@@ -202,8 +202,8 @@ export class Tree {
202
202
  }
203
203
 
204
204
  const nodeToAdd = node;
205
- Obj.change(this._tree, (t) => {
206
- t.nodes[nodeToAdd.id] = nodeToAdd;
205
+ Obj.change(this._tree, (obj) => {
206
+ obj.nodes[nodeToAdd.id] = nodeToAdd;
207
207
  parent.children.splice(index ?? parent.children.length, 0, nodeToAdd.id);
208
208
  });
209
209
  return node;
@@ -218,8 +218,8 @@ export class Tree {
218
218
  return undefined;
219
219
  }
220
220
 
221
- Obj.change(this._tree, (t) => {
222
- delete t.nodes[node.id];
221
+ Obj.change(this._tree, (obj) => {
222
+ delete obj.nodes[node.id];
223
223
  });
224
224
  const idx = parent.children.findIndex((child) => child === id);
225
225
  if (idx !== -1) {
@@ -2,11 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type ComponentType, lazy } from 'react';
6
-
7
5
  export * from './Chart';
8
6
  export * from './Globe';
9
7
  export * from './Graph';
10
8
  export * from './Tree';
11
-
12
- export const ExplorerContainer: ComponentType<any> = lazy(() => import('./ExplorerContainer'));
@@ -0,0 +1,53 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import React, { useCallback, useMemo, useState } from 'react';
6
+
7
+ import { type ObjectSurfaceProps } from '@dxos/app-toolkit/ui';
8
+ import { type Filter } from '@dxos/echo';
9
+ import { type View } from '@dxos/echo';
10
+ import { QueryBuilder } from '@dxos/echo-query';
11
+ import { useGlobalSearch } from '@dxos/plugin-search';
12
+ import { getSpace, useObject } from '@dxos/react-client/echo';
13
+ import { Panel, Toolbar } from '@dxos/react-ui';
14
+ import { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';
15
+
16
+ import { D3ForceGraph } from '#components';
17
+ import { useGraphModel } from '#hooks';
18
+
19
+ export type ExplorerContainerProps = ObjectSurfaceProps<View.View>;
20
+
21
+ export const ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {
22
+ useObject(view);
23
+ const space = view && getSpace(view);
24
+ const [filter, setFilter] = useState<Filter.Any>();
25
+ const model = useGraphModel(space, filter);
26
+ const { match } = useGlobalSearch();
27
+
28
+ const builder = useMemo(() => new QueryBuilder(), []);
29
+ const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>((value) => {
30
+ setFilter(builder.build(value).filter);
31
+ }, []);
32
+
33
+ const showToolbar = role === 'article';
34
+
35
+ if (!space || !model) {
36
+ return null;
37
+ }
38
+
39
+ return (
40
+ <Panel.Root role={role}>
41
+ {showToolbar && (
42
+ <Panel.Toolbar asChild>
43
+ <Toolbar.Root>
44
+ <QueryEditor db={space.db} onChange={handleChange} />
45
+ </Toolbar.Root>
46
+ </Panel.Toolbar>
47
+ )}
48
+ <Panel.Content asChild>
49
+ <D3ForceGraph model={model} match={match} />
50
+ </Panel.Content>
51
+ </Panel.Root>
52
+ );
53
+ };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { ExplorerContainer } from './ExplorerContainer';
6
+
7
+ export default ExplorerContainer;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const ExplorerContainer: ComponentType<any> = lazy(() => import('./ExplorerContainer'));
@@ -2,9 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { RegistryContext } from '@effect-atom/atom-react';
6
- import { useContext, useEffect, useState } from 'react';
5
+ import { useEffect, useState } from 'react';
7
6
 
7
+ import { Capabilities } from '@dxos/app-framework';
8
+ import { useCapability } from '@dxos/app-framework/ui';
8
9
  import { type Filter, type Queue, type Space } from '@dxos/client/echo';
9
10
  import { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';
10
11
 
@@ -15,24 +16,28 @@ export const useGraphModel = (
15
16
  options?: SpaceGraphModelOptions,
16
17
  queue?: Queue,
17
18
  ): SpaceGraphModel | undefined => {
18
- const registry = useContext(RegistryContext);
19
+ const registry = useCapability(Capabilities.AtomRegistry);
19
20
  const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);
21
+
20
22
  useEffect(() => {
21
23
  if (!space) {
22
- void model?.close();
23
24
  setModel(undefined);
24
25
  return;
25
26
  }
26
27
 
27
- // TODO(burdon): Does this need to be a dependency?
28
- if (!model || model.queue !== queue) {
29
- const model = new SpaceGraphModel(registry).setFilter(filter).setOptions(options);
30
- void model.open(space.db, queue);
31
- setModel(model);
32
- } else {
33
- model.setFilter(filter).setOptions(options);
34
- }
35
- }, [space, filter, options, queue, registry]);
28
+ const newModel = new SpaceGraphModel(registry);
29
+ void newModel.open(space.db, queue);
30
+ setModel(newModel);
31
+
32
+ return () => {
33
+ setModel(undefined);
34
+ void newModel.close();
35
+ };
36
+ }, [space, registry, queue]);
37
+
38
+ useEffect(() => {
39
+ model?.setFilter(filter).setOptions(options);
40
+ }, [model, filter, options]);
36
41
 
37
42
  return model;
38
43
  };
package/src/meta.ts CHANGED
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/explorer',
9
+ id: 'org.dxos.plugin.explorer',
10
10
  name: 'Explorer',
11
11
  description: trim`
12
12
  Interactive hypergraph visualization that reveals relationships between objects in your workspace.
@@ -6,25 +6,26 @@ import { Type } from '@dxos/echo';
6
6
  import { type Resource } from '@dxos/react-ui';
7
7
  import { translations as componentsTranslations } from '@dxos/react-ui-components';
8
8
 
9
- import { meta } from './meta';
10
- import { Graph } from './types';
9
+ import { meta } from '#meta';
10
+ import { Graph } from '#types';
11
11
 
12
12
  export const translations = [
13
13
  {
14
14
  'en-US': {
15
15
  [Type.getTypename(Graph.Graph)]: {
16
- 'typename label': 'Explorer',
17
- 'typename label_zero': 'Explorers',
18
- 'typename label_one': 'Explorer',
19
- 'typename label_other': 'Explorers',
20
- 'object name placeholder': 'New explorer',
21
- 'rename object label': 'Rename explorer',
22
- 'delete object label': 'Delete explorer',
23
- 'object deleted label': 'Explorer deleted',
16
+ 'typename.label': 'Explorer',
17
+ 'typename.label_zero': 'Explorers',
18
+ 'typename.label_one': 'Explorer',
19
+ 'typename.label_other': 'Explorers',
20
+ 'object-name.placeholder': 'New explorer',
21
+ 'add-object.label': 'Add explorer',
22
+ 'rename-object.label': 'Rename explorer',
23
+ 'delete-object.label': 'Delete explorer',
24
+ 'object-deleted.label': 'Explorer deleted',
24
25
  },
25
26
  [meta.id]: {
26
- 'plugin name': 'Explorer',
27
- 'object title label': 'Title',
27
+ 'plugin.name': 'Explorer',
28
+ 'object-title.label': 'Title',
28
29
  },
29
30
  },
30
31
  },
@@ -14,7 +14,6 @@ export const GraphProps = Schema.Struct({
14
14
  TypeInputOptionsAnnotation.set({
15
15
  location: ['database', 'runtime'],
16
16
  kind: ['user'],
17
- registered: ['registered'],
18
17
  }),
19
18
  Schema.optional,
20
19
  ),
@@ -4,14 +4,15 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Filter, Obj, Query, QueryAST, Ref, Type } from '@dxos/echo';
7
+ import { Annotation, Filter, Obj, Query, QueryAST, Ref, Type } from '@dxos/echo';
8
+ import { View } from '@dxos/echo';
8
9
  import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
9
- import { View, ViewAnnotation } from '@dxos/schema';
10
+ import { ViewAnnotation } from '@dxos/schema';
10
11
 
11
12
  const GraphSchema = Schema.Struct({
12
13
  name: Schema.optional(Schema.String),
13
14
 
14
- view: Type.Ref(View.View).pipe(FormInputAnnotation.set(false)),
15
+ view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),
15
16
 
16
17
  query: Schema.Struct({
17
18
  raw: Schema.optional(Schema.String),
@@ -19,11 +20,15 @@ const GraphSchema = Schema.Struct({
19
20
  }).pipe(FormInputAnnotation.set(false)),
20
21
  }).pipe(
21
22
  Type.object({
22
- typename: 'dxos.org/type/Graph',
23
- version: '0.2.0',
23
+ typename: 'org.dxos.type.graph',
24
+ version: '0.1.0',
24
25
  }),
25
26
  LabelAnnotation.set(['name']),
26
27
  ViewAnnotation.set(true),
28
+ Annotation.IconAnnotation.set({
29
+ icon: 'ph--graph--regular',
30
+ hue: 'green',
31
+ }),
27
32
  );
28
33
  export interface Graph extends Schema.Schema.Type<typeof GraphSchema> {}
29
34
  export const Graph: Type.Obj<Graph> = GraphSchema as any;
@@ -42,21 +47,3 @@ export const make = ({
42
47
  }: MakeProps): Graph => {
43
48
  return Obj.make(Graph, { name, view: Ref.make(view), query });
44
49
  };
45
-
46
- //
47
- // V1
48
- //
49
-
50
- export const GraphV1 = Schema.Struct({
51
- name: Schema.optional(Schema.String),
52
- query: Schema.Struct({
53
- raw: Schema.optional(Schema.String),
54
- ast: QueryAST.Query,
55
- }),
56
- }).pipe(
57
- Type.object({
58
- typename: 'dxos.org/type/Graph',
59
- version: '0.1.0',
60
- }),
61
- LabelAnnotation.set(['name']),
62
- );
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ declare module '*.css' {
6
+ const content: undefined;
7
+ export default content;
8
+ }
@@ -1,45 +0,0 @@
1
- import {
2
- useGraphModel
3
- } from "./chunk-BZMTFAP3.mjs";
4
- import {
5
- D3ForceGraph
6
- } from "./chunk-MGBT2ZFU.mjs";
7
- import "./chunk-J5LGTIGS.mjs";
8
-
9
- // src/components/ExplorerContainer.tsx
10
- import React, { useCallback, useMemo, useState } from "react";
11
- import { QueryBuilder } from "@dxos/echo-query";
12
- import { useGlobalSearch } from "@dxos/plugin-search";
13
- import { getSpace } from "@dxos/react-client/echo";
14
- import { Toolbar } from "@dxos/react-ui";
15
- import { QueryEditor } from "@dxos/react-ui-components";
16
- import { Layout } from "@dxos/react-ui-mosaic";
17
- var ExplorerContainer = ({ role, subject: view }) => {
18
- const space = getSpace(view);
19
- const [filter, setFilter] = useState();
20
- const model = useGraphModel(space, filter);
21
- const { match } = useGlobalSearch();
22
- const builder = useMemo(() => new QueryBuilder(), []);
23
- const handleChange = useCallback((value) => {
24
- setFilter(builder.build(value).filter);
25
- }, []);
26
- const showToolbar = role === "article";
27
- if (!space || !model) {
28
- return null;
29
- }
30
- return /* @__PURE__ */ React.createElement(Layout.Main, {
31
- role,
32
- toolbar: showToolbar
33
- }, showToolbar && /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(QueryEditor, {
34
- db: space.db,
35
- onChange: handleChange
36
- })), /* @__PURE__ */ React.createElement(D3ForceGraph, {
37
- model,
38
- match
39
- }));
40
- };
41
- var ExplorerContainer_default = ExplorerContainer;
42
- export {
43
- ExplorerContainer_default as default
44
- };
45
- //# sourceMappingURL=ExplorerContainer-BFAWRIAJ.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ExplorerContainer.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { type Filter } from '@dxos/echo';\nimport { QueryBuilder } from '@dxos/echo-query';\nimport { useGlobalSearch } from '@dxos/plugin-search';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Toolbar } from '@dxos/react-ui';\nimport { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';\nimport { Layout } from '@dxos/react-ui-mosaic';\nimport { type View } from '@dxos/schema';\n\nimport { useGraphModel } from '../hooks';\n\nimport { D3ForceGraph } from './Graph';\n\nexport type ExplorerContainerProps = SurfaceComponentProps<View.View>;\n\nconst ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {\n const space = getSpace(view);\n const [filter, setFilter] = useState<Filter.Any>();\n const model = useGraphModel(space, filter);\n const { match } = useGlobalSearch();\n\n const builder = useMemo(() => new QueryBuilder(), []);\n const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>((value) => {\n setFilter(builder.build(value).filter);\n }, []);\n\n const showToolbar = role === 'article';\n\n if (!space || !model) {\n return null;\n }\n\n return (\n <Layout.Main role={role} toolbar={showToolbar}>\n {showToolbar && (\n <Toolbar.Root>\n <QueryEditor db={space.db} onChange={handleChange} />\n </Toolbar.Root>\n )}\n <D3ForceGraph model={model} match={match} />\n </Layout.Main>\n );\n};\n\nexport default ExplorerContainer;\n"],
5
- "mappings": ";;;;;;;;;AAIA,OAAOA,SAASC,aAAaC,SAASC,gBAAgB;AAItD,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,mBAA0C;AACnD,SAASC,cAAc;AASvB,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,SAASC,KAAI,MAA0B;AACxE,QAAMC,QAAQC,SAASF,IAAAA;AACvB,QAAM,CAACG,QAAQC,SAAAA,IAAaC,SAAAA;AAC5B,QAAMC,QAAQC,cAAcN,OAAOE,MAAAA;AACnC,QAAM,EAAEK,MAAK,IAAKC,gBAAAA;AAElB,QAAMC,UAAUC,QAAQ,MAAM,IAAIC,aAAAA,GAAgB,CAAA,CAAE;AACpD,QAAMC,eAAeC,YAAuD,CAACC,UAAAA;AAC3EX,cAAUM,QAAQM,MAAMD,KAAAA,EAAOZ,MAAM;EACvC,GAAG,CAAA,CAAE;AAEL,QAAMc,cAAcnB,SAAS;AAE7B,MAAI,CAACG,SAAS,CAACK,OAAO;AACpB,WAAO;EACT;AAEA,SACE,sBAAA,cAACY,OAAOC,MAAI;IAACrB;IAAYsB,SAASH;KAC/BA,eACC,sBAAA,cAACI,QAAQC,MAAI,MACX,sBAAA,cAACC,aAAAA;IAAYC,IAAIvB,MAAMuB;IAAIC,UAAUZ;OAGzC,sBAAA,cAACa,cAAAA;IAAapB;IAAcE;;AAGlC;AAEA,IAAA,4BAAeX;",
6
- "names": ["React", "useCallback", "useMemo", "useState", "QueryBuilder", "useGlobalSearch", "getSpace", "Toolbar", "QueryEditor", "Layout", "ExplorerContainer", "role", "subject", "view", "space", "getSpace", "filter", "setFilter", "useState", "model", "useGraphModel", "match", "useGlobalSearch", "builder", "useMemo", "QueryBuilder", "handleChange", "useCallback", "value", "build", "showToolbar", "Layout", "Main", "toolbar", "Toolbar", "Root", "QueryEditor", "db", "onChange", "D3ForceGraph"]
7
- }