jsmind 0.4.12 → 0.5.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.
- package/README.md +13 -9
- package/docs/en/1.usage.md +1 -1
- package/docs/en/2.options.md +29 -21
- package/docs/en/index.md +1 -0
- package/docs/zh/1.usage.md +1 -1
- package/docs/zh/2.options.md +25 -22
- package/docs/zh/index.md +1 -0
- package/es6/jsmind.draggable-node.js.map +1 -1
- package/es6/jsmind.js +1 -1
- package/es6/jsmind.js.map +1 -1
- package/es6/jsmind.screenshot.js +1 -1
- package/es6/jsmind.screenshot.js.map +1 -1
- package/js/jsmind.js +9 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# jsMind
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/jsmind)
|
|
3
4
|

|
|
4
5
|
|
|
5
|
-
jsMind 是一个显示/编辑思维导图的纯 javascript 类库,其基于 html5 canvas (和 svg) 进行设计。jsMind 以 BSD 协议开源,在此基础上你可以在你的项目上任意使用。你可以在此浏览[适用于 jsMind
|
|
6
|
+
jsMind 是一个显示/编辑思维导图的纯 javascript 类库,其基于 html5 canvas (和 svg) 进行设计。jsMind 以 BSD 协议开源,在此基础上你可以在你的项目上任意使用。你可以在此浏览[适用于 jsMind 的许可协议][3]。
|
|
6
7
|
|
|
7
|
-
jsMind is
|
|
8
|
+
jsMind is mind map library built by javascript, it base on html5 canvas and svg. jsMind is released under the BSD license, you can embed it in any project as long as you abide by the license. You can read [the license agreement for jsMind][3] here.
|
|
8
9
|
|
|
9
10
|
## Get Started
|
|
10
11
|
|
|
@@ -24,7 +25,7 @@ jsMind is a pure javascript library for mindmap, it base on html5 canvas and svg
|
|
|
24
25
|
<script type="text/javascript">
|
|
25
26
|
var mind = {
|
|
26
27
|
// 3 data formats were supported ...
|
|
27
|
-
// see
|
|
28
|
+
// see documents for more information
|
|
28
29
|
};
|
|
29
30
|
var options = {
|
|
30
31
|
container: 'jsmind_container',
|
|
@@ -40,14 +41,17 @@ jsMind is a pure javascript library for mindmap, it base on html5 canvas and svg
|
|
|
40
41
|
|
|
41
42
|
## Links
|
|
42
43
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
- npm : <https://www.npmjs.com/package/jsmind>
|
|
44
|
+
- Project Home :
|
|
45
|
+
- on Github: <https://github.com/hizzgdev/jsmind>
|
|
46
|
+
- on npm : <https://www.npmjs.com/package/jsmind>
|
|
47
|
+
- Apps :
|
|
48
|
+
- <https://jsmind.online>
|
|
49
|
+
- <https://jsmind.sinaapp.com>
|
|
46
50
|
- Demo :
|
|
47
51
|
- <http://hizzgdev.github.io/jsmind/example/1_basic.html>
|
|
48
52
|
- <http://hizzgdev.github.io/jsmind/example/2_features.html>
|
|
49
53
|
- ~~<http://hizzgdev.github.io/jsmind/example/3_mathjax.html>~~
|
|
50
|
-
-
|
|
54
|
+
- Document :
|
|
51
55
|
- [简体中文][1]
|
|
52
56
|
- [English][2]
|
|
53
57
|
- Wiki :
|
|
@@ -60,8 +64,8 @@ jsMind is a pure javascript library for mindmap, it base on html5 canvas and svg
|
|
|
60
64
|
## ES6 Pilot Version
|
|
61
65
|
|
|
62
66
|
- 目前处于测试阶段,欢迎试用找 bug, ES6 代码位于 `/src`, 可运行于浏览器的 js 文件位于 `/es6`
|
|
63
|
-
- Currently it's in the testing stage,
|
|
64
|
-
- Demo <http://hizzgdev.github.io/jsmind/example/2_features_es6.html>
|
|
67
|
+
- Currently it's in the testing stage, welcome to trial and dig bugs, the ES6 code is located in `/src`, and the js files that can run in browsers are located in `/es6`
|
|
68
|
+
- Demo: <http://hizzgdev.github.io/jsmind/example/2_features_es6.html>
|
|
65
69
|
|
|
66
70
|
## Maintainer
|
|
67
71
|
|
package/docs/en/1.usage.md
CHANGED
|
@@ -191,7 +191,7 @@ In addition to the Themes, there are some styles can be set at node level:
|
|
|
191
191
|
* font-style: font style of the topic of a node, e.g.`italic`
|
|
192
192
|
* background-image: background image url e.g. `http://fakeurl.com/fake-picture.png`, or a data url, e.g. `data:image/png;base64,...`
|
|
193
193
|
* background-rotation: the rotation of the background image, e.g. `30`
|
|
194
|
-
* leading-line-color: the color of the leading line of a node, e.g. `#1abc9c`, `blue` (only works
|
|
194
|
+
* leading-line-color: the color of the leading line of a node, e.g. `#1abc9c`, `blue` (only works in ES6 version)
|
|
195
195
|
|
|
196
196
|
How to set:
|
|
197
197
|
|
package/docs/en/2.options.md
CHANGED
|
@@ -48,7 +48,7 @@ options = {
|
|
|
48
48
|
enable:true, // whether to enable shortcut
|
|
49
49
|
handles:{}, // Named shortcut key event processor
|
|
50
50
|
mapping:{ // shortcut key mapping
|
|
51
|
-
addchild : 45, // <Insert>
|
|
51
|
+
addchild : [45, 4096+13], // <Insert>, <Ctrl> + <Enter>
|
|
52
52
|
addbrother : 13, // <Enter>
|
|
53
53
|
editnode : 113, // <F2>
|
|
54
54
|
delnode : 46, // <Delete>
|
|
@@ -87,13 +87,20 @@ These options are described in more detail below.
|
|
|
87
87
|
|
|
88
88
|
> Specify the theme name of jsMind. (look in jsMind.css)
|
|
89
89
|
|
|
90
|
-
**mode** : (string)
|
|
90
|
+
**mode** : (string) layout mode
|
|
91
91
|
|
|
92
|
-
> jsMind
|
|
92
|
+
> When adding a first-level child node to the mind map, jsMind will decide which side to place the node based on this option. 2 layout modes are currently supported::
|
|
93
93
|
|
|
94
94
|
> * full - child nodes are dynamically distributed on both sides of the root node [default]
|
|
95
95
|
> * side - child nodes are distributed only to the right of the root node
|
|
96
96
|
|
|
97
|
+
> 当往脑图里添加一级子节点时,jsMind 将根据此参数决定把节点放置在哪一侧。目前支持两种布局模式:
|
|
98
|
+
|
|
99
|
+
> * full - 子节点动态分布在根节点两侧 [默认值]
|
|
100
|
+
> * side - 子节点只分布在根节点右侧
|
|
101
|
+
|
|
102
|
+
> Note that this option only takes effect when adding nodes (`jsMind.add_node(...)`)
|
|
103
|
+
|
|
97
104
|
**support_html** : (bool) Does it support HTML elements in nodes?
|
|
98
105
|
|
|
99
106
|
> The default value of this parameter is true, meaning that it allows HTML code to be used in the node's header, and you can even insert a table `<table>` in the node's header if you wish. If you want only plain text in the title, set this parameter to false .
|
|
@@ -167,41 +174,42 @@ handles : {
|
|
|
167
174
|
}
|
|
168
175
|
```
|
|
169
176
|
|
|
170
|
-
**shortcut.mapping** : (object{string : number}) Shortcut mapping configuration
|
|
177
|
+
**shortcut.mapping** : (object{string : number | [number]}) Shortcut mapping configuration
|
|
171
178
|
|
|
172
179
|
> This parameter is used to configure the correspondence between a specific key and the event handler, this code shows the correspondence by default, e.g. the code for the [Insert] key is 45 and can be used to add a child node, while 112 represents the [F1] key for dosomething.
|
|
180
|
+
> Note: You can also bind multiple shortcut keys to an event handler, just use an array.
|
|
173
181
|
|
|
174
182
|
```javascript
|
|
175
|
-
mapping:{
|
|
176
|
-
addchild
|
|
177
|
-
addbrother : 13,
|
|
178
|
-
editnode
|
|
179
|
-
delnode
|
|
180
|
-
toggle
|
|
181
|
-
left
|
|
182
|
-
up
|
|
183
|
-
right
|
|
184
|
-
down
|
|
183
|
+
mapping:{ // handle mapping.
|
|
184
|
+
addchild : [45, 4096+13], // <Insert>, <Ctrl> + <Enter>
|
|
185
|
+
addbrother : 13, // <Enter>
|
|
186
|
+
editnode : 113, // <F2>
|
|
187
|
+
delnode : 46, // <Delete>
|
|
188
|
+
toggle : 32, // <Space>
|
|
189
|
+
left : 37, // <Left>
|
|
190
|
+
up : 38, // <Up>
|
|
191
|
+
right : 39, // <Right>
|
|
192
|
+
down : 40, // <Down>
|
|
185
193
|
|
|
186
194
|
// Examples
|
|
187
|
-
dosomething: 112,
|
|
195
|
+
dosomething: 112, // <F1>
|
|
188
196
|
}
|
|
189
197
|
```
|
|
190
198
|
|
|
191
199
|
> In addition to the single-key scenario described above, jsMind has added support for combination keys, where the code of the combination shortcut is the code of the regular key plus the identification code of the function key.
|
|
192
200
|
> Four function keys are currently supported, and the corresponding identification codes are.
|
|
193
201
|
|
|
194
|
-
> * Meta : 8192
|
|
195
|
-
> * Ctrl : 4096
|
|
196
|
-
> * ALT : 2048
|
|
197
|
-
> * SHIFT : 1024
|
|
202
|
+
> * Meta : 8192
|
|
203
|
+
> * Ctrl : 4096
|
|
204
|
+
> * ALT : 2048
|
|
205
|
+
> * SHIFT : 1024
|
|
198
206
|
|
|
199
207
|
> The following are some examples.
|
|
200
208
|
|
|
201
209
|
```javascript
|
|
202
210
|
mapping:{
|
|
203
|
-
addchild :
|
|
204
|
-
delnode :
|
|
211
|
+
addchild : 4096 + 73, // <Ctrl> + <I>
|
|
212
|
+
delnode : 4096 + 2048 + 68, // <Ctrl> + <ALT> + <D>
|
|
205
213
|
}
|
|
206
214
|
```
|
|
207
215
|
|
package/docs/en/index.md
CHANGED
package/docs/zh/1.usage.md
CHANGED
|
@@ -224,7 +224,7 @@ jmnodes.theme-greensea jmexpander:hover{} /* 鼠
|
|
|
224
224
|
* font-style: 节点的文本样式,如 `italic`
|
|
225
225
|
* background-image: 节点的背景图片,可使用 url,如 `http://fakeurl.com/fake-picture.png`,或 data url 形式,如 `data:image/png;base64,...`
|
|
226
226
|
* background-rotation: 节点的背景图片旋转角度,如 `30`
|
|
227
|
-
* leading-line-color: 节点的引导线颜色,如 `#1abc9c`, `blue`。仅在 ES6
|
|
227
|
+
* leading-line-color: 节点的引导线颜色,如 `#1abc9c`, `blue`。仅在 ES6 版本中支持。
|
|
228
228
|
|
|
229
229
|
设置方法:
|
|
230
230
|
|
package/docs/zh/2.options.md
CHANGED
|
@@ -27,7 +27,7 @@ options = {
|
|
|
27
27
|
container : '', // [必选] 容器的ID
|
|
28
28
|
editable : false, // 是否启用编辑
|
|
29
29
|
theme : null, // 主题
|
|
30
|
-
mode :'full', //
|
|
30
|
+
mode :'full', // 布局模式
|
|
31
31
|
support_html : true, // 是否支持节点里的HTML元素
|
|
32
32
|
log_level: 'info', // 日志级别
|
|
33
33
|
view:{
|
|
@@ -48,7 +48,7 @@ options = {
|
|
|
48
48
|
enable:true, // 是否启用快捷键
|
|
49
49
|
handles:{}, // 命名的快捷键事件处理器
|
|
50
50
|
mapping:{ // 快捷键映射
|
|
51
|
-
addchild : 45,
|
|
51
|
+
addchild : [45, 4096+13], // <Insert>, <Ctrl> + <Enter>
|
|
52
52
|
addbrother : 13, // <Enter>
|
|
53
53
|
editnode : 113, // <F2>
|
|
54
54
|
delnode : 46, // <Delete>
|
|
@@ -85,13 +85,15 @@ options = {
|
|
|
85
85
|
|
|
86
86
|
> 指定 jsMind 的主题名。
|
|
87
87
|
|
|
88
|
-
**mode** : (string)
|
|
88
|
+
**mode** : (string) 布局模式
|
|
89
89
|
|
|
90
|
-
> jsMind
|
|
90
|
+
> 当往脑图里添加一级子节点时,jsMind 将根据此参数决定把节点放置在哪一侧。目前支持两种布局模式:
|
|
91
91
|
|
|
92
92
|
> * full - 子节点动态分布在根节点两侧 [默认值]
|
|
93
93
|
> * side - 子节点只分布在根节点右侧
|
|
94
94
|
|
|
95
|
+
> 需要注意的是,此参数只在添加节点时(`jsMind.add_node(...)`)生效。
|
|
96
|
+
|
|
95
97
|
**support_html** : (bool) 是否支持节点里的HTML元素
|
|
96
98
|
|
|
97
99
|
> 该参数的默认值为 true ,含义为允许在节点的标题中使用 HTML 代码,如果你愿意,你甚至可以在节点标题里插入一个表格`<table>`。如果你希望标题中只有纯文本,请将该参数设为 false 。
|
|
@@ -164,41 +166,42 @@ handles : {
|
|
|
164
166
|
}
|
|
165
167
|
```
|
|
166
168
|
|
|
167
|
-
**shortcut.mapping** : (object{string : number}) 快捷键映射配置
|
|
169
|
+
**shortcut.mapping** : (object{string : number | [number]}) 快捷键映射配置
|
|
168
170
|
|
|
169
171
|
> 该参数用于配置具体的按键与处理器之间的对应关系,此代码显示了默认情况下的对应关系,如 [Insert] 键的代码是 45 ,可用于添加一个子节点,而 112 代表的是 [F1] 键,用于 dosomething。
|
|
172
|
+
> 提示:还可以为一个处理器配置多个快捷键,把键码替换为数组即可。
|
|
170
173
|
|
|
171
174
|
```javascript
|
|
172
|
-
mapping:{
|
|
173
|
-
addchild : 45, // <Insert>
|
|
174
|
-
addbrother : 13,
|
|
175
|
-
editnode : 113,
|
|
176
|
-
delnode : 46,
|
|
177
|
-
toggle : 32,
|
|
178
|
-
left : 37,
|
|
179
|
-
up : 38,
|
|
180
|
-
right : 39,
|
|
181
|
-
down : 40,
|
|
175
|
+
mapping:{ // handle mapping.
|
|
176
|
+
addchild : [45, 4096+13], // <Insert>, <Ctrl> + <Enter>
|
|
177
|
+
addbrother : 13, // <Enter>
|
|
178
|
+
editnode : 113, // <F2>
|
|
179
|
+
delnode : 46, // <Delete>
|
|
180
|
+
toggle : 32, // <Space>
|
|
181
|
+
left : 37, // <Left>
|
|
182
|
+
up : 38, // <Up>
|
|
183
|
+
right : 39, // <Right>
|
|
184
|
+
down : 40, // <Down>
|
|
182
185
|
|
|
183
186
|
// 示例
|
|
184
|
-
dosomething: 112,
|
|
187
|
+
dosomething: 112, // <F1>
|
|
185
188
|
}
|
|
186
189
|
```
|
|
187
190
|
|
|
188
191
|
> 除了上述这种单一按键的情况,jsMind新增了对组合按键的支持,组合快捷键的代码为常规按键的代码加上功能键的标识代码。
|
|
189
192
|
> 目前支持四种功能键,对应的标识代码分别为:
|
|
190
193
|
|
|
191
|
-
> * Meta : 8192
|
|
192
|
-
> * Ctrl : 4096
|
|
193
|
-
> * ALT : 2048
|
|
194
|
-
> * SHIFT : 1024
|
|
194
|
+
> * Meta : 8192
|
|
195
|
+
> * Ctrl : 4096
|
|
196
|
+
> * ALT : 2048
|
|
197
|
+
> * SHIFT : 1024
|
|
195
198
|
|
|
196
199
|
> 以下是一些示例:
|
|
197
200
|
|
|
198
201
|
```javascript
|
|
199
202
|
mapping:{
|
|
200
|
-
addchild :
|
|
201
|
-
delnode :
|
|
203
|
+
addchild : 4096 + 73, // <Ctrl> + <I>
|
|
204
|
+
delnode : 4096 + 2048 + 68, // <Ctrl> + <ALT> + <D>
|
|
202
205
|
}
|
|
203
206
|
```
|
|
204
207
|
|
package/docs/zh/index.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsmind.draggable-node.js","sources":["../src/plugins/jsmind.draggable-node.js"],"sourcesContent":["/**\n * @license BSD\n * @copyright 2014-2022 hizzgdev@163.com\n *\n * Project Home:\n * https://github.com/hizzgdev/jsmind/\n */\n\nif (!jsMind) {\n throw new Error('jsMind is not defined');\n}\n\nconst jm = jsMind;\nconst $ = jm.$;\n\nconst clear_selection =\n 'getSelection' in $.w\n ? function () {\n $.w.getSelection().removeAllRanges();\n }\n : function () {\n $.d.selection.empty();\n };\n\nconst options = {\n line_width: 5,\n lookup_delay: 500,\n lookup_interval: 80,\n};\n\nclass DraggableNode {\n constructor(jm) {\n this.jm = jm;\n this.e_canvas = null;\n this.canvas_ctx = null;\n this.shadow = null;\n this.shadow_w = 0;\n this.shadow_h = 0;\n this.active_node = null;\n this.target_node = null;\n this.target_direct = null;\n this.client_w = 0;\n this.client_h = 0;\n this.offset_x = 0;\n this.offset_y = 0;\n this.hlookup_delay = 0;\n this.hlookup_timer = 0;\n this.capture = false;\n this.moved = false;\n this.canvas_draggable = this.jm.get_view_draggable();\n }\n init() {\n this._create_canvas();\n this._create_shadow();\n this._event_bind();\n }\n resize() {\n this.jm.view.e_nodes.appendChild(this.shadow);\n this.e_canvas.width = this.jm.view.size.w;\n this.e_canvas.height = this.jm.view.size.h;\n }\n _create_canvas() {\n var c = $.c('canvas');\n this.jm.view.e_panel.appendChild(c);\n var ctx = c.getContext('2d');\n this.e_canvas = c;\n this.canvas_ctx = ctx;\n }\n _create_shadow() {\n var s = $.c('jmnode');\n s.style.visibility = 'hidden';\n s.style.zIndex = '3';\n s.style.cursor = 'move';\n s.style.opacity = '0.7';\n this.shadow = s;\n }\n reset_shadow(el) {\n var s = this.shadow.style;\n this.shadow.innerHTML = el.innerHTML;\n s.left = el.style.left;\n s.top = el.style.top;\n s.width = el.style.width;\n s.height = el.style.height;\n s.backgroundImage = el.style.backgroundImage;\n s.backgroundSize = el.style.backgroundSize;\n s.transform = el.style.transform;\n this.shadow_w = this.shadow.clientWidth;\n this.shadow_h = this.shadow.clientHeight;\n }\n show_shadow() {\n if (!this.moved) {\n this.shadow.style.visibility = 'visible';\n }\n }\n hide_shadow() {\n this.shadow.style.visibility = 'hidden';\n }\n _magnet_shadow(node) {\n if (!!node) {\n this.canvas_ctx.lineWidth = options.line_width;\n this.canvas_ctx.strokeStyle = 'rgba(0,0,0,0.3)';\n this.canvas_ctx.lineCap = 'round';\n this._clear_lines();\n this._canvas_lineto(node.sp.x, node.sp.y, node.np.x, node.np.y);\n }\n }\n _clear_lines() {\n this.canvas_ctx.clearRect(0, 0, this.jm.view.size.w, this.jm.view.size.h);\n }\n _canvas_lineto(x1, y1, x2, y2) {\n this.canvas_ctx.beginPath();\n this.canvas_ctx.moveTo(x1, y1);\n this.canvas_ctx.lineTo(x2, y2);\n this.canvas_ctx.stroke();\n }\n _lookup_close_node() {\n var root = this.jm.get_root();\n var root_location = root.get_location();\n var root_size = root.get_size();\n var root_x = root_location.x + root_size.w / 2;\n\n var sw = this.shadow_w;\n var sh = this.shadow_h;\n var sx = this.shadow.offsetLeft;\n var sy = this.shadow.offsetTop;\n\n var ns, nl;\n\n var direct = sx + sw / 2 >= root_x ? jsMind.direction.right : jsMind.direction.left;\n var nodes = this.jm.mind.nodes;\n var node = null;\n var layout = this.jm.layout;\n var min_distance = Number.MAX_VALUE;\n var distance = 0;\n var closest_node = null;\n var closest_p = null;\n var shadow_p = null;\n for (var nodeid in nodes) {\n var np, sp;\n node = nodes[nodeid];\n if (node.isroot || node.direction == direct) {\n if (node.id == this.active_node.id) {\n continue;\n }\n if (!layout.is_visible(node)) {\n continue;\n }\n ns = node.get_size();\n nl = node.get_location();\n if (direct == jsMind.direction.right) {\n if (sx - nl.x - ns.w <= 0) {\n continue;\n }\n distance = Math.abs(sx - nl.x - ns.w) + Math.abs(sy + sh / 2 - nl.y - ns.h / 2);\n np = { x: nl.x + ns.w - options.line_width, y: nl.y + ns.h / 2 };\n sp = { x: sx + options.line_width, y: sy + sh / 2 };\n } else {\n if (nl.x - sx - sw <= 0) {\n continue;\n }\n distance = Math.abs(sx + sw - nl.x) + Math.abs(sy + sh / 2 - nl.y - ns.h / 2);\n np = { x: nl.x + options.line_width, y: nl.y + ns.h / 2 };\n sp = { x: sx + sw - options.line_width, y: sy + sh / 2 };\n }\n if (distance < min_distance) {\n closest_node = node;\n closest_p = np;\n shadow_p = sp;\n min_distance = distance;\n }\n }\n }\n var result_node = null;\n if (!!closest_node) {\n result_node = {\n node: closest_node,\n direction: direct,\n sp: shadow_p,\n np: closest_p,\n };\n }\n return result_node;\n }\n lookup_close_node() {\n var node_data = this._lookup_close_node();\n if (!!node_data) {\n this._magnet_shadow(node_data);\n this.target_node = node_data.node;\n this.target_direct = node_data.direction;\n }\n }\n _event_bind() {\n var jd = this;\n var container = this.jm.view.container;\n $.on(container, 'mousedown', function (e) {\n var evt = e || event;\n jd.dragstart.call(jd, evt);\n });\n $.on(container, 'mousemove', function (e) {\n var evt = e || event;\n jd.drag.call(jd, evt);\n });\n $.on(container, 'mouseup', function (e) {\n var evt = e || event;\n jd.dragend.call(jd, evt);\n });\n $.on(container, 'touchstart', function (e) {\n var evt = e || event;\n jd.dragstart.call(jd, evt);\n });\n $.on(container, 'touchmove', function (e) {\n var evt = e || event;\n jd.drag.call(jd, evt);\n });\n $.on(container, 'touchend', function (e) {\n var evt = e || event;\n jd.dragend.call(jd, evt);\n });\n }\n dragstart(e) {\n if (!this.jm.get_editable()) {\n return;\n }\n if (this.capture) {\n return;\n }\n this.active_node = null;\n this.view_draggable = this.jm.get_view_draggable();\n\n var jview = this.jm.view;\n var el = e.target || event.srcElement;\n if (el.tagName.toLowerCase() != 'jmnode') {\n return;\n }\n if (this.view_draggable) {\n this.jm.disable_view_draggable();\n }\n var nodeid = jview.get_binded_nodeid(el);\n if (!!nodeid) {\n var node = this.jm.get_node(nodeid);\n if (!node.isroot) {\n this.reset_shadow(el);\n this.active_node = node;\n this.offset_x =\n (e.clientX || e.touches[0].clientX) / jview.actualZoom - el.offsetLeft;\n this.offset_y =\n (e.clientY || e.touches[0].clientY) / jview.actualZoom - el.offsetTop;\n this.client_hw = Math.floor(el.clientWidth / 2);\n this.client_hh = Math.floor(el.clientHeight / 2);\n if (this.hlookup_delay != 0) {\n $.w.clearTimeout(this.hlookup_delay);\n }\n if (this.hlookup_timer != 0) {\n $.w.clearInterval(this.hlookup_timer);\n }\n var jd = this;\n this.hlookup_delay = $.w.setTimeout(function () {\n jd.hlookup_delay = 0;\n jd.hlookup_timer = $.w.setInterval(function () {\n jd.lookup_close_node.call(jd);\n }, options.lookup_interval);\n }, options.lookup_delay);\n this.capture = true;\n }\n }\n }\n drag(e) {\n if (!this.jm.get_editable()) {\n return;\n }\n if (this.capture) {\n e.preventDefault();\n this.show_shadow();\n this.moved = true;\n clear_selection();\n var jview = this.jm.view;\n var px = (e.clientX || e.touches[0].clientX) / jview.actualZoom - this.offset_x;\n var py = (e.clientY || e.touches[0].clientY) / jview.actualZoom - this.offset_y;\n this.shadow.style.left = px + 'px';\n this.shadow.style.top = py + 'px';\n clear_selection();\n }\n }\n dragend(e) {\n if (!this.jm.get_editable()) {\n return;\n }\n if (this.view_draggable) {\n this.jm.enable_view_draggable();\n }\n if (this.capture) {\n if (this.hlookup_delay != 0) {\n $.w.clearTimeout(this.hlookup_delay);\n this.hlookup_delay = 0;\n this._clear_lines();\n }\n if (this.hlookup_timer != 0) {\n $.w.clearInterval(this.hlookup_timer);\n this.hlookup_timer = 0;\n this._clear_lines();\n }\n if (this.moved) {\n var src_node = this.active_node;\n var target_node = this.target_node;\n var target_direct = this.target_direct;\n this.move_node(src_node, target_node, target_direct);\n }\n this.hide_shadow();\n }\n this.moved = false;\n this.capture = false;\n }\n move_node(src_node, target_node, target_direct) {\n var shadow_h = this.shadow.offsetTop;\n if (!!target_node && !!src_node && !jsMind.node.inherited(src_node, target_node)) {\n // lookup before_node\n var sibling_nodes = target_node.children;\n var sc = sibling_nodes.length;\n var node = null;\n var delta_y = Number.MAX_VALUE;\n var node_before = null;\n var beforeid = '_last_';\n while (sc--) {\n node = sibling_nodes[sc];\n if (node.direction == target_direct && node.id != src_node.id) {\n var dy = node.get_location().y - shadow_h;\n if (dy > 0 && dy < delta_y) {\n delta_y = dy;\n node_before = node;\n beforeid = '_first_';\n }\n }\n }\n if (!!node_before) {\n beforeid = node_before.id;\n }\n this.jm.move_node(src_node.id, beforeid, target_node.id, target_direct);\n }\n this.active_node = null;\n this.target_node = null;\n this.target_direct = null;\n }\n jm_event_handle(type, data) {\n if (type === jsMind.event_type.resize) {\n this.resize();\n }\n }\n}\n\nvar draggable_plugin = new jm.plugin('draggable_node', function (jm) {\n var jd = new DraggableNode(jm);\n jd.init();\n jm.add_event_listener(function (type, data) {\n jd.jm_event_handle.call(jd, type, data);\n });\n});\n\njsMind.register_plugin(draggable_plugin);\n"],"names":["jsMind","Error","jm","$","clear_selection","w","getSelection","removeAllRanges","d","selection","empty","options","DraggableNode","constructor","this","e_canvas","canvas_ctx","shadow","shadow_w","shadow_h","active_node","target_node","target_direct","client_w","client_h","offset_x","offset_y","hlookup_delay","hlookup_timer","capture","moved","canvas_draggable","get_view_draggable","init","_create_canvas","_create_shadow","_event_bind","resize","view","e_nodes","appendChild","width","size","height","h","c","e_panel","ctx","getContext","s","style","visibility","zIndex","cursor","opacity","reset_shadow","el","innerHTML","left","top","backgroundImage","backgroundSize","transform","clientWidth","clientHeight","show_shadow","hide_shadow","_magnet_shadow","node","lineWidth","strokeStyle","lineCap","_clear_lines","_canvas_lineto","sp","x","y","np","clearRect","x1","y1","x2","y2","beginPath","moveTo","lineTo","stroke","_lookup_close_node","ns","nl","root","get_root","root_location","get_location","root_size","get_size","root_x","sw","sh","sx","offsetLeft","sy","offsetTop","direct","direction","right","nodes","mind","layout","min_distance","Number","MAX_VALUE","distance","closest_node","closest_p","shadow_p","nodeid","isroot","id","is_visible","Math","abs","result_node","lookup_close_node","node_data","jd","container","on","e","evt","event","dragstart","call","drag","dragend","get_editable","view_draggable","jview","target","srcElement","tagName","toLowerCase","disable_view_draggable","get_binded_nodeid","get_node","clientX","touches","actualZoom","clientY","client_hw","floor","client_hh","clearTimeout","clearInterval","setTimeout","setInterval","preventDefault","px","py","enable_view_draggable","src_node","move_node","inherited","sibling_nodes","children","sc","length","delta_y","node_before","beforeid","dy","jm_event_handle","type","data","event_type","draggable_plugin","plugin","add_event_listener","register_plugin"],"mappings":";;;;;;;yBAQA,IAAKA,OACD,MAAM,IAAIC,MAAM,yBAGpB,MAAMC,EAAKF,OACLG,EAAID,EAAGC,EAEPC,EACF,iBAAkBD,EAAEE,EACd,WACIF,EAAEE,EAAEC,eAAeC,mBAEvB,WACIJ,EAAEK,EAAEC,UAAUC,SAGtBC,EACU,EADVA,EAEY,IAFZA,EAGe,GAGrB,MAAMC,EACFC,YAAYX,GACRY,KAAKZ,GAAKA,EACVY,KAAKC,SAAW,KAChBD,KAAKE,WAAa,KAClBF,KAAKG,OAAS,KACdH,KAAKI,SAAW,EAChBJ,KAAKK,SAAW,EAChBL,KAAKM,YAAc,KACnBN,KAAKO,YAAc,KACnBP,KAAKQ,cAAgB,KACrBR,KAAKS,SAAW,EAChBT,KAAKU,SAAW,EAChBV,KAAKW,SAAW,EAChBX,KAAKY,SAAW,EAChBZ,KAAKa,cAAgB,EACrBb,KAAKc,cAAgB,EACrBd,KAAKe,SAAU,EACff,KAAKgB,OAAQ,EACbhB,KAAKiB,iBAAmBjB,KAAKZ,GAAG8B,qBAEpCC,OACInB,KAAKoB,iBACLpB,KAAKqB,iBACLrB,KAAKsB,cAETC,SACIvB,KAAKZ,GAAGoC,KAAKC,QAAQC,YAAY1B,KAAKG,QACtCH,KAAKC,SAAS0B,MAAQ3B,KAAKZ,GAAGoC,KAAKI,KAAKrC,EACxCS,KAAKC,SAAS4B,OAAS7B,KAAKZ,GAAGoC,KAAKI,KAAKE,EAE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B2I,IAAahK,OAAOoE,KAAK8F,UAAUF,EAAU3I,GAAc,CAQ9E,IANA,IAAI8I,EAAgB9I,EAAY+I,SAC5BC,EAAKF,EAAcG,OACnBlG,EAAO,KACPmG,EAAUzD,OAAOC,UACjByD,EAAc,KACdC,EAAW,SACRJ,KAEH,IADAjG,EAAO+F,EAAcE,IACZ7D,WAAalF,GAAiB8C,EAAKkD,IAAM0C,EAAS1C,GAAI,CAC3D,IAAIoD,EAAKtG,EAAKyB,eAAejB,EAAIzD,EAC7BuJ,EAAK,GAAKA,EAAKH,IACfA,EAAUG,EACVF,EAAcpG,EACdqG,EAAW,WAIjBD,IACFC,EAAWD,EAAYlD,IAE3BxG,KAAKZ,GAAG+J,UAAUD,EAAS1C,GAAImD,EAAUpJ,EAAYiG,GAAIhG,GAE7DR,KAAKM,YAAc,KACnBN,KAAKO,YAAc,KACnBP,KAAKQ,cAAgB,KAEzBqJ,gBAAgBC,EAAMC,GACdD,IAAS5K,OAAO8K,WAAWzI,QAC3BvB,KAAKuB,UAKjB,IAAI0I,EAAmB,IAAI7K,EAAG8K,OAAO,kBAAkB,SAAU9K,GAC7D,IAAI2H,EAAK,IAAIjH,EAAcV,GAC3B2H,EAAG5F,OACH/B,EAAG+K,oBAAmB,SAAUL,EAAMC,GAClChD,EAAG8C,gBAAgBvC,KAAKP,EAAI+C,EAAMC,SAI1C7K,OAAOkL,gBAAgBH"}
|
|
1
|
+
{"version":3,"file":"jsmind.draggable-node.js","sources":["../src/plugins/jsmind.draggable-node.js"],"sourcesContent":["/**\n * @license BSD\n * @copyright 2014-2022 hizzgdev@163.com\n *\n * Project Home:\n * https://github.com/hizzgdev/jsmind/\n */\n\nif (!jsMind) {\n throw new Error('jsMind is not defined');\n}\n\nconst jm = jsMind;\nconst $ = jm.$;\n\nconst clear_selection =\n 'getSelection' in $.w\n ? function () {\n $.w.getSelection().removeAllRanges();\n }\n : function () {\n $.d.selection.empty();\n };\n\nconst options = {\n line_width: 5,\n lookup_delay: 500,\n lookup_interval: 80,\n};\n\nclass DraggableNode {\n constructor(jm) {\n this.jm = jm;\n this.e_canvas = null;\n this.canvas_ctx = null;\n this.shadow = null;\n this.shadow_w = 0;\n this.shadow_h = 0;\n this.active_node = null;\n this.target_node = null;\n this.target_direct = null;\n this.client_w = 0;\n this.client_h = 0;\n this.offset_x = 0;\n this.offset_y = 0;\n this.hlookup_delay = 0;\n this.hlookup_timer = 0;\n this.capture = false;\n this.moved = false;\n this.canvas_draggable = this.jm.get_view_draggable();\n }\n init() {\n this._create_canvas();\n this._create_shadow();\n this._event_bind();\n }\n resize() {\n this.jm.view.e_nodes.appendChild(this.shadow);\n this.e_canvas.width = this.jm.view.size.w;\n this.e_canvas.height = this.jm.view.size.h;\n }\n _create_canvas() {\n var c = $.c('canvas');\n this.jm.view.e_panel.appendChild(c);\n var ctx = c.getContext('2d');\n this.e_canvas = c;\n this.canvas_ctx = ctx;\n }\n _create_shadow() {\n var s = $.c('jmnode');\n s.style.visibility = 'hidden';\n s.style.zIndex = '3';\n s.style.cursor = 'move';\n s.style.opacity = '0.7';\n this.shadow = s;\n }\n reset_shadow(el) {\n var s = this.shadow.style;\n this.shadow.innerHTML = el.innerHTML;\n s.left = el.style.left;\n s.top = el.style.top;\n s.width = el.style.width;\n s.height = el.style.height;\n s.backgroundImage = el.style.backgroundImage;\n s.backgroundSize = el.style.backgroundSize;\n s.transform = el.style.transform;\n this.shadow_w = this.shadow.clientWidth;\n this.shadow_h = this.shadow.clientHeight;\n }\n show_shadow() {\n if (!this.moved) {\n this.shadow.style.visibility = 'visible';\n }\n }\n hide_shadow() {\n this.shadow.style.visibility = 'hidden';\n }\n _magnet_shadow(node) {\n if (!!node) {\n this.canvas_ctx.lineWidth = options.line_width;\n this.canvas_ctx.strokeStyle = 'rgba(0,0,0,0.3)';\n this.canvas_ctx.lineCap = 'round';\n this._clear_lines();\n this._canvas_lineto(node.sp.x, node.sp.y, node.np.x, node.np.y);\n }\n }\n _clear_lines() {\n this.canvas_ctx.clearRect(0, 0, this.jm.view.size.w, this.jm.view.size.h);\n }\n _canvas_lineto(x1, y1, x2, y2) {\n this.canvas_ctx.beginPath();\n this.canvas_ctx.moveTo(x1, y1);\n this.canvas_ctx.lineTo(x2, y2);\n this.canvas_ctx.stroke();\n }\n _lookup_close_node() {\n var root = this.jm.get_root();\n var root_location = root.get_location();\n var root_size = root.get_size();\n var root_x = root_location.x + root_size.w / 2;\n\n var sw = this.shadow_w;\n var sh = this.shadow_h;\n var sx = this.shadow.offsetLeft;\n var sy = this.shadow.offsetTop;\n\n var ns, nl;\n\n var direct = sx + sw / 2 >= root_x ? jsMind.direction.right : jsMind.direction.left;\n var nodes = this.jm.mind.nodes;\n var node = null;\n var layout = this.jm.layout;\n var min_distance = Number.MAX_VALUE;\n var distance = 0;\n var closest_node = null;\n var closest_p = null;\n var shadow_p = null;\n for (var nodeid in nodes) {\n var np, sp;\n node = nodes[nodeid];\n if (node.isroot || node.direction == direct) {\n if (node.id == this.active_node.id) {\n continue;\n }\n if (!layout.is_visible(node)) {\n continue;\n }\n ns = node.get_size();\n nl = node.get_location();\n if (direct == jsMind.direction.right) {\n if (sx - nl.x - ns.w <= 0) {\n continue;\n }\n distance = Math.abs(sx - nl.x - ns.w) + Math.abs(sy + sh / 2 - nl.y - ns.h / 2);\n np = { x: nl.x + ns.w - options.line_width, y: nl.y + ns.h / 2 };\n sp = { x: sx + options.line_width, y: sy + sh / 2 };\n } else {\n if (nl.x - sx - sw <= 0) {\n continue;\n }\n distance = Math.abs(sx + sw - nl.x) + Math.abs(sy + sh / 2 - nl.y - ns.h / 2);\n np = { x: nl.x + options.line_width, y: nl.y + ns.h / 2 };\n sp = { x: sx + sw - options.line_width, y: sy + sh / 2 };\n }\n if (distance < min_distance) {\n closest_node = node;\n closest_p = np;\n shadow_p = sp;\n min_distance = distance;\n }\n }\n }\n var result_node = null;\n if (!!closest_node) {\n result_node = {\n node: closest_node,\n direction: direct,\n sp: shadow_p,\n np: closest_p,\n };\n }\n return result_node;\n }\n lookup_close_node() {\n var node_data = this._lookup_close_node();\n if (!!node_data) {\n this._magnet_shadow(node_data);\n this.target_node = node_data.node;\n this.target_direct = node_data.direction;\n }\n }\n _event_bind() {\n var jd = this;\n var container = this.jm.view.container;\n $.on(container, 'mousedown', function (e) {\n var evt = e || event;\n jd.dragstart.call(jd, evt);\n });\n $.on(container, 'mousemove', function (e) {\n var evt = e || event;\n jd.drag.call(jd, evt);\n });\n $.on(container, 'mouseup', function (e) {\n var evt = e || event;\n jd.dragend.call(jd, evt);\n });\n $.on(container, 'touchstart', function (e) {\n var evt = e || event;\n jd.dragstart.call(jd, evt);\n });\n $.on(container, 'touchmove', function (e) {\n var evt = e || event;\n jd.drag.call(jd, evt);\n });\n $.on(container, 'touchend', function (e) {\n var evt = e || event;\n jd.dragend.call(jd, evt);\n });\n }\n dragstart(e) {\n if (!this.jm.get_editable()) {\n return;\n }\n if (this.capture) {\n return;\n }\n this.active_node = null;\n this.view_draggable = this.jm.get_view_draggable();\n\n var jview = this.jm.view;\n var el = e.target || event.srcElement;\n if (el.tagName.toLowerCase() != 'jmnode') {\n return;\n }\n if (this.view_draggable) {\n this.jm.disable_view_draggable();\n }\n var nodeid = jview.get_binded_nodeid(el);\n if (!!nodeid) {\n var node = this.jm.get_node(nodeid);\n if (!node.isroot) {\n this.reset_shadow(el);\n this.active_node = node;\n this.offset_x =\n (e.clientX || e.touches[0].clientX) / jview.actualZoom - el.offsetLeft;\n this.offset_y =\n (e.clientY || e.touches[0].clientY) / jview.actualZoom - el.offsetTop;\n this.client_hw = Math.floor(el.clientWidth / 2);\n this.client_hh = Math.floor(el.clientHeight / 2);\n if (this.hlookup_delay != 0) {\n $.w.clearTimeout(this.hlookup_delay);\n }\n if (this.hlookup_timer != 0) {\n $.w.clearInterval(this.hlookup_timer);\n }\n var jd = this;\n this.hlookup_delay = $.w.setTimeout(function () {\n jd.hlookup_delay = 0;\n jd.hlookup_timer = $.w.setInterval(function () {\n jd.lookup_close_node.call(jd);\n }, options.lookup_interval);\n }, options.lookup_delay);\n this.capture = true;\n }\n }\n }\n drag(e) {\n if (!this.jm.get_editable()) {\n return;\n }\n if (this.capture) {\n e.preventDefault();\n this.show_shadow();\n this.moved = true;\n clear_selection();\n var jview = this.jm.view;\n var px = (e.clientX || e.touches[0].clientX) / jview.actualZoom - this.offset_x;\n var py = (e.clientY || e.touches[0].clientY) / jview.actualZoom - this.offset_y;\n this.shadow.style.left = px + 'px';\n this.shadow.style.top = py + 'px';\n clear_selection();\n }\n }\n dragend(e) {\n if (!this.jm.get_editable()) {\n return;\n }\n if (this.view_draggable) {\n this.jm.enable_view_draggable();\n }\n if (this.capture) {\n if (this.hlookup_delay != 0) {\n $.w.clearTimeout(this.hlookup_delay);\n this.hlookup_delay = 0;\n this._clear_lines();\n }\n if (this.hlookup_timer != 0) {\n $.w.clearInterval(this.hlookup_timer);\n this.hlookup_timer = 0;\n this._clear_lines();\n }\n if (this.moved) {\n var src_node = this.active_node;\n var target_node = this.target_node;\n var target_direct = this.target_direct;\n this.move_node(src_node, target_node, target_direct);\n }\n this.hide_shadow();\n }\n this.moved = false;\n this.capture = false;\n }\n move_node(src_node, target_node, target_direct) {\n var shadow_h = this.shadow.offsetTop;\n if (!!target_node && !!src_node && !jsMind.node.inherited(src_node, target_node)) {\n // lookup before_node\n var sibling_nodes = target_node.children;\n var sc = sibling_nodes.length;\n var node = null;\n var delta_y = Number.MAX_VALUE;\n var node_before = null;\n var beforeid = '_last_';\n while (sc--) {\n node = sibling_nodes[sc];\n if (node.direction == target_direct && node.id != src_node.id) {\n var dy = node.get_location().y - shadow_h;\n if (dy > 0 && dy < delta_y) {\n delta_y = dy;\n node_before = node;\n beforeid = '_first_';\n }\n }\n }\n if (!!node_before) {\n beforeid = node_before.id;\n }\n this.jm.move_node(src_node.id, beforeid, target_node.id, target_direct);\n }\n this.active_node = null;\n this.target_node = null;\n this.target_direct = null;\n }\n jm_event_handle(type, data) {\n if (type === jsMind.event_type.resize) {\n this.resize();\n }\n }\n}\n\nvar draggable_plugin = new jm.plugin('draggable_node', function (jm) {\n var jd = new DraggableNode(jm);\n jd.init();\n jm.add_event_listener(function (type, data) {\n jd.jm_event_handle.call(jd, type, data);\n });\n});\n\njsMind.register_plugin(draggable_plugin);\n"],"names":["jsMind","Error","jm","$","clear_selection","w","getSelection","removeAllRanges","d","selection","empty","options","DraggableNode","constructor","this","e_canvas","canvas_ctx","shadow","shadow_w","shadow_h","active_node","target_node","target_direct","client_w","client_h","offset_x","offset_y","hlookup_delay","hlookup_timer","capture","moved","canvas_draggable","get_view_draggable","init","_create_canvas","_create_shadow","_event_bind","resize","view","e_nodes","appendChild","width","size","height","h","c","e_panel","ctx","getContext","s","style","visibility","zIndex","cursor","opacity","reset_shadow","el","innerHTML","left","top","backgroundImage","backgroundSize","transform","clientWidth","clientHeight","show_shadow","hide_shadow","_magnet_shadow","node","lineWidth","strokeStyle","lineCap","_clear_lines","_canvas_lineto","sp","x","y","np","clearRect","x1","y1","x2","y2","beginPath","moveTo","lineTo","stroke","_lookup_close_node","ns","nl","root","get_root","root_location","get_location","root_size","get_size","root_x","sw","sh","sx","offsetLeft","sy","offsetTop","direct","direction","right","nodes","mind","layout","min_distance","Number","MAX_VALUE","distance","closest_node","closest_p","shadow_p","nodeid","isroot","id","is_visible","Math","abs","result_node","lookup_close_node","node_data","jd","container","on","e","evt","event","dragstart","call","drag","dragend","get_editable","view_draggable","jview","target","srcElement","tagName","toLowerCase","disable_view_draggable","get_binded_nodeid","get_node","clientX","touches","actualZoom","clientY","client_hw","floor","client_hh","clearTimeout","clearInterval","setTimeout","setInterval","preventDefault","px","py","enable_view_draggable","src_node","move_node","inherited","sibling_nodes","children","sc","length","delta_y","node_before","beforeid","dy","jm_event_handle","type","data","event_type","draggable_plugin","plugin","add_event_listener","register_plugin"],"mappings":";;;;;;;yBAQA,IAAKA,OACD,MAAM,IAAIC,MAAM,yBAGpB,MAAMC,EAAKF,OACLG,EAAID,EAAGC,EAEPC,EAC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