@univerjs/core 0.10.12 → 0.10.13
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/cjs/facade.js +1 -1
- package/lib/cjs/index.js +7 -7
- package/lib/es/facade.js +120 -113
- package/lib/es/index.js +642 -642
- package/lib/facade.js +120 -113
- package/lib/index.js +642 -642
- package/lib/types/facade/f-base.d.ts +3 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +7 -7
- package/package.json +3 -3
package/lib/es/facade.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (i, e, t) =>
|
|
4
|
-
import { Disposable as
|
|
1
|
+
var W = Object.defineProperty;
|
|
2
|
+
var q = (i, e, t) => e in i ? W(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var d = (i, e, t) => q(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Disposable as M, Inject as p, Injector as _, AbsoluteRefType as G, UniverInstanceType as R, LifecycleStages as f, DataValidationType as J, DataValidationErrorStyle as K, DataValidationRenderMode as Q, DataValidationOperator as X, DataValidationStatus as Y, CommandType as Z, BaselineOffset as k, BooleanNumber as ee, HorizontalAlign as te, TextDecoration as re, TextDirection as ie, VerticalAlign as ne, WrapStrategy as oe, BorderType as se, BorderStyleTypes as ce, AutoFillSeries as ae, ColorType as de, CommonHideTypes as le, CopyPasteType as pe, DeleteDirection as he, DeveloperMetadataVisibility as ue, Dimension as ge, Direction as ye, InterpolationPointType as ve, LocaleType as fe, MentionType as _e, ProtectionType as me, RelativeDate as Ee, SheetTypes as be, ThemeColorType as Se, LifecycleService as V, toDisposable as l, ICommandService as g, UndoCommand as h, IUndoRedoService as E, RedoCommand as u, Registry as Ce, UserManagerService as De, Rectangle as xe, numfmt as Te, Tools as we, IUniverInstanceService as F, Univer as Re, CanceledError as T, ThemeService as Oe, LocaleService as z, ColorBuilder as je, RichTextBuilder as Pe, RichTextValue as Be, ParagraphStyleBuilder as He, ParagraphStyleValue as Ue, TextStyleBuilder as Ie, TextStyleValue as Me, TextDecorationBuilder as Ve } from "@univerjs/core";
|
|
5
5
|
import { filter as b } from "rxjs";
|
|
6
|
-
class $ extends
|
|
6
|
+
class $ extends M {
|
|
7
7
|
/**
|
|
8
8
|
* @ignore
|
|
9
9
|
*/
|
|
@@ -15,19 +15,26 @@ class $ extends V {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
class
|
|
18
|
+
const S = Symbol("initializers"), A = Symbol("manualInit");
|
|
19
|
+
class $e extends M {
|
|
20
20
|
constructor(e) {
|
|
21
|
-
super(), this._injector = e;
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
if (super(), this._injector = e, !!this.constructor[A]) return;
|
|
22
|
+
const n = this, o = Object.getPrototypeOf(this)[S];
|
|
23
|
+
o && o.forEach(function(s) {
|
|
24
|
+
s.apply(n, [e]);
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* @ignore
|
|
29
29
|
*/
|
|
30
|
-
_initialize(e) {
|
|
30
|
+
_initialize(e, ...t) {
|
|
31
|
+
}
|
|
32
|
+
_runInitializers(...e) {
|
|
33
|
+
const t = Object.getPrototypeOf(this)[S];
|
|
34
|
+
t != null && t.length && t.forEach((r) => r.apply(this, e));
|
|
35
|
+
}
|
|
36
|
+
static _enableManualInit() {
|
|
37
|
+
this[A] = !0;
|
|
31
38
|
}
|
|
32
39
|
/**
|
|
33
40
|
* @ignore
|
|
@@ -35,20 +42,20 @@ class Ie extends V {
|
|
|
35
42
|
static extend(e) {
|
|
36
43
|
Object.getOwnPropertyNames(e.prototype).forEach((t) => {
|
|
37
44
|
if (t === "_initialize") {
|
|
38
|
-
let r = this.prototype[
|
|
39
|
-
r || (r = [], this.prototype[
|
|
45
|
+
let r = this.prototype[S];
|
|
46
|
+
r || (r = [], this.prototype[S] = r), r.push(e.prototype._initialize);
|
|
40
47
|
} else t !== "constructor" && (this.prototype[t] = e.prototype[t]);
|
|
41
48
|
}), Object.getOwnPropertyNames(e).forEach((t) => {
|
|
42
49
|
t !== "prototype" && t !== "name" && t !== "length" && (this[t] = e[t]);
|
|
43
50
|
});
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
|
-
var
|
|
47
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
53
|
+
var ze = Object.getOwnPropertyDescriptor, Ae = (i, e, t, r) => {
|
|
54
|
+
for (var n = r > 1 ? void 0 : r ? ze(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
48
55
|
(s = i[o]) && (n = s(n) || n);
|
|
49
56
|
return n;
|
|
50
|
-
},
|
|
51
|
-
let
|
|
57
|
+
}, Le = (i, e) => (t, r) => e(t, r, i);
|
|
58
|
+
let D = class extends $ {
|
|
52
59
|
constructor(i, e) {
|
|
53
60
|
super(), this._blob = i, this._injector = e;
|
|
54
61
|
}
|
|
@@ -63,7 +70,7 @@ let C = class extends $ {
|
|
|
63
70
|
* ```
|
|
64
71
|
*/
|
|
65
72
|
copyBlob() {
|
|
66
|
-
return this._injector.createInstance(
|
|
73
|
+
return this._injector.createInstance(D, this._blob);
|
|
67
74
|
}
|
|
68
75
|
/**
|
|
69
76
|
* Return the data inside this object as a blob converted to the specified content type.
|
|
@@ -150,9 +157,9 @@ let C = class extends $ {
|
|
|
150
157
|
return this._blob = (e = this._blob) == null ? void 0 : e.slice(0, this._blob.size, i), this;
|
|
151
158
|
}
|
|
152
159
|
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
],
|
|
160
|
+
D = Ae([
|
|
161
|
+
Le(1, p(_))
|
|
162
|
+
], D);
|
|
156
163
|
const y = class y {
|
|
157
164
|
static get() {
|
|
158
165
|
if (this._instance)
|
|
@@ -183,7 +190,7 @@ const y = class y {
|
|
|
183
190
|
* ```
|
|
184
191
|
*/
|
|
185
192
|
get AbsoluteRefType() {
|
|
186
|
-
return
|
|
193
|
+
return G;
|
|
187
194
|
}
|
|
188
195
|
/**
|
|
189
196
|
* Defines different types of Univer instances
|
|
@@ -216,7 +223,7 @@ const y = class y {
|
|
|
216
223
|
* ```
|
|
217
224
|
*/
|
|
218
225
|
get DataValidationType() {
|
|
219
|
-
return
|
|
226
|
+
return J;
|
|
220
227
|
}
|
|
221
228
|
/**
|
|
222
229
|
* Different error display styles
|
|
@@ -227,7 +234,7 @@ const y = class y {
|
|
|
227
234
|
* ```
|
|
228
235
|
*/
|
|
229
236
|
get DataValidationErrorStyle() {
|
|
230
|
-
return
|
|
237
|
+
return K;
|
|
231
238
|
}
|
|
232
239
|
/**
|
|
233
240
|
* Different validation rendering modes
|
|
@@ -238,7 +245,7 @@ const y = class y {
|
|
|
238
245
|
* ```
|
|
239
246
|
*/
|
|
240
247
|
get DataValidationRenderMode() {
|
|
241
|
-
return
|
|
248
|
+
return Q;
|
|
242
249
|
}
|
|
243
250
|
/**
|
|
244
251
|
* Different validation operators
|
|
@@ -249,7 +256,7 @@ const y = class y {
|
|
|
249
256
|
* ```
|
|
250
257
|
*/
|
|
251
258
|
get DataValidationOperator() {
|
|
252
|
-
return
|
|
259
|
+
return X;
|
|
253
260
|
}
|
|
254
261
|
/**
|
|
255
262
|
* Different validation states
|
|
@@ -260,7 +267,7 @@ const y = class y {
|
|
|
260
267
|
* ```
|
|
261
268
|
*/
|
|
262
269
|
get DataValidationStatus() {
|
|
263
|
-
return
|
|
270
|
+
return Y;
|
|
264
271
|
}
|
|
265
272
|
/**
|
|
266
273
|
* Different types of commands
|
|
@@ -271,7 +278,7 @@ const y = class y {
|
|
|
271
278
|
* ```
|
|
272
279
|
*/
|
|
273
280
|
get CommandType() {
|
|
274
|
-
return
|
|
281
|
+
return Z;
|
|
275
282
|
}
|
|
276
283
|
/**
|
|
277
284
|
* Different baseline offsets for text baseline positioning
|
|
@@ -282,7 +289,7 @@ const y = class y {
|
|
|
282
289
|
* ```
|
|
283
290
|
*/
|
|
284
291
|
get BaselineOffset() {
|
|
285
|
-
return
|
|
292
|
+
return k;
|
|
286
293
|
}
|
|
287
294
|
/**
|
|
288
295
|
* Boolean number representations
|
|
@@ -293,7 +300,7 @@ const y = class y {
|
|
|
293
300
|
* ```
|
|
294
301
|
*/
|
|
295
302
|
get BooleanNumber() {
|
|
296
|
-
return
|
|
303
|
+
return ee;
|
|
297
304
|
}
|
|
298
305
|
/**
|
|
299
306
|
* Different horizontal text alignment options
|
|
@@ -304,7 +311,7 @@ const y = class y {
|
|
|
304
311
|
* ```
|
|
305
312
|
*/
|
|
306
313
|
get HorizontalAlign() {
|
|
307
|
-
return
|
|
314
|
+
return te;
|
|
308
315
|
}
|
|
309
316
|
/**
|
|
310
317
|
* Different text decoration styles
|
|
@@ -315,7 +322,7 @@ const y = class y {
|
|
|
315
322
|
* ```
|
|
316
323
|
*/
|
|
317
324
|
get TextDecoration() {
|
|
318
|
-
return
|
|
325
|
+
return re;
|
|
319
326
|
}
|
|
320
327
|
/**
|
|
321
328
|
* Different text direction options
|
|
@@ -326,7 +333,7 @@ const y = class y {
|
|
|
326
333
|
* ```
|
|
327
334
|
*/
|
|
328
335
|
get TextDirection() {
|
|
329
|
-
return
|
|
336
|
+
return ie;
|
|
330
337
|
}
|
|
331
338
|
/**
|
|
332
339
|
* Different vertical text alignment options
|
|
@@ -337,7 +344,7 @@ const y = class y {
|
|
|
337
344
|
* ```
|
|
338
345
|
*/
|
|
339
346
|
get VerticalAlign() {
|
|
340
|
-
return
|
|
347
|
+
return ne;
|
|
341
348
|
}
|
|
342
349
|
/**
|
|
343
350
|
* Different wrap strategy options
|
|
@@ -348,7 +355,7 @@ const y = class y {
|
|
|
348
355
|
* ```
|
|
349
356
|
*/
|
|
350
357
|
get WrapStrategy() {
|
|
351
|
-
return
|
|
358
|
+
return oe;
|
|
352
359
|
}
|
|
353
360
|
/**
|
|
354
361
|
* Different border types
|
|
@@ -359,7 +366,7 @@ const y = class y {
|
|
|
359
366
|
* ```
|
|
360
367
|
*/
|
|
361
368
|
get BorderType() {
|
|
362
|
-
return
|
|
369
|
+
return se;
|
|
363
370
|
}
|
|
364
371
|
/**
|
|
365
372
|
* Different border style types
|
|
@@ -370,7 +377,7 @@ const y = class y {
|
|
|
370
377
|
* ```
|
|
371
378
|
*/
|
|
372
379
|
get BorderStyleTypes() {
|
|
373
|
-
return
|
|
380
|
+
return ce;
|
|
374
381
|
}
|
|
375
382
|
/**
|
|
376
383
|
* Auto fill series types
|
|
@@ -381,7 +388,7 @@ const y = class y {
|
|
|
381
388
|
* ```
|
|
382
389
|
*/
|
|
383
390
|
get AutoFillSeries() {
|
|
384
|
-
return
|
|
391
|
+
return ae;
|
|
385
392
|
}
|
|
386
393
|
/**
|
|
387
394
|
* Color types
|
|
@@ -392,7 +399,7 @@ const y = class y {
|
|
|
392
399
|
* ```
|
|
393
400
|
*/
|
|
394
401
|
get ColorType() {
|
|
395
|
-
return
|
|
402
|
+
return de;
|
|
396
403
|
}
|
|
397
404
|
/**
|
|
398
405
|
* Common hide types
|
|
@@ -403,7 +410,7 @@ const y = class y {
|
|
|
403
410
|
* ```
|
|
404
411
|
*/
|
|
405
412
|
get CommonHideTypes() {
|
|
406
|
-
return
|
|
413
|
+
return le;
|
|
407
414
|
}
|
|
408
415
|
/**
|
|
409
416
|
* Copy paste types
|
|
@@ -414,7 +421,7 @@ const y = class y {
|
|
|
414
421
|
* ```
|
|
415
422
|
*/
|
|
416
423
|
get CopyPasteType() {
|
|
417
|
-
return
|
|
424
|
+
return pe;
|
|
418
425
|
}
|
|
419
426
|
/**
|
|
420
427
|
* Delete direction types
|
|
@@ -425,7 +432,7 @@ const y = class y {
|
|
|
425
432
|
* ```
|
|
426
433
|
*/
|
|
427
434
|
get DeleteDirection() {
|
|
428
|
-
return
|
|
435
|
+
return he;
|
|
429
436
|
}
|
|
430
437
|
/**
|
|
431
438
|
* Developer metadata visibility types
|
|
@@ -436,7 +443,7 @@ const y = class y {
|
|
|
436
443
|
* ```
|
|
437
444
|
*/
|
|
438
445
|
get DeveloperMetadataVisibility() {
|
|
439
|
-
return
|
|
446
|
+
return ue;
|
|
440
447
|
}
|
|
441
448
|
/**
|
|
442
449
|
* Dimension types
|
|
@@ -447,7 +454,7 @@ const y = class y {
|
|
|
447
454
|
* ```
|
|
448
455
|
*/
|
|
449
456
|
get Dimension() {
|
|
450
|
-
return
|
|
457
|
+
return ge;
|
|
451
458
|
}
|
|
452
459
|
/**
|
|
453
460
|
* Direction types
|
|
@@ -458,7 +465,7 @@ const y = class y {
|
|
|
458
465
|
* ```
|
|
459
466
|
*/
|
|
460
467
|
get Direction() {
|
|
461
|
-
return
|
|
468
|
+
return ye;
|
|
462
469
|
}
|
|
463
470
|
/**
|
|
464
471
|
* Interpolation point types
|
|
@@ -469,7 +476,7 @@ const y = class y {
|
|
|
469
476
|
* ```
|
|
470
477
|
*/
|
|
471
478
|
get InterpolationPointType() {
|
|
472
|
-
return
|
|
479
|
+
return ve;
|
|
473
480
|
}
|
|
474
481
|
/**
|
|
475
482
|
* Locale types
|
|
@@ -480,7 +487,7 @@ const y = class y {
|
|
|
480
487
|
* ```
|
|
481
488
|
*/
|
|
482
489
|
get LocaleType() {
|
|
483
|
-
return
|
|
490
|
+
return fe;
|
|
484
491
|
}
|
|
485
492
|
/**
|
|
486
493
|
* Mention types
|
|
@@ -491,7 +498,7 @@ const y = class y {
|
|
|
491
498
|
* ```
|
|
492
499
|
*/
|
|
493
500
|
get MentionType() {
|
|
494
|
-
return
|
|
501
|
+
return _e;
|
|
495
502
|
}
|
|
496
503
|
/**
|
|
497
504
|
* Protection types
|
|
@@ -502,7 +509,7 @@ const y = class y {
|
|
|
502
509
|
* ```
|
|
503
510
|
*/
|
|
504
511
|
get ProtectionType() {
|
|
505
|
-
return
|
|
512
|
+
return me;
|
|
506
513
|
}
|
|
507
514
|
/**
|
|
508
515
|
* Relative date types
|
|
@@ -513,7 +520,7 @@ const y = class y {
|
|
|
513
520
|
* ```
|
|
514
521
|
*/
|
|
515
522
|
get RelativeDate() {
|
|
516
|
-
return
|
|
523
|
+
return Ee;
|
|
517
524
|
}
|
|
518
525
|
/**
|
|
519
526
|
* Sheet types
|
|
@@ -524,7 +531,7 @@ const y = class y {
|
|
|
524
531
|
* ```
|
|
525
532
|
*/
|
|
526
533
|
get SheetTypes() {
|
|
527
|
-
return
|
|
534
|
+
return be;
|
|
528
535
|
}
|
|
529
536
|
/**
|
|
530
537
|
* Theme color types
|
|
@@ -535,14 +542,14 @@ const y = class y {
|
|
|
535
542
|
* ```
|
|
536
543
|
*/
|
|
537
544
|
get ThemeColorType() {
|
|
538
|
-
return
|
|
545
|
+
return Se;
|
|
539
546
|
}
|
|
540
547
|
};
|
|
541
548
|
/**
|
|
542
549
|
* @ignore
|
|
543
550
|
*/
|
|
544
551
|
d(y, "_instance");
|
|
545
|
-
let
|
|
552
|
+
let O = y;
|
|
546
553
|
const v = class v {
|
|
547
554
|
static get() {
|
|
548
555
|
if (this._instance)
|
|
@@ -722,12 +729,12 @@ const v = class v {
|
|
|
722
729
|
* @ignore
|
|
723
730
|
*/
|
|
724
731
|
d(v, "_instance");
|
|
725
|
-
let
|
|
726
|
-
var
|
|
727
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
732
|
+
let j = v;
|
|
733
|
+
var Ne = Object.getOwnPropertyDescriptor, Fe = (i, e, t, r) => {
|
|
734
|
+
for (var n = r > 1 ? void 0 : r ? Ne(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
728
735
|
(s = i[o]) && (n = s(n) || n);
|
|
729
736
|
return n;
|
|
730
|
-
},
|
|
737
|
+
}, L = (i, e) => (t, r) => e(t, r, i);
|
|
731
738
|
let P = class extends $ {
|
|
732
739
|
constructor(i, e) {
|
|
733
740
|
super(), this._injector = i, this._lifecycleService = e;
|
|
@@ -809,31 +816,31 @@ let P = class extends $ {
|
|
|
809
816
|
});
|
|
810
817
|
}
|
|
811
818
|
};
|
|
812
|
-
P =
|
|
813
|
-
|
|
814
|
-
|
|
819
|
+
P = Fe([
|
|
820
|
+
L(0, p(_)),
|
|
821
|
+
L(1, p(V))
|
|
815
822
|
], P);
|
|
816
|
-
var
|
|
817
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
823
|
+
var We = Object.getOwnPropertyDescriptor, qe = (i, e, t, r) => {
|
|
824
|
+
for (var n = r > 1 ? void 0 : r ? We(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
818
825
|
(s = i[o]) && (n = s(n) || n);
|
|
819
826
|
return n;
|
|
820
|
-
},
|
|
821
|
-
let B = class extends
|
|
827
|
+
}, Ge = (i, e) => (t, r) => e(t, r, i);
|
|
828
|
+
let B = class extends $e {
|
|
822
829
|
constructor(i, e) {
|
|
823
830
|
super(e), this.doc = i;
|
|
824
831
|
}
|
|
825
832
|
};
|
|
826
|
-
B =
|
|
827
|
-
|
|
833
|
+
B = qe([
|
|
834
|
+
Ge(1, p(_))
|
|
828
835
|
], B);
|
|
829
|
-
class
|
|
836
|
+
class Je {
|
|
830
837
|
constructor() {
|
|
831
838
|
d(this, "_eventRegistry", /* @__PURE__ */ new Map());
|
|
832
839
|
d(this, "_eventHandlerMap", /* @__PURE__ */ new Map());
|
|
833
840
|
d(this, "_eventHandlerRegisted", /* @__PURE__ */ new Map());
|
|
834
841
|
}
|
|
835
842
|
_ensureEventRegistry(e) {
|
|
836
|
-
return this._eventRegistry.has(e) || this._eventRegistry.set(e, new
|
|
843
|
+
return this._eventRegistry.has(e) || this._eventRegistry.set(e, new Ce()), this._eventRegistry.get(e);
|
|
837
844
|
}
|
|
838
845
|
dispose() {
|
|
839
846
|
this._eventRegistry.clear(), this._eventHandlerMap.clear(), this._eventHandlerRegisted.forEach((e) => {
|
|
@@ -894,11 +901,11 @@ class Ge {
|
|
|
894
901
|
}), t.cancel;
|
|
895
902
|
}
|
|
896
903
|
}
|
|
897
|
-
var
|
|
898
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
904
|
+
var Ke = Object.getOwnPropertyDescriptor, Qe = (i, e, t, r) => {
|
|
905
|
+
for (var n = r > 1 ? void 0 : r ? Ke(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
899
906
|
(s = i[o]) && (n = s(n) || n);
|
|
900
907
|
return n;
|
|
901
|
-
},
|
|
908
|
+
}, N = (i, e) => (t, r) => e(t, r, i);
|
|
902
909
|
let H = class extends $ {
|
|
903
910
|
constructor(i, e) {
|
|
904
911
|
super(), this._injector = i, this._userManagerService = e;
|
|
@@ -915,15 +922,15 @@ let H = class extends $ {
|
|
|
915
922
|
return this._userManagerService.getCurrentUser();
|
|
916
923
|
}
|
|
917
924
|
};
|
|
918
|
-
H =
|
|
919
|
-
|
|
920
|
-
|
|
925
|
+
H = Qe([
|
|
926
|
+
N(0, p(_)),
|
|
927
|
+
N(1, p(De))
|
|
921
928
|
], H);
|
|
922
|
-
const
|
|
929
|
+
const x = class x {
|
|
923
930
|
static get() {
|
|
924
931
|
if (this._instance)
|
|
925
932
|
return this._instance;
|
|
926
|
-
const e = new
|
|
933
|
+
const e = new x();
|
|
927
934
|
return this._instance = e, e;
|
|
928
935
|
}
|
|
929
936
|
/**
|
|
@@ -950,7 +957,7 @@ const D = class D {
|
|
|
950
957
|
* ```
|
|
951
958
|
*/
|
|
952
959
|
get rectangle() {
|
|
953
|
-
return
|
|
960
|
+
return xe;
|
|
954
961
|
}
|
|
955
962
|
/**
|
|
956
963
|
* Number format utils, including parse and strigify about date, price, etc
|
|
@@ -962,7 +969,7 @@ const D = class D {
|
|
|
962
969
|
* ```
|
|
963
970
|
*/
|
|
964
971
|
get numfmt() {
|
|
965
|
-
return
|
|
972
|
+
return Te;
|
|
966
973
|
}
|
|
967
974
|
/**
|
|
968
975
|
* common tools
|
|
@@ -974,24 +981,24 @@ const D = class D {
|
|
|
974
981
|
* ```
|
|
975
982
|
*/
|
|
976
983
|
get tools() {
|
|
977
|
-
return
|
|
984
|
+
return we;
|
|
978
985
|
}
|
|
979
986
|
};
|
|
980
987
|
/**
|
|
981
988
|
* @ignore
|
|
982
989
|
*/
|
|
983
|
-
d(
|
|
984
|
-
let U =
|
|
985
|
-
var
|
|
986
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
990
|
+
d(x, "_instance");
|
|
991
|
+
let U = x;
|
|
992
|
+
var Xe = Object.getOwnPropertyDescriptor, Ye = (i, e, t, r) => {
|
|
993
|
+
for (var n = r > 1 ? void 0 : r ? Xe(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
987
994
|
(s = i[o]) && (n = s(n) || n);
|
|
988
995
|
return n;
|
|
989
|
-
},
|
|
996
|
+
}, C = (i, e) => (t, r) => e(t, r, i);
|
|
990
997
|
const w = Symbol("initializers");
|
|
991
|
-
let
|
|
998
|
+
let I = class extends M {
|
|
992
999
|
constructor(e, t, r, n) {
|
|
993
1000
|
super();
|
|
994
|
-
d(this, "_eventRegistry", new
|
|
1001
|
+
d(this, "_eventRegistry", new Je());
|
|
995
1002
|
d(this, "registerEventHandler", (e, t) => this._eventRegistry.registerEventHandler(e, t));
|
|
996
1003
|
this._injector = e, this._commandService = t, this._univerInstanceService = r, this._lifecycleService = n, this.registerEventHandler(
|
|
997
1004
|
this.Event.LifeCycleChanged,
|
|
@@ -1023,7 +1030,7 @@ let M = class extends V {
|
|
|
1023
1030
|
* ```
|
|
1024
1031
|
*/
|
|
1025
1032
|
static newAPI(e) {
|
|
1026
|
-
return (e instanceof
|
|
1033
|
+
return (e instanceof Re ? e.__getInjector() : e).createInstance(I);
|
|
1027
1034
|
}
|
|
1028
1035
|
/**
|
|
1029
1036
|
* @ignore
|
|
@@ -1083,7 +1090,7 @@ let M = class extends V {
|
|
|
1083
1090
|
if (r.id === u.id) {
|
|
1084
1091
|
const a = { id: n, type: o, params: s };
|
|
1085
1092
|
if (this.fireEvent(this.Event.BeforeRedo, a), a.cancel)
|
|
1086
|
-
throw new
|
|
1093
|
+
throw new T();
|
|
1087
1094
|
}
|
|
1088
1095
|
})
|
|
1089
1096
|
), this.registerEventHandler(
|
|
@@ -1093,7 +1100,7 @@ let M = class extends V {
|
|
|
1093
1100
|
if (r.id === h.id) {
|
|
1094
1101
|
const a = { id: n, type: o, params: s };
|
|
1095
1102
|
if (this.fireEvent(this.Event.BeforeUndo, a), a.cancel)
|
|
1096
|
-
throw new
|
|
1103
|
+
throw new T();
|
|
1097
1104
|
}
|
|
1098
1105
|
})
|
|
1099
1106
|
), this.registerEventHandler(
|
|
@@ -1103,13 +1110,13 @@ let M = class extends V {
|
|
|
1103
1110
|
if (r.id !== u.id && r.id !== h.id) {
|
|
1104
1111
|
const m = { id: o, type: s, params: c, options: n };
|
|
1105
1112
|
if (this.fireEvent(this.Event.BeforeCommandExecute, m), m.cancel)
|
|
1106
|
-
throw new
|
|
1113
|
+
throw new T();
|
|
1107
1114
|
}
|
|
1108
1115
|
})
|
|
1109
1116
|
);
|
|
1110
1117
|
}
|
|
1111
1118
|
_initUnitEvent(e) {
|
|
1112
|
-
const t = e.get(
|
|
1119
|
+
const t = e.get(F);
|
|
1113
1120
|
this.registerEventHandler(
|
|
1114
1121
|
this.Event.DocDisposed,
|
|
1115
1122
|
() => t.unitDisposed$.subscribe((r) => {
|
|
@@ -1164,7 +1171,7 @@ let M = class extends V {
|
|
|
1164
1171
|
* ```
|
|
1165
1172
|
*/
|
|
1166
1173
|
getCurrentLifecycleStage() {
|
|
1167
|
-
return this._injector.get(
|
|
1174
|
+
return this._injector.get(V).stage;
|
|
1168
1175
|
}
|
|
1169
1176
|
/**
|
|
1170
1177
|
* Undo an editing on the currently focused document.
|
|
@@ -1199,7 +1206,7 @@ let M = class extends V {
|
|
|
1199
1206
|
* ```
|
|
1200
1207
|
*/
|
|
1201
1208
|
toggleDarkMode(e) {
|
|
1202
|
-
this._injector.get(
|
|
1209
|
+
this._injector.get(Oe).setDarkMode(e);
|
|
1203
1210
|
}
|
|
1204
1211
|
/**
|
|
1205
1212
|
* Load locales for the given locale.
|
|
@@ -1294,10 +1301,10 @@ let M = class extends V {
|
|
|
1294
1301
|
return this._injector.createInstance(P);
|
|
1295
1302
|
}
|
|
1296
1303
|
get Enum() {
|
|
1297
|
-
return
|
|
1304
|
+
return O.get();
|
|
1298
1305
|
}
|
|
1299
1306
|
get Event() {
|
|
1300
|
-
return
|
|
1307
|
+
return j.get();
|
|
1301
1308
|
}
|
|
1302
1309
|
get Util() {
|
|
1303
1310
|
return U.get();
|
|
@@ -1347,7 +1354,7 @@ let M = class extends V {
|
|
|
1347
1354
|
* ```
|
|
1348
1355
|
*/
|
|
1349
1356
|
newBlob() {
|
|
1350
|
-
return this._injector.createInstance(
|
|
1357
|
+
return this._injector.createInstance(D);
|
|
1351
1358
|
}
|
|
1352
1359
|
/**
|
|
1353
1360
|
* Create a new color.
|
|
@@ -1373,7 +1380,7 @@ let M = class extends V {
|
|
|
1373
1380
|
* ```
|
|
1374
1381
|
*/
|
|
1375
1382
|
newRichText(e) {
|
|
1376
|
-
return
|
|
1383
|
+
return Pe.create(e);
|
|
1377
1384
|
}
|
|
1378
1385
|
/**
|
|
1379
1386
|
* Create a new rich text value.
|
|
@@ -1387,7 +1394,7 @@ let M = class extends V {
|
|
|
1387
1394
|
* ```
|
|
1388
1395
|
*/
|
|
1389
1396
|
newRichTextValue(e) {
|
|
1390
|
-
return
|
|
1397
|
+
return Be.create(e);
|
|
1391
1398
|
}
|
|
1392
1399
|
/**
|
|
1393
1400
|
* Create a new paragraph style.
|
|
@@ -1403,7 +1410,7 @@ let M = class extends V {
|
|
|
1403
1410
|
* ```
|
|
1404
1411
|
*/
|
|
1405
1412
|
newParagraphStyle(e) {
|
|
1406
|
-
return
|
|
1413
|
+
return He.create(e);
|
|
1407
1414
|
}
|
|
1408
1415
|
/**
|
|
1409
1416
|
* Create a new paragraph style value.
|
|
@@ -1415,7 +1422,7 @@ let M = class extends V {
|
|
|
1415
1422
|
* ```
|
|
1416
1423
|
*/
|
|
1417
1424
|
newParagraphStyleValue(e) {
|
|
1418
|
-
return
|
|
1425
|
+
return Ue.create(e);
|
|
1419
1426
|
}
|
|
1420
1427
|
/**
|
|
1421
1428
|
* Create a new text style.
|
|
@@ -1427,7 +1434,7 @@ let M = class extends V {
|
|
|
1427
1434
|
* ```
|
|
1428
1435
|
*/
|
|
1429
1436
|
newTextStyle(e) {
|
|
1430
|
-
return
|
|
1437
|
+
return Ie.create(e);
|
|
1431
1438
|
}
|
|
1432
1439
|
/**
|
|
1433
1440
|
* Create a new text style value.
|
|
@@ -1454,19 +1461,19 @@ let M = class extends V {
|
|
|
1454
1461
|
return new Ve(e);
|
|
1455
1462
|
}
|
|
1456
1463
|
};
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
],
|
|
1464
|
+
I = Ye([
|
|
1465
|
+
C(0, p(_)),
|
|
1466
|
+
C(1, g),
|
|
1467
|
+
C(2, F),
|
|
1468
|
+
C(3, p(V))
|
|
1469
|
+
], I);
|
|
1463
1470
|
export {
|
|
1464
1471
|
$ as FBase,
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1472
|
+
$e as FBaseInitialable,
|
|
1473
|
+
D as FBlob,
|
|
1474
|
+
O as FEnum,
|
|
1475
|
+
j as FEventName,
|
|
1469
1476
|
P as FHooks,
|
|
1470
|
-
|
|
1477
|
+
I as FUniver,
|
|
1471
1478
|
U as FUtil
|
|
1472
1479
|
};
|