@plait/common 0.56.1 → 0.57.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/core/plugin-element.d.ts +1 -1
- package/esm2022/core/plugin-element.mjs +4 -5
- package/esm2022/generators/active.generator.mjs +2 -1
- package/esm2022/generators/generator.mjs +4 -1
- package/esm2022/plugins/with-resize.mjs +11 -7
- package/esm2022/transforms/text.mjs +6 -3
- package/esm2022/utils/text.mjs +13 -1
- package/fesm2022/plait-common.mjs +33 -12
- package/fesm2022/plait-common.mjs.map +1 -1
- package/generators/active.generator.d.ts +1 -0
- package/generators/generator.d.ts +3 -3
- package/package.json +1 -1
- package/utils/text.d.ts +2 -1
|
@@ -12,6 +12,7 @@ export interface ActiveGeneratorOptions<T> {
|
|
|
12
12
|
export declare class ActiveGenerator<T extends PlaitElement = PlaitElement> extends Generator<T, ActiveGeneratorExtraData, ActiveGeneratorOptions<T> & GeneratorOptions> {
|
|
13
13
|
board: PlaitBoard;
|
|
14
14
|
options: ActiveGeneratorOptions<T>;
|
|
15
|
+
static key: string;
|
|
15
16
|
hasResizeHandle: boolean;
|
|
16
17
|
constructor(board: PlaitBoard, options: ActiveGeneratorOptions<T>);
|
|
17
18
|
canDraw(element: T, data: ActiveGeneratorExtraData): boolean;
|
|
@@ -4,11 +4,11 @@ export interface GeneratorExtraData {
|
|
|
4
4
|
export interface GeneratorOptions {
|
|
5
5
|
prepend?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare abstract class Generator<T extends PlaitElement = PlaitElement, K extends GeneratorExtraData = GeneratorExtraData, V extends GeneratorOptions = GeneratorOptions> {
|
|
8
|
-
protected board:
|
|
7
|
+
export declare abstract class Generator<T extends PlaitElement = PlaitElement, K extends GeneratorExtraData = GeneratorExtraData, V extends GeneratorOptions = GeneratorOptions, P extends PlaitBoard = PlaitBoard> {
|
|
8
|
+
protected board: P;
|
|
9
9
|
g?: SVGGElement;
|
|
10
10
|
protected options?: V;
|
|
11
|
-
constructor(board:
|
|
11
|
+
constructor(board: P, options?: V);
|
|
12
12
|
processDrawing(element: T, parentG: SVGGElement, data?: K): void;
|
|
13
13
|
/**
|
|
14
14
|
* abstract function
|
package/package.json
CHANGED
package/utils/text.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { PlaitElement } from '@plait/core';
|
|
1
|
+
import { PlaitBoard, PlaitElement } from '@plait/core';
|
|
2
2
|
import { CustomText, TextManage } from '@plait/text';
|
|
3
3
|
export declare const getTextManages: (element: PlaitElement) => TextManage[];
|
|
4
4
|
export declare const getFirstTextManage: (element: PlaitElement) => TextManage;
|
|
5
5
|
export declare const getTextEditors: (element: PlaitElement) => (import("slate").BaseEditor & import("slate-angular").AngularEditor & import("slate-history").HistoryEditor)[];
|
|
6
6
|
export declare const getFirstTextEditor: (element: PlaitElement) => import("slate").BaseEditor & import("slate-angular").AngularEditor & import("slate-history").HistoryEditor;
|
|
7
|
+
export declare const findFirstTextEditor: (board: PlaitBoard) => null;
|
|
7
8
|
export declare const getTextMarksByElement: (element: PlaitElement) => Omit<CustomText, "text">;
|
|
8
9
|
export declare const getElementsText: (elements: PlaitElement[]) => string;
|
|
9
10
|
export declare const ELEMENT_TO_TEXT_MANAGES: WeakMap<PlaitElement, TextManage[]>;
|