mind-elixir 5.0.4 → 5.0.6

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.
@@ -53,7 +53,7 @@ declare namespace MindElixir {
53
53
  y: number;
54
54
  }) => void;
55
55
  scaleFit: (this: MindElixirInstance) => void;
56
- move: (this: MindElixirInstance, dx: number, dy: number) => void;
56
+ move: (this: MindElixirInstance, dx: number, dy: number, smooth?: boolean) => void;
57
57
  toCenter: (this: MindElixirInstance) => void;
58
58
  install: (this: MindElixirInstance, plugin: (instance: MindElixirInstance) => void) => void;
59
59
  focusNode: (this: MindElixirInstance, el: Topic) => void;
@@ -57,7 +57,7 @@ export declare const scaleFit: (this: MindElixirInstance) => void;
57
57
  /**
58
58
  * Move the map by `dx` and `dy`.
59
59
  */
60
- export declare const move: (this: MindElixirInstance, dx: number, dy: number) => void;
60
+ export declare const move: (this: MindElixirInstance, dx: number, dy: number, smooth?: boolean) => void;
61
61
  /**
62
62
  * @function
63
63
  * @instance
@@ -59,7 +59,7 @@ declare const methods: {
59
59
  y: number;
60
60
  }) => void;
61
61
  scaleFit: (this: MindElixirInstance) => void;
62
- move: (this: MindElixirInstance, dx: number, dy: number) => void;
62
+ move: (this: MindElixirInstance, dx: number, dy: number, smooth?: boolean) => void;
63
63
  toCenter: (this: MindElixirInstance) => void;
64
64
  install: (this: MindElixirInstance, plugin: (instance: MindElixirInstance) => void) => void;
65
65
  focusNode: (this: MindElixirInstance, el: import("./index").Topic) => void;
@@ -3,6 +3,15 @@ import type { Summary } from '../summary';
3
3
  import type { MindElixirInstance } from '../types';
4
4
  import type { CustomSvg } from '../types/dom';
5
5
  export declare const svgNS = "http://www.w3.org/2000/svg";
6
+ export interface SvgTextOptions {
7
+ anchor?: 'start' | 'middle' | 'end';
8
+ color?: string;
9
+ dataType?: string;
10
+ }
11
+ /**
12
+ * Create an SVG text element with common attributes
13
+ */
14
+ export declare const createSvgText: (text: string, x: number, y: number, options?: SvgTextOptions) => SVGTextElement;
6
15
  export declare const createPath: (d: string, color: string, width: string) => SVGPathElement;
7
16
  export declare const createLinkSvg: (klass: string) => SVGSVGElement;
8
17
  export declare const createLine: () => SVGLineElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mind-elixir",
3
- "version": "5.0.4",
3
+ "version": "5.0.6",
4
4
  "type": "module",
5
5
  "description": "Mind elixir is a free open source mind map core.",
6
6
  "keywords": [
@@ -18,6 +18,9 @@
18
18
  "preview": "vite preview",
19
19
  "test": "playwright test",
20
20
  "test:ui": "playwright test --ui",
21
+ "test:clean": "rimraf .nyc_output coverage",
22
+ "test:coverage": "pnpm test:clean && pnpm test && pnpm nyc && npx http-server ./coverage",
23
+ "nyc": "nyc report --reporter=html",
21
24
  "doc": "api-extractor run --local --verbose",
22
25
  "doc:md": "api-documenter markdown --input-folder ./api --output-folder ./md",
23
26
  "beta": "npm run build && npm publish --tag beta"
@@ -92,8 +95,11 @@
92
95
  "husky": "^8.0.3",
93
96
  "less": "^4.2.0",
94
97
  "lint-staged": "^13.3.0",
98
+ "nyc": "^17.1.0",
95
99
  "prettier": "2.8.4",
100
+ "rimraf": "^6.0.1",
96
101
  "typescript": "^5.4.5",
97
- "vite": "^4.5.3"
102
+ "vite": "^4.5.3",
103
+ "vite-plugin-istanbul": "^7.1.0"
98
104
  }
99
105
  }
package/readme.md CHANGED
@@ -63,6 +63,8 @@ Mind elixir is a open source JavaScript mind map core. You can use it with any f
63
63
  - **Easy styling** - Customize mindmap with CSS variables
64
64
  - **Theme support** - Built-in themes and custom styling
65
65
 
66
+ [v5 Breaking Changes](https://github.com/SSShooter/mind-elixir-core/wiki/Breaking-Change#500)
67
+
66
68
  <details>
67
69
  <summary>Table of Contents</summary>
68
70
 
@@ -86,11 +88,11 @@ Mind elixir is a open source JavaScript mind map core. You can use it with any f
86
88
  - [Export as a Image](#export-as-a-image)
87
89
  - [Theme](#theme)
88
90
  - [Shortcuts](#shortcuts)
91
+ - [Who's using](#whos-using)
89
92
  - [Ecosystem](#ecosystem)
90
93
  - [Development](#development)
91
94
  - [Thanks](#thanks)
92
95
  - [Contributors](#contributors)
93
- - [v5 Breaking Changes](#v5-breaking-changes)
94
96
 
95
97
  </details>
96
98
 
@@ -121,8 +123,8 @@ npm i mind-elixir -S
121
123
  ```
122
124
 
123
125
  ```javascript
124
- import MindElixir from 'mind-elixir';
125
- import "mind-elixir/style.css";
126
+ import MindElixir from 'mind-elixir'
127
+ import 'mind-elixir/style.css'
126
128
  ```
127
129
 
128
130
  #### Script tag
@@ -134,7 +136,7 @@ import "mind-elixir/style.css";
134
136
  And in your CSS file:
135
137
 
136
138
  ```css
137
- @import "https://cdn.jsdelivr.net/npm/mind-elixir/dist/style.css";
139
+ @import 'https://cdn.jsdelivr.net/npm/mind-elixir/dist/style.css';
138
140
  ```
139
141
 
140
142
  ### Init
@@ -151,7 +153,7 @@ And in your CSS file:
151
153
 
152
154
  ```javascript
153
155
  import MindElixir from 'mind-elixir'
154
- import "mind-elixir/style.css";
156
+ import 'mind-elixir/style.css'
155
157
  import example from 'mind-elixir/dist/example1'
156
158
 
157
159
  let options = {
@@ -245,7 +247,6 @@ mind.bus.addListener('operation', operation => {
245
247
  // obj: {from:target1,to:target2}
246
248
  })
247
249
 
248
-
249
250
  mind.bus.addListener('selectNodes', nodes => {
250
251
  console.log(nodes)
251
252
  })
@@ -345,25 +346,11 @@ Be aware that Mind Elixir will not observe the change of `prefers-color-scheme`.
345
346
 
346
347
  ## Shortcuts
347
348
 
348
- | Shortcut | Function |
349
- | ------------------ | -------------------------------- |
350
- | Enter | Insert Sibling Node |
351
- | Tab | Insert Child Node |
352
- | F1 | Center the Map |
353
- | F2 | Begin Editing the Current Node |
354
- | ↑ | Select the Previous Sibling Node |
355
- | ↓ | Select the Next Sibling Node |
356
- | ← / → | Select Parent or First Child |
357
- | PageUp / Alt + ↑ | Move Up Node |
358
- | PageDown / Alt + ↓ | Move Down Node |
359
- | Ctrl + ↑ | Change Layout Pattern to Side |
360
- | Ctrl + ← | Change Layout Pattern to Left |
361
- | Ctrl + → | Change Layout Pattern to Right |
362
- | Ctrl + C | Copy the Current Node |
363
- | Ctrl + V | Paste the Copied Node |
364
- | Ctrl + "+" | Zoom In Mind Map |
365
- | Ctrl + "-" | Zoom Out Mind Map |
366
- | Ctrl + 0 | Reset Zoom Level |
349
+ See [Shortcuts Guide](https://docs.mind-elixir.com/docs/guides/shortcuts) for detailed information.
350
+
351
+ ## Who's using
352
+
353
+ - [Mind Elixir Desktop](https://desktop.mind-elixir.com/)
367
354
 
368
355
  ## Ecosystem
369
356
 
@@ -413,18 +400,3 @@ Thanks for your contributions to Mind Elixir! Your support and dedication make t
413
400
  <a href="https://github.com/SSShooter/mind-elixir-core/graphs/contributors">
414
401
  <img src="https://contrib.rocks/image?repo=SSShooter/mind-elixir-core" />
415
402
  </a>
416
-
417
- ## v5 Breaking Changes
418
-
419
- - Move scroll-based movement to transition-based movement
420
- - `Summary.text` -> `Summary.label`
421
- - Remove `getDataMd()`
422
- - MindElixir.dragMoveHelper -> instance.dragMoveHelper
423
- - Remove `unselectNode()`
424
- - Remove `selectNode` event, use `selectNodes` event instead
425
- - Remove `removeNode()`
426
- - `node.style.fontSize`: use string instead of number which means you should add `px` to the end
427
- - Use `instance.findEl` instead of `MindElixir.E` to get a node element
428
- - CSS file is separated from JS file, you need to import it manually
429
- - If using a bundler with CSS support: `import "mind-elixir/style.css";`
430
- - If using a CDN you can add to your CSS file: `@import "https://cdn.jsdelivr.net/npm/mind-elixir@^5.0.0/dist/style.css";`