@univerjs/core 0.10.11 → 0.10.12
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/index.js
CHANGED
|
@@ -1342,7 +1342,7 @@ class d1 extends Ve {
|
|
|
1342
1342
|
this._ref -= 1, this._ref === 0 && (this._rootDisposable.dispose(), this.dispose());
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
1345
|
-
var
|
|
1345
|
+
var we = /* @__PURE__ */ ((e) => (e[e.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", e[e.UNIVER_DOC = 1] = "UNIVER_DOC", e[e.UNIVER_SHEET = 2] = "UNIVER_SHEET", e[e.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", e[e.UNIVER_PROJECT = 4] = "UNIVER_PROJECT", e[e.UNRECOGNIZED = -1] = "UNRECOGNIZED", e))(we || {}), xt = /* @__PURE__ */ ((e) => (e[e.Reader = 0] = "Reader", e[e.Editor = 1] = "Editor", e[e.Owner = 2] = "Owner", e[e.UNRECOGNIZED = -1] = "UNRECOGNIZED", e))(xt || {}), Ri = /* @__PURE__ */ ((e) => (e[e.SomeCollaborator = 0] = "SomeCollaborator", e[e.AllCollaborator = 1] = "AllCollaborator", e[e.OneSelf = 2] = "OneSelf", e[e.UNRECOGNIZED = -1] = "UNRECOGNIZED", e))(Ri || {});
|
|
1346
1346
|
class lo extends Ve {
|
|
1347
1347
|
}
|
|
1348
1348
|
const tm = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
@@ -3090,11 +3090,11 @@ function ug() {
|
|
|
3090
3090
|
C(Qe, ue, ze), de.add(ve);
|
|
3091
3091
|
} else ue ? C(Qe, ue, w(Fe)) : re && (C(Qe, re, w(ve)), de.add(ve));
|
|
3092
3092
|
const he = typeof ae == "object" && ae != null;
|
|
3093
|
-
let
|
|
3093
|
+
let Oe = !1, Se = 0, be = 0, Ye = 0, Be = 0, $e = 0;
|
|
3094
3094
|
const Ze = s.advancer(Re, (se, Ce) => h(Ce) ? Be - se - 1 : se - Be, (se, Ce) => {
|
|
3095
3095
|
h(Ce) && Be++;
|
|
3096
|
-
}), Ie = s.advancer(ce, (se, Ce) => c(Ce) ?
|
|
3097
|
-
c(Ce) &&
|
|
3096
|
+
}), Ie = s.advancer(ce, (se, Ce) => c(Ce) ? Se - se - 1 : se - Se, (se, Ce) => {
|
|
3097
|
+
c(Ce) && Se++;
|
|
3098
3098
|
});
|
|
3099
3099
|
if (s.eachChildOf(Me, Ae, (se, Ce, ze) => {
|
|
3100
3100
|
let nt, Bt, sn = se, wt = se, Xn = se;
|
|
@@ -3102,14 +3102,14 @@ function ug() {
|
|
|
3102
3102
|
let Ke = se + Ye;
|
|
3103
3103
|
Bt = Ze(Ke), wt = Ke + Be;
|
|
3104
3104
|
let He = se + be;
|
|
3105
|
-
nt = Ie(He), h(a(Bt)) && (nt = null), sn = He +
|
|
3105
|
+
nt = Ie(He), h(a(Bt)) && (nt = null), sn = He + Se, Xn = se + $e, o(sn >= 0, "p1PickKey is negative"), o(wt >= 0, "p2DropKey is negative");
|
|
3106
3106
|
const St = h(a(Ce)), jt = c(a(ze));
|
|
3107
3107
|
(St || jt && !Ht) && $e--, St && be--, jt && Ye--;
|
|
3108
3108
|
} else nt = Ie(se), Bt = Ze(se);
|
|
3109
3109
|
Ge.descend(sn), Qe.descend(wt);
|
|
3110
3110
|
const Rn = he && !h(a(Ce)) ? ae[Xn] : void 0, Tt = K(nt, Ce, ze, Bt, Rn, Ht, Qe, Ge);
|
|
3111
3111
|
var Mt, fe, De;
|
|
3112
|
-
he && !Ht ? Rn !== Tt && (
|
|
3112
|
+
he && !Ht ? Rn !== Tt && (Oe || (ae = Array.isArray(ae) ? ae.slice() : Object.assign({}, ae), Oe = !0), Mt = ae, De = Tt, typeof (fe = Xn) == "number" ? (o(Array.isArray(Mt)), o(fe < Mt.length)) : (o(!Array.isArray(Mt)), o(Mt[fe] !== void 0)), De === void 0 ? typeof fe == "number" ? Mt.splice(fe, 1) : delete Mt[fe] : Mt[fe] = De) : o(Tt === void 0), Qe.ascend(), Ge.ascend();
|
|
3113
3113
|
}), Ie.end(), Ze.end(), Ee != null) Ee.i = ae;
|
|
3114
3114
|
else if (!$t && !It && at == null) return ae;
|
|
3115
3115
|
})(z, z.clone(), B, B.clone(), void 0, !1, j, _e), j.reset(), j.mergeTree(_e.get()), j.reset(), j.get(), Q.map((K) => K.get()), ee.map((K) => K.get()), z.traverse(j, (K, ce) => {
|
|
@@ -3264,30 +3264,30 @@ function ug() {
|
|
|
3264
3264
|
const re = a(Ee);
|
|
3265
3265
|
re && (re.r !== void 0 ? ue = Ee.clone() : re.p != null && (ue = null, X[re.p] = ae.clone()));
|
|
3266
3266
|
const he = ae.getComponent();
|
|
3267
|
-
let
|
|
3268
|
-
he && (
|
|
3269
|
-
const
|
|
3270
|
-
for (const be of ae) ve(ae,
|
|
3271
|
-
|
|
3267
|
+
let Oe;
|
|
3268
|
+
he && (Oe = he.p) != null && (G[Oe] = Ee ? Ee.clone() : null, ee[Oe] = ae.clone(), ue && (K[Oe] = !0, _e[Oe] = ue), re && re.p != null && (Re[Oe] = re.p));
|
|
3269
|
+
const Se = s.advancer(Ee);
|
|
3270
|
+
for (const be of ae) ve(ae, Se(be), ue);
|
|
3271
|
+
Se.end();
|
|
3272
3272
|
})(Ge, Qe, null), (function ve(ae, Ee, ue, re, he) {
|
|
3273
|
-
const
|
|
3274
|
-
let
|
|
3275
|
-
|
|
3273
|
+
const Oe = ue.getComponent();
|
|
3274
|
+
let Se, be = !1;
|
|
3275
|
+
Oe && ((Se = Oe.d) != null ? (U[Se] = ue.clone(), re != null && (Pe[re] == null && (Pe[re] = []), Pe[re].push(Se)), K[Se], ae = G[Se] || null, Ee = ee[Se] || null, K[Se] ? (he && (ce[Se] = !0), he = _e[Se] || null) : !he || z !== 1 && Re[Se] != null || B == null && (B = {
|
|
3276
3276
|
type: i.ConflictType.RM_UNEXPECTED_CONTENT,
|
|
3277
3277
|
op1: e.removeOp(he.getPath()),
|
|
3278
3278
|
op2: e.moveOp(Ee.getPath(), ue.getPath())
|
|
3279
|
-
}), be = !0) :
|
|
3279
|
+
}), be = !0) : Oe.i !== void 0 && (ae = Ee = null, be = !0, he && B == null && (B = {
|
|
3280
3280
|
type: i.ConflictType.RM_UNEXPECTED_CONTENT,
|
|
3281
3281
|
op1: e.removeOp(he.getPath()),
|
|
3282
|
-
op2: e.insertOp(ue.getPath(),
|
|
3282
|
+
op2: e.insertOp(ue.getPath(), Oe.i)
|
|
3283
3283
|
})));
|
|
3284
3284
|
const Ye = a(ae);
|
|
3285
3285
|
Ye && (Ye.r !== void 0 ? he = ae.clone() : Ye.p != null && (Ye.p, re = Ye.p, he = null));
|
|
3286
|
-
const Be = W(
|
|
3286
|
+
const Be = W(Oe);
|
|
3287
3287
|
Be && he && B == null && (B = {
|
|
3288
3288
|
type: i.ConflictType.RM_UNEXPECTED_CONTENT,
|
|
3289
3289
|
op1: e.removeOp(he.getPath()),
|
|
3290
|
-
op2: e.editOp(ue.getPath(), Be, w(
|
|
3290
|
+
op2: e.editOp(ue.getPath(), Be, w(Oe), !0)
|
|
3291
3291
|
});
|
|
3292
3292
|
let $e = 0, Ze = 0;
|
|
3293
3293
|
const Ie = s.advancer(Ee, (Ce, ze) => c(ze) ? $e - Ce - 1 : Ce - $e, (Ce, ze) => {
|
|
@@ -3309,16 +3309,16 @@ function ug() {
|
|
|
3309
3309
|
const dt = [];
|
|
3310
3310
|
let It = null;
|
|
3311
3311
|
(function ve(ae, Ee, ue, re, he) {
|
|
3312
|
-
let
|
|
3313
|
-
const
|
|
3314
|
-
if (c(
|
|
3315
|
-
const Ie =
|
|
3316
|
-
Ie != null ? (ue = U[Ie], re = Me[Ie] = s.writeCursor(),
|
|
3312
|
+
let Oe = !1;
|
|
3313
|
+
const Se = a(Ee);
|
|
3314
|
+
if (c(Se)) {
|
|
3315
|
+
const Ie = Se.p;
|
|
3316
|
+
Ie != null ? (ue = U[Ie], re = Me[Ie] = s.writeCursor(), Oe = !0, he = null) : (ue = null, he = Ee.clone());
|
|
3317
3317
|
} else h(a(ue)) && (ue = null);
|
|
3318
3318
|
const be = ae.getComponent();
|
|
3319
3319
|
if (be) {
|
|
3320
3320
|
const Ie = be.p;
|
|
3321
|
-
Ie != null ? (he && (de[Ie] = he), dt[Ie] = he || z === 1 &&
|
|
3321
|
+
Ie != null ? (he && (de[Ie] = he), dt[Ie] = he || z === 1 && Oe ? null : re.getComponent(), j[Ie] = ae.clone(), ue && (ne[Ie] = ue.clone())) : be.r !== void 0 && (he || re.write("r", !0), (he || Oe) && (It == null && (It = /* @__PURE__ */ new Set()), It.add(be)));
|
|
3322
3322
|
}
|
|
3323
3323
|
let Ye = 0, Be = 0;
|
|
3324
3324
|
const $e = s.advancer(Ee, void 0, (Ie, se) => {
|
|
@@ -3336,46 +3336,46 @@ function ug() {
|
|
|
3336
3336
|
$e.end(), Ze.end();
|
|
3337
3337
|
})(Qe, Ge, Ge.clone(), Fe, null), Fe.reset();
|
|
3338
3338
|
let rn = [];
|
|
3339
|
-
if ((function ve(ae, Ee, ue, re, he,
|
|
3339
|
+
if ((function ve(ae, Ee, ue, re, he, Oe) {
|
|
3340
3340
|
o(Ee);
|
|
3341
|
-
const
|
|
3341
|
+
const Se = Ee.getComponent();
|
|
3342
3342
|
let be = a(re), Ye = !1;
|
|
3343
3343
|
const Be = (fe, De, Ke) => fe ? e.moveOp(fe.getPath(), De.getPath()) : e.insertOp(De.getPath(), Ke.i);
|
|
3344
|
-
if (h(
|
|
3345
|
-
const fe =
|
|
3344
|
+
if (h(Se)) {
|
|
3345
|
+
const fe = Se.d;
|
|
3346
3346
|
fe != null && (Q[fe] = Ee.clone());
|
|
3347
3347
|
const De = fe != null ? dt[fe] : null;
|
|
3348
3348
|
let Ke = !1;
|
|
3349
|
-
if (
|
|
3349
|
+
if (Se.i !== void 0 || fe != null && De) {
|
|
3350
3350
|
let He;
|
|
3351
|
-
be && (be.i !== void 0 || (He = be.d) != null && !K[He]) && (Ke = He != null ? fe != null && fe === Re[He] : n.default(be.i,
|
|
3351
|
+
be && (be.i !== void 0 || (He = be.d) != null && !K[He]) && (Ke = He != null ? fe != null && fe === Re[He] : n.default(be.i, Se.i), Ke || He != null && z !== 1 && Re[He] != null || B == null && (B = {
|
|
3352
3352
|
type: i.ConflictType.DROP_COLLISION,
|
|
3353
|
-
op1: Be(fe != null ? j[fe] : null, Ee,
|
|
3353
|
+
op1: Be(fe != null ? j[fe] : null, Ee, Se),
|
|
3354
3354
|
op2: Be(He != null ? ee[He] : null, re, be)
|
|
3355
|
-
})), Ke || (
|
|
3355
|
+
})), Ke || (Oe ? B == null && (B = {
|
|
3356
3356
|
type: i.ConflictType.RM_UNEXPECTED_CONTENT,
|
|
3357
|
-
op1: Be(fe != null ? j[fe] : null, Ee,
|
|
3358
|
-
op2: e.removeOp(
|
|
3359
|
-
}) : (fe != null ? (rn[$t] = fe, he.write("d", De.p = $t++)) : he.write("i", r.default(
|
|
3357
|
+
op1: Be(fe != null ? j[fe] : null, Ee, Se),
|
|
3358
|
+
op2: e.removeOp(Oe.getPath())
|
|
3359
|
+
}) : (fe != null ? (rn[$t] = fe, he.write("d", De.p = $t++)) : he.write("i", r.default(Se.i)), Ye = !0));
|
|
3360
3360
|
} else if (fe != null && !De) {
|
|
3361
3361
|
const He = de[fe];
|
|
3362
|
-
He && (
|
|
3362
|
+
He && (Oe = He.clone());
|
|
3363
3363
|
}
|
|
3364
|
-
fe != null ? (ae = j[fe], ue = X[fe], re = ne[fe]) :
|
|
3364
|
+
fe != null ? (ae = j[fe], ue = X[fe], re = ne[fe]) : Se.i !== void 0 && (ae = ue = null, Ke || (re = null));
|
|
3365
3365
|
} else c(a(ae)) && (ae = ue = re = null);
|
|
3366
3366
|
const $e = a(ae), Ze = a(ue);
|
|
3367
3367
|
if (c(Ze)) {
|
|
3368
3368
|
const fe = Ze.p;
|
|
3369
|
-
Ze.r !== void 0 && (!$e || $e.r === void 0) || K[fe] ? (re = null,
|
|
3370
|
-
} else !h(
|
|
3369
|
+
Ze.r !== void 0 && (!$e || $e.r === void 0) || K[fe] ? (re = null, Oe = ue.clone()) : fe != null && (re = U[fe], z !== 1 && Re[fe] != null || ((he = Ae[fe]) || (he = Ae[fe] = s.writeCursor()), he.reset(), Oe = null));
|
|
3370
|
+
} else !h(Se) && h(be) && (re = null);
|
|
3371
3371
|
be = re != null ? re.getComponent() : null;
|
|
3372
|
-
const Ie = W(
|
|
3372
|
+
const Ie = W(Se);
|
|
3373
3373
|
if (Ie) {
|
|
3374
|
-
const fe = w(
|
|
3375
|
-
if (
|
|
3374
|
+
const fe = w(Se);
|
|
3375
|
+
if (Oe) B == null && (B = {
|
|
3376
3376
|
type: i.ConflictType.RM_UNEXPECTED_CONTENT,
|
|
3377
3377
|
op1: e.editOp(Ee.getPath(), Ie, fe, !0),
|
|
3378
|
-
op2: e.removeOp(
|
|
3378
|
+
op2: e.removeOp(Oe.getPath())
|
|
3379
3379
|
});
|
|
3380
3380
|
else {
|
|
3381
3381
|
const De = W(be);
|
|
@@ -3443,7 +3443,7 @@ function ug() {
|
|
|
3443
3443
|
}
|
|
3444
3444
|
}
|
|
3445
3445
|
const ta = js + nt + Bt + sn;
|
|
3446
|
-
o(ta >= 0, "trying to descend to a negative index"), he.descend(ta), Ke && (De = jt = Tr = null, Ce++), ve(De, Ee, jt, Tr, he,
|
|
3446
|
+
o(ta >= 0, "trying to descend to a negative index"), he.descend(ta), Ke && (De = jt = Tr = null, Ce++), ve(De, Ee, jt, Tr, he, Oe) && sn++, he.ascend();
|
|
3447
3447
|
} else {
|
|
3448
3448
|
let De;
|
|
3449
3449
|
for (; wt && (De = ae.getKey(), typeof De != "string" || !(De > fe || De === fe)); ) wt = ae.nextSibling();
|
|
@@ -3451,7 +3451,7 @@ function ug() {
|
|
|
3451
3451
|
let St;
|
|
3452
3452
|
for (; Tt && (St = re.getKey(), typeof St != "string" || !(St > fe || St === fe)); ) Tt = re.nextSibling();
|
|
3453
3453
|
const jt = Tt && St === fe ? re : null;
|
|
3454
|
-
he.descend(fe), ve(Ke, Ee, He, jt, he,
|
|
3454
|
+
he.descend(fe), ve(Ke, Ee, He, jt, he, Oe), he.ascend();
|
|
3455
3455
|
}
|
|
3456
3456
|
return Rn.end(), Xn && ae.ascend(), Mt && re.ascend(), Ye;
|
|
3457
3457
|
})(Qe, Qe.clone(), Ge, Ge.clone(), Fe, null), B) return {
|
|
@@ -3474,7 +3474,7 @@ function ug() {
|
|
|
3474
3474
|
ae && ft(s.readCursor(ae.get()), null, (Ee, ue) => {
|
|
3475
3475
|
at[Ee] = ue.clone();
|
|
3476
3476
|
});
|
|
3477
|
-
}), (function ae(Ee, ue, re, he,
|
|
3477
|
+
}), (function ae(Ee, ue, re, he, Oe, Se) {
|
|
3478
3478
|
const be = a(ue);
|
|
3479
3479
|
if (be && c(be)) if (be.p != null) {
|
|
3480
3480
|
const se = be.p;
|
|
@@ -3507,18 +3507,18 @@ function ug() {
|
|
|
3507
3507
|
if (Fe.get(), Ht.length) {
|
|
3508
3508
|
const ae = Ht.map((ue) => ue ? ue.get() : null), Ee = s.readCursor(M(Fe.get()));
|
|
3509
3509
|
if (ft(Ee, Fe, (ue, re, he) => {
|
|
3510
|
-
const
|
|
3511
|
-
|
|
3510
|
+
const Oe = ae[ue];
|
|
3511
|
+
Oe && (he.mergeTree(Oe), ae[ue] = null);
|
|
3512
3512
|
}), ae.find((ue) => ue)) {
|
|
3513
3513
|
const ue = s.writeCursor(), re = s.writeCursor();
|
|
3514
|
-
let he = 0,
|
|
3515
|
-
ae.forEach((
|
|
3516
|
-
|
|
3514
|
+
let he = 0, Oe = 0;
|
|
3515
|
+
ae.forEach((Se) => {
|
|
3516
|
+
Se != null && ft(s.readCursor(Se), null, (be) => {
|
|
3517
3517
|
const Ye = rn[be];
|
|
3518
3518
|
ue.writeMove(j[Ye].getPath(), Q[Ye].getPath(), he++);
|
|
3519
3519
|
const Be = Pe[Ye];
|
|
3520
3520
|
Be && Be.forEach(($e) => {
|
|
3521
|
-
K[$e] || z !== 1 && Re[$e] != null || re.writeMove(ee[$e].getPath(), U[$e].getPath(),
|
|
3521
|
+
K[$e] || z !== 1 && Re[$e] != null || re.writeMove(ee[$e].getPath(), U[$e].getPath(), Oe++);
|
|
3522
3522
|
});
|
|
3523
3523
|
});
|
|
3524
3524
|
}), B = {
|
|
@@ -12364,7 +12364,7 @@ class x0 extends lo {
|
|
|
12364
12364
|
constructor(n) {
|
|
12365
12365
|
var r;
|
|
12366
12366
|
super();
|
|
12367
|
-
p(this, "type",
|
|
12367
|
+
p(this, "type", we.UNIVER_DOC);
|
|
12368
12368
|
p(this, "_name$", new tt(""));
|
|
12369
12369
|
p(this, "name$", this._name$.asObservable());
|
|
12370
12370
|
p(this, "snapshot");
|
|
@@ -15473,7 +15473,7 @@ let ji = class {
|
|
|
15473
15473
|
},
|
|
15474
15474
|
parseJson: (e) => JSON.parse(e),
|
|
15475
15475
|
pluginName: "SHEET_AuthzIoMockService_PLUGIN",
|
|
15476
|
-
businesses: [
|
|
15476
|
+
businesses: [we.UNIVER_SHEET, we.UNIVER_DOC, we.UNIVER_SLIDE],
|
|
15477
15477
|
onLoad: (e, t) => {
|
|
15478
15478
|
for (const n in t)
|
|
15479
15479
|
this._permissionMap.set(n, t[n]);
|
|
@@ -15640,7 +15640,7 @@ class _E extends Ve {
|
|
|
15640
15640
|
}
|
|
15641
15641
|
}
|
|
15642
15642
|
var ic = /* @__PURE__ */ ((e) => (e.URL = "URL", e.UUID = "UUID", e.BASE64 = "BASE64", e))(ic || {}), pE = /* @__PURE__ */ ((e) => (e.SUCCUSS = "0", e.ERROR_EXCEED_SIZE = "1", e.ERROR_IMAGE_TYPE = "2", e.ERROR_UPLOAD_COUNT_LIMIT = "3", e.ERROR_IMAGE = "4", e))(pE || {});
|
|
15643
|
-
const El = ht("core.image-io.service"), EE = "0.10.
|
|
15643
|
+
const El = ht("core.image-io.service"), EE = "0.10.12", CE = {
|
|
15644
15644
|
version: EE
|
|
15645
15645
|
};
|
|
15646
15646
|
function RE(e = "", t = Ns.ZH_CN, n = "") {
|
|
@@ -17306,7 +17306,7 @@ function KR(e, t) {
|
|
|
17306
17306
|
let ws = class extends lo {
|
|
17307
17307
|
constructor(t = {}, n) {
|
|
17308
17308
|
super();
|
|
17309
|
-
p(this, "type",
|
|
17309
|
+
p(this, "type", we.UNIVER_SHEET);
|
|
17310
17310
|
p(this, "_sheetCreated$", new ot());
|
|
17311
17311
|
p(this, "sheetCreated$", this._sheetCreated$.asObservable());
|
|
17312
17312
|
p(this, "_sheetDisposed$", new ot());
|
|
@@ -17575,7 +17575,7 @@ class ac extends lo {
|
|
|
17575
17575
|
constructor(n) {
|
|
17576
17576
|
var r;
|
|
17577
17577
|
super();
|
|
17578
|
-
p(this, "type",
|
|
17578
|
+
p(this, "type", we.UNIVER_SLIDE);
|
|
17579
17579
|
p(this, "_activePage$", new tt(null));
|
|
17580
17580
|
p(this, "activePage$", this._activePage$.asObservable());
|
|
17581
17581
|
p(this, "_name$");
|
|
@@ -17748,20 +17748,20 @@ let Yi = class extends Ve {
|
|
|
17748
17748
|
return n && (r == null ? void 0 : r.type) !== n ? null : r;
|
|
17749
17749
|
}
|
|
17750
17750
|
getCurrentUniverDocInstance() {
|
|
17751
|
-
return this.getCurrentUnitForType(
|
|
17751
|
+
return this.getCurrentUnitForType(we.UNIVER_DOC);
|
|
17752
17752
|
}
|
|
17753
17753
|
getUniverDocInstance(t) {
|
|
17754
|
-
return this.getUnit(t,
|
|
17754
|
+
return this.getUnit(t, we.UNIVER_DOC);
|
|
17755
17755
|
}
|
|
17756
17756
|
getUniverSheetInstance(t) {
|
|
17757
|
-
return this.getUnit(t,
|
|
17757
|
+
return this.getUnit(t, we.UNIVER_SHEET);
|
|
17758
17758
|
}
|
|
17759
17759
|
getAllUnitsForType(t) {
|
|
17760
17760
|
var n;
|
|
17761
17761
|
return (n = this._unitsByType.get(t)) != null ? n : [];
|
|
17762
17762
|
}
|
|
17763
17763
|
changeDoc(t, n) {
|
|
17764
|
-
const r = this.getAllUnitsForType(
|
|
17764
|
+
const r = this.getAllUnitsForType(we.UNIVER_DOC), s = r.find((i) => i.getUnitId() === t);
|
|
17765
17765
|
if (s != null) {
|
|
17766
17766
|
const i = r.indexOf(s);
|
|
17767
17767
|
r.splice(i, 1);
|
|
@@ -17781,7 +17781,7 @@ let Yi = class extends Ve {
|
|
|
17781
17781
|
}
|
|
17782
17782
|
getUnitType(t) {
|
|
17783
17783
|
const n = this._getUnitById(t);
|
|
17784
|
-
return n ? n[1] :
|
|
17784
|
+
return n ? n[1] : we.UNRECOGNIZED;
|
|
17785
17785
|
}
|
|
17786
17786
|
disposeUnit(t) {
|
|
17787
17787
|
const n = this._getUnitById(t);
|
|
@@ -18121,7 +18121,7 @@ class Ol extends Ve {
|
|
|
18121
18121
|
return this.constructor.pluginName;
|
|
18122
18122
|
}
|
|
18123
18123
|
}
|
|
18124
|
-
p(Ol, "pluginName"), p(Ol, "type",
|
|
18124
|
+
p(Ol, "pluginName"), p(Ol, "type", we.UNIVER_UNKNOWN);
|
|
18125
18125
|
class oC {
|
|
18126
18126
|
constructor() {
|
|
18127
18127
|
p(this, "_plugins", []);
|
|
@@ -18148,7 +18148,7 @@ let Ss = class {
|
|
|
18148
18148
|
p(this, "_pluginStore", new oC());
|
|
18149
18149
|
p(this, "_seenPlugins", /* @__PURE__ */ new Set());
|
|
18150
18150
|
p(this, "_loadedPlugins", /* @__PURE__ */ new Set());
|
|
18151
|
-
p(this, "_loadedPluginTypes", /* @__PURE__ */ new Set([
|
|
18151
|
+
p(this, "_loadedPluginTypes", /* @__PURE__ */ new Set([we.UNIVER_UNKNOWN]));
|
|
18152
18152
|
p(this, "_flushTimerByType", /* @__PURE__ */ new Map());
|
|
18153
18153
|
this._injector = e, this._lifecycleService = t, this._logService = n;
|
|
18154
18154
|
}
|
|
@@ -18165,7 +18165,7 @@ let Ss = class {
|
|
|
18165
18165
|
const n = { plugin: e, options: t };
|
|
18166
18166
|
this._pluginRegistry.set(e.pluginName, n), this._logService.debug("[PluginService]", `Plugin "${e.pluginName}" registered.`);
|
|
18167
18167
|
const { type: r } = e;
|
|
18168
|
-
this._loadedPluginTypes.has(r) && (r ===
|
|
18168
|
+
this._loadedPluginTypes.has(r) && (r === we.UNIVER_UNKNOWN ? this._loadFromPlugins([n]) : this._flushType(r));
|
|
18169
18169
|
}
|
|
18170
18170
|
startPluginsForType(e) {
|
|
18171
18171
|
this._loadedPluginTypes.has(e) || this._loadPluginsForType(e);
|
|
@@ -18179,7 +18179,7 @@ let Ss = class {
|
|
|
18179
18179
|
}
|
|
18180
18180
|
_assertPluginValid(e) {
|
|
18181
18181
|
const { type: t, pluginName: n } = e;
|
|
18182
|
-
if (t ===
|
|
18182
|
+
if (t === we.UNRECOGNIZED)
|
|
18183
18183
|
throw new Error(`[PluginService]: invalid plugin type for ${e.name}. Please assign a "type" to your plugin.`);
|
|
18184
18184
|
if (!n)
|
|
18185
18185
|
throw new Error(`[PluginService]: no plugin name for ${e.name}. Please assign a "pluginName" to your plugin.`);
|
|
@@ -18204,11 +18204,11 @@ let Ss = class {
|
|
|
18204
18204
|
if (c)
|
|
18205
18205
|
r(c);
|
|
18206
18206
|
else if (!this._seenPlugins.has(u.pluginName) && !n.has(u.pluginName)) {
|
|
18207
|
-
if (o.type ===
|
|
18207
|
+
if (o.type === we.UNIVER_UNKNOWN && u.type !== we.UNIVER_UNKNOWN)
|
|
18208
18208
|
throw new Error(
|
|
18209
18209
|
`[PluginService]: cannot register a plugin with Univer type that depends on a plugin with other type. The dependent is ${o.pluginName} and the dependency is ${u.pluginName}.`
|
|
18210
18210
|
);
|
|
18211
|
-
o.type !== u.type && u.type !==
|
|
18211
|
+
o.type !== u.type && u.type !== we.UNIVER_UNKNOWN && this._logService.debug(
|
|
18212
18212
|
"[PluginService]",
|
|
18213
18213
|
`Plugin "${a}" depends on "${u.pluginName}" which has different type.`
|
|
18214
18214
|
), this._logService.debug(
|
|
@@ -18317,9 +18317,9 @@ let Vi = class extends Ve {
|
|
|
18317
18317
|
}
|
|
18318
18318
|
});
|
|
18319
18319
|
}
|
|
18320
|
-
unloadResources(t) {
|
|
18321
|
-
this.getAllResourceHooks().
|
|
18322
|
-
|
|
18320
|
+
unloadResources(t, n) {
|
|
18321
|
+
this.getAllResourceHooks().filter((r) => r.businesses.includes(n)).forEach((r) => {
|
|
18322
|
+
r.onUnLoad(t);
|
|
18323
18323
|
});
|
|
18324
18324
|
}
|
|
18325
18325
|
dispose() {
|
|
@@ -19648,11 +19648,11 @@ let Zi = class extends Ve {
|
|
|
19648
19648
|
const e = (n) => {
|
|
19649
19649
|
n.businesses.forEach((r) => {
|
|
19650
19650
|
switch (r) {
|
|
19651
|
-
case
|
|
19652
|
-
case
|
|
19653
|
-
case
|
|
19654
|
-
case
|
|
19655
|
-
this._univerInstanceService.getAllUnitsForType(
|
|
19651
|
+
case we.UNRECOGNIZED:
|
|
19652
|
+
case we.UNIVER_UNKNOWN:
|
|
19653
|
+
case we.UNIVER_SLIDE:
|
|
19654
|
+
case we.UNIVER_DOC: {
|
|
19655
|
+
this._univerInstanceService.getAllUnitsForType(we.UNIVER_DOC).forEach((s) => {
|
|
19656
19656
|
const o = (s.getSnapshot().resources || []).find((a) => a.name === n.pluginName);
|
|
19657
19657
|
if (o)
|
|
19658
19658
|
try {
|
|
@@ -19664,8 +19664,8 @@ let Zi = class extends Ve {
|
|
|
19664
19664
|
});
|
|
19665
19665
|
break;
|
|
19666
19666
|
}
|
|
19667
|
-
case
|
|
19668
|
-
this._univerInstanceService.getAllUnitsForType(
|
|
19667
|
+
case we.UNIVER_SHEET:
|
|
19668
|
+
this._univerInstanceService.getAllUnitsForType(we.UNIVER_SHEET).forEach((s) => {
|
|
19669
19669
|
const o = (s.getSnapshot().resources || []).find((a) => a.name === n.pluginName);
|
|
19670
19670
|
if (o)
|
|
19671
19671
|
try {
|
|
@@ -19679,21 +19679,21 @@ let Zi = class extends Ve {
|
|
|
19679
19679
|
});
|
|
19680
19680
|
};
|
|
19681
19681
|
this._resourceManagerService.getAllResourceHooks().forEach((n) => e(n)), this.disposeWithMe(this._resourceManagerService.register$.subscribe((n) => e(n))), this.disposeWithMe(
|
|
19682
|
-
this._univerInstanceService.getTypeOfUnitAdded$(
|
|
19682
|
+
this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_SHEET).subscribe((n) => {
|
|
19683
19683
|
this._resourceManagerService.loadResources(n.getUnitId(), n.getSnapshot().resources);
|
|
19684
19684
|
})
|
|
19685
19685
|
), this.disposeWithMe(
|
|
19686
|
-
this._univerInstanceService.getTypeOfUnitAdded$(
|
|
19686
|
+
this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_DOC).subscribe((n) => {
|
|
19687
19687
|
const r = n.getUnitId();
|
|
19688
19688
|
Wc(r) || this._resourceManagerService.loadResources(n.getUnitId(), n.getSnapshot().resources);
|
|
19689
19689
|
})
|
|
19690
19690
|
), this.disposeWithMe(
|
|
19691
|
-
this._univerInstanceService.getTypeOfUnitDisposed$(
|
|
19692
|
-
this._resourceManagerService.unloadResources(n.getUnitId());
|
|
19691
|
+
this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_SHEET).subscribe((n) => {
|
|
19692
|
+
this._resourceManagerService.unloadResources(n.getUnitId(), we.UNIVER_SHEET);
|
|
19693
19693
|
})
|
|
19694
19694
|
), this.disposeWithMe(
|
|
19695
|
-
this._univerInstanceService.getTypeOfUnitDisposed$(
|
|
19696
|
-
this._resourceManagerService.unloadResources(n.getUnitId());
|
|
19695
|
+
this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_DOC).subscribe((n) => {
|
|
19696
|
+
this._resourceManagerService.unloadResources(n.getUnitId(), we.UNIVER_DOC);
|
|
19697
19697
|
})
|
|
19698
19698
|
);
|
|
19699
19699
|
}
|
|
@@ -19761,22 +19761,22 @@ class sI {
|
|
|
19761
19761
|
* @deprecated use `createUnit` instead
|
|
19762
19762
|
*/
|
|
19763
19763
|
createUniverSheet(t) {
|
|
19764
|
-
return this._injector.get(yt).warn("[Univer]", "Univer.createUniverSheet is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(
|
|
19764
|
+
return this._injector.get(yt).warn("[Univer]", "Univer.createUniverSheet is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(we.UNIVER_SHEET, t);
|
|
19765
19765
|
}
|
|
19766
19766
|
/**
|
|
19767
19767
|
* @deprecated use `createUnit` instead
|
|
19768
19768
|
*/
|
|
19769
19769
|
createUniverDoc(t) {
|
|
19770
|
-
return this._injector.get(yt).warn("[Univer]", "Univer.createUniverDoc is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(
|
|
19770
|
+
return this._injector.get(yt).warn("[Univer]", "Univer.createUniverDoc is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(we.UNIVER_DOC, t);
|
|
19771
19771
|
}
|
|
19772
19772
|
/**
|
|
19773
19773
|
* @deprecated use `createUnit` instead
|
|
19774
19774
|
*/
|
|
19775
19775
|
createUniverSlide(t) {
|
|
19776
|
-
return this._injector.get(yt).warn("[Univer]", "Univer.createUniverSlide is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(
|
|
19776
|
+
return this._injector.get(yt).warn("[Univer]", "Univer.createUniverSlide is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(we.UNIVER_SLIDE, t);
|
|
19777
19777
|
}
|
|
19778
19778
|
_init(t) {
|
|
19779
|
-
this._univerInstanceService.registerCtorForType(
|
|
19779
|
+
this._univerInstanceService.registerCtorForType(we.UNIVER_SHEET, ws), this._univerInstanceService.registerCtorForType(we.UNIVER_DOC, Pt), this._univerInstanceService.registerCtorForType(we.UNIVER_SLIDE, ac);
|
|
19780
19780
|
const n = t.get(vr);
|
|
19781
19781
|
n.__setCreateHandler(
|
|
19782
19782
|
(r, s, i, o) => {
|
|
@@ -20072,7 +20072,7 @@ export {
|
|
|
20072
20072
|
lo as UnitModel,
|
|
20073
20073
|
sI as Univer,
|
|
20074
20074
|
Yi as UniverInstanceService,
|
|
20075
|
-
|
|
20075
|
+
we as UniverInstanceType,
|
|
20076
20076
|
pe as UpdateDocsAttributeType,
|
|
20077
20077
|
Rs as UserManagerService,
|
|
20078
20078
|
xn as VerticalAlign,
|