jvs-draw 1.1.13 → 1.1.14
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/App.vue.d.ts +8 -1
- package/dist/components/BoardName.vue.d.ts +17 -1
- package/dist/config.d.ts +9 -0
- package/dist/core/element.d.ts +1 -1
- package/dist/jvs-draw.css +1 -1
- package/dist/jvs-draw.es.js +19935 -9875
- package/dist/jvs-draw.umd.js +32 -23
- package/dist/jvs-ui-public/icon-fonts/iconfont.css +71 -3
- package/dist/jvs-ui-public/icon-fonts/iconfont.js +1 -1
- package/dist/jvs-ui-public/icon-fonts/iconfont.json +119 -0
- package/dist/jvs-ui-public/icon-fonts/iconfont.ttf +0 -0
- package/dist/jvs-ui-public/icon-fonts/iconfont.woff +0 -0
- package/dist/jvs-ui-public/icon-fonts/iconfont.woff2 +0 -0
- package/dist/locales/en-US.d.ts +11 -0
- package/dist/locales/zh-CN.d.ts +11 -0
- package/dist/store/index.d.ts +23 -5
- package/dist/types/element.d.ts +2 -1
- package/dist/utils/aiDiagramStream.d.ts +2 -0
- package/dist/utils/export.d.ts +7 -0
- package/dist/utils/exportSVG.d.ts +6 -0
- package/dist/utils/isPointOnElement.d.ts +1 -1
- package/dist/utils/math.d.ts +9 -11
- package/dist/utils/pptxParser.d.ts +7 -0
- package/package.json +4 -1
- package/dist/elbow/algorithms/a-star.d.ts +0 -10
- package/dist/elbow/algorithms/data-structures/graph.d.ts +0 -14
- package/dist/elbow/algorithms/data-structures/index.d.ts +0 -2
- package/dist/elbow/algorithms/data-structures/priority-queue.d.ts +0 -16
- package/dist/elbow/algorithms/index.d.ts +0 -2
- package/dist/elbow/constants/default.d.ts +0 -10
- package/dist/elbow/constants/index.d.ts +0 -4
- package/dist/elbow/constants/media.d.ts +0 -6
- package/dist/elbow/constants/property.d.ts +0 -5
- package/dist/elbow/constants/resize.d.ts +0 -10
- package/dist/elbow/core.d.ts +0 -37
- package/dist/elbow/utils/elbow-line-route.d.ts +0 -38
- package/dist/elbow/utils/index.d.ts +0 -4
- package/dist/elbow/utils/line-path.d.ts +0 -7
- package/dist/elbow/utils/math.d.ts +0 -3
- package/dist/elbow/utils/vector.d.ts +0 -6
|
@@ -5,6 +5,125 @@
|
|
|
5
5
|
"css_prefix_text": "icon-",
|
|
6
6
|
"description": "",
|
|
7
7
|
"glyphs": [
|
|
8
|
+
{
|
|
9
|
+
"icon_id": "47388293",
|
|
10
|
+
"name": "语言",
|
|
11
|
+
"font_class": "yuyan",
|
|
12
|
+
"unicode": "ea2f",
|
|
13
|
+
"unicode_decimal": 59951
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"icon_id": "47388292",
|
|
17
|
+
"name": "Github",
|
|
18
|
+
"font_class": "Github",
|
|
19
|
+
"unicode": "ea30",
|
|
20
|
+
"unicode_decimal": 59952
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"icon_id": "47388239",
|
|
24
|
+
"name": "开源地址",
|
|
25
|
+
"font_class": "kaiyuandizhi",
|
|
26
|
+
"unicode": "ea27",
|
|
27
|
+
"unicode_decimal": 59943
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"icon_id": "47388237",
|
|
31
|
+
"name": "快捷键",
|
|
32
|
+
"font_class": "kuaijiejian1",
|
|
33
|
+
"unicode": "ea28",
|
|
34
|
+
"unicode_decimal": 59944
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"icon_id": "47388238",
|
|
38
|
+
"name": "分享",
|
|
39
|
+
"font_class": "fenxiang",
|
|
40
|
+
"unicode": "ea29",
|
|
41
|
+
"unicode_decimal": 59945
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"icon_id": "47388236",
|
|
45
|
+
"name": "软开企服",
|
|
46
|
+
"font_class": "ruankaiqifu",
|
|
47
|
+
"unicode": "ea2a",
|
|
48
|
+
"unicode_decimal": 59946
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"icon_id": "47388235",
|
|
52
|
+
"name": "搜索",
|
|
53
|
+
"font_class": "sousuo",
|
|
54
|
+
"unicode": "ea2b",
|
|
55
|
+
"unicode_decimal": 59947
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"icon_id": "47388234",
|
|
59
|
+
"name": "技术支持",
|
|
60
|
+
"font_class": "jishuzhichi",
|
|
61
|
+
"unicode": "ea2c",
|
|
62
|
+
"unicode_decimal": 59948
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"icon_id": "47388232",
|
|
66
|
+
"name": "Gitee",
|
|
67
|
+
"font_class": "Gitee",
|
|
68
|
+
"unicode": "ea2d",
|
|
69
|
+
"unicode_decimal": 59949
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"icon_id": "47388233",
|
|
73
|
+
"name": "导出",
|
|
74
|
+
"font_class": "daochu",
|
|
75
|
+
"unicode": "ea2e",
|
|
76
|
+
"unicode_decimal": 59950
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"icon_id": "38219878",
|
|
80
|
+
"name": "svg",
|
|
81
|
+
"font_class": "svg",
|
|
82
|
+
"unicode": "e6e6",
|
|
83
|
+
"unicode_decimal": 59110
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"icon_id": "38219879",
|
|
87
|
+
"name": "图片",
|
|
88
|
+
"font_class": "tupian1",
|
|
89
|
+
"unicode": "e6e2",
|
|
90
|
+
"unicode_decimal": 59106
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"icon_id": "47295393",
|
|
94
|
+
"name": "左下",
|
|
95
|
+
"font_class": "zuoxia",
|
|
96
|
+
"unicode": "ea22",
|
|
97
|
+
"unicode_decimal": 59938
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"icon_id": "47295392",
|
|
101
|
+
"name": "右下",
|
|
102
|
+
"font_class": "youxia",
|
|
103
|
+
"unicode": "ea23",
|
|
104
|
+
"unicode_decimal": 59939
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"icon_id": "47295391",
|
|
108
|
+
"name": "左上",
|
|
109
|
+
"font_class": "zuoshang",
|
|
110
|
+
"unicode": "ea24",
|
|
111
|
+
"unicode_decimal": 59940
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"icon_id": "47295390",
|
|
115
|
+
"name": "右上",
|
|
116
|
+
"font_class": "youshang",
|
|
117
|
+
"unicode": "ea25",
|
|
118
|
+
"unicode_decimal": 59941
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"icon_id": "47299940",
|
|
122
|
+
"name": "左下",
|
|
123
|
+
"font_class": "zuoxia-copy",
|
|
124
|
+
"unicode": "ea26",
|
|
125
|
+
"unicode_decimal": 59942
|
|
126
|
+
},
|
|
8
127
|
{
|
|
9
128
|
"icon_id": "40608578",
|
|
10
129
|
"name": "字间距",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/locales/en-US.d.ts
CHANGED
|
@@ -106,6 +106,15 @@ declare const _default: {
|
|
|
106
106
|
'board.showQuickCreateDesc': string;
|
|
107
107
|
'board.shortcuts': string;
|
|
108
108
|
'board.language': string;
|
|
109
|
+
'board.export': string;
|
|
110
|
+
'board.exportImage': string;
|
|
111
|
+
'board.exportSVG': string;
|
|
112
|
+
'board.exportAll': string;
|
|
113
|
+
'board.exportSelected': string;
|
|
114
|
+
'board.importPPTX': string;
|
|
115
|
+
'board.openSource': string;
|
|
116
|
+
'board.techSupport': string;
|
|
117
|
+
'board.more': string;
|
|
109
118
|
'help.shortcutsList': string;
|
|
110
119
|
'help.tools': string;
|
|
111
120
|
'help.handTool': string;
|
|
@@ -153,5 +162,7 @@ declare const _default: {
|
|
|
153
162
|
'floatingBar.strokeStyleText': string;
|
|
154
163
|
'floatingBar.lineWidth': string;
|
|
155
164
|
'floatingBar.strokeOpacity': string;
|
|
165
|
+
'floatingBar.exportImage': string;
|
|
166
|
+
'floatingBar.exportSVG': string;
|
|
156
167
|
};
|
|
157
168
|
export default _default;
|
package/dist/locales/zh-CN.d.ts
CHANGED
|
@@ -106,6 +106,15 @@ declare const _default: {
|
|
|
106
106
|
'board.showQuickCreateDesc': string;
|
|
107
107
|
'board.shortcuts': string;
|
|
108
108
|
'board.language': string;
|
|
109
|
+
'board.export': string;
|
|
110
|
+
'board.exportImage': string;
|
|
111
|
+
'board.exportSVG': string;
|
|
112
|
+
'board.exportAll': string;
|
|
113
|
+
'board.exportSelected': string;
|
|
114
|
+
'board.importPPTX': string;
|
|
115
|
+
'board.openSource': string;
|
|
116
|
+
'board.techSupport': string;
|
|
117
|
+
'board.more': string;
|
|
109
118
|
'help.shortcutsList': string;
|
|
110
119
|
'help.tools': string;
|
|
111
120
|
'help.handTool': string;
|
|
@@ -153,5 +162,7 @@ declare const _default: {
|
|
|
153
162
|
'floatingBar.strokeStyleText': string;
|
|
154
163
|
'floatingBar.lineWidth': string;
|
|
155
164
|
'floatingBar.strokeOpacity': string;
|
|
165
|
+
'floatingBar.exportImage': string;
|
|
166
|
+
'floatingBar.exportSVG': string;
|
|
156
167
|
};
|
|
157
168
|
export default _default;
|
package/dist/store/index.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
22
22
|
showLanguageMenu?: boolean;
|
|
23
23
|
languageList?: import('../config').LanguageOption[];
|
|
24
24
|
messages?: Record<string, Record<string, string>>;
|
|
25
|
+
showExport?: boolean;
|
|
26
|
+
showImportPPTX?: boolean;
|
|
27
|
+
showAI?: boolean;
|
|
28
|
+
aiConfig?: import('../config').AiConfig;
|
|
25
29
|
};
|
|
26
30
|
appState: {
|
|
27
31
|
lockedTool: boolean;
|
|
@@ -56,7 +60,7 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
56
60
|
currentItemFontWeight: string;
|
|
57
61
|
currentItemLineHeight: number;
|
|
58
62
|
currentItemLetterSpacing: number;
|
|
59
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
63
|
+
currentItemArrowType: "sharp" | "round" | "arrowBold" | "elbow";
|
|
60
64
|
currentItemStartArrowhead: string | null;
|
|
61
65
|
currentItemEndArrowhead: string | null;
|
|
62
66
|
currentItemX: number;
|
|
@@ -1000,6 +1004,7 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
1000
1004
|
containerId: string | null;
|
|
1001
1005
|
originalText: string;
|
|
1002
1006
|
autoResize: boolean;
|
|
1007
|
+
boundTextOffset?: number | undefined;
|
|
1003
1008
|
id: string;
|
|
1004
1009
|
x: number;
|
|
1005
1010
|
y: number;
|
|
@@ -1059,7 +1064,7 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
1059
1064
|
fixedPoint?: [number, number] | undefined;
|
|
1060
1065
|
isBorder?: boolean | undefined;
|
|
1061
1066
|
} | null;
|
|
1062
|
-
arrowType: "sharp" | "round" | "
|
|
1067
|
+
arrowType: "sharp" | "round" | "arrowBold" | "elbow";
|
|
1063
1068
|
id: string;
|
|
1064
1069
|
x: number;
|
|
1065
1070
|
y: number;
|
|
@@ -2194,6 +2199,7 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
2194
2199
|
containerId: string | null;
|
|
2195
2200
|
originalText: string;
|
|
2196
2201
|
autoResize: boolean;
|
|
2202
|
+
boundTextOffset?: number | undefined;
|
|
2197
2203
|
id: string;
|
|
2198
2204
|
x: number;
|
|
2199
2205
|
y: number;
|
|
@@ -2253,7 +2259,7 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
2253
2259
|
fixedPoint?: [number, number] | undefined;
|
|
2254
2260
|
isBorder?: boolean | undefined;
|
|
2255
2261
|
} | null;
|
|
2256
|
-
arrowType: "sharp" | "round" | "
|
|
2262
|
+
arrowType: "sharp" | "round" | "arrowBold" | "elbow";
|
|
2257
2263
|
id: string;
|
|
2258
2264
|
x: number;
|
|
2259
2265
|
y: number;
|
|
@@ -2500,6 +2506,14 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
2500
2506
|
value: string;
|
|
2501
2507
|
}[] | undefined;
|
|
2502
2508
|
messages?: Record<string, Record<string, string>> | undefined;
|
|
2509
|
+
showExport?: boolean | undefined;
|
|
2510
|
+
showImportPPTX?: boolean | undefined;
|
|
2511
|
+
showAI?: boolean | undefined;
|
|
2512
|
+
aiConfig?: {
|
|
2513
|
+
url?: string | undefined;
|
|
2514
|
+
headers?: Record<string, string> | undefined;
|
|
2515
|
+
data?: Record<string, any> | undefined;
|
|
2516
|
+
} | undefined;
|
|
2503
2517
|
};
|
|
2504
2518
|
appState: {
|
|
2505
2519
|
lockedTool: boolean;
|
|
@@ -2534,7 +2548,7 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
2534
2548
|
currentItemFontWeight: string;
|
|
2535
2549
|
currentItemLineHeight: number;
|
|
2536
2550
|
currentItemLetterSpacing: number;
|
|
2537
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
2551
|
+
currentItemArrowType: "sharp" | "round" | "arrowBold" | "elbow";
|
|
2538
2552
|
currentItemStartArrowhead: string | null;
|
|
2539
2553
|
currentItemEndArrowhead: string | null;
|
|
2540
2554
|
currentItemX: number;
|
|
@@ -2590,6 +2604,10 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
2590
2604
|
showLanguageMenu?: boolean;
|
|
2591
2605
|
languageList?: import('../config').LanguageOption[];
|
|
2592
2606
|
messages?: Record<string, Record<string, string>>;
|
|
2607
|
+
showExport?: boolean;
|
|
2608
|
+
showImportPPTX?: boolean;
|
|
2609
|
+
showAI?: boolean;
|
|
2610
|
+
aiConfig?: import('../config').AiConfig;
|
|
2593
2611
|
};
|
|
2594
2612
|
appState: {
|
|
2595
2613
|
lockedTool: boolean;
|
|
@@ -2624,7 +2642,7 @@ export declare const useExcalidrawStore: (id?: string) => import('pinia').Store<
|
|
|
2624
2642
|
currentItemFontWeight: string;
|
|
2625
2643
|
currentItemLineHeight: number;
|
|
2626
2644
|
currentItemLetterSpacing: number;
|
|
2627
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
2645
|
+
currentItemArrowType: "sharp" | "round" | "arrowBold" | "elbow";
|
|
2628
2646
|
currentItemStartArrowhead: string | null;
|
|
2629
2647
|
currentItemEndArrowhead: string | null;
|
|
2630
2648
|
currentItemX: number;
|
package/dist/types/element.d.ts
CHANGED
|
@@ -124,6 +124,7 @@ export interface ExcalidrawTextElement extends ElementBase {
|
|
|
124
124
|
containerId: string | null;
|
|
125
125
|
originalText: string;
|
|
126
126
|
autoResize: boolean;
|
|
127
|
+
boundTextOffset?: number;
|
|
127
128
|
}
|
|
128
129
|
export interface ExcalidrawLinearElement extends ElementBase {
|
|
129
130
|
type: "line" | "arrow";
|
|
@@ -145,7 +146,7 @@ export interface ExcalidrawLinearElement extends ElementBase {
|
|
|
145
146
|
fixedPoint?: [number, number];
|
|
146
147
|
isBorder?: boolean;
|
|
147
148
|
} | null;
|
|
148
|
-
arrowType: "sharp" | "round" | "
|
|
149
|
+
arrowType: "sharp" | "round" | "arrowBold" | "elbow";
|
|
149
150
|
}
|
|
150
151
|
export interface ExcalidrawImageElement extends ElementBase {
|
|
151
152
|
type: "image";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExcalidrawElement } from '../types/element';
|
|
2
|
+
export declare const exportToImage: (elements: readonly ExcalidrawElement[], options?: {
|
|
3
|
+
viewBackgroundColor?: string;
|
|
4
|
+
padding?: number;
|
|
5
|
+
images?: Record<string, string>;
|
|
6
|
+
gridType?: string;
|
|
7
|
+
}) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isPointOnElement: (maxDistance: number, x: number, y: number, element: any) => boolean;
|
|
1
|
+
export declare const isPointOnElement: (maxDistance: number, x: number, y: number, element: any, elements?: any[]) => boolean;
|
package/dist/utils/math.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { Point } from '../types/element';
|
|
2
2
|
export declare const rotate: (x1: number, y1: number, x2: number, y2: number, angle: number) => [number, number];
|
|
3
3
|
export declare const rotatePoint: (point: Point, center: [number, number], angle: number) => [number, number];
|
|
4
|
-
export declare const getElementRotatedBounds: (el: {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
angle: number;
|
|
10
|
-
}) => {
|
|
4
|
+
export declare const getElementRotatedBounds: (el: any) => {
|
|
11
5
|
minX: number;
|
|
12
6
|
minY: number;
|
|
13
7
|
maxX: number;
|
|
@@ -57,11 +51,11 @@ export declare const measureText: (text: string, fontSize: number, fontFamily: s
|
|
|
57
51
|
height: number;
|
|
58
52
|
};
|
|
59
53
|
export declare const getCurvePoints: (points: Point[], tension?: number, numSegments?: number) => Point[];
|
|
60
|
-
export declare const getFlowchartBezierData: (points: Point[]) => {
|
|
54
|
+
export declare const getFlowchartBezierData: (points: Point[], startDirOverride?: Point, endDirOverride?: Point) => {
|
|
61
55
|
pathString: string;
|
|
62
56
|
renderPoints: Point[];
|
|
63
57
|
} | null;
|
|
64
|
-
export declare const getFlowchartBezierPoints: (points: Point[], numSegments?: number) => Point[];
|
|
58
|
+
export declare const getFlowchartBezierPoints: (points: Point[], numSegments?: number, startDirOverride?: Point, endDirOverride?: Point) => Point[];
|
|
65
59
|
export declare const getDirectionFromFixedPoint: (fixedPoint: [number, number], width: number, height: number) => Point | null;
|
|
66
60
|
export declare const getElementBounds: (element: any) => {
|
|
67
61
|
minX: any;
|
|
@@ -79,6 +73,10 @@ export declare const getCommonBoundingBox: (elements: any[]) => {
|
|
|
79
73
|
maxX: number;
|
|
80
74
|
maxY: number;
|
|
81
75
|
} | null;
|
|
76
|
+
export declare const getHoveredElbowSegment: (mouseX: number, mouseY: number, element: ExcalidrawElement, elements: readonly ExcalidrawElement[], tolerance?: number) => {
|
|
77
|
+
segmentIndex: number;
|
|
78
|
+
isHorizontal: boolean;
|
|
79
|
+
} | null;
|
|
82
80
|
export declare const isPointOnElement: (maxDistance: number, x: number, y: number, element: any, elements?: readonly any[]) => boolean;
|
|
83
|
-
export declare const
|
|
84
|
-
export declare const
|
|
81
|
+
export declare const pointsToRoundedPath: (rawP: Point[], radius?: number) => string;
|
|
82
|
+
export declare const projectPointOnPolyline: (px: number, py: number, points: readonly Point[]) => number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExcalidrawElement } from '../types/element';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts and parses a PPTX file, converting slides into an ExcalidrawElement array.
|
|
4
|
+
* @param file The .pptx File blob
|
|
5
|
+
* @param verticalSpacing Space between slides (in pixels)
|
|
6
|
+
*/
|
|
7
|
+
export declare const parsePPTXToElements: (file: File, verticalSpacing?: number) => Promise<ExcalidrawElement[]>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jvs-draw",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/jvs-draw.umd.js",
|
|
7
7
|
"module": "dist/jvs-draw.es.js",
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"clsx": "^2.1.1",
|
|
29
|
+
"dagre": "^0.8.5",
|
|
30
|
+
"jszip": "^3.10.1",
|
|
29
31
|
"jvs-picker-color-v3": "^0.0.7",
|
|
30
32
|
"nanoid": "^5.1.6",
|
|
31
33
|
"remixicon": "^4.8.0",
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
"vue": "^3.5.24"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
43
|
+
"@types/dagre": "^0.7.54",
|
|
41
44
|
"@types/node": "^24.10.1",
|
|
42
45
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
43
46
|
"@vue/tsconfig": "^0.8.1",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Point } from '../core';
|
|
2
|
-
import { PointGraph, PointNode } from './data-structures/graph';
|
|
3
|
-
export declare class AStar {
|
|
4
|
-
private graph;
|
|
5
|
-
cameFrom: Map<PointNode, PointNode>;
|
|
6
|
-
constructor(graph: PointGraph);
|
|
7
|
-
heuristic(a: Point, b: Point): number;
|
|
8
|
-
search(start: Point, end: Point, previousStart: Point): void;
|
|
9
|
-
getRoute(start: Point, end: Point): Point[];
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Point } from '../../core';
|
|
2
|
-
export declare class PointNode {
|
|
3
|
-
data: Point;
|
|
4
|
-
distance: number;
|
|
5
|
-
adjacentNodes: PointNode[];
|
|
6
|
-
constructor(data: Point);
|
|
7
|
-
}
|
|
8
|
-
export declare class PointGraph {
|
|
9
|
-
private index;
|
|
10
|
-
add(p: Point): void;
|
|
11
|
-
connect(a: Point, b: Point): void;
|
|
12
|
-
has(p: Point): boolean;
|
|
13
|
-
get(p: Point): PointNode | null;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PointNode } from './graph';
|
|
2
|
-
export declare class PriorityQueue {
|
|
3
|
-
list: {
|
|
4
|
-
node: PointNode;
|
|
5
|
-
priority: number;
|
|
6
|
-
}[];
|
|
7
|
-
constructor();
|
|
8
|
-
enqueue(item: {
|
|
9
|
-
node: PointNode;
|
|
10
|
-
priority: number;
|
|
11
|
-
}): void;
|
|
12
|
-
dequeue(): {
|
|
13
|
-
node: PointNode;
|
|
14
|
-
priority: number;
|
|
15
|
-
} | undefined;
|
|
16
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const BASE = 4;
|
|
2
|
-
export declare const PRIMARY_COLOR = "#6698FF";
|
|
3
|
-
export declare const RESIZE_HANDLE_DIAMETER = 9;
|
|
4
|
-
export declare const WithTextPluginKey = "plait-text-plugin-key";
|
|
5
|
-
export declare const DEFAULT_ROUTE_MARGIN = 30;
|
|
6
|
-
export declare const TRANSPARENT = "transparent";
|
|
7
|
-
export declare const ROTATE_HANDLE_DISTANCE_TO_ELEMENT = 4;
|
|
8
|
-
export declare const ROTATE_HANDLE_SIZE = 18;
|
|
9
|
-
export declare const DEFAULT_FONT_FAMILY = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Noto Sans', 'Noto Sans CJK SC', 'Microsoft Yahei', 'Hiragino Sans GB', Arial, sans-serif";
|
|
10
|
-
export declare const DEFAULT_FILL = "none";
|
package/dist/elbow/core.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export type Point = [number, number];
|
|
2
|
-
export type Vector = [number, number];
|
|
3
|
-
export declare enum Direction {
|
|
4
|
-
top = "top",
|
|
5
|
-
bottom = "bottom",
|
|
6
|
-
left = "left",
|
|
7
|
-
right = "right"
|
|
8
|
-
}
|
|
9
|
-
export interface PlaitBoard {
|
|
10
|
-
}
|
|
11
|
-
export interface DebugGenerator {
|
|
12
|
-
clear(): void;
|
|
13
|
-
drawRectangle(board: PlaitBoard, rect: RectangleClient): void;
|
|
14
|
-
drawLine(board: PlaitBoard, points: Point[]): void;
|
|
15
|
-
}
|
|
16
|
-
export declare const createDebugGenerator: (name: string) => DebugGenerator;
|
|
17
|
-
export declare const distanceBetweenPointAndPoint: (x1: number, y1: number, x2: number, y2: number) => number;
|
|
18
|
-
export declare class RectangleClient {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
constructor(x: number, y: number, width: number, height: number);
|
|
24
|
-
static getRectangleByPoints(points: Point[]): RectangleClient;
|
|
25
|
-
static getCornerPointsByPoints(points: Point[]): Point[];
|
|
26
|
-
static isHit(rect1: RectangleClient, rect2: RectangleClient): boolean;
|
|
27
|
-
static isHitX(rect1: RectangleClient, rect2: RectangleClient): boolean;
|
|
28
|
-
static isHitY(rect1: RectangleClient, rect2: RectangleClient): boolean;
|
|
29
|
-
static isPointInRectangle(rect: RectangleClient, point: Point): boolean;
|
|
30
|
-
static getGapCenter(rect1: RectangleClient, rect2: RectangleClient, isHorizontal: boolean): number;
|
|
31
|
-
static expand(rect: RectangleClient, left: number, top: number, right: number, bottom: number): RectangleClient;
|
|
32
|
-
}
|
|
33
|
-
export declare namespace Point {
|
|
34
|
-
function isEquals(p1: Point, p2: Point): boolean;
|
|
35
|
-
function isOverHorizontal(points: Point[]): boolean;
|
|
36
|
-
function isOverVertical(points: Point[]): boolean;
|
|
37
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Direction, PlaitBoard, Point, RectangleClient } from '../core';
|
|
2
|
-
import { PointGraph } from '../algorithms';
|
|
3
|
-
export interface ElbowLineRouteOptions {
|
|
4
|
-
sourcePoint: Point;
|
|
5
|
-
nextSourcePoint: Point;
|
|
6
|
-
sourceRectangle: RectangleClient;
|
|
7
|
-
sourceOuterRectangle: RectangleClient;
|
|
8
|
-
targetPoint: Point;
|
|
9
|
-
nextTargetPoint: Point;
|
|
10
|
-
targetOuterRectangle: RectangleClient;
|
|
11
|
-
targetRectangle: RectangleClient;
|
|
12
|
-
}
|
|
13
|
-
export interface RouteAdjustOptions {
|
|
14
|
-
centerX?: number;
|
|
15
|
-
centerY?: number;
|
|
16
|
-
sourceRectangle: RectangleClient;
|
|
17
|
-
targetRectangle: RectangleClient;
|
|
18
|
-
}
|
|
19
|
-
export interface AdjustOptions {
|
|
20
|
-
parallelPaths: [Point, Point][];
|
|
21
|
-
pointOfHit: Point;
|
|
22
|
-
sourceRectangle: RectangleClient;
|
|
23
|
-
targetRectangle: RectangleClient;
|
|
24
|
-
}
|
|
25
|
-
export declare const generateElbowLineRoute: (options: ElbowLineRouteOptions, board?: PlaitBoard) => Point[];
|
|
26
|
-
export declare const routeAdjust: (path: Point[], options: RouteAdjustOptions, board?: PlaitBoard) => Point[];
|
|
27
|
-
export declare const getGraphPoints: (options: ElbowLineRouteOptions) => Point[];
|
|
28
|
-
export declare const createGraph: (points: Point[]) => PointGraph;
|
|
29
|
-
export declare const reduceRouteMargin: (sourceRectangle: RectangleClient, targetRectangle: RectangleClient) => {
|
|
30
|
-
sourceOffset: number[];
|
|
31
|
-
targetOffset: number[];
|
|
32
|
-
};
|
|
33
|
-
export declare const getNextPoint: (point: Point, outerRectangle: RectangleClient, direction: Direction) => Point;
|
|
34
|
-
export declare const getSourceAndTargetOuterRectangle: (sourceRectangle: RectangleClient, targetRectangle: RectangleClient) => {
|
|
35
|
-
sourceOuterRectangle: RectangleClient;
|
|
36
|
-
targetOuterRectangle: RectangleClient;
|
|
37
|
-
};
|
|
38
|
-
export declare const isSourceAndTargetIntersect: (options: ElbowLineRouteOptions) => boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Point } from '../core';
|
|
2
|
-
export declare function getPointOnPolyline(points: Point[], ratio: number): any[] | undefined;
|
|
3
|
-
export declare function calculatePolylineLength(points: Point[]): number;
|
|
4
|
-
export declare function getRatioByPoint(points: Point[], point: Point): number;
|
|
5
|
-
export declare const removeDuplicatePoints: (points: Point[]) => Point[];
|
|
6
|
-
export declare function simplifyOrthogonalPoints(points: Point[]): Point[];
|
|
7
|
-
export declare const getExtendPoint: (source: Point, target: Point, extendDistance: number) => Point;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Point, Vector } from '../core';
|
|
2
|
-
export declare function getUnitVectorByPointAndPoint(point1: Point, point2: Point): Point;
|
|
3
|
-
export declare function getPointByVectorComponent(point: Point, vector: Vector, component: number): Point;
|
|
4
|
-
export declare function getPointByVectorDirectionComponent(point: Point, unitVector: Vector, directionComponent: number, isHorizontal: boolean): Point;
|
|
5
|
-
export declare function rotateVectorAnti90(vector: Vector): Vector;
|
|
6
|
-
export declare function rotateVector(vector: Vector, angle: number): Vector;
|