@relation-graph/vue3 3.0.11 → 3.0.13

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 (52) hide show
  1. package/README-zh.md +9 -9
  2. package/README.md +9 -9
  3. package/package.json +4 -4
  4. package/relation-graph.js +10 -79
  5. package/relation-graph.mjs +5489 -4227
  6. package/relation-graph.ssr.mjs +5489 -4227
  7. package/relation-graph.umd.js +10 -79
  8. package/style.css +1 -1
  9. package/types/packages/platforms/react/src/index.d.ts +1 -1
  10. package/types/packages/platforms/react/src/index.shared.d.ts +33 -22
  11. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGFakeNode.d.ts +3 -3
  12. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLinePath.d.ts +3 -4
  13. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLineText.d.ts +2 -4
  14. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectSource.d.ts +2 -2
  15. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectTarget.d.ts +2 -2
  16. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingConnectController.d.ts +2 -2
  17. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingLineController.d.ts +2 -2
  18. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNearNodeWidget.d.ts +2 -2
  19. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNodeController.d.ts +4 -2
  20. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnCanvas.d.ts +2 -2
  21. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnCanvasAbove.d.ts +2 -2
  22. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnLineText.d.ts +3 -3
  23. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnNodeExpandHandle.d.ts +2 -2
  24. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnView.d.ts +2 -2
  25. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphBackground.d.ts +2 -2
  26. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphToolBar.d.ts +2 -2
  27. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphWatermark.d.ts +2 -2
  28. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphXsToolBar.d.ts +2 -2
  29. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/RGDebugView.d.ts +2 -2
  30. package/types/packages/platforms/svelte/src/hooks/useGraphInstance.d.ts +2 -2
  31. package/types/packages/platforms/svelte/src/index.d.ts +1 -1
  32. package/types/packages/platforms/vue2/src/core4vue/RGCanvas.vue.d.ts +1 -0
  33. package/types/packages/platforms/vue2/src/core4vue/RelationGraphUI.vue.d.ts +0 -1
  34. package/types/packages/platforms/vue2/src/core4vue/RelationLinker.vue.d.ts +1 -1
  35. package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectTarget.vue.d.ts +33 -2
  36. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingNodeController.vue.d.ts +14 -2
  37. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphWatermark.vue.d.ts +1 -1
  38. package/types/packages/platforms/vue2/src/index.d.ts +49 -6
  39. package/types/packages/platforms/vue3/src/index.d.ts +1 -1
  40. package/types/packages/relation-graph-models/data/RGLineDataUtils.d.ts +140 -4
  41. package/types/packages/relation-graph-models/data/RGNodeDataUtils.d.ts +7 -2
  42. package/types/packages/relation-graph-models/models/RelationGraphBase.d.ts +8 -1
  43. package/types/packages/relation-graph-models/models/RelationGraphWith1View.d.ts +9 -6
  44. package/types/packages/relation-graph-models/models/RelationGraphWith2Data4ConnectTarget.d.ts +73 -5
  45. package/types/packages/relation-graph-models/models/RelationGraphWith2Data5LineConfig.d.ts +20 -2
  46. package/types/packages/relation-graph-models/models/RelationGraphWith6Layout.d.ts +7 -3
  47. package/types/packages/relation-graph-models/models/RelationGraphWith7Event.d.ts +3 -2
  48. package/types/packages/relation-graph-models/models/RelationGraphWith95Dom.d.ts +24 -4
  49. package/types/packages/relation-graph-models/models/RelationGraphWith99API.d.ts +5 -3
  50. package/types/packages/relation-graph-models/models/RelationGraphWith9EasyView.d.ts +1 -0
  51. package/types/packages/relation-graph-models/utils/RGClassAndRender.d.ts +111 -0
  52. package/types/packages/types.ts +25 -1
@@ -15,6 +15,7 @@ export declare class RelationGraphWith9EasyView extends RelationGraphWith7Event
15
15
  * @private
16
16
  */
17
17
  setEasyViewCanvas(canvas: HTMLCanvasElement): void;
18
+ protected updateMiniView(): void;
18
19
  /**
19
20
  * relation-graph internal call, please do not use externally
20
21
  * @inner
@@ -0,0 +1,111 @@
1
+ import { JsonLine, JsonNode, RGFakeLine, RGLine, RGLink, RGNode, RGOptions } from '../../types';
2
+ export type RGAnalyzeRenderedGraphOptions = {
3
+ waitForStable?: boolean;
4
+ timeoutMs?: number;
5
+ stableFrames?: number;
6
+ includeNormalizedHtml?: boolean;
7
+ };
8
+ export type RGRenderDescriptorNode = {
9
+ kind: 'element';
10
+ tag: string;
11
+ classes: string[];
12
+ attrs: Record<string, string>;
13
+ children: RGRenderDescriptorNode[];
14
+ } | {
15
+ kind: 'text';
16
+ text: string;
17
+ };
18
+ export type RGNodeStyleClass = {
19
+ id: string;
20
+ signature: string;
21
+ style: Record<string, string>;
22
+ nodeIds: string[];
23
+ };
24
+ export type RGNodeRenderClass = {
25
+ id: string;
26
+ signature: string;
27
+ renderDescriptor: RGRenderDescriptorNode;
28
+ renderStyleRules: RGRenderStyleRule[];
29
+ renderKeyframes: RGRenderKeyframes[];
30
+ normalizedHtml?: string;
31
+ nodeIds: string[];
32
+ };
33
+ export type RGRenderStylePseudo = 'self' | 'before' | 'after';
34
+ export type RGRenderStyleRule = {
35
+ path: string;
36
+ pseudo: RGRenderStylePseudo;
37
+ style: Record<string, string>;
38
+ };
39
+ export type RGRenderKeyframes = {
40
+ name: string;
41
+ cssText: string;
42
+ };
43
+ export type RGLinePathStyle = {
44
+ stroke: string;
45
+ strokeWidth: string;
46
+ strokeDasharray: string;
47
+ strokeDashoffset: string;
48
+ opacity: string;
49
+ };
50
+ export type RGLineTextStyle = {
51
+ mode: 'html-label' | 'svg-text-path' | 'none';
52
+ backgroundColor: string;
53
+ fontSize: string;
54
+ color: string;
55
+ };
56
+ export type RGLineStyleClass = {
57
+ id: string;
58
+ signature: string;
59
+ pathStyle: RGLinePathStyle;
60
+ textStyle: RGLineTextStyle;
61
+ lineIds: string[];
62
+ };
63
+ export type RGClassifiedNodeItem = JsonNode & {
64
+ nodeId: string;
65
+ styleClassId: string;
66
+ renderClassId: string;
67
+ };
68
+ export type RGClassifiedLineItem = JsonLine & {
69
+ lineId: string;
70
+ styleClassId: string;
71
+ isFakeLine: boolean;
72
+ textMode: 'html-label' | 'svg-text-path' | 'none';
73
+ };
74
+ export type RGRenderedGraphAnalysisMeta = {
75
+ degraded: boolean;
76
+ reason?: string;
77
+ warnings: string[];
78
+ renderedAt: number;
79
+ };
80
+ export type RGAnalyzeRenderedGraphResult = {
81
+ meta: RGRenderedGraphAnalysisMeta;
82
+ nodeStyleClasses: RGNodeStyleClass[];
83
+ nodeRenderClasses: RGNodeRenderClass[];
84
+ lineStyleClasses: RGLineStyleClass[];
85
+ nodes: RGClassifiedNodeItem[];
86
+ lines: RGClassifiedLineItem[];
87
+ };
88
+ export type RGRenderedGraphAnalysisContext = {
89
+ dom?: HTMLDivElement;
90
+ canvasDom?: HTMLDivElement;
91
+ instanceId: string;
92
+ graphOptions: RGOptions;
93
+ performanceMode: boolean;
94
+ showEasyView: boolean;
95
+ sleep: (time: number) => Promise<void>;
96
+ getNodeById: (id: string) => RGNode | undefined;
97
+ getLineById: (id: string) => RGLine | undefined;
98
+ getLinkByLineId: (id: string) => RGLink | undefined;
99
+ getFakeLineById: (id: string) => RGFakeLine | undefined;
100
+ };
101
+ /** @deprecated Use RGAnalyzeRenderedGraphOptions instead. */
102
+ export type RGGetClassAndRenderOptions = RGAnalyzeRenderedGraphOptions;
103
+ /** @deprecated Use RGRenderedGraphAnalysisMeta instead. */
104
+ export type RGClassAndRenderMeta = RGRenderedGraphAnalysisMeta;
105
+ /** @deprecated Use RGAnalyzeRenderedGraphResult instead. */
106
+ export type RGClassAndRenderResult = RGAnalyzeRenderedGraphResult;
107
+ /** @deprecated Use RGRenderedGraphAnalysisContext instead. */
108
+ export type RGClassAndRenderContext = RGRenderedGraphAnalysisContext;
109
+ export declare function analyzeRenderedGraphByDom(context: RGRenderedGraphAnalysisContext, options?: RGAnalyzeRenderedGraphOptions): Promise<RGAnalyzeRenderedGraphResult>;
110
+ /** @deprecated Use analyzeRenderedGraphByDom instead. */
111
+ export declare const collectClassAndRenderResult: typeof analyzeRenderedGraphByDom;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * relation-graph
3
3
  * Website: http://www.relation-graph.com/
4
- * Github: https://github.com/seeksdream/relation-graph
4
+ * Github: https://github.com/relation-graph/relation-graph
5
5
  */
6
6
 
7
7
  /**
@@ -82,6 +82,26 @@ export type RGConnectTargetData = {
82
82
  offsetPercentY: number;
83
83
  targetData: Record<string, any>;
84
84
  };
85
+ /**
86
+ * DOM rendering mode for <RGConnectTarget />
87
+ */
88
+ export type RGConnectTargetDomMode = 'wrap' | 'contents';
89
+ /**
90
+ * Registration options used internally by relation-graph to manage connect targets
91
+ * @inner
92
+ */
93
+ export type RGRegisterConnectTargetOptions = {
94
+ hostEl: Element;
95
+ targetId: string;
96
+ targetType: string;
97
+ junctionPoint?: RGJunctionPoint;
98
+ targetData?: Record<string, any>;
99
+ triggerEl?: Element;
100
+ measureEl?: Element;
101
+ domMode?: RGConnectTargetDomMode;
102
+ measureSelector?: string;
103
+ strictMeasureTarget?: boolean;
104
+ };
85
105
  /**
86
106
  * Resize handle positions for relation-graph
87
107
  * @inner
@@ -179,6 +199,7 @@ export type RGLineTarget = RGRectTarget & {
179
199
  id?: string // Like node.text
180
200
  text?: string; // Like node.text
181
201
  targetType: RGInnerConnectTargetType | string
202
+ junctionPoint?: RGJunctionPoint
182
203
  targetData?: Record<string, any>
183
204
  hidden?: boolean
184
205
  };
@@ -979,6 +1000,9 @@ export interface RGConnectTargetProps {
979
1000
  className?: string;
980
1001
  forSvg?: boolean;
981
1002
  style?: Record<string, string | number | undefined>,
1003
+ domMode?: RGConnectTargetDomMode;
1004
+ measureSelector?: string;
1005
+ strictMeasureTarget?: boolean;
982
1006
  }
983
1007
 
984
1008
  /**