@plait/mind 0.2.0-next.5 → 0.2.0-next.8
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/draw/richtext.d.ts +4 -3
- package/esm2020/draw/richtext.mjs +7 -7
- package/esm2020/interfaces/options.mjs +2 -0
- package/esm2020/layout-option.mjs +3 -3
- package/esm2020/mind.component.mjs +2 -2
- package/esm2020/node.component.mjs +6 -6
- package/esm2020/plugins/emoji/emoji-base.component.mjs +13 -3
- package/esm2020/plugins/emoji/emoji.drawer.mjs +6 -10
- package/esm2020/plugins/emoji/emoji.mjs +9 -5
- package/esm2020/plugins/emoji/index.mjs +1 -2
- package/esm2020/plugins/with-abstract.mjs +2 -1
- package/esm2020/plugins/with-dnd.mjs +5 -5
- package/esm2020/plugins/with-extend-mind.mjs +11 -0
- package/esm2020/plugins/with-mind.mjs +3 -3
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/utils/draw-placeholder.mjs +5 -4
- package/esm2020/utils/node-space.mjs +5 -5
- package/fesm2015/plait-mind.mjs +64 -49
- package/fesm2015/plait-mind.mjs.map +1 -1
- package/fesm2020/plait-mind.mjs +64 -49
- package/fesm2020/plait-mind.mjs.map +1 -1
- package/interfaces/options.d.ts +4 -0
- package/layout-option.d.ts +2 -1
- package/mind.component.d.ts +2 -2
- package/node.component.d.ts +5 -4
- package/package.json +1 -1
- package/plugins/emoji/emoji-base.component.d.ts +7 -4
- package/plugins/emoji/emoji.d.ts +3 -2
- package/plugins/emoji/emoji.drawer.d.ts +5 -5
- package/plugins/emoji/index.d.ts +0 -1
- package/plugins/with-extend-mind.d.ts +10 -0
- package/plugins/with-mind.d.ts +1 -1
- package/public-api.d.ts +1 -0
- package/styles/styles.scss +3 -0
- package/utils/node-space.d.ts +3 -2
- package/esm2020/plugins/emoji/with-mind-emoji.mjs +0 -8
- package/plugins/emoji/with-mind-emoji.d.ts +0 -8
package/layout-option.d.ts
CHANGED
package/mind.component.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { MindNode } from './interfaces/node';
|
|
|
4
4
|
import { BeforeContextChange, PlaitPluginElementContext } from '@plait/core';
|
|
5
5
|
import { MindNodeComponent } from './node.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class PlaitMindComponent extends MindNodeComponent
|
|
7
|
+
export declare class PlaitMindComponent extends MindNodeComponent implements OnInit, BeforeContextChange<PlaitMind> {
|
|
8
8
|
root: MindNode;
|
|
9
9
|
rootG: SVGGElement;
|
|
10
10
|
ngOnInit(): void;
|
|
11
11
|
beforeContextChange(value: PlaitPluginElementContext<PlaitMind>): void;
|
|
12
|
-
updateMindLayout(element?:
|
|
12
|
+
updateMindLayout(element?: import("./interfaces/element").MindElement<import("@plait/mind").BaseData>): void;
|
|
13
13
|
updateMindNodeLocation(element: PlaitMind): void;
|
|
14
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlaitMindComponent, never>;
|
|
15
15
|
static ɵcmp: i0.ɵɵComponentDeclaration<PlaitMindComponent, "plait-mind", never, {}, {}, never, never, false, never>;
|
package/node.component.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ import { MindNode } from './interfaces/node';
|
|
|
8
8
|
import { EmojisDrawer } from './plugins/emoji/emoji.drawer';
|
|
9
9
|
import { AbstractHandlePosition } from './interfaces';
|
|
10
10
|
import { QuickInsertDrawer } from './drawer/quick-insert.drawer';
|
|
11
|
+
import { PlaitMindBoard } from './plugins/with-extend-mind';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
|
-
export declare class MindNodeComponent
|
|
13
|
+
export declare class MindNodeComponent extends PlaitPluginElementComponent<MindElement, PlaitMindBoard> implements OnInit, OnDestroy, OnContextChanged<MindElement, PlaitMindBoard> {
|
|
13
14
|
private viewContainerRef;
|
|
14
15
|
protected cdr: ChangeDetectorRef;
|
|
15
16
|
private render2;
|
|
@@ -34,7 +35,7 @@ export declare class MindNodeComponent<T extends MindElement = MindElement> exte
|
|
|
34
35
|
get handActive(): boolean;
|
|
35
36
|
constructor(viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef, render2: Renderer2);
|
|
36
37
|
ngOnInit(): void;
|
|
37
|
-
onContextChanged(value: PlaitPluginElementContext<
|
|
38
|
+
onContextChanged(value: PlaitPluginElementContext<MindElement, PlaitMindBoard>, previous: PlaitPluginElementContext<MindElement, PlaitMindBoard>): void;
|
|
38
39
|
drawEmojis(): void;
|
|
39
40
|
drawQuickInsert(): void;
|
|
40
41
|
drawShape(): void;
|
|
@@ -57,6 +58,6 @@ export declare class MindNodeComponent<T extends MindElement = MindElement> exte
|
|
|
57
58
|
startEditText(isEnd: boolean, isClear: boolean): void;
|
|
58
59
|
trackBy: (index: number, node: MindNode) => string;
|
|
59
60
|
ngOnDestroy(): void;
|
|
60
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MindNodeComponent
|
|
61
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MindNodeComponent
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MindNodeComponent, never>;
|
|
62
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MindNodeComponent, "plait-mind-node", never, {}, {}, never, never, false, never>;
|
|
62
63
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
-
import { EmojiItem } from '../../interfaces/element-data';
|
|
1
|
+
import { ElementRef, OnInit } from '@angular/core';
|
|
2
|
+
import { EmojiData, EmojiItem } from '../../interfaces/element-data';
|
|
3
3
|
import { PlaitBoard } from '@plait/core';
|
|
4
|
+
import { MindElement } from '../../interfaces';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class MindEmojiBaseComponent {
|
|
6
|
+
export declare class MindEmojiBaseComponent implements OnInit {
|
|
6
7
|
protected elementRef: ElementRef<HTMLElement>;
|
|
7
8
|
fontSize: number;
|
|
8
9
|
emojiItem: EmojiItem;
|
|
9
10
|
board: PlaitBoard;
|
|
11
|
+
element: MindElement<EmojiData>;
|
|
10
12
|
get nativeElement(): HTMLElement;
|
|
11
13
|
constructor(elementRef: ElementRef<HTMLElement>);
|
|
14
|
+
ngOnInit(): void;
|
|
12
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<MindEmojiBaseComponent, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MindEmojiBaseComponent, never, never, { "fontSize": "fontSize"; "emojiItem": "emojiItem"; "board": "board"; }, {}, never, never, false, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MindEmojiBaseComponent, never, never, { "fontSize": "fontSize"; "emojiItem": "emojiItem"; "board": "board"; "element": "element"; }, {}, never, never, false, never>;
|
|
14
17
|
}
|
package/plugins/emoji/emoji.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EmojiData, MindElement } from '../../interfaces';
|
|
2
|
-
|
|
2
|
+
import { PlaitMindBoard } from '../with-extend-mind';
|
|
3
|
+
export declare function getEmojisRectangle(board: PlaitMindBoard, element: MindElement<EmojiData>): {
|
|
3
4
|
width: number;
|
|
4
5
|
height: number;
|
|
5
6
|
};
|
|
6
|
-
export declare function getEmojiFontSize(element: MindElement<EmojiData>):
|
|
7
|
+
export declare function getEmojiFontSize(element: MindElement<EmojiData>): number;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ComponentRef, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { EmojiItem, MindElement } from '../../interfaces';
|
|
2
|
+
import { EmojiData, EmojiItem, MindElement } from '../../interfaces';
|
|
3
3
|
import { MindEmojiBaseComponent } from './emoji-base.component';
|
|
4
|
-
import {
|
|
4
|
+
import { PlaitMindBoard } from '../with-extend-mind';
|
|
5
5
|
export declare class EmojiDrawer {
|
|
6
6
|
private board;
|
|
7
7
|
private viewContainerRef;
|
|
8
8
|
componentRef: ComponentRef<MindEmojiBaseComponent> | null;
|
|
9
|
-
constructor(board:
|
|
10
|
-
draw(emoji: EmojiItem, element: MindElement): void;
|
|
9
|
+
constructor(board: PlaitMindBoard, viewContainerRef: ViewContainerRef);
|
|
10
|
+
draw(emoji: EmojiItem, element: MindElement<EmojiData>): void;
|
|
11
11
|
get nativeElement(): HTMLElement | null;
|
|
12
12
|
destroy(): void;
|
|
13
13
|
}
|
|
@@ -16,7 +16,7 @@ export declare class EmojisDrawer {
|
|
|
16
16
|
private viewContainerRef;
|
|
17
17
|
emojiDrawers: EmojiDrawer[];
|
|
18
18
|
g?: SVGGElement;
|
|
19
|
-
constructor(board:
|
|
19
|
+
constructor(board: PlaitMindBoard, viewContainerRef: ViewContainerRef);
|
|
20
20
|
drawEmojis(element: MindElement): SVGGElement | undefined;
|
|
21
21
|
destroy(): void;
|
|
22
22
|
}
|
package/plugins/emoji/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType, PlaitBoard } from '@plait/core';
|
|
2
|
+
import { MindElement } from '../interfaces/element';
|
|
3
|
+
import { EmojiItem } from '../interfaces/element-data';
|
|
4
|
+
import { MindEmojiBaseComponent } from './emoji';
|
|
5
|
+
import { MindOptions } from '../interfaces/options';
|
|
6
|
+
export interface PlaitMindBoard extends PlaitBoard {
|
|
7
|
+
drawEmoji: (emoji: EmojiItem, element: MindElement) => ComponentType<MindEmojiBaseComponent>;
|
|
8
|
+
getMindOptions: () => MindOptions;
|
|
9
|
+
}
|
|
10
|
+
export declare const withExtendMind: (board: PlaitBoard) => PlaitBoard & PlaitMindBoard;
|
package/plugins/with-mind.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PlaitBoard } from '@plait/core';
|
|
2
|
-
export declare const withMind: (board: PlaitBoard) => PlaitBoard & import("./
|
|
2
|
+
export declare const withMind: (board: PlaitBoard) => PlaitBoard & import("./with-extend-mind").PlaitMindBoard;
|
package/public-api.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './mind.module';
|
|
|
4
4
|
export * from './utils';
|
|
5
5
|
export * from './interfaces';
|
|
6
6
|
export * from './plugins/with-mind';
|
|
7
|
+
export * from './plugins/with-extend-mind';
|
|
7
8
|
export * from './constants';
|
|
8
9
|
export * from './queries/index';
|
|
9
10
|
export * from './transforms/index';
|
package/styles/styles.scss
CHANGED
package/utils/node-space.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MindElement } from '../interfaces/element';
|
|
2
|
+
import { PlaitMindBoard } from '../plugins/with-extend-mind';
|
|
2
3
|
export declare const NodeSpace: {
|
|
3
|
-
getNodeWidth(element: MindElement): number;
|
|
4
|
+
getNodeWidth(board: PlaitMindBoard, element: MindElement): number;
|
|
4
5
|
getNodeHeight(element: MindElement): number;
|
|
5
|
-
getTextHorizontalSpace(element: MindElement): number;
|
|
6
|
+
getTextHorizontalSpace(board: PlaitMindBoard, element: MindElement): number;
|
|
6
7
|
getTextVerticalSpace(element: MindElement): number;
|
|
7
8
|
getEmojiHorizontalSpace(element: MindElement): number;
|
|
8
9
|
getEmojiVerticalSpace(element: MindElement): number;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const withEmoji = (board) => {
|
|
2
|
-
const newBoard = board;
|
|
3
|
-
newBoard.drawEmoji = (emoji, element) => {
|
|
4
|
-
throw new Error('Not implement drawEmoji method error.');
|
|
5
|
-
};
|
|
6
|
-
return newBoard;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l0aC1taW5kLWVtb2ppLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvbWluZC9zcmMvcGx1Z2lucy9lbW9qaS93aXRoLW1pbmQtZW1vamkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBU0EsTUFBTSxDQUFDLE1BQU0sU0FBUyxHQUFHLENBQUMsS0FBaUIsRUFBRSxFQUFFO0lBQzN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W50KSA9PiB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcignTm90IGltcGxlbWVudCBkcmF3RW1vamkgbWV0aG9kIGVycm9yLicpO1xuICAgIH07XG5cbiAgICByZXR1cm4gbmV3Qm9hcmQ7XG59O1xuIl19
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComponentType, PlaitBoard } from '@plait/core';
|
|
2
|
-
import { MindElement } from '../../interfaces/element';
|
|
3
|
-
import { EmojiItem } from '../../interfaces/element-data';
|
|
4
|
-
import { MindEmojiBaseComponent } from './emoji-base.component';
|
|
5
|
-
export interface PlaitMindEmojiBoard extends PlaitBoard {
|
|
6
|
-
drawEmoji: (emoji: EmojiItem, element: MindElement) => ComponentType<MindEmojiBaseComponent>;
|
|
7
|
-
}
|
|
8
|
-
export declare const withEmoji: (board: PlaitBoard) => PlaitBoard & PlaitMindEmojiBoard;
|