@ts-graphviz/react 0.10.6 → 0.11.1

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 (54) hide show
  1. package/CHANGELOG.md +497 -0
  2. package/README.md +630 -67
  3. package/example/example.tsx +1 -1
  4. package/lib/react.d.ts +198 -96
  5. package/lib/react.js +558 -215
  6. package/package.json +15 -20
  7. package/tsconfig.test.json +11 -0
  8. package/lib/react.cjs +0 -457
  9. package/src/components/Digraph.spec.tsx +0 -18
  10. package/src/components/Digraph.tsx +0 -41
  11. package/src/components/Edge.tsx +0 -17
  12. package/src/components/Graph.spec.tsx +0 -18
  13. package/src/components/Graph.tsx +0 -36
  14. package/src/components/GraphPortal.tsx +0 -22
  15. package/src/components/Node.spec.tsx +0 -101
  16. package/src/components/Node.tsx +0 -21
  17. package/src/components/Subgraph.tsx +0 -30
  18. package/src/contexts/CurrentGraph.ts +0 -5
  19. package/src/contexts/GraphContainer.ts +0 -5
  20. package/src/contexts/GraphMap.ts +0 -5
  21. package/src/contexts/GraphvizContext.ts +0 -11
  22. package/src/hooks/__tests__/wrapper.tsx +0 -58
  23. package/src/hooks/useCurrentGraph.spec.ts +0 -56
  24. package/src/hooks/useCurrentGraph.ts +0 -18
  25. package/src/hooks/useDigraph.spec.ts +0 -15
  26. package/src/hooks/useDigraph.ts +0 -33
  27. package/src/hooks/useEdge.spec.ts +0 -46
  28. package/src/hooks/useEdge.ts +0 -35
  29. package/src/hooks/useGraph.spec.ts +0 -15
  30. package/src/hooks/useGraph.ts +0 -33
  31. package/src/hooks/useGraphAttributes.ts +0 -32
  32. package/src/hooks/useGraphContainer.spec.ts +0 -45
  33. package/src/hooks/useGraphContainer.ts +0 -10
  34. package/src/hooks/useGraphMap.ts +0 -7
  35. package/src/hooks/useGraphvizContext.spec.ts +0 -26
  36. package/src/hooks/useGraphvizContext.ts +0 -16
  37. package/src/hooks/useHasAttributes.ts +0 -16
  38. package/src/hooks/useHasComment.ts +0 -8
  39. package/src/hooks/useNode.spec.ts +0 -16
  40. package/src/hooks/useNode.ts +0 -29
  41. package/src/hooks/useRenderedID.spec.tsx +0 -28
  42. package/src/hooks/useRenderedID.ts +0 -6
  43. package/src/hooks/useSubgraph.spec.ts +0 -41
  44. package/src/hooks/useSubgraph.ts +0 -39
  45. package/src/react.ts +0 -16
  46. package/src/reconciler.ts +0 -272
  47. package/src/render.test.tsx +0 -71
  48. package/src/render.ts +0 -142
  49. package/src/renderHTMLLike.ts +0 -9
  50. package/src/renderId.ts +0 -9
  51. package/src/types.ts +0 -107
  52. package/tsconfig.json +0 -8
  53. package/typedoc.json +0 -5
  54. package/vite.config.ts +0 -31
package/src/types.ts DELETED
@@ -1,107 +0,0 @@
1
- import type {
2
- EdgeAttributesObject,
3
- EdgeTargetLikeTuple,
4
- GraphAttributesObject,
5
- HTMLLikeLabel,
6
- HasComment,
7
- NodeAttributesObject,
8
- SubgraphAttributesObject,
9
- } from '@ts-graphviz/common';
10
- import type { ReactElement, ReactNode } from 'react';
11
-
12
- /** Common attribute values of objects under cluster */
13
- export interface GraphBaseAttributesProps {
14
- /** Attribute value for Edges */
15
- edge?: EdgeAttributesObject;
16
- /** Attribute value for Nodes */
17
- node?: NodeAttributesObject;
18
- /** Attribute value for Graphs */
19
- graph?: SubgraphAttributesObject;
20
- }
21
-
22
- /** Options for RootGraph */
23
- export interface RootGraphOptions
24
- extends GraphAttributesObject,
25
- GraphBaseAttributesProps {
26
- /** Cluster id */
27
- id?: string;
28
- }
29
-
30
- /** Options for Subgraph */
31
- export interface SubgraphOptions
32
- extends SubgraphAttributesObject,
33
- GraphBaseAttributesProps,
34
- HasComment {
35
- /** Cluster id */
36
- id?: string;
37
- }
38
-
39
- /** Options for Edge */
40
- export interface EdgeOptions extends EdgeAttributesObject {}
41
-
42
- /** Options for Node */
43
- export interface NodeOptions extends NodeAttributesObject {}
44
-
45
- /** Props for RootGraph component */
46
- export interface RootGraphProps extends Omit<RootGraphOptions, 'label'> {
47
- label?: ReactElement | string;
48
- children?: ReactNode;
49
- }
50
-
51
- /** Props for Edge component */
52
- export interface EdgeProps extends Omit<EdgeOptions, 'label'> {
53
- /** Edge targets */
54
- targets: EdgeTargetLikeTuple;
55
- /** Edge label */
56
- label?: ReactElement | string;
57
- }
58
-
59
- /** Props for Node component */
60
- export interface NodeProps extends Omit<NodeOptions, 'label' | 'xlabel'> {
61
- /** Node id */
62
- id: string;
63
- /** Node label */
64
- label?: ReactElement | string;
65
- /** Node xlabel */
66
- xlabel?: ReactElement | string;
67
- }
68
-
69
- /** Props for Subgraph component */
70
- export interface SubgraphProps extends Omit<SubgraphOptions, 'label'> {
71
- /** Subgraph label */
72
- label?: ReactElement | string;
73
- children?: ReactNode;
74
- }
75
-
76
- /** Props for GraphPortal component */
77
- export interface GraphPortalProps {
78
- /**
79
- * id of the cluster you want to target for the portal.
80
- * If not specified, target the cluster that is the container to the portal.
81
- */
82
- id?: string;
83
- children?: ReactNode;
84
- }
85
-
86
- declare global {
87
- namespace JSX {
88
- interface IntrinsicElements {
89
- 'dot:port': { children: string };
90
- 'dot:table': HTMLLikeLabel.TableAttributes & { children?: ReactNode };
91
- 'dot:tr': HTMLLikeLabel.TrAttributes & { children?: ReactNode };
92
- 'dot:td': HTMLLikeLabel.TdAttributes & { children?: ReactNode };
93
- 'dot:font': HTMLLikeLabel.FontAttributes & { children?: ReactNode };
94
- 'dot:br': HTMLLikeLabel.BrAttributes;
95
- 'dot:img': HTMLLikeLabel.ImgAttributes;
96
- 'dot:i': HTMLLikeLabel.IAttributes & { children?: ReactNode };
97
- 'dot:b': HTMLLikeLabel.BAttributes & { children?: ReactNode };
98
- 'dot:u': HTMLLikeLabel.UAttributes & { children?: ReactNode };
99
- 'dot:o': HTMLLikeLabel.OAttributes & { children?: ReactNode };
100
- 'dot:sub': HTMLLikeLabel.SubAttributes & { children?: ReactNode };
101
- 'dot:sup': HTMLLikeLabel.SupAttributes & { children?: ReactNode };
102
- 'dot:s': HTMLLikeLabel.SAttributes & { children?: ReactNode };
103
- 'dot:hr': HTMLLikeLabel.HrAttributes;
104
- 'dot:vr': HTMLLikeLabel.VrAttributes;
105
- }
106
- }
107
- }
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "lib",
5
- "jsx": "react-jsx"
6
- },
7
- "include": ["src/**/*.ts", "src/**/*.tsx"]
8
- }
package/typedoc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://typedoc.org/schema.json",
3
- "includeVersion": true,
4
- "entryPoints": ["src/react.ts"]
5
- }
package/vite.config.ts DELETED
@@ -1,31 +0,0 @@
1
- import dts from 'vite-plugin-dts';
2
- import { defineConfig } from 'vitest/config';
3
-
4
- export default defineConfig({
5
- build: {
6
- target: 'ES2022',
7
- outDir: './lib',
8
- minify: false,
9
- lib: {
10
- entry: {
11
- react: './src/react.ts',
12
- },
13
- formats: ['es', 'cjs'],
14
- },
15
- rollupOptions: {
16
- external: [
17
- 'react',
18
- 'react/jsx-runtime',
19
- 'react-dom',
20
- 'react-dom/server',
21
- 'react-reconciler',
22
- 'ts-graphviz',
23
- ],
24
- },
25
- },
26
- plugins: [
27
- dts({
28
- rollupTypes: true,
29
- }),
30
- ],
31
- });