@chenyomi/leafer-htmltext-editor 1.0.1 → 1.0.3

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.
@@ -2,7 +2,6 @@ import { EditTool } from "@leafer-in/editor";
2
2
  export declare class TextEditTool extends EditTool {
3
3
  get tag(): string;
4
4
  quill: any;
5
- private _dragRAF;
6
5
  private updateBoxDebounced;
7
6
  constructor(editor: any);
8
7
  private debounce;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextEditTool/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAK3B,qBAEa,YAAa,SAAQ,QAAQ;IAExC,IAAW,GAAG,WAEb;IACM,KAAK,EAAE,GAAG,CAAQ;IACzB,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,kBAAkB,CAAsB;gBAEpC,MAAM,EAAE,GAAG;IAQvB,OAAO,CAAC,QAAQ;IAgBT,QAAQ,IAAI,IAAI;IA2BhB,MAAM,IAAI,IAAI;IA0BrB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,WAAW,CAAK;IACjB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAQrC,QAAQ,IAAI,IAAI;IAgBhB,QAAQ,IAAI,IAAI;IAMhB,SAAS,IAAI,IAAI;CACzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextEditTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAI3B,qBAEa,YAAa,SAAQ,QAAQ;IAExC,IAAW,GAAG,WAEb;IACM,KAAK,EAAE,GAAG,CAAQ;IACzB,OAAO,CAAC,kBAAkB,CAAsB;gBAEpC,MAAM,EAAE,GAAG;IAQvB,OAAO,CAAC,QAAQ;IAgBT,QAAQ,IAAI,IAAI;IA2BhB,MAAM,IAAI,IAAI;IA2BrB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,WAAW,CAAK;IACjB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAQrC,QAAQ,IAAI,IAAI;IAgBhB,QAAQ,IAAI,IAAI;IAMhB,SAAS,IAAI,IAAI;CACzB"}
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TextEditTool = void 0;
13
13
  const editor_1 = require("@leafer-in/editor");
14
14
  const leafer_ui_1 = require("leafer-ui");
15
- const index_1 = require("../index");
15
+ const __1 = require("../");
16
16
  const utils_1 = require("../utils");
17
17
  let TextEditTool = class TextEditTool extends editor_1.EditTool {
18
18
  get tag() {
@@ -21,7 +21,6 @@ let TextEditTool = class TextEditTool extends editor_1.EditTool {
21
21
  constructor(editor) {
22
22
  super(editor);
23
23
  this.quill = null;
24
- this._dragRAF = null;
25
24
  this.isUpdatingPoints = false;
26
25
  this.curveAmount = 0;
27
26
  this.eventIds = [];
@@ -39,7 +38,7 @@ let TextEditTool = class TextEditTool extends editor_1.EditTool {
39
38
  });
40
39
  }
41
40
  addEvent() {
42
- const { editor } = index_1.quillManager.getCanvas();
41
+ const { editor } = __1.quillManager.getCanvas();
43
42
  const text = editor._target.findOne("HTMLText");
44
43
  const { scaleX, scaleY } = text.worldTransform;
45
44
  const zoomScale = Math.max(Math.abs(scaleX), Math.abs(scaleY));
@@ -64,12 +63,13 @@ let TextEditTool = class TextEditTool extends editor_1.EditTool {
64
63
  ];
65
64
  }
66
65
  onLoad() {
67
- const { editor } = index_1.quillManager.getCanvas();
66
+ console.log(22222222);
67
+ const { editor } = __1.quillManager.getCanvas();
68
68
  const text = editor._target.findOne("HTMLText");
69
69
  const { scaleX, scaleY } = text.worldTransform;
70
70
  const zoomScale = Math.max(Math.abs(scaleX), Math.abs(scaleY));
71
71
  this.addEvent();
72
- this.quill = index_1.quillManager.getQuill();
72
+ this.quill = __1.quillManager.getQuill();
73
73
  this.quill.clipboard.dangerouslyPasteHTML(text.text);
74
74
  const div = document.querySelector("#textInnerEditor");
75
75
  const { style } = div;
@@ -90,7 +90,7 @@ let TextEditTool = class TextEditTool extends editor_1.EditTool {
90
90
  });
91
91
  }
92
92
  onUpdate() {
93
- const { editor } = index_1.quillManager.getCanvas();
93
+ const { editor } = __1.quillManager.getCanvas();
94
94
  const text = editor._target.findOne("HTMLText");
95
95
  const el = editor._target;
96
96
  console.log("文本bound更新");
@@ -100,7 +100,7 @@ let TextEditTool = class TextEditTool extends editor_1.EditTool {
100
100
  return;
101
101
  }
102
102
  onUnload() {
103
- const { editor } = index_1.quillManager.getCanvas();
103
+ const { editor } = __1.quillManager.getCanvas();
104
104
  editor.off_(this.eventIds);
105
105
  }
106
106
  onDestroy() { }
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../src/TextEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,mBAAmB,CAAC;AAKrE,qBACa,UAAW,SAAQ,WAAW;IACzC,IAAW,GAAG,WAEb;IACc,UAAU,EAAE,GAAG,CAAC;IAExB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM;;MAEX;IAEK,QAAQ,EAAE,GAAG,EAAE,CAAM;IAE5B,SAAS,CAAC,UAAU,EAChB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAC5C,SAAS,CAAa;IAC1B,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAa;IAClD,SAAS,CAAC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAa;IACtD,SAAS,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAa;IAC9C,KAAK,EAAE,GAAG,CAAQ;IAClB,WAAW,EAAE,OAAO,CAAS;IAGpC,OAAO,CAAC,eAAe,CAIf;IACR,OAAO,CAAC,OAAO,CAA+B;IAG9C,OAAO,KAAK,UAAU,GAErB;IACM,MAAM,IAAI,IAAI;IA2FrB,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,OAAO,CAUb;IAEK,QAAQ;IA0Bf,OAAO,CAAC,gBAAgB,CAAS;IAC1B,QAAQ,IAAI,IAAI;CAsCxB"}
1
+ {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../src/TextEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,mBAAmB,CAAC;AAMrE,qBACa,UAAW,SAAQ,WAAW;IACzC,IAAW,GAAG,WAEb;IACc,UAAU,EAAE,GAAG,CAAC;IAExB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM;;MAEX;IAEK,QAAQ,EAAE,GAAG,EAAE,CAAM;IAE5B,SAAS,CAAC,UAAU,EAChB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAC5C,SAAS,CAAa;IAC1B,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAa;IAClD,SAAS,CAAC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAa;IACtD,SAAS,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAa;IAC9C,KAAK,EAAE,GAAG,CAAQ;IAClB,WAAW,EAAE,OAAO,CAAS;IAGpC,OAAO,CAAC,eAAe,CAIf;IACR,OAAO,CAAC,OAAO,CAA+B;IAG9C,OAAO,KAAK,UAAU,GAErB;IACM,MAAM,IAAI,IAAI;IA4FrB,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,OAAO,CAUb;IAEK,QAAQ;IA0Bf,OAAO,CAAC,gBAAgB,CAAS;IAC1B,QAAQ,IAAI,IAAI;CAsCxB"}
@@ -11,6 +11,7 @@ const editor_1 = require("@leafer-in/editor");
11
11
  const core_1 = require("@leafer-ui/core");
12
12
  const _1 = require(".");
13
13
  const utils_1 = require("./utils");
14
+ console.log(1111, 'registerInnerEditor');
14
15
  let TextEditor = class TextEditor extends editor_1.InnerEditor {
15
16
  constructor() {
16
17
  super(...arguments);
@@ -43,6 +44,7 @@ let TextEditor = class TextEditor extends editor_1.InnerEditor {
43
44
  return window.location.host.includes("oa");
44
45
  }
45
46
  onLoad() {
47
+ console.log(22222222);
46
48
  const { editor } = this;
47
49
  const { config } = editor.app;
48
50
  const text = this.editTarget;
@@ -2,7 +2,6 @@ import { EditTool } from "@leafer-in/editor";
2
2
  export declare class TextEditTool extends EditTool {
3
3
  get tag(): string;
4
4
  quill: any;
5
- private _dragRAF;
6
5
  private updateBoxDebounced;
7
6
  constructor(editor: any);
8
7
  private debounce;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TextEditTool/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAK3B,qBAEa,YAAa,SAAQ,QAAQ;IAExC,IAAW,GAAG,WAEb;IACM,KAAK,EAAE,GAAG,CAAQ;IACzB,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,kBAAkB,CAAsB;gBAEpC,MAAM,EAAE,GAAG;IAQvB,OAAO,CAAC,QAAQ;IAgBT,QAAQ,IAAI,IAAI;IA2BhB,MAAM,IAAI,IAAI;IA0BrB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,WAAW,CAAK;IACjB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAQrC,QAAQ,IAAI,IAAI;IAgBhB,QAAQ,IAAI,IAAI;IAMhB,SAAS,IAAI,IAAI;CACzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TextEditTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAI3B,qBAEa,YAAa,SAAQ,QAAQ;IAExC,IAAW,GAAG,WAEb;IACM,KAAK,EAAE,GAAG,CAAQ;IACzB,OAAO,CAAC,kBAAkB,CAAsB;gBAEpC,MAAM,EAAE,GAAG;IAQvB,OAAO,CAAC,QAAQ;IAgBT,QAAQ,IAAI,IAAI;IA2BhB,MAAM,IAAI,IAAI;IA2BrB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,WAAW,CAAK;IACjB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAQrC,QAAQ,IAAI,IAAI;IAgBhB,QAAQ,IAAI,IAAI;IAMhB,SAAS,IAAI,IAAI;CACzB"}
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { EditTool, EditorScaleEvent, registerEditTool, } from "@leafer-in/editor";
10
+ import { EditTool, EditorScaleEvent, registerEditTool } from "@leafer-in/editor";
11
11
  import { PointerEvent } from "leafer-ui";
12
- import { quillManager } from "../index";
12
+ import { quillManager } from "../";
13
13
  import { updataHtmlText } from "../utils";
14
14
  let TextEditTool = class TextEditTool extends EditTool {
15
15
  get tag() {
@@ -18,7 +18,6 @@ let TextEditTool = class TextEditTool extends EditTool {
18
18
  constructor(editor) {
19
19
  super(editor);
20
20
  this.quill = null;
21
- this._dragRAF = null;
22
21
  this.isUpdatingPoints = false;
23
22
  this.curveAmount = 0;
24
23
  this.eventIds = [];
@@ -61,6 +60,7 @@ let TextEditTool = class TextEditTool extends EditTool {
61
60
  ];
62
61
  }
63
62
  onLoad() {
63
+ console.log(22222222);
64
64
  const { editor } = quillManager.getCanvas();
65
65
  const text = editor._target.findOne("HTMLText");
66
66
  const { scaleX, scaleY } = text.worldTransform;
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../src/TextEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,mBAAmB,CAAC;AAKrE,qBACa,UAAW,SAAQ,WAAW;IACzC,IAAW,GAAG,WAEb;IACc,UAAU,EAAE,GAAG,CAAC;IAExB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM;;MAEX;IAEK,QAAQ,EAAE,GAAG,EAAE,CAAM;IAE5B,SAAS,CAAC,UAAU,EAChB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAC5C,SAAS,CAAa;IAC1B,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAa;IAClD,SAAS,CAAC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAa;IACtD,SAAS,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAa;IAC9C,KAAK,EAAE,GAAG,CAAQ;IAClB,WAAW,EAAE,OAAO,CAAS;IAGpC,OAAO,CAAC,eAAe,CAIf;IACR,OAAO,CAAC,OAAO,CAA+B;IAG9C,OAAO,KAAK,UAAU,GAErB;IACM,MAAM,IAAI,IAAI;IA2FrB,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,OAAO,CAUb;IAEK,QAAQ;IA0Bf,OAAO,CAAC,gBAAgB,CAAS;IAC1B,QAAQ,IAAI,IAAI;CAsCxB"}
1
+ {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../src/TextEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,mBAAmB,CAAC;AAMrE,qBACa,UAAW,SAAQ,WAAW;IACzC,IAAW,GAAG,WAEb;IACc,UAAU,EAAE,GAAG,CAAC;IAExB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM;;MAEX;IAEK,QAAQ,EAAE,GAAG,EAAE,CAAM;IAE5B,SAAS,CAAC,UAAU,EAChB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAC5C,SAAS,CAAa;IAC1B,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAa;IAClD,SAAS,CAAC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAa;IACtD,SAAS,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAa;IAC9C,KAAK,EAAE,GAAG,CAAQ;IAClB,WAAW,EAAE,OAAO,CAAS;IAGpC,OAAO,CAAC,eAAe,CAIf;IACR,OAAO,CAAC,OAAO,CAA+B;IAG9C,OAAO,KAAK,UAAU,GAErB;IACM,MAAM,IAAI,IAAI;IA4FrB,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,OAAO,CAUb;IAEK,QAAQ;IA0Bf,OAAO,CAAC,gBAAgB,CAAS;IAC1B,QAAQ,IAAI,IAAI;CAsCxB"}
@@ -8,6 +8,7 @@ import { InnerEditor, registerInnerEditor } from "@leafer-in/editor";
8
8
  import { Matrix, PointerEvent } from "@leafer-ui/core";
9
9
  import { quillManager } from ".";
10
10
  import { updataHtmlText } from "./utils";
11
+ console.log(1111, 'registerInnerEditor');
11
12
  let TextEditor = class TextEditor extends InnerEditor {
12
13
  constructor() {
13
14
  super(...arguments);
@@ -40,6 +41,7 @@ let TextEditor = class TextEditor extends InnerEditor {
40
41
  return window.location.host.includes("oa");
41
42
  }
42
43
  onLoad() {
44
+ console.log(22222222);
43
45
  const { editor } = this;
44
46
  const { config } = editor.app;
45
47
  const text = this.editTarget;
@@ -1,13 +1,13 @@
1
- export { TextEditor } from './TextEditor';
2
- import './TextEditTool';
3
- import Quill from 'quill';
1
+ import Quill from "quill";
2
+ import "./TextEditTool";
3
+ import './TextEditor';
4
4
  declare class QuillManager {
5
5
  private static instance;
6
6
  private quill;
7
7
  app_: any | null;
8
8
  private constructor();
9
9
  static getInstance(): QuillManager;
10
- init(app: any): Quill;
10
+ init(app: any): Promise<Quill>;
11
11
  getQuill(): Quill;
12
12
  getCanvas(): any;
13
13
  private registerFonts;
@@ -15,4 +15,5 @@ declare class QuillManager {
15
15
  dateEdit(callback: (leaf: any) => void, level?: number, listNew?: any): void;
16
16
  }
17
17
  export declare const quillManager: QuillManager;
18
+ export {};
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,gBAAgB,CAAA;AAGvB,OAAO,KAAgB,MAAM,OAAO,CAAA;AAEpC,cAAM,YAAY;IAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IACrC,OAAO,CAAC,KAAK,CAAqB;IAC3B,IAAI,EAAE,GAAG,GAAG,IAAI,CAAO;IAE9B,OAAO;IAEP,MAAM,CAAC,WAAW;IAQlB,IAAI,CAAC,GAAG,EAAE,GAAG;IAgDb,QAAQ;IAOR,SAAS;IAOT,OAAO,CAAC,aAAa;IA+Bd,aAAa,IAAI,OAAO;IAQxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,KAAK,SAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;CA4B/E;AAED,eAAO,MAAM,YAAY,cAA6B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAA;AACrB,cAAM,YAAY;IAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IACtC,OAAO,CAAC,KAAK,CAAsB;IAC5B,IAAI,EAAE,GAAG,GAAG,IAAI,CAAQ;IAE/B,OAAO;IAEP,MAAM,CAAC,WAAW;IAOZ,IAAI,CAAC,GAAG,EAAE,GAAG;IAiDnB,QAAQ;IAOR,SAAS;IAOT,OAAO,CAAC,aAAa;IA+Bd,aAAa,IAAI,OAAO;IAQxB,QAAQ,CACb,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAC7B,KAAK,SAAI,EACT,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI;CA4BR;AAED,eAAO,MAAM,YAAY,cAA6B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- export { TextEditor } from './TextEditor';
2
- import './TextEditTool';
3
- import Quill from 'quill';
1
+ import Quill from "quill";
2
+ import "./TextEditTool";
3
+ import './TextEditor';
4
4
  declare class QuillManager {
5
5
  private static instance;
6
6
  private quill;
7
7
  app_: any | null;
8
8
  private constructor();
9
9
  static getInstance(): QuillManager;
10
- init(app: any): Quill;
10
+ init(app: any): Promise<Quill>;
11
11
  getQuill(): Quill;
12
12
  getCanvas(): any;
13
13
  private registerFonts;
@@ -15,4 +15,5 @@ declare class QuillManager {
15
15
  dateEdit(callback: (leaf: any) => void, level?: number, listNew?: any): void;
16
16
  }
17
17
  export declare const quillManager: QuillManager;
18
+ export {};
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,gBAAgB,CAAA;AAGvB,OAAO,KAAgB,MAAM,OAAO,CAAA;AAEpC,cAAM,YAAY;IAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IACrC,OAAO,CAAC,KAAK,CAAqB;IAC3B,IAAI,EAAE,GAAG,GAAG,IAAI,CAAO;IAE9B,OAAO;IAEP,MAAM,CAAC,WAAW;IAQlB,IAAI,CAAC,GAAG,EAAE,GAAG;IAgDb,QAAQ;IAOR,SAAS;IAOT,OAAO,CAAC,aAAa;IA+Bd,aAAa,IAAI,OAAO;IAQxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,KAAK,SAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;CA4B/E;AAED,eAAO,MAAM,YAAY,cAA6B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAA;AACrB,cAAM,YAAY;IAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IACtC,OAAO,CAAC,KAAK,CAAsB;IAC5B,IAAI,EAAE,GAAG,GAAG,IAAI,CAAQ;IAE/B,OAAO;IAEP,MAAM,CAAC,WAAW;IAOZ,IAAI,CAAC,GAAG,EAAE,GAAG;IAiDnB,QAAQ;IAOR,SAAS;IAOT,OAAO,CAAC,aAAa;IA+Bd,aAAa,IAAI,OAAO;IAQxB,QAAQ,CACb,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAC7B,KAAK,SAAI,EACT,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI;CA4BR;AAED,eAAO,MAAM,YAAY,cAA6B,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1,8 +1,6 @@
1
- export { TextEditor } from './TextEditor';
2
- import { Plugin } from '@leafer-ui/core';
3
- import './TextEditTool';
4
- Plugin.add('text-editor2', 'editor');
5
- import Quill, { Delta } from 'quill';
1
+ import Quill, { Delta } from "quill";
2
+ import "./TextEditTool";
3
+ import './TextEditor';
6
4
  class QuillManager {
7
5
  constructor() {
8
6
  this.quill = null;
@@ -14,44 +12,47 @@ class QuillManager {
14
12
  }
15
13
  return QuillManager.instance;
16
14
  }
17
- init(app) {
15
+ async init(app) {
18
16
  this.app_ = app;
19
17
  if (this.quill)
20
18
  return this.quill;
21
- let el = document.getElementById('textInnerEditor');
19
+ let el = document.getElementById("textInnerEditor");
22
20
  if (!el) {
23
- el = document.createElement('div');
24
- el.id = 'textInnerEditor';
25
- el.style.position = 'fixed';
26
- el.style.transformOrigin = 'left top';
27
- el.style.overflowWrap = 'break-word';
28
- el.style.wordBreak = 'break-all';
29
- el.style.visibility = 'hidden';
21
+ el = document.createElement("div");
22
+ el.id = "textInnerEditor";
23
+ el.style.position = "fixed";
24
+ el.style.transformOrigin = "left top";
25
+ el.style.overflowWrap = "break-word";
26
+ el.style.wordBreak = "break-all";
27
+ el.style.visibility = "hidden";
30
28
  document.body.appendChild(el);
31
29
  }
32
- this.quill = new Quill('#textInnerEditor', {
30
+ this.quill = new Quill("#textInnerEditor", {
33
31
  theme: undefined,
34
32
  modules: {
35
33
  toolbar: false,
36
34
  keyboard: {
37
35
  bindings: {
38
36
  enter: {
39
- key: 'Enter',
37
+ key: "Enter",
40
38
  handler: (range) => {
41
39
  const [line] = this.quill.getLine(range.index);
42
- const BlockBlot = Quill.import('blots/block');
40
+ const BlockBlot = Quill.import("blots/block");
43
41
  if (!BlockBlot?.bubbleFormats)
44
42
  return true;
45
43
  const lineFormats = BlockBlot.bubbleFormats(line);
46
- const delta = new Delta().retain(range.index).delete(range.length).insert('\n', lineFormats);
44
+ const delta = new Delta()
45
+ .retain(range.index)
46
+ .delete(range.length)
47
+ .insert("\n", lineFormats);
47
48
  this.quill.updateContents(delta, Quill.sources.USER);
48
49
  this.quill.setSelection(range.index + 1, Quill.sources.SILENT);
49
50
  return false;
50
- }
51
- }
52
- }
53
- }
54
- }
51
+ },
52
+ },
53
+ },
54
+ },
55
+ },
55
56
  });
56
57
  this.app_.editor.quill = this.quill;
57
58
  this.registerFonts();
@@ -59,43 +60,43 @@ class QuillManager {
59
60
  }
60
61
  getQuill() {
61
62
  if (!this.quill) {
62
- throw new Error('Quill editor not initialized. Call init() first.');
63
+ throw new Error("Quill editor not initialized. Call init() first.");
63
64
  }
64
65
  return this.quill;
65
66
  }
66
67
  getCanvas() {
67
68
  if (!this.app_) {
68
- throw new Error('app_ editor not initialized. Call init() first.');
69
+ throw new Error("app_ editor not initialized. Call init() first.");
69
70
  }
70
71
  return this.app_;
71
72
  }
72
73
  registerFonts() {
73
- const FontAttributor = Quill.import('attributors/class/font');
74
+ const FontAttributor = Quill.import("attributors/class/font");
74
75
  FontAttributor.whitelist = [
75
- 'Roboto',
76
- 'RobotoMono',
77
- 'Inter',
78
- 'OpenSans',
79
- 'Montserrat',
80
- 'RobotoCondensed',
81
- 'Arimo',
82
- 'NotoSans',
83
- 'NotoSansSymbols',
84
- 'Merriweather',
85
- 'PlayfairDisplay',
86
- 'NotoSerif',
87
- 'Lato',
88
- 'Spectral',
89
- 'DancingScript',
90
- 'NotoSansSimplifiedChinese',
91
- 'NotoSerifSimplifiedChinese',
92
- 'NotoSansTraditionalChinese',
93
- 'NotoSansHongKong',
94
- 'NotoSerifTraditionalChinese',
95
- 'NotoSerifHongKong',
96
- 'NotoSansJapanese',
97
- 'NotoSansKorean',
98
- 'Poppins'
76
+ "Roboto",
77
+ "RobotoMono",
78
+ "Inter",
79
+ "OpenSans",
80
+ "Montserrat",
81
+ "RobotoCondensed",
82
+ "Arimo",
83
+ "NotoSans",
84
+ "NotoSansSymbols",
85
+ "Merriweather",
86
+ "PlayfairDisplay",
87
+ "NotoSerif",
88
+ "Lato",
89
+ "Spectral",
90
+ "DancingScript",
91
+ "NotoSansSimplifiedChinese",
92
+ "NotoSerifSimplifiedChinese",
93
+ "NotoSansTraditionalChinese",
94
+ "NotoSansHongKong",
95
+ "NotoSerifTraditionalChinese",
96
+ "NotoSerifHongKong",
97
+ "NotoSansJapanese",
98
+ "NotoSansKorean",
99
+ "Poppins",
99
100
  ];
100
101
  Quill.register(FontAttributor, true);
101
102
  }
@@ -113,7 +114,7 @@ class QuillManager {
113
114
  const { editor } = this.app_;
114
115
  const list = listNew ? listNew : editor.leafList.list;
115
116
  const applyCallback = (leaf) => {
116
- if (level && (leaf.tag === 'Box' || leaf.name === 'Text')) {
117
+ if (level && (leaf.tag === "Box" || leaf.name === "Text")) {
117
118
  callback(leaf.children?.[0] || leaf);
118
119
  }
119
120
  else {
package/dist/index.js CHANGED
@@ -33,13 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.quillManager = exports.TextEditor = void 0;
37
- var TextEditor_1 = require("./TextEditor");
38
- Object.defineProperty(exports, "TextEditor", { enumerable: true, get: function () { return TextEditor_1.TextEditor; } });
39
- const core_1 = require("@leafer-ui/core");
40
- require("./TextEditTool");
41
- core_1.Plugin.add('text-editor2', 'editor');
36
+ exports.quillManager = void 0;
42
37
  const quill_1 = __importStar(require("quill"));
38
+ require("./TextEditTool");
39
+ require("./TextEditor");
43
40
  class QuillManager {
44
41
  constructor() {
45
42
  this.quill = null;
@@ -51,44 +48,47 @@ class QuillManager {
51
48
  }
52
49
  return QuillManager.instance;
53
50
  }
54
- init(app) {
51
+ async init(app) {
55
52
  this.app_ = app;
56
53
  if (this.quill)
57
54
  return this.quill;
58
- let el = document.getElementById('textInnerEditor');
55
+ let el = document.getElementById("textInnerEditor");
59
56
  if (!el) {
60
- el = document.createElement('div');
61
- el.id = 'textInnerEditor';
62
- el.style.position = 'fixed';
63
- el.style.transformOrigin = 'left top';
64
- el.style.overflowWrap = 'break-word';
65
- el.style.wordBreak = 'break-all';
66
- el.style.visibility = 'hidden';
57
+ el = document.createElement("div");
58
+ el.id = "textInnerEditor";
59
+ el.style.position = "fixed";
60
+ el.style.transformOrigin = "left top";
61
+ el.style.overflowWrap = "break-word";
62
+ el.style.wordBreak = "break-all";
63
+ el.style.visibility = "hidden";
67
64
  document.body.appendChild(el);
68
65
  }
69
- this.quill = new quill_1.default('#textInnerEditor', {
66
+ this.quill = new quill_1.default("#textInnerEditor", {
70
67
  theme: undefined,
71
68
  modules: {
72
69
  toolbar: false,
73
70
  keyboard: {
74
71
  bindings: {
75
72
  enter: {
76
- key: 'Enter',
73
+ key: "Enter",
77
74
  handler: (range) => {
78
75
  const [line] = this.quill.getLine(range.index);
79
- const BlockBlot = quill_1.default.import('blots/block');
76
+ const BlockBlot = quill_1.default.import("blots/block");
80
77
  if (!BlockBlot?.bubbleFormats)
81
78
  return true;
82
79
  const lineFormats = BlockBlot.bubbleFormats(line);
83
- const delta = new quill_1.Delta().retain(range.index).delete(range.length).insert('\n', lineFormats);
80
+ const delta = new quill_1.Delta()
81
+ .retain(range.index)
82
+ .delete(range.length)
83
+ .insert("\n", lineFormats);
84
84
  this.quill.updateContents(delta, quill_1.default.sources.USER);
85
85
  this.quill.setSelection(range.index + 1, quill_1.default.sources.SILENT);
86
86
  return false;
87
- }
88
- }
89
- }
90
- }
91
- }
87
+ },
88
+ },
89
+ },
90
+ },
91
+ },
92
92
  });
93
93
  this.app_.editor.quill = this.quill;
94
94
  this.registerFonts();
@@ -96,43 +96,43 @@ class QuillManager {
96
96
  }
97
97
  getQuill() {
98
98
  if (!this.quill) {
99
- throw new Error('Quill editor not initialized. Call init() first.');
99
+ throw new Error("Quill editor not initialized. Call init() first.");
100
100
  }
101
101
  return this.quill;
102
102
  }
103
103
  getCanvas() {
104
104
  if (!this.app_) {
105
- throw new Error('app_ editor not initialized. Call init() first.');
105
+ throw new Error("app_ editor not initialized. Call init() first.");
106
106
  }
107
107
  return this.app_;
108
108
  }
109
109
  registerFonts() {
110
- const FontAttributor = quill_1.default.import('attributors/class/font');
110
+ const FontAttributor = quill_1.default.import("attributors/class/font");
111
111
  FontAttributor.whitelist = [
112
- 'Roboto',
113
- 'RobotoMono',
114
- 'Inter',
115
- 'OpenSans',
116
- 'Montserrat',
117
- 'RobotoCondensed',
118
- 'Arimo',
119
- 'NotoSans',
120
- 'NotoSansSymbols',
121
- 'Merriweather',
122
- 'PlayfairDisplay',
123
- 'NotoSerif',
124
- 'Lato',
125
- 'Spectral',
126
- 'DancingScript',
127
- 'NotoSansSimplifiedChinese',
128
- 'NotoSerifSimplifiedChinese',
129
- 'NotoSansTraditionalChinese',
130
- 'NotoSansHongKong',
131
- 'NotoSerifTraditionalChinese',
132
- 'NotoSerifHongKong',
133
- 'NotoSansJapanese',
134
- 'NotoSansKorean',
135
- 'Poppins'
112
+ "Roboto",
113
+ "RobotoMono",
114
+ "Inter",
115
+ "OpenSans",
116
+ "Montserrat",
117
+ "RobotoCondensed",
118
+ "Arimo",
119
+ "NotoSans",
120
+ "NotoSansSymbols",
121
+ "Merriweather",
122
+ "PlayfairDisplay",
123
+ "NotoSerif",
124
+ "Lato",
125
+ "Spectral",
126
+ "DancingScript",
127
+ "NotoSansSimplifiedChinese",
128
+ "NotoSerifSimplifiedChinese",
129
+ "NotoSansTraditionalChinese",
130
+ "NotoSansHongKong",
131
+ "NotoSerifTraditionalChinese",
132
+ "NotoSerifHongKong",
133
+ "NotoSansJapanese",
134
+ "NotoSansKorean",
135
+ "Poppins",
136
136
  ];
137
137
  quill_1.default.register(FontAttributor, true);
138
138
  }
@@ -150,7 +150,7 @@ class QuillManager {
150
150
  const { editor } = this.app_;
151
151
  const list = listNew ? listNew : editor.leafList.list;
152
152
  const applyCallback = (leaf) => {
153
- if (level && (leaf.tag === 'Box' || leaf.name === 'Text')) {
153
+ if (level && (leaf.tag === "Box" || leaf.name === "Text")) {
154
154
  callback(leaf.children?.[0] || leaf);
155
155
  }
156
156
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chenyomi/leafer-htmltext-editor",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A text editor plugin for Leafer UI with HTML text support and Quill integration",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,20 +1,11 @@
1
- /**
2
- * TextEditTool 插件
3
- * 用于在编辑器中提供带有圆角的矩形的控制点编辑功能
4
- *
5
- * 作者: chenyomi
6
- */
7
-
8
- // #图形编辑器 [自定义编辑工具]
9
1
  import {
10
2
  EditTool,
11
3
  EditorScaleEvent,
12
- registerEditTool,
4
+ registerEditTool
13
5
  } from "@leafer-in/editor";
14
6
  import { PointerEvent } from "leafer-ui";
15
- import { quillManager } from "../index";
7
+ import { quillManager } from "../";
16
8
  import { updataHtmlText } from "../utils";
17
-
18
9
  @registerEditTool()
19
10
  // 定义插件类,继承自 EditTool,处理矩形圆角编辑交互
20
11
  export class TextEditTool extends EditTool {
@@ -23,7 +14,6 @@ export class TextEditTool extends EditTool {
23
14
  return "TextEditTool";
24
15
  }
25
16
  public quill: any = null;
26
- private _dragRAF: number | null = null; // 用于 requestAnimationFrame 节流拖拽事件
27
17
  private updateBoxDebounced: (text: any) => void;
28
18
  // 构造函数,初始化控制点并加入视图
29
19
  constructor(editor: any) {
@@ -78,6 +68,7 @@ export class TextEditTool extends EditTool {
78
68
 
79
69
  // 生命周期钩子:插件加载时绑定事件
80
70
  public onLoad(): void {
71
+ console.log(22222222)
81
72
  const { editor } = quillManager.getCanvas();
82
73
  const text: any = editor._target.findOne("HTMLText");
83
74
  const { scaleX, scaleY } = text.worldTransform;
package/src/TextEditor.ts CHANGED
@@ -3,6 +3,7 @@ import { Matrix, PointerEvent } from "@leafer-ui/core";
3
3
  import { quillManager } from ".";
4
4
  import { updataHtmlText } from "./utils";
5
5
 
6
+ console.log(1111, 'registerInnerEditor')
6
7
  @registerInnerEditor()
7
8
  export class TextEditor extends InnerEditor {
8
9
  public get tag() {
@@ -39,6 +40,7 @@ export class TextEditor extends InnerEditor {
39
40
  return window.location.host.includes("oa");
40
41
  }
41
42
  public onLoad(): void {
43
+ console.log(22222222)
42
44
  const { editor } = this;
43
45
  const { config } = editor.app;
44
46
  const text = this.editTarget;
package/src/index.ts CHANGED
@@ -1,148 +1,148 @@
1
- export { TextEditor } from './TextEditor'
2
- import { Plugin } from '@leafer-ui/core'
3
- import './TextEditTool'
4
- Plugin.add('text-editor2', 'editor')
5
-
6
- import Quill, { Delta } from 'quill'
7
-
1
+ import Quill, { Delta } from "quill";
2
+ import "./TextEditTool";
3
+ import './TextEditor'
8
4
  class QuillManager {
9
- private static instance: QuillManager
10
- private quill: Quill | null = null
11
- public app_: any | null = null
5
+ private static instance: QuillManager;
6
+ private quill: Quill | null = null;
7
+ public app_: any | null = null;
12
8
 
13
9
  private constructor() {}
14
10
 
15
11
  static getInstance() {
16
12
  if (!QuillManager.instance) {
17
- QuillManager.instance = new QuillManager()
13
+ QuillManager.instance = new QuillManager();
18
14
  }
19
- return QuillManager.instance
15
+ return QuillManager.instance;
20
16
  }
21
17
 
22
- /** 初始化(只会执行一次) */
23
- init(app: any) {
24
- this.app_ = app
25
- if (this.quill) return this.quill
18
+ async init(app: any) {
19
+ this.app_ = app;
20
+ if (this.quill) return this.quill;
26
21
 
27
- let el = document.getElementById('textInnerEditor')
22
+ let el = document.getElementById("textInnerEditor");
28
23
  if (!el) {
29
- el = document.createElement('div')
30
- el.id = 'textInnerEditor'
31
- el.style.position = 'fixed'
32
- el.style.transformOrigin = 'left top'
33
- el.style.overflowWrap = 'break-word'
34
- el.style.wordBreak = 'break-all'
35
- el.style.visibility = 'hidden'
36
- document.body.appendChild(el)
24
+ el = document.createElement("div");
25
+ el.id = "textInnerEditor";
26
+ el.style.position = "fixed";
27
+ el.style.transformOrigin = "left top";
28
+ el.style.overflowWrap = "break-word";
29
+ el.style.wordBreak = "break-all";
30
+ el.style.visibility = "hidden";
31
+ document.body.appendChild(el);
37
32
  }
38
33
 
39
- this.quill = new Quill('#textInnerEditor', {
34
+ this.quill = new Quill("#textInnerEditor", {
40
35
  theme: undefined,
41
36
  modules: {
42
37
  toolbar: false,
43
38
  keyboard: {
44
39
  bindings: {
45
40
  enter: {
46
- key: 'Enter',
41
+ key: "Enter",
47
42
  handler: (range: any) => {
48
- const [line] = this.quill!.getLine(range.index)
49
- const BlockBlot: any = Quill.import('blots/block')
50
- if (!BlockBlot?.bubbleFormats) return true
43
+ const [line] = this.quill!.getLine(range.index);
44
+ const BlockBlot: any = Quill.import("blots/block");
45
+ if (!BlockBlot?.bubbleFormats) return true;
51
46
 
52
- const lineFormats = BlockBlot.bubbleFormats(line)
53
- const delta = new Delta().retain(range.index).delete(range.length).insert('\n', lineFormats)
47
+ const lineFormats = BlockBlot.bubbleFormats(line);
48
+ const delta = new Delta()
49
+ .retain(range.index)
50
+ .delete(range.length)
51
+ .insert("\n", lineFormats);
54
52
 
55
- this.quill!.updateContents(delta, Quill.sources.USER)
56
- this.quill!.setSelection(range.index + 1, Quill.sources.SILENT)
57
- return false
58
- }
59
- }
60
- }
61
- }
62
- }
63
- })
64
- this.app_.editor.quill = this.quill
65
- this.registerFonts()
66
-
67
- return this.quill
53
+ this.quill!.updateContents(delta, Quill.sources.USER);
54
+ this.quill!.setSelection(range.index + 1, Quill.sources.SILENT);
55
+ return false;
56
+ },
57
+ },
58
+ },
59
+ },
60
+ },
61
+ });
62
+ this.app_.editor.quill = this.quill;
63
+ this.registerFonts();
64
+ return this.quill;
68
65
  }
69
66
 
70
- /** 获取实例 */
71
67
  getQuill() {
72
68
  if (!this.quill) {
73
- throw new Error('Quill editor not initialized. Call init() first.')
69
+ throw new Error("Quill editor not initialized. Call init() first.");
74
70
  }
75
- return this.quill
71
+ return this.quill;
76
72
  }
77
73
 
78
74
  getCanvas() {
79
75
  if (!this.app_) {
80
- throw new Error('app_ editor not initialized. Call init() first.')
76
+ throw new Error("app_ editor not initialized. Call init() first.");
81
77
  }
82
- return this.app_
78
+ return this.app_;
83
79
  }
84
80
 
85
81
  private registerFonts() {
86
- const FontAttributor: any = Quill.import('attributors/class/font')
82
+ const FontAttributor: any = Quill.import("attributors/class/font");
87
83
  FontAttributor.whitelist = [
88
- 'Roboto',
89
- 'RobotoMono',
90
- 'Inter',
91
- 'OpenSans',
92
- 'Montserrat',
93
- 'RobotoCondensed',
94
- 'Arimo',
95
- 'NotoSans',
96
- 'NotoSansSymbols',
97
- 'Merriweather',
98
- 'PlayfairDisplay',
99
- 'NotoSerif',
100
- 'Lato',
101
- 'Spectral',
102
- 'DancingScript',
103
- 'NotoSansSimplifiedChinese',
104
- 'NotoSerifSimplifiedChinese',
105
- 'NotoSansTraditionalChinese',
106
- 'NotoSansHongKong',
107
- 'NotoSerifTraditionalChinese',
108
- 'NotoSerifHongKong',
109
- 'NotoSansJapanese',
110
- 'NotoSansKorean',
111
- 'Poppins'
112
- ]
113
- Quill.register(FontAttributor, true)
84
+ "Roboto",
85
+ "RobotoMono",
86
+ "Inter",
87
+ "OpenSans",
88
+ "Montserrat",
89
+ "RobotoCondensed",
90
+ "Arimo",
91
+ "NotoSans",
92
+ "NotoSansSymbols",
93
+ "Merriweather",
94
+ "PlayfairDisplay",
95
+ "NotoSerif",
96
+ "Lato",
97
+ "Spectral",
98
+ "DancingScript",
99
+ "NotoSansSimplifiedChinese",
100
+ "NotoSerifSimplifiedChinese",
101
+ "NotoSansTraditionalChinese",
102
+ "NotoSansHongKong",
103
+ "NotoSerifTraditionalChinese",
104
+ "NotoSerifHongKong",
105
+ "NotoSansJapanese",
106
+ "NotoSansKorean",
107
+ "Poppins",
108
+ ];
109
+ Quill.register(FontAttributor, true);
114
110
  }
115
111
  // 判断是否是多选情况下
116
112
  public isMultiSelect(): boolean {
117
- if (!this.app_.editor) return false
113
+ if (!this.app_.editor) return false;
118
114
  if (this.app_.editor.multiple === true) {
119
- return true
115
+ return true;
120
116
  } else {
121
- return false
117
+ return false;
122
118
  }
123
119
  }
124
- public dateEdit(callback: (leaf: any) => void, level = 0, listNew?: any): void {
120
+ public dateEdit(
121
+ callback: (leaf: any) => void,
122
+ level = 0,
123
+ listNew?: any,
124
+ ): void {
125
125
  // 添加listNew支持,用来指定检索的数据源,防止因为防抖或者延迟执行造成的活跃对象变更
126
- const { editor } = this.app_
127
- const list = listNew ? listNew : editor.leafList.list
126
+ const { editor } = this.app_;
127
+ const list = listNew ? listNew : editor.leafList.list;
128
128
  // if (this.activeObject.value?.tag === 'Frame') {
129
129
  // callback(this.contentFrame)
130
130
  // }
131
131
  const applyCallback = (leaf: any) => {
132
- if (level && (leaf.tag === 'Box' || leaf.name === 'Text')) {
133
- callback(leaf.children?.[0] || leaf)
132
+ if (level && (leaf.tag === "Box" || leaf.name === "Text")) {
133
+ callback(leaf.children?.[0] || leaf);
134
134
  } else {
135
- callback(leaf)
135
+ callback(leaf);
136
136
  }
137
- }
138
- if (!list.length) return
137
+ };
138
+ if (!list.length) return;
139
139
  if (Array.isArray(list) && list.length > 1) {
140
- this.app_.lockLayout()
141
- list.forEach(applyCallback)
142
- this.app_.unlockLayout()
143
- editor.updateEditBox()
140
+ this.app_.lockLayout();
141
+ list.forEach(applyCallback);
142
+ this.app_.unlockLayout();
143
+ editor.updateEditBox();
144
144
  } else {
145
- applyCallback(list[0])
145
+ applyCallback(list[0]);
146
146
  }
147
147
  // 不知道为啥 加这个忘记了 先保留
148
148
  // else if (this.activeObject.value?.tag !== 'Frame') {
@@ -151,4 +151,4 @@ class QuillManager {
151
151
  }
152
152
  }
153
153
 
154
- export const quillManager = QuillManager.getInstance()
154
+ export const quillManager = QuillManager.getInstance();