@univerjs/core 0.10.10 → 0.10.11

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/lib/es/facade.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var F = Object.defineProperty;
2
2
  var W = (i, e, t) => e in i ? F(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
3
  var d = (i, e, t) => W(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { Disposable as I, Inject as p, Injector as _, AbsoluteRefType as q, UniverInstanceType as R, LifecycleStages as f, DataValidationType as G, DataValidationErrorStyle as J, DataValidationRenderMode as K, DataValidationOperator as Q, DataValidationStatus as X, CommandType as Y, BaselineOffset as Z, BooleanNumber as k, HorizontalAlign as ee, TextDecoration as te, TextDirection as re, VerticalAlign as ie, WrapStrategy as ne, BorderType as oe, BorderStyleTypes as se, AutoFillSeries as ce, ColorType as ae, CommonHideTypes as de, CopyPasteType as le, DeleteDirection as pe, DeveloperMetadataVisibility as he, Dimension as ue, Direction as ge, InterpolationPointType as ye, LocaleType as ve, MentionType as fe, ProtectionType as _e, RelativeDate as me, SheetTypes as Ee, ThemeColorType as be, LifecycleService as M, toDisposable as l, ICommandService as g, UndoCommand as h, IUndoRedoService as E, RedoCommand as u, Registry as Se, UserManagerService as Ce, Rectangle as De, numfmt as xe, Tools as Te, IUniverInstanceService as N, Univer as we, CanceledError as x, ThemeService as Re, LocaleService as z, ColorBuilder as je, RichTextBuilder as Oe, RichTextValue as Pe, ParagraphStyleBuilder as Be, ParagraphStyleValue as He, TextStyleBuilder as Ue, TextStyleValue as Ve, TextDecorationBuilder as Ie } from "@univerjs/core";
4
+ import { Disposable as V, Inject as p, Injector as _, AbsoluteRefType as q, UniverInstanceType as R, LifecycleStages as f, DataValidationType as G, DataValidationErrorStyle as J, DataValidationRenderMode as K, DataValidationOperator as Q, DataValidationStatus as X, CommandType as Y, BaselineOffset as Z, BooleanNumber as k, HorizontalAlign as ee, TextDecoration as te, TextDirection as re, VerticalAlign as ie, WrapStrategy as ne, BorderType as oe, BorderStyleTypes as se, AutoFillSeries as ce, ColorType as ae, CommonHideTypes as de, CopyPasteType as le, DeleteDirection as pe, DeveloperMetadataVisibility as he, Dimension as ue, Direction as ge, InterpolationPointType as ye, LocaleType as ve, MentionType as fe, ProtectionType as _e, RelativeDate as me, SheetTypes as Ee, ThemeColorType as be, LifecycleService as I, toDisposable as l, ICommandService as g, UndoCommand as h, IUndoRedoService as E, RedoCommand as u, Registry as Se, UserManagerService as Ce, Rectangle as De, numfmt as xe, Tools as Te, IUniverInstanceService as N, Univer as we, CanceledError as x, ThemeService as Re, LocaleService as z, ColorBuilder as je, RichTextBuilder as Oe, RichTextValue as Pe, ParagraphStyleBuilder as Be, ParagraphStyleValue as He, TextStyleBuilder as Ue, TextStyleValue as Me, TextDecorationBuilder as Ve } from "@univerjs/core";
5
5
  import { filter as b } from "rxjs";
6
- class $ extends I {
6
+ class $ extends V {
7
7
  /**
8
8
  * @ignore
9
9
  */
@@ -16,7 +16,7 @@ class $ extends I {
16
16
  }
17
17
  }
18
18
  const T = Symbol("initializers");
19
- class Me extends I {
19
+ class Ie extends V {
20
20
  constructor(e) {
21
21
  super(), this._injector = e;
22
22
  const t = this, r = Object.getPrototypeOf(this)[T];
@@ -811,14 +811,14 @@ let P = class extends $ {
811
811
  };
812
812
  P = Ne([
813
813
  A(0, p(_)),
814
- A(1, p(M))
814
+ A(1, p(I))
815
815
  ], P);
816
816
  var Fe = Object.getOwnPropertyDescriptor, We = (i, e, t, r) => {
817
817
  for (var n = r > 1 ? void 0 : r ? Fe(e, t) : e, o = i.length - 1, s; o >= 0; o--)
818
818
  (s = i[o]) && (n = s(n) || n);
819
819
  return n;
820
820
  }, qe = (i, e) => (t, r) => e(t, r, i);
821
- let B = class extends Me {
821
+ let B = class extends Ie {
822
822
  constructor(i, e) {
823
823
  super(e), this.doc = i;
824
824
  }
@@ -835,6 +835,11 @@ class Ge {
835
835
  _ensureEventRegistry(e) {
836
836
  return this._eventRegistry.has(e) || this._eventRegistry.set(e, new Se()), this._eventRegistry.get(e);
837
837
  }
838
+ dispose() {
839
+ this._eventRegistry.clear(), this._eventHandlerMap.clear(), this._eventHandlerRegisted.forEach((e) => {
840
+ e.forEach((t) => t.dispose()), e.clear();
841
+ }), this._eventHandlerRegisted.clear();
842
+ }
838
843
  registerEventHandler(e, t) {
839
844
  const r = this._eventHandlerMap.get(e);
840
845
  return r ? r.add(t) : this._eventHandlerMap.set(e, /* @__PURE__ */ new Set([t])), this._ensureEventRegistry(e).getData().length && this._initEventHandler(e), l(() => {
@@ -983,7 +988,7 @@ var Qe = Object.getOwnPropertyDescriptor, Xe = (i, e, t, r) => {
983
988
  return n;
984
989
  }, S = (i, e) => (t, r) => e(t, r, i);
985
990
  const w = Symbol("initializers");
986
- let V = class extends I {
991
+ let M = class extends V {
987
992
  constructor(e, t, r, n) {
988
993
  super();
989
994
  d(this, "_eventRegistry", new Ge());
@@ -1018,7 +1023,7 @@ let V = class extends I {
1018
1023
  * ```
1019
1024
  */
1020
1025
  static newAPI(e) {
1021
- return (e instanceof we ? e.__getInjector() : e).createInstance(V);
1026
+ return (e instanceof we ? e.__getInjector() : e).createInstance(M);
1022
1027
  }
1023
1028
  /**
1024
1029
  * @ignore
@@ -1145,7 +1150,8 @@ let V = class extends I {
1145
1150
  * ```
1146
1151
  */
1147
1152
  disposeUnit(e) {
1148
- return this._univerInstanceService.disposeUnit(e);
1153
+ const t = this._univerInstanceService.disposeUnit(e);
1154
+ return this._eventRegistry.dispose(), t;
1149
1155
  }
1150
1156
  /**
1151
1157
  * Get the current lifecycle stage.
@@ -1158,7 +1164,7 @@ let V = class extends I {
1158
1164
  * ```
1159
1165
  */
1160
1166
  getCurrentLifecycleStage() {
1161
- return this._injector.get(M).stage;
1167
+ return this._injector.get(I).stage;
1162
1168
  }
1163
1169
  /**
1164
1170
  * Undo an editing on the currently focused document.
@@ -1433,7 +1439,7 @@ let V = class extends I {
1433
1439
  * ```
1434
1440
  */
1435
1441
  newTextStyleValue(e) {
1436
- return Ve.create(e);
1442
+ return Me.create(e);
1437
1443
  }
1438
1444
  /**
1439
1445
  * Create a new text decoration.
@@ -1445,22 +1451,22 @@ let V = class extends I {
1445
1451
  * ```
1446
1452
  */
1447
1453
  newTextDecoration(e) {
1448
- return new Ie(e);
1454
+ return new Ve(e);
1449
1455
  }
1450
1456
  };
1451
- V = Xe([
1457
+ M = Xe([
1452
1458
  S(0, p(_)),
1453
1459
  S(1, g),
1454
1460
  S(2, N),
1455
- S(3, p(M))
1456
- ], V);
1461
+ S(3, p(I))
1462
+ ], M);
1457
1463
  export {
1458
1464
  $ as FBase,
1459
- Me as FBaseInitialable,
1465
+ Ie as FBaseInitialable,
1460
1466
  C as FBlob,
1461
1467
  j as FEnum,
1462
1468
  O as FEventName,
1463
1469
  P as FHooks,
1464
- V as FUniver,
1470
+ M as FUniver,
1465
1471
  U as FUtil
1466
1472
  };