@billtaofbj/mindmap 1.0.0
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/LICENSE +21 -0
- package/dist/AutoMove-B6piuV1l.mjs +21 -0
- package/dist/Base-B8xfItDp.mjs +289 -0
- package/dist/Drag-BNJqZaaB.mjs +458 -0
- package/dist/Export-C11gtER2.mjs +307 -0
- package/dist/Formula-rim6V3Ro.mjs +29081 -0
- package/dist/KeyboardNavigation-BznWjRqo.mjs +106 -0
- package/dist/MindMapNode-CKCds6wa.mjs +1865 -0
- package/dist/MiniMap-BtFFvLbR.mjs +98 -0
- package/dist/NodeImgAdjust-CU_ka96q.mjs +138 -0
- package/dist/OuterFrame-D-P0EKq5.mjs +325 -0
- package/dist/Painter-D3byksYq.mjs +42 -0
- package/dist/RainbowLines-CGp8BmNt.mjs +52 -0
- package/dist/Scrollbar-5bObtsl_.mjs +117 -0
- package/dist/Search-1GRF2dmm.mjs +124 -0
- package/dist/Select-CY_n5-r2.mjs +99 -0
- package/dist/Watermark-B-zBgHXG.mjs +88 -0
- package/dist/api-D2rfJWe_.mjs +16 -0
- package/dist/btns-Cf5zZK5X.mjs +9 -0
- package/dist/index.cjs.js +1515 -0
- package/dist/index.es.js +2745 -0
- package/dist/mindmap.css +2 -0
- package/dist/simple-mind-map-DFGmd5vc.mjs +3188 -0
- package/dist/utils-DjW7eJ1w.mjs +4295 -0
- package/package.json +26 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Dt as e, dt as t } from "./utils-DjW7eJ1w.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/simple-mind-map@0.14.0-fix.2/node_modules/simple-mind-map/src/plugins/Scrollbar.js
|
|
3
|
+
var n = class {
|
|
4
|
+
constructor(e) {
|
|
5
|
+
this.mindMap = e.mindMap, this.scrollbarWrapSize = {
|
|
6
|
+
width: 0,
|
|
7
|
+
height: 0
|
|
8
|
+
}, this.chartHeight = 0, this.chartWidth = 0, this.reset(), this.bindEvent();
|
|
9
|
+
}
|
|
10
|
+
reset() {
|
|
11
|
+
this.currentScrollType = "", this.isMousedown = !1, this.mousedownPos = {
|
|
12
|
+
x: 0,
|
|
13
|
+
y: 0
|
|
14
|
+
}, this.mousedownScrollbarPos = 0;
|
|
15
|
+
}
|
|
16
|
+
bindEvent() {
|
|
17
|
+
this.onMousemove = this.onMousemove.bind(this), this.onMouseup = this.onMouseup.bind(this), this.updateScrollbar = this.updateScrollbar.bind(this), this.updateScrollbar = t(this.updateScrollbar, 16, this), this.mindMap.on("mousemove", this.onMousemove), this.mindMap.on("mouseup", this.onMouseup), this.mindMap.on("node_tree_render_end", this.updateScrollbar), this.mindMap.on("view_data_change", this.updateScrollbar), this.mindMap.on("resize", this.updateScrollbar);
|
|
18
|
+
}
|
|
19
|
+
unBindEvent() {
|
|
20
|
+
this.mindMap.off("mousemove", this.onMousemove), this.mindMap.off("mouseup", this.onMouseup), this.mindMap.off("node_tree_render_end", this.updateScrollbar), this.mindMap.off("view_data_change", this.updateScrollbar), this.mindMap.off("resize", this.updateScrollbar);
|
|
21
|
+
}
|
|
22
|
+
updateScrollbar() {
|
|
23
|
+
if (this.isMousedown) return;
|
|
24
|
+
let e = this.calculationScrollbar();
|
|
25
|
+
this.emitEvent(e);
|
|
26
|
+
}
|
|
27
|
+
emitEvent(e) {
|
|
28
|
+
this.mindMap.emit("scrollbar_change", e);
|
|
29
|
+
}
|
|
30
|
+
setScrollBarWrapSize(e, t) {
|
|
31
|
+
this.scrollbarWrapSize.width = e, this.scrollbarWrapSize.height = t;
|
|
32
|
+
}
|
|
33
|
+
calculationScrollbar() {
|
|
34
|
+
let e = this.mindMap.draw.rbox(), t = this.mindMap.elRect;
|
|
35
|
+
e.x -= t.left, e.y -= t.top;
|
|
36
|
+
let n = this.mindMap.height, r = n / 2, i = e.height + r * 2;
|
|
37
|
+
this.chartHeight = i;
|
|
38
|
+
let a = e.y - r, o = Math.min(n / i * 100, 100), s = -a / i * 100;
|
|
39
|
+
s < 0 && (s = 0), s > 100 - o && (s = 100 - o);
|
|
40
|
+
let c = this.mindMap.width, l = c / 2, u = e.width + l * 2;
|
|
41
|
+
this.chartWidth = u;
|
|
42
|
+
let d = e.x - l, f = Math.min(c / u * 100, 100), p = -d / u * 100;
|
|
43
|
+
return p < 0 && (p = 0), p > 100 - f && (p = 100 - f), {
|
|
44
|
+
vertical: {
|
|
45
|
+
top: s,
|
|
46
|
+
height: o
|
|
47
|
+
},
|
|
48
|
+
horizontal: {
|
|
49
|
+
left: p,
|
|
50
|
+
width: f
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
onMousedown(t, n) {
|
|
55
|
+
t.preventDefault(), t.stopPropagation(), this.currentScrollType = n, this.isMousedown = !0, this.mousedownPos = {
|
|
56
|
+
x: t.clientX,
|
|
57
|
+
y: t.clientY
|
|
58
|
+
};
|
|
59
|
+
let r = window.getComputedStyle(t.target);
|
|
60
|
+
n === e.SCROLL_BAR_DIR.VERTICAL ? this.mousedownScrollbarPos = Number.parseFloat(r.top) : this.mousedownScrollbarPos = Number.parseFloat(r.left);
|
|
61
|
+
}
|
|
62
|
+
onMousemove(t) {
|
|
63
|
+
if (this.isMousedown) if (t.preventDefault(), t.stopPropagation(), this.currentScrollType === e.SCROLL_BAR_DIR.VERTICAL) {
|
|
64
|
+
let n = t.clientY - this.mousedownPos.y + this.mousedownScrollbarPos;
|
|
65
|
+
this.updateMindMapView(e.SCROLL_BAR_DIR.VERTICAL, n);
|
|
66
|
+
} else {
|
|
67
|
+
let n = t.clientX - this.mousedownPos.x + this.mousedownScrollbarPos;
|
|
68
|
+
this.updateMindMapView(e.SCROLL_BAR_DIR.HORIZONTAL, n);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
onMouseup() {
|
|
72
|
+
this.isMousedown = !1, this.reset();
|
|
73
|
+
}
|
|
74
|
+
updateMindMapView(t, n) {
|
|
75
|
+
let r = this.calculationScrollbar(), i = this.mindMap.draw.transform(), a = this.mindMap.draw.rbox(), o = this.mindMap.renderer.root.group.rbox(), s = this.mindMap.renderer.layout.getRootCenterOffset(o.width, o.height);
|
|
76
|
+
if (t === e.SCROLL_BAR_DIR.VERTICAL) {
|
|
77
|
+
let e = n;
|
|
78
|
+
e <= 0 && (e = 0);
|
|
79
|
+
let t = (100 - r.vertical.height) / 100 * this.scrollbarWrapSize.height;
|
|
80
|
+
e >= t && (e = t);
|
|
81
|
+
let c = e / this.scrollbarWrapSize.height * 100, l = -c / 100 * this.chartHeight, u = o.y - a.y, d = this.mindMap.height / 2, f = l + u - d * i.scaleY + d - s.y * i.scaleY + (this.mindMap.height - this.mindMap.initHeight) / 2 * i.scaleY;
|
|
82
|
+
this.mindMap.view.translateYTo(f), this.emitEvent({
|
|
83
|
+
horizontal: r.horizontal,
|
|
84
|
+
vertical: {
|
|
85
|
+
top: c,
|
|
86
|
+
height: r.vertical.height
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
} else {
|
|
90
|
+
let e = n;
|
|
91
|
+
e <= 0 && (e = 0);
|
|
92
|
+
let t = (100 - r.horizontal.width) / 100 * this.scrollbarWrapSize.width;
|
|
93
|
+
e >= t && (e = t);
|
|
94
|
+
let c = e / this.scrollbarWrapSize.width * 100, l = -c / 100 * this.chartWidth, u = o.x - a.x, d = this.mindMap.width / 2, f = l + u - d * i.scaleX + d - s.x * i.scaleX + (this.mindMap.width - this.mindMap.initWidth) / 2 * i.scaleX;
|
|
95
|
+
this.mindMap.view.translateXTo(f), this.emitEvent({
|
|
96
|
+
vertical: r.vertical,
|
|
97
|
+
horizontal: {
|
|
98
|
+
left: c,
|
|
99
|
+
width: r.horizontal.width
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
onClick(t, n) {
|
|
105
|
+
let r = 0;
|
|
106
|
+
r = n === e.SCROLL_BAR_DIR.VERTICAL ? t.clientY - t.currentTarget.getBoundingClientRect().top : t.clientX - t.currentTarget.getBoundingClientRect().left, this.updateMindMapView(n, r);
|
|
107
|
+
}
|
|
108
|
+
beforePluginRemove() {
|
|
109
|
+
this.unBindEvent();
|
|
110
|
+
}
|
|
111
|
+
beforePluginDestroy() {
|
|
112
|
+
this.unBindEvent();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
n.instanceName = "scrollbar";
|
|
116
|
+
//#endregion
|
|
117
|
+
export { n as default };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Dt as e, F as t, K as n, i as r, it as i, w as a } from "./utils-DjW7eJ1w.mjs";
|
|
2
|
+
import { t as o } from "./MindMapNode-CKCds6wa.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/simple-mind-map@0.14.0-fix.2/node_modules/simple-mind-map/src/plugins/Search.js
|
|
4
|
+
var s = class {
|
|
5
|
+
constructor({ mindMap: e }) {
|
|
6
|
+
this.mindMap = e, this.isSearching = !1, this.searchText = "", this.matchNodeList = [], this.currentIndex = -1, this.notResetSearchText = !1, this.isJumpNext = !1, this.bindEvent();
|
|
7
|
+
}
|
|
8
|
+
bindEvent() {
|
|
9
|
+
this.onDataChange = this.onDataChange.bind(this), this.onModeChange = this.onModeChange.bind(this), this.mindMap.on("data_change", this.onDataChange), this.mindMap.on("mode_change", this.onModeChange);
|
|
10
|
+
}
|
|
11
|
+
unBindEvent() {
|
|
12
|
+
this.mindMap.off("data_change", this.onDataChange), this.mindMap.off("mode_change", this.onModeChange);
|
|
13
|
+
}
|
|
14
|
+
onDataChange() {
|
|
15
|
+
if (this.isJumpNext) {
|
|
16
|
+
this.isJumpNext = !1, this.search(this.searchText);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (this.notResetSearchText) {
|
|
20
|
+
this.notResetSearchText = !1;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this.searchText = "";
|
|
24
|
+
}
|
|
25
|
+
onModeChange(t) {
|
|
26
|
+
t !== e.MODE.READONLY && this.isSearching && this.matchNodeList[this.currentIndex] && this.matchNodeList[this.currentIndex].closeHighlight();
|
|
27
|
+
}
|
|
28
|
+
search(e, t = () => {}) {
|
|
29
|
+
if (n(e)) return this.endSearch();
|
|
30
|
+
e = String(e), this.isSearching = !0, this.searchText === e ? this.searchNext(t) : (this.searchText = e, this.doSearch(), this.searchNext(t)), this.emitEvent();
|
|
31
|
+
}
|
|
32
|
+
updateMatchNodeList(e) {
|
|
33
|
+
this.matchNodeList = e, this.mindMap.emit("search_match_node_list_change", e);
|
|
34
|
+
}
|
|
35
|
+
endSearch() {
|
|
36
|
+
this.isSearching && (this.mindMap.opt.readonly && this.matchNodeList[this.currentIndex] && this.matchNodeList[this.currentIndex].closeHighlight(), this.searchText = "", this.updateMatchNodeList([]), this.currentIndex = -1, this.notResetSearchText = !1, this.isSearching = !1, this.emitEvent());
|
|
37
|
+
}
|
|
38
|
+
doSearch() {
|
|
39
|
+
this.clearHighlightOnReadonly(), this.updateMatchNodeList([]), this.currentIndex = -1;
|
|
40
|
+
let { isOnlySearchCurrentRenderNodes: e } = this.mindMap.opt, n = e ? this.mindMap.renderer.root : this.mindMap.renderer.renderTree;
|
|
41
|
+
if (!n) return;
|
|
42
|
+
let i = [];
|
|
43
|
+
r(n, (n) => {
|
|
44
|
+
let { richText: r, text: o, generalization: s } = e ? n.getData() : n.data;
|
|
45
|
+
r && (o = t(o)), o.includes(this.searchText) && i.push(n), a({ generalization: s }).forEach((n) => {
|
|
46
|
+
let { richText: r, text: a, uid: o } = n;
|
|
47
|
+
e && !this.mindMap.renderer.findNodeByUid(o) || (r && (a = t(a)), a.includes(this.searchText) && i.push({ data: n }));
|
|
48
|
+
});
|
|
49
|
+
}), this.updateMatchNodeList(i);
|
|
50
|
+
}
|
|
51
|
+
isNodeInstance(e) {
|
|
52
|
+
return e instanceof o;
|
|
53
|
+
}
|
|
54
|
+
searchNext(e, t) {
|
|
55
|
+
if (!this.isSearching || this.matchNodeList.length <= 0) return;
|
|
56
|
+
t !== void 0 && Number.isInteger(t) && t >= 0 && t < this.matchNodeList.length ? this.currentIndex = t : this.currentIndex < this.matchNodeList.length - 1 ? this.currentIndex++ : this.currentIndex = 0;
|
|
57
|
+
let { readonly: n } = this.mindMap.opt;
|
|
58
|
+
this.clearHighlightOnReadonly();
|
|
59
|
+
let r = this.matchNodeList[this.currentIndex];
|
|
60
|
+
this.notResetSearchText = !0;
|
|
61
|
+
let i = this.isNodeInstance(r) ? r.getData("uid") : r.data.uid;
|
|
62
|
+
if (!i) {
|
|
63
|
+
e();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
let a = this.mindMap.renderer.findNodeByUid(i);
|
|
67
|
+
this.mindMap.execCommand("GO_TARGET_NODE", i, (t) => {
|
|
68
|
+
this.isNodeInstance(r) || (this.matchNodeList[this.currentIndex] = t, this.updateMatchNodeList(this.matchNodeList)), e(), n && t.highlight(), a && (this.notResetSearchText = !1);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
clearHighlightOnReadonly() {
|
|
72
|
+
let { readonly: e } = this.mindMap.opt;
|
|
73
|
+
e && this.matchNodeList.forEach((e) => {
|
|
74
|
+
this.isNodeInstance(e) && e.closeHighlight();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
jump(e, t = () => {}) {
|
|
78
|
+
this.searchNext(t, e);
|
|
79
|
+
}
|
|
80
|
+
replace(e, t = !1) {
|
|
81
|
+
if (e == null || !this.isSearching || this.matchNodeList.length <= 0) return;
|
|
82
|
+
this.isJumpNext = t, e = String(e);
|
|
83
|
+
let n = this.matchNodeList[this.currentIndex];
|
|
84
|
+
if (!n) return;
|
|
85
|
+
let r = e.includes(this.searchText), i = this.getReplacedText(n, this.searchText, e);
|
|
86
|
+
if (this.notResetSearchText = !0, n.setText(i, n.getData("richText")), r) {
|
|
87
|
+
this.updateMatchNodeList(this.matchNodeList);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
let a = this.matchNodeList.filter((e) => n !== e);
|
|
91
|
+
this.updateMatchNodeList(a), this.currentIndex > this.matchNodeList.length - 1 ? this.currentIndex = -1 : this.currentIndex--, this.emitEvent();
|
|
92
|
+
}
|
|
93
|
+
replaceAll(e) {
|
|
94
|
+
if (e == null || !this.isSearching || this.matchNodeList.length <= 0) return;
|
|
95
|
+
e = String(e);
|
|
96
|
+
let t = e.includes(this.searchText);
|
|
97
|
+
this.notResetSearchText = !0, this.matchNodeList.forEach((t) => {
|
|
98
|
+
let n = this.getReplacedText(t, this.searchText, e);
|
|
99
|
+
if (this.isNodeInstance(t)) {
|
|
100
|
+
let e = { text: n };
|
|
101
|
+
this.mindMap.renderer.setNodeDataRender(t, e, !0);
|
|
102
|
+
} else t.data.text = n;
|
|
103
|
+
}), this.mindMap.render(), this.mindMap.command.addHistory(), t ? this.updateMatchNodeList(this.matchNodeList) : this.endSearch();
|
|
104
|
+
}
|
|
105
|
+
getReplacedText(e, t, n) {
|
|
106
|
+
let { richText: r, text: a } = this.isNodeInstance(e) ? e.getData() : e.data;
|
|
107
|
+
return r ? i(a, t, n) : a.replace(new RegExp(t, "g"), n);
|
|
108
|
+
}
|
|
109
|
+
emitEvent() {
|
|
110
|
+
this.mindMap.emit("search_info_change", {
|
|
111
|
+
currentIndex: this.currentIndex,
|
|
112
|
+
total: this.matchNodeList.length
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
beforePluginRemove() {
|
|
116
|
+
this.unBindEvent();
|
|
117
|
+
}
|
|
118
|
+
beforePluginDestroy() {
|
|
119
|
+
this.unBindEvent();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
s.instanceName = "search";
|
|
123
|
+
//#endregion
|
|
124
|
+
export { s as default };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { dt as e, f as t, i as n } from "./utils-DjW7eJ1w.mjs";
|
|
2
|
+
import { t as r } from "./AutoMove-B6piuV1l.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/simple-mind-map@0.14.0-fix.2/node_modules/simple-mind-map/src/plugins/Select.js
|
|
4
|
+
var i = class {
|
|
5
|
+
constructor({ mindMap: e }) {
|
|
6
|
+
this.mindMap = e, this.rect = null, this.isMousedown = !1, this.mouseDownX = 0, this.mouseDownY = 0, this.mouseMoveX = 0, this.mouseMoveY = 0, this.isSelecting = !1, this.cacheActiveList = [], this.autoMove = new r(e), this.bindEvent();
|
|
7
|
+
}
|
|
8
|
+
bindEvent() {
|
|
9
|
+
this.onMousedown = this.onMousedown.bind(this), this.onMousemove = this.onMousemove.bind(this), this.onMouseup = this.onMouseup.bind(this), this.checkInNodes = e(this.checkInNodes, 300, this), this.mindMap.on("mousedown", this.onMousedown), this.mindMap.on("mousemove", this.onMousemove), this.mindMap.on("mouseup", this.onMouseup), this.mindMap.on("node_mouseup", this.onMouseup);
|
|
10
|
+
}
|
|
11
|
+
unBindEvent() {
|
|
12
|
+
this.mindMap.off("mousedown", this.onMousedown), this.mindMap.off("mousemove", this.onMousemove), this.mindMap.off("mouseup", this.onMouseup), this.mindMap.off("node_mouseup", this.onMouseup);
|
|
13
|
+
}
|
|
14
|
+
onMousedown(e) {
|
|
15
|
+
let { readonly: t, mousedownEventPreventDefault: n } = this.mindMap.opt;
|
|
16
|
+
if (t) return;
|
|
17
|
+
let { useLeftKeySelectionRightKeyDrag: r } = this.mindMap.opt;
|
|
18
|
+
if (!(e.ctrlKey || e.metaKey) && (r ? e.which !== 1 : e.which !== 3)) return;
|
|
19
|
+
n && e.preventDefault(), this.isMousedown = !0, this.cacheActiveList = [...this.mindMap.renderer.activeNodeList];
|
|
20
|
+
let { x: i, y: a } = this.mindMap.toPos(e.clientX, e.clientY);
|
|
21
|
+
this.mouseDownX = i, this.mouseDownY = a, this.createRect(i, a);
|
|
22
|
+
}
|
|
23
|
+
onMousemove(e) {
|
|
24
|
+
if (this.mindMap.opt.readonly || !this.isMousedown) return;
|
|
25
|
+
let { x: t, y: n } = this.mindMap.toPos(e.clientX, e.clientY);
|
|
26
|
+
this.mouseMoveX = t, this.mouseMoveY = n, !(Math.abs(t - this.mouseDownX) <= 10 && Math.abs(n - this.mouseDownY) <= 10) && (this.autoMove.clearAutoMoveTimer(), this.autoMove.onMove(e.clientX, e.clientY, () => {
|
|
27
|
+
this.isSelecting = !0, this.rect && this.rect.plot([
|
|
28
|
+
[this.mouseDownX, this.mouseDownY],
|
|
29
|
+
[this.mouseMoveX, this.mouseDownY],
|
|
30
|
+
[this.mouseMoveX, this.mouseMoveY],
|
|
31
|
+
[this.mouseDownX, this.mouseMoveY]
|
|
32
|
+
]), this.checkInNodes();
|
|
33
|
+
}, (e, t) => {
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "left":
|
|
36
|
+
this.mouseDownX += t;
|
|
37
|
+
break;
|
|
38
|
+
case "top":
|
|
39
|
+
this.mouseDownY += t;
|
|
40
|
+
break;
|
|
41
|
+
case "right":
|
|
42
|
+
this.mouseDownX -= t;
|
|
43
|
+
break;
|
|
44
|
+
case "bottom":
|
|
45
|
+
this.mouseDownY -= t;
|
|
46
|
+
break;
|
|
47
|
+
default: break;
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
onMouseup() {
|
|
52
|
+
this.mindMap.opt.readonly || this.isMousedown && (this.checkTriggerNodeActiveEvent(), this.autoMove.clearAutoMoveTimer(), this.isMousedown = !1, this.cacheActiveList = [], this.rect && this.rect.remove(), this.rect = null, setTimeout(() => {
|
|
53
|
+
this.isSelecting = !1;
|
|
54
|
+
}, 0));
|
|
55
|
+
}
|
|
56
|
+
checkTriggerNodeActiveEvent() {
|
|
57
|
+
let e = this.cacheActiveList.length !== this.mindMap.renderer.activeNodeList.length, t = !1;
|
|
58
|
+
if (!e) for (let e = 0; e < this.cacheActiveList.length; e++) {
|
|
59
|
+
let n = this.cacheActiveList[e];
|
|
60
|
+
if (!this.mindMap.renderer.activeNodeList.find((e) => e.getData("uid") === n.getData("uid"))) {
|
|
61
|
+
t = !0;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
(e || t) && this.mindMap.renderer.emitNodeActiveEvent();
|
|
66
|
+
}
|
|
67
|
+
createRect(e, t) {
|
|
68
|
+
this.rect && this.rect.remove(), this.rect = this.mindMap.svg.polygon().stroke({ color: "#0984e3" }).fill({ color: "rgba(9,132,227,0.3)" }).plot([[e, t]]);
|
|
69
|
+
}
|
|
70
|
+
checkInNodes() {
|
|
71
|
+
let { scaleX: e, scaleY: r, translateX: i, translateY: a } = this.mindMap.draw.transform(), o = Math.min(this.mouseDownX, this.mouseMoveX), s = Math.min(this.mouseDownY, this.mouseMoveY), c = Math.max(this.mouseDownX, this.mouseMoveX), l = Math.max(this.mouseDownY, this.mouseMoveY), u = (n) => {
|
|
72
|
+
let { left: u, top: d, width: f, height: p } = n, m = (u + f) * e + i, h = (d + p) * r + a;
|
|
73
|
+
if (u = u * e + i, d = d * r + a, t(o, c, s, l, u, m, d, h)) {
|
|
74
|
+
if (n.getData("isActive")) return;
|
|
75
|
+
this.mindMap.renderer.addNodeToActiveList(n), this.mindMap.renderer.emitNodeActiveEvent();
|
|
76
|
+
} else if (n.getData("isActive")) {
|
|
77
|
+
if (!n.getData("isActive")) return;
|
|
78
|
+
this.mindMap.renderer.removeNodeFromActiveList(n), this.mindMap.renderer.emitNodeActiveEvent();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
n(this.mindMap.renderer.root, (e) => {
|
|
82
|
+
u(e), e._generalizationList && e._generalizationList.length > 0 && e._generalizationList.forEach((e) => {
|
|
83
|
+
u(e.generalizationNode);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
hasSelectRange() {
|
|
88
|
+
return this.isSelecting;
|
|
89
|
+
}
|
|
90
|
+
beforePluginRemove() {
|
|
91
|
+
this.unBindEvent();
|
|
92
|
+
}
|
|
93
|
+
beforePluginDestroy() {
|
|
94
|
+
this.unBindEvent();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
i.instanceName = "select";
|
|
98
|
+
//#endregion
|
|
99
|
+
export { i as default };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Et as e, It as t, Tt as n, a as r, b as i, yt as a } from "./utils-DjW7eJ1w.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/simple-mind-map@0.14.0-fix.2/node_modules/simple-mind-map/src/plugins/Watermark.js
|
|
3
|
+
var o = /* @__PURE__ */ t(e()), s = class {
|
|
4
|
+
constructor(e = {}) {
|
|
5
|
+
this.mindMap = e.mindMap, this.lineSpacing = 0, this.textSpacing = 0, this.angle = 0, this.text = "", this.textStyle = {}, this.watermarkDraw = null, this.isInExport = !1, this.maxLong = this.getMaxLong(), this.updateWatermark(this.mindMap.opt.watermarkConfig || {}), this.bindEvent();
|
|
6
|
+
}
|
|
7
|
+
getMaxLong() {
|
|
8
|
+
return Math.sqrt(this.mindMap.width ** 2 + this.mindMap.height ** 2);
|
|
9
|
+
}
|
|
10
|
+
bindEvent() {
|
|
11
|
+
this.onResize = this.onResize.bind(this), this.mindMap.on("resize", this.onResize);
|
|
12
|
+
}
|
|
13
|
+
unBindEvent() {
|
|
14
|
+
this.mindMap.off("resize", this.onResize);
|
|
15
|
+
}
|
|
16
|
+
onResize() {
|
|
17
|
+
this.maxLong = this.getMaxLong(), this.draw();
|
|
18
|
+
}
|
|
19
|
+
createContainer() {
|
|
20
|
+
this.watermarkDraw || (this.watermarkDraw = new a().css({
|
|
21
|
+
"pointer-events": "none",
|
|
22
|
+
"user-select": "none"
|
|
23
|
+
}).addClass("smm-water-mark-container"), this.updateLayer());
|
|
24
|
+
}
|
|
25
|
+
updateLayer() {
|
|
26
|
+
if (!this.watermarkDraw) return;
|
|
27
|
+
let { belowNode: e } = this.mindMap.opt.watermarkConfig;
|
|
28
|
+
e ? this.watermarkDraw.insertBefore(this.mindMap.draw) : this.mindMap.svg.add(this.watermarkDraw);
|
|
29
|
+
}
|
|
30
|
+
removeContainer() {
|
|
31
|
+
this.watermarkDraw &&= (this.watermarkDraw.remove(), null);
|
|
32
|
+
}
|
|
33
|
+
hasWatermark() {
|
|
34
|
+
return !!this.text.trim();
|
|
35
|
+
}
|
|
36
|
+
handleConfig({ text: e, lineSpacing: t, textSpacing: n, angle: r, textStyle: i }) {
|
|
37
|
+
this.text = e === void 0 ? "" : String(e).trim(), this.lineSpacing = typeof t == "number" && t > 0 ? t : 100, this.textSpacing = typeof n == "number" && n > 0 ? n : 100, this.angle = typeof r == "number" && r >= 0 && r <= 90 ? r : 30, this.textStyle = Object.assign(this.textStyle, i || {});
|
|
38
|
+
}
|
|
39
|
+
clear() {
|
|
40
|
+
this.watermarkDraw && this.watermarkDraw.clear();
|
|
41
|
+
}
|
|
42
|
+
draw() {
|
|
43
|
+
this.clear();
|
|
44
|
+
let { onlyExport: e } = this.mindMap.opt.watermarkConfig;
|
|
45
|
+
if (e && !this.isInExport) return;
|
|
46
|
+
if (!this.hasWatermark()) {
|
|
47
|
+
this.removeContainer();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.createContainer();
|
|
51
|
+
let t = 0;
|
|
52
|
+
for (; t < this.mindMap.width;) this.drawText(t), t += this.lineSpacing / Math.sin(i(this.angle));
|
|
53
|
+
let n = this.lineSpacing / Math.cos(i(this.angle)) || this.lineSpacing, r = n;
|
|
54
|
+
for (; r < this.mindMap.height;) this.drawText(0, r), r += n;
|
|
55
|
+
}
|
|
56
|
+
drawText(e, t) {
|
|
57
|
+
let r = Math.min(this.maxLong, (this.mindMap.width - e) / Math.cos(i(this.angle))), o = new a(), s = null, c = 0, l = -1;
|
|
58
|
+
for (; c < r;) {
|
|
59
|
+
let e = new n().text(this.text);
|
|
60
|
+
o.add(e), e.transform({ translateX: c }), this.setTextStyle(e), s = o.bbox(), l === -1 && (l = s.height), c = s.width + this.textSpacing;
|
|
61
|
+
}
|
|
62
|
+
let u = {
|
|
63
|
+
rotate: this.angle,
|
|
64
|
+
origin: "top left",
|
|
65
|
+
translateX: e,
|
|
66
|
+
translateY: l
|
|
67
|
+
};
|
|
68
|
+
t !== void 0 && (u.translateY = t + l), o.transform(u), this.watermarkDraw.add(o);
|
|
69
|
+
}
|
|
70
|
+
setTextStyle(e) {
|
|
71
|
+
Object.keys(this.textStyle).forEach((t) => {
|
|
72
|
+
let n = this.textStyle[t];
|
|
73
|
+
t === "color" ? e.fill(n) : e.css(r(t), n);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
updateWatermark(e) {
|
|
77
|
+
this.mindMap.opt.watermarkConfig = (0, o.default)(this.mindMap.opt.watermarkConfig, e), this.updateLayer(), this.handleConfig(e), this.draw();
|
|
78
|
+
}
|
|
79
|
+
beforePluginRemove() {
|
|
80
|
+
this.unBindEvent(), this.removeContainer();
|
|
81
|
+
}
|
|
82
|
+
beforePluginDestroy() {
|
|
83
|
+
this.unBindEvent(), this.removeContainer();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
s.instanceName = "watermark";
|
|
87
|
+
//#endregion
|
|
88
|
+
export { s as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e from "axios";
|
|
2
|
+
//#region ../../src/api/index.js
|
|
3
|
+
var t = e.create({
|
|
4
|
+
baseURL: "/api",
|
|
5
|
+
timeout: 3e4
|
|
6
|
+
}), n = {
|
|
7
|
+
list: (e) => t.get("/documents/", { params: e }),
|
|
8
|
+
get: (e) => t.get(`/documents/${e}`),
|
|
9
|
+
create: (e) => t.post("/documents/", e),
|
|
10
|
+
update: (e, n) => t.put(`/documents/${e}`, n),
|
|
11
|
+
delete: (e) => t.delete(`/documents/${e}`),
|
|
12
|
+
addAttachment: (e, n) => t.post(`/documents/${e}/attachments`, n),
|
|
13
|
+
listAttachments: (e) => t.get(`/documents/${e}/attachments`)
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as documentAPI };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var e = {
|
|
2
|
+
open: "<svg viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\"><path d=\"M475.136 327.168v147.968h-147.968v74.24h147.968v147.968h74.24v-147.968h147.968v-74.24h-147.968v-147.968h-74.24z m36.864-222.208c225.28 0 407.04 181.76 407.04 407.04s-181.76 407.04-407.04 407.04-407.04-181.76-407.04-407.04 181.76-407.04 407.04-407.04z m0-74.24c-265.216 0-480.768 215.552-480.768 480.768s215.552 480.768 480.768 480.768 480.768-215.552 480.768-480.768-215.552-480.768-480.768-480.768z\"></path></svg>",
|
|
3
|
+
close: "<svg viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\"><path d=\"M512 105.472c225.28 0 407.04 181.76 407.04 407.04s-181.76 407.04-407.04 407.04-407.04-181.76-407.04-407.04 181.76-407.04 407.04-407.04z m0-74.24c-265.216 0-480.768 215.552-480.768 480.768s215.552 480.768 480.768 480.768 480.768-215.552 480.768-480.768-215.552-480.768-480.768-480.768z\"></path><path d=\"M252.928 474.624h518.144v74.24h-518.144z\"></path></svg>",
|
|
4
|
+
remove: "<svg width=\"14px\" height=\"14px\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\"><path fill=\"#ffffff\" d=\"M512 105.472c225.28 0 407.04 181.76 407.04 407.04s-181.76 407.04-407.04 407.04-407.04-181.76-407.04-407.04 181.76-407.04 407.04-407.04z m0-74.24c-265.216 0-480.768 215.552-480.768 480.768s215.552 480.768 480.768 480.768 480.768-215.552 480.768-480.768-215.552-480.768-480.768-480.768z\"></path><path fill=\"#ffffff\" d=\"M252.928 474.624h518.144v74.24h-518.144z\"></path></svg>",
|
|
5
|
+
imgAdjust: "<svg width=\"12px\" height=\"12px\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"#ffffff\" d=\"M1008.128 614.4a25.6 25.6 0 0 0-27.648 5.632l-142.848 142.848L259.072 186.88 401.92 43.52A25.6 25.6 0 0 0 384 0h-358.4a25.6 25.6 0 0 0-25.6 25.6v358.4a25.6 25.6 0 0 0 43.52 17.92l143.36-142.848 578.048 578.048-142.848 142.848a25.6 25.6 0 0 0 17.92 43.52h358.4a25.6 25.6 0 0 0 25.6-25.6v-358.4a25.6 25.6 0 0 0-15.872-25.088z\" /></svg>",
|
|
6
|
+
quickCreateChild: "<svg viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\"><path d=\"M514.048 62.464q93.184 0 175.616 35.328t143.872 96.768 96.768 143.872 35.328 175.616q0 94.208-35.328 176.128t-96.768 143.36-143.872 96.768-175.616 35.328q-94.208 0-176.64-35.328t-143.872-96.768-96.768-143.36-35.328-176.128q0-93.184 35.328-175.616t96.768-143.872 143.872-96.768 176.64-35.328zM772.096 576.512q26.624 0 45.056-18.944t18.432-45.568-18.432-45.056-45.056-18.432l-192.512 0 0-192.512q0-26.624-18.944-45.568t-45.568-18.944-45.056 18.944-18.432 45.568l0 192.512-192.512 0q-26.624 0-45.056 18.432t-18.432 45.056 18.432 45.568 45.056 18.944l192.512 0 0 191.488q0 26.624 18.432 45.568t45.056 18.944 45.568-18.944 18.944-45.568l0-191.488 192.512 0z\"></path></svg>"
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { e as t };
|