@plait/mind 0.13.0 → 0.14.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/esm2020/interfaces/element.mjs +11 -3
- package/esm2020/plugins/with-mind-create.mjs +4 -3
- package/esm2020/plugins/with-mind.mjs +7 -5
- package/esm2020/plugins/with-node-dnd.mjs +3 -6
- package/esm2020/utils/clipboard.mjs +1 -1
- package/esm2020/utils/node/adjust-node.mjs +8 -7
- package/esm2020/utils/node/create-node.mjs +9 -9
- package/fesm2015/plait-mind.mjs +66 -55
- package/fesm2015/plait-mind.mjs.map +1 -1
- package/fesm2020/plait-mind.mjs +70 -60
- package/fesm2020/plait-mind.mjs.map +1 -1
- package/interfaces/element.d.ts +2 -1
- package/package.json +1 -1
- package/styles/styles.scss +5 -5
- package/utils/clipboard.d.ts +2 -1
- package/utils/node/create-node.d.ts +4 -3
package/interfaces/element.d.ts
CHANGED
|
@@ -39,7 +39,8 @@ export declare const MindElement: {
|
|
|
39
39
|
findParentNode(element: MindElement): import("@plait/mind").MindNode | undefined;
|
|
40
40
|
hasEmojis(element: MindElement): element is MindElement<EmojiData>;
|
|
41
41
|
getEmojis(element: MindElement<EmojiData>): import("./element-data").EmojiItem[];
|
|
42
|
-
|
|
42
|
+
hasMounted(element: MindElement): boolean;
|
|
43
|
+
getTextEditor(element: MindElement): import("slate").BaseEditor & import("slate-angular").AngularEditor & import("slate-history").HistoryEditor;
|
|
43
44
|
};
|
|
44
45
|
export declare enum MindElementShape {
|
|
45
46
|
roundRectangle = "round-rectangle",
|
package/package.json
CHANGED
package/styles/styles.scss
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
$primary: #4e8afa;
|
|
4
4
|
|
|
5
5
|
.plait-board-container {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.root {
|
|
6
|
+
g[plait-mindmap='true'], g[plait-mind-temporary='true'] {
|
|
7
|
+
// The font family under SAFARI affects the measurement of the text size,
|
|
8
|
+
// so specify the default font family to avoid unexpected text breaks in different scene
|
|
9
|
+
font-family: PingFangSC-Regular, 'PingFang SC';
|
|
10
|
+
.root, &.root {
|
|
11
11
|
.text {
|
|
12
12
|
font-family: PingFangSC-Medium, 'PingFang SC';
|
|
13
13
|
font-weight: 400;
|
package/utils/clipboard.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PlaitBoard, PlaitElement, Point } from '@plait/core';
|
|
2
2
|
import { MindElement } from '../interfaces';
|
|
3
|
+
import { Element } from 'slate';
|
|
3
4
|
export declare const buildClipboardData: (board: PlaitBoard, selectedElements: MindElement[]) => MindElement<import("../interfaces").BaseData>[];
|
|
4
5
|
export declare const setClipboardData: (data: DataTransfer | null, elements: MindElement[]) => void;
|
|
5
6
|
export declare const getDataFromClipboard: (data: DataTransfer | null) => PlaitElement[];
|
|
6
7
|
export declare const insertClipboardData: (board: PlaitBoard, elements: PlaitElement[], targetPoint: Point) => void;
|
|
7
|
-
export declare const insertClipboardText: (board: PlaitBoard, parentElement: PlaitElement, text: string, width: number, height: number) => void;
|
|
8
|
+
export declare const insertClipboardText: (board: PlaitBoard, parentElement: PlaitElement, text: string | Element, width: number, height: number) => void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Point } from '@plait/core';
|
|
2
2
|
import { MindLayoutType } from '@plait/layouts';
|
|
3
3
|
import { BranchShape, MindElement, MindElementShape } from '../../interfaces/element';
|
|
4
|
-
|
|
4
|
+
import { Element } from 'slate';
|
|
5
|
+
export declare const createEmptyMind: (point: Point) => MindElement<import("@plait/mind").BaseData>;
|
|
5
6
|
export declare const createDefaultMind: (point: Point, rightNodeCount: number, layout: MindLayoutType) => MindElement<import("@plait/mind").BaseData>;
|
|
6
|
-
export declare const createMindElement: (text: string, width: number, height: number, options: InheritAttribute) => MindElement<import("@plait/mind").BaseData>;
|
|
7
|
+
export declare const createMindElement: (text: string | Element, width: number, height: number, options: InheritAttribute) => MindElement<import("@plait/mind").BaseData>;
|
|
7
8
|
export interface InheritAttribute {
|
|
8
9
|
fill?: string;
|
|
9
10
|
strokeColor?: string;
|