mind-elixir 3.2.2 → 3.2.4
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 +9 -9
- package/dist/MindElixir.js +854 -839
- package/dist/MindElixirLite.iife.js +5 -5
- package/dist/MindElixirLite.js +169 -151
- package/dist/types/customLink.d.ts +1 -0
- package/dist/types/docs.d.ts +6 -0
- package/dist/types/index.d.ts +17 -16
- package/dist/types/linkDiv.d.ts +2 -1
- package/dist/types/methods.d.ts +20 -16
- package/dist/types/plugin/exportImage.d.ts +2 -2
- package/dist/types/types/dom.d.ts +2 -1
- package/dist/types/types/index.d.ts +4 -2
- package/package.json +1 -1
- package/readme.md +8 -11
|
@@ -31,3 +31,4 @@ export declare const hideLinkController: (this: MindElixirInstance) => void;
|
|
|
31
31
|
export declare const showLinkController: (this: MindElixirInstance, linkItem: LinkItem, fromData: DivData, toData: DivData) => void;
|
|
32
32
|
export declare function renderCustomLink(this: MindElixirInstance): void;
|
|
33
33
|
export declare function editCutsomLinkLabel(this: MindElixirInstance, el: CustomSvg): void;
|
|
34
|
+
export declare function tidyCustomLink(this: MindElixirInstance): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LinkItem } from './customLink';
|
|
2
|
+
import type methods from './methods';
|
|
3
|
+
import type { MindElixirMethods } from './methods';
|
|
4
|
+
import type { Summary } from './summary';
|
|
5
|
+
import type { LinkObj, MindElixirData, MindElixirInstance, NodeObj } from './types';
|
|
6
|
+
export { methods, MindElixirMethods, MindElixirInstance, MindElixirData, NodeObj, LinkObj, Summary, LinkItem };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ declare function MindElixir(this: MindElixirInstance, { el, direction, locale, d
|
|
|
9
9
|
declare namespace MindElixir {
|
|
10
10
|
export var prototype: {
|
|
11
11
|
init(this: MindElixirInstance, data: MindElixirData): Error | undefined;
|
|
12
|
-
exportSvg: (this: MindElixirInstance) => Blob;
|
|
13
|
-
exportPng: (this: MindElixirInstance) => Promise<Blob | null>;
|
|
12
|
+
exportSvg: (this: MindElixirInstance, noForiegnObject?: boolean) => Blob;
|
|
13
|
+
exportPng: (this: MindElixirInstance, noForiegnObject?: boolean) => Promise<Blob | null>;
|
|
14
14
|
createSummary: (this: MindElixirInstance) => void;
|
|
15
15
|
removeSummary: (this: MindElixirInstance, id: string) => void;
|
|
16
16
|
selectSummary: (this: MindElixirInstance, el: import("./summary").SummarySvgGroup) => void;
|
|
@@ -19,6 +19,7 @@ declare namespace MindElixir {
|
|
|
19
19
|
editSummary: (this: MindElixirInstance, el: import("./summary").SummarySvgGroup) => void;
|
|
20
20
|
renderCustomLink(this: MindElixirInstance): void;
|
|
21
21
|
editCutsomLinkLabel(this: MindElixirInstance, el: import("./types/dom").CustomSvg): void;
|
|
22
|
+
tidyCustomLink(this: MindElixirInstance): void;
|
|
22
23
|
drawCustomLink: (this: MindElixirInstance, from: import("./types/dom").Topic, to: import("./types/dom").Topic, obj: import("./customLink").LinkItem, isInitPaint?: boolean | undefined) => void;
|
|
23
24
|
createLink: (this: MindElixirInstance, from: import("./types/dom").Topic, to: import("./types/dom").Topic) => void;
|
|
24
25
|
removeLink: (this: MindElixirInstance, linkSvg?: import("./types/dom").CustomSvg | undefined) => void;
|
|
@@ -26,20 +27,20 @@ declare namespace MindElixir {
|
|
|
26
27
|
unselectLink: (this: MindElixirInstance) => void;
|
|
27
28
|
hideLinkController: (this: MindElixirInstance) => void;
|
|
28
29
|
showLinkController: (this: MindElixirInstance, linkItem: import("./customLink").LinkItem, fromData: import("./customLink").DivData, toData: import("./customLink").DivData) => void;
|
|
29
|
-
reshapeNode: (this: MindElixirInstance,
|
|
30
|
-
insertSibling: (this: MindElixirInstance,
|
|
31
|
-
insertBefore: (this: MindElixirInstance,
|
|
32
|
-
insertParent: (this: MindElixirInstance,
|
|
33
|
-
addChild: (this: MindElixirInstance,
|
|
34
|
-
copyNode: (this: MindElixirInstance,
|
|
35
|
-
moveUpNode: (this: MindElixirInstance,
|
|
36
|
-
moveDownNode: (this: MindElixirInstance,
|
|
37
|
-
removeNode: (this: MindElixirInstance,
|
|
38
|
-
moveNode: (this: MindElixirInstance,
|
|
39
|
-
moveNodeBefore: (this: MindElixirInstance,
|
|
40
|
-
moveNodeAfter: (this: MindElixirInstance,
|
|
41
|
-
beginEdit: (this: MindElixirInstance,
|
|
42
|
-
setNodeTopic: (this: MindElixirInstance,
|
|
30
|
+
reshapeNode: (this: MindElixirInstance, tpc: import("./types/dom").Topic, patchData: import("./types/index").NodeObj) => Promise<void>;
|
|
31
|
+
insertSibling: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined, node?: import("./types/index").NodeObj | undefined) => Promise<void>;
|
|
32
|
+
insertBefore: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined, node?: import("./types/index").NodeObj | undefined) => Promise<void>;
|
|
33
|
+
insertParent: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined, node?: import("./types/index").NodeObj | undefined) => Promise<void>;
|
|
34
|
+
addChild: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined, node?: import("./types/index").NodeObj | undefined) => Promise<void>;
|
|
35
|
+
copyNode: (this: MindElixirInstance, node: import("./types/dom").Topic, to: import("./types/dom").Topic) => Promise<void>;
|
|
36
|
+
moveUpNode: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined) => Promise<void>;
|
|
37
|
+
moveDownNode: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined) => Promise<void>;
|
|
38
|
+
removeNode: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined) => Promise<void>;
|
|
39
|
+
moveNode: (this: MindElixirInstance, from: import("./types/dom").Topic, to: import("./types/dom").Topic) => Promise<void>;
|
|
40
|
+
moveNodeBefore: (this: MindElixirInstance, from: import("./types/dom").Topic, to: import("./types/dom").Topic) => Promise<void>;
|
|
41
|
+
moveNodeAfter: (this: MindElixirInstance, from: import("./types/dom").Topic, to: import("./types/dom").Topic) => Promise<void>;
|
|
42
|
+
beginEdit: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined) => Promise<void>;
|
|
43
|
+
setNodeTopic: (this: MindElixirInstance, el: import("./types/dom").Topic, topic: string) => Promise<void>;
|
|
43
44
|
selectNode: (this: MindElixirInstance, targetElement: import("./types/dom").Topic, isNewNode?: boolean | undefined, e?: MouseEvent | undefined) => void;
|
|
44
45
|
unselectNode: (this: MindElixirInstance) => void;
|
|
45
46
|
selectNodes: (this: MindElixirInstance, targetElements: import("./types/dom").Topic[]) => void;
|
package/dist/types/linkDiv.d.ts
CHANGED
|
@@ -5,9 +5,10 @@ import type { MindElixirInstance } from './types/index';
|
|
|
5
5
|
* only link specific node if `mainNode` is present
|
|
6
6
|
*
|
|
7
7
|
* procedure:
|
|
8
|
-
* 1.
|
|
8
|
+
* 1. generate main link
|
|
9
9
|
* 2. generate links inside main node, if `mainNode` is present, only generate the link of the specific main node
|
|
10
10
|
* 3. generate custom link
|
|
11
|
+
* 4. generate summary
|
|
11
12
|
* @param mainNode regenerate sublink of the specific main node
|
|
12
13
|
*/
|
|
13
14
|
declare const linkDiv: (this: MindElixirInstance, mainNode?: Wrapper) => void;
|
package/dist/types/methods.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { MindElixirInstance, MindElixirData } from './index';
|
|
2
|
+
import * as nodeOperation from './nodeOperation';
|
|
2
3
|
import * as customLink from './customLink';
|
|
3
4
|
import * as summaryOperation from './summary';
|
|
5
|
+
export type OperationMap = typeof nodeOperation;
|
|
6
|
+
export type Operations = keyof OperationMap;
|
|
4
7
|
export type MindElixirMethods = typeof methods;
|
|
5
8
|
/**
|
|
6
9
|
* Methods that mind-elixir instance can use
|
|
@@ -9,8 +12,8 @@ export type MindElixirMethods = typeof methods;
|
|
|
9
12
|
*/
|
|
10
13
|
declare const methods: {
|
|
11
14
|
init(this: MindElixirInstance, data: MindElixirData): Error | undefined;
|
|
12
|
-
exportSvg: (this: MindElixirInstance) => Blob;
|
|
13
|
-
exportPng: (this: MindElixirInstance) => Promise<Blob | null>;
|
|
15
|
+
exportSvg: (this: MindElixirInstance, noForiegnObject?: boolean) => Blob;
|
|
16
|
+
exportPng: (this: MindElixirInstance, noForiegnObject?: boolean) => Promise<Blob | null>;
|
|
14
17
|
createSummary: (this: MindElixirInstance) => void;
|
|
15
18
|
removeSummary: (this: MindElixirInstance, id: string) => void;
|
|
16
19
|
selectSummary: (this: MindElixirInstance, el: summaryOperation.SummarySvgGroup) => void;
|
|
@@ -19,6 +22,7 @@ declare const methods: {
|
|
|
19
22
|
editSummary: (this: MindElixirInstance, el: summaryOperation.SummarySvgGroup) => void;
|
|
20
23
|
renderCustomLink(this: MindElixirInstance): void;
|
|
21
24
|
editCutsomLinkLabel(this: MindElixirInstance, el: import("./index").CustomSvg): void;
|
|
25
|
+
tidyCustomLink(this: MindElixirInstance): void;
|
|
22
26
|
drawCustomLink: (this: MindElixirInstance, from: import("./index").Topic, to: import("./index").Topic, obj: customLink.LinkItem, isInitPaint?: boolean | undefined) => void;
|
|
23
27
|
createLink: (this: MindElixirInstance, from: import("./index").Topic, to: import("./index").Topic) => void;
|
|
24
28
|
removeLink: (this: MindElixirInstance, linkSvg?: import("./index").CustomSvg | undefined) => void;
|
|
@@ -26,20 +30,20 @@ declare const methods: {
|
|
|
26
30
|
unselectLink: (this: MindElixirInstance) => void;
|
|
27
31
|
hideLinkController: (this: MindElixirInstance) => void;
|
|
28
32
|
showLinkController: (this: MindElixirInstance, linkItem: customLink.LinkItem, fromData: customLink.DivData, toData: customLink.DivData) => void;
|
|
29
|
-
reshapeNode: (this: MindElixirInstance,
|
|
30
|
-
insertSibling: (this: MindElixirInstance,
|
|
31
|
-
insertBefore: (this: MindElixirInstance,
|
|
32
|
-
insertParent: (this: MindElixirInstance,
|
|
33
|
-
addChild: (this: MindElixirInstance,
|
|
34
|
-
copyNode: (this: MindElixirInstance,
|
|
35
|
-
moveUpNode: (this: MindElixirInstance,
|
|
36
|
-
moveDownNode: (this: MindElixirInstance,
|
|
37
|
-
removeNode: (this: MindElixirInstance,
|
|
38
|
-
moveNode: (this: MindElixirInstance,
|
|
39
|
-
moveNodeBefore: (this: MindElixirInstance,
|
|
40
|
-
moveNodeAfter: (this: MindElixirInstance,
|
|
41
|
-
beginEdit: (this: MindElixirInstance,
|
|
42
|
-
setNodeTopic: (this: MindElixirInstance,
|
|
33
|
+
reshapeNode: (this: MindElixirInstance, tpc: import("./index").Topic, patchData: import("./types").NodeObj) => Promise<void>;
|
|
34
|
+
insertSibling: (this: MindElixirInstance, el?: import("./index").Topic | undefined, node?: import("./types").NodeObj | undefined) => Promise<void>;
|
|
35
|
+
insertBefore: (this: MindElixirInstance, el?: import("./index").Topic | undefined, node?: import("./types").NodeObj | undefined) => Promise<void>;
|
|
36
|
+
insertParent: (this: MindElixirInstance, el?: import("./index").Topic | undefined, node?: import("./types").NodeObj | undefined) => Promise<void>;
|
|
37
|
+
addChild: (this: MindElixirInstance, el?: import("./index").Topic | undefined, node?: import("./types").NodeObj | undefined) => Promise<void>;
|
|
38
|
+
copyNode: (this: MindElixirInstance, node: import("./index").Topic, to: import("./index").Topic) => Promise<void>;
|
|
39
|
+
moveUpNode: (this: MindElixirInstance, el?: import("./index").Topic | undefined) => Promise<void>;
|
|
40
|
+
moveDownNode: (this: MindElixirInstance, el?: import("./index").Topic | undefined) => Promise<void>;
|
|
41
|
+
removeNode: (this: MindElixirInstance, el?: import("./index").Topic | undefined) => Promise<void>;
|
|
42
|
+
moveNode: (this: MindElixirInstance, from: import("./index").Topic, to: import("./index").Topic) => Promise<void>;
|
|
43
|
+
moveNodeBefore: (this: MindElixirInstance, from: import("./index").Topic, to: import("./index").Topic) => Promise<void>;
|
|
44
|
+
moveNodeAfter: (this: MindElixirInstance, from: import("./index").Topic, to: import("./index").Topic) => Promise<void>;
|
|
45
|
+
beginEdit: (this: MindElixirInstance, el?: import("./index").Topic | undefined) => Promise<void>;
|
|
46
|
+
setNodeTopic: (this: MindElixirInstance, el: import("./index").Topic, topic: string) => Promise<void>;
|
|
43
47
|
selectNode: (this: MindElixirInstance, targetElement: import("./index").Topic, isNewNode?: boolean | undefined, e?: MouseEvent | undefined) => void;
|
|
44
48
|
unselectNode: (this: MindElixirInstance) => void;
|
|
45
49
|
selectNodes: (this: MindElixirInstance, targetElements: import("./index").Topic[]) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { MindElixirInstance } from '../types';
|
|
2
|
-
export declare const exportSvg: (this: MindElixirInstance) => Blob;
|
|
3
|
-
export declare const exportPng: (this: MindElixirInstance) => Promise<Blob | null>;
|
|
2
|
+
export declare const exportSvg: (this: MindElixirInstance, noForiegnObject?: boolean) => Blob;
|
|
3
|
+
export declare const exportPng: (this: MindElixirInstance, noForiegnObject?: boolean) => Promise<Blob | null>;
|
|
@@ -26,11 +26,12 @@ export interface Children extends HTMLElement {
|
|
|
26
26
|
}
|
|
27
27
|
export interface Topic extends HTMLElement {
|
|
28
28
|
nodeObj: NodeObj;
|
|
29
|
-
linkContainer: HTMLElement | null;
|
|
30
29
|
parentNode: Parent;
|
|
31
30
|
parentElement: Parent;
|
|
32
31
|
offsetParent: Parent;
|
|
32
|
+
text: HTMLSpanElement;
|
|
33
33
|
expander?: Expander;
|
|
34
|
+
linkContainer?: HTMLElement;
|
|
34
35
|
image?: HTMLImageElement;
|
|
35
36
|
icons?: HTMLSpanElement;
|
|
36
37
|
tags?: HTMLDivElement;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type Bus from '../utils/pubsub';
|
|
2
2
|
import type { Topic, CustomSvg } from './dom';
|
|
3
3
|
import type { EventMap, Operation } from '../utils/pubsub';
|
|
4
|
-
import type { MindElixirMethods } from '../methods';
|
|
4
|
+
import type { MindElixirMethods, OperationMap, Operations } from '../methods';
|
|
5
5
|
import type { LinkDragMoveHelperInstance } from '../utils/LinkDragMoveHelper';
|
|
6
6
|
import type { LinkItem } from '../customLink';
|
|
7
7
|
import type { Summary, SummarySvgGroup } from '../summary';
|
|
8
8
|
export * from '../methods';
|
|
9
|
-
type Before =
|
|
9
|
+
type Before = Partial<{
|
|
10
|
+
[K in Operations]: (...args: Parameters<OperationMap[K]>) => Promise<boolean> | boolean;
|
|
11
|
+
}>;
|
|
10
12
|
export interface Theme {
|
|
11
13
|
name: string;
|
|
12
14
|
palette: string[];
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -259,8 +259,6 @@ let mind = new MindElixir({
|
|
|
259
259
|
## Export as a Image
|
|
260
260
|
|
|
261
261
|
```typescript
|
|
262
|
-
import { exportPng } from './plugin/exportImage'
|
|
263
|
-
|
|
264
262
|
const mind = {
|
|
265
263
|
/** mind elixir instance */
|
|
266
264
|
}
|
|
@@ -327,14 +325,14 @@ Be aware that Mind Elixir will not observe the change of `prefers-color-scheme`.
|
|
|
327
325
|
| Tab | Insert Child Node |
|
|
328
326
|
| F1 | Center the Map |
|
|
329
327
|
| F2 | Begin Editing the Current Node |
|
|
330
|
-
|
|
|
331
|
-
|
|
|
332
|
-
|
|
|
333
|
-
| PageUp
|
|
334
|
-
| PageDown
|
|
335
|
-
| Ctrl +
|
|
336
|
-
| Ctrl +
|
|
337
|
-
| Ctrl +
|
|
328
|
+
| ↑ | Select the Previous Sibling Node |
|
|
329
|
+
| ↓ | Select the Next Sibling Node |
|
|
330
|
+
| ← / → | Select Parent or First Child |
|
|
331
|
+
| PageUp / Alt + ↑ | Move Up Node |
|
|
332
|
+
| PageDown / Alt + ↓ | Move Down Node |
|
|
333
|
+
| Ctrl + ↑ | Change Layout Pattern to Side |
|
|
334
|
+
| Ctrl + ← | Change Layout Pattern to Left |
|
|
335
|
+
| Ctrl + → | Change Layout Pattern to Right |
|
|
338
336
|
| Ctrl + C | Copy the Current Node |
|
|
339
337
|
| Ctrl + V | Paste the Copied Node |
|
|
340
338
|
| Ctrl + "+" | Zoom In Mind Map |
|
|
@@ -347,7 +345,6 @@ Be aware that Mind Elixir will not observe the change of `prefers-color-scheme`.
|
|
|
347
345
|
- [@mind-elixir/node-menu-neo](https://github.com/ssshooter/node-menu-neo)
|
|
348
346
|
- [@mind-elixir/export-xmind](https://github.com/ssshooter/export-xmind)
|
|
349
347
|
- [@mind-elixir/export-html](https://github.com/ssshooter/export-html)
|
|
350
|
-
- [@mind-elixir/export-image](https://github.com/ssshooter/export-image) (WIP🚧)
|
|
351
348
|
- [mind-elixir-react](https://github.com/ssshooter/mind-elixir-react)
|
|
352
349
|
|
|
353
350
|
## Development
|