mind-elixir 5.6.0 → 5.7.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/dist/MindElixir.iife.js +4 -4
- package/dist/MindElixir.js +1133 -1101
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +643 -628
- package/dist/types/arrow.d.ts +3 -3
- package/dist/types/exampleData/plaintext.d.ts +2 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/interact.d.ts +1 -0
- package/dist/types/methods.d.ts +1 -0
- package/dist/types/types/index.d.ts +8 -1
- package/dist/types/utils/plaintextConverter.d.ts +17 -0
- package/package.json +2 -2
- package/readme.md +12 -1
package/dist/types/arrow.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CustomSvg, Topic } from './types/dom';
|
|
2
|
-
import type
|
|
2
|
+
import { type MindElixirInstance, type Uid } from './index';
|
|
3
3
|
export interface ArrowStyle {
|
|
4
4
|
/**
|
|
5
5
|
* stroke color of the arrow
|
|
@@ -43,14 +43,14 @@ export interface Arrow {
|
|
|
43
43
|
/**
|
|
44
44
|
* offset of control point from start point
|
|
45
45
|
*/
|
|
46
|
-
delta1
|
|
46
|
+
delta1?: {
|
|
47
47
|
x: number;
|
|
48
48
|
y: number;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* offset of control point from end point
|
|
52
52
|
*/
|
|
53
|
-
delta2
|
|
53
|
+
delta2?: {
|
|
54
54
|
x: number;
|
|
55
55
|
y: number;
|
|
56
56
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "- Root Node\n - Child Node 1\n - Child Node 1-1\n - Child Node 1-2\n - Child Node 1-3\n - }:2 Summary of first two nodes\n - Child Node 2\n - Child Node 2-1 [^id1]\n - Child Node 2-2 [^id2]\n - Child Node 2-3 {color: #e87a90}\n - > [^id1] <-Bidirectional Link-> [^id2]\n - Child Node 3\n - Child Node 3-1 [^id3]\n - Child Node 3-2 [^id4]\n - Child Node 3-3 [^id5]\n - > [^id3] >-Unidirectional Link-> [^id4]\n - > [^id3] <-Unidirectional Link-< [^id5]\n - Child Node 4\n - Child Node 4-1 [^id6]\n - Child Node 4-2 [^id7]\n - Child Node 4-3 [^id8]\n - } Summary of all previous nodes\n - Child Node 4-4\n - > [^id1] <-Link position is not restricted, as long as the id can be found during rendering-> [^id8]\n";
|
|
2
|
+
export default _default;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import './markdown.css';
|
|
|
3
3
|
import { LEFT, RIGHT, SIDE, DARK_THEME, THEME } from './const';
|
|
4
4
|
import type { MindElixirData, MindElixirInstance, MindElixirMethods, Options } from './types/index';
|
|
5
5
|
import type { Topic } from './docs';
|
|
6
|
-
declare function MindElixir(this: MindElixirInstance, { el, direction, locale,
|
|
6
|
+
declare function MindElixir(this: MindElixirInstance, { el, direction, locale, editable, contextMenu, toolBar, keypress, mouseSelectionButton, selectionContainer, before, newTopicName, allowUndo, generateMainBranch, generateSubBranch, overflowHidden, theme, alignment, scaleSensitivity, scaleMax, scaleMin, handleWheel, markdown, imageProxy, pasteHandler, }: Options): void;
|
|
7
7
|
declare namespace MindElixir {
|
|
8
8
|
export var prototype: {
|
|
9
9
|
init(this: MindElixirInstance, data: MindElixirData): Error | undefined;
|
|
@@ -45,6 +45,7 @@ declare namespace MindElixir {
|
|
|
45
45
|
selectNodes: (this: MindElixirInstance, tpcs: Topic[]) => void;
|
|
46
46
|
unselectNodes: (this: MindElixirInstance, tpcs: Topic[]) => void;
|
|
47
47
|
clearSelection: (this: MindElixirInstance) => void;
|
|
48
|
+
stringifyData: (data: object) => string;
|
|
48
49
|
getDataString: (this: MindElixirInstance) => string;
|
|
49
50
|
getData: (this: MindElixirInstance) => MindElixirData;
|
|
50
51
|
enableEdit: (this: MindElixirInstance) => void;
|
|
@@ -109,6 +110,7 @@ export interface MindElixirCtor {
|
|
|
109
110
|
}
|
|
110
111
|
declare const _default: MindElixirCtor;
|
|
111
112
|
export default _default;
|
|
113
|
+
export { LEFT, RIGHT, SIDE, THEME, DARK_THEME };
|
|
112
114
|
export type * from './utils/pubsub';
|
|
113
115
|
export type * from './types/index';
|
|
114
116
|
export type * from './types/dom';
|
package/dist/types/interact.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const selectNode: (this: MindElixirInstance, tpc: Topic, isNewNod
|
|
|
6
6
|
export declare const selectNodes: (this: MindElixirInstance, tpcs: Topic[]) => void;
|
|
7
7
|
export declare const unselectNodes: (this: MindElixirInstance, tpcs: Topic[]) => void;
|
|
8
8
|
export declare const clearSelection: (this: MindElixirInstance) => void;
|
|
9
|
+
export declare const stringifyData: (data: object) => string;
|
|
9
10
|
/**
|
|
10
11
|
* @function
|
|
11
12
|
* @instance
|
package/dist/types/methods.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ declare const methods: {
|
|
|
50
50
|
selectNodes: (this: MindElixirInstance, tpcs: import("./docs").Topic[]) => void;
|
|
51
51
|
unselectNodes: (this: MindElixirInstance, tpcs: import("./docs").Topic[]) => void;
|
|
52
52
|
clearSelection: (this: MindElixirInstance) => void;
|
|
53
|
+
stringifyData: (data: object) => string;
|
|
53
54
|
getDataString: (this: MindElixirInstance) => string;
|
|
54
55
|
getData: (this: MindElixirInstance) => MindElixirData;
|
|
55
56
|
enableEdit: (this: MindElixirInstance) => void;
|
|
@@ -82,7 +82,6 @@ export interface MindElixirInstance extends Omit<Required<Options>, 'markdown' |
|
|
|
82
82
|
currentNodes: Topic[];
|
|
83
83
|
currentSummary: SummarySvgGroup | null;
|
|
84
84
|
currentArrow: CustomSvg | null;
|
|
85
|
-
waitCopy: Topic[] | null;
|
|
86
85
|
scaleVal: number;
|
|
87
86
|
tempDirection: 0 | 1 | 2 | null;
|
|
88
87
|
container: HTMLElement;
|
|
@@ -123,6 +122,9 @@ export interface Options {
|
|
|
123
122
|
el: string | HTMLElement;
|
|
124
123
|
direction?: 0 | 1 | 2;
|
|
125
124
|
locale?: Locale;
|
|
125
|
+
/**
|
|
126
|
+
* @deprecated Use `editable` instead
|
|
127
|
+
*/
|
|
126
128
|
draggable?: boolean;
|
|
127
129
|
editable?: boolean;
|
|
128
130
|
contextMenu?: boolean | ContextMenuOption;
|
|
@@ -154,6 +156,11 @@ export interface Options {
|
|
|
154
156
|
* @default undefined
|
|
155
157
|
*/
|
|
156
158
|
imageProxy?: (url: string) => string;
|
|
159
|
+
/**
|
|
160
|
+
* Custom paste handler when there are no nodes copied;
|
|
161
|
+
* @default undefined
|
|
162
|
+
*/
|
|
163
|
+
pasteHandler?: (e: ClipboardEvent) => void;
|
|
157
164
|
}
|
|
158
165
|
export type Uid = string;
|
|
159
166
|
export type Left = 0;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MindElixirData } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert plaintext format to MindElixirData
|
|
4
|
+
*
|
|
5
|
+
* Format:
|
|
6
|
+
* - Root node
|
|
7
|
+
* - Child 1
|
|
8
|
+
* - Child 1-1 [^id1]
|
|
9
|
+
* - Child 1-2 {color: #e87a90}
|
|
10
|
+
* - }:2 Summary of first two nodes
|
|
11
|
+
* - Child 2 [^id2]
|
|
12
|
+
* - > [^id1] <-label-> [^id2]
|
|
13
|
+
*
|
|
14
|
+
* @param plaintext - The plaintext string to convert
|
|
15
|
+
* @returns MindElixirData object
|
|
16
|
+
*/
|
|
17
|
+
export declare function plaintextToMindElixir(plaintext: string): MindElixirData;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mind-elixir",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Mind elixir is a free open source mind map core.",
|
|
6
6
|
"keywords": [
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@eslint/js": "^9.36.0",
|
|
82
82
|
"@microsoft/api-documenter": "^7.26.34",
|
|
83
83
|
"@microsoft/api-extractor": "^7.52.13",
|
|
84
|
-
"@playwright/test": "^1.
|
|
84
|
+
"@playwright/test": "^1.58.0",
|
|
85
85
|
"@rollup/plugin-strip": "^3.0.4",
|
|
86
86
|
"@types/node": "^24.5.2",
|
|
87
87
|
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
package/readme.md
CHANGED
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
<a href="https://bundlephobia.com/result?p=mind-elixir">
|
|
23
23
|
<img src="https://badgen.net/bundlephobia/dependency-count/mind-elixir" alt="dependency-count">
|
|
24
24
|
</a>
|
|
25
|
+
<a href="https://dependents.info/SSShooter/mind-elixir-core">
|
|
26
|
+
<img src="https://dependents.info/SSShooter/mind-elixir-core/badge" alt="dependents count badge" />
|
|
27
|
+
</a>
|
|
25
28
|
<a href="https://packagephobia.com/result?p=mind-elixir">
|
|
26
29
|
<img src="https://packagephobia.com/badge?p=mind-elixir" alt="package size">
|
|
27
30
|
</a>
|
|
@@ -72,6 +75,7 @@ Mind elixir is a open source JavaScript mind map core. You can use it with any f
|
|
|
72
75
|
<details>
|
|
73
76
|
<summary>Table of Contents</summary>
|
|
74
77
|
|
|
78
|
+
- [Used by](#used-by)
|
|
75
79
|
- [Features](#features)
|
|
76
80
|
- [🎨 **User Experience**](#-user-experience)
|
|
77
81
|
- [⚡ **Performance \& Architecture**](#-performance--architecture)
|
|
@@ -102,6 +106,12 @@ Mind elixir is a open source JavaScript mind map core. You can use it with any f
|
|
|
102
106
|
|
|
103
107
|
</details>
|
|
104
108
|
|
|
109
|
+
## Used by
|
|
110
|
+
|
|
111
|
+
<a href="https://dependents.info/SSShooter/mind-elixir-core">
|
|
112
|
+
<img src="https://dependents.info/SSShooter/mind-elixir-core/image" alt="network dependents image" />
|
|
113
|
+
</a>
|
|
114
|
+
|
|
105
115
|
## Try now
|
|
106
116
|
|
|
107
117
|

|
|
@@ -163,7 +173,6 @@ import example from 'mind-elixir/dist/example1'
|
|
|
163
173
|
let options = {
|
|
164
174
|
el: '#map', // or HTMLDivElement
|
|
165
175
|
direction: MindElixir.LEFT,
|
|
166
|
-
draggable: true, // default true
|
|
167
176
|
toolBar: true, // default true
|
|
168
177
|
nodeMenu: true, // default true
|
|
169
178
|
keypress: true, // default true
|
|
@@ -388,6 +397,8 @@ See [Shortcuts Guide](https://docs.mind-elixir.com/docs/guides/shortcuts) for de
|
|
|
388
397
|
## Who's using
|
|
389
398
|
|
|
390
399
|
- [Mind Elixir Desktop](https://desktop.mind-elixir.com/)
|
|
400
|
+
- [ebook-to-mindmap](https://github.com/SSShooter/ebook-to-mindmap)
|
|
401
|
+
- [M10C-Video-Summary](https://github.com/SSShooter/M10C-Video-Summary)
|
|
391
402
|
|
|
392
403
|
## Ecosystem
|
|
393
404
|
|