jsmind 0.6.3 → 0.6.5-preview
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 +7 -5
- package/docs/en/1.usage.md +11 -4
- package/docs/en/2.options.md +6 -2
- package/docs/en/5.development.md +1 -1
- package/docs/zh/1.usage.md +12 -4
- package/docs/zh/2.options.md +8 -2
- package/es6/README-en.md +37 -0
- package/es6/README.md +14 -15
- package/es6/jsmind.draggable-node.js +1 -1
- 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.draggable-node.js +1 -1
- package/js/jsmind.js +1 -1
- package/js/jsmind.screenshot.js +1 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ jsMind is mind map library built by javascript, it base on html5 canvas and svg.
|
|
|
16
16
|
|
|
17
17
|
ES6 版本现已发布,详情请查阅 [es6/README.md](es6/README.md)
|
|
18
18
|
|
|
19
|
-
The ES6 version of jsMind has been launched. see details from [es6/README.md](es6/README.md)
|
|
19
|
+
The ES6 version of jsMind has been launched. see details from [es6/README-en.md](es6/README-en.md)
|
|
20
20
|
|
|
21
21
|
## Get Started
|
|
22
22
|
|
|
@@ -26,15 +26,15 @@ The ES6 version of jsMind has been launched. see details from [es6/README.md](es
|
|
|
26
26
|
<link
|
|
27
27
|
type="text/css"
|
|
28
28
|
rel="stylesheet"
|
|
29
|
-
href="//cdn.jsdelivr.net/npm/jsmind@0.6/style/jsmind.css"
|
|
29
|
+
href="//cdn.jsdelivr.net/npm/jsmind@0.6.4/style/jsmind.css"
|
|
30
30
|
/>
|
|
31
31
|
<script
|
|
32
32
|
type="text/javascript"
|
|
33
|
-
src="//cdn.jsdelivr.net/npm/jsmind@0.6/es6/jsmind.js"
|
|
33
|
+
src="//cdn.jsdelivr.net/npm/jsmind@0.6.4/es6/jsmind.js"
|
|
34
34
|
></script>
|
|
35
35
|
<!--
|
|
36
36
|
enable draggable node feature
|
|
37
|
-
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind@0.6/es6/jsmind.draggable-node.js"></script>
|
|
37
|
+
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind@0.6.4/es6/jsmind.draggable-node.js"></script>
|
|
38
38
|
-->
|
|
39
39
|
</head>
|
|
40
40
|
<body>
|
|
@@ -57,11 +57,13 @@ The ES6 version of jsMind has been launched. see details from [es6/README.md](es
|
|
|
57
57
|
</html>
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
> 查阅[文档](docs/zh/1.usage.md)以获取更多关于 CDN 以及版本的知识。 Read the [doc](docs/en/1.usage.md) to learn more knowledge about CDN and version.
|
|
61
|
+
|
|
60
62
|
## Links
|
|
61
63
|
|
|
62
64
|
- Resources:
|
|
63
65
|
- [NPM - jsmind](https://www.npmjs.com/package/jsmind)
|
|
64
|
-
- CDN - [UNPKG](https://unpkg.com/browse/jsmind/), [jsDelivr](https://www.jsdelivr.com/package/npm/jsmind)
|
|
66
|
+
- CDN - [UNPKG](https://unpkg.com/browse/jsmind/), [jsDelivr](https://www.jsdelivr.com/package/npm/jsmind/), [jsDelivr 的国内镜像](https://jsd.onmicrosoft.cn/npm/jsmind/)
|
|
65
67
|
- [文档 - Documents](https://hizzgdev.github.io/jsmind/docs)
|
|
66
68
|
- Apps :
|
|
67
69
|
- <https://jsmind.online>
|
package/docs/en/1.usage.md
CHANGED
|
@@ -12,15 +12,22 @@
|
|
|
12
12
|
At first, 2 files (jsmind.css and jsmind.js) are required. Here we link to the resources on the CDN. It is recommended to use the latest version.
|
|
13
13
|
|
|
14
14
|
```html
|
|
15
|
-
<link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.6.4/style/jsmind.css" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" src="https://unpkg.com/jsmind@0.6.4/es6/jsmind.js"></script>
|
|
16
18
|
|
|
17
|
-
<script type="text/javascript" src="https://unpkg.com/jsmind@0.5/es6/jsmind.js"></script>
|
|
18
19
|
```
|
|
20
|
+
> CDN: other available CDNs are [jsDelivr](https://www.jsdelivr.com/package/npm/jsmind/), and [the mirror of jsDelivr in China](https://jsd.onmicrosoft.cn/npm/jsmind/). the resource urls would look like:
|
|
21
|
+
> - https://unpkg.com/jsmind@0.6.4/es6/jsmind.js
|
|
22
|
+
> - https://cdn.jsdelivr.net/npm/jsmind@0.6.4/es6/jsmind.js
|
|
23
|
+
> - https://jsd.onmicrosoft.cn/npm/jsmind@0.6.4/es6/jsmind.js
|
|
24
|
+
|
|
25
|
+
> Version: the version number appear in the url of CDN. It's strongly recommended that you also specify the version number in your project to avoid the risks that caused by version upgrades. Access the [Release page](https://github.com/hizzgdev/jsmind/releases) to get the latest version number of jsMind.
|
|
19
26
|
|
|
20
27
|
Add script jsmind.draggable-node.js for enabling draggable node feature.
|
|
21
28
|
|
|
22
29
|
```html
|
|
23
|
-
<script type="text/javascript" src="https://unpkg.com/jsmind@0.
|
|
30
|
+
<script type="text/javascript" src="https://unpkg.com/jsmind@0.6.4/es6/jsmind.draggable-node.js"></script>
|
|
24
31
|
```
|
|
25
32
|
|
|
26
33
|
The second, a div element should be in your HTML as container
|
|
@@ -192,7 +199,7 @@ In addition to the Themes, there are some styles can be set at node level:
|
|
|
192
199
|
* font-style: font style of the topic of a node, e.g.`italic`
|
|
193
200
|
* background-image: background image url e.g. `http://fakeurl.com/fake-picture.png`, or a data url, e.g. `data:image/png;base64,...`
|
|
194
201
|
* background-rotation: the rotation of the background image, e.g. `30`
|
|
195
|
-
* leading-line-color: the color of the leading line of a node, e.g. `#1abc9c`, `blue`
|
|
202
|
+
* leading-line-color: the color of the leading line of a node, e.g. `#1abc9c`, `blue`
|
|
196
203
|
|
|
197
204
|
How to set:
|
|
198
205
|
|
package/docs/en/2.options.md
CHANGED
|
@@ -36,6 +36,7 @@ options = {
|
|
|
36
36
|
vmargin:50, // Minimum vertical distance of the mindmap from the outer frame of the container
|
|
37
37
|
line_width:2, // thickness of the mindmap line
|
|
38
38
|
line_color:'#555', // Thought mindmap line color
|
|
39
|
+
line_style:'curved', // line style, straight or curved
|
|
39
40
|
draggable: false, // Drag the mind map with your mouse, when it's larger that the container
|
|
40
41
|
hide_scrollbars_when_draggable: false, // Hide container scrollbars, when mind map is larger than container and draggable option is true.
|
|
41
42
|
node_overflow: 'hidden' // Text overflow style in node
|
|
@@ -124,9 +125,12 @@ These options are described in more detail below.
|
|
|
124
125
|
> These two parameters determine how close the mindmap can be to the border of the container. These two parameters are similar to the margin(css) property of the object if you consider the thought map itself as an object. The default value of them are the width and height of the container.
|
|
125
126
|
|
|
126
127
|
**view.line_width** : (number) Thickness of the mindmap line (pixels)
|
|
127
|
-
**view.line_color** : (string) color of the mindmap line (color representation in HTML).
|
|
128
|
+
**view.line_color** : (string) color of the mindmap line (color representation in HTML). If `data.leading-line-color` is set on `node`, this option will be overridden.
|
|
129
|
+
> By default, the lines are 2px in thickness and dark gray in color (#555).
|
|
128
130
|
|
|
129
|
-
|
|
131
|
+
**view.line_style** : (string) style of the mindmap line. The available options are:
|
|
132
|
+
> * `curved` [default]
|
|
133
|
+
> * `straight`
|
|
130
134
|
|
|
131
135
|
**view.draggable** : (bool) Do you want whole mind map draggable inside container?
|
|
132
136
|
|
package/docs/en/5.development.md
CHANGED
|
@@ -33,7 +33,7 @@ The basic process of contributing code to jsMind is:
|
|
|
33
33
|
5.3. development
|
|
34
34
|
===
|
|
35
35
|
|
|
36
|
-
jsMind is written
|
|
36
|
+
jsMind is written in ES6 format, source code is in `/src`. Generally, only the code in it needs to be modified.
|
|
37
37
|
|
|
38
38
|
Please remember to format the code at any time during the development process. Execute the following code on the command line to format the code:
|
|
39
39
|
|
package/docs/zh/1.usage.md
CHANGED
|
@@ -11,16 +11,24 @@
|
|
|
11
11
|
|
|
12
12
|
首先,需要在页面上引用 jsmind.js 和 jsmind.css 两个文件,这里我们引用的是 CDN 上的资源,请注意使用最新的版本。
|
|
13
13
|
|
|
14
|
+
|
|
14
15
|
```html
|
|
15
|
-
<link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.
|
|
16
|
+
<link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.6.4/style/jsmind.css" />
|
|
16
17
|
|
|
17
|
-
<script type="text/javascript" src="https://unpkg.com/jsmind@0.
|
|
18
|
+
<script type="text/javascript" src="https://unpkg.com/jsmind@0.6.4/es6/jsmind.js"></script>
|
|
18
19
|
```
|
|
19
20
|
|
|
21
|
+
> CDN:其它可用的 CDN 还有 [jsDelivr](https://www.jsdelivr.com/package/npm/jsmind/),以及 jsDelivr 的[国内镜像](https://jsd.onmicrosoft.cn/npm/jsmind/)。文件路径大概像这样:
|
|
22
|
+
> - https://unpkg.com/jsmind@0.6.4/es6/jsmind.js
|
|
23
|
+
> - https://cdn.jsdelivr.net/npm/jsmind@0.6.4/es6/jsmind.js
|
|
24
|
+
> - https://jsd.onmicrosoft.cn/npm/jsmind@0.6.4/es6/jsmind.js
|
|
25
|
+
|
|
26
|
+
> 版本:上面的示例url中都有版本号,强烈建议你在项目里也指明版本号,以避免版本升级给你的项目带来风险。访问 [Release 页面](https://github.com/hizzgdev/jsmind/releases) 可以获取 jsmind 的最新版本号。
|
|
27
|
+
|
|
20
28
|
如果希望能够通过鼠标拖拽的方式移动节点,需要额外引用 jsmind.draggable-node.js 文件
|
|
21
29
|
|
|
22
30
|
```html
|
|
23
|
-
<script type="text/javascript" src="https://unpkg.com/jsmind@0.
|
|
31
|
+
<script type="text/javascript" src="https://unpkg.com/jsmind@0.6.4/es6/jsmind.draggable-node.js"></script>
|
|
24
32
|
```
|
|
25
33
|
|
|
26
34
|
其次,要为 jsMind 准备一个容器,jsMind 将在这个容器里显示思维导图。可自行定义容器的id、大小及样式。
|
|
@@ -221,7 +229,7 @@ jmnodes.theme-greensea jmexpander:hover{} /* 鼠
|
|
|
221
229
|
* font-style: 节点的文本样式,如 `italic`
|
|
222
230
|
* background-image: 节点的背景图片,可使用 url,如 `http://fakeurl.com/fake-picture.png`,或 data url 形式,如 `data:image/png;base64,...`
|
|
223
231
|
* background-rotation: 节点的背景图片旋转角度,如 `30`
|
|
224
|
-
* leading-line-color: 节点的引导线颜色,如 `#1abc9c`, `blue
|
|
232
|
+
* leading-line-color: 节点的引导线颜色,如 `#1abc9c`, `blue`。
|
|
225
233
|
|
|
226
234
|
设置方法:
|
|
227
235
|
|
package/docs/zh/2.options.md
CHANGED
|
@@ -36,6 +36,7 @@ options = {
|
|
|
36
36
|
vmargin:50, // 思维导图距容器外框的最小垂直距离
|
|
37
37
|
line_width:2, // 思维导图线条的粗细
|
|
38
38
|
line_color:'#555', // 思维导图线条的颜色
|
|
39
|
+
line_style:'curved',// 思维导图线条的样式,直线(straight)或者曲线(curved)
|
|
39
40
|
draggable: false, // 当容器不能完全容纳思维导图时,是否允许拖动画布代替鼠标滚动
|
|
40
41
|
hide_scrollbars_when_draggable: false, // 当设置 draggable = true 时,是否隐藏滚动条
|
|
41
42
|
node_overflow: 'hidden' // 节点文本过长时的样式
|
|
@@ -122,9 +123,14 @@ options = {
|
|
|
122
123
|
> 这两个参数决定了思维导图与容器的边框能距离多近。把思维导图本身作为一个对象的话,这两个参数就类似该对象的 margin(css) 属性。这两个参数的默认值为 container 的宽和高。
|
|
123
124
|
|
|
124
125
|
**view.line_width** : (number) 思维导图线条的粗细(像素)
|
|
125
|
-
**view.line_color** : (string) 思维导图线条的颜色(html
|
|
126
|
+
**view.line_color** : (string) 思维导图线条的颜色(html的颜色表示方法)。如果一个 `node` 设置了 `data.leading-line-color`,此选项将会被覆盖
|
|
126
127
|
|
|
127
|
-
>
|
|
128
|
+
> 默认情况下,线条的粗细是2px,颜色是深灰色(#555)。
|
|
129
|
+
|
|
130
|
+
**view.line_style** : (string) 思维导图线条的样式。可用的选项有:
|
|
131
|
+
|
|
132
|
+
> * `curved` 表示曲线 [默认值]
|
|
133
|
+
> * `straight` 表示直线
|
|
128
134
|
|
|
129
135
|
**view.draggable** : (bool) 当容器不能完全容纳思维导图时,是否允许拖动画布代替鼠标滚动
|
|
130
136
|
|
package/es6/README-en.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# jsMind ES6 Version
|
|
2
|
+
|
|
3
|
+
[[中文](README.md)] | [English]
|
|
4
|
+
|
|
5
|
+
jsMind is now written in ES6 code, the source code is in `/src`, and the dist directory is `/es6`.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Compatibility
|
|
9
|
+
|
|
10
|
+
All features in the JS version are fully compatible in the ES6 version.
|
|
11
|
+
|
|
12
|
+
### Migration
|
|
13
|
+
|
|
14
|
+
If you use `jsMind` via `NPM`, no migration is required, we just changed the `main` file to `es6/jsmind.js`
|
|
15
|
+
|
|
16
|
+
If you reference `jsMind` from CDN, the only thing you need to do is change the url from `js/*.js` to `es6/*.js`.
|
|
17
|
+
|
|
18
|
+
E.g.
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<!-- before -->
|
|
22
|
+
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind/js/jsmind.js"></script>
|
|
23
|
+
|
|
24
|
+
<!-- after -->
|
|
25
|
+
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind/es6/jsmind.js"></script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Deprecation
|
|
29
|
+
|
|
30
|
+
The legacy version `/js` will be kept in repo for several months, and then will be moved into another dir in a version with a break change alert.
|
|
31
|
+
|
|
32
|
+
### Local build
|
|
33
|
+
|
|
34
|
+
You probably notice that there is no `js` files or `es6` files in the directory `/es6`. Yes, we publish the dist file to `NPM` but don't store them in the repo.
|
|
35
|
+
|
|
36
|
+
You can download the resources from CDN, or build them locally by running `npm run build` in the root dir of the project. Read [development doc](../docs/en/5.development.md) to get the detail about code building.
|
|
37
|
+
|
package/es6/README.md
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
# jsMind ES6 Version
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[中文] | [[English](README-en.md)]
|
|
4
4
|
|
|
5
|
+
jsMind 使用 ES6 编写,源代码位于 `/src`,构建目录为 `/es6`。
|
|
5
6
|
|
|
6
|
-
### Compatible
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
### 兼容性
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
之前 JS 版本里的所有功能,在 ES6 的版本中都是兼容的。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
### 迁移到新版
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
如果你是通过 `NPM` 引用的 `jsMind`,则无须手动迁移,我们只是在 `project.json` 里将 `main` 修改成了 `es6/jsmind.js` 。
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
如果你是通过 CDN 引用 `jsMind` 的话,你仅仅需要把 url 从 `js/*.js` 改成 `es6/*.js` 。 如:
|
|
17
17
|
|
|
18
18
|
```html
|
|
19
|
-
<!--
|
|
19
|
+
<!-- 修改前 -->
|
|
20
20
|
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind/js/jsmind.js"></script>
|
|
21
21
|
|
|
22
|
-
<!--
|
|
22
|
+
<!-- 修改后 -->
|
|
23
23
|
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind/es6/jsmind.js"></script>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### 老版本下线
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
之前的版本仍将会保留在 `/js` 目录里,我们将会在几个月后发布的新的版本里把这些文件移动到其它目录,并添加上不兼容性警告。
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### 本地构建
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
If you can not refer the resource from CDN, the dist files can be built by running `npm run build` in the root dir of the project. see details for [development](../docs/en/5.development.md)
|
|
32
|
+
你可能注意到了,在 `es6` 这个目录里没有任何 `js` 或 `es` 文件。是的,构建的文件仅会被包含在 `NPM` 里,但并不会保留在代码库中。
|
|
35
33
|
|
|
34
|
+
你可以从 CDN 上下载这些文件,也可以在你本地构建,只需在项目根目录里运行 `npm run build` 即可。更详细的介绍可参考[贡献代码指南](../docs/en/5.development.md)里的相关内容。
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Project Home:
|
|
6
6
|
* https://github.com/hizzgdev/jsmind/
|
|
7
7
|
*/
|
|
8
|
-
!function(){"use strict";if(!
|
|
8
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jsmind")):"function"==typeof define&&define.amd?define(["jsmind"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jsMind)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=e(t);if(!i.default)throw new Error("jsMind is not defined");const s=i.default.$,o="getSelection"in s.w?function(){s.w.getSelection().removeAllRanges()}:function(){s.d.selection.empty()},n={line_width:5,line_color:"rgba(0,0,0,0.3)",lookup_delay:500,lookup_interval:80,scrolling_trigger_width:20,scrolling_step_length:10};class l{constructor(t,e){var s={};i.default.util.json.merge(s,n),i.default.util.json.merge(s,e),this.version="0.3.0",this.jm=t,this.options=s,this.e_canvas=null,this.canvas_ctx=null,this.shadow=null,this.shadow_w=0,this.shadow_h=0,this.active_node=null,this.target_node=null,this.target_direct=null,this.client_w=0,this.client_h=0,this.offset_x=0,this.offset_y=0,this.hlookup_delay=0,this.hlookup_timer=0,this.capture=!1,this.moved=!1,this.canvas_draggable=t.get_view_draggable(),this.view_panel=t.view.e_panel,this.view_panel_rect=null}init(){this._create_canvas(),this._create_shadow(),this._event_bind()}resize(){this.jm.view.e_nodes.appendChild(this.shadow),this.e_canvas.width=this.jm.view.size.w,this.e_canvas.height=this.jm.view.size.h}_create_canvas(){var t=s.c("canvas");this.jm.view.e_panel.appendChild(t);var e=t.getContext("2d");this.e_canvas=t,this.canvas_ctx=e}_create_shadow(){var t=s.c("jmnode");t.style.visibility="hidden",t.style.zIndex="3",t.style.cursor="move",t.style.opacity="0.7",this.shadow=t}reset_shadow(t){var e=this.shadow.style;this.shadow.innerHTML=t.innerHTML,e.left=t.style.left,e.top=t.style.top,e.width=t.style.width,e.height=t.style.height,e.backgroundImage=t.style.backgroundImage,e.backgroundSize=t.style.backgroundSize,e.transform=t.style.transform,this.shadow_w=this.shadow.clientWidth,this.shadow_h=this.shadow.clientHeight}show_shadow(){this.moved||(this.shadow.style.visibility="visible")}hide_shadow(){this.shadow.style.visibility="hidden"}_magnet_shadow(t){t&&(this.canvas_ctx.lineWidth=this.options.line_width,this.canvas_ctx.strokeStyle=this.options.line_color,this.canvas_ctx.lineCap="round",this._clear_lines(),this._canvas_lineto(t.sp.x,t.sp.y,t.np.x,t.np.y))}_clear_lines(){this.canvas_ctx.clearRect(0,0,this.jm.view.size.w,this.jm.view.size.h)}_canvas_lineto(t,e,i,s){this.canvas_ctx.beginPath(),this.canvas_ctx.moveTo(t,e),this.canvas_ctx.lineTo(i,s),this.canvas_ctx.stroke()}_lookup_close_node(){var t,e,s=this.jm.get_root(),o=s.get_location(),n=s.get_size(),l=o.x+n.w/2,h=this.shadow_w,a=this.shadow_h,_=this.shadow.offsetLeft,r=this.shadow.offsetTop,c=_+h/2>=l?i.default.direction.right:i.default.direction.left,d=this.jm.mind.nodes,v=null,u=this.jm.layout,g=Number.MAX_VALUE,p=0,w=null,f=null,m=null;for(var y in d){var b,j;if((v=d[y]).isroot||v.direction==c){if(v.id==this.active_node.id)continue;if(!u.is_visible(v))continue;if(t=v.get_size(),e=v.get_location(),c==i.default.direction.right){if(_-e.x-t.w<=0)continue;p=Math.abs(_-e.x-t.w)+Math.abs(r+a/2-e.y-t.h/2),b={x:e.x+t.w-this.options.line_width,y:e.y+t.h/2},j={x:_+this.options.line_width,y:r+a/2}}else{if(e.x-_-h<=0)continue;p=Math.abs(_+h-e.x)+Math.abs(r+a/2-e.y-t.h/2),b={x:e.x+this.options.line_width,y:e.y+t.h/2},j={x:_+h-this.options.line_width,y:r+a/2}}p<g&&(w=v,f=b,m=j,g=p)}}var x=null;return w&&(x={node:w,direction:c,sp:m,np:f}),x}lookup_close_node(){var t=this._lookup_close_node();t&&(this._magnet_shadow(t),this.target_node=t.node,this.target_direct=t.direction)}_event_bind(){var t=this,e=this.jm.view.container;s.on(e,"mousedown",(function(e){var i=e||event;t.dragstart.call(t,i)})),s.on(e,"mousemove",(function(e){var i=e||event;t.drag.call(t,i)})),s.on(e,"mouseup",(function(e){var i=e||event;t.dragend.call(t,i)})),s.on(e,"touchstart",(function(e){var i=e||event;t.dragstart.call(t,i)})),s.on(e,"touchmove",(function(e){var i=e||event;t.drag.call(t,i)})),s.on(e,"touchend",(function(e){var i=e||event;t.dragend.call(t,i)}))}dragstart(t){if(this.jm.get_editable()&&!this.capture){this.active_node=null,this.view_draggable=this.jm.get_view_draggable();var e=this.jm.view,i=t.target||event.srcElement;if("jmnode"==i.tagName.toLowerCase()){this.view_draggable&&this.jm.disable_view_draggable();var o=e.get_binded_nodeid(i);if(o){var n=this.jm.get_node(o);if(!n.isroot){this.reset_shadow(i),this.view_panel_rect=this.view_panel.getBoundingClientRect(),this.active_node=n,this.offset_x=(t.clientX||t.touches[0].clientX)/e.zoom_current-i.offsetLeft,this.offset_y=(t.clientY||t.touches[0].clientY)/e.zoom_current-i.offsetTop,this.client_hw=Math.floor(i.clientWidth/2),this.client_hh=Math.floor(i.clientHeight/2),0!=this.hlookup_delay&&s.w.clearTimeout(this.hlookup_delay),0!=this.hlookup_timer&&s.w.clearInterval(this.hlookup_timer);var l=this;this.hlookup_delay=s.w.setTimeout((function(){l.hlookup_delay=0,l.hlookup_timer=s.w.setInterval((function(){l.lookup_close_node.call(l)}),l.options.lookup_interval)}),this.options.lookup_delay),this.capture=!0}}}}}drag(t){if(this.jm.get_editable()&&this.capture){t.preventDefault(),this.show_shadow(),this.moved=!0,o();var e=this.jm.view,i=(t.clientX||t.touches[0].clientX)/e.zoom_current-this.offset_x,s=(t.clientY||t.touches[0].clientY)/e.zoom_current-this.offset_y;t.clientY-this.view_panel_rect.top<this.options.scrolling_trigger_width&&this.view_panel.scrollTop>this.options.scrolling_step_length?(this.view_panel.scrollBy(0,-this.options.scrolling_step_length),this.offset_y+=this.options.scrolling_step_length/e.zoom_current):this.view_panel_rect.bottom-t.clientY<this.options.scrolling_trigger_width&&this.view_panel.scrollTop<this.view_panel.scrollHeight-this.view_panel_rect.height-this.options.scrolling_step_length&&(this.view_panel.scrollBy(0,this.options.scrolling_step_length),this.offset_y-=this.options.scrolling_step_length/e.zoom_current),t.clientX-this.view_panel_rect.left<this.options.scrolling_trigger_width&&this.view_panel.scrollLeft>this.options.scrolling_step_length?(this.view_panel.scrollBy(-this.options.scrolling_step_length,0),this.offset_x+=this.options.scrolling_step_length/e.zoom_current):this.view_panel_rect.right-t.clientX<this.options.scrolling_trigger_width&&this.view_panel.scrollLeft<this.view_panel.scrollWidth-this.view_panel_rect.width-this.options.scrolling_step_length&&(this.view_panel.scrollBy(this.options.scrolling_step_length,0),this.offset_x-=this.options.scrolling_step_length/e.zoom_current),this.shadow.style.left=i+"px",this.shadow.style.top=s+"px",o()}}dragend(t){if(this.jm.get_editable()){if(this.view_draggable&&this.jm.enable_view_draggable(),this.capture){if(0!=this.hlookup_delay&&(s.w.clearTimeout(this.hlookup_delay),this.hlookup_delay=0,this._clear_lines()),0!=this.hlookup_timer&&(s.w.clearInterval(this.hlookup_timer),this.hlookup_timer=0,this._clear_lines()),this.moved){var e=this.active_node,i=this.target_node,o=this.target_direct;this.move_node(e,i,o)}this.hide_shadow()}this.view_panel_rect=null,this.moved=!1,this.capture=!1}}move_node(t,e,s){var o=this.shadow.offsetTop;if(e&&t&&!i.default.node.inherited(t,e)){for(var n=e.children,l=n.length,h=null,a=Number.MAX_VALUE,_=null,r="_last_";l--;)if((h=n[l]).direction==s&&h.id!=t.id){var c=h.get_location().y-o;c>0&&c<a&&(a=c,_=h,r="_first_")}_&&(r=_.id),this.jm.move_node(t.id,r,e.id,s)}this.active_node=null,this.target_node=null,this.target_direct=null}jm_event_handle(t,e){t===i.default.event_type.resize&&this.resize()}}var h=new i.default.plugin("draggable_node",(function(t,e){var i=new l(t,e);i.init(),t.add_event_listener((function(t,e){i.jm_event_handle.call(i,t,e)}))}));i.default.register_plugin(h)}));
|
|
9
9
|
//# sourceMappingURL=jsmind.draggable-node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsmind.draggable-node.js","sources":["../src/plugins/jsmind.draggable-node.js"],"sourcesContent":["/**\n * @license BSD\n * @copyright 2014-2023 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 $ = jsMind.$;\n\nconst clear_selection =\n 'getSelection' in $.w\n ? function () {\n $.w.getSelection().removeAllRanges();\n }\n : function () {\n $.d.selection.empty();\n };\n\nconst DEFAULT_OPTIONS = {\n line_width: 5,\n line_color: 'rgba(0,0,0,0.3)',\n lookup_delay: 500,\n lookup_interval: 80,\n scrolling_trigger_width: 20,\n scrolling_step_length: 10,\n};\n\nclass DraggableNode {\n constructor(jm, options) {\n var opts = {};\n jsMind.util.json.merge(opts, DEFAULT_OPTIONS);\n jsMind.util.json.merge(opts, options);\n\n this.jm = jm;\n this.options = opts;\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 = jm.get_view_draggable();\n this.view_panel = jm.view.e_panel;\n this.view_panel_rect = null;\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 = this.options.line_width;\n this.canvas_ctx.strokeStyle = this.options.line_color;\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 - this.options.line_width, y: nl.y + ns.h / 2 };\n sp = { x: sx + this.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 + this.options.line_width, y: nl.y + ns.h / 2 };\n sp = { x: sx + sw - this.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.view_panel_rect = this.view_panel.getBoundingClientRect();\n this.active_node = node;\n this.offset_x =\n (e.clientX || e.touches[0].clientX) / jview.zoom_current - el.offsetLeft;\n this.offset_y =\n (e.clientY || e.touches[0].clientY) / jview.zoom_current - 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 }, jd.options.lookup_interval);\n }, this.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.zoom_current - this.offset_x;\n var py = (e.clientY || e.touches[0].clientY) / jview.zoom_current - this.offset_y;\n // scrolling container axisY if drag nodes exceeding container\n if (\n e.clientY - this.view_panel_rect.top < this.options.scrolling_trigger_width &&\n this.view_panel.scrollTop > this.options.scrolling_step_length\n ) {\n this.view_panel.scrollBy(0, -this.options.scrolling_step_length);\n this.offset_y += this.options.scrolling_step_length / jview.zoom_current;\n } else if (\n this.view_panel_rect.bottom - e.clientY < this.options.scrolling_trigger_width &&\n this.view_panel.scrollTop <\n this.view_panel.scrollHeight -\n this.view_panel_rect.height -\n this.options.scrolling_step_length\n ) {\n this.view_panel.scrollBy(0, this.options.scrolling_step_length);\n this.offset_y -= this.options.scrolling_step_length / jview.zoom_current;\n }\n // scrolling container axisX if drag nodes exceeding container\n if (\n e.clientX - this.view_panel_rect.left < this.options.scrolling_trigger_width &&\n this.view_panel.scrollLeft > this.options.scrolling_step_length\n ) {\n this.view_panel.scrollBy(-this.options.scrolling_step_length, 0);\n this.offset_x += this.options.scrolling_step_length / jview.zoom_current;\n } else if (\n this.view_panel_rect.right - e.clientX < this.options.scrolling_trigger_width &&\n this.view_panel.scrollLeft <\n this.view_panel.scrollWidth -\n this.view_panel_rect.width -\n this.options.scrolling_step_length\n ) {\n this.view_panel.scrollBy(this.options.scrolling_step_length, 0);\n this.offset_x -= this.options.scrolling_step_length / jview.zoom_current;\n }\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.view_panel_rect = null;\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 jsMind.plugin('draggable_node', function (jm, options) {\n var jd = new DraggableNode(jm, options);\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","$","clear_selection","w","getSelection","removeAllRanges","d","selection","empty","DEFAULT_OPTIONS","line_width","line_color","lookup_delay","lookup_interval","scrolling_trigger_width","scrolling_step_length","DraggableNode","constructor","jm","options","opts","util","json","merge","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","view_panel","view","e_panel","view_panel_rect","init","_create_canvas","_create_shadow","_event_bind","resize","e_nodes","appendChild","width","size","height","h","c","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","getBoundingClientRect","clientX","touches","zoom_current","clientY","client_hw","floor","client_hh","clearTimeout","clearInterval","setTimeout","setInterval","preventDefault","px","py","scrollTop","scrollBy","bottom","scrollHeight","scrollLeft","scrollWidth","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,EAAIF,OAAOE,EAEXC,EACF,iBAAkBD,EAAEE,EACd,WACIF,EAAEE,EAAEC,eAAeC,iBACtB,EACD,WACIJ,EAAEK,EAAEC,UAAUC,OAC5B,EAEMC,EAAkB,CACpBC,WAAY,EACZC,WAAY,kBACZC,aAAc,IACdC,gBAAiB,GACjBC,wBAAyB,GACzBC,sBAAuB,IAG3B,MAAMC,EACFC,YAAYC,EAAIC,GACZ,IAAIC,EAAO,CAAA,EACXrB,OAAOsB,KAAKC,KAAKC,MAAMH,EAAMX,GAC7BV,OAAOsB,KAAKC,KAAKC,MAAMH,EAAMD,GAE7BK,KAAKN,GAAKA,EACVM,KAAKL,QAAUC,EACfI,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,KAA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AgBC,EAAMC,GACdD,IAAShM,OAAOkM,WAAW9I,QAC3B3B,KAAK2B,QAEZ,EAGL,IAAI+I,EAAmB,IAAInM,OAAOoM,OAAO,kBAAkB,SAAUjL,EAAIC,GACrE,IAAIsH,EAAK,IAAIzH,EAAcE,EAAIC,GAC/BsH,EAAG1F,OACH7B,EAAGkL,oBAAmB,SAAUL,EAAMC,GAClCvD,EAAGqD,gBAAgB9C,KAAKP,EAAIsD,EAAMC,EAC1C,GACA,IAEAjM,OAAOsM,gBAAgBH"}
|
|
1
|
+
{"version":3,"file":"jsmind.draggable-node.js","sources":["../src/plugins/jsmind.draggable-node.js"],"sourcesContent":["/**\n * @license BSD\n * @copyright 2014-2023 hizzgdev@163.com\n *\n * Project Home:\n * https://github.com/hizzgdev/jsmind/\n */\n\nimport jsMind from 'jsmind';\n\nif (!jsMind) {\n throw new Error('jsMind is not defined');\n}\n\nconst $ = jsMind.$;\n\nconst clear_selection =\n 'getSelection' in $.w\n ? function () {\n $.w.getSelection().removeAllRanges();\n }\n : function () {\n $.d.selection.empty();\n };\n\nconst DEFAULT_OPTIONS = {\n line_width: 5,\n line_color: 'rgba(0,0,0,0.3)',\n lookup_delay: 500,\n lookup_interval: 80,\n scrolling_trigger_width: 20,\n scrolling_step_length: 10,\n};\n\nclass DraggableNode {\n constructor(jm, options) {\n var opts = {};\n jsMind.util.json.merge(opts, DEFAULT_OPTIONS);\n jsMind.util.json.merge(opts, options);\n\n this.version = '0.3.0';\n this.jm = jm;\n this.options = opts;\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 = jm.get_view_draggable();\n this.view_panel = jm.view.e_panel;\n this.view_panel_rect = null;\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 = this.options.line_width;\n this.canvas_ctx.strokeStyle = this.options.line_color;\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 - this.options.line_width, y: nl.y + ns.h / 2 };\n sp = { x: sx + this.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 + this.options.line_width, y: nl.y + ns.h / 2 };\n sp = { x: sx + sw - this.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.view_panel_rect = this.view_panel.getBoundingClientRect();\n this.active_node = node;\n this.offset_x =\n (e.clientX || e.touches[0].clientX) / jview.zoom_current - el.offsetLeft;\n this.offset_y =\n (e.clientY || e.touches[0].clientY) / jview.zoom_current - 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 }, jd.options.lookup_interval);\n }, this.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.zoom_current - this.offset_x;\n var py = (e.clientY || e.touches[0].clientY) / jview.zoom_current - this.offset_y;\n // scrolling container axisY if drag nodes exceeding container\n if (\n e.clientY - this.view_panel_rect.top < this.options.scrolling_trigger_width &&\n this.view_panel.scrollTop > this.options.scrolling_step_length\n ) {\n this.view_panel.scrollBy(0, -this.options.scrolling_step_length);\n this.offset_y += this.options.scrolling_step_length / jview.zoom_current;\n } else if (\n this.view_panel_rect.bottom - e.clientY < this.options.scrolling_trigger_width &&\n this.view_panel.scrollTop <\n this.view_panel.scrollHeight -\n this.view_panel_rect.height -\n this.options.scrolling_step_length\n ) {\n this.view_panel.scrollBy(0, this.options.scrolling_step_length);\n this.offset_y -= this.options.scrolling_step_length / jview.zoom_current;\n }\n // scrolling container axisX if drag nodes exceeding container\n if (\n e.clientX - this.view_panel_rect.left < this.options.scrolling_trigger_width &&\n this.view_panel.scrollLeft > this.options.scrolling_step_length\n ) {\n this.view_panel.scrollBy(-this.options.scrolling_step_length, 0);\n this.offset_x += this.options.scrolling_step_length / jview.zoom_current;\n } else if (\n this.view_panel_rect.right - e.clientX < this.options.scrolling_trigger_width &&\n this.view_panel.scrollLeft <\n this.view_panel.scrollWidth -\n this.view_panel_rect.width -\n this.options.scrolling_step_length\n ) {\n this.view_panel.scrollBy(this.options.scrolling_step_length, 0);\n this.offset_x -= this.options.scrolling_step_length / jview.zoom_current;\n }\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.view_panel_rect = null;\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 jsMind.plugin('draggable_node', function (jm, options) {\n var jd = new DraggableNode(jm, options);\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","$","clear_selection","w","getSelection","removeAllRanges","d","selection","empty","DEFAULT_OPTIONS","line_width","line_color","lookup_delay","lookup_interval","scrolling_trigger_width","scrolling_step_length","DraggableNode","constructor","jm","options","opts","util","json","merge","this","version","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","view_panel","view","e_panel","view_panel_rect","init","_create_canvas","_create_shadow","_event_bind","resize","e_nodes","appendChild","width","size","height","h","c","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","getBoundingClientRect","clientX","touches","zoom_current","clientY","client_hw","floor","client_hh","clearTimeout","clearInterval","setTimeout","setInterval","preventDefault","px","py","scrollTop","scrollBy","bottom","scrollHeight","scrollLeft","scrollWidth","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":";;;;;;;uUAUA,IAAKA,UACD,MAAM,IAAIC,MAAM,yBAGpB,MAAMC,EAAIF,EAAM,QAACE,EAEXC,EACF,iBAAkBD,EAAEE,EACd,WACIF,EAAEE,EAAEC,eAAeC,iBACtB,EACD,WACIJ,EAAEK,EAAEC,UAAUC,OAC5B,EAEMC,EAAkB,CACpBC,WAAY,EACZC,WAAY,kBACZC,aAAc,IACdC,gBAAiB,GACjBC,wBAAyB,GACzBC,sBAAuB,IAG3B,MAAMC,EACFC,YAAYC,EAAIC,GACZ,IAAIC,EAAO,CAAA,EACXrB,EAAM,QAACsB,KAAKC,KAAKC,MAAMH,EAAMX,GAC7BV,EAAM,QAACsB,KAAKC,KAAKC,MAAMH,EAAMD,GAE7BK,KAAKC,QAAU,QACfD,KAAKN,GAAKA,EACVM,KAAKL,QAAUC,EACfI,KAAKE,SAAW,KAChBF,KAAKG,WAAa,KAClBH,KAAKI,OAAS,KACdJ,KAAKK,SAAW,EAChBL,KAAKM,SAAW,EAChBN,KAAKO,YAAc,K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