@univerjs/core 0.7.0 → 0.8.0-beta.1

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,8 +1,8 @@
1
- var L = Object.defineProperty;
2
- var F = (i, e, t) => e in i ? L(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var d = (i, e, t) => F(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { Disposable as I, Inject as l, Injector as _, AbsoluteRefType as W, UniverInstanceType as R, LifecycleStages as f, DataValidationType as q, DataValidationErrorStyle as G, DataValidationRenderMode as J, DataValidationOperator as K, DataValidationStatus as Q, CommandType as X, BaselineOffset as Y, BooleanNumber as Z, HorizontalAlign as k, TextDecoration as ee, TextDirection as te, VerticalAlign as re, WrapStrategy as ie, BorderType as ne, BorderStyleTypes as oe, AutoFillSeries as se, ColorType as ce, CommonHideTypes as ae, CopyPasteType as de, DeleteDirection as pe, DeveloperMetadataVisibility as le, Dimension as he, Direction as ue, InterpolationPointType as ye, LocaleType as ge, MentionType as ve, ProtectionType as fe, RelativeDate as _e, SheetTypes as me, ThemeColorType as Ee, LifecycleService as M, toDisposable as p, ICommandService as y, UndoCommand as h, IUndoRedoService as E, RedoCommand as u, Registry as be, UserManagerService as Se, Rectangle as Ce, numfmt as De, Tools as xe, IUniverInstanceService as N, Univer as Te, CanceledError as x, ThemeService as we, ColorBuilder as Re, RichTextBuilder as Oe, RichTextValue as Pe, ParagraphStyleBuilder as je, ParagraphStyleValue as Be, TextStyleBuilder as He, TextStyleValue as Ue, TextDecorationBuilder as Ve } from "@univerjs/core";
5
- import { filter as b } from "rxjs";
1
+ var F = Object.defineProperty;
2
+ var W = (i, e, t) => e in i ? F(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
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 Se, LifecycleService as M, toDisposable as l, ICommandService as g, UndoCommand as h, IUndoRedoService as E, RedoCommand as u, Registry as be, 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";
5
+ import { filter as S } from "rxjs";
6
6
  class $ extends I {
7
7
  /**
8
8
  * @ignore
@@ -16,7 +16,7 @@ class $ extends I {
16
16
  }
17
17
  }
18
18
  const T = Symbol("initializers");
19
- class Ie extends I {
19
+ class Me extends I {
20
20
  constructor(e) {
21
21
  super(), this._injector = e;
22
22
  const t = this, r = Object.getPrototypeOf(this)[T];
@@ -43,11 +43,11 @@ class Ie extends I {
43
43
  });
44
44
  }
45
45
  }
46
- var Me = Object.getOwnPropertyDescriptor, $e = (i, e, t, r) => {
47
- for (var n = r > 1 ? void 0 : r ? Me(e, t) : e, o = i.length - 1, s; o >= 0; o--)
46
+ var $e = Object.getOwnPropertyDescriptor, ze = (i, e, t, r) => {
47
+ for (var n = r > 1 ? void 0 : r ? $e(e, t) : e, o = i.length - 1, s; o >= 0; o--)
48
48
  (s = i[o]) && (n = s(n) || n);
49
49
  return n;
50
- }, ze = (i, e) => (t, r) => e(t, r, i);
50
+ }, Ae = (i, e) => (t, r) => e(t, r, i);
51
51
  let C = class extends $ {
52
52
  constructor(i, e) {
53
53
  super(), this._blob = i, this._injector = e;
@@ -150,14 +150,14 @@ let C = class extends $ {
150
150
  return this._blob = (e = this._blob) == null ? void 0 : e.slice(0, this._blob.size, i), this;
151
151
  }
152
152
  };
153
- C = $e([
154
- ze(1, l(_))
153
+ C = ze([
154
+ Ae(1, p(_))
155
155
  ], C);
156
- const g = class g {
156
+ const y = class y {
157
157
  static get() {
158
158
  if (this._instance)
159
159
  return this._instance;
160
- const e = new g();
160
+ const e = new y();
161
161
  return this._instance = e, e;
162
162
  }
163
163
  /**
@@ -171,8 +171,8 @@ const g = class g {
171
171
  });
172
172
  }
173
173
  constructor() {
174
- for (const e in g.prototype)
175
- this[e] = g.prototype[e];
174
+ for (const e in y.prototype)
175
+ this[e] = y.prototype[e];
176
176
  }
177
177
  /**
178
178
  * Defines different types of absolute references
@@ -183,7 +183,7 @@ const g = class g {
183
183
  * ```
184
184
  */
185
185
  get AbsoluteRefType() {
186
- return W;
186
+ return q;
187
187
  }
188
188
  /**
189
189
  * Defines different types of Univer instances
@@ -216,7 +216,7 @@ const g = class g {
216
216
  * ```
217
217
  */
218
218
  get DataValidationType() {
219
- return q;
219
+ return G;
220
220
  }
221
221
  /**
222
222
  * Different error display styles
@@ -227,7 +227,7 @@ const g = class g {
227
227
  * ```
228
228
  */
229
229
  get DataValidationErrorStyle() {
230
- return G;
230
+ return J;
231
231
  }
232
232
  /**
233
233
  * Different validation rendering modes
@@ -238,7 +238,7 @@ const g = class g {
238
238
  * ```
239
239
  */
240
240
  get DataValidationRenderMode() {
241
- return J;
241
+ return K;
242
242
  }
243
243
  /**
244
244
  * Different validation operators
@@ -249,7 +249,7 @@ const g = class g {
249
249
  * ```
250
250
  */
251
251
  get DataValidationOperator() {
252
- return K;
252
+ return Q;
253
253
  }
254
254
  /**
255
255
  * Different validation states
@@ -260,7 +260,7 @@ const g = class g {
260
260
  * ```
261
261
  */
262
262
  get DataValidationStatus() {
263
- return Q;
263
+ return X;
264
264
  }
265
265
  /**
266
266
  * Different types of commands
@@ -271,7 +271,7 @@ const g = class g {
271
271
  * ```
272
272
  */
273
273
  get CommandType() {
274
- return X;
274
+ return Y;
275
275
  }
276
276
  /**
277
277
  * Different baseline offsets for text baseline positioning
@@ -282,7 +282,7 @@ const g = class g {
282
282
  * ```
283
283
  */
284
284
  get BaselineOffset() {
285
- return Y;
285
+ return Z;
286
286
  }
287
287
  /**
288
288
  * Boolean number representations
@@ -293,7 +293,7 @@ const g = class g {
293
293
  * ```
294
294
  */
295
295
  get BooleanNumber() {
296
- return Z;
296
+ return k;
297
297
  }
298
298
  /**
299
299
  * Different horizontal text alignment options
@@ -304,7 +304,7 @@ const g = class g {
304
304
  * ```
305
305
  */
306
306
  get HorizontalAlign() {
307
- return k;
307
+ return ee;
308
308
  }
309
309
  /**
310
310
  * Different text decoration styles
@@ -315,7 +315,7 @@ const g = class g {
315
315
  * ```
316
316
  */
317
317
  get TextDecoration() {
318
- return ee;
318
+ return te;
319
319
  }
320
320
  /**
321
321
  * Different text direction options
@@ -326,7 +326,7 @@ const g = class g {
326
326
  * ```
327
327
  */
328
328
  get TextDirection() {
329
- return te;
329
+ return re;
330
330
  }
331
331
  /**
332
332
  * Different vertical text alignment options
@@ -337,7 +337,7 @@ const g = class g {
337
337
  * ```
338
338
  */
339
339
  get VerticalAlign() {
340
- return re;
340
+ return ie;
341
341
  }
342
342
  /**
343
343
  * Different wrap strategy options
@@ -348,7 +348,7 @@ const g = class g {
348
348
  * ```
349
349
  */
350
350
  get WrapStrategy() {
351
- return ie;
351
+ return ne;
352
352
  }
353
353
  /**
354
354
  * Different border types
@@ -359,7 +359,7 @@ const g = class g {
359
359
  * ```
360
360
  */
361
361
  get BorderType() {
362
- return ne;
362
+ return oe;
363
363
  }
364
364
  /**
365
365
  * Different border style types
@@ -370,7 +370,7 @@ const g = class g {
370
370
  * ```
371
371
  */
372
372
  get BorderStyleTypes() {
373
- return oe;
373
+ return se;
374
374
  }
375
375
  /**
376
376
  * Auto fill series types
@@ -381,7 +381,7 @@ const g = class g {
381
381
  * ```
382
382
  */
383
383
  get AutoFillSeries() {
384
- return se;
384
+ return ce;
385
385
  }
386
386
  /**
387
387
  * Color types
@@ -392,7 +392,7 @@ const g = class g {
392
392
  * ```
393
393
  */
394
394
  get ColorType() {
395
- return ce;
395
+ return ae;
396
396
  }
397
397
  /**
398
398
  * Common hide types
@@ -403,7 +403,7 @@ const g = class g {
403
403
  * ```
404
404
  */
405
405
  get CommonHideTypes() {
406
- return ae;
406
+ return de;
407
407
  }
408
408
  /**
409
409
  * Copy paste types
@@ -414,7 +414,7 @@ const g = class g {
414
414
  * ```
415
415
  */
416
416
  get CopyPasteType() {
417
- return de;
417
+ return le;
418
418
  }
419
419
  /**
420
420
  * Delete direction types
@@ -436,7 +436,7 @@ const g = class g {
436
436
  * ```
437
437
  */
438
438
  get DeveloperMetadataVisibility() {
439
- return le;
439
+ return he;
440
440
  }
441
441
  /**
442
442
  * Dimension types
@@ -447,7 +447,7 @@ const g = class g {
447
447
  * ```
448
448
  */
449
449
  get Dimension() {
450
- return he;
450
+ return ue;
451
451
  }
452
452
  /**
453
453
  * Direction types
@@ -458,7 +458,7 @@ const g = class g {
458
458
  * ```
459
459
  */
460
460
  get Direction() {
461
- return ue;
461
+ return ge;
462
462
  }
463
463
  /**
464
464
  * Interpolation point types
@@ -480,7 +480,7 @@ const g = class g {
480
480
  * ```
481
481
  */
482
482
  get LocaleType() {
483
- return ge;
483
+ return ve;
484
484
  }
485
485
  /**
486
486
  * Mention types
@@ -491,7 +491,7 @@ const g = class g {
491
491
  * ```
492
492
  */
493
493
  get MentionType() {
494
- return ve;
494
+ return fe;
495
495
  }
496
496
  /**
497
497
  * Protection types
@@ -502,7 +502,7 @@ const g = class g {
502
502
  * ```
503
503
  */
504
504
  get ProtectionType() {
505
- return fe;
505
+ return _e;
506
506
  }
507
507
  /**
508
508
  * Relative date types
@@ -513,7 +513,7 @@ const g = class g {
513
513
  * ```
514
514
  */
515
515
  get RelativeDate() {
516
- return _e;
516
+ return me;
517
517
  }
518
518
  /**
519
519
  * Sheet types
@@ -524,7 +524,7 @@ const g = class g {
524
524
  * ```
525
525
  */
526
526
  get SheetTypes() {
527
- return me;
527
+ return Ee;
528
528
  }
529
529
  /**
530
530
  * Theme color types
@@ -535,14 +535,14 @@ const g = class g {
535
535
  * ```
536
536
  */
537
537
  get ThemeColorType() {
538
- return Ee;
538
+ return Se;
539
539
  }
540
540
  };
541
541
  /**
542
542
  * @ignore
543
543
  */
544
- d(g, "_instance");
545
- let O = g;
544
+ d(y, "_instance");
545
+ let j = y;
546
546
  const v = class v {
547
547
  static get() {
548
548
  if (this._instance)
@@ -722,13 +722,13 @@ const v = class v {
722
722
  * @ignore
723
723
  */
724
724
  d(v, "_instance");
725
- let P = v;
726
- var Ae = Object.getOwnPropertyDescriptor, Ne = (i, e, t, r) => {
727
- for (var n = r > 1 ? void 0 : r ? Ae(e, t) : e, o = i.length - 1, s; o >= 0; o--)
725
+ let O = v;
726
+ var Le = Object.getOwnPropertyDescriptor, Ne = (i, e, t, r) => {
727
+ for (var n = r > 1 ? void 0 : r ? Le(e, t) : e, o = i.length - 1, s; o >= 0; o--)
728
728
  (s = i[o]) && (n = s(n) || n);
729
729
  return n;
730
- }, z = (i, e) => (t, r) => e(t, r, i);
731
- let j = class extends $ {
730
+ }, A = (i, e) => (t, r) => e(t, r, i);
731
+ let P = class extends $ {
732
732
  constructor(i, e) {
733
733
  super(), this._injector = i, this._lifecycleService = e;
734
734
  }
@@ -737,35 +737,35 @@ let j = class extends $ {
737
737
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, ({ stage }) => {})` as instead
738
738
  */
739
739
  onStarting(i) {
740
- return p(this._lifecycleService.lifecycle$.pipe(b((e) => e === f.Starting)).subscribe(i));
740
+ return l(this._lifecycleService.lifecycle$.pipe(S((e) => e === f.Starting)).subscribe(i));
741
741
  }
742
742
  /**
743
743
  * @param callback
744
744
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, ({ stage }) => {})` as instead
745
745
  */
746
746
  onReady(i) {
747
- return p(this._lifecycleService.lifecycle$.pipe(b((e) => e === f.Ready)).subscribe(i));
747
+ return l(this._lifecycleService.lifecycle$.pipe(S((e) => e === f.Ready)).subscribe(i));
748
748
  }
749
749
  /**
750
750
  * @param callback
751
751
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, ({ stage }) => {})` as instead
752
752
  */
753
753
  onRendered(i) {
754
- return p(this._lifecycleService.lifecycle$.pipe(b((e) => e === f.Rendered)).subscribe(i));
754
+ return l(this._lifecycleService.lifecycle$.pipe(S((e) => e === f.Rendered)).subscribe(i));
755
755
  }
756
756
  /**
757
757
  * @param callback
758
758
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, ({ stage }) => {})` as instead
759
759
  */
760
760
  onSteady(i) {
761
- return p(this._lifecycleService.lifecycle$.pipe(b((e) => e === f.Steady)).subscribe(i));
761
+ return l(this._lifecycleService.lifecycle$.pipe(S((e) => e === f.Steady)).subscribe(i));
762
762
  }
763
763
  /**
764
764
  * @param callback
765
765
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeUndo, (event) => {})` as instead
766
766
  */
767
767
  onBeforeUndo(i) {
768
- return this._injector.get(y).beforeCommandExecuted((t) => {
768
+ return this._injector.get(g).beforeCommandExecuted((t) => {
769
769
  if (t.id === h.id) {
770
770
  const n = this._injector.get(E).pitchTopUndoElement();
771
771
  n && i(n);
@@ -777,7 +777,7 @@ let j = class extends $ {
777
777
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.Undo, (event) => {})` as instead
778
778
  */
779
779
  onUndo(i) {
780
- return this._injector.get(y).onCommandExecuted((t) => {
780
+ return this._injector.get(g).onCommandExecuted((t) => {
781
781
  if (t.id === h.id) {
782
782
  const n = this._injector.get(E).pitchTopUndoElement();
783
783
  n && i(n);
@@ -789,7 +789,7 @@ let j = class extends $ {
789
789
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeRedo, (event) => {})` as instead
790
790
  */
791
791
  onBeforeRedo(i) {
792
- return this._injector.get(y).beforeCommandExecuted((t) => {
792
+ return this._injector.get(g).beforeCommandExecuted((t) => {
793
793
  if (t.id === u.id) {
794
794
  const n = this._injector.get(E).pitchTopRedoElement();
795
795
  n && i(n);
@@ -801,7 +801,7 @@ let j = class extends $ {
801
801
  * @deprecated use `univerAPI.addEvent(univerAPI.Event.Redo, (event) => {})` as instead
802
802
  */
803
803
  onRedo(i) {
804
- return this._injector.get(y).onCommandExecuted((t) => {
804
+ return this._injector.get(g).onCommandExecuted((t) => {
805
805
  if (t.id === u.id) {
806
806
  const n = this._injector.get(E).pitchTopRedoElement();
807
807
  n && i(n);
@@ -809,24 +809,24 @@ let j = class extends $ {
809
809
  });
810
810
  }
811
811
  };
812
- j = Ne([
813
- z(0, l(_)),
814
- z(1, l(M))
815
- ], j);
816
- var Le = Object.getOwnPropertyDescriptor, Fe = (i, e, t, r) => {
817
- for (var n = r > 1 ? void 0 : r ? Le(e, t) : e, o = i.length - 1, s; o >= 0; o--)
812
+ P = Ne([
813
+ A(0, p(_)),
814
+ A(1, p(M))
815
+ ], P);
816
+ var Fe = Object.getOwnPropertyDescriptor, We = (i, e, t, r) => {
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
- }, We = (i, e) => (t, r) => e(t, r, i);
821
- let B = class extends Ie {
820
+ }, qe = (i, e) => (t, r) => e(t, r, i);
821
+ let B = class extends Me {
822
822
  constructor(i, e) {
823
823
  super(e), this.doc = i;
824
824
  }
825
825
  };
826
- B = Fe([
827
- We(1, l(_))
826
+ B = We([
827
+ qe(1, p(_))
828
828
  ], B);
829
- class qe {
829
+ class Ge {
830
830
  constructor() {
831
831
  d(this, "_eventRegistry", /* @__PURE__ */ new Map());
832
832
  d(this, "_eventHandlerMap", /* @__PURE__ */ new Map());
@@ -837,7 +837,7 @@ class qe {
837
837
  }
838
838
  registerEventHandler(e, t) {
839
839
  const r = this._eventHandlerMap.get(e);
840
- return r ? r.add(t) : this._eventHandlerMap.set(e, /* @__PURE__ */ new Set([t])), this._ensureEventRegistry(e).getData().length && this._initEventHandler(e), p(() => {
840
+ return r ? r.add(t) : this._eventHandlerMap.set(e, /* @__PURE__ */ new Set([t])), this._ensureEventRegistry(e).getData().length && this._initEventHandler(e), l(() => {
841
841
  var n, o, s, c;
842
842
  (n = this._eventHandlerMap.get(e)) == null || n.delete(t), (s = (o = this._eventHandlerRegisted.get(e)) == null ? void 0 : o.get(t)) == null || s.dispose(), (c = this._eventHandlerRegisted.get(e)) == null || c.delete(t);
843
843
  });
@@ -853,7 +853,7 @@ class qe {
853
853
  let t = this._eventHandlerRegisted.get(e);
854
854
  const r = this._eventHandlerMap.get(e);
855
855
  r && (t || (t = /* @__PURE__ */ new Map(), this._eventHandlerRegisted.set(e, t), r == null || r.forEach((n) => {
856
- t == null || t.set(n, p(n()));
856
+ t == null || t.set(n, l(n()));
857
857
  })));
858
858
  }
859
859
  /**
@@ -870,7 +870,7 @@ class qe {
870
870
  * ```
871
871
  */
872
872
  addEvent(e, t) {
873
- return this._ensureEventRegistry(e).add(t), this._initEventHandler(e), p(() => this.removeEvent(e, t));
873
+ return this._ensureEventRegistry(e).add(t), this._initEventHandler(e), l(() => this.removeEvent(e, t));
874
874
  }
875
875
  /**
876
876
  * Fire an event, used in internal only.
@@ -889,11 +889,11 @@ class qe {
889
889
  }), t.cancel;
890
890
  }
891
891
  }
892
- var Ge = Object.getOwnPropertyDescriptor, Je = (i, e, t, r) => {
893
- for (var n = r > 1 ? void 0 : r ? Ge(e, t) : e, o = i.length - 1, s; o >= 0; o--)
892
+ var Je = Object.getOwnPropertyDescriptor, Ke = (i, e, t, r) => {
893
+ for (var n = r > 1 ? void 0 : r ? Je(e, t) : e, o = i.length - 1, s; o >= 0; o--)
894
894
  (s = i[o]) && (n = s(n) || n);
895
895
  return n;
896
- }, A = (i, e) => (t, r) => e(t, r, i);
896
+ }, L = (i, e) => (t, r) => e(t, r, i);
897
897
  let H = class extends $ {
898
898
  constructor(i, e) {
899
899
  super(), this._injector = i, this._userManagerService = e;
@@ -910,9 +910,9 @@ let H = class extends $ {
910
910
  return this._userManagerService.getCurrentUser();
911
911
  }
912
912
  };
913
- H = Je([
914
- A(0, l(_)),
915
- A(1, l(Se))
913
+ H = Ke([
914
+ L(0, p(_)),
915
+ L(1, p(Ce))
916
916
  ], H);
917
917
  const D = class D {
918
918
  static get() {
@@ -945,7 +945,7 @@ const D = class D {
945
945
  * ```
946
946
  */
947
947
  get rectangle() {
948
- return Ce;
948
+ return De;
949
949
  }
950
950
  /**
951
951
  * Number format utils, including parse and strigify about date, price, etc
@@ -957,7 +957,7 @@ const D = class D {
957
957
  * ```
958
958
  */
959
959
  get numfmt() {
960
- return De;
960
+ return xe;
961
961
  }
962
962
  /**
963
963
  * common tools
@@ -969,7 +969,7 @@ const D = class D {
969
969
  * ```
970
970
  */
971
971
  get tools() {
972
- return xe;
972
+ return Te;
973
973
  }
974
974
  };
975
975
  /**
@@ -977,20 +977,20 @@ const D = class D {
977
977
  */
978
978
  d(D, "_instance");
979
979
  let U = D;
980
- var Ke = Object.getOwnPropertyDescriptor, Qe = (i, e, t, r) => {
981
- for (var n = r > 1 ? void 0 : r ? Ke(e, t) : e, o = i.length - 1, s; o >= 0; o--)
980
+ var Qe = Object.getOwnPropertyDescriptor, Xe = (i, e, t, r) => {
981
+ for (var n = r > 1 ? void 0 : r ? Qe(e, t) : e, o = i.length - 1, s; o >= 0; o--)
982
982
  (s = i[o]) && (n = s(n) || n);
983
983
  return n;
984
- }, S = (i, e) => (t, r) => e(t, r, i);
984
+ }, b = (i, e) => (t, r) => e(t, r, i);
985
985
  const w = Symbol("initializers");
986
986
  let V = class extends I {
987
987
  constructor(e, t, r, n) {
988
988
  super();
989
- d(this, "_eventRegistry", new qe());
989
+ d(this, "_eventRegistry", new Ge());
990
990
  d(this, "registerEventHandler", (e, t) => this._eventRegistry.registerEventHandler(e, t));
991
991
  this._injector = e, this._commandService = t, this._univerInstanceService = r, this._lifecycleService = n, this.registerEventHandler(
992
992
  this.Event.LifeCycleChanged,
993
- () => p(
993
+ () => l(
994
994
  this._lifecycleService.lifecycle$.subscribe((s) => {
995
995
  this.fireEvent(this.Event.LifeCycleChanged, { stage: s });
996
996
  })
@@ -1018,7 +1018,7 @@ let V = class extends I {
1018
1018
  * ```
1019
1019
  */
1020
1020
  static newAPI(e) {
1021
- return (e instanceof Te ? e.__getInjector() : e).createInstance(V);
1021
+ return (e instanceof we ? e.__getInjector() : e).createInstance(V);
1022
1022
  }
1023
1023
  /**
1024
1024
  * @ignore
@@ -1039,7 +1039,7 @@ let V = class extends I {
1039
1039
  });
1040
1040
  }
1041
1041
  _initCommandEvent(e) {
1042
- const t = e.get(y);
1042
+ const t = e.get(g);
1043
1043
  this.registerEventHandler(
1044
1044
  this.Event.Redo,
1045
1045
  () => t.onCommandExecuted((r) => {
@@ -1070,7 +1070,7 @@ let V = class extends I {
1070
1070
  );
1071
1071
  }
1072
1072
  _initBeforeCommandEvent(e) {
1073
- const t = e.get(y);
1073
+ const t = e.get(g);
1074
1074
  this.registerEventHandler(
1075
1075
  this.Event.BeforeRedo,
1076
1076
  () => t.beforeCommandExecuted((r) => {
@@ -1187,14 +1187,39 @@ let V = class extends I {
1187
1187
  /**
1188
1188
  * Toggle dark mode on or off.
1189
1189
  * @param {boolean} isDarkMode - Whether the dark mode is enabled.
1190
- * @internal
1191
1190
  * @example
1192
1191
  * ```ts
1193
1192
  * univerAPI.toggleDarkMode(true);
1194
1193
  * ```
1195
1194
  */
1196
1195
  toggleDarkMode(e) {
1197
- this._injector.get(we).setDarkMode(e);
1196
+ this._injector.get(Re).setDarkMode(e);
1197
+ }
1198
+ /**
1199
+ * Load locales for the given locale.
1200
+ * @description This method is utilized to load locales, which can be either built-in or custom-defined.
1201
+ * @param {string} locale - A unique locale identifier.
1202
+ * @param {ILanguagePack} locales - The locales object containing the translations.
1203
+ * @example
1204
+ * ```ts
1205
+ * univerAPI.loadLocales('esES', {
1206
+ * 'Hello World': 'Hola Mundo',
1207
+ * });
1208
+ * ```
1209
+ */
1210
+ loadLocales(e, t) {
1211
+ this._injector.get(z).load({ [e]: t });
1212
+ }
1213
+ /**
1214
+ * Set the current locale.
1215
+ * @param {string} locale - A unique locale identifier.
1216
+ * @example
1217
+ * ```ts
1218
+ * univerAPI.setLocale('esES');
1219
+ * ```
1220
+ */
1221
+ setLocale(e) {
1222
+ this._injector.get(z).setLocale(e);
1198
1223
  }
1199
1224
  /**
1200
1225
  * Register a callback that will be triggered before invoking a command.
@@ -1260,13 +1285,13 @@ let V = class extends I {
1260
1285
  * @returns {FHooks} FHooks instance
1261
1286
  */
1262
1287
  getHooks() {
1263
- return this._injector.createInstance(j);
1288
+ return this._injector.createInstance(P);
1264
1289
  }
1265
1290
  get Enum() {
1266
- return O.get();
1291
+ return j.get();
1267
1292
  }
1268
1293
  get Event() {
1269
- return P.get();
1294
+ return O.get();
1270
1295
  }
1271
1296
  get Util() {
1272
1297
  return U.get();
@@ -1328,7 +1353,7 @@ let V = class extends I {
1328
1353
  * @deprecated
1329
1354
  */
1330
1355
  newColor() {
1331
- return new Re();
1356
+ return new je();
1332
1357
  }
1333
1358
  /**
1334
1359
  * Create a new rich text.
@@ -1372,7 +1397,7 @@ let V = class extends I {
1372
1397
  * ```
1373
1398
  */
1374
1399
  newParagraphStyle(e) {
1375
- return je.create(e);
1400
+ return Be.create(e);
1376
1401
  }
1377
1402
  /**
1378
1403
  * Create a new paragraph style value.
@@ -1384,7 +1409,7 @@ let V = class extends I {
1384
1409
  * ```
1385
1410
  */
1386
1411
  newParagraphStyleValue(e) {
1387
- return Be.create(e);
1412
+ return He.create(e);
1388
1413
  }
1389
1414
  /**
1390
1415
  * Create a new text style.
@@ -1396,7 +1421,7 @@ let V = class extends I {
1396
1421
  * ```
1397
1422
  */
1398
1423
  newTextStyle(e) {
1399
- return He.create(e);
1424
+ return Ue.create(e);
1400
1425
  }
1401
1426
  /**
1402
1427
  * Create a new text style value.
@@ -1408,7 +1433,7 @@ let V = class extends I {
1408
1433
  * ```
1409
1434
  */
1410
1435
  newTextStyleValue(e) {
1411
- return Ue.create(e);
1436
+ return Ve.create(e);
1412
1437
  }
1413
1438
  /**
1414
1439
  * Create a new text decoration.
@@ -1420,22 +1445,22 @@ let V = class extends I {
1420
1445
  * ```
1421
1446
  */
1422
1447
  newTextDecoration(e) {
1423
- return new Ve(e);
1448
+ return new Ie(e);
1424
1449
  }
1425
1450
  };
1426
- V = Qe([
1427
- S(0, l(_)),
1428
- S(1, y),
1429
- S(2, N),
1430
- S(3, l(M))
1451
+ V = Xe([
1452
+ b(0, p(_)),
1453
+ b(1, g),
1454
+ b(2, N),
1455
+ b(3, p(M))
1431
1456
  ], V);
1432
1457
  export {
1433
1458
  $ as FBase,
1434
- Ie as FBaseInitialable,
1459
+ Me as FBaseInitialable,
1435
1460
  C as FBlob,
1436
- O as FEnum,
1437
- P as FEventName,
1438
- j as FHooks,
1461
+ j as FEnum,
1462
+ O as FEventName,
1463
+ P as FHooks,
1439
1464
  V as FUniver,
1440
1465
  U as FUtil
1441
1466
  };