@leafer-in/editor 2.1.7 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-in/editor",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
4
4
  "description": "@leafer-in/editor",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -34,10 +34,10 @@
34
34
  "leaferjs"
35
35
  ],
36
36
  "peerDependencies": {
37
- "@leafer-ui/draw": "^2.1.7",
38
- "@leafer-ui/core": "^2.1.7",
39
- "@leafer-in/resize": "^2.1.7",
40
- "@leafer-ui/interface": "^2.1.7",
41
- "@leafer-in/interface": "^2.1.7"
37
+ "@leafer-ui/draw": "^2.1.8",
38
+ "@leafer-ui/core": "^2.1.8",
39
+ "@leafer-in/resize": "^2.1.8",
40
+ "@leafer-ui/interface": "^2.1.8",
41
+ "@leafer-in/interface": "^2.1.8"
42
42
  }
43
43
  }
@@ -7,8 +7,8 @@ import { InnerEditor } from './InnerEditor'
7
7
  @registerEditTool()
8
8
  export class EditTool extends InnerEditor implements IEditTool {
9
9
 
10
- static registerEditTool() {
11
- EditToolCreator.register(this)
10
+ static registerEditTool(name?: string) {
11
+ EditToolCreator.register(this, name)
12
12
  }
13
13
 
14
14
 
@@ -18,10 +18,11 @@ export const EditToolCreator = {
18
18
 
19
19
  list: {} as IObject,
20
20
 
21
- register(EditTool: IObject): void {
21
+ register(EditTool: IObject, name?: string): void {
22
22
  const { tag } = EditTool.prototype as IEditTool
23
- list[tag] && debug.repeat(tag)
24
- list[tag] = EditTool
23
+ name || (name = tag)
24
+ list[name] && debug.repeat(name)
25
+ list[name] = EditTool
25
26
  },
26
27
 
27
28
  get(tag: string, editor: IEditor): IEditTool {
package/types/index.d.ts CHANGED
@@ -313,7 +313,7 @@ declare function registerEditTool(): (target: IObject) => void;
313
313
  declare const registerInnerEditor: typeof registerEditTool;
314
314
  declare const EditToolCreator: {
315
315
  list: IObject;
316
- register(EditTool: IObject): void;
316
+ register(EditTool: IObject, name?: string): void;
317
317
  get(tag: string, editor: IEditor): IEditTool;
318
318
  };
319
319
 
@@ -344,7 +344,7 @@ declare class InnerEditor implements IInnerEditor {
344
344
  }
345
345
 
346
346
  declare class EditTool extends InnerEditor implements IEditTool {
347
- static registerEditTool(): void;
347
+ static registerEditTool(name?: string): void;
348
348
  get tag(): string;
349
349
  onMove(e: IEditorMoveEvent): void;
350
350
  onScale(e: IEditorScaleEvent): void;