@dxos/plugin-explorer 0.8.4-main.5ea62a8 → 0.8.4-main.66e292d

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 (127) hide show
  1. package/dist/lib/browser/ExplorerContainer-NOLLVUTE.mjs +50 -0
  2. package/dist/lib/browser/ExplorerContainer-NOLLVUTE.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-3YITRGGW.mjs → chunk-6BVXZQPP.mjs} +15 -30
  4. package/dist/lib/browser/chunk-6BVXZQPP.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-VNOGW2JS.mjs → chunk-ARBGXQFH.mjs} +6 -258
  6. package/dist/lib/browser/{chunk-VNOGW2JS.mjs.map → chunk-ARBGXQFH.mjs.map} +3 -3
  7. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  8. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-P6FFFVPM.mjs +100 -0
  10. package/dist/lib/browser/chunk-P6FFFVPM.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-UBHZGWZQ.mjs +24 -0
  12. package/dist/lib/browser/chunk-UBHZGWZQ.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +27 -27
  14. package/dist/lib/browser/index.mjs.map +3 -3
  15. package/dist/lib/browser/intent-resolver-EWB3H5KH.mjs +35 -0
  16. package/dist/lib/browser/intent-resolver-EWB3H5KH.mjs.map +7 -0
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/meta.mjs +2 -3
  19. package/dist/lib/browser/react-surface-BY2DYCTH.mjs +34 -0
  20. package/dist/lib/browser/react-surface-BY2DYCTH.mjs.map +7 -0
  21. package/dist/lib/browser/types/index.mjs +7 -6
  22. package/dist/lib/node-esm/{ExplorerContainer-OBSRVHZZ.mjs → ExplorerContainer-N3S5KSUX.mjs} +19 -6
  23. package/dist/lib/node-esm/ExplorerContainer-N3S5KSUX.mjs.map +7 -0
  24. package/dist/lib/node-esm/chunk-4BY2XZET.mjs +101 -0
  25. package/dist/lib/node-esm/chunk-4BY2XZET.mjs.map +7 -0
  26. package/dist/lib/node-esm/{chunk-GFYXDQQV.mjs → chunk-CRSVAZNA.mjs} +15 -30
  27. package/dist/lib/node-esm/chunk-CRSVAZNA.mjs.map +7 -0
  28. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  29. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-ODMJ7DPA.mjs → chunk-NPIP4VEH.mjs} +6 -258
  31. package/dist/lib/node-esm/{chunk-ODMJ7DPA.mjs.map → chunk-NPIP4VEH.mjs.map} +3 -3
  32. package/dist/lib/node-esm/{chunk-PIAXA43R.mjs → chunk-UXZM5VJB.mjs} +8 -5
  33. package/dist/lib/node-esm/chunk-UXZM5VJB.mjs.map +7 -0
  34. package/dist/lib/node-esm/index.mjs +27 -27
  35. package/dist/lib/node-esm/index.mjs.map +3 -3
  36. package/dist/lib/node-esm/intent-resolver-SH6PW7VF.mjs +36 -0
  37. package/dist/lib/node-esm/intent-resolver-SH6PW7VF.mjs.map +7 -0
  38. package/dist/lib/node-esm/meta.json +1 -1
  39. package/dist/lib/node-esm/meta.mjs +2 -3
  40. package/dist/lib/node-esm/react-surface-7AAV7GBG.mjs +35 -0
  41. package/dist/lib/node-esm/react-surface-7AAV7GBG.mjs.map +7 -0
  42. package/dist/lib/node-esm/types/index.mjs +7 -6
  43. package/dist/types/src/ExplorerPlugin.d.ts +1 -1
  44. package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/index.d.ts +1 -1
  46. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
  48. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  49. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  50. package/dist/types/src/components/Chart/Chart.stories.d.ts +3 -1
  51. package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
  52. package/dist/types/src/components/ExplorerContainer.d.ts +2 -2
  53. package/dist/types/src/components/ExplorerContainer.d.ts.map +1 -1
  54. package/dist/types/src/components/Globe/Globe.stories.d.ts +3 -1
  55. package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
  56. package/dist/types/src/components/Graph/D3ForceGraph.d.ts +2 -2
  57. package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -1
  58. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +5 -10
  59. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
  60. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +4 -2
  61. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
  62. package/dist/types/src/components/Graph/testing.d.ts.map +1 -1
  63. package/dist/types/src/components/Tree/Tree.stories.d.ts +0 -1
  64. package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
  65. package/dist/types/src/components/Tree/types/tree.d.ts +7 -7
  66. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
  67. package/dist/types/src/components/index.d.ts +2 -4
  68. package/dist/types/src/components/index.d.ts.map +1 -1
  69. package/dist/types/src/meta.d.ts +0 -1
  70. package/dist/types/src/meta.d.ts.map +1 -1
  71. package/dist/types/src/translations.d.ts +25 -5
  72. package/dist/types/src/translations.d.ts.map +1 -1
  73. package/dist/types/src/types/ExplorerAction.d.ts +23 -0
  74. package/dist/types/src/types/ExplorerAction.d.ts.map +1 -0
  75. package/dist/types/src/types/Graph.d.ts +32 -0
  76. package/dist/types/src/types/Graph.d.ts.map +1 -0
  77. package/dist/types/src/types/index.d.ts +2 -2
  78. package/dist/types/src/types/index.d.ts.map +1 -1
  79. package/dist/types/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +38 -36
  81. package/src/ExplorerPlugin.tsx +40 -49
  82. package/src/capabilities/intent-resolver.ts +12 -8
  83. package/src/capabilities/react-surface.tsx +8 -5
  84. package/src/components/Chart/Chart.stories.tsx +5 -4
  85. package/src/components/ExplorerContainer.tsx +22 -5
  86. package/src/components/Globe/Globe.stories.tsx +5 -4
  87. package/src/components/Graph/D3ForceGraph.stories.tsx +28 -15
  88. package/src/components/Graph/D3ForceGraph.tsx +4 -4
  89. package/src/components/Graph/ForceGraph.stories.tsx +28 -15
  90. package/src/components/Graph/ForceGraph.tsx +3 -3
  91. package/src/components/Graph/testing.ts +6 -6
  92. package/src/components/Tree/Tree.stories.tsx +2 -4
  93. package/src/components/Tree/Tree.tsx +2 -2
  94. package/src/components/Tree/types/tree.test.ts +2 -2
  95. package/src/components/Tree/types/tree.ts +1 -1
  96. package/src/components/index.ts +3 -3
  97. package/src/meta.ts +7 -4
  98. package/src/translations.ts +6 -2
  99. package/src/types/ExplorerAction.ts +37 -0
  100. package/src/types/Graph.ts +63 -0
  101. package/src/types/index.ts +2 -2
  102. package/dist/lib/browser/ExplorerContainer-7MTDS2TQ.mjs +0 -37
  103. package/dist/lib/browser/ExplorerContainer-7MTDS2TQ.mjs.map +0 -7
  104. package/dist/lib/browser/chunk-3YITRGGW.mjs.map +0 -7
  105. package/dist/lib/browser/chunk-CZZ3DDR7.mjs +0 -38
  106. package/dist/lib/browser/chunk-CZZ3DDR7.mjs.map +0 -7
  107. package/dist/lib/browser/chunk-UL5EDJPE.mjs +0 -21
  108. package/dist/lib/browser/chunk-UL5EDJPE.mjs.map +0 -7
  109. package/dist/lib/browser/intent-resolver-7MVEYNX7.mjs +0 -24
  110. package/dist/lib/browser/intent-resolver-7MVEYNX7.mjs.map +0 -7
  111. package/dist/lib/browser/react-surface-VLGQKYBI.mjs +0 -31
  112. package/dist/lib/browser/react-surface-VLGQKYBI.mjs.map +0 -7
  113. package/dist/lib/node-esm/ExplorerContainer-OBSRVHZZ.mjs.map +0 -7
  114. package/dist/lib/node-esm/chunk-4GWDNZ4Z.mjs +0 -39
  115. package/dist/lib/node-esm/chunk-4GWDNZ4Z.mjs.map +0 -7
  116. package/dist/lib/node-esm/chunk-GFYXDQQV.mjs.map +0 -7
  117. package/dist/lib/node-esm/chunk-PIAXA43R.mjs.map +0 -7
  118. package/dist/lib/node-esm/intent-resolver-NL3SR2XF.mjs +0 -25
  119. package/dist/lib/node-esm/intent-resolver-NL3SR2XF.mjs.map +0 -7
  120. package/dist/lib/node-esm/react-surface-BYJABDS5.mjs +0 -32
  121. package/dist/lib/node-esm/react-surface-BYJABDS5.mjs.map +0 -7
  122. package/dist/types/src/types/schema.d.ts +0 -12
  123. package/dist/types/src/types/schema.d.ts.map +0 -1
  124. package/dist/types/src/types/types.d.ts +0 -18
  125. package/dist/types/src/types/types.d.ts.map +0 -1
  126. package/src/types/schema.ts +0 -16
  127. package/src/types/types.ts +0 -22
@@ -2,15 +2,13 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React, { useEffect, useState } from 'react';
9
7
 
10
8
  import { faker } from '@dxos/random';
11
9
  import { useClient } from '@dxos/react-client';
12
10
  import { type ClientRepeatedComponentProps, ClientRepeater } from '@dxos/react-client/testing';
13
- import { withLayout, withTheme } from '@dxos/storybook-utils';
11
+ import { withTheme } from '@dxos/react-ui/testing';
14
12
 
15
13
  import { Tree, type TreeComponentProps } from './Tree';
16
14
  import { Tree as TreeModel, TreeType } from './types';
@@ -48,7 +46,7 @@ const meta = {
48
46
  title: 'plugins/plugin-explorer/Tree',
49
47
  component: Tree as any,
50
48
  render: DefaultStory,
51
- decorators: [withTheme, withLayout({ fullscreen: true })],
49
+ decorators: [withTheme],
52
50
  parameters: {
53
51
  layout: 'fullscreen',
54
52
  },
@@ -75,8 +75,8 @@ export const Tree = <N,>({ space, selected, variant = 'tidy', onNodeClick }: Tre
75
75
  const context = useRef<SVGContext>(null);
76
76
 
77
77
  useEffect(() => {
78
- if (context.current) {
79
- const { width, height } = context.current.size!;
78
+ if (context.current?.size) {
79
+ const { width, height } = context.current.size;
80
80
  const size = Math.min(width, height);
81
81
  const radius = size * 0.4;
82
82
  const options = {
@@ -6,7 +6,7 @@ import { describe, test } from 'vitest';
6
6
 
7
7
  import { Obj, Ref } from '@dxos/echo';
8
8
  import { faker } from '@dxos/random';
9
- import { DataType } from '@dxos/schema';
9
+ import { Task } from '@dxos/types';
10
10
 
11
11
  import { createTree } from '../testing';
12
12
 
@@ -124,7 +124,7 @@ describe('tree', () => {
124
124
  });
125
125
 
126
126
  test('task', ({ expect }) => {
127
- const task = Obj.make(DataType.Task, { title: 'Test task.' });
127
+ const task = Obj.make(Task.Task, { title: 'Test task.' });
128
128
  expect(task.title).to.eq('Test task.');
129
129
 
130
130
  const tree = createTree();
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { Key, Obj, Type } from '@dxos/echo';
8
8
  import { invariant } from '@dxos/invariant';
@@ -2,11 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from 'react';
6
-
7
- export const ExplorerContainer = lazy(() => import('./ExplorerContainer'));
5
+ import { type ComponentType, lazy } from 'react';
8
6
 
9
7
  export * from './Chart';
10
8
  export * from './Globe';
11
9
  export * from './Graph';
12
10
  export * from './Tree';
11
+
12
+ export const ExplorerContainer: ComponentType<any> = lazy(() => import('./ExplorerContainer'));
package/src/meta.ts CHANGED
@@ -3,14 +3,17 @@
3
3
  //
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
-
7
- export const EXPLORER_PLUGIN = 'dxos.org/plugin/explorer';
6
+ import { trim } from '@dxos/util';
8
7
 
9
8
  export const meta: PluginMeta = {
10
- id: EXPLORER_PLUGIN,
9
+ id: 'dxos.org/plugin/explorer',
11
10
  name: 'Explorer',
12
- description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',
11
+ description: trim`
12
+ Interactive hypergraph visualization that reveals relationships between objects in your workspace.
13
+ Navigate complex data structures and discover connections through a dynamic network view.
14
+ `,
13
15
  icon: 'ph--graph--regular',
16
+ iconHue: 'green',
14
17
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',
15
18
  tags: ['labs'],
16
19
  screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],
@@ -2,15 +2,17 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import { Type } from '@dxos/echo';
5
6
  import { type Resource } from '@dxos/react-ui';
7
+ import { translations as componentsTranslations } from '@dxos/react-ui-components';
6
8
 
7
9
  import { meta } from './meta';
8
- import { ViewType } from './types';
10
+ import { Graph } from './types';
9
11
 
10
12
  export const translations = [
11
13
  {
12
14
  'en-US': {
13
- [ViewType.typename]: {
15
+ [Type.getTypename(Graph.Graph)]: {
14
16
  'typename label': 'Explorer',
15
17
  'typename label_zero': 'Explorers',
16
18
  'typename label_one': 'Explorer',
@@ -18,6 +20,7 @@ export const translations = [
18
20
  'object name placeholder': 'New explorer',
19
21
  'rename object label': 'Rename explorer',
20
22
  'delete object label': 'Delete explorer',
23
+ 'object deleted label': 'Explorer deleted',
21
24
  },
22
25
  [meta.id]: {
23
26
  'plugin name': 'Explorer',
@@ -25,4 +28,5 @@ export const translations = [
25
28
  },
26
29
  },
27
30
  },
31
+ ...componentsTranslations,
28
32
  ] as const satisfies Resource[];
@@ -0,0 +1,37 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { TypeInputOptionsAnnotation } from '@dxos/plugin-space/types';
8
+ import { SpaceSchema } from '@dxos/react-client/echo';
9
+
10
+ import { meta } from '../meta';
11
+
12
+ import * as Graph from './Graph';
13
+
14
+ const EXPLORER_ACTION = `${meta.id}/action`;
15
+
16
+ export const GraphProps = Schema.Struct({
17
+ name: Schema.optional(Schema.String),
18
+ // TODO(wittjosiah): This should be a query input instead.
19
+ typename: Schema.String.pipe(
20
+ Schema.annotations({ title: 'Select type' }),
21
+ TypeInputOptionsAnnotation.set({
22
+ location: ['database', 'runtime'],
23
+ kind: ['user'],
24
+ registered: ['registered'],
25
+ }),
26
+ Schema.optional,
27
+ ),
28
+ });
29
+
30
+ export class CreateGraph extends Schema.TaggedClass<CreateGraph>()(`${EXPLORER_ACTION}/create-graph`, {
31
+ input: Schema.Struct({
32
+ space: SpaceSchema,
33
+ }).pipe(Schema.extend(GraphProps)),
34
+ output: Schema.Struct({
35
+ object: Graph.Graph,
36
+ }),
37
+ }) {}
@@ -0,0 +1,63 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { Filter, Obj, Query, QueryAST, Ref, Type } from '@dxos/echo';
8
+ import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
9
+ import { View, ViewAnnotation } from '@dxos/schema';
10
+
11
+ const GraphSchema = Schema.Struct({
12
+ name: Schema.optional(Schema.String),
13
+
14
+ view: Type.Ref(View.View).pipe(FormInputAnnotation.set(false)),
15
+
16
+ query: Schema.Struct({
17
+ raw: Schema.optional(Schema.String),
18
+ ast: QueryAST.Query,
19
+ }).pipe(Schema.mutable, FormInputAnnotation.set(false)),
20
+ }).pipe(
21
+ Type.Obj({
22
+ typename: 'dxos.org/type/Graph',
23
+ version: '0.2.0',
24
+ }),
25
+ LabelAnnotation.set(['name']),
26
+ ViewAnnotation.set(true),
27
+ );
28
+ export interface Graph extends Schema.Schema.Type<typeof GraphSchema> {}
29
+ export interface GraphEncoded extends Schema.Schema.Encoded<typeof GraphSchema> {}
30
+ export const Graph: Schema.Schema<Graph, GraphEncoded> = GraphSchema;
31
+
32
+ type MakeProps = Omit<Partial<Obj.MakeProps<typeof Graph>>, 'view'> & {
33
+ view: View.View;
34
+ };
35
+
36
+ /**
37
+ * Make a graph as a view of a data set.
38
+ */
39
+ export const make = ({
40
+ name,
41
+ query = { raw: '', ast: Query.select(Filter.nothing()).ast },
42
+ view,
43
+ }: MakeProps): Graph => {
44
+ return Obj.make(Graph, { name, view: Ref.make(view), query });
45
+ };
46
+
47
+ //
48
+ // V1
49
+ //
50
+
51
+ export const GraphV1 = Schema.Struct({
52
+ name: Schema.optional(Schema.String),
53
+ query: Schema.Struct({
54
+ raw: Schema.optional(Schema.String),
55
+ ast: QueryAST.Query,
56
+ }).pipe(Schema.mutable),
57
+ }).pipe(
58
+ Type.Obj({
59
+ typename: 'dxos.org/type/Graph',
60
+ version: '0.1.0',
61
+ }),
62
+ LabelAnnotation.set(['name']),
63
+ );
@@ -2,5 +2,5 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export * from './schema';
6
- export * from './types';
5
+ export * as ExplorerAction from './ExplorerAction';
6
+ export * as Graph from './Graph';
@@ -1,37 +0,0 @@
1
- import {
2
- useGraphModel
3
- } from "./chunk-2MKBRIUT.mjs";
4
- import {
5
- D3ForceGraph
6
- } from "./chunk-3YITRGGW.mjs";
7
-
8
- // src/components/ExplorerContainer.tsx
9
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
10
- import React from "react";
11
- import { useGlobalSearch } from "@dxos/plugin-search";
12
- import { getSpace } from "@dxos/react-client/echo";
13
- import { StackItem } from "@dxos/react-ui-stack";
14
- var ExplorerContainer = ({ role, view }) => {
15
- var _effect = _useSignals();
16
- try {
17
- const space = getSpace(view);
18
- const model = useGraphModel(space);
19
- const { match } = useGlobalSearch();
20
- if (!space || !model) {
21
- return null;
22
- }
23
- return /* @__PURE__ */ React.createElement(StackItem.Content, {
24
- size: role === "section" ? "square" : "intrinsic"
25
- }, /* @__PURE__ */ React.createElement(D3ForceGraph, {
26
- model,
27
- match
28
- }));
29
- } finally {
30
- _effect.f();
31
- }
32
- };
33
- var ExplorerContainer_default = ExplorerContainer;
34
- export {
35
- ExplorerContainer_default as default
36
- };
37
- //# sourceMappingURL=ExplorerContainer-7MTDS2TQ.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 from 'react';\n\nimport { useGlobalSearch } from '@dxos/plugin-search';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { useGraphModel } from '../hooks';\nimport { type ViewType } from '../types';\n\nimport { D3ForceGraph } from './Graph';\n\ntype ExplorerContainerProps = {\n role: string;\n view: ViewType;\n};\n\nconst ExplorerContainer = ({ role, view }: ExplorerContainerProps) => {\n const space = getSpace(view);\n const model = useGraphModel(space);\n const { match } = useGlobalSearch();\n\n if (!space || !model) {\n return null;\n }\n\n return (\n <StackItem.Content size={role === 'section' ? 'square' : 'intrinsic'}>\n <D3ForceGraph model={model} match={match} />\n </StackItem.Content>\n );\n};\n\nexport default ExplorerContainer;\n"],
5
- "mappings": ";;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAY1B,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,KAAI,MAA0B;;;AAC/D,UAAMC,QAAQC,SAASF,IAAAA;AACvB,UAAMG,QAAQC,cAAcH,KAAAA;AAC5B,UAAM,EAAEI,MAAK,IAAKC,gBAAAA;AAElB,QAAI,CAACL,SAAS,CAACE,OAAO;AACpB,aAAO;IACT;AAEA,WACE,sBAAA,cAACI,UAAUC,SAAO;MAACC,MAAMV,SAAS,YAAY,WAAW;OACvD,sBAAA,cAACW,cAAAA;MAAaP;MAAcE;;;;;AAGlC;AAEA,IAAA,4BAAeP;",
6
- "names": ["React", "useGlobalSearch", "getSpace", "StackItem", "ExplorerContainer", "role", "view", "space", "getSpace", "model", "useGraphModel", "match", "useGlobalSearch", "StackItem", "Content", "size", "D3ForceGraph"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/Graph/D3ForceGraph.tsx", "../../../src/components/Graph/ForceGraph.tsx", "../../../src/components/Graph/adapter.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { SelectionModel } from '@dxos/graph';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n type GraphController,\n GraphForceProjector,\n type GraphLayoutNode,\n type GraphProps,\n SVG,\n type SVGContext,\n} from '@dxos/react-ui-graph';\nimport { getHashColor } from '@dxos/react-ui-theme';\nimport { type SpaceGraphEdge, type SpaceGraphModel, type SpaceGraphNode } from '@dxos/schema';\n\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nexport type D3ForceGraphProps = ThemedClassName<\n {\n model?: SpaceGraphModel;\n match?: RegExp;\n selection?: SelectionModel;\n grid?: boolean;\n } & Pick<GraphProps, 'drag'>\n>;\n\nexport const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selection: _selection, grid, ...props }) => {\n const context = useRef<SVGContext>(null);\n const projector = useMemo<GraphForceProjector | undefined>(() => {\n if (context.current) {\n return new GraphForceProjector(context.current, {\n attributes: {\n linkForce: (edge) => {\n // TODO(burdon): Check type (currently assumes Employee property).\n // Edge shouldn't contribute to force if it's not active.\n return edge.data?.object?.active !== false;\n },\n },\n forces: {\n point: {\n strength: 0.01,\n },\n },\n });\n }\n }, [context.current]);\n\n const graph = useRef<GraphController>(null);\n const selection = useMemo(() => _selection ?? new SelectionModel(), [_selection]);\n useEffect(() => graph.current?.repaint(), [selection.selected.value]);\n\n const handleSelect = useCallback<NonNullable<GraphProps['onSelect']>>(\n (node) => {\n if (selection.contains(node.id)) {\n selection.remove(node.id);\n } else {\n selection.add(node.id);\n }\n },\n [selection],\n );\n\n return (\n <SVG.Root ref={context} classNames={classNames}>\n <SVG.Markers />\n {grid && <SVG.Grid axis />}\n <SVG.Zoom extent={[1 / 2, 2]}>\n <SVG.Graph<SpaceGraphNode, SpaceGraphEdge>\n {...props}\n ref={graph}\n model={model}\n projector={projector}\n labels={{\n text: (node) => {\n return node.data?.data.label ?? node.id;\n },\n }}\n attributes={{\n node: (node: GraphLayoutNode<SpaceGraphNode>) => {\n const obj = node.data?.data.object;\n return {\n data: {\n color: getHashColor(obj && Obj.getTypename(obj))?.color,\n },\n classes: {\n 'dx-selected': selection.contains(node.id),\n },\n };\n },\n }}\n onSelect={handleSelect}\n />\n </SVG.Zoom>\n </SVG.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { forceLink, forceManyBody } from 'd3';\nimport NativeForceGraph from 'force-graph';\nimport React, { type FC, useEffect, useRef, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type SearchResult, filterObjectsSync } from '@dxos/plugin-search';\nimport { type SpaceGraphModel } from '@dxos/schema';\n\nimport { GraphAdapter } from './adapter';\n\nexport type ForceGraphProps = {\n model?: SpaceGraphModel;\n match?: RegExp;\n};\n\nexport const ForceGraph: FC<ForceGraphProps> = ({ model, match }) => {\n const { ref, width, height } = useResizeDetector({ refreshRate: 200 });\n const rootRef = useRef<HTMLDivElement>(null);\n const forceGraph = useRef<NativeForceGraph>();\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n\n const [data, setData] = useState<GraphAdapter>();\n useEffect(() => {\n return model?.subscribe((model) => {\n setData(new GraphAdapter(model.graph));\n });\n }, [model]);\n\n useEffect(() => {\n if (rootRef.current) {\n // https://github.com/vasturiano/force-graph\n // https://github.com/vasturiano/3d-force-graph\n forceGraph.current = new NativeForceGraph(rootRef.current)\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#node-styling\n .nodeRelSize(6)\n .nodeLabel((node: any) => (node.type === 'schema' ? node.data.typename : (node.data.label ?? node.id)))\n .nodeAutoColorBy((node: any) => (node.type === 'schema' ? 'schema' : node.data.typename))\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#link-styling\n .linkAutoColorBy((link: any) => link.type);\n }\n\n return () => {\n forceGraph.current?.pauseAnimation().graphData({ nodes: [], links: [] });\n forceGraph.current = undefined;\n };\n }, []);\n\n useEffect(() => {\n if (!data || !width || !height || !forceGraph.current) {\n return;\n }\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#container-layout\n forceGraph.current\n .pauseAnimation()\n .width(width)\n .height(height)\n .onEngineStop(() => {\n handleZoomToFit();\n })\n .onNodeClick((node: any) => {\n forceGraph.current?.emitParticle(node);\n })\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#force-engine-d3-force-configuration\n // .d3Force('center', forceCenter().strength(0.9))\n .d3Force('link', forceLink().distance(160).strength(0.5))\n .d3Force('charge', forceManyBody().strength(-30))\n\n .graphData(data)\n .warmupTicks(100)\n .cooldownTime(1_000)\n .resumeAnimation();\n }, [data, width, height, forceGraph.current]);\n\n const handleZoomToFit = () => {\n forceGraph.current?.zoomToFit(400, 40);\n };\n\n return (\n <div ref={ref} className='relative grow' onClick={handleZoomToFit}>\n <div ref={rootRef} className='absolute inset-0' />\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Graph } from '@dxos/graph';\n\nexport type GraphNode = {\n id?: string;\n};\n\nexport type GraphLink = {\n source?: string;\n target?: string;\n};\n\nexport type GraphData = {\n nodes: GraphNode[];\n links: GraphLink[];\n};\n\n/**\n * Map common graph to force-graph format.\n */\nexport class GraphAdapter implements GraphData {\n private readonly _nodes: GraphNode[] = [];\n private readonly _links: GraphLink[] = [];\n\n constructor(private readonly graph: Graph) {\n this._nodes = graph.nodes.map((node) => ({\n id: node.id,\n type: node.type,\n data: node.data,\n }));\n\n this._links = graph.edges.map((edge) => ({\n type: edge.type,\n source: edge.source,\n target: edge.target,\n data: edge.data,\n }));\n }\n\n get nodes() {\n return this._nodes;\n }\n\n get links() {\n return this._links;\n }\n}\n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ICiB,QAAQ,QAAQC,UAAAA,EAAYC,SAAS,GAAA,EAAKC,SAAS,GAAA,CAAA,EACnDH,QAAQ,UAAUI,cAAAA,EAAgBD,SAAS,GAAC,CAAA,EAE5CX,UAAUnB,IAAAA,EACVgC,YAAY,GAAA,EACZC,aAAa,GAAA,EACbC,gBAAe;IACpB,GAAG;MAAClC;MAAMX;MAAOC;MAAQK,WAAWE;KAAQ;AAE5C,UAAM2B,kBAAkB,MAAA;AACtB7B,iBAAWE,SAASsC,UAAU,KAAK,EAAA;IACrC;AAEA,WACE,gBAAAC,OAAA,cAACC,OAAAA;MAAIjD;MAAUkD,WAAU;MAAgBC,SAASf;OAChD,gBAAAY,OAAA,cAACC,OAAAA;MAAIjD,KAAKK;MAAS6C,WAAU;;;;;AAGnC;",
6
- "names": ["React", "useCallback", "useEffect", "useMemo", "useRef", "Obj", "SelectionModel", "GraphForceProjector", "SVG", "getHashColor", "D3ForceGraph", "classNames", "model", "selection", "_selection", "grid", "props", "context", "useRef", "projector", "useMemo", "current", "GraphForceProjector", "attributes", "linkForce", "edge", "data", "object", "active", "forces", "point", "strength", "graph", "SelectionModel", "useEffect", "repaint", "selected", "value", "handleSelect", "useCallback", "node", "contains", "id", "remove", "add", "SVG", "Root", "ref", "Markers", "Grid", "axis", "Zoom", "extent", "Graph", "labels", "text", "label", "obj", "color", "getHashColor", "Obj", "getTypename", "classes", "onSelect", "forceLink", "forceManyBody", "NativeForceGraph", "React", "useEffect", "useRef", "useState", "useResizeDetector", "filterObjectsSync", "GraphAdapter", "nodes", "_nodes", "links", "_links", "graph", "map", "node", "id", "type", "data", "edges", "edge", "source", "target", "ForceGraph", "model", "match", "ref", "width", "height", "useResizeDetector", "refreshRate", "rootRef", "useRef", "forceGraph", "filteredRef", "current", "filterObjectsSync", "objects", "data", "setData", "useState", "useEffect", "subscribe", "GraphAdapter", "graph", "NativeForceGraph", "nodeRelSize", "nodeLabel", "node", "type", "typename", "label", "id", "nodeAutoColorBy", "linkAutoColorBy", "link", "pauseAnimation", "graphData", "nodes", "links", "undefined", "onEngineStop", "handleZoomToFit", "onNodeClick", "emitParticle", "d3Force", "forceLink", "distance", "strength", "forceManyBody", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "React", "div", "className", "onClick"]
7
- }
@@ -1,38 +0,0 @@
1
- import {
2
- EXPLORER_PLUGIN
3
- } from "./chunk-UL5EDJPE.mjs";
4
-
5
- // src/types/schema.ts
6
- import { Schema } from "effect";
7
- import { TypedObject } from "@dxos/echo-schema";
8
- var ViewType = class extends TypedObject({
9
- typename: "dxos.org/type/ExplorerView",
10
- version: "0.1.0"
11
- })({
12
- name: Schema.optional(Schema.String),
13
- type: Schema.String
14
- }) {
15
- };
16
-
17
- // src/types/types.ts
18
- import { Schema as Schema2 } from "effect";
19
- (function(ExplorerAction2) {
20
- const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;
21
- class Create extends Schema2.TaggedClass()(`${EXPLORER_ACTION}/create`, {
22
- input: Schema2.Struct({
23
- name: Schema2.optional(Schema2.String)
24
- }),
25
- output: Schema2.Struct({
26
- object: ViewType
27
- })
28
- }) {
29
- }
30
- ExplorerAction2.Create = Create;
31
- })(ExplorerAction || (ExplorerAction = {}));
32
- var ExplorerAction;
33
-
34
- export {
35
- ViewType,
36
- ExplorerAction
37
- };
38
- //# sourceMappingURL=chunk-CZZ3DDR7.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Clashes with sdk/view.\nexport class ViewType extends TypedObject({\n typename: 'dxos.org/type/ExplorerView',\n version: '0.1.0',\n})({\n name: Schema.optional(Schema.String),\n type: Schema.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { EXPLORER_PLUGIN } from '../meta';\n\nimport { ViewType } from './schema';\n\nexport namespace ExplorerAction {\n const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ViewType,\n }),\n }) {}\n}\n"],
5
- "mappings": ";;;;;AAIA,SAASA,cAAc;AAEvB,SAASC,mBAAmB;AAGrB,IAAMC,WAAN,cAAuBC,YAAY;EACxCC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,MAAMC,OAAOC,SAASD,OAAOE,MAAM;EACnCC,MAAMH,OAAOE;AACf,CAAA,EAAA;AAAI;;;ACXJ,SAASE,UAAAA,eAAc;UAMNC,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,eAAAA;EAEpB,MAAMC,eAAeC,QAAOC,YAAW,EAAW,GAAGJ,eAAAA,WAA0B;IACpFK,OAAOF,QAAOG,OAAO;MACnBC,MAAMJ,QAAOK,SAASL,QAAOM,MAAM;IACrC,CAAA;IACAC,QAAQP,QAAOG,OAAO;MACpBK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSV,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
6
- "names": ["Schema", "TypedObject", "ViewType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "type", "Schema", "ExplorerAction", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "Create", "Schema", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "ViewType"]
7
- }
@@ -1,21 +0,0 @@
1
- // src/meta.ts
2
- var EXPLORER_PLUGIN = "dxos.org/plugin/explorer";
3
- var meta = {
4
- id: EXPLORER_PLUGIN,
5
- name: "Explorer",
6
- description: "Install this plugin to view a hypergraph of all objects inside of your Space.",
7
- icon: "ph--graph--regular",
8
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer",
9
- tags: [
10
- "labs"
11
- ],
12
- screenshots: [
13
- "https://dxos.network/plugin-details-explorer-dark.png"
14
- ]
15
- };
16
-
17
- export {
18
- EXPLORER_PLUGIN,
19
- meta
20
- };
21
- //# sourceMappingURL=chunk-UL5EDJPE.mjs.map
@@ -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 EXPLORER_PLUGIN = 'dxos.org/plugin/explorer';\n\nexport const meta: PluginMeta = {\n id: EXPLORER_PLUGIN,\n name: 'Explorer',\n description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',\n icon: 'ph--graph--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
5
- "mappings": ";AAMO,IAAMA,kBAAkB;AAExB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
6
- "names": ["EXPLORER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
7
- }
@@ -1,24 +0,0 @@
1
- import {
2
- ExplorerAction,
3
- ViewType
4
- } from "./chunk-CZZ3DDR7.mjs";
5
- import "./chunk-UL5EDJPE.mjs";
6
-
7
- // src/capabilities/intent-resolver.ts
8
- import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
9
- import { Obj } from "@dxos/echo";
10
- var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
11
- intent: ExplorerAction.Create,
12
- resolve: ({ name }) => ({
13
- data: {
14
- object: Obj.make(ViewType, {
15
- name,
16
- type: ""
17
- })
18
- }
19
- })
20
- }));
21
- export {
22
- intent_resolver_default as default
23
- };
24
- //# sourceMappingURL=intent-resolver-7MVEYNX7.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ExplorerAction, ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ExplorerAction.Create,\n resolve: ({ name }) => ({\n data: { object: Obj.make(ViewType, { name, type: '' }) },\n }),\n }),\n );\n"],
5
- "mappings": ";;;;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,WAAW;AAIpB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,QAAQC,IAAIC,KAAKC,UAAU;QAAEL;QAAMM,MAAM;MAAG,CAAA;IAAG;EACzD;AACF,CAAA,CAAA;",
6
- "names": ["Capabilities", "contributes", "createResolver", "Obj", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ExplorerAction", "Create", "resolve", "name", "data", "object", "Obj", "make", "ViewType", "type"]
7
- }
@@ -1,31 +0,0 @@
1
- import {
2
- ExplorerContainer
3
- } from "./chunk-VNOGW2JS.mjs";
4
- import "./chunk-3YITRGGW.mjs";
5
- import {
6
- ViewType
7
- } from "./chunk-CZZ3DDR7.mjs";
8
- import {
9
- EXPLORER_PLUGIN
10
- } from "./chunk-UL5EDJPE.mjs";
11
-
12
- // src/capabilities/react-surface.tsx
13
- import React from "react";
14
- import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
15
- import { Obj } from "@dxos/echo";
16
- var react_surface_default = () => contributes(Capabilities.ReactSurface, createSurface({
17
- id: `${EXPLORER_PLUGIN}/article`,
18
- role: [
19
- "article",
20
- "section"
21
- ],
22
- filter: (data) => Obj.instanceOf(ViewType, data.subject),
23
- component: ({ data, role }) => /* @__PURE__ */ React.createElement(ExplorerContainer, {
24
- view: data.subject,
25
- role
26
- })
27
- }));
28
- export {
29
- react_surface_default as default
30
- };
31
- //# sourceMappingURL=react-surface-VLGQKYBI.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ExplorerContainer } from '../components';\nimport { EXPLORER_PLUGIN } from '../meta';\nimport { ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: `${EXPLORER_PLUGIN}/article`,\n role: ['article', 'section'],\n filter: (data): data is { subject: ViewType } => Obj.instanceOf(ViewType, data.subject),\n component: ({ data, role }) => <ExplorerContainer view={data.subject} role={role} />,\n }),\n );\n"],
5
- "mappings": ";;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AAMpB,IAAA,wBAAe,MACbC,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAI,GAAGC,eAAAA;EACPC,MAAM;IAAC;IAAW;;EAClBC,QAAQ,CAACC,SAAwCC,IAAIC,WAAWC,UAAUH,KAAKI,OAAO;EACtFC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAO,sBAAA,cAACQ,mBAAAA;IAAkBC,MAAMP,KAAKI;IAASN;;AACxE,CAAA,CAAA;",
6
- "names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "EXPLORER_PLUGIN", "role", "filter", "data", "Obj", "instanceOf", "ViewType", "subject", "component", "ExplorerContainer", "view"]
7
- }
@@ -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 from 'react';\n\nimport { useGlobalSearch } from '@dxos/plugin-search';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { useGraphModel } from '../hooks';\nimport { type ViewType } from '../types';\n\nimport { D3ForceGraph } from './Graph';\n\ntype ExplorerContainerProps = {\n role: string;\n view: ViewType;\n};\n\nconst ExplorerContainer = ({ role, view }: ExplorerContainerProps) => {\n const space = getSpace(view);\n const model = useGraphModel(space);\n const { match } = useGlobalSearch();\n\n if (!space || !model) {\n return null;\n }\n\n return (\n <StackItem.Content size={role === 'section' ? 'square' : 'intrinsic'}>\n <D3ForceGraph model={model} match={match} />\n </StackItem.Content>\n );\n};\n\nexport default ExplorerContainer;\n"],
5
- "mappings": ";;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAY1B,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,KAAI,MAA0B;;;AAC/D,UAAMC,QAAQC,SAASF,IAAAA;AACvB,UAAMG,QAAQC,cAAcH,KAAAA;AAC5B,UAAM,EAAEI,MAAK,IAAKC,gBAAAA;AAElB,QAAI,CAACL,SAAS,CAACE,OAAO;AACpB,aAAO;IACT;AAEA,WACE,sBAAA,cAACI,UAAUC,SAAO;MAACC,MAAMV,SAAS,YAAY,WAAW;OACvD,sBAAA,cAACW,cAAAA;MAAaP;MAAcE;;;;;AAGlC;AAEA,IAAA,4BAAeP;",
6
- "names": ["React", "useGlobalSearch", "getSpace", "StackItem", "ExplorerContainer", "role", "view", "space", "getSpace", "model", "useGraphModel", "match", "useGlobalSearch", "StackItem", "Content", "size", "D3ForceGraph"]
7
- }
@@ -1,39 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- EXPLORER_PLUGIN
4
- } from "./chunk-PIAXA43R.mjs";
5
-
6
- // src/types/schema.ts
7
- import { Schema } from "effect";
8
- import { TypedObject } from "@dxos/echo-schema";
9
- var ViewType = class extends TypedObject({
10
- typename: "dxos.org/type/ExplorerView",
11
- version: "0.1.0"
12
- })({
13
- name: Schema.optional(Schema.String),
14
- type: Schema.String
15
- }) {
16
- };
17
-
18
- // src/types/types.ts
19
- import { Schema as Schema2 } from "effect";
20
- (function(ExplorerAction2) {
21
- const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;
22
- class Create extends Schema2.TaggedClass()(`${EXPLORER_ACTION}/create`, {
23
- input: Schema2.Struct({
24
- name: Schema2.optional(Schema2.String)
25
- }),
26
- output: Schema2.Struct({
27
- object: ViewType
28
- })
29
- }) {
30
- }
31
- ExplorerAction2.Create = Create;
32
- })(ExplorerAction || (ExplorerAction = {}));
33
- var ExplorerAction;
34
-
35
- export {
36
- ViewType,
37
- ExplorerAction
38
- };
39
- //# sourceMappingURL=chunk-4GWDNZ4Z.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Clashes with sdk/view.\nexport class ViewType extends TypedObject({\n typename: 'dxos.org/type/ExplorerView',\n version: '0.1.0',\n})({\n name: Schema.optional(Schema.String),\n type: Schema.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { EXPLORER_PLUGIN } from '../meta';\n\nimport { ViewType } from './schema';\n\nexport namespace ExplorerAction {\n const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ViewType,\n }),\n }) {}\n}\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,cAAc;AAEvB,SAASC,mBAAmB;AAGrB,IAAMC,WAAN,cAAuBC,YAAY;EACxCC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,MAAMC,OAAOC,SAASD,OAAOE,MAAM;EACnCC,MAAMH,OAAOE;AACf,CAAA,EAAA;AAAI;;;ACXJ,SAASE,UAAAA,eAAc;UAMNC,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,eAAAA;EAEpB,MAAMC,eAAeC,QAAOC,YAAW,EAAW,GAAGJ,eAAAA,WAA0B;IACpFK,OAAOF,QAAOG,OAAO;MACnBC,MAAMJ,QAAOK,SAASL,QAAOM,MAAM;IACrC,CAAA;IACAC,QAAQP,QAAOG,OAAO;MACpBK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSV,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
6
- "names": ["Schema", "TypedObject", "ViewType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "type", "Schema", "ExplorerAction", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "Create", "Schema", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "ViewType"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/Graph/D3ForceGraph.tsx", "../../../src/components/Graph/ForceGraph.tsx", "../../../src/components/Graph/adapter.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { SelectionModel } from '@dxos/graph';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n type GraphController,\n GraphForceProjector,\n type GraphLayoutNode,\n type GraphProps,\n SVG,\n type SVGContext,\n} from '@dxos/react-ui-graph';\nimport { getHashColor } from '@dxos/react-ui-theme';\nimport { type SpaceGraphEdge, type SpaceGraphModel, type SpaceGraphNode } from '@dxos/schema';\n\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nexport type D3ForceGraphProps = ThemedClassName<\n {\n model?: SpaceGraphModel;\n match?: RegExp;\n selection?: SelectionModel;\n grid?: boolean;\n } & Pick<GraphProps, 'drag'>\n>;\n\nexport const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selection: _selection, grid, ...props }) => {\n const context = useRef<SVGContext>(null);\n const projector = useMemo<GraphForceProjector | undefined>(() => {\n if (context.current) {\n return new GraphForceProjector(context.current, {\n attributes: {\n linkForce: (edge) => {\n // TODO(burdon): Check type (currently assumes Employee property).\n // Edge shouldn't contribute to force if it's not active.\n return edge.data?.object?.active !== false;\n },\n },\n forces: {\n point: {\n strength: 0.01,\n },\n },\n });\n }\n }, [context.current]);\n\n const graph = useRef<GraphController>(null);\n const selection = useMemo(() => _selection ?? new SelectionModel(), [_selection]);\n useEffect(() => graph.current?.repaint(), [selection.selected.value]);\n\n const handleSelect = useCallback<NonNullable<GraphProps['onSelect']>>(\n (node) => {\n if (selection.contains(node.id)) {\n selection.remove(node.id);\n } else {\n selection.add(node.id);\n }\n },\n [selection],\n );\n\n return (\n <SVG.Root ref={context} classNames={classNames}>\n <SVG.Markers />\n {grid && <SVG.Grid axis />}\n <SVG.Zoom extent={[1 / 2, 2]}>\n <SVG.Graph<SpaceGraphNode, SpaceGraphEdge>\n {...props}\n ref={graph}\n model={model}\n projector={projector}\n labels={{\n text: (node) => {\n return node.data?.data.label ?? node.id;\n },\n }}\n attributes={{\n node: (node: GraphLayoutNode<SpaceGraphNode>) => {\n const obj = node.data?.data.object;\n return {\n data: {\n color: getHashColor(obj && Obj.getTypename(obj))?.color,\n },\n classes: {\n 'dx-selected': selection.contains(node.id),\n },\n };\n },\n }}\n onSelect={handleSelect}\n />\n </SVG.Zoom>\n </SVG.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { forceLink, forceManyBody } from 'd3';\nimport NativeForceGraph from 'force-graph';\nimport React, { type FC, useEffect, useRef, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type SearchResult, filterObjectsSync } from '@dxos/plugin-search';\nimport { type SpaceGraphModel } from '@dxos/schema';\n\nimport { GraphAdapter } from './adapter';\n\nexport type ForceGraphProps = {\n model?: SpaceGraphModel;\n match?: RegExp;\n};\n\nexport const ForceGraph: FC<ForceGraphProps> = ({ model, match }) => {\n const { ref, width, height } = useResizeDetector({ refreshRate: 200 });\n const rootRef = useRef<HTMLDivElement>(null);\n const forceGraph = useRef<NativeForceGraph>();\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n\n const [data, setData] = useState<GraphAdapter>();\n useEffect(() => {\n return model?.subscribe((model) => {\n setData(new GraphAdapter(model.graph));\n });\n }, [model]);\n\n useEffect(() => {\n if (rootRef.current) {\n // https://github.com/vasturiano/force-graph\n // https://github.com/vasturiano/3d-force-graph\n forceGraph.current = new NativeForceGraph(rootRef.current)\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#node-styling\n .nodeRelSize(6)\n .nodeLabel((node: any) => (node.type === 'schema' ? node.data.typename : (node.data.label ?? node.id)))\n .nodeAutoColorBy((node: any) => (node.type === 'schema' ? 'schema' : node.data.typename))\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#link-styling\n .linkAutoColorBy((link: any) => link.type);\n }\n\n return () => {\n forceGraph.current?.pauseAnimation().graphData({ nodes: [], links: [] });\n forceGraph.current = undefined;\n };\n }, []);\n\n useEffect(() => {\n if (!data || !width || !height || !forceGraph.current) {\n return;\n }\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#container-layout\n forceGraph.current\n .pauseAnimation()\n .width(width)\n .height(height)\n .onEngineStop(() => {\n handleZoomToFit();\n })\n .onNodeClick((node: any) => {\n forceGraph.current?.emitParticle(node);\n })\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#force-engine-d3-force-configuration\n // .d3Force('center', forceCenter().strength(0.9))\n .d3Force('link', forceLink().distance(160).strength(0.5))\n .d3Force('charge', forceManyBody().strength(-30))\n\n .graphData(data)\n .warmupTicks(100)\n .cooldownTime(1_000)\n .resumeAnimation();\n }, [data, width, height, forceGraph.current]);\n\n const handleZoomToFit = () => {\n forceGraph.current?.zoomToFit(400, 40);\n };\n\n return (\n <div ref={ref} className='relative grow' onClick={handleZoomToFit}>\n <div ref={rootRef} className='absolute inset-0' />\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Graph } from '@dxos/graph';\n\nexport type GraphNode = {\n id?: string;\n};\n\nexport type GraphLink = {\n source?: string;\n target?: string;\n};\n\nexport type GraphData = {\n nodes: GraphNode[];\n links: GraphLink[];\n};\n\n/**\n * Map common graph to force-graph format.\n */\nexport class GraphAdapter implements GraphData {\n private readonly _nodes: GraphNode[] = [];\n private readonly _links: GraphLink[] = [];\n\n constructor(private readonly graph: Graph) {\n this._nodes = graph.nodes.map((node) => ({\n id: node.id,\n type: node.type,\n data: node.data,\n }));\n\n this._links = graph.edges.map((edge) => ({\n type: edge.type,\n source: edge.source,\n target: edge.target,\n data: edge.data,\n }));\n }\n\n get nodes() {\n return this._nodes;\n }\n\n get links() {\n return this._links;\n }\n}\n"],
5
- "mappings": ";;;;AAIA,OAAOA,SAAkBC,aAAaC,WAAWC,SAASC,cAAc;AAExE,SAASC,WAAW;AACpB,SAASC,sBAAsB;AAE/B,SAEEC,qBAGAC,WAEK;AACP,SAASC,oBAAoB;AAG7B,OAAO;AAWA,IAAMC,eAAsC,CAAC,EAAEC,YAAYC,OAAOC,WAAWC,YAAYC,MAAM,GAAGC,MAAAA,MAAO;;;AAC9G,UAAMC,UAAUC,OAAmB,IAAA;AACnC,UAAMC,YAAYC,QAAyC,MAAA;AACzD,UAAIH,QAAQI,SAAS;AACnB,eAAO,IAAIC,oBAAoBL,QAAQI,SAAS;UAC9CE,YAAY;YACVC,WAAW,CAACC,SAAAA;A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C,OAAAA;MAAIjD,KAAKK;MAAS6C,WAAU;;;;;AAGnC;",
6
- "names": ["React", "useCallback", "useEffect", "useMemo", "useRef", "Obj", "SelectionModel", "GraphForceProjector", "SVG", "getHashColor", "D3ForceGraph", "classNames", "model", "selection", "_selection", "grid", "props", "context", "useRef", "projector", "useMemo", "current", "GraphForceProjector", "attributes", "linkForce", "edge", "data", "object", "active", "forces", "point", "strength", "graph", "SelectionModel", "useEffect", "repaint", "selected", "value", "handleSelect", "useCallback", "node", "contains", "id", "remove", "add", "SVG", "Root", "ref", "Markers", "Grid", "axis", "Zoom", "extent", "Graph", "labels", "text", "label", "obj", "color", "getHashColor", "Obj", "getTypename", "classes", "onSelect", "forceLink", "forceManyBody", "NativeForceGraph", "React", "useEffect", "useRef", "useState", "useResizeDetector", "filterObjectsSync", "GraphAdapter", "nodes", "_nodes", "links", "_links", "graph", "map", "node", "id", "type", "data", "edges", "edge", "source", "target", "ForceGraph", "model", "match", "ref", "width", "height", "useResizeDetector", "refreshRate", "rootRef", "useRef", "forceGraph", "filteredRef", "current", "filterObjectsSync", "objects", "data", "setData", "useState", "useEffect", "subscribe", "GraphAdapter", "graph", "NativeForceGraph", "nodeRelSize", "nodeLabel", "node", "type", "typename", "label", "id", "nodeAutoColorBy", "linkAutoColorBy", "link", "pauseAnimation", "graphData", "nodes", "links", "undefined", "onEngineStop", "handleZoomToFit", "onNodeClick", "emitParticle", "d3Force", "forceLink", "distance", "strength", "forceManyBody", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "React", "div", "className", "onClick"]
7
- }
@@ -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 EXPLORER_PLUGIN = 'dxos.org/plugin/explorer';\n\nexport const meta: PluginMeta = {\n id: EXPLORER_PLUGIN,\n name: 'Explorer',\n description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',\n icon: 'ph--graph--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
5
- "mappings": ";;;AAMO,IAAMA,kBAAkB;AAExB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
6
- "names": ["EXPLORER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
7
- }