@univerjs/docs 0.1.0-alpha.3 → 0.1.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/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var S = (n, e, t) => (
|
|
4
|
-
import { CommandType as R, RxDisposable as
|
|
5
|
-
import { NORMAL_TEXT_SELECTION_PLUGIN_STYLE as
|
|
6
|
-
import { BehaviorSubject as de, takeUntil as
|
|
7
|
-
import { CopyCommand as hn, CutCommand as pn, PasteCommand as gn, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as mn, HTML_CLIPBOARD_MIME_TYPE as fn, IClipboardInterfaceService as _n, LayoutService as Sn, KeyCode as $, MetaKeys as
|
|
1
|
+
var Ft = Object.defineProperty;
|
|
2
|
+
var kt = (n, e, t) => e in n ? Ft(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var S = (n, e, t) => (kt(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { CommandType as R, RxDisposable as Ze, ICommandService as x, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as K, IUniverInstanceService as O, IUndoRedoService as N, DataStreamTreeTokenType as He, Tools as H, FOCUSING_DOC as w, FOCUSING_EDITOR as me, LocaleService as It, MemoryCursor as we, getDocsUpdateBody as zt, UpdateDocsAttributeType as xt, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as J, BooleanNumber as D, BaselineOffset as j, PresetListType as Ot, LRUMap as Wt, ColorKit as it, Disposable as W, toDisposable as Ge, OnLifecycle as V, LifecycleStages as F, ILogService as Ht, IContextService as Gt, DEFAULT_DOCUMENT_SUB_COMPONENT_ID as Xt, IFloatingObjectManagerService as qt, Direction as b, IConfigService as yt, Plugin as Yt, PluginType as Zt } from "@univerjs/core";
|
|
5
|
+
import { NORMAL_TEXT_SELECTION_PLUGIN_STYLE as Kt, ITextSelectionRenderManager as fe, DocumentViewModel as Jt, DocumentSkeleton as Qt, hasListSpan as en, isIndentBySpan as tn, isFirstSpan as nn, getParagraphBySpan as rn, PageLayoutType as ot, IRenderManagerService as G, Liquid as sn, RANGE_DIRECTION as at, NodePositionConvertToCursor as ct, Rect as on, CURSOR_TYPE as lt, Viewport as an, EVENT_TYPE as cn, ScrollBar as ln, Layer as dt, Documents as dn, TextSelectionRenderManager as un } from "@univerjs/engine-render";
|
|
6
|
+
import { BehaviorSubject as de, takeUntil as bt } from "rxjs";
|
|
7
|
+
import { CopyCommand as hn, CutCommand as pn, PasteCommand as gn, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as mn, HTML_CLIPBOARD_MIME_TYPE as fn, IClipboardInterfaceService as _n, LayoutService as Sn, KeyCode as $, MetaKeys as _e, IShortcutService as vn } from "@univerjs/ui";
|
|
8
8
|
import { Inject as U, createIdentifier as Mn, Optional as Cn, Injector as Rn } from "@wendellhu/redi";
|
|
9
|
-
function
|
|
9
|
+
function Le(n, e) {
|
|
10
10
|
const r = n.getCurrentUniverDocInstance().getUnitId(), s = e.getRenderById(r);
|
|
11
11
|
if (s == null)
|
|
12
12
|
return;
|
|
@@ -21,15 +21,15 @@ function In(n, e) {
|
|
|
21
21
|
const t = e.getRenderById(n);
|
|
22
22
|
if (t == null)
|
|
23
23
|
return;
|
|
24
|
-
const {
|
|
24
|
+
const { mainComponent: r, scene: s, engine: i } = t;
|
|
25
25
|
return {
|
|
26
|
-
document:
|
|
27
|
-
scene:
|
|
28
|
-
engine:
|
|
26
|
+
document: r,
|
|
27
|
+
scene: s,
|
|
28
|
+
engine: i
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
var
|
|
32
|
-
const
|
|
31
|
+
var Xe = /* @__PURE__ */ ((n) => (n.MAIN = "__Document_Render_Main__", n))(Xe || {}), Ke = /* @__PURE__ */ ((n) => (n.VIEW_MAIN = "viewMain", n.VIEW_TOP = "viewTop", n.VIEW_LEFT = "viewLeft", n.VIEW_LEFT_TOP = "viewLeftTop", n))(Ke || {});
|
|
32
|
+
const ut = 0, xn = 2, On = 10, hs = "normalTextSelectionPluginName", Dt = {
|
|
33
33
|
id: "doc.operation.set-selections",
|
|
34
34
|
type: R.OPERATION,
|
|
35
35
|
handler: (n, e) => !0
|
|
@@ -38,8 +38,8 @@ var yn = Object.defineProperty, bn = Object.getOwnPropertyDescriptor, Dn = (n, e
|
|
|
38
38
|
for (var s = r > 1 ? void 0 : r ? bn(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
39
39
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
40
40
|
return r && s && yn(e, t, s), s;
|
|
41
|
-
},
|
|
42
|
-
function
|
|
41
|
+
}, ht = (n, e) => (t, r) => e(t, r, n);
|
|
42
|
+
function pt(n) {
|
|
43
43
|
const { startOffset: e, endOffset: t, collapsed: r } = n;
|
|
44
44
|
return {
|
|
45
45
|
startOffset: e,
|
|
@@ -47,7 +47,7 @@ function ht(n) {
|
|
|
47
47
|
collapsed: r
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
let P = class extends
|
|
50
|
+
let P = class extends Ze {
|
|
51
51
|
constructor(e, t) {
|
|
52
52
|
super();
|
|
53
53
|
S(this, "_currentSelection", null);
|
|
@@ -105,7 +105,7 @@ let P = class extends Rt {
|
|
|
105
105
|
...this._currentSelection,
|
|
106
106
|
textRanges: e,
|
|
107
107
|
segmentId: "",
|
|
108
|
-
style:
|
|
108
|
+
style: Kt
|
|
109
109
|
// mock style.
|
|
110
110
|
});
|
|
111
111
|
}
|
|
@@ -114,7 +114,7 @@ let P = class extends Rt {
|
|
|
114
114
|
}
|
|
115
115
|
// All textRanges should be synchronized from the render layer.
|
|
116
116
|
_syncSelectionFromRenderService() {
|
|
117
|
-
this._textSelectionRenderManager.textSelectionInner$.pipe(
|
|
117
|
+
this._textSelectionRenderManager.textSelectionInner$.pipe(bt(this.dispose$)).subscribe((e) => {
|
|
118
118
|
e != null && this._replaceTextRangesWithNoRefresh(e);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
@@ -127,12 +127,12 @@ let P = class extends Rt {
|
|
|
127
127
|
};
|
|
128
128
|
this._replaceByParam(t), this._textSelection$.next(t);
|
|
129
129
|
const { unitId: r, subUnitId: s, segmentId: i, style: o, textRanges: a } = t;
|
|
130
|
-
this._commandService.executeCommand(
|
|
130
|
+
this._commandService.executeCommand(Dt.id, {
|
|
131
131
|
unitId: r,
|
|
132
132
|
subUnitId: s,
|
|
133
133
|
segmentId: i,
|
|
134
134
|
style: o,
|
|
135
|
-
ranges: a.map(
|
|
135
|
+
ranges: a.map(pt)
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
_getTextRanges(e) {
|
|
@@ -144,7 +144,7 @@ let P = class extends Rt {
|
|
|
144
144
|
}
|
|
145
145
|
_refresh(e) {
|
|
146
146
|
const t = this._getTextRanges(e);
|
|
147
|
-
this._textSelectionRenderManager.removeAllTextRanges(), t && Array.isArray(t.textRanges) && t.textRanges.length && this._textSelectionRenderManager.addTextRanges(t.textRanges.map(
|
|
147
|
+
this._textSelectionRenderManager.removeAllTextRanges(), t && Array.isArray(t.textRanges) && t.textRanges.length && this._textSelectionRenderManager.addTextRanges(t.textRanges.map(pt));
|
|
148
148
|
}
|
|
149
149
|
_replaceByParam(e) {
|
|
150
150
|
const { unitId: t, subUnitId: r, style: s, segmentId: i, textRanges: o } = e;
|
|
@@ -158,10 +158,10 @@ let P = class extends Rt {
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
P = Dn([
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
ht(0, fe),
|
|
162
|
+
ht(1, x)
|
|
163
163
|
], P);
|
|
164
|
-
function
|
|
164
|
+
function Ae(n, e = "", t = 0) {
|
|
165
165
|
const { startOffset: r, endOffset: s } = n, i = [], o = r - t, a = s - t;
|
|
166
166
|
return o > 0 && i.push({
|
|
167
167
|
t: "r",
|
|
@@ -220,7 +220,7 @@ let se = class {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
_buildDocViewModel(n) {
|
|
223
|
-
return new
|
|
223
|
+
return new Jt(n);
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
se = En([
|
|
@@ -250,11 +250,11 @@ const _ = {
|
|
|
250
250
|
mutations: []
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
|
-
h ? p.params.mutations.push({
|
|
253
|
+
h ? l > 0 && p.params.mutations.push({
|
|
254
254
|
t: "r",
|
|
255
255
|
len: l,
|
|
256
256
|
segmentId: o
|
|
257
|
-
}) : p.params.mutations.push(...
|
|
257
|
+
}) : p.params.mutations.push(...Ae(i, o)), p.params.mutations.push({
|
|
258
258
|
t: "i",
|
|
259
259
|
body: a,
|
|
260
260
|
len: a.dataStream.length,
|
|
@@ -310,7 +310,7 @@ const Qe = {
|
|
|
310
310
|
}
|
|
311
311
|
}), !1;
|
|
312
312
|
}
|
|
313
|
-
},
|
|
313
|
+
}, Tt = {
|
|
314
314
|
id: "doc.command.update-text",
|
|
315
315
|
type: R.COMMAND,
|
|
316
316
|
handler: async (n, e) => {
|
|
@@ -349,7 +349,7 @@ const Qe = {
|
|
|
349
349
|
function wn(n, e) {
|
|
350
350
|
const t = [];
|
|
351
351
|
for (let r = 0, s = n.length; r < s; r++)
|
|
352
|
-
n[r] ===
|
|
352
|
+
n[r] === He.PARAGRAPH && t.push({
|
|
353
353
|
startIndex: r
|
|
354
354
|
});
|
|
355
355
|
if (e)
|
|
@@ -357,7 +357,7 @@ function wn(n, e) {
|
|
|
357
357
|
e.bullet && (r.bullet = H.deepClone(e.bullet)), e.paragraphStyle && (r.paragraphStyle = H.deepClone(e.paragraphStyle));
|
|
358
358
|
return t;
|
|
359
359
|
}
|
|
360
|
-
const
|
|
360
|
+
const Pt = {
|
|
361
361
|
id: "doc.command.break-line",
|
|
362
362
|
type: R.COMMAND,
|
|
363
363
|
handler: async (n) => {
|
|
@@ -375,44 +375,44 @@ const Tt = {
|
|
|
375
375
|
return await r.executeCommand(Je.id, {
|
|
376
376
|
unitId: o,
|
|
377
377
|
body: {
|
|
378
|
-
dataStream:
|
|
379
|
-
paragraphs: wn(
|
|
378
|
+
dataStream: He.PARAGRAPH,
|
|
379
|
+
paragraphs: wn(He.PARAGRAPH, p)
|
|
380
380
|
},
|
|
381
381
|
range: s,
|
|
382
382
|
textRanges: l,
|
|
383
383
|
segmentId: c
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
},
|
|
386
|
+
}, Ve = {
|
|
387
387
|
id: hn.id,
|
|
388
388
|
name: "doc.command.copy",
|
|
389
389
|
type: R.COMMAND,
|
|
390
390
|
multi: !0,
|
|
391
391
|
priority: 999,
|
|
392
|
-
preconditions: (n) => n.getContextValue(w) || n.getContextValue(
|
|
392
|
+
preconditions: (n) => n.getContextValue(w) || n.getContextValue(me),
|
|
393
393
|
handler: async () => !0
|
|
394
|
-
},
|
|
394
|
+
}, Fe = {
|
|
395
395
|
id: pn.id,
|
|
396
396
|
name: "doc.command.cut",
|
|
397
397
|
type: R.COMMAND,
|
|
398
398
|
multi: !0,
|
|
399
399
|
priority: 999,
|
|
400
|
-
preconditions: (n) => n.getContextValue(w) || n.getContextValue(
|
|
400
|
+
preconditions: (n) => n.getContextValue(w) || n.getContextValue(me),
|
|
401
401
|
handler: async () => !0
|
|
402
|
-
},
|
|
402
|
+
}, ke = {
|
|
403
403
|
id: gn.id,
|
|
404
404
|
name: "doc.command.paste",
|
|
405
405
|
type: R.COMMAND,
|
|
406
406
|
multi: !0,
|
|
407
407
|
priority: 999,
|
|
408
|
-
preconditions: (n) => n.getContextValue(w) || n.getContextValue(
|
|
408
|
+
preconditions: (n) => n.getContextValue(w) || n.getContextValue(me),
|
|
409
409
|
handler: async () => !0
|
|
410
410
|
};
|
|
411
411
|
var Ln = Object.defineProperty, An = Object.getOwnPropertyDescriptor, Nn = (n, e, t, r) => {
|
|
412
412
|
for (var s = r > 1 ? void 0 : r ? An(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
413
413
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
414
414
|
return r && s && Ln(e, t, s), s;
|
|
415
|
-
},
|
|
415
|
+
}, gt = (n, e) => (t, r) => e(t, r, n);
|
|
416
416
|
let A = class {
|
|
417
417
|
constructor(n, e) {
|
|
418
418
|
S(this, "_currentSkeletonUnitId", "");
|
|
@@ -463,14 +463,14 @@ let A = class {
|
|
|
463
463
|
return this._docSkeletonMap.get(n);
|
|
464
464
|
}
|
|
465
465
|
_buildSkeleton(n) {
|
|
466
|
-
return
|
|
466
|
+
return Qt.create(n, this._localeService);
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
469
|
A = Nn([
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
gt(0, U(It)),
|
|
471
|
+
gt(1, U(se))
|
|
472
472
|
], A);
|
|
473
|
-
const
|
|
473
|
+
const mt = {
|
|
474
474
|
id: "doc.command.inner-paste",
|
|
475
475
|
type: R.COMMAND,
|
|
476
476
|
handler: async (n, e) => {
|
|
@@ -483,7 +483,7 @@ const gt = {
|
|
|
483
483
|
unitId: h,
|
|
484
484
|
mutations: []
|
|
485
485
|
}
|
|
486
|
-
}, u = new
|
|
486
|
+
}, u = new we();
|
|
487
487
|
u.reset();
|
|
488
488
|
for (const m of d) {
|
|
489
489
|
const { startOffset: f, endOffset: v, collapsed: M } = m, T = f - u.cursor;
|
|
@@ -492,7 +492,7 @@ const gt = {
|
|
|
492
492
|
len: T,
|
|
493
493
|
segmentId: t
|
|
494
494
|
}) : p.params.mutations.push(
|
|
495
|
-
...
|
|
495
|
+
...Ae(m, t, u.cursor)
|
|
496
496
|
), p.params.mutations.push({
|
|
497
497
|
t: "i",
|
|
498
498
|
body: r,
|
|
@@ -514,14 +514,14 @@ const gt = {
|
|
|
514
514
|
}
|
|
515
515
|
}), !0) : !1;
|
|
516
516
|
}
|
|
517
|
-
},
|
|
517
|
+
}, Ee = {
|
|
518
518
|
id: "doc.command.inner-cut",
|
|
519
519
|
type: R.COMMAND,
|
|
520
520
|
handler: async (n, e) => {
|
|
521
521
|
const { segmentId: t, textRanges: r } = e, s = n.get(N), i = n.get(x), o = n.get(P), a = n.get(O), c = o.getSelections();
|
|
522
522
|
if (!Array.isArray(c) || c.length === 0)
|
|
523
523
|
return !1;
|
|
524
|
-
const d = a.getCurrentUniverDocInstance().getUnitId(), l = a.getUniverDocInstance(d), h =
|
|
524
|
+
const d = a.getCurrentUniverDocInstance().getUnitId(), l = a.getUniverDocInstance(d), h = zt(l.snapshot, t);
|
|
525
525
|
if (h == null)
|
|
526
526
|
return !1;
|
|
527
527
|
const p = {
|
|
@@ -530,7 +530,7 @@ const gt = {
|
|
|
530
530
|
unitId: d,
|
|
531
531
|
mutations: []
|
|
532
532
|
}
|
|
533
|
-
}, u = new
|
|
533
|
+
}, u = new we();
|
|
534
534
|
u.reset();
|
|
535
535
|
for (const m of c) {
|
|
536
536
|
const { startOffset: f, endOffset: v, collapsed: M } = m, T = f - u.cursor;
|
|
@@ -590,7 +590,7 @@ function $n(n, e, t = "", r = 0) {
|
|
|
590
590
|
});
|
|
591
591
|
return o;
|
|
592
592
|
}
|
|
593
|
-
const
|
|
593
|
+
const Et = {
|
|
594
594
|
id: "doc.command.delete-left",
|
|
595
595
|
type: R.COMMAND,
|
|
596
596
|
handler: async (n) => {
|
|
@@ -602,11 +602,11 @@ const Pt = {
|
|
|
602
602
|
const d = r.getCurrentUniverDocInstance(), { startOffset: l, collapsed: h, segmentId: p, style: u } = i;
|
|
603
603
|
if (l === 0 && h)
|
|
604
604
|
return !0;
|
|
605
|
-
const g = a.findNodeByCharIndex(l), m =
|
|
605
|
+
const g = a.findNodeByCharIndex(l), m = en(g), f = tn(g, d.body);
|
|
606
606
|
let v = l;
|
|
607
607
|
const M = a.findNodeByCharIndex(l - 1);
|
|
608
|
-
if (
|
|
609
|
-
const C =
|
|
608
|
+
if (nn(g) && M !== g && (m === !0 || f === !0)) {
|
|
609
|
+
const C = rn(g, d.body);
|
|
610
610
|
if (C == null)
|
|
611
611
|
return !1;
|
|
612
612
|
const E = C == null ? void 0 : C.startIndex, L = { startIndex: 0 }, B = C.paragraphStyle;
|
|
@@ -617,14 +617,14 @@ const Pt = {
|
|
|
617
617
|
const I = C.bullet;
|
|
618
618
|
I && (L.bullet = I), B != null && (L.paragraphStyle = { ...B }, delete L.paragraphStyle.hanging, delete L.paragraphStyle.indentStart);
|
|
619
619
|
}
|
|
620
|
-
const
|
|
620
|
+
const k = [
|
|
621
621
|
{
|
|
622
622
|
startOffset: v,
|
|
623
623
|
endOffset: v,
|
|
624
624
|
style: u
|
|
625
625
|
}
|
|
626
626
|
];
|
|
627
|
-
c = await s.executeCommand(
|
|
627
|
+
c = await s.executeCommand(Tt.id, {
|
|
628
628
|
unitId: d.getUnitId(),
|
|
629
629
|
updateBody: {
|
|
630
630
|
dataStream: "",
|
|
@@ -634,7 +634,7 @@ const Pt = {
|
|
|
634
634
|
startOffset: E,
|
|
635
635
|
endOffset: E + 1
|
|
636
636
|
},
|
|
637
|
-
textRanges:
|
|
637
|
+
textRanges: k,
|
|
638
638
|
coverType: xt.REPLACE,
|
|
639
639
|
segmentId: p
|
|
640
640
|
});
|
|
@@ -663,15 +663,15 @@ const Pt = {
|
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
665
|
else {
|
|
666
|
-
const C =
|
|
667
|
-
c = await s.executeCommand(
|
|
666
|
+
const C = wt(i, o);
|
|
667
|
+
c = await s.executeCommand(Ee.id, {
|
|
668
668
|
segmentId: p,
|
|
669
669
|
textRanges: C
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
672
|
return c;
|
|
673
673
|
}
|
|
674
|
-
},
|
|
674
|
+
}, Ut = {
|
|
675
675
|
id: "doc.command.delete-right",
|
|
676
676
|
type: R.COMMAND,
|
|
677
677
|
handler: async (n) => {
|
|
@@ -708,8 +708,8 @@ const Pt = {
|
|
|
708
708
|
});
|
|
709
709
|
}
|
|
710
710
|
} else {
|
|
711
|
-
const m =
|
|
712
|
-
c = await s.executeCommand(
|
|
711
|
+
const m = wt(i, o);
|
|
712
|
+
c = await s.executeCommand(Ee.id, {
|
|
713
713
|
segmentId: p,
|
|
714
714
|
textRanges: m
|
|
715
715
|
});
|
|
@@ -720,14 +720,14 @@ const Pt = {
|
|
|
720
720
|
id: "doc.command.merge-two-paragraph",
|
|
721
721
|
type: R.COMMAND,
|
|
722
722
|
handler: async (n, e) => {
|
|
723
|
-
var L, B,
|
|
723
|
+
var L, B, k;
|
|
724
724
|
const t = n.get(P), r = n.get(O), s = n.get(x), i = n.get(N), { direction: o, range: a } = e, c = t.getActiveRange(), d = t.getSelections();
|
|
725
725
|
if (c == null || d == null)
|
|
726
726
|
return !1;
|
|
727
727
|
const l = r.getCurrentUniverDocInstance(), { startOffset: h, collapsed: p, segmentId: u, style: g } = c;
|
|
728
728
|
if (!p)
|
|
729
729
|
return !1;
|
|
730
|
-
const m = o === q.LEFT ? h : h + 1, f = (
|
|
730
|
+
const m = o === q.LEFT ? h : h + 1, f = (k = (B = (L = l.getBody()) == null ? void 0 : L.paragraphs) == null ? void 0 : B.find((I) => I.startIndex >= m)) == null ? void 0 : k.startIndex, v = Bn(l.getBody(), m, f), M = o === q.LEFT ? h - 1 : h, T = l.getUnitId(), y = [
|
|
731
731
|
{
|
|
732
732
|
startOffset: M,
|
|
733
733
|
endOffset: M,
|
|
@@ -802,7 +802,7 @@ function Bn(n, e, t) {
|
|
|
802
802
|
textRuns: i
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function wt(n, e) {
|
|
806
806
|
let t = n.endOffset;
|
|
807
807
|
for (const s of e) {
|
|
808
808
|
const { startOffset: i, endOffset: o } = s;
|
|
@@ -853,7 +853,7 @@ class tt {
|
|
|
853
853
|
t: "r",
|
|
854
854
|
len: s,
|
|
855
855
|
segmentId: r
|
|
856
|
-
}), o.mutations.push(this._undoMutationParamsCache[0].mutations.find((c) => c.t === "i")), a.mutations.push(...
|
|
856
|
+
}), o.mutations.push(this._undoMutationParamsCache[0].mutations.find((c) => c.t === "i")), a.mutations.push(...Ae(this._previousActiveRange, r))), e.length && (o.mutations.push({
|
|
857
857
|
t: "d",
|
|
858
858
|
len: e.length,
|
|
859
859
|
line: 0,
|
|
@@ -872,7 +872,7 @@ class tt {
|
|
|
872
872
|
this._undoMutationParamsCache = [], this._redoMutationParamsCache = [], this._previousActiveRange = null;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
const
|
|
875
|
+
const Lt = {
|
|
876
876
|
id: "doc.command.ime-input",
|
|
877
877
|
type: R.COMMAND,
|
|
878
878
|
handler: async (n, e) => {
|
|
@@ -887,7 +887,7 @@ const wt = {
|
|
|
887
887
|
t: "r",
|
|
888
888
|
len: i.startOffset,
|
|
889
889
|
segmentId: o
|
|
890
|
-
}) : u.params.mutations.push(...
|
|
890
|
+
}) : u.params.mutations.push(...Ae(i, o)), s > 0 && u.params.mutations.push({
|
|
891
891
|
t: "d",
|
|
892
892
|
len: s,
|
|
893
893
|
line: 0,
|
|
@@ -924,19 +924,19 @@ const wt = {
|
|
|
924
924
|
return !!g;
|
|
925
925
|
return !1;
|
|
926
926
|
}
|
|
927
|
-
},
|
|
927
|
+
}, ue = {
|
|
928
928
|
id: "doc.command.set-inline-format-bold",
|
|
929
929
|
type: R.COMMAND,
|
|
930
930
|
handler: async () => !0
|
|
931
|
-
},
|
|
931
|
+
}, Ne = {
|
|
932
932
|
id: "doc.command.set-inline-format-italic",
|
|
933
933
|
type: R.COMMAND,
|
|
934
934
|
handler: async () => !0
|
|
935
|
-
},
|
|
935
|
+
}, $e = {
|
|
936
936
|
id: "doc.command.set-inline-format-underline",
|
|
937
937
|
type: R.COMMAND,
|
|
938
938
|
handler: async () => !0
|
|
939
|
-
},
|
|
939
|
+
}, Be = {
|
|
940
940
|
id: "doc.command.set-inline-format-strikethrough",
|
|
941
941
|
type: R.COMMAND,
|
|
942
942
|
handler: async () => !0
|
|
@@ -948,11 +948,11 @@ const wt = {
|
|
|
948
948
|
id: "doc.command.set-inline-format-superscript",
|
|
949
949
|
type: R.COMMAND,
|
|
950
950
|
handler: async () => !0
|
|
951
|
-
},
|
|
951
|
+
}, he = {
|
|
952
952
|
id: "doc.command.set-inline-format-fontsize",
|
|
953
953
|
type: R.COMMAND,
|
|
954
954
|
handler: async () => !0
|
|
955
|
-
},
|
|
955
|
+
}, pe = {
|
|
956
956
|
id: "doc.command.set-inline-format-font-family",
|
|
957
957
|
type: R.COMMAND,
|
|
958
958
|
handler: async () => !0
|
|
@@ -960,17 +960,17 @@ const wt = {
|
|
|
960
960
|
id: "doc.command.set-inline-format-text-color",
|
|
961
961
|
type: R.COMMAND,
|
|
962
962
|
handler: async () => !0
|
|
963
|
-
},
|
|
964
|
-
[
|
|
965
|
-
[
|
|
966
|
-
[
|
|
967
|
-
[
|
|
968
|
-
[
|
|
969
|
-
[
|
|
963
|
+
}, At = {
|
|
964
|
+
[ue.id]: "bl",
|
|
965
|
+
[Ne.id]: "it",
|
|
966
|
+
[$e.id]: "ul",
|
|
967
|
+
[Be.id]: "st",
|
|
968
|
+
[he.id]: "fs",
|
|
969
|
+
[pe.id]: "ff",
|
|
970
970
|
[je.id]: "cl",
|
|
971
971
|
[Q.id]: "va",
|
|
972
972
|
[ie.id]: "va"
|
|
973
|
-
},
|
|
973
|
+
}, Nt = {
|
|
974
974
|
id: "doc.command.set-inline-format",
|
|
975
975
|
type: R.COMMAND,
|
|
976
976
|
handler: async (n, e) => {
|
|
@@ -981,21 +981,21 @@ const wt = {
|
|
|
981
981
|
h === J && (l = c.getUniverDocInstance(K), h = l.getUnitId());
|
|
982
982
|
let p;
|
|
983
983
|
switch (s) {
|
|
984
|
-
case
|
|
984
|
+
case ue.id:
|
|
985
|
+
case Ne.id:
|
|
985
986
|
case $e.id:
|
|
986
987
|
case Be.id:
|
|
987
|
-
case Ve.id:
|
|
988
988
|
case Q.id:
|
|
989
989
|
case ie.id: {
|
|
990
|
-
p =
|
|
990
|
+
p = Vn(
|
|
991
991
|
l.getBody().textRuns,
|
|
992
992
|
s,
|
|
993
993
|
d
|
|
994
994
|
);
|
|
995
995
|
break;
|
|
996
996
|
}
|
|
997
|
-
case
|
|
998
|
-
case
|
|
997
|
+
case he.id:
|
|
998
|
+
case pe.id: {
|
|
999
999
|
p = r;
|
|
1000
1000
|
break;
|
|
1001
1001
|
}
|
|
@@ -1014,7 +1014,7 @@ const wt = {
|
|
|
1014
1014
|
unitId: h,
|
|
1015
1015
|
mutations: []
|
|
1016
1016
|
}
|
|
1017
|
-
}, g = new
|
|
1017
|
+
}, g = new we();
|
|
1018
1018
|
g.reset();
|
|
1019
1019
|
for (const v of d) {
|
|
1020
1020
|
const { startOffset: M, endOffset: T } = v, y = {
|
|
@@ -1024,7 +1024,7 @@ const wt = {
|
|
|
1024
1024
|
st: 0,
|
|
1025
1025
|
ed: T - M,
|
|
1026
1026
|
ts: {
|
|
1027
|
-
[
|
|
1027
|
+
[At[s]]: p
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
1030
|
]
|
|
@@ -1041,9 +1041,9 @@ const wt = {
|
|
|
1041
1041
|
}), g.reset(), g.moveCursor(T);
|
|
1042
1042
|
}
|
|
1043
1043
|
const m = o.syncExecuteCommand(u.id, u.params), f = [
|
|
1044
|
+
ue.id,
|
|
1044
1045
|
he.id,
|
|
1045
1046
|
pe.id,
|
|
1046
|
-
ge.id,
|
|
1047
1047
|
Q.id,
|
|
1048
1048
|
ie.id
|
|
1049
1049
|
];
|
|
@@ -1060,12 +1060,12 @@ const wt = {
|
|
|
1060
1060
|
}), !0) : !1;
|
|
1061
1061
|
}
|
|
1062
1062
|
};
|
|
1063
|
-
function
|
|
1063
|
+
function jn(n) {
|
|
1064
1064
|
return n !== null && typeof n == "object";
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function Vn(n, e, t) {
|
|
1067
1067
|
let r = 0, s = 0;
|
|
1068
|
-
const i =
|
|
1068
|
+
const i = At[e];
|
|
1069
1069
|
for (; r !== n.length && s !== t.length; ) {
|
|
1070
1070
|
const { startOffset: o, endOffset: a } = t[s], { st: c, ed: d, ts: l } = n[r];
|
|
1071
1071
|
if (a <= c)
|
|
@@ -1081,16 +1081,16 @@ function jn(n, e, t) {
|
|
|
1081
1081
|
s: D.TRUE
|
|
1082
1082
|
};
|
|
1083
1083
|
if (/va/.test(i))
|
|
1084
|
-
return e === Q.id ?
|
|
1084
|
+
return e === Q.id ? j.SUBSCRIPT : j.SUPERSCRIPT;
|
|
1085
1085
|
}
|
|
1086
|
-
if (
|
|
1086
|
+
if (jn(l == null ? void 0 : l[i]) && l[i].s === D.FALSE)
|
|
1087
1087
|
return {
|
|
1088
1088
|
s: D.TRUE
|
|
1089
1089
|
};
|
|
1090
|
-
if (e === Q.id && (l == null ? void 0 : l[i]) !==
|
|
1091
|
-
return
|
|
1092
|
-
if (e === ie.id && (l == null ? void 0 : l[i]) !==
|
|
1093
|
-
return
|
|
1090
|
+
if (e === Q.id && (l == null ? void 0 : l[i]) !== j.SUBSCRIPT)
|
|
1091
|
+
return j.SUBSCRIPT;
|
|
1092
|
+
if (e === ie.id && (l == null ? void 0 : l[i]) !== j.SUPERSCRIPT)
|
|
1093
|
+
return j.SUPERSCRIPT;
|
|
1094
1094
|
if ((l == null ? void 0 : l[i]) === D.FALSE)
|
|
1095
1095
|
return D.TRUE;
|
|
1096
1096
|
r++;
|
|
@@ -1098,7 +1098,7 @@ function jn(n, e, t) {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
return /bl|it/.test(i) ? D.FALSE : /ul|st/.test(i) ? {
|
|
1100
1100
|
s: D.FALSE
|
|
1101
|
-
} :
|
|
1101
|
+
} : j.NORMAL;
|
|
1102
1102
|
}
|
|
1103
1103
|
const Fn = {
|
|
1104
1104
|
id: "doc.command.bullet-list",
|
|
@@ -1135,7 +1135,7 @@ const Fn = {
|
|
|
1135
1135
|
unitId: p,
|
|
1136
1136
|
mutations: []
|
|
1137
1137
|
}
|
|
1138
|
-
}, v = new
|
|
1138
|
+
}, v = new we();
|
|
1139
1139
|
v.reset();
|
|
1140
1140
|
for (const y of l) {
|
|
1141
1141
|
const { startIndex: C } = y;
|
|
@@ -1209,7 +1209,7 @@ const Wn = {
|
|
|
1209
1209
|
const { unitId: t, body: r, textRanges: s, segmentId: i = "" } = e, o = n.get(O), a = n.get(x), c = n.get(P), d = n.get(N), l = (g = o.getUniverDocInstance(t)) == null ? void 0 : g.getSnapshot().body, h = c.getSelections();
|
|
1210
1210
|
if (l == null || !Array.isArray(h) || h.length === 0)
|
|
1211
1211
|
return !1;
|
|
1212
|
-
const p =
|
|
1212
|
+
const p = $t(t, i, l, r), u = a.syncExecuteCommand(p.id, p.params);
|
|
1213
1213
|
return c.replaceTextRanges(s), u ? (d.pushUndoRedo({
|
|
1214
1214
|
unitID: t,
|
|
1215
1215
|
undoMutations: [{ id: _.id, params: u }],
|
|
@@ -1230,14 +1230,14 @@ const Wn = {
|
|
|
1230
1230
|
const { unitId: t, body: r, segmentId: s = "" } = e, i = n.get(O), o = n.get(x), a = n.get(N), c = (l = i.getUniverDocInstance(t)) == null ? void 0 : l.getSnapshot().body;
|
|
1231
1231
|
if (c == null)
|
|
1232
1232
|
return !1;
|
|
1233
|
-
const d =
|
|
1233
|
+
const d = $t(t, s, c, r);
|
|
1234
1234
|
return o.syncExecuteCommand(
|
|
1235
1235
|
d.id,
|
|
1236
1236
|
d.params
|
|
1237
1237
|
), a.clearUndoRedo(t), !0;
|
|
1238
1238
|
}
|
|
1239
1239
|
};
|
|
1240
|
-
function
|
|
1240
|
+
function $t(n, e, t, r) {
|
|
1241
1241
|
const s = {
|
|
1242
1242
|
id: _.id,
|
|
1243
1243
|
params: {
|
|
@@ -1284,7 +1284,7 @@ const ee = {
|
|
|
1284
1284
|
zoomRatio: e.zoomRatio
|
|
1285
1285
|
} : r.settings.zoomRatio = e.zoomRatio, !0;
|
|
1286
1286
|
}
|
|
1287
|
-
},
|
|
1287
|
+
}, Bt = {
|
|
1288
1288
|
type: R.COMMAND,
|
|
1289
1289
|
id: "doc.command.set-zoom-ratio",
|
|
1290
1290
|
handler: async (n, e) => {
|
|
@@ -1302,7 +1302,7 @@ const ee = {
|
|
|
1302
1302
|
redoMutations: [{ id: Z.id, params: c }]
|
|
1303
1303
|
}), !0) : !1;
|
|
1304
1304
|
}
|
|
1305
|
-
},
|
|
1305
|
+
}, jt = {
|
|
1306
1306
|
id: "doc.operation.select-all",
|
|
1307
1307
|
type: R.COMMAND,
|
|
1308
1308
|
handler: async (n) => {
|
|
@@ -1327,7 +1327,7 @@ function Zn(n) {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
class Kn {
|
|
1329
1329
|
constructor() {
|
|
1330
|
-
S(this, "_cache", new
|
|
1330
|
+
S(this, "_cache", new Wt(Xn));
|
|
1331
1331
|
}
|
|
1332
1332
|
set(e, t) {
|
|
1333
1333
|
this._cache.set(e, t);
|
|
@@ -1339,7 +1339,7 @@ class Kn {
|
|
|
1339
1339
|
this._cache.clear();
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
const
|
|
1342
|
+
const ft = new Kn();
|
|
1343
1343
|
function Jn(n) {
|
|
1344
1344
|
const e = n.style, t = {};
|
|
1345
1345
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -1347,19 +1347,19 @@ function Jn(n) {
|
|
|
1347
1347
|
switch (s) {
|
|
1348
1348
|
case "margin-top": {
|
|
1349
1349
|
const o = parseInt(i);
|
|
1350
|
-
t.spaceAbove = /pt/.test(i) ?
|
|
1350
|
+
t.spaceAbove = /pt/.test(i) ? qe(o) : o;
|
|
1351
1351
|
break;
|
|
1352
1352
|
}
|
|
1353
1353
|
case "margin-bottom": {
|
|
1354
1354
|
const o = parseInt(i);
|
|
1355
|
-
t.spaceBelow = /pt/.test(i) ?
|
|
1355
|
+
t.spaceBelow = /pt/.test(i) ? qe(o) : o;
|
|
1356
1356
|
break;
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
1360
|
return Object.getOwnPropertyNames(t).length ? t : null;
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1362
|
+
function qe(n) {
|
|
1363
1363
|
return n / 0.75;
|
|
1364
1364
|
}
|
|
1365
1365
|
function rt(n) {
|
|
@@ -1389,7 +1389,7 @@ function rt(n) {
|
|
|
1389
1389
|
}
|
|
1390
1390
|
case "sub":
|
|
1391
1391
|
case "sup": {
|
|
1392
|
-
t.va = r === "sup" ?
|
|
1392
|
+
t.va = r === "sup" ? j.SUPERSCRIPT : j.SUBSCRIPT;
|
|
1393
1393
|
break;
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
@@ -1402,7 +1402,7 @@ function rt(n) {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
case "font-size": {
|
|
1404
1404
|
const a = parseInt(o);
|
|
1405
|
-
Number.isNaN(a) || (t.fs = /pt$/.test(o) ?
|
|
1405
|
+
Number.isNaN(a) || (t.fs = /pt$/.test(o) ? qe(a) : a);
|
|
1406
1406
|
break;
|
|
1407
1407
|
}
|
|
1408
1408
|
case "font-style": {
|
|
@@ -1445,53 +1445,53 @@ function Qn(n) {
|
|
|
1445
1445
|
const e = new DOMParser(), t = `<x-univer id="univer-root">${n}</x-univer>`;
|
|
1446
1446
|
return e.parseFromString(t, "text/html").querySelector("#univer-root");
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1448
|
+
function _t(n, e) {
|
|
1449
1449
|
const t = n.tagName.toLowerCase();
|
|
1450
1450
|
return typeof e == "string" ? t === e : Array.isArray(e) ? e.some((r) => r === t) : e(n);
|
|
1451
1451
|
}
|
|
1452
|
-
const
|
|
1452
|
+
const Ue = class Ue {
|
|
1453
1453
|
constructor() {
|
|
1454
|
-
S(this, "
|
|
1455
|
-
S(this, "
|
|
1456
|
-
S(this, "
|
|
1454
|
+
S(this, "_styleCache", /* @__PURE__ */ new Map());
|
|
1455
|
+
S(this, "_styleRules", []);
|
|
1456
|
+
S(this, "_afterProcessRules", []);
|
|
1457
1457
|
}
|
|
1458
1458
|
static use(e) {
|
|
1459
|
-
if (this.
|
|
1459
|
+
if (this._pluginList.includes(e))
|
|
1460
1460
|
throw new Error(`Univer paste plugin ${e.name} already added`);
|
|
1461
|
-
this.
|
|
1461
|
+
this._pluginList.push(e);
|
|
1462
1462
|
}
|
|
1463
1463
|
convert(e) {
|
|
1464
|
-
const t =
|
|
1464
|
+
const t = Ue._pluginList.find((i) => i.checkPasteType(e)), r = Qn(e), s = {
|
|
1465
1465
|
dataStream: "",
|
|
1466
1466
|
textRuns: []
|
|
1467
1467
|
};
|
|
1468
|
-
return t && (this.
|
|
1468
|
+
return t && (this._styleRules = [...t.stylesRules], this._afterProcessRules = [...t.afterProcessRules]), this._styleCache.clear(), this._process(null, r == null ? void 0 : r.childNodes, s), this._styleCache.clear(), this._styleRules = [], this._afterProcessRules = [], s;
|
|
1469
1469
|
}
|
|
1470
|
-
|
|
1470
|
+
_process(e, t, r) {
|
|
1471
1471
|
var s;
|
|
1472
1472
|
for (const i of t)
|
|
1473
1473
|
if (i.nodeType === Node.TEXT_NODE) {
|
|
1474
1474
|
const o = (s = i.nodeValue) == null ? void 0 : s.replace(/[\r\n]/g, "");
|
|
1475
1475
|
let a;
|
|
1476
|
-
e && this.
|
|
1476
|
+
e && this._styleCache.has(e) && (a = this._styleCache.get(e)), r.dataStream += o, a && Object.getOwnPropertyNames(a).length && r.textRuns.push({
|
|
1477
1477
|
st: r.dataStream.length - o.length,
|
|
1478
1478
|
ed: r.dataStream.length,
|
|
1479
1479
|
ts: a
|
|
1480
1480
|
});
|
|
1481
1481
|
} else if (i.nodeType === Node.ELEMENT_NODE) {
|
|
1482
|
-
const o = e ? this.
|
|
1483
|
-
this.
|
|
1482
|
+
const o = e ? this._styleCache.get(e) : {}, a = this._styleRules.find(({ filter: h }) => _t(i, h)), c = a ? a.getStyle(i) : rt(i);
|
|
1483
|
+
this._styleCache.set(i, { ...o, ...c });
|
|
1484
1484
|
const { childNodes: d } = i;
|
|
1485
|
-
this.
|
|
1486
|
-
const l = this.
|
|
1487
|
-
({ filter: h }) =>
|
|
1485
|
+
this._process(i, d, r);
|
|
1486
|
+
const l = this._afterProcessRules.find(
|
|
1487
|
+
({ filter: h }) => _t(i, h)
|
|
1488
1488
|
);
|
|
1489
1489
|
l && l.handler(r, i);
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
1492
|
};
|
|
1493
|
-
S(
|
|
1494
|
-
let
|
|
1493
|
+
S(Ue, "_pluginList", []);
|
|
1494
|
+
let ge = Ue;
|
|
1495
1495
|
const er = {
|
|
1496
1496
|
name: "univer-doc-paste-plugin-lark",
|
|
1497
1497
|
checkPasteType(n) {
|
|
@@ -1557,9 +1557,9 @@ function nr(n, e) {
|
|
|
1557
1557
|
const { st: t, ed: r, ts: s = {} } = e, { ff: i, fs: o, it: a, bl: c, ul: d, st: l, ol: h, bg: p, cl: u, va: g } = s;
|
|
1558
1558
|
let m = n.slice(t, r);
|
|
1559
1559
|
const f = [];
|
|
1560
|
-
return a === D.TRUE && (m = `<i>${m}</i>`), g ===
|
|
1560
|
+
return a === D.TRUE && (m = `<i>${m}</i>`), g === j.SUPERSCRIPT ? m = `<sup>${m}</sup>` : g === j.SUBSCRIPT && (m = `<sub>${m}</sub>`), (d == null ? void 0 : d.s) === D.TRUE && (m = `<u>${m}</u>`), (l == null ? void 0 : l.s) === D.TRUE && (m = `<s>${m}</s>`), c === D.TRUE && (m = `<strong>${m}</strong>`), i && f.push(`font-family: ${i}`), u && f.push(`color: ${u.rgb}`), o && f.push(`font-size: ${o}px`), h && f.push("text-decoration: overline"), p && f.push(`background: ${p.rgb}`), f.length ? `<span style="${f.join(";")}">${m}</span>` : m;
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function St(n, e = !0) {
|
|
1563
1563
|
const { dataStream: t, textRuns: r = [], paragraphs: s = [] } = n;
|
|
1564
1564
|
let i = 0;
|
|
1565
1565
|
const o = [], a = [];
|
|
@@ -1583,10 +1583,10 @@ class rr {
|
|
|
1583
1583
|
if (e.length === 0)
|
|
1584
1584
|
throw new Error("The bodyList length at least to be 1");
|
|
1585
1585
|
if (e.length === 1)
|
|
1586
|
-
return
|
|
1586
|
+
return St(e[0]);
|
|
1587
1587
|
let t = "";
|
|
1588
1588
|
for (const r of e)
|
|
1589
|
-
t += '<p className="UniverNormal">', t +=
|
|
1589
|
+
t += '<p className="UniverNormal">', t += St(r, !1), t += "</p>";
|
|
1590
1590
|
return t;
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
@@ -1594,15 +1594,24 @@ var sr = Object.defineProperty, ir = Object.getOwnPropertyDescriptor, or = (n, e
|
|
|
1594
1594
|
for (var s = r > 1 ? void 0 : r ? ir(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
1595
1595
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
1596
1596
|
return r && s && sr(e, t, s), s;
|
|
1597
|
-
},
|
|
1598
|
-
|
|
1599
|
-
|
|
1597
|
+
}, vt = (n, e) => (t, r) => e(t, r, n);
|
|
1598
|
+
ge.use(tr);
|
|
1599
|
+
ge.use(er);
|
|
1600
|
+
function ar(n) {
|
|
1601
|
+
const e = n.replace(/\n/g, "\r"), t = [];
|
|
1602
|
+
for (let r = 0; r < e.length; r++)
|
|
1603
|
+
e[r] === "\r" && t.push({ startIndex: r });
|
|
1604
|
+
return {
|
|
1605
|
+
dataStream: e,
|
|
1606
|
+
paragraphs: t
|
|
1607
|
+
};
|
|
1608
|
+
}
|
|
1600
1609
|
const Vt = Mn("doc.clipboard-service");
|
|
1601
|
-
let
|
|
1610
|
+
let Ye = class extends W {
|
|
1602
1611
|
constructor(e, t) {
|
|
1603
1612
|
super();
|
|
1604
1613
|
S(this, "_clipboardHooks", []);
|
|
1605
|
-
S(this, "_htmlToUDM", new
|
|
1614
|
+
S(this, "_htmlToUDM", new ge());
|
|
1606
1615
|
S(this, "_umdToHtml", new rr());
|
|
1607
1616
|
this._currentUniverService = e, this._clipboardInterfaceService = t;
|
|
1608
1617
|
}
|
|
@@ -1616,12 +1625,10 @@ let Ke = class extends j {
|
|
|
1616
1625
|
for (const o of i.types)
|
|
1617
1626
|
o === mn ? r = await i.getType(o).then((a) => a && a.text()) : o === fn && (t = await i.getType(o).then((a) => a && a.text()));
|
|
1618
1627
|
if (!t)
|
|
1619
|
-
return
|
|
1620
|
-
dataStream: r
|
|
1621
|
-
};
|
|
1628
|
+
return ar(r);
|
|
1622
1629
|
const s = Zn(t);
|
|
1623
1630
|
if (s) {
|
|
1624
|
-
const i =
|
|
1631
|
+
const i = ft.get(s);
|
|
1625
1632
|
if (i)
|
|
1626
1633
|
return i;
|
|
1627
1634
|
}
|
|
@@ -1634,50 +1641,50 @@ let Ke = class extends j {
|
|
|
1634
1641
|
const t = Yn(), r = e.length > 1 ? e.map((i) => i.dataStream).join(`
|
|
1635
1642
|
`) : e[0].dataStream;
|
|
1636
1643
|
let s = this._umdToHtml.convert(e);
|
|
1637
|
-
return e.length === 1 && (s = s.replace(/(<[a-z]+)/, (i, o) => `${o} data-copy-id="${t}"`),
|
|
1644
|
+
return e.length === 1 && (s = s.replace(/(<[a-z]+)/, (i, o) => `${o} data-copy-id="${t}"`), ft.set(t, e[0])), this._clipboardInterfaceService.write(r, s);
|
|
1638
1645
|
}
|
|
1639
1646
|
addClipboardHook(e) {
|
|
1640
|
-
return this._clipboardHooks.push(e),
|
|
1647
|
+
return this._clipboardHooks.push(e), Ge(() => {
|
|
1641
1648
|
const t = this._clipboardHooks.indexOf(e);
|
|
1642
1649
|
t > -1 && this._clipboardHooks.splice(t, 1);
|
|
1643
1650
|
});
|
|
1644
1651
|
}
|
|
1645
1652
|
};
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
],
|
|
1650
|
-
var
|
|
1651
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1653
|
+
Ye = or([
|
|
1654
|
+
vt(0, O),
|
|
1655
|
+
vt(1, _n)
|
|
1656
|
+
], Ye);
|
|
1657
|
+
var cr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, dr = (n, e, t, r) => {
|
|
1658
|
+
for (var s = r > 1 ? void 0 : r ? lr(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
1652
1659
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
1653
|
-
return r && s &&
|
|
1660
|
+
return r && s && cr(e, t, s), s;
|
|
1654
1661
|
}, ne = (n, e) => (t, r) => e(t, r, n);
|
|
1655
|
-
let
|
|
1662
|
+
let Me = class extends W {
|
|
1656
1663
|
constructor(n, e, t, r, s, i) {
|
|
1657
1664
|
super(), this._logService = n, this._commandService = e, this._currentUniverService = t, this._docClipboardService = r, this._textSelectionManagerService = s, this._contextService = i, this._commandExecutedListener(), this.initialize();
|
|
1658
1665
|
}
|
|
1659
1666
|
initialize() {
|
|
1660
|
-
[
|
|
1667
|
+
[Ve, Fe, ke].forEach(
|
|
1661
1668
|
(n) => this.disposeWithMe(this._commandService.registerAsMultipleCommand(n))
|
|
1662
|
-
), [
|
|
1669
|
+
), [mt, Ee].forEach(
|
|
1663
1670
|
(n) => this.disposeWithMe(this._commandService.registerCommand(n))
|
|
1664
1671
|
);
|
|
1665
1672
|
}
|
|
1666
1673
|
_commandExecutedListener() {
|
|
1667
|
-
const n = [
|
|
1674
|
+
const n = [Fe.id, Ve.id, ke.id];
|
|
1668
1675
|
this.disposeWithMe(
|
|
1669
1676
|
this._commandService.onCommandExecuted((e) => {
|
|
1670
|
-
if (n.includes(e.id) && !(!this._contextService.getContextValue(w) && !this._contextService.getContextValue(
|
|
1677
|
+
if (n.includes(e.id) && !(!this._contextService.getContextValue(w) && !this._contextService.getContextValue(me)))
|
|
1671
1678
|
switch (e.id) {
|
|
1672
|
-
case
|
|
1679
|
+
case ke.id: {
|
|
1673
1680
|
this._handlePaste();
|
|
1674
1681
|
break;
|
|
1675
1682
|
}
|
|
1676
|
-
case
|
|
1683
|
+
case Ve.id: {
|
|
1677
1684
|
this._handleCopy();
|
|
1678
1685
|
break;
|
|
1679
1686
|
}
|
|
1680
|
-
case
|
|
1687
|
+
case Fe.id: {
|
|
1681
1688
|
this._handleCut();
|
|
1682
1689
|
break;
|
|
1683
1690
|
}
|
|
@@ -1708,7 +1715,7 @@ let Ce = class extends j {
|
|
|
1708
1715
|
style: r
|
|
1709
1716
|
}
|
|
1710
1717
|
];
|
|
1711
|
-
this._commandService.executeCommand(
|
|
1718
|
+
this._commandService.executeCommand(mt.id, { body: i, segmentId: e, textRanges: a });
|
|
1712
1719
|
} catch {
|
|
1713
1720
|
this._logService.error("[DocClipboardController] clipboard is empty");
|
|
1714
1721
|
}
|
|
@@ -1785,33 +1792,33 @@ let Ce = class extends j {
|
|
|
1785
1792
|
style: t
|
|
1786
1793
|
}
|
|
1787
1794
|
];
|
|
1788
|
-
this._commandService.executeCommand(
|
|
1795
|
+
this._commandService.executeCommand(Ee.id, { segmentId: n, textRanges: i });
|
|
1789
1796
|
} catch {
|
|
1790
1797
|
this._logService.error("[DocClipboardController] cut content failed");
|
|
1791
1798
|
}
|
|
1792
1799
|
}
|
|
1793
1800
|
}
|
|
1794
1801
|
};
|
|
1795
|
-
|
|
1796
|
-
F
|
|
1797
|
-
ne(0,
|
|
1802
|
+
Me = dr([
|
|
1803
|
+
V(F.Rendered, Me),
|
|
1804
|
+
ne(0, Ht),
|
|
1798
1805
|
ne(1, x),
|
|
1799
1806
|
ne(2, O),
|
|
1800
1807
|
ne(3, Vt),
|
|
1801
1808
|
ne(4, U(P)),
|
|
1802
|
-
ne(5,
|
|
1803
|
-
],
|
|
1804
|
-
var
|
|
1805
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1809
|
+
ne(5, Gt)
|
|
1810
|
+
], Me);
|
|
1811
|
+
var ur = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, pr = (n, e, t, r) => {
|
|
1812
|
+
for (var s = r > 1 ? void 0 : r ? hr(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
1806
1813
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
1807
|
-
return r && s &&
|
|
1808
|
-
},
|
|
1809
|
-
let
|
|
1814
|
+
return r && s && ur(e, t, s), s;
|
|
1815
|
+
}, ze = (n, e) => (t, r) => e(t, r, n);
|
|
1816
|
+
let Ce = class extends Ze {
|
|
1810
1817
|
constructor(n, e, t) {
|
|
1811
1818
|
super(), this._docSkeletonManagerService = n, this._renderManagerService = e, this._commandService = t, this._initialRenderRefresh(), this._commandExecutedListener();
|
|
1812
1819
|
}
|
|
1813
1820
|
_initialRenderRefresh() {
|
|
1814
|
-
this._docSkeletonManagerService.currentSkeletonBefore$.subscribe((n) => {
|
|
1821
|
+
this._docSkeletonManagerService.currentSkeletonBefore$.pipe(bt(this.dispose$)).subscribe((n) => {
|
|
1815
1822
|
if (n == null)
|
|
1816
1823
|
return;
|
|
1817
1824
|
const { skeleton: e, unitId: t } = n, r = this._renderManagerService.getRenderById(t);
|
|
@@ -1821,39 +1828,6 @@ let Re = class extends j {
|
|
|
1821
1828
|
s.changeSkeleton(e), this._recalculateSizeBySkeleton(r, e);
|
|
1822
1829
|
});
|
|
1823
1830
|
}
|
|
1824
|
-
// calculatePagePosition(currentRender: IRender) {
|
|
1825
|
-
// const { mainComponent, scene } = currentRender;
|
|
1826
|
-
// const docsComponent = mainComponent as Documents;
|
|
1827
|
-
// const parent = scene?.getParent();
|
|
1828
|
-
// const { width: docsWidth, height: docsHeight, pageMarginLeft, pageMarginTop } = docsComponent;
|
|
1829
|
-
// if (parent == null || docsWidth === Infinity || docsHeight === Infinity) {
|
|
1830
|
-
// return;
|
|
1831
|
-
// }
|
|
1832
|
-
// const { width: engineWidth, height: engineHeight } = parent;
|
|
1833
|
-
// let docsLeft = 0;
|
|
1834
|
-
// let docsTop = 0;
|
|
1835
|
-
// let sceneWidth = 0;
|
|
1836
|
-
// let sceneHeight = 0;
|
|
1837
|
-
// if (engineWidth > docsWidth) {
|
|
1838
|
-
// docsLeft = engineWidth / 2 - docsWidth / 2;
|
|
1839
|
-
// sceneWidth = engineWidth - 34;
|
|
1840
|
-
// } else {
|
|
1841
|
-
// docsLeft = pageMarginLeft;
|
|
1842
|
-
// sceneWidth = docsWidth + pageMarginLeft * 2;
|
|
1843
|
-
// }
|
|
1844
|
-
// if (engineHeight > docsHeight) {
|
|
1845
|
-
// docsTop = engineHeight / 2 - docsHeight / 2;
|
|
1846
|
-
// sceneHeight = engineHeight - 34;
|
|
1847
|
-
// } else {
|
|
1848
|
-
// docsTop = pageMarginTop;
|
|
1849
|
-
// sceneHeight = docsHeight + pageMarginTop * 2;
|
|
1850
|
-
// }
|
|
1851
|
-
// // this.docsLeft = docsLeft;
|
|
1852
|
-
// // this.docsTop = docsTop;
|
|
1853
|
-
// scene.resize(sceneWidth, sceneHeight + 200);
|
|
1854
|
-
// docsComponent.translate(docsLeft, docsTop);
|
|
1855
|
-
// return this;
|
|
1856
|
-
// }
|
|
1857
1831
|
_recalculateSizeBySkeleton(n, e) {
|
|
1858
1832
|
var d;
|
|
1859
1833
|
const { mainComponent: t, scene: r } = n, s = t, i = (d = e.getSkeletonData()) == null ? void 0 : d.pages;
|
|
@@ -1888,21 +1862,21 @@ let Re = class extends j {
|
|
|
1888
1862
|
);
|
|
1889
1863
|
}
|
|
1890
1864
|
};
|
|
1891
|
-
|
|
1892
|
-
F
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
],
|
|
1897
|
-
var
|
|
1898
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1865
|
+
Ce = pr([
|
|
1866
|
+
V(F.Rendered, Ce),
|
|
1867
|
+
ze(0, U(A)),
|
|
1868
|
+
ze(1, G),
|
|
1869
|
+
ze(2, x)
|
|
1870
|
+
], Ce);
|
|
1871
|
+
var gr = Object.defineProperty, mr = Object.getOwnPropertyDescriptor, fr = (n, e, t, r) => {
|
|
1872
|
+
for (var s = r > 1 ? void 0 : r ? mr(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
1899
1873
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
1900
|
-
return r && s &&
|
|
1874
|
+
return r && s && gr(e, t, s), s;
|
|
1901
1875
|
}, oe = (n, e) => (t, r) => e(t, r, n);
|
|
1902
|
-
let
|
|
1876
|
+
let Re = class extends W {
|
|
1903
1877
|
constructor(e, t, r, s, i) {
|
|
1904
1878
|
super();
|
|
1905
|
-
S(this, "_liquid", new
|
|
1879
|
+
S(this, "_liquid", new sn());
|
|
1906
1880
|
S(this, "_pageMarginCache", /* @__PURE__ */ new Map());
|
|
1907
1881
|
this._docSkeletonManagerService = e, this._currentUniverService = t, this._renderManagerService = r, this._commandService = s, this._floatingObjectManagerService = i, this._initialize(), this._commandExecutedListener();
|
|
1908
1882
|
}
|
|
@@ -1919,10 +1893,10 @@ let Ie = class extends j {
|
|
|
1919
1893
|
return;
|
|
1920
1894
|
const { mainComponent: o, components: a, scene: c } = i, d = o, { left: l, top: h } = d;
|
|
1921
1895
|
e.forEach((p) => {
|
|
1922
|
-
const { unitId: u, subComponentId: g, floatingObjectId: m, floatingObject: f } = p, { left: v = 0, top: M = 0, width: T = 0, height: y = 0, angle: C, flipX: E, flipY: L, skewX: B, skewY:
|
|
1896
|
+
const { unitId: u, subComponentId: g, floatingObjectId: m, floatingObject: f } = p, { left: v = 0, top: M = 0, width: T = 0, height: y = 0, angle: C, flipX: E, flipY: L, skewX: B, skewY: k } = f, I = this._pageMarginCache.get(m), X = (I == null ? void 0 : I.marginLeft) || 0, z = (I == null ? void 0 : I.marginTop) || 0;
|
|
1923
1897
|
s == null || s.getViewModel().getDataModel().updateDrawing(m, {
|
|
1924
1898
|
left: v - l - X,
|
|
1925
|
-
top: M - h -
|
|
1899
|
+
top: M - h - z,
|
|
1926
1900
|
height: y,
|
|
1927
1901
|
width: T
|
|
1928
1902
|
});
|
|
@@ -1973,15 +1947,15 @@ let Ie = class extends j {
|
|
|
1973
1947
|
for (let m = 0, f = u.length; m < f; m++) {
|
|
1974
1948
|
const v = u[m], { skeDrawings: M, marginLeft: T, marginTop: y } = v;
|
|
1975
1949
|
this._liquid.translatePagePadding(v), M.forEach((C) => {
|
|
1976
|
-
const { aLeft: E, aTop: L, height: B, width:
|
|
1950
|
+
const { aLeft: E, aTop: L, height: B, width: k, objectId: I } = C;
|
|
1977
1951
|
g.push({
|
|
1978
1952
|
unitId: e,
|
|
1979
|
-
subComponentId:
|
|
1953
|
+
subComponentId: Xt,
|
|
1980
1954
|
floatingObjectId: I,
|
|
1981
1955
|
floatingObject: {
|
|
1982
1956
|
left: E + c + this._liquid.x,
|
|
1983
1957
|
top: L + d + this._liquid.y,
|
|
1984
|
-
width:
|
|
1958
|
+
width: k,
|
|
1985
1959
|
height: B
|
|
1986
1960
|
}
|
|
1987
1961
|
}), this._pageMarginCache.set(I, {
|
|
@@ -1993,20 +1967,20 @@ let Ie = class extends j {
|
|
|
1993
1967
|
this._floatingObjectManagerService.BatchAddOrUpdate(g);
|
|
1994
1968
|
}
|
|
1995
1969
|
};
|
|
1996
|
-
|
|
1997
|
-
F
|
|
1970
|
+
Re = fr([
|
|
1971
|
+
V(F.Steady, Re),
|
|
1998
1972
|
oe(0, U(A)),
|
|
1999
1973
|
oe(1, O),
|
|
2000
1974
|
oe(2, G),
|
|
2001
1975
|
oe(3, x),
|
|
2002
|
-
oe(4,
|
|
2003
|
-
],
|
|
2004
|
-
var
|
|
2005
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1976
|
+
oe(4, qt)
|
|
1977
|
+
], Re);
|
|
1978
|
+
var _r = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, vr = (n, e, t, r) => {
|
|
1979
|
+
for (var s = r > 1 ? void 0 : r ? Sr(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2006
1980
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2007
|
-
return r && s &&
|
|
1981
|
+
return r && s && _r(e, t, s), s;
|
|
2008
1982
|
}, re = (n, e) => (t, r) => e(t, r, n);
|
|
2009
|
-
let
|
|
1983
|
+
let Ie = class extends W {
|
|
2010
1984
|
constructor(e, t, r, s, i, o) {
|
|
2011
1985
|
super();
|
|
2012
1986
|
S(this, "_previousIMEContent", "");
|
|
@@ -2059,7 +2033,7 @@ let xe = class extends j {
|
|
|
2059
2033
|
style: d
|
|
2060
2034
|
}
|
|
2061
2035
|
];
|
|
2062
|
-
await this._commandService.executeCommand(
|
|
2036
|
+
await this._commandService.executeCommand(Lt.id, {
|
|
2063
2037
|
unitId: s.getUnitId(),
|
|
2064
2038
|
newText: h,
|
|
2065
2039
|
oldTextLen: this._previousIMEContent.length,
|
|
@@ -2073,37 +2047,37 @@ let xe = class extends j {
|
|
|
2073
2047
|
this._previousIMEContent = "", this._previousIMERange = null, this._imeInputManagerService.clearUndoRedoMutationParamsCache(), this._imeInputManagerService.setActiveRange(null);
|
|
2074
2048
|
}
|
|
2075
2049
|
_getDocObject() {
|
|
2076
|
-
return
|
|
2050
|
+
return Le(this._currentUniverService, this._renderManagerService);
|
|
2077
2051
|
}
|
|
2078
2052
|
};
|
|
2079
|
-
|
|
2080
|
-
F
|
|
2053
|
+
Ie = vr([
|
|
2054
|
+
V(F.Rendered, Ie),
|
|
2081
2055
|
re(0, U(A)),
|
|
2082
2056
|
re(1, O),
|
|
2083
2057
|
re(2, G),
|
|
2084
|
-
re(3,
|
|
2058
|
+
re(3, fe),
|
|
2085
2059
|
re(4, U(tt)),
|
|
2086
2060
|
re(5, x)
|
|
2087
|
-
],
|
|
2088
|
-
var
|
|
2089
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2061
|
+
], Ie);
|
|
2062
|
+
var Mr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Rr = (n, e, t, r) => {
|
|
2063
|
+
for (var s = r > 1 ? void 0 : r ? Cr(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2090
2064
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2091
|
-
return r && s &&
|
|
2092
|
-
},
|
|
2093
|
-
let
|
|
2065
|
+
return r && s && Mr(e, t, s), s;
|
|
2066
|
+
}, Mt = (n, e) => (t, r) => e(t, r, n);
|
|
2067
|
+
let xe = class extends W {
|
|
2094
2068
|
constructor(n, e) {
|
|
2095
2069
|
super(), this._textSelectionManagerService = n, this._commandService = e, this._commandExecutedListener();
|
|
2096
2070
|
}
|
|
2097
2071
|
_commandExecutedListener() {
|
|
2098
2072
|
const n = [
|
|
2099
|
-
|
|
2073
|
+
ue.id,
|
|
2074
|
+
Ne.id,
|
|
2100
2075
|
$e.id,
|
|
2101
2076
|
Be.id,
|
|
2102
|
-
Ve.id,
|
|
2103
2077
|
Q.id,
|
|
2104
2078
|
ie.id,
|
|
2079
|
+
he.id,
|
|
2105
2080
|
pe.id,
|
|
2106
|
-
ge.id,
|
|
2107
2081
|
je.id
|
|
2108
2082
|
];
|
|
2109
2083
|
this.disposeWithMe(
|
|
@@ -2114,24 +2088,24 @@ let Oe = class extends j {
|
|
|
2114
2088
|
}
|
|
2115
2089
|
_handleInlineFormat(n) {
|
|
2116
2090
|
const { segmentId: e } = this._textSelectionManagerService.getActiveRange() ?? {};
|
|
2117
|
-
e != null && this._commandService.executeCommand(
|
|
2091
|
+
e != null && this._commandService.executeCommand(Nt.id, {
|
|
2118
2092
|
segmentId: e,
|
|
2119
2093
|
preCommandId: n.id,
|
|
2120
2094
|
...n.params ?? {}
|
|
2121
2095
|
});
|
|
2122
2096
|
}
|
|
2123
2097
|
};
|
|
2124
|
-
|
|
2125
|
-
F
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
],
|
|
2129
|
-
var
|
|
2130
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2098
|
+
xe = Rr([
|
|
2099
|
+
V(F.Rendered, xe),
|
|
2100
|
+
Mt(0, U(P)),
|
|
2101
|
+
Mt(1, x)
|
|
2102
|
+
], xe);
|
|
2103
|
+
var Ir = Object.defineProperty, xr = Object.getOwnPropertyDescriptor, Or = (n, e, t, r) => {
|
|
2104
|
+
for (var s = r > 1 ? void 0 : r ? xr(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2131
2105
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2132
|
-
return r && s &&
|
|
2106
|
+
return r && s && Ir(e, t, s), s;
|
|
2133
2107
|
}, ae = (n, e) => (t, r) => e(t, r, n);
|
|
2134
|
-
let
|
|
2108
|
+
let Oe = class extends W {
|
|
2135
2109
|
constructor(e, t, r, s, i) {
|
|
2136
2110
|
super();
|
|
2137
2111
|
S(this, "_onInputSubscription");
|
|
@@ -2305,7 +2279,7 @@ let ye = class extends j {
|
|
|
2305
2279
|
return e.findPositionBySpan(s.span);
|
|
2306
2280
|
}
|
|
2307
2281
|
_getNextOrPrevLine(e, t) {
|
|
2308
|
-
var g, m, f, v, M, T, y, C, E, L, B,
|
|
2282
|
+
var g, m, f, v, M, T, y, C, E, L, B, k;
|
|
2309
2283
|
const r = e.parent;
|
|
2310
2284
|
if (r == null)
|
|
2311
2285
|
return;
|
|
@@ -2344,8 +2318,8 @@ let ye = class extends j {
|
|
|
2344
2318
|
if (t === !0)
|
|
2345
2319
|
a = (M = (v = l.sections[h - 1]) == null ? void 0 : v.columns[0]) == null ? void 0 : M.lines[0];
|
|
2346
2320
|
else {
|
|
2347
|
-
const I = (y = (T = l.sections) == null ? void 0 : T[h - 1]) == null ? void 0 : y.columns, X = I == null ? void 0 : I[I.length - 1],
|
|
2348
|
-
a =
|
|
2321
|
+
const I = (y = (T = l.sections) == null ? void 0 : T[h - 1]) == null ? void 0 : y.columns, X = I == null ? void 0 : I[I.length - 1], z = X == null ? void 0 : X.lines;
|
|
2322
|
+
a = z == null ? void 0 : z[z.length - 1];
|
|
2349
2323
|
}
|
|
2350
2324
|
if (a != null)
|
|
2351
2325
|
return a;
|
|
@@ -2360,7 +2334,7 @@ let ye = class extends j {
|
|
|
2360
2334
|
const I = (B = p.pages[u - 1]) == null ? void 0 : B.sections;
|
|
2361
2335
|
if (I == null)
|
|
2362
2336
|
return;
|
|
2363
|
-
const X = (
|
|
2337
|
+
const X = (k = I[I.length - 1]) == null ? void 0 : k.columns, z = X[X.length - 1], st = z == null ? void 0 : z.lines;
|
|
2364
2338
|
a = st[st.length - 1];
|
|
2365
2339
|
}
|
|
2366
2340
|
if (a != null)
|
|
@@ -2368,23 +2342,23 @@ let ye = class extends j {
|
|
|
2368
2342
|
}
|
|
2369
2343
|
}
|
|
2370
2344
|
_getDocObject() {
|
|
2371
|
-
return
|
|
2345
|
+
return Le(this._currentUniverService, this._renderManagerService);
|
|
2372
2346
|
}
|
|
2373
2347
|
};
|
|
2374
|
-
|
|
2375
|
-
F
|
|
2348
|
+
Oe = Or([
|
|
2349
|
+
V(F.Rendered, Oe),
|
|
2376
2350
|
ae(0, U(A)),
|
|
2377
2351
|
ae(1, O),
|
|
2378
2352
|
ae(2, G),
|
|
2379
2353
|
ae(3, U(P)),
|
|
2380
2354
|
ae(4, x)
|
|
2381
|
-
],
|
|
2382
|
-
var
|
|
2383
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2355
|
+
], Oe);
|
|
2356
|
+
var yr = Object.defineProperty, br = Object.getOwnPropertyDescriptor, Dr = (n, e, t, r) => {
|
|
2357
|
+
for (var s = r > 1 ? void 0 : r ? br(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2384
2358
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2385
|
-
return r && s &&
|
|
2359
|
+
return r && s && yr(e, t, s), s;
|
|
2386
2360
|
}, ce = (n, e) => (t, r) => e(t, r, n);
|
|
2387
|
-
let
|
|
2361
|
+
let ye = class extends W {
|
|
2388
2362
|
constructor(e, t, r, s, i) {
|
|
2389
2363
|
super();
|
|
2390
2364
|
S(this, "_onInputSubscription");
|
|
@@ -2426,24 +2400,24 @@ let be = class extends j {
|
|
|
2426
2400
|
_commandExecutedListener() {
|
|
2427
2401
|
}
|
|
2428
2402
|
_getDocObject() {
|
|
2429
|
-
return
|
|
2403
|
+
return Le(this._currentUniverService, this._renderManagerService);
|
|
2430
2404
|
}
|
|
2431
2405
|
};
|
|
2432
|
-
|
|
2433
|
-
F
|
|
2406
|
+
ye = Dr([
|
|
2407
|
+
V(F.Rendered, ye),
|
|
2434
2408
|
ce(0, U(A)),
|
|
2435
2409
|
ce(1, O),
|
|
2436
2410
|
ce(2, G),
|
|
2437
|
-
ce(3,
|
|
2411
|
+
ce(3, fe),
|
|
2438
2412
|
ce(4, x)
|
|
2439
|
-
],
|
|
2440
|
-
var
|
|
2441
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2413
|
+
], ye);
|
|
2414
|
+
var Tr = Object.defineProperty, Pr = Object.getOwnPropertyDescriptor, Er = (n, e, t, r) => {
|
|
2415
|
+
for (var s = r > 1 ? void 0 : r ? Pr(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2442
2416
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2443
|
-
return r && s &&
|
|
2444
|
-
},
|
|
2445
|
-
const
|
|
2446
|
-
let
|
|
2417
|
+
return r && s && Tr(e, t, s), s;
|
|
2418
|
+
}, Ct = (n, e) => (t, r) => e(t, r, n);
|
|
2419
|
+
const Ur = "rgba(198, 198, 198, 1)", wr = "rgba(255, 255, 255, 1)";
|
|
2420
|
+
let be = class extends W {
|
|
2447
2421
|
constructor(n, e) {
|
|
2448
2422
|
super(), this._renderManagerService = n, this._currentUniverService = e, this._initialize(), this._commandExecutedListener();
|
|
2449
2423
|
}
|
|
@@ -2462,13 +2436,13 @@ let De = class extends j {
|
|
|
2462
2436
|
r.onPageRenderObservable.add((o) => {
|
|
2463
2437
|
if ([K, J].includes(n))
|
|
2464
2438
|
return;
|
|
2465
|
-
const { page: a, pageLeft: c, pageTop: d, ctx: l } = o, { width: h,
|
|
2466
|
-
l.save(), l.translate(c - 0.5, d - 0.5),
|
|
2467
|
-
width: (s == null ? void 0 : s.width)
|
|
2468
|
-
height: (s == null ? void 0 : s.height)
|
|
2439
|
+
const { page: a, pageLeft: c, pageTop: d, ctx: l } = o, { width: h, pageWidth: p, height: u, pageHeight: g } = a;
|
|
2440
|
+
l.save(), l.translate(c - 0.5, d - 0.5), on.drawWith(l, {
|
|
2441
|
+
width: (s == null ? void 0 : s.width) ?? p ?? h,
|
|
2442
|
+
height: (s == null ? void 0 : s.height) ?? g ?? u,
|
|
2469
2443
|
strokeWidth: 1,
|
|
2470
|
-
stroke:
|
|
2471
|
-
fill:
|
|
2444
|
+
stroke: Ur,
|
|
2445
|
+
fill: wr,
|
|
2472
2446
|
zIndex: 3
|
|
2473
2447
|
}), l.restore();
|
|
2474
2448
|
});
|
|
@@ -2477,17 +2451,17 @@ let De = class extends j {
|
|
|
2477
2451
|
_commandExecutedListener() {
|
|
2478
2452
|
}
|
|
2479
2453
|
};
|
|
2480
|
-
|
|
2481
|
-
F
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
],
|
|
2485
|
-
var
|
|
2486
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2454
|
+
be = Er([
|
|
2455
|
+
V(F.Rendered, be),
|
|
2456
|
+
Ct(0, G),
|
|
2457
|
+
Ct(1, U(O))
|
|
2458
|
+
], be);
|
|
2459
|
+
var Lr = Object.defineProperty, Ar = Object.getOwnPropertyDescriptor, Nr = (n, e, t, r) => {
|
|
2460
|
+
for (var s = r > 1 ? void 0 : r ? Ar(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2487
2461
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2488
|
-
return r && s &&
|
|
2462
|
+
return r && s && Lr(e, t, s), s;
|
|
2489
2463
|
}, Y = (n, e) => (t, r) => e(t, r, n);
|
|
2490
|
-
let
|
|
2464
|
+
let De = class extends W {
|
|
2491
2465
|
constructor(e, t, r, s, i, o, a) {
|
|
2492
2466
|
super();
|
|
2493
2467
|
S(this, "_moveInObserver");
|
|
@@ -2515,17 +2489,17 @@ let Te = class extends j {
|
|
|
2515
2489
|
const t = this._getDocObjectById(e);
|
|
2516
2490
|
if (t == null)
|
|
2517
2491
|
return;
|
|
2518
|
-
const { document: r, scene: s } = t
|
|
2492
|
+
const { document: r, scene: s } = t;
|
|
2519
2493
|
this._moveInObserver = r.onPointerEnterObserver.add(() => {
|
|
2520
2494
|
r.cursor = lt.TEXT;
|
|
2521
2495
|
}), this._moveOutObserver = r.onPointerLeaveObserver.add(() => {
|
|
2522
2496
|
r.cursor = lt.DEFAULT, s.resetCursor();
|
|
2523
|
-
}), this._downObserver = r == null ? void 0 : r.onPointerDownObserver.add((
|
|
2524
|
-
this._currentUniverService.getCurrentUniverDocInstance().getUnitId() !== e && this._currentUniverService.setCurrentUniverDocInstance(e), this._textSelectionRenderManager.eventTrigger(
|
|
2525
|
-
}), this._dblClickObserver = r == null ? void 0 : r.onDblclickObserver.add((
|
|
2526
|
-
this._textSelectionRenderManager.handleDblClick(
|
|
2527
|
-
}), this._tripleClickObserver = r == null ? void 0 : r.onTripleClickObserver.add((
|
|
2528
|
-
this._textSelectionRenderManager.handleTripleClick(
|
|
2497
|
+
}), this._downObserver = r == null ? void 0 : r.onPointerDownObserver.add((i, o) => {
|
|
2498
|
+
this._currentUniverService.getCurrentUniverDocInstance().getUnitId() !== e && this._currentUniverService.setCurrentUniverDocInstance(e), this._textSelectionRenderManager.eventTrigger(i), i.button !== 2 && o.stopPropagation();
|
|
2499
|
+
}), this._dblClickObserver = r == null ? void 0 : r.onDblclickObserver.add((i) => {
|
|
2500
|
+
this._textSelectionRenderManager.handleDblClick(i);
|
|
2501
|
+
}), this._tripleClickObserver = r == null ? void 0 : r.onTripleClickObserver.add((i) => {
|
|
2502
|
+
this._textSelectionRenderManager.handleTripleClick(i);
|
|
2529
2503
|
});
|
|
2530
2504
|
}
|
|
2531
2505
|
_commandExecutedListener() {
|
|
@@ -2549,13 +2523,8 @@ let Te = class extends j {
|
|
|
2549
2523
|
const { unitId: t, skeleton: r } = e, s = this._renderManagerService.getRenderById(t);
|
|
2550
2524
|
if (s == null)
|
|
2551
2525
|
return;
|
|
2552
|
-
const { scene: i, mainComponent: o } = s
|
|
2553
|
-
this._textSelectionRenderManager.changeRuntime(
|
|
2554
|
-
r,
|
|
2555
|
-
i,
|
|
2556
|
-
a,
|
|
2557
|
-
o.getOffsetConfig()
|
|
2558
|
-
), this._textSelectionManagerService.setCurrentSelectionNotRefresh({
|
|
2526
|
+
const { scene: i, mainComponent: o } = s;
|
|
2527
|
+
this._textSelectionRenderManager.changeRuntime(r, i, o), this._textSelectionManagerService.setCurrentSelectionNotRefresh({
|
|
2559
2528
|
unitId: t,
|
|
2560
2529
|
subUnitId: ""
|
|
2561
2530
|
});
|
|
@@ -2565,22 +2534,22 @@ let Te = class extends j {
|
|
|
2565
2534
|
return In(e, this._renderManagerService);
|
|
2566
2535
|
}
|
|
2567
2536
|
};
|
|
2568
|
-
|
|
2569
|
-
F
|
|
2537
|
+
De = Nr([
|
|
2538
|
+
V(F.Rendered, De),
|
|
2570
2539
|
Y(0, U(A)),
|
|
2571
2540
|
Y(1, O),
|
|
2572
2541
|
Y(2, x),
|
|
2573
2542
|
Y(3, G),
|
|
2574
|
-
Y(4,
|
|
2543
|
+
Y(4, fe),
|
|
2575
2544
|
Y(5, U(P)),
|
|
2576
2545
|
Y(6, Cn(Sn))
|
|
2577
|
-
],
|
|
2578
|
-
var
|
|
2579
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2546
|
+
], De);
|
|
2547
|
+
var $r = Object.defineProperty, Br = Object.getOwnPropertyDescriptor, jr = (n, e, t, r) => {
|
|
2548
|
+
for (var s = r > 1 ? void 0 : r ? Br(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2580
2549
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2581
|
-
return r && s &&
|
|
2550
|
+
return r && s && $r(e, t, s), s;
|
|
2582
2551
|
}, le = (n, e) => (t, r) => e(t, r, n);
|
|
2583
|
-
let
|
|
2552
|
+
let Te = class extends W {
|
|
2584
2553
|
constructor(e, t, r, s, i) {
|
|
2585
2554
|
super();
|
|
2586
2555
|
S(this, "_initializedRender", /* @__PURE__ */ new Set());
|
|
@@ -2602,7 +2571,7 @@ let Pe = class extends j {
|
|
|
2602
2571
|
this._initializedRender.add(t);
|
|
2603
2572
|
const { scene: s } = r;
|
|
2604
2573
|
this.disposeWithMe(
|
|
2605
|
-
|
|
2574
|
+
Ge(
|
|
2606
2575
|
s.onMouseWheelObserver.add((i) => {
|
|
2607
2576
|
if (!i.ctrlKey)
|
|
2608
2577
|
return;
|
|
@@ -2611,7 +2580,7 @@ let Pe = class extends j {
|
|
|
2611
2580
|
a *= i.deltaY > 0 ? -1 : 1, s.scaleX < 1 && (a /= 2);
|
|
2612
2581
|
const c = this._currentUniverService.getCurrentUniverDocInstance(), d = c.zoomRatio;
|
|
2613
2582
|
let l = +parseFloat(`${d + a}`).toFixed(1);
|
|
2614
|
-
l = l >= 4 ? 4 : l <= 0.1 ? 0.1 : l, this._commandService.executeCommand(
|
|
2583
|
+
l = l >= 4 ? 4 : l <= 0.1 ? 0.1 : l, this._commandService.executeCommand(Bt.id, {
|
|
2615
2584
|
zoomRatio: l,
|
|
2616
2585
|
unitId: c.getUnitId()
|
|
2617
2586
|
}), i.preventDefault();
|
|
@@ -2629,7 +2598,7 @@ let Pe = class extends j {
|
|
|
2629
2598
|
// }
|
|
2630
2599
|
_skeletonListener() {
|
|
2631
2600
|
this.disposeWithMe(
|
|
2632
|
-
|
|
2601
|
+
Ge(
|
|
2633
2602
|
this._docSkeletonManagerService.currentSkeletonBefore$.subscribe((e) => {
|
|
2634
2603
|
if (e == null)
|
|
2635
2604
|
return;
|
|
@@ -2665,7 +2634,7 @@ let Pe = class extends j {
|
|
|
2665
2634
|
const { width: l, height: h } = i;
|
|
2666
2635
|
let p = 0, u = 0, g = 0, m = 0, f = 1 / 0;
|
|
2667
2636
|
l > (o + c * 2) * t ? (p = l / 2 - o * t / 2, p /= t, g = (l - c * 2) / t, f = 0) : (p = c, g = o + c * 2, f = (g - l / t) / 2), h > a ? (u = h / 2 - a / 2, m = (h - d * 2) / t) : (u = d, m = a + d * 2), s.resize(g, m + 200), r.translate(p, u);
|
|
2668
|
-
const v = s.getViewport(
|
|
2637
|
+
const v = s.getViewport(Ke.VIEW_MAIN);
|
|
2669
2638
|
if (f !== 1 / 0 && v != null) {
|
|
2670
2639
|
const M = v.getBarScroll(f, 0).x;
|
|
2671
2640
|
v.scrollTo({
|
|
@@ -2675,96 +2644,96 @@ let Pe = class extends j {
|
|
|
2675
2644
|
return this;
|
|
2676
2645
|
}
|
|
2677
2646
|
_getDocObject() {
|
|
2678
|
-
return
|
|
2647
|
+
return Le(this._currentUniverService, this._renderManagerService);
|
|
2679
2648
|
}
|
|
2680
2649
|
};
|
|
2681
|
-
|
|
2682
|
-
F
|
|
2650
|
+
Te = jr([
|
|
2651
|
+
V(F.Rendered, Te),
|
|
2683
2652
|
le(0, U(A)),
|
|
2684
2653
|
le(1, O),
|
|
2685
2654
|
le(2, x),
|
|
2686
2655
|
le(3, G),
|
|
2687
2656
|
le(4, U(P))
|
|
2688
|
-
],
|
|
2657
|
+
], Te);
|
|
2689
2658
|
const Vr = {
|
|
2690
|
-
id: Tt.id,
|
|
2691
|
-
preconditions: (n) => n.getContextValue(w),
|
|
2692
|
-
binding: $.ENTER
|
|
2693
|
-
}, jr = {
|
|
2694
2659
|
id: Pt.id,
|
|
2695
2660
|
preconditions: (n) => n.getContextValue(w),
|
|
2696
|
-
binding: $.
|
|
2661
|
+
binding: $.ENTER
|
|
2697
2662
|
}, Fr = {
|
|
2698
2663
|
id: Et.id,
|
|
2699
2664
|
preconditions: (n) => n.getContextValue(w),
|
|
2700
|
-
binding: $.
|
|
2665
|
+
binding: $.BACKSPACE
|
|
2701
2666
|
}, kr = {
|
|
2667
|
+
id: Ut.id,
|
|
2668
|
+
preconditions: (n) => n.getContextValue(w),
|
|
2669
|
+
binding: $.DELETE
|
|
2670
|
+
}, zr = {
|
|
2702
2671
|
id: ee.id,
|
|
2703
2672
|
binding: $.ARROW_UP,
|
|
2704
2673
|
preconditions: (n) => n.getContextValue(w),
|
|
2705
2674
|
staticParameters: {
|
|
2706
2675
|
direction: b.UP
|
|
2707
2676
|
}
|
|
2708
|
-
},
|
|
2677
|
+
}, Wr = {
|
|
2709
2678
|
id: ee.id,
|
|
2710
2679
|
binding: $.ARROW_DOWN,
|
|
2711
2680
|
preconditions: (n) => n.getContextValue(w),
|
|
2712
2681
|
staticParameters: {
|
|
2713
2682
|
direction: b.DOWN
|
|
2714
2683
|
}
|
|
2715
|
-
},
|
|
2684
|
+
}, Hr = {
|
|
2716
2685
|
id: ee.id,
|
|
2717
2686
|
binding: $.ARROW_LEFT,
|
|
2718
2687
|
preconditions: (n) => n.getContextValue(w),
|
|
2719
2688
|
staticParameters: {
|
|
2720
2689
|
direction: b.LEFT
|
|
2721
2690
|
}
|
|
2722
|
-
},
|
|
2691
|
+
}, Gr = {
|
|
2723
2692
|
id: ee.id,
|
|
2724
2693
|
binding: $.ARROW_RIGHT,
|
|
2725
2694
|
preconditions: (n) => n.getContextValue(w),
|
|
2726
2695
|
staticParameters: {
|
|
2727
2696
|
direction: b.RIGHT
|
|
2728
2697
|
}
|
|
2729
|
-
},
|
|
2698
|
+
}, Xr = {
|
|
2730
2699
|
id: te.id,
|
|
2731
|
-
binding: $.ARROW_UP |
|
|
2700
|
+
binding: $.ARROW_UP | _e.SHIFT,
|
|
2732
2701
|
preconditions: (n) => n.getContextValue(w),
|
|
2733
2702
|
staticParameters: {
|
|
2734
2703
|
direction: b.UP
|
|
2735
2704
|
}
|
|
2736
|
-
},
|
|
2705
|
+
}, qr = {
|
|
2737
2706
|
id: te.id,
|
|
2738
|
-
binding: $.ARROW_DOWN |
|
|
2707
|
+
binding: $.ARROW_DOWN | _e.SHIFT,
|
|
2739
2708
|
preconditions: (n) => n.getContextValue(w),
|
|
2740
2709
|
staticParameters: {
|
|
2741
2710
|
direction: b.DOWN
|
|
2742
2711
|
}
|
|
2743
|
-
},
|
|
2712
|
+
}, Yr = {
|
|
2744
2713
|
id: te.id,
|
|
2745
|
-
binding: $.ARROW_LEFT |
|
|
2714
|
+
binding: $.ARROW_LEFT | _e.SHIFT,
|
|
2746
2715
|
preconditions: (n) => n.getContextValue(w),
|
|
2747
2716
|
staticParameters: {
|
|
2748
2717
|
direction: b.LEFT
|
|
2749
2718
|
}
|
|
2750
|
-
},
|
|
2719
|
+
}, Zr = {
|
|
2751
2720
|
id: te.id,
|
|
2752
|
-
binding: $.ARROW_RIGHT |
|
|
2721
|
+
binding: $.ARROW_RIGHT | _e.SHIFT,
|
|
2753
2722
|
preconditions: (n) => n.getContextValue(w),
|
|
2754
2723
|
staticParameters: {
|
|
2755
2724
|
direction: b.RIGHT
|
|
2756
2725
|
}
|
|
2757
|
-
},
|
|
2758
|
-
id:
|
|
2759
|
-
binding: $.A |
|
|
2760
|
-
preconditions: (n) => n.getContextValue(w) || n.getContextValue(
|
|
2726
|
+
}, Kr = {
|
|
2727
|
+
id: jt.id,
|
|
2728
|
+
binding: $.A | _e.CTRL_COMMAND,
|
|
2729
|
+
preconditions: (n) => n.getContextValue(w) || n.getContextValue(me)
|
|
2761
2730
|
};
|
|
2762
|
-
var
|
|
2763
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2731
|
+
var Jr = Object.defineProperty, Qr = Object.getOwnPropertyDescriptor, es = (n, e, t, r) => {
|
|
2732
|
+
for (var s = r > 1 ? void 0 : r ? Qr(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2764
2733
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2765
|
-
return r && s &&
|
|
2766
|
-
},
|
|
2767
|
-
let
|
|
2734
|
+
return r && s && Jr(e, t, s), s;
|
|
2735
|
+
}, Se = (n, e) => (t, r) => e(t, r, n);
|
|
2736
|
+
let Pe = class extends Ze {
|
|
2768
2737
|
constructor(e, t, r, s) {
|
|
2769
2738
|
super();
|
|
2770
2739
|
S(this, "_scene");
|
|
@@ -2796,14 +2765,14 @@ let Ee = class extends Rt {
|
|
|
2796
2765
|
return;
|
|
2797
2766
|
const { scene: o, engine: a } = i;
|
|
2798
2767
|
o.openTransformer(), this._scene = o;
|
|
2799
|
-
const c = new
|
|
2768
|
+
const c = new an(Ke.VIEW_MAIN, o, {
|
|
2800
2769
|
left: 0,
|
|
2801
2770
|
top: 0,
|
|
2802
2771
|
bottom: 0,
|
|
2803
2772
|
right: 0,
|
|
2804
2773
|
isWheelPreventDefaultX: !0
|
|
2805
2774
|
});
|
|
2806
|
-
o.addViewport(c).attachControl(), o.on(
|
|
2775
|
+
o.addViewport(c).attachControl(), o.on(cn.wheel, (h, p) => {
|
|
2807
2776
|
const u = h;
|
|
2808
2777
|
if (u.ctrlKey) {
|
|
2809
2778
|
const g = Math.abs(u.deltaX);
|
|
@@ -2811,42 +2780,42 @@ let Ee = class extends Rt {
|
|
|
2811
2780
|
m *= u.deltaY > 0 ? -1 : 1, o.scaleX < 1 && (m /= 2), o.scaleX + m > 4 ? o.scale(4, 4) : o.scaleX + m < 0.1 ? o.scale(0.1, 0.1) : u.preventDefault();
|
|
2812
2781
|
} else
|
|
2813
2782
|
c.onMouseWheel(u, p);
|
|
2814
|
-
}), this._configService.getConfig("hasScroll") !== !1 && t !== J && new
|
|
2815
|
-
new dt(o, [],
|
|
2783
|
+
}), this._configService.getConfig("hasScroll") !== !1 && t !== J && new ln(c), o.addLayer(
|
|
2784
|
+
new dt(o, [], ut),
|
|
2816
2785
|
new dt(o, [], xn)
|
|
2817
2786
|
), this._addComponent(i), this._currentDocumentModel.getShouldRenderLoopImmediately() && a.runRenderLoop(() => {
|
|
2818
2787
|
o.render(), this._fps$.next(Math.round(a.getFps()).toString());
|
|
2819
2788
|
}), this._renderManagerService.setCurrent(t);
|
|
2820
2789
|
}
|
|
2821
2790
|
_addComponent(e) {
|
|
2822
|
-
const t = this._scene, r = this._currentDocumentModel, s = new
|
|
2791
|
+
const t = this._scene, r = this._currentDocumentModel, s = new dn(Xe.MAIN, void 0, {
|
|
2823
2792
|
pageMarginLeft: r.documentStyle.marginLeft || 0,
|
|
2824
2793
|
pageMarginTop: r.documentStyle.marginTop || 0
|
|
2825
2794
|
});
|
|
2826
|
-
s.zIndex = On, e.mainComponent = s, e.components.set(
|
|
2795
|
+
s.zIndex = On, e.mainComponent = s, e.components.set(Xe.MAIN, s), t.addObjects([s], ut);
|
|
2827
2796
|
}
|
|
2828
2797
|
};
|
|
2829
|
-
|
|
2830
|
-
F
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
],
|
|
2836
|
-
var
|
|
2837
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2798
|
+
Pe = es([
|
|
2799
|
+
V(F.Ready, Pe),
|
|
2800
|
+
Se(0, G),
|
|
2801
|
+
Se(1, yt),
|
|
2802
|
+
Se(2, O),
|
|
2803
|
+
Se(3, U(se))
|
|
2804
|
+
], Pe);
|
|
2805
|
+
var ts = Object.defineProperty, ns = Object.getOwnPropertyDescriptor, rs = (n, e, t, r) => {
|
|
2806
|
+
for (var s = r > 1 ? void 0 : r ? ns(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
2838
2807
|
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
2839
|
-
return r && s &&
|
|
2840
|
-
},
|
|
2841
|
-
const
|
|
2808
|
+
return r && s && ts(e, t, s), s;
|
|
2809
|
+
}, ve = (n, e) => (t, r) => e(t, r, n);
|
|
2810
|
+
const ss = {
|
|
2842
2811
|
hasScroll: !0
|
|
2843
|
-
},
|
|
2844
|
-
var
|
|
2845
|
-
let
|
|
2812
|
+
}, is = "docs";
|
|
2813
|
+
var We;
|
|
2814
|
+
let Rt = (We = class extends Yt {
|
|
2846
2815
|
constructor(e = {}, t, r, s, i) {
|
|
2847
|
-
super(
|
|
2816
|
+
super(is);
|
|
2848
2817
|
S(this, "_config");
|
|
2849
|
-
this._injector = t, this._localeService = r, this._configService = s, this._currentUniverService = i, this._config = Object.assign(
|
|
2818
|
+
this._injector = t, this._localeService = r, this._configService = s, this._currentUniverService = i, this._config = Object.assign(ss, e), this._initializeDependencies(t), this._initializeCommands();
|
|
2850
2819
|
}
|
|
2851
2820
|
initialize() {
|
|
2852
2821
|
}
|
|
@@ -2854,48 +2823,48 @@ let Ct = (Ge = class extends qt {
|
|
|
2854
2823
|
[
|
|
2855
2824
|
ee,
|
|
2856
2825
|
te,
|
|
2857
|
-
Pt,
|
|
2858
2826
|
Et,
|
|
2859
|
-
|
|
2827
|
+
Ut,
|
|
2828
|
+
ue,
|
|
2829
|
+
Ne,
|
|
2860
2830
|
$e,
|
|
2861
2831
|
Be,
|
|
2862
|
-
Ve,
|
|
2863
2832
|
Q,
|
|
2864
2833
|
ie,
|
|
2834
|
+
he,
|
|
2865
2835
|
pe,
|
|
2866
|
-
ge,
|
|
2867
2836
|
je,
|
|
2868
|
-
|
|
2869
|
-
|
|
2837
|
+
Nt,
|
|
2838
|
+
Pt,
|
|
2870
2839
|
Je,
|
|
2871
2840
|
Qe,
|
|
2872
|
-
|
|
2873
|
-
|
|
2841
|
+
Tt,
|
|
2842
|
+
Lt,
|
|
2874
2843
|
et,
|
|
2875
2844
|
_,
|
|
2876
2845
|
Wn,
|
|
2877
2846
|
Hn,
|
|
2878
|
-
$t,
|
|
2879
|
-
Z,
|
|
2880
|
-
bt,
|
|
2881
2847
|
Bt,
|
|
2848
|
+
Z,
|
|
2849
|
+
Dt,
|
|
2850
|
+
jt,
|
|
2882
2851
|
kn,
|
|
2883
2852
|
Fn,
|
|
2884
2853
|
nt
|
|
2885
2854
|
].forEach((e) => {
|
|
2886
2855
|
this._injector.get(x).registerCommand(e);
|
|
2887
2856
|
}), [
|
|
2888
|
-
kr,
|
|
2889
2857
|
zr,
|
|
2890
|
-
Hr,
|
|
2891
2858
|
Wr,
|
|
2892
2859
|
Gr,
|
|
2860
|
+
Hr,
|
|
2893
2861
|
Xr,
|
|
2894
2862
|
qr,
|
|
2895
2863
|
Yr,
|
|
2896
2864
|
Zr,
|
|
2897
|
-
|
|
2865
|
+
Kr,
|
|
2898
2866
|
Fr,
|
|
2867
|
+
kr,
|
|
2899
2868
|
Vr
|
|
2900
2869
|
].forEach((e) => {
|
|
2901
2870
|
this._injector.get(vn).registerShortcut(e);
|
|
@@ -2911,7 +2880,7 @@ let Ct = (Ge = class extends qt {
|
|
|
2911
2880
|
// { useFactory: () => docInjector.createInstance(CanvasView, this._config.standalone ?? true) },
|
|
2912
2881
|
// ], // FIXME: CanvasView shouldn't be a dependency of UniverDocs. Because it maybe created dynamically.
|
|
2913
2882
|
//views
|
|
2914
|
-
[
|
|
2883
|
+
[Pe],
|
|
2915
2884
|
// services
|
|
2916
2885
|
[A],
|
|
2917
2886
|
[se],
|
|
@@ -2919,75 +2888,75 @@ let Ct = (Ge = class extends qt {
|
|
|
2919
2888
|
[
|
|
2920
2889
|
Vt,
|
|
2921
2890
|
{
|
|
2922
|
-
useClass:
|
|
2891
|
+
useClass: Ye
|
|
2923
2892
|
}
|
|
2924
2893
|
],
|
|
2925
2894
|
[
|
|
2926
|
-
|
|
2895
|
+
fe,
|
|
2927
2896
|
{
|
|
2928
|
-
useClass:
|
|
2897
|
+
useClass: un
|
|
2929
2898
|
}
|
|
2930
2899
|
],
|
|
2931
2900
|
[P],
|
|
2932
2901
|
// controllers
|
|
2933
|
-
[
|
|
2934
|
-
[De],
|
|
2935
|
-
[Te],
|
|
2902
|
+
[Ce],
|
|
2936
2903
|
[be],
|
|
2904
|
+
[De],
|
|
2905
|
+
[ye],
|
|
2906
|
+
[Ie],
|
|
2937
2907
|
[xe],
|
|
2908
|
+
[Me],
|
|
2938
2909
|
[Oe],
|
|
2939
|
-
[
|
|
2940
|
-
[
|
|
2941
|
-
[Pe],
|
|
2942
|
-
[Ie]
|
|
2910
|
+
[Te],
|
|
2911
|
+
[Re]
|
|
2943
2912
|
].forEach((t) => e.add(t));
|
|
2944
2913
|
}
|
|
2945
|
-
}, S(
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
],
|
|
2914
|
+
}, S(We, "type", Zt.Doc), We);
|
|
2915
|
+
Rt = rs([
|
|
2916
|
+
ve(1, U(Rn)),
|
|
2917
|
+
ve(2, U(It)),
|
|
2918
|
+
ve(3, yt),
|
|
2919
|
+
ve(4, O)
|
|
2920
|
+
], Rt);
|
|
2952
2921
|
export {
|
|
2953
|
-
|
|
2922
|
+
Pt as BreakLineCommand,
|
|
2954
2923
|
Fn as BulletListCommand,
|
|
2955
2924
|
Hn as CoverContentCommand,
|
|
2956
2925
|
On as DOCS_COMPONENT_DEFAULT_Z_INDEX,
|
|
2957
2926
|
xn as DOCS_COMPONENT_HEADER_LAYER_INDEX,
|
|
2958
|
-
|
|
2959
|
-
|
|
2927
|
+
ut as DOCS_COMPONENT_MAIN_LAYER_INDEX,
|
|
2928
|
+
Xe as DOCS_VIEW_KEY,
|
|
2960
2929
|
Qe as DeleteCommand,
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2930
|
+
Et as DeleteLeftCommand,
|
|
2931
|
+
Ut as DeleteRightCommand,
|
|
2932
|
+
Pe as DocCanvasView,
|
|
2933
|
+
Ve as DocCopyCommand,
|
|
2934
|
+
Fe as DocCutCommand,
|
|
2935
|
+
ke as DocPasteCommand,
|
|
2967
2936
|
A as DocSkeletonManagerService,
|
|
2968
2937
|
se as DocViewModelManagerService,
|
|
2969
|
-
|
|
2938
|
+
Lt as IMEInputCommand,
|
|
2970
2939
|
Je as InsertCommand,
|
|
2971
2940
|
ee as MoveCursorOperation,
|
|
2972
2941
|
te as MoveSelectionOperation,
|
|
2973
|
-
|
|
2942
|
+
hs as NORMAL_TEXT_SELECTION_PLUGIN_NAME,
|
|
2974
2943
|
kn as OrderListCommand,
|
|
2975
2944
|
Wn as ReplaceContentCommand,
|
|
2976
2945
|
_ as RichTextEditingMutation,
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2946
|
+
ue as SetInlineFormatBoldCommand,
|
|
2947
|
+
Nt as SetInlineFormatCommand,
|
|
2948
|
+
pe as SetInlineFormatFontFamilyCommand,
|
|
2949
|
+
he as SetInlineFormatFontSizeCommand,
|
|
2950
|
+
Ne as SetInlineFormatItalicCommand,
|
|
2951
|
+
Be as SetInlineFormatStrikethroughCommand,
|
|
2983
2952
|
Q as SetInlineFormatSubscriptCommand,
|
|
2984
2953
|
ie as SetInlineFormatSuperscriptCommand,
|
|
2985
2954
|
je as SetInlineFormatTextColorCommand,
|
|
2986
|
-
|
|
2987
|
-
|
|
2955
|
+
$e as SetInlineFormatUnderlineCommand,
|
|
2956
|
+
Dt as SetTextSelectionsOperation,
|
|
2988
2957
|
P as TextSelectionManagerService,
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2958
|
+
Rt as UniverDocsPlugin,
|
|
2959
|
+
Tt as UpdateCommand,
|
|
2960
|
+
Ke as VIEWPORT_KEY,
|
|
2961
|
+
Le as getDocObject
|
|
2993
2962
|
};
|