@univerjs/docs-drawing-ui 0.6.7 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +290 -295
- package/lib/index.js +2750 -0
- package/lib/locale/en-US.js +62 -0
- package/lib/locale/fa-IR.js +62 -0
- package/lib/locale/fr-FR.js +62 -0
- package/lib/locale/ru-RU.js +62 -0
- package/lib/locale/vi-VN.js +62 -0
- package/lib/locale/zh-CN.js +62 -0
- package/lib/locale/zh-TW.js +62 -0
- package/lib/umd/index.js +1 -1
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
var At = Object.defineProperty;
|
|
2
2
|
var xt = (i, e, n) => e in i ? At(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
3
|
var Se = (i, e, n) => xt(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { Disposable as Ge,
|
|
5
|
-
import { IDocDrawingService as Ue, UniverDocsDrawingPlugin as
|
|
6
|
-
import { IDrawingManagerService as _e, IImageIoService as
|
|
7
|
-
import { DrawingCommonPanel as
|
|
8
|
-
import { IRenderManagerService as J, DocumentEditArea as We, Liquid as Jn, PageLayoutType as Ln, DocumentSkeletonPageType as Un, Vector2 as
|
|
9
|
-
import { IMessageService as
|
|
4
|
+
import { Disposable as Ge, UndoCommand as Lt, RedoCommand as Ut, JSONX as X, IUniverInstanceService as q, ICommandService as $, PositionedObjectLayoutType as W, CommandType as Y, BooleanNumber as se, ObjectRelativeFromH as ee, ObjectRelativeFromV as H, Tools as be, TextX as Dn, TextXActionType as Q, toDisposable as Oe, throttle as Rn, COLORS as Bt, MemoryCursor as Ft, IUndoRedoService as Yn, BuildTextUtils as kt, ArrangeTypeEnum as Qe, Inject as pe, IContextService as Zn, LocaleService as un, WrapTextType as Xe, DrawingTypeEnum as rn, FOCUSING_COMMON_DRAWINGS as on, UniverInstanceType as Ie, Direction as he, DocumentFlavor as wn, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Cn, FOCUSING_UNIVER_EDITOR as Wt, DisposableCollection as Ht, fromEventSubject as Qn, generateRandomId as Gt, RxDisposable as Vt, SHEET_EDITOR_UNITS as jt, LifecycleService as $t, LifecycleStages as En, DependentOn as zt, Injector as Xt, IConfigService as qt, Plugin as Kt, merge as Yt } from "@univerjs/core";
|
|
5
|
+
import { IDocDrawingService as Ue, UniverDocsDrawingPlugin as Zt } from "@univerjs/docs-drawing";
|
|
6
|
+
import { IDrawingManagerService as _e, IImageIoService as Qt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Jt, DRAWING_IMAGE_COUNT_LIMIT as Nn, ImageUploadStatusType as vn, DRAWING_IMAGE_ALLOW_SIZE as ei, getImageSize as ni, getDrawingShapeKeyByDrawingSearch as ti, DRAWING_IMAGE_WIDTH_LIMIT as An, DRAWING_IMAGE_HEIGHT_LIMIT as xn, UniverDrawingPlugin as ii } from "@univerjs/drawing";
|
|
7
|
+
import { DrawingCommonPanel as ri, DrawingRenderService as oi, ImageCropperObject as si, COMPONENT_IMAGE_POPUP_MENU as ai, OpenImageCropOperation as ci, ImageResetSizeOperation as di, UniverDrawingUIPlugin as li } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as J, DocumentEditArea as We, Liquid as Jn, PageLayoutType as Ln, DocumentSkeletonPageType as Un, Vector2 as gi, Rect as mi, getColor as ui, getCurrentTypeOfRenderer as hi, CURSOR_TYPE as Bn, TRANSFORM_CHANGE_OBSERVABLE_TYPE as fi } from "@univerjs/engine-render";
|
|
9
|
+
import { IMessageService as pi, ILocalFileService as wi, ISidebarService as vi, useDependency as ve, getMenuHiddenObservable as et, MenuItemType as nt, RibbonStartGroup as Ii, KeyCode as He, ComponentManager as _i, IMenuManagerService as Si, IShortcutService as Di, CanvasFloatDomService as Ci, UniverUIPlugin as Oi } from "@univerjs/ui";
|
|
10
10
|
import { RichTextEditingMutation as ne, DocSkeletonManagerService as te, DocSelectionManagerService as On } from "@univerjs/docs";
|
|
11
|
-
import { DocSelectionRenderService as Re, getRichTextEditPath as qe, NodePositionConvertToCursor as
|
|
12
|
-
import { BehaviorSubject as ot, debounceTime as st, Observable as
|
|
13
|
-
import { MessageType as Vn, clsx as j, InputNumber as
|
|
11
|
+
import { DocSelectionRenderService as Re, getRichTextEditPath as qe, NodePositionConvertToCursor as Fn, getOneTextSelectionRange as kn, getAnchorBounding as Ti, TEXT_RANGE_LAYER_INDEX as yi, getDocObject as Pi, getCustomBlockIdsInSelections as Mi, docDrawingPositionToTransform as tt, VIEWPORT_KEY as it, SetDocZoomRatioOperation as rt, DocCanvasPopManagerService as bi, IEditorService as Ri } from "@univerjs/docs-ui";
|
|
12
|
+
import { BehaviorSubject as ot, debounceTime as st, Observable as Ei, map as Wn, switchMap as Ni, of as Ai, takeUntil as Hn, filter as Gn } from "rxjs";
|
|
13
|
+
import { MessageType as Vn, clsx as j, InputNumber as ke, Select as jn, Checkbox as xi, RadioGroup as $n, Radio as Me } from "@univerjs/design";
|
|
14
14
|
import { jsxs as K, jsx as p } from "react/jsx-runtime";
|
|
15
|
-
import { forwardRef as at, useRef as
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
15
|
+
import { forwardRef as at, useRef as Li, createElement as ct, useState as oe, useEffect as Tn } from "react";
|
|
16
|
+
const Ui = "docs-drawing-ui.config", zn = {};
|
|
17
|
+
var Bi = Object.getOwnPropertyDescriptor, Fi = (i, e, n, t) => {
|
|
18
|
+
for (var r = t > 1 ? void 0 : t ? Bi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
19
19
|
(s = i[o]) && (r = s(r) || r);
|
|
20
20
|
return r;
|
|
21
21
|
}, $e = (i, e) => (n, t) => e(n, t, i);
|
|
22
|
-
function
|
|
22
|
+
function ki(i) {
|
|
23
23
|
var t, r, o, s;
|
|
24
24
|
if (X.isNoop(i) || !Array.isArray(i))
|
|
25
25
|
return null;
|
|
@@ -42,7 +42,7 @@ function Wi(i) {
|
|
|
42
42
|
});
|
|
43
43
|
return n;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Wi(i) {
|
|
46
46
|
if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
|
|
47
47
|
return [];
|
|
48
48
|
const e = [];
|
|
@@ -67,27 +67,24 @@ let sn = class extends Ge {
|
|
|
67
67
|
_commandExecutedListener() {
|
|
68
68
|
this.disposeWithMe(
|
|
69
69
|
this._commandService.beforeCommandExecuted((i) => {
|
|
70
|
-
var a, d;
|
|
71
70
|
if (i.id !== ne.id)
|
|
72
71
|
return;
|
|
73
|
-
const e = i.params, { unitId: n, actions: t } = e, r =
|
|
74
|
-
if (
|
|
75
|
-
for (const { type:
|
|
76
|
-
|
|
77
|
-
(l == null ? void 0 : l.blockType) !== Lt.CUSTOM && (c === "add" ? this._addDrawings(n, [m]) : this._removeDrawings(n, [g]));
|
|
78
|
-
}
|
|
72
|
+
const e = i.params, { unitId: n, actions: t } = e, r = ki(t);
|
|
73
|
+
if (r != null)
|
|
74
|
+
for (const { type: o, drawingId: s, drawing: a } of r)
|
|
75
|
+
o === "add" ? this._addDrawings(n, [a]) : this._removeDrawings(n, [s]);
|
|
79
76
|
})
|
|
80
77
|
), this.disposeWithMe(
|
|
81
78
|
this._commandService.onCommandExecuted((i) => {
|
|
82
79
|
if (i.id !== ne.id)
|
|
83
80
|
return;
|
|
84
81
|
const e = i.params, { unitId: n, actions: t } = e;
|
|
85
|
-
|
|
82
|
+
Wi(t).length > 0 && this._updateDrawingsOrder(n);
|
|
86
83
|
})
|
|
87
84
|
), this.disposeWithMe(
|
|
88
85
|
this._commandService.onCommandExecuted((i) => {
|
|
89
86
|
var s;
|
|
90
|
-
if (i.id !==
|
|
87
|
+
if (i.id !== Lt.id && i.id !== Ut.id)
|
|
91
88
|
return;
|
|
92
89
|
const e = (s = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : s.getUnitId(), n = this._drawingManagerService.getFocusDrawings();
|
|
93
90
|
if (e == null || n.length === 0)
|
|
@@ -135,7 +132,7 @@ sn = Fi([
|
|
|
135
132
|
$e(3, Ue),
|
|
136
133
|
$e(4, J)
|
|
137
134
|
], sn);
|
|
138
|
-
class
|
|
135
|
+
class hn {
|
|
139
136
|
constructor() {
|
|
140
137
|
Se(this, "_refreshDrawings$", new ot(null));
|
|
141
138
|
Se(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
|
|
@@ -145,7 +142,7 @@ class fn {
|
|
|
145
142
|
}
|
|
146
143
|
}
|
|
147
144
|
var ue = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(ue || {});
|
|
148
|
-
const
|
|
145
|
+
const Hi = {
|
|
149
146
|
inline: W.INLINE,
|
|
150
147
|
wrapSquare: W.WRAP_SQUARE,
|
|
151
148
|
wrapTopAndBottom: W.WRAP_TOP_AND_BOTTOM,
|
|
@@ -242,7 +239,7 @@ const lt = {
|
|
|
242
239
|
return !1;
|
|
243
240
|
const f = g.getEditArea(), u = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: I } = c, O = X.getInstance(), C = [], { drawings: T = {} } = l.getSnapshot();
|
|
244
241
|
for (const E of n) {
|
|
245
|
-
const { drawingId: _ } = E, L = T[_].layoutType, G =
|
|
242
|
+
const { drawingId: _ } = E, L = T[_].layoutType, G = Hi[t];
|
|
246
243
|
if (L !== G) {
|
|
247
244
|
const D = O.replaceOp(["drawings", _, "layoutType"], L, G);
|
|
248
245
|
C.push(D);
|
|
@@ -258,20 +255,20 @@ const lt = {
|
|
|
258
255
|
continue;
|
|
259
256
|
let x = null, V = 0, S = 0;
|
|
260
257
|
for (const D of v) {
|
|
261
|
-
const { headerId: R, footerId: y, marginTop: U, marginLeft:
|
|
258
|
+
const { headerId: R, footerId: y, marginTop: U, marginLeft: F, marginBottom: M, pageWidth: A, pageHeight: z } = D;
|
|
262
259
|
switch (f) {
|
|
263
260
|
case We.HEADER: {
|
|
264
|
-
const
|
|
265
|
-
|
|
261
|
+
const k = (N = w.get(R)) == null ? void 0 : N.get(A);
|
|
262
|
+
k != null && k.skeDrawings.has(_) && (x = k.skeDrawings.get(_), V = k.marginTop, S = F);
|
|
266
263
|
break;
|
|
267
264
|
}
|
|
268
265
|
case We.FOOTER: {
|
|
269
|
-
const
|
|
270
|
-
|
|
266
|
+
const k = (B = I.get(y)) == null ? void 0 : B.get(A);
|
|
267
|
+
k != null && k.skeDrawings.has(_) && (x = k.skeDrawings.get(_), V = z - M + k.marginTop, S = F);
|
|
271
268
|
break;
|
|
272
269
|
}
|
|
273
270
|
case We.BODY: {
|
|
274
|
-
D.skeDrawings.has(_) && (x = D.skeDrawings.get(_), V = U, S =
|
|
271
|
+
D.skeDrawings.has(_) && (x = D.skeDrawings.get(_), V = U, S = F);
|
|
275
272
|
break;
|
|
276
273
|
}
|
|
277
274
|
}
|
|
@@ -282,28 +279,28 @@ const lt = {
|
|
|
282
279
|
const { aTop: D, aLeft: R } = x, y = T[_].docTransform.positionH;
|
|
283
280
|
let U = R;
|
|
284
281
|
y.relativeFrom === ee.MARGIN ? U -= S : y.relativeFrom === ee.COLUMN && (U -= x.columnLeft);
|
|
285
|
-
const
|
|
282
|
+
const F = {
|
|
286
283
|
relativeFrom: y.relativeFrom,
|
|
287
284
|
posOffset: U
|
|
288
285
|
};
|
|
289
|
-
if (y.posOffset !==
|
|
290
|
-
const
|
|
291
|
-
C.push(
|
|
286
|
+
if (y.posOffset !== F.posOffset) {
|
|
287
|
+
const k = O.replaceOp(["drawings", _, "docTransform", "positionH"], y, F);
|
|
288
|
+
C.push(k);
|
|
292
289
|
}
|
|
293
|
-
const
|
|
290
|
+
const M = T[_].docTransform.positionV;
|
|
294
291
|
let A = D;
|
|
295
|
-
|
|
292
|
+
M.relativeFrom === H.PAGE ? A += V : M.relativeFrom === H.LINE ? A -= x.lineTop : M.relativeFrom === H.PARAGRAPH && (A -= x.blockAnchorTop);
|
|
296
293
|
const z = {
|
|
297
|
-
relativeFrom:
|
|
294
|
+
relativeFrom: M.relativeFrom,
|
|
298
295
|
posOffset: A
|
|
299
296
|
};
|
|
300
|
-
if (
|
|
301
|
-
const
|
|
302
|
-
C.push(
|
|
297
|
+
if (M.posOffset !== z.posOffset) {
|
|
298
|
+
const k = O.replaceOp(["drawings", _, "docTransform", "positionV"], M, z);
|
|
299
|
+
C.push(k);
|
|
303
300
|
}
|
|
304
301
|
}
|
|
305
302
|
}
|
|
306
|
-
const
|
|
303
|
+
const b = {
|
|
307
304
|
id: ne.id,
|
|
308
305
|
params: {
|
|
309
306
|
unitId: r,
|
|
@@ -311,8 +308,8 @@ const lt = {
|
|
|
311
308
|
textRanges: null
|
|
312
309
|
}
|
|
313
310
|
};
|
|
314
|
-
|
|
315
|
-
const P = o.syncExecuteCommand(
|
|
311
|
+
b.params.actions = C.reduce((E, _) => X.compose(E, _), null);
|
|
312
|
+
const P = o.syncExecuteCommand(b.id, b.params);
|
|
316
313
|
return u.refreshControls(), !!P;
|
|
317
314
|
}
|
|
318
315
|
}, gt = {
|
|
@@ -387,9 +384,9 @@ const lt = {
|
|
|
387
384
|
const { drawings: c, unitId: g } = e, m = X.getInstance(), l = [], { drawings: f = {} } = d.getSnapshot();
|
|
388
385
|
for (const w of c) {
|
|
389
386
|
const { drawingId: I, key: O, value: C } = w, T = f[I].docTransform[O];
|
|
390
|
-
if (!
|
|
391
|
-
const
|
|
392
|
-
l.push(
|
|
387
|
+
if (!be.diffValue(T, C)) {
|
|
388
|
+
const b = m.replaceOp(["drawings", I, "docTransform", O], T, C);
|
|
389
|
+
l.push(b);
|
|
393
390
|
}
|
|
394
391
|
}
|
|
395
392
|
const u = {
|
|
@@ -412,7 +409,7 @@ const lt = {
|
|
|
412
409
|
var B, E;
|
|
413
410
|
if (e == null)
|
|
414
411
|
return !1;
|
|
415
|
-
const n = i.get(J), t = (B = n.getRenderById(e.unitId)) == null ? void 0 : B.with(Re), r = i.get(
|
|
412
|
+
const n = i.get(J), t = (B = n.getRenderById(e.unitId)) == null ? void 0 : B.with(Re), r = i.get(hn), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, a = o == null ? void 0 : o.with(te).getSkeleton();
|
|
416
413
|
if (s == null || t == null)
|
|
417
414
|
return !1;
|
|
418
415
|
const d = s.getTransformerByCreate(), c = i.get($), m = i.get(q).getCurrentUniverDocInstance();
|
|
@@ -421,7 +418,7 @@ const lt = {
|
|
|
421
418
|
const { drawing: l, unitId: f, offset: u, segmentId: v, segmentPage: w, needRefreshDrawings: I } = e;
|
|
422
419
|
if (I)
|
|
423
420
|
return r.refreshDrawings(a), d.refreshControls(), !0;
|
|
424
|
-
const O = [], { drawingId: C } = l, T = (E = t.getSegment()) != null ? E : "",
|
|
421
|
+
const O = [], { drawingId: C } = l, T = (E = t.getSegment()) != null ? E : "", b = dt(
|
|
425
422
|
v,
|
|
426
423
|
T,
|
|
427
424
|
w,
|
|
@@ -430,9 +427,9 @@ const lt = {
|
|
|
430
427
|
m,
|
|
431
428
|
t
|
|
432
429
|
);
|
|
433
|
-
if (
|
|
430
|
+
if (b == null || b.length === 0)
|
|
434
431
|
return r.refreshDrawings(a), d.refreshControls(), !1;
|
|
435
|
-
O.push(...
|
|
432
|
+
O.push(...b);
|
|
436
433
|
const P = {
|
|
437
434
|
id: ne.id,
|
|
438
435
|
params: {
|
|
@@ -445,7 +442,7 @@ const lt = {
|
|
|
445
442
|
const N = c.syncExecuteCommand(P.id, P.params);
|
|
446
443
|
return d.refreshControls(), !!N;
|
|
447
444
|
}
|
|
448
|
-
},
|
|
445
|
+
}, ht = {
|
|
449
446
|
id: "doc.command.transform-non-inline-drawing",
|
|
450
447
|
type: Y.COMMAND,
|
|
451
448
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -471,20 +468,20 @@ const lt = {
|
|
|
471
468
|
if (C == null)
|
|
472
469
|
return !1;
|
|
473
470
|
C.length > 0 && w.push(...C);
|
|
474
|
-
const T = X.getInstance(), { drawings:
|
|
475
|
-
if (!
|
|
471
|
+
const T = X.getInstance(), { drawings: b = {} } = c.getSnapshot(), P = b[I].docTransform, { positionH: N, positionV: B, size: E, angle: _ } = P;
|
|
472
|
+
if (!be.diffValue(N, f.positionH)) {
|
|
476
473
|
const S = T.replaceOp(["drawings", I, "docTransform", "positionH"], N, f.positionH);
|
|
477
474
|
w.push(S);
|
|
478
475
|
}
|
|
479
|
-
if (!
|
|
476
|
+
if (!be.diffValue(B, f.positionV)) {
|
|
480
477
|
const S = T.replaceOp(["drawings", I, "docTransform", "positionV"], B, f.positionV);
|
|
481
478
|
w.push(S);
|
|
482
479
|
}
|
|
483
|
-
if (!
|
|
480
|
+
if (!be.diffValue(E, f.size)) {
|
|
484
481
|
const S = T.replaceOp(["drawings", I, "docTransform", "size"], E, f.size);
|
|
485
482
|
w.push(S);
|
|
486
483
|
}
|
|
487
|
-
if (!
|
|
484
|
+
if (!be.diffValue(_, f.angle)) {
|
|
488
485
|
const S = T.replaceOp(["drawings", I, "docTransform", "angle"], _, f.angle);
|
|
489
486
|
w.push(S);
|
|
490
487
|
}
|
|
@@ -502,12 +499,12 @@ const lt = {
|
|
|
502
499
|
return s.refreshControls(), !!G;
|
|
503
500
|
}
|
|
504
501
|
};
|
|
505
|
-
var
|
|
506
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
502
|
+
var Gi = Object.getOwnPropertyDescriptor, Vi = (i, e, n, t) => {
|
|
503
|
+
for (var r = t > 1 ? void 0 : t ? Gi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
507
504
|
(s = i[o]) && (r = s(r) || r);
|
|
508
505
|
return r;
|
|
509
506
|
}, Je = (i, e) => (n, t) => e(n, t, i);
|
|
510
|
-
const
|
|
507
|
+
const ji = "__InlineDrawingAnchor__";
|
|
511
508
|
function Xn(i) {
|
|
512
509
|
const { path: e } = i;
|
|
513
510
|
return e.some((n) => n === "cells");
|
|
@@ -631,8 +628,8 @@ let an = class extends Ge {
|
|
|
631
628
|
const f = this._transformerCache.get(l.drawingId);
|
|
632
629
|
if (f == null)
|
|
633
630
|
continue;
|
|
634
|
-
const { drawing: u, top: v, left: w, width: I, height: O, angle: C } = f, { width: T, height:
|
|
635
|
-
if (g = Math.min(g, T), m = Math.min(m,
|
|
631
|
+
const { drawing: u, top: v, left: w, width: I, height: O, angle: C } = f, { width: T, height: b } = this._getPageContentSize(u);
|
|
632
|
+
if (g = Math.min(g, T), m = Math.min(m, b), (I !== g || O !== m) && n.push({
|
|
636
633
|
drawingId: l.drawingId,
|
|
637
634
|
key: "size",
|
|
638
635
|
value: {
|
|
@@ -710,13 +707,13 @@ let an = class extends Ge {
|
|
|
710
707
|
}
|
|
711
708
|
if (f == null)
|
|
712
709
|
return;
|
|
713
|
-
const
|
|
714
|
-
if (
|
|
710
|
+
const b = o == null ? void 0 : o.findPositionByGlyph(f, v), P = this._getDocObject();
|
|
711
|
+
if (b == null || o == null || P == null || Xn(b))
|
|
715
712
|
return;
|
|
716
713
|
const N = {
|
|
717
|
-
...
|
|
714
|
+
...b,
|
|
718
715
|
isBack: u
|
|
719
|
-
}, B = P.document.getOffsetConfig(), E = new
|
|
716
|
+
}, B = P.document.getOffsetConfig(), E = new Fn(B, o), { cursorList: _, contentBoxPointGroup: L } = E.getRangePointData(N, N), { startOffset: G } = (V = kn(_)) != null ? V : {};
|
|
720
717
|
if (G != null)
|
|
721
718
|
return { offset: G, contentBoxPointGroup: L, segmentId: w, segmentPage: v };
|
|
722
719
|
}
|
|
@@ -727,14 +724,14 @@ let an = class extends Ge {
|
|
|
727
724
|
if (o == null || t == null)
|
|
728
725
|
return;
|
|
729
726
|
const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene: g } = t, m = c, l = g.getViewports()[0], { pageLayoutType: f = Ln.VERTICAL, pageMarginLeft: u, pageMarginTop: v, docsLeft: w, docsTop: I } = m.getOffsetConfig(), { left: O, top: C, angle: T } = n;
|
|
730
|
-
let { width:
|
|
727
|
+
let { width: b, height: P } = n;
|
|
731
728
|
const { positionV: N, positionH: B } = e.docTransform, { width: E, height: _ } = this._getPageContentSize(e);
|
|
732
|
-
|
|
729
|
+
b = Math.min(b, E), P = Math.min(P, _);
|
|
733
730
|
let L = null, G = "", x = -1;
|
|
734
731
|
const V = !1, S = {
|
|
735
732
|
...e.docTransform,
|
|
736
733
|
size: {
|
|
737
|
-
width:
|
|
734
|
+
width: b,
|
|
738
735
|
height: P
|
|
739
736
|
},
|
|
740
737
|
angle: T
|
|
@@ -744,43 +741,43 @@ let an = class extends Ge {
|
|
|
744
741
|
const U = (De = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : De.with(Re);
|
|
745
742
|
if (U == null)
|
|
746
743
|
return;
|
|
747
|
-
const
|
|
744
|
+
const F = r == null ? void 0 : r.findNodeByCoord(y, f, u, v, {
|
|
748
745
|
strict: !1,
|
|
749
746
|
segmentId: U.getSegment(),
|
|
750
747
|
segmentPage: U.getSegmentPage()
|
|
751
748
|
});
|
|
752
|
-
if (
|
|
753
|
-
const { node: we, segmentPage:
|
|
754
|
-
L = we, x =
|
|
749
|
+
if (F) {
|
|
750
|
+
const { node: we, segmentPage: fn, segmentId: pn } = F;
|
|
751
|
+
L = we, x = fn, G = pn;
|
|
755
752
|
}
|
|
756
753
|
if (L == null)
|
|
757
754
|
return;
|
|
758
|
-
const
|
|
759
|
-
if (
|
|
755
|
+
const M = (Ce = L.parent) == null ? void 0 : Ce.parent, A = M == null ? void 0 : M.parent, z = (de = A == null ? void 0 : A.lines.find((we) => we.paragraphIndex === (M == null ? void 0 : M.paragraphIndex) && we.paragraphStart)) != null ? de : A == null ? void 0 : A.lines[0], k = (Te = A == null ? void 0 : A.parent) == null ? void 0 : Te.parent;
|
|
756
|
+
if (M == null || A == null || z == null || k == null)
|
|
760
757
|
return;
|
|
761
758
|
this._liquid.reset();
|
|
762
|
-
const Z =
|
|
759
|
+
const Z = k.type;
|
|
763
760
|
for (const we of s) {
|
|
764
|
-
const { headerId:
|
|
761
|
+
const { headerId: fn, footerId: pn, pageHeight: Rt, pageWidth: Mn, marginLeft: bn, marginBottom: Et } = we, Nt = s.indexOf(we);
|
|
765
762
|
if (x > -1 && Nt === x) {
|
|
766
763
|
switch (Z) {
|
|
767
764
|
case Un.HEADER: {
|
|
768
|
-
const je = (ye = a.get(
|
|
765
|
+
const je = (ye = a.get(fn)) == null ? void 0 : ye.get(Mn);
|
|
769
766
|
if (je)
|
|
770
767
|
this._liquid.translatePagePadding({
|
|
771
768
|
marginTop: je.marginTop,
|
|
772
|
-
marginLeft:
|
|
769
|
+
marginLeft: bn
|
|
773
770
|
});
|
|
774
771
|
else
|
|
775
772
|
throw new Error("header skeleton not found");
|
|
776
773
|
break;
|
|
777
774
|
}
|
|
778
775
|
case Un.FOOTER: {
|
|
779
|
-
const je = (Ne = d.get(pn)) == null ? void 0 : Ne.get(
|
|
776
|
+
const je = (Ne = d.get(pn)) == null ? void 0 : Ne.get(Mn);
|
|
780
777
|
if (je)
|
|
781
778
|
this._liquid.translatePagePadding({
|
|
782
779
|
marginTop: Rt - Et + je.marginTop,
|
|
783
|
-
marginLeft:
|
|
780
|
+
marginLeft: bn
|
|
784
781
|
});
|
|
785
782
|
else
|
|
786
783
|
throw new Error("footer skeleton not found");
|
|
@@ -789,16 +786,16 @@ let an = class extends Ge {
|
|
|
789
786
|
}
|
|
790
787
|
break;
|
|
791
788
|
}
|
|
792
|
-
if (this._liquid.translatePagePadding(we), we ===
|
|
789
|
+
if (this._liquid.translatePagePadding(we), we === k)
|
|
793
790
|
break;
|
|
794
791
|
this._liquid.restorePagePadding(we), this._liquid.translatePage(we, f, u, v);
|
|
795
792
|
}
|
|
796
|
-
switch (N.relativeFrom === H.LINE ? L =
|
|
793
|
+
switch (N.relativeFrom === H.LINE ? L = M.divides[0].glyphGroup[0] : L = (ge = (le = (Pe = (Ae = z.divides) == null ? void 0 : Ae[0]) == null ? void 0 : Pe.glyphGroup) == null ? void 0 : le[0]) != null ? ge : L, S.positionH = {
|
|
797
794
|
relativeFrom: B.relativeFrom,
|
|
798
795
|
posOffset: O - this._liquid.x - w
|
|
799
796
|
}, B.relativeFrom) {
|
|
800
797
|
case ee.MARGIN: {
|
|
801
|
-
S.positionH.posOffset = O - this._liquid.x - w -
|
|
798
|
+
S.positionH.posOffset = O - this._liquid.x - w - k.marginLeft;
|
|
802
799
|
break;
|
|
803
800
|
}
|
|
804
801
|
case ee.COLUMN: {
|
|
@@ -811,11 +808,11 @@ let an = class extends Ge {
|
|
|
811
808
|
posOffset: C - this._liquid.y - I
|
|
812
809
|
}, N.relativeFrom) {
|
|
813
810
|
case H.PAGE: {
|
|
814
|
-
S.positionV.posOffset = C - this._liquid.y - I -
|
|
811
|
+
S.positionV.posOffset = C - this._liquid.y - I - k.marginTop;
|
|
815
812
|
break;
|
|
816
813
|
}
|
|
817
814
|
case H.LINE: {
|
|
818
|
-
S.positionV.posOffset = C - this._liquid.y - I -
|
|
815
|
+
S.positionV.posOffset = C - this._liquid.y - I - M.top;
|
|
819
816
|
break;
|
|
820
817
|
}
|
|
821
818
|
case H.PARAGRAPH: {
|
|
@@ -831,7 +828,7 @@ let an = class extends Ge {
|
|
|
831
828
|
const Ee = {
|
|
832
829
|
...ae,
|
|
833
830
|
isBack: V
|
|
834
|
-
}, Ve = Be.document.getOffsetConfig(), ce = new
|
|
831
|
+
}, Ve = Be.document.getOffsetConfig(), ce = new Fn(Ve, r), { cursorList: ie } = ce.getRangePointData(Ee, Ee), { startOffset: re } = (xe = kn(ie)) != null ? xe : {};
|
|
835
832
|
if (re != null)
|
|
836
833
|
return { offset: re, docTransform: S, segmentId: G, segmentPage: x };
|
|
837
834
|
}
|
|
@@ -886,17 +883,17 @@ let an = class extends Ge {
|
|
|
886
883
|
let O = o;
|
|
887
884
|
this._liquid.reset();
|
|
888
885
|
for (const C of m) {
|
|
889
|
-
const { marginBottom: T, pageHeight:
|
|
886
|
+
const { marginBottom: T, pageHeight: b } = C, P = m.indexOf(C), N = m[P + 1];
|
|
890
887
|
if (N == null)
|
|
891
888
|
continue;
|
|
892
|
-
if (
|
|
889
|
+
if (be.hasIntersectionBetweenTwoRanges(
|
|
893
890
|
o,
|
|
894
891
|
o + a,
|
|
895
|
-
this._liquid.y + u +
|
|
896
|
-
this._liquid.y + u +
|
|
892
|
+
this._liquid.y + u + b - T,
|
|
893
|
+
this._liquid.y + u + b + I + N.marginTop
|
|
897
894
|
)) {
|
|
898
|
-
const E = o + a / 2, _ = this._liquid.y + u +
|
|
899
|
-
E < _ ? O = Math.min(o, this._liquid.y + u +
|
|
895
|
+
const E = o + a / 2, _ = this._liquid.y + u + b + I / 2;
|
|
896
|
+
E < _ ? O = Math.min(o, this._liquid.y + u + b - T - a) : O = Math.max(o, this._liquid.y + u + b + I + N.marginTop);
|
|
900
897
|
}
|
|
901
898
|
this._liquid.translatePage(C, v, w, I);
|
|
902
899
|
}
|
|
@@ -913,7 +910,7 @@ let an = class extends Ge {
|
|
|
913
910
|
if (t && r.top !== n.top)
|
|
914
911
|
return;
|
|
915
912
|
const o = this._getDrawingAnchor(e, r), { offset: s, docTransform: a, segmentId: d, segmentPage: c } = o != null ? o : {};
|
|
916
|
-
return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(
|
|
913
|
+
return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(ht.id, {
|
|
917
914
|
unitId: e.unitId,
|
|
918
915
|
subUnitId: e.unitId,
|
|
919
916
|
drawing: e,
|
|
@@ -933,7 +930,7 @@ let an = class extends Ge {
|
|
|
933
930
|
return { scene: t, transformer: r };
|
|
934
931
|
}
|
|
935
932
|
_getTransformCoordForDocumentOffset(e, n, t, r) {
|
|
936
|
-
const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(
|
|
933
|
+
const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(gi.FromArray([t, r]));
|
|
937
934
|
if (s)
|
|
938
935
|
return o.clone().invert().applyPoint(s);
|
|
939
936
|
}
|
|
@@ -944,23 +941,23 @@ let an = class extends Ge {
|
|
|
944
941
|
const { mainComponent: r, scene: o } = t, s = r, {
|
|
945
942
|
docsLeft: a,
|
|
946
943
|
docsTop: d
|
|
947
|
-
} = s.getOffsetConfig(), c =
|
|
944
|
+
} = s.getOffsetConfig(), c = Ti(n), { left: g, top: m, height: l } = c, f = g + a, u = m + d;
|
|
948
945
|
if (this._anchorShape) {
|
|
949
946
|
this._anchorShape.transformByState({ left: f, top: u, height: l }), this._anchorShape.show();
|
|
950
947
|
return;
|
|
951
948
|
}
|
|
952
|
-
const v = 6, w = new
|
|
949
|
+
const v = 6, w = new mi(ji + be.generateRandomId(v), {
|
|
953
950
|
left: f,
|
|
954
951
|
top: u,
|
|
955
952
|
height: l,
|
|
956
953
|
strokeWidth: 2,
|
|
957
|
-
stroke:
|
|
954
|
+
stroke: ui(Bt.darkGray, 1),
|
|
958
955
|
evented: !1
|
|
959
956
|
});
|
|
960
|
-
this._anchorShape = w, o.addObject(w,
|
|
957
|
+
this._anchorShape = w, o.addObject(w, yi);
|
|
961
958
|
}
|
|
962
959
|
_getDocObject() {
|
|
963
|
-
return
|
|
960
|
+
return Pi(this._univerInstanceService, this._renderManagerService);
|
|
964
961
|
}
|
|
965
962
|
_getPageContentSize(e) {
|
|
966
963
|
const n = this._renderManagerService.getRenderById(e.unitId), t = n == null ? void 0 : n.with(te).getSkeleton(), r = 500, o = 500, s = t == null ? void 0 : t.getSkeletonData();
|
|
@@ -991,38 +988,38 @@ let an = class extends Ge {
|
|
|
991
988
|
};
|
|
992
989
|
}
|
|
993
990
|
};
|
|
994
|
-
an =
|
|
991
|
+
an = Vi([
|
|
995
992
|
Je(0, $),
|
|
996
993
|
Je(1, q),
|
|
997
994
|
Je(2, _e),
|
|
998
995
|
Je(3, J)
|
|
999
996
|
], an);
|
|
1000
|
-
var
|
|
1001
|
-
return
|
|
997
|
+
var fe = function() {
|
|
998
|
+
return fe = Object.assign || function(i) {
|
|
1002
999
|
for (var e, n = 1, t = arguments.length; n < t; n++) {
|
|
1003
1000
|
e = arguments[n];
|
|
1004
1001
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
|
|
1005
1002
|
}
|
|
1006
1003
|
return i;
|
|
1007
|
-
},
|
|
1008
|
-
},
|
|
1004
|
+
}, fe.apply(this, arguments);
|
|
1005
|
+
}, $i = function(i, e) {
|
|
1009
1006
|
var n = {};
|
|
1010
1007
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
1011
1008
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1012
1009
|
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
1013
1010
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
1014
1011
|
return n;
|
|
1015
|
-
},
|
|
1016
|
-
var n = i.icon, t = i.id, r = i.className, o = i.extend, s =
|
|
1017
|
-
return pt(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current },
|
|
1012
|
+
}, ft = at(function(i, e) {
|
|
1013
|
+
var n = i.icon, t = i.id, r = i.className, o = i.extend, s = $i(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Li("_".concat(qi()));
|
|
1014
|
+
return pt(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, fe({ ref: e, className: a }, s), o);
|
|
1018
1015
|
});
|
|
1019
1016
|
function pt(i, e, n, t, r) {
|
|
1020
|
-
return ct(i.tag,
|
|
1017
|
+
return ct(i.tag, fe(fe({ key: e }, zi(i, n, r)), t), (Xi(i, n).children || []).map(function(o, s) {
|
|
1021
1018
|
return pt(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
|
|
1022
1019
|
}));
|
|
1023
1020
|
}
|
|
1024
|
-
function
|
|
1025
|
-
var t =
|
|
1021
|
+
function zi(i, e, n) {
|
|
1022
|
+
var t = fe({}, i.attrs);
|
|
1026
1023
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1), i.tag === "mask" && t.id && (t.id = t.id + e.idSuffix), Object.entries(t).forEach(function(o) {
|
|
1027
1024
|
var s = o[0], a = o[1];
|
|
1028
1025
|
s === "mask" && typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
@@ -1033,21 +1030,21 @@ function Xi(i, e, n) {
|
|
|
1033
1030
|
typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1034
1031
|
})), t;
|
|
1035
1032
|
}
|
|
1036
|
-
function
|
|
1033
|
+
function Xi(i, e) {
|
|
1037
1034
|
var n, t = e.defIds;
|
|
1038
|
-
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ?
|
|
1039
|
-
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ?
|
|
1035
|
+
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? fe(fe({}, i), { children: i.children.map(function(r) {
|
|
1036
|
+
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? fe(fe({}, r), { attrs: fe(fe({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
1040
1037
|
}) }) : i;
|
|
1041
1038
|
}
|
|
1042
|
-
function
|
|
1039
|
+
function qi() {
|
|
1043
1040
|
return Math.random().toString(36).substring(2, 8);
|
|
1044
1041
|
}
|
|
1045
|
-
|
|
1046
|
-
var
|
|
1047
|
-
return ct(
|
|
1042
|
+
ft.displayName = "UniverIcon";
|
|
1043
|
+
var Ki = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, wt = at(function(i, e) {
|
|
1044
|
+
return ct(ft, Object.assign({}, i, {
|
|
1048
1045
|
id: "add-image-single",
|
|
1049
1046
|
ref: e,
|
|
1050
|
-
icon:
|
|
1047
|
+
icon: Ki
|
|
1051
1048
|
}));
|
|
1052
1049
|
});
|
|
1053
1050
|
wt.displayName = "AddImageSingle";
|
|
@@ -1056,11 +1053,11 @@ const yn = {
|
|
|
1056
1053
|
type: Y.COMMAND,
|
|
1057
1054
|
// eslint-disable-next-line max-lines-per-function
|
|
1058
1055
|
handler: (i, e) => {
|
|
1059
|
-
var
|
|
1056
|
+
var b, P, N, B;
|
|
1060
1057
|
const n = i.get($), t = i.get(q), r = i.get(J), o = t.getCurrentUniverDocInstance();
|
|
1061
1058
|
if (e == null || o == null)
|
|
1062
1059
|
return !1;
|
|
1063
|
-
const s = r.getRenderById(e.unitId).with(Re), { drawings: a } = e, d = (
|
|
1060
|
+
const s = r.getRenderById(e.unitId).with(Re), { drawings: a } = e, d = (b = s.getSegment()) != null ? b : "", c = new Dn(), g = X.getInstance(), m = (N = (P = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : P.customBlocks) != null ? N : [], l = a.map((E) => m.find((_) => _.blockId === E.drawingId)).filter((E) => !!E).sort((E, _) => E.startIndex > _.startIndex ? 1 : -1), f = a[0].unitId, u = new Ft();
|
|
1064
1061
|
u.reset();
|
|
1065
1062
|
const v = l[0].startIndex, w = [
|
|
1066
1063
|
{
|
|
@@ -1152,7 +1149,7 @@ const yn = {
|
|
|
1152
1149
|
len: g
|
|
1153
1150
|
});
|
|
1154
1151
|
else {
|
|
1155
|
-
const _ =
|
|
1152
|
+
const _ = kt.selection.delete([o], l, 0, null, !1);
|
|
1156
1153
|
f.push(..._);
|
|
1157
1154
|
const L = Mi(l, [o]), G = (B = s.getDrawings()) != null ? B : {}, x = (E = s.getDrawingsOrder()) != null ? E : [], V = L.sort((S, D) => x.indexOf(S) > x.indexOf(D) ? -1 : x.indexOf(S) < x.indexOf(D) ? 1 : 0);
|
|
1158
1155
|
if (V.length > 0)
|
|
@@ -1206,7 +1203,7 @@ const yn = {
|
|
|
1206
1203
|
if (g == null)
|
|
1207
1204
|
return !1;
|
|
1208
1205
|
const m = [];
|
|
1209
|
-
let l =
|
|
1206
|
+
let l = be.deepClone(g);
|
|
1210
1207
|
l = l.slice(3), l.unshift("drawingsOrder"), m.push(l);
|
|
1211
1208
|
const f = {
|
|
1212
1209
|
id: ne.id,
|
|
@@ -1235,8 +1232,8 @@ const yn = {
|
|
|
1235
1232
|
return !1;
|
|
1236
1233
|
}
|
|
1237
1234
|
};
|
|
1238
|
-
var
|
|
1239
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1235
|
+
var Yi = Object.getOwnPropertyDescriptor, Zi = (i, e, n, t) => {
|
|
1236
|
+
for (var r = t > 1 ? void 0 : t ? Yi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1240
1237
|
(s = i[o]) && (r = s(r) || r);
|
|
1241
1238
|
return r;
|
|
1242
1239
|
}, me = (i, e) => (n, t) => e(n, t, i);
|
|
@@ -1247,7 +1244,7 @@ let cn = class extends Ge {
|
|
|
1247
1244
|
async insertDocImage() {
|
|
1248
1245
|
const i = await this._fileOpenerService.openFile({
|
|
1249
1246
|
multiple: !0,
|
|
1250
|
-
accept:
|
|
1247
|
+
accept: Jt.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
1251
1248
|
}), e = i.length;
|
|
1252
1249
|
return e > Nn ? (this._messageService.show({
|
|
1253
1250
|
type: Vn.Error,
|
|
@@ -1264,7 +1261,7 @@ let cn = class extends Ge {
|
|
|
1264
1261
|
let s = "";
|
|
1265
1262
|
switch (o) {
|
|
1266
1263
|
case vn.ERROR_EXCEED_SIZE:
|
|
1267
|
-
s = this._localeService.t("update-status.exceedMaxSize", String(
|
|
1264
|
+
s = this._localeService.t("update-status.exceedMaxSize", String(ei / (1024 * 1024)));
|
|
1268
1265
|
break;
|
|
1269
1266
|
case vn.ERROR_IMAGE_TYPE:
|
|
1270
1267
|
s = this._localeService.t("update-status.invalidImageType");
|
|
@@ -1284,7 +1281,7 @@ let cn = class extends Ge {
|
|
|
1284
1281
|
for (const r of e) {
|
|
1285
1282
|
if (r == null)
|
|
1286
1283
|
continue;
|
|
1287
|
-
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: g, image: m } = await
|
|
1284
|
+
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: g, image: m } = await ni(d || "");
|
|
1288
1285
|
this._imageIoService.addImageSourceCache(o, s, m);
|
|
1289
1286
|
let l = 1;
|
|
1290
1287
|
if (c > An || g > xn) {
|
|
@@ -1422,7 +1419,7 @@ let cn = class extends Ge {
|
|
|
1422
1419
|
return;
|
|
1423
1420
|
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === We.BODY;
|
|
1424
1421
|
for (const d of Object.keys(o)) {
|
|
1425
|
-
const c = o[d], g =
|
|
1422
|
+
const c = o[d], g = ti({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(g, !0);
|
|
1426
1423
|
if (m.length)
|
|
1427
1424
|
for (const l of m) {
|
|
1428
1425
|
e.detachTransformerFrom(l);
|
|
@@ -1468,19 +1465,19 @@ let cn = class extends Ge {
|
|
|
1468
1465
|
this._docSelectionManagerService.replaceDocRanges(t);
|
|
1469
1466
|
}
|
|
1470
1467
|
};
|
|
1471
|
-
cn =
|
|
1468
|
+
cn = Zi([
|
|
1472
1469
|
me(1, $),
|
|
1473
1470
|
me(2, pe(On)),
|
|
1474
1471
|
me(3, J),
|
|
1475
|
-
me(4,
|
|
1472
|
+
me(4, Qt),
|
|
1476
1473
|
me(5, Ue),
|
|
1477
1474
|
me(6, _e),
|
|
1478
1475
|
me(7, Zn),
|
|
1479
|
-
me(8,
|
|
1476
|
+
me(8, pi),
|
|
1480
1477
|
me(9, pe(un)),
|
|
1481
1478
|
me(10, pe(Re)),
|
|
1482
|
-
me(11, pe(
|
|
1483
|
-
me(12,
|
|
1479
|
+
me(11, pe(hn)),
|
|
1480
|
+
me(12, wi)
|
|
1484
1481
|
], cn);
|
|
1485
1482
|
const Dt = {
|
|
1486
1483
|
id: "doc.command.insert-float-image",
|
|
@@ -1505,11 +1502,11 @@ const Dt = {
|
|
|
1505
1502
|
const { drawingId: w } = v, I = (P = l == null ? void 0 : l.getSnapshot().drawings) == null ? void 0 : P[w];
|
|
1506
1503
|
if (I == null || I.layoutType === W.INLINE)
|
|
1507
1504
|
return null;
|
|
1508
|
-
const { positionH: O, positionV: C } = I.docTransform, T = { ...O },
|
|
1509
|
-
return s ===
|
|
1505
|
+
const { positionH: O, positionV: C } = I.docTransform, T = { ...O }, b = { ...C };
|
|
1506
|
+
return s === he.UP ? b.posOffset = ((N = b.posOffset) != null ? N : 0) - 2 : s === he.DOWN ? b.posOffset = ((B = b.posOffset) != null ? B : 0) + 2 : s === he.LEFT ? T.posOffset = ((E = T.posOffset) != null ? E : 0) - 2 : s === he.RIGHT && (T.posOffset = ((_ = T.posOffset) != null ? _ : 0) + 2), {
|
|
1510
1507
|
drawingId: w,
|
|
1511
|
-
key: s ===
|
|
1512
|
-
value: s ===
|
|
1508
|
+
key: s === he.UP || s === he.DOWN ? "positionV" : "positionH",
|
|
1509
|
+
value: s === he.UP || s === he.DOWN ? b : T
|
|
1513
1510
|
};
|
|
1514
1511
|
}).filter((v) => v != null);
|
|
1515
1512
|
if (f.length === 0)
|
|
@@ -1521,7 +1518,7 @@ const Dt = {
|
|
|
1521
1518
|
});
|
|
1522
1519
|
return m.refreshControls(), !!u;
|
|
1523
1520
|
}
|
|
1524
|
-
},
|
|
1521
|
+
}, Qi = {
|
|
1525
1522
|
id: "doc.operation.clear-drawing-transformer",
|
|
1526
1523
|
type: Y.MUTATION,
|
|
1527
1524
|
handler: (i, e) => {
|
|
@@ -1535,7 +1532,7 @@ const Dt = {
|
|
|
1535
1532
|
id: "sidebar.operation.doc-image",
|
|
1536
1533
|
type: Y.COMMAND,
|
|
1537
1534
|
handler: async (i, e) => {
|
|
1538
|
-
const n = i.get(
|
|
1535
|
+
const n = i.get(vi), t = i.get(un), r = i.get(_e);
|
|
1539
1536
|
switch (e.value) {
|
|
1540
1537
|
case "open":
|
|
1541
1538
|
n.open({
|
|
@@ -1561,17 +1558,17 @@ const Dt = {
|
|
|
1561
1558
|
const n = i.get(_e), t = i.get($);
|
|
1562
1559
|
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Ot.id, { value: "open" }), !0);
|
|
1563
1560
|
}
|
|
1564
|
-
},
|
|
1565
|
-
imageCommonPanel:
|
|
1566
|
-
imageCommonPanelGrid:
|
|
1567
|
-
imageCommonPanelBorder:
|
|
1568
|
-
imageCommonPanelTitle:
|
|
1569
|
-
imageCommonPanelSubtitle:
|
|
1570
|
-
imageCommonPanelRow:
|
|
1571
|
-
imageCommonPanelColumn:
|
|
1572
|
-
imageCommonPanelSpan2:
|
|
1573
|
-
imageCommonPanelInput:
|
|
1574
|
-
}, qn = -1e3, Kn = 1e3,
|
|
1561
|
+
}, Ji = "univer-image-common-panel", er = "univer-image-common-panel-grid", nr = "univer-image-common-panel-border", tr = "univer-image-common-panel-title", ir = "univer-image-common-panel-subtitle", rr = "univer-image-common-panel-row", or = "univer-image-common-panel-column", sr = "univer-image-common-panel-span2", ar = "univer-image-common-panel-input", h = {
|
|
1562
|
+
imageCommonPanel: Ji,
|
|
1563
|
+
imageCommonPanelGrid: er,
|
|
1564
|
+
imageCommonPanelBorder: nr,
|
|
1565
|
+
imageCommonPanelTitle: tr,
|
|
1566
|
+
imageCommonPanelSubtitle: ir,
|
|
1567
|
+
imageCommonPanelRow: rr,
|
|
1568
|
+
imageCommonPanelColumn: or,
|
|
1569
|
+
imageCommonPanelSpan2: sr,
|
|
1570
|
+
imageCommonPanelInput: ar
|
|
1571
|
+
}, qn = -1e3, Kn = 1e3, cr = (i) => {
|
|
1575
1572
|
const e = ve($), n = ve(un), t = ve(_e), r = ve(J), o = ve(q), { drawings: s } = i, a = s[0];
|
|
1576
1573
|
if (a == null)
|
|
1577
1574
|
return;
|
|
@@ -1605,13 +1602,13 @@ const Dt = {
|
|
|
1605
1602
|
}], [w, I] = oe(!0), [O, C] = oe({
|
|
1606
1603
|
relativeFrom: ee.PAGE,
|
|
1607
1604
|
posOffset: 0
|
|
1608
|
-
}), [T,
|
|
1605
|
+
}), [T, b] = oe({
|
|
1609
1606
|
relativeFrom: H.PAGE,
|
|
1610
1607
|
posOffset: 0
|
|
1611
1608
|
}), [P, N] = oe(!0), [B, E] = oe(!0);
|
|
1612
1609
|
function _(D, R) {
|
|
1613
|
-
var
|
|
1614
|
-
D === "positionH" ? C(R) :
|
|
1610
|
+
var M;
|
|
1611
|
+
D === "positionH" ? C(R) : b(R);
|
|
1615
1612
|
const y = t.getFocusDrawings();
|
|
1616
1613
|
if (y.length === 0)
|
|
1617
1614
|
return;
|
|
@@ -1629,44 +1626,44 @@ const Dt = {
|
|
|
1629
1626
|
value: R
|
|
1630
1627
|
}))
|
|
1631
1628
|
});
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1629
|
+
const F = (M = r.getRenderById(d)) == null ? void 0 : M.with(Re);
|
|
1630
|
+
F && F.blur(), f.refreshControls();
|
|
1634
1631
|
}
|
|
1635
1632
|
function L(D) {
|
|
1636
1633
|
var re, De, Ce;
|
|
1637
1634
|
const R = O.relativeFrom, y = O.posOffset, U = Number(D);
|
|
1638
1635
|
if (R === U)
|
|
1639
1636
|
return;
|
|
1640
|
-
const
|
|
1641
|
-
if (
|
|
1637
|
+
const F = t.getFocusDrawings();
|
|
1638
|
+
if (F.length === 0)
|
|
1642
1639
|
return;
|
|
1643
|
-
const
|
|
1644
|
-
let z = null,
|
|
1640
|
+
const M = F[0].drawingId, A = F[0].unitId;
|
|
1641
|
+
let z = null, k = 0;
|
|
1645
1642
|
const Z = (re = r.getRenderById(A)) == null ? void 0 : re.with(te).getSkeleton(), ae = Z == null ? void 0 : Z.getSkeletonData();
|
|
1646
1643
|
if (ae == null)
|
|
1647
1644
|
return;
|
|
1648
1645
|
const { pages: Be, skeHeaders: Ee, skeFooters: Ve } = ae;
|
|
1649
1646
|
for (const de of Be) {
|
|
1650
1647
|
const { marginLeft: Te, skeDrawings: ye, headerId: Ne, footerId: Ae, pageWidth: Pe } = de;
|
|
1651
|
-
if (ye.has(
|
|
1652
|
-
z = ye.get(
|
|
1648
|
+
if (ye.has(M)) {
|
|
1649
|
+
z = ye.get(M), k = Te;
|
|
1653
1650
|
break;
|
|
1654
1651
|
}
|
|
1655
1652
|
const le = (De = Ee.get(Ne)) == null ? void 0 : De.get(Pe);
|
|
1656
|
-
if (le != null && le.skeDrawings.has(
|
|
1657
|
-
z = le == null ? void 0 : le.skeDrawings.get(
|
|
1653
|
+
if (le != null && le.skeDrawings.has(M)) {
|
|
1654
|
+
z = le == null ? void 0 : le.skeDrawings.get(M), k = Te;
|
|
1658
1655
|
break;
|
|
1659
1656
|
}
|
|
1660
1657
|
const ge = (Ce = Ve.get(Ae)) == null ? void 0 : Ce.get(Pe);
|
|
1661
|
-
if (ge != null && ge.skeDrawings.has(
|
|
1662
|
-
z = ge == null ? void 0 : ge.skeDrawings.get(
|
|
1658
|
+
if (ge != null && ge.skeDrawings.has(M)) {
|
|
1659
|
+
z = ge == null ? void 0 : ge.skeDrawings.get(M), k = Te;
|
|
1663
1660
|
break;
|
|
1664
1661
|
}
|
|
1665
1662
|
}
|
|
1666
1663
|
if (z == null)
|
|
1667
1664
|
return;
|
|
1668
1665
|
let ce = 0;
|
|
1669
|
-
R === ee.COLUMN ? ce -= z.columnLeft : R === ee.MARGIN && (ce -=
|
|
1666
|
+
R === ee.COLUMN ? ce -= z.columnLeft : R === ee.MARGIN && (ce -= k), U === ee.COLUMN ? ce += z.columnLeft : U === ee.MARGIN ? ce += k : ee.PAGE;
|
|
1670
1667
|
const ie = {
|
|
1671
1668
|
relativeFrom: U,
|
|
1672
1669
|
posOffset: (y != null ? y : 0) - ce
|
|
@@ -1678,13 +1675,13 @@ const Dt = {
|
|
|
1678
1675
|
const R = T.relativeFrom, y = T.posOffset, U = Number(D);
|
|
1679
1676
|
if (R === U)
|
|
1680
1677
|
return;
|
|
1681
|
-
const
|
|
1682
|
-
if (
|
|
1678
|
+
const F = t.getFocusDrawings();
|
|
1679
|
+
if (F.length === 0)
|
|
1683
1680
|
return;
|
|
1684
|
-
const { drawingId:
|
|
1685
|
-
if (Ee == null ||
|
|
1681
|
+
const { drawingId: M, unitId: A } = F[0], z = o.getUniverDocInstance(A), k = (ye = r.getRenderById(A)) == null ? void 0 : ye.with(te).getSkeleton(), Z = (Ne = r.getRenderById(A)) == null ? void 0 : Ne.with(Re), ae = Z == null ? void 0 : Z.getSegment(), Be = Z == null ? void 0 : Z.getSegmentPage(), Ee = (Pe = (Ae = z == null ? void 0 : z.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ae.customBlocks) == null ? void 0 : Pe.find((xe) => xe.blockId === M);
|
|
1682
|
+
if (Ee == null || k == null || Z == null)
|
|
1686
1683
|
return;
|
|
1687
|
-
const { startIndex: Ve } = Ee, ce =
|
|
1684
|
+
const { startIndex: Ve } = Ee, ce = k.findNodeByCharIndex(Ve, ae, Be), ie = (le = ce == null ? void 0 : ce.parent) == null ? void 0 : le.parent, re = ie == null ? void 0 : ie.parent, De = re == null ? void 0 : re.lines.find((xe) => xe.paragraphIndex === (ie == null ? void 0 : ie.paragraphIndex) && xe.paragraphStart), Ce = (ge = re == null ? void 0 : re.parent) == null ? void 0 : ge.parent;
|
|
1688
1685
|
if (ce == null || ie == null || De == null || re == null || Ce == null)
|
|
1689
1686
|
return;
|
|
1690
1687
|
let de = 0;
|
|
@@ -1701,10 +1698,10 @@ const Dt = {
|
|
|
1701
1698
|
if (y == null)
|
|
1702
1699
|
return;
|
|
1703
1700
|
const { layoutType: U } = y, {
|
|
1704
|
-
positionH:
|
|
1705
|
-
positionV:
|
|
1701
|
+
positionH: F,
|
|
1702
|
+
positionV: M
|
|
1706
1703
|
} = y.docTransform;
|
|
1707
|
-
C(
|
|
1704
|
+
C(F), b(M), I(U === W.INLINE), N(M.relativeFrom === H.PARAGRAPH || M.relativeFrom === H.LINE);
|
|
1708
1705
|
}
|
|
1709
1706
|
function V() {
|
|
1710
1707
|
const D = t.getFocusDrawings();
|
|
@@ -1734,7 +1731,7 @@ const Dt = {
|
|
|
1734
1731
|
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1735
1732
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1736
1733
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(
|
|
1737
|
-
|
|
1734
|
+
ke,
|
|
1738
1735
|
{
|
|
1739
1736
|
min: qn,
|
|
1740
1737
|
max: Kn,
|
|
@@ -1769,7 +1766,7 @@ const Dt = {
|
|
|
1769
1766
|
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1770
1767
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1771
1768
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(
|
|
1772
|
-
|
|
1769
|
+
ke,
|
|
1773
1770
|
{
|
|
1774
1771
|
min: qn,
|
|
1775
1772
|
max: Kn,
|
|
@@ -1800,16 +1797,16 @@ const Dt = {
|
|
|
1800
1797
|
] }) })
|
|
1801
1798
|
] }),
|
|
1802
1799
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSubtitle), children: /* @__PURE__ */ p("div", { children: n.t("image-position.options") }) }) }),
|
|
1803
|
-
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(
|
|
1800
|
+
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(xi, { disabled: w, checked: P, onChange: S, children: n.t("image-position.moveObjectWithText") }) }) })
|
|
1804
1801
|
] });
|
|
1805
|
-
}, en = 0, nn = 100,
|
|
1802
|
+
}, en = 0, nn = 100, dr = (i) => {
|
|
1806
1803
|
const e = ve($), n = ve(un), t = ve(_e), r = ve(J), o = ve(q), { drawings: s } = i, a = s[0];
|
|
1807
1804
|
if (a == null)
|
|
1808
1805
|
return null;
|
|
1809
1806
|
const { unitId: d } = a, c = o.getUniverDocInstance(d), g = r.getRenderById(d);
|
|
1810
1807
|
if ((g == null ? void 0 : g.scene) == null)
|
|
1811
1808
|
return null;
|
|
1812
|
-
const [l, f] = oe(!0), [u, v] = oe(!0), [w, I] = oe(!0), [O, C] = oe(ue.INLINE), [T,
|
|
1809
|
+
const [l, f] = oe(!0), [u, v] = oe(!0), [w, I] = oe(!0), [O, C] = oe(ue.INLINE), [T, b] = oe(""), [P, N] = oe({
|
|
1813
1810
|
distT: 0,
|
|
1814
1811
|
distL: 0,
|
|
1815
1812
|
distB: 0,
|
|
@@ -1820,9 +1817,9 @@ const Dt = {
|
|
|
1820
1817
|
const D = t.getFocusDrawings();
|
|
1821
1818
|
if (D.length === 0)
|
|
1822
1819
|
return;
|
|
1823
|
-
const { unitId: R, subUnitId: y } = D[0], U = D.map(({ unitId:
|
|
1824
|
-
unitId:
|
|
1825
|
-
subUnitId:
|
|
1820
|
+
const { unitId: R, subUnitId: y } = D[0], U = D.map(({ unitId: F, subUnitId: M, drawingId: A }) => ({
|
|
1821
|
+
unitId: F,
|
|
1822
|
+
subUnitId: M,
|
|
1826
1823
|
drawingId: A
|
|
1827
1824
|
}));
|
|
1828
1825
|
e.executeCommand(lt.id, {
|
|
@@ -1833,7 +1830,7 @@ const Dt = {
|
|
|
1833
1830
|
});
|
|
1834
1831
|
}
|
|
1835
1832
|
function L(S) {
|
|
1836
|
-
|
|
1833
|
+
b(S);
|
|
1837
1834
|
const D = t.getFocusDrawings();
|
|
1838
1835
|
if (D.length === 0)
|
|
1839
1836
|
return;
|
|
@@ -1857,10 +1854,10 @@ const Dt = {
|
|
|
1857
1854
|
const y = t.getFocusDrawings();
|
|
1858
1855
|
if (y.length === 0)
|
|
1859
1856
|
return;
|
|
1860
|
-
const U = y.map((
|
|
1861
|
-
unitId:
|
|
1862
|
-
subUnitId:
|
|
1863
|
-
drawingId:
|
|
1857
|
+
const U = y.map((F) => ({
|
|
1858
|
+
unitId: F.unitId,
|
|
1859
|
+
subUnitId: F.subUnitId,
|
|
1860
|
+
drawingId: F.drawingId
|
|
1864
1861
|
}));
|
|
1865
1862
|
e.executeCommand(gt.id, {
|
|
1866
1863
|
unitId: y[0].unitId,
|
|
@@ -1884,8 +1881,8 @@ const Dt = {
|
|
|
1884
1881
|
distT: R = 0,
|
|
1885
1882
|
distL: y = 0,
|
|
1886
1883
|
distB: U = 0,
|
|
1887
|
-
distR:
|
|
1888
|
-
layoutType:
|
|
1884
|
+
distR: F = 0,
|
|
1885
|
+
layoutType: M = W.INLINE,
|
|
1889
1886
|
behindDoc: A = se.FALSE,
|
|
1890
1887
|
wrapText: z = Xe.BOTH_SIDES
|
|
1891
1888
|
} = D;
|
|
@@ -1893,11 +1890,11 @@ const Dt = {
|
|
|
1893
1890
|
distT: R,
|
|
1894
1891
|
distL: y,
|
|
1895
1892
|
distB: U,
|
|
1896
|
-
distR:
|
|
1897
|
-
}),
|
|
1893
|
+
distR: F
|
|
1894
|
+
}), b(z), f(M !== W.WRAP_SQUARE), M === W.WRAP_NONE || M === W.INLINE ? v(!0) : v(!1), M === W.WRAP_NONE || M === W.INLINE || M === W.WRAP_TOP_AND_BOTTOM ? I(!0) : I(!1), M === W.WRAP_NONE)
|
|
1898
1895
|
A === se.TRUE ? C(ue.BEHIND_TEXT) : C(ue.IN_FRONT_OF_TEXT);
|
|
1899
1896
|
else
|
|
1900
|
-
switch (
|
|
1897
|
+
switch (M) {
|
|
1901
1898
|
case W.INLINE:
|
|
1902
1899
|
C(ue.INLINE);
|
|
1903
1900
|
break;
|
|
@@ -1908,7 +1905,7 @@ const Dt = {
|
|
|
1908
1905
|
C(ue.WRAP_TOP_AND_BOTTOM);
|
|
1909
1906
|
break;
|
|
1910
1907
|
default:
|
|
1911
|
-
throw new Error(`Unsupported layout type: ${
|
|
1908
|
+
throw new Error(`Unsupported layout type: ${M}`);
|
|
1912
1909
|
}
|
|
1913
1910
|
}
|
|
1914
1911
|
return Tn(() => {
|
|
@@ -1929,24 +1926,24 @@ const Dt = {
|
|
|
1929
1926
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelTitle), children: /* @__PURE__ */ p("div", { children: n.t("image-text-wrap.title") }) }) }),
|
|
1930
1927
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSubtitle), children: /* @__PURE__ */ p("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
|
|
1931
1928
|
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelRow), children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn), children: /* @__PURE__ */ K($n, { value: O, onChange: _, direction: "vertical", children: [
|
|
1932
|
-
/* @__PURE__ */ p(
|
|
1933
|
-
/* @__PURE__ */ p(
|
|
1934
|
-
/* @__PURE__ */ p(
|
|
1935
|
-
/* @__PURE__ */ p(
|
|
1936
|
-
/* @__PURE__ */ p(
|
|
1929
|
+
/* @__PURE__ */ p(Me, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
|
|
1930
|
+
/* @__PURE__ */ p(Me, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
|
|
1931
|
+
/* @__PURE__ */ p(Me, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
|
|
1932
|
+
/* @__PURE__ */ p(Me, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
|
|
1933
|
+
/* @__PURE__ */ p(Me, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
|
|
1937
1934
|
] }) }) }),
|
|
1938
1935
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSubtitle), children: /* @__PURE__ */ p("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
|
|
1939
1936
|
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelRow), children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn), children: /* @__PURE__ */ K($n, { disabled: l, value: T, onChange: L, direction: "horizontal", children: [
|
|
1940
|
-
/* @__PURE__ */ p(
|
|
1941
|
-
/* @__PURE__ */ p(
|
|
1942
|
-
/* @__PURE__ */ p(
|
|
1937
|
+
/* @__PURE__ */ p(Me, { value: Xe.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
|
|
1938
|
+
/* @__PURE__ */ p(Me, { value: Xe.LEFT, children: n.t("image-text-wrap.leftOnly") }),
|
|
1939
|
+
/* @__PURE__ */ p(Me, { value: Xe.RIGHT, children: n.t("image-text-wrap.rightOnly") })
|
|
1943
1940
|
] }) }) }),
|
|
1944
1941
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSubtitle), children: /* @__PURE__ */ p("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
|
|
1945
1942
|
/* @__PURE__ */ K("div", { className: h.imageCommonPanelRow, children: [
|
|
1946
1943
|
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1947
1944
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: n.t("image-text-wrap.top") }) }),
|
|
1948
1945
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(
|
|
1949
|
-
|
|
1946
|
+
ke,
|
|
1950
1947
|
{
|
|
1951
1948
|
min: en,
|
|
1952
1949
|
max: nn,
|
|
@@ -1963,7 +1960,7 @@ const Dt = {
|
|
|
1963
1960
|
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1964
1961
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: n.t("image-text-wrap.left") }) }),
|
|
1965
1962
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(
|
|
1966
|
-
|
|
1963
|
+
ke,
|
|
1967
1964
|
{
|
|
1968
1965
|
min: en,
|
|
1969
1966
|
max: nn,
|
|
@@ -1982,7 +1979,7 @@ const Dt = {
|
|
|
1982
1979
|
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1983
1980
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: n.t("image-text-wrap.bottom") }) }),
|
|
1984
1981
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(
|
|
1985
|
-
|
|
1982
|
+
ke,
|
|
1986
1983
|
{
|
|
1987
1984
|
min: en,
|
|
1988
1985
|
max: nn,
|
|
@@ -1999,7 +1996,7 @@ const Dt = {
|
|
|
1999
1996
|
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
2000
1997
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: n.t("image-text-wrap.right") }) }),
|
|
2001
1998
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(
|
|
2002
|
-
|
|
1999
|
+
ke,
|
|
2003
2000
|
{
|
|
2004
2001
|
min: en,
|
|
2005
2002
|
max: nn,
|
|
@@ -2015,7 +2012,7 @@ const Dt = {
|
|
|
2015
2012
|
] }) })
|
|
2016
2013
|
] })
|
|
2017
2014
|
] });
|
|
2018
|
-
},
|
|
2015
|
+
}, lr = () => {
|
|
2019
2016
|
const i = ve(_e), e = i.getFocusDrawings(), [n, t] = oe(e);
|
|
2020
2017
|
return Tn(() => {
|
|
2021
2018
|
const r = i.focus$.subscribe((o) => {
|
|
@@ -2025,13 +2022,13 @@ const Dt = {
|
|
|
2025
2022
|
r.unsubscribe();
|
|
2026
2023
|
};
|
|
2027
2024
|
}, []), !!(n != null && n.length) && /* @__PURE__ */ K("div", { className: h.imageCommonPanel, children: [
|
|
2028
|
-
/* @__PURE__ */ p(
|
|
2029
|
-
/* @__PURE__ */ p(
|
|
2030
|
-
/* @__PURE__ */ p(
|
|
2025
|
+
/* @__PURE__ */ p(ri, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
|
|
2026
|
+
/* @__PURE__ */ p(dr, { drawings: n }),
|
|
2027
|
+
/* @__PURE__ */ p(cr, { drawings: n })
|
|
2031
2028
|
] });
|
|
2032
|
-
}, yt = "addition-and-subtraction-single", Pt = "doc.menu.image",
|
|
2029
|
+
}, yt = "addition-and-subtraction-single", Pt = "doc.menu.image", Mt = Dt.id, gr = (i) => {
|
|
2033
2030
|
const e = i.get(On), n = i.get(q);
|
|
2034
|
-
return new
|
|
2031
|
+
return new Ei((t) => {
|
|
2035
2032
|
const r = e.textSelection$.subscribe(() => {
|
|
2036
2033
|
var s;
|
|
2037
2034
|
const o = e.getActiveTextRange();
|
|
@@ -2053,40 +2050,40 @@ const Dt = {
|
|
|
2053
2050
|
return () => r.unsubscribe();
|
|
2054
2051
|
});
|
|
2055
2052
|
};
|
|
2056
|
-
function
|
|
2053
|
+
function mr(i) {
|
|
2057
2054
|
return {
|
|
2058
2055
|
id: Pt,
|
|
2059
2056
|
type: nt.SUBITEMS,
|
|
2060
2057
|
icon: yt,
|
|
2061
2058
|
tooltip: "docImage.title",
|
|
2062
|
-
disabled$:
|
|
2059
|
+
disabled$: gr(i),
|
|
2063
2060
|
hidden$: et(i, Ie.UNIVER_DOC, void 0, Cn)
|
|
2064
2061
|
};
|
|
2065
2062
|
}
|
|
2066
|
-
function
|
|
2063
|
+
function ur(i) {
|
|
2067
2064
|
return {
|
|
2068
|
-
id:
|
|
2065
|
+
id: Mt,
|
|
2069
2066
|
title: "docImage.upload.float",
|
|
2070
2067
|
type: nt.BUTTON,
|
|
2071
2068
|
hidden$: et(i, Ie.UNIVER_DOC, void 0, Cn)
|
|
2072
2069
|
};
|
|
2073
2070
|
}
|
|
2074
2071
|
const hr = {
|
|
2075
|
-
[
|
|
2072
|
+
[Ii.LAYOUT]: {
|
|
2076
2073
|
[Pt]: {
|
|
2077
2074
|
order: 0,
|
|
2078
|
-
menuItemFactory:
|
|
2079
|
-
[
|
|
2075
|
+
menuItemFactory: mr,
|
|
2076
|
+
[Mt]: {
|
|
2080
2077
|
order: 0,
|
|
2081
|
-
menuItemFactory:
|
|
2078
|
+
menuItemFactory: ur
|
|
2082
2079
|
}
|
|
2083
2080
|
}
|
|
2084
2081
|
}
|
|
2085
2082
|
};
|
|
2086
2083
|
function Ze(i) {
|
|
2087
|
-
return i.getContextValue(
|
|
2084
|
+
return i.getContextValue(Wt) && i.getContextValue(on);
|
|
2088
2085
|
}
|
|
2089
|
-
const
|
|
2086
|
+
const fr = {
|
|
2090
2087
|
id: Ye.id,
|
|
2091
2088
|
description: "shortcut.doc.drawing-move-down",
|
|
2092
2089
|
group: "4_doc-drawing-view",
|
|
@@ -2094,9 +2091,9 @@ const pr = {
|
|
|
2094
2091
|
priority: 100,
|
|
2095
2092
|
preconditions: Ze,
|
|
2096
2093
|
staticParameters: {
|
|
2097
|
-
direction:
|
|
2094
|
+
direction: he.DOWN
|
|
2098
2095
|
}
|
|
2099
|
-
},
|
|
2096
|
+
}, pr = {
|
|
2100
2097
|
id: Ye.id,
|
|
2101
2098
|
description: "shortcut.doc.drawing-move-up",
|
|
2102
2099
|
group: "4_doc-drawing-view",
|
|
@@ -2104,9 +2101,9 @@ const pr = {
|
|
|
2104
2101
|
priority: 100,
|
|
2105
2102
|
preconditions: Ze,
|
|
2106
2103
|
staticParameters: {
|
|
2107
|
-
direction:
|
|
2104
|
+
direction: he.UP
|
|
2108
2105
|
}
|
|
2109
|
-
},
|
|
2106
|
+
}, wr = {
|
|
2110
2107
|
id: Ye.id,
|
|
2111
2108
|
description: "shortcut.doc.drawing-move-left",
|
|
2112
2109
|
group: "4_doc-drawing-view",
|
|
@@ -2114,9 +2111,9 @@ const pr = {
|
|
|
2114
2111
|
priority: 100,
|
|
2115
2112
|
preconditions: Ze,
|
|
2116
2113
|
staticParameters: {
|
|
2117
|
-
direction:
|
|
2114
|
+
direction: he.LEFT
|
|
2118
2115
|
}
|
|
2119
|
-
},
|
|
2116
|
+
}, vr = {
|
|
2120
2117
|
id: Ye.id,
|
|
2121
2118
|
description: "shortcut.doc.drawing-move-right",
|
|
2122
2119
|
group: "4_doc-drawing-view",
|
|
@@ -2124,9 +2121,9 @@ const pr = {
|
|
|
2124
2121
|
priority: 100,
|
|
2125
2122
|
preconditions: Ze,
|
|
2126
2123
|
staticParameters: {
|
|
2127
|
-
direction:
|
|
2124
|
+
direction: he.RIGHT
|
|
2128
2125
|
}
|
|
2129
|
-
},
|
|
2126
|
+
}, Ir = {
|
|
2130
2127
|
id: vt.id,
|
|
2131
2128
|
description: "shortcut.doc.drawing-delete",
|
|
2132
2129
|
group: "4_doc-drawing-view",
|
|
@@ -2135,8 +2132,8 @@ const pr = {
|
|
|
2135
2132
|
binding: He.DELETE,
|
|
2136
2133
|
mac: He.BACKSPACE
|
|
2137
2134
|
};
|
|
2138
|
-
var
|
|
2139
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2135
|
+
var _r = Object.getOwnPropertyDescriptor, Sr = (i, e, n, t) => {
|
|
2136
|
+
for (var r = t > 1 ? void 0 : t ? _r(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2140
2137
|
(s = i[o]) && (r = s(r) || r);
|
|
2141
2138
|
return r;
|
|
2142
2139
|
}, tn = (i, e) => (n, t) => e(n, t, i);
|
|
@@ -2146,7 +2143,7 @@ let dn = class extends Ge {
|
|
|
2146
2143
|
}
|
|
2147
2144
|
_initCustomComponents() {
|
|
2148
2145
|
const i = this._componentManager;
|
|
2149
|
-
this.disposeWithMe(i.register(yt, wt)), this.disposeWithMe(i.register(Ct,
|
|
2146
|
+
this.disposeWithMe(i.register(yt, wt)), this.disposeWithMe(i.register(Ct, lr));
|
|
2150
2147
|
}
|
|
2151
2148
|
_initMenus() {
|
|
2152
2149
|
this._menuManagerService.mergeMenu(hr);
|
|
@@ -2160,10 +2157,10 @@ let dn = class extends Ge {
|
|
|
2160
2157
|
mt,
|
|
2161
2158
|
Ke,
|
|
2162
2159
|
ut,
|
|
2163
|
-
|
|
2160
|
+
ht,
|
|
2164
2161
|
yn,
|
|
2165
2162
|
Ot,
|
|
2166
|
-
|
|
2163
|
+
Qi,
|
|
2167
2164
|
Tt,
|
|
2168
2165
|
It,
|
|
2169
2166
|
St,
|
|
@@ -2175,11 +2172,11 @@ let dn = class extends Ge {
|
|
|
2175
2172
|
_initShortcuts() {
|
|
2176
2173
|
[
|
|
2177
2174
|
// sheet drawing shortcuts
|
|
2175
|
+
fr,
|
|
2178
2176
|
pr,
|
|
2179
2177
|
wr,
|
|
2180
2178
|
vr,
|
|
2181
|
-
Ir
|
|
2182
|
-
_r
|
|
2179
|
+
Ir
|
|
2183
2180
|
].forEach((i) => {
|
|
2184
2181
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2185
2182
|
});
|
|
@@ -2188,17 +2185,17 @@ let dn = class extends Ge {
|
|
|
2188
2185
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2189
2186
|
}
|
|
2190
2187
|
};
|
|
2191
|
-
dn =
|
|
2192
|
-
tn(0, pe(
|
|
2193
|
-
tn(1,
|
|
2188
|
+
dn = Sr([
|
|
2189
|
+
tn(0, pe(_i)),
|
|
2190
|
+
tn(1, Si),
|
|
2194
2191
|
tn(2, $),
|
|
2195
|
-
tn(3,
|
|
2192
|
+
tn(3, Di)
|
|
2196
2193
|
], dn);
|
|
2197
|
-
var
|
|
2198
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2194
|
+
var Dr = Object.getOwnPropertyDescriptor, Cr = (i, e, n, t) => {
|
|
2195
|
+
for (var r = t > 1 ? void 0 : t ? Dr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2199
2196
|
(s = i[o]) && (r = s(r) || r);
|
|
2200
2197
|
return r;
|
|
2201
|
-
},
|
|
2198
|
+
}, Fe = (i, e) => (n, t) => e(n, t, i);
|
|
2202
2199
|
function In(i, e) {
|
|
2203
2200
|
const { top: n, left: t, width: r, height: o, angle: s, opacity: a } = i, d = e.scene, c = d.getViewport(it.VIEW_MAIN), { viewportScrollX: g, viewportScrollY: m } = c, { scaleX: l, scaleY: f } = d.getAncestorScale();
|
|
2204
2201
|
return {
|
|
@@ -2206,8 +2203,8 @@ function In(i, e) {
|
|
|
2206
2203
|
startY: (n - m) * f,
|
|
2207
2204
|
endX: (t + r - g) * l,
|
|
2208
2205
|
endY: (n + o - m) * f,
|
|
2209
|
-
width: r,
|
|
2210
|
-
height: o,
|
|
2206
|
+
width: r * l,
|
|
2207
|
+
height: o * f,
|
|
2211
2208
|
rotate: s,
|
|
2212
2209
|
absolute: {
|
|
2213
2210
|
left: !1,
|
|
@@ -2265,7 +2262,7 @@ let ln = class extends Ge {
|
|
|
2265
2262
|
if (!(a == null || a.length === 0))
|
|
2266
2263
|
for (const d of a) {
|
|
2267
2264
|
this._addHoverForRect(d);
|
|
2268
|
-
const c = new
|
|
2265
|
+
const c = new Ht(), g = In(d, o.renderUnit), m = new ot(g), l = o.canvas, f = s.data, u = {
|
|
2269
2266
|
dispose: c,
|
|
2270
2267
|
rect: d,
|
|
2271
2268
|
position$: m,
|
|
@@ -2342,8 +2339,8 @@ let ln = class extends Ge {
|
|
|
2342
2339
|
const t = n.getUnitId(), r = this._renderManagerService.getRenderById(t);
|
|
2343
2340
|
return r ? { render: r, unitId: t } : null;
|
|
2344
2341
|
}),
|
|
2345
|
-
|
|
2346
|
-
(n) => n ? Qn(n.render.scene.getViewport(it.VIEW_MAIN).onScrollAfter$).pipe(Wn(() => ({ unitId: n.unitId }))) :
|
|
2342
|
+
Ni(
|
|
2343
|
+
(n) => n ? Qn(n.render.scene.getViewport(it.VIEW_MAIN).onScrollAfter$).pipe(Wn(() => ({ unitId: n.unitId }))) : Ai(null)
|
|
2347
2344
|
)
|
|
2348
2345
|
).subscribe((n) => {
|
|
2349
2346
|
if (!n) return;
|
|
@@ -2379,7 +2376,7 @@ let ln = class extends Ge {
|
|
|
2379
2376
|
posOffset: 0
|
|
2380
2377
|
},
|
|
2381
2378
|
angle: 0
|
|
2382
|
-
}, f = (I = n.drawingId) != null ? I :
|
|
2379
|
+
}, f = (I = n.drawingId) != null ? I : Gt(), u = {
|
|
2383
2380
|
unitId: t.getUnitId(),
|
|
2384
2381
|
drawings: [
|
|
2385
2382
|
{
|
|
@@ -2399,20 +2396,20 @@ let ln = class extends Ge {
|
|
|
2399
2396
|
return this._commandService.syncExecuteCommand(Pn.id, u), f;
|
|
2400
2397
|
}
|
|
2401
2398
|
};
|
|
2402
|
-
ln =
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2399
|
+
ln = Cr([
|
|
2400
|
+
Fe(0, J),
|
|
2401
|
+
Fe(1, _e),
|
|
2402
|
+
Fe(2, pe(oi)),
|
|
2403
|
+
Fe(3, pe(Ci)),
|
|
2404
|
+
Fe(4, q),
|
|
2405
|
+
Fe(5, $)
|
|
2409
2406
|
], ln);
|
|
2410
|
-
var
|
|
2411
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2407
|
+
var Or = Object.getOwnPropertyDescriptor, Tr = (i, e, n, t) => {
|
|
2408
|
+
for (var r = t > 1 ? void 0 : t ? Or(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2412
2409
|
(s = i[o]) && (r = s(r) || r);
|
|
2413
2410
|
return r;
|
|
2414
2411
|
}, ze = (i, e) => (n, t) => e(n, t, i);
|
|
2415
|
-
let gn = class extends
|
|
2412
|
+
let gn = class extends Vt {
|
|
2416
2413
|
constructor(e, n, t, r, o) {
|
|
2417
2414
|
super();
|
|
2418
2415
|
Se(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
@@ -2434,7 +2431,7 @@ let gn = class extends jt {
|
|
|
2434
2431
|
_hasCropObject(e) {
|
|
2435
2432
|
const n = e.getAllObjects();
|
|
2436
2433
|
for (const t of n)
|
|
2437
|
-
if (t instanceof
|
|
2434
|
+
if (t instanceof si)
|
|
2438
2435
|
return !0;
|
|
2439
2436
|
return !1;
|
|
2440
2437
|
}
|
|
@@ -2465,7 +2462,7 @@ let gn = class extends jt {
|
|
|
2465
2462
|
const { unitId: g, subUnitId: m, drawingId: l, drawingType: f } = c, u = this._canvasPopManagerService.attachPopupToObject(
|
|
2466
2463
|
a,
|
|
2467
2464
|
{
|
|
2468
|
-
componentKey:
|
|
2465
|
+
componentKey: ai,
|
|
2469
2466
|
direction: "horizontal",
|
|
2470
2467
|
offset: [2, 0],
|
|
2471
2468
|
extraProps: {
|
|
@@ -2508,7 +2505,7 @@ let gn = class extends jt {
|
|
|
2508
2505
|
index: 0,
|
|
2509
2506
|
commandId: Tt.id,
|
|
2510
2507
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2511
|
-
disable:
|
|
2508
|
+
disable: !!jt.includes(e) || r === rn.DRAWING_DOM
|
|
2512
2509
|
},
|
|
2513
2510
|
{
|
|
2514
2511
|
label: "image-popup.delete",
|
|
@@ -2520,7 +2517,7 @@ let gn = class extends jt {
|
|
|
2520
2517
|
{
|
|
2521
2518
|
label: "image-popup.crop",
|
|
2522
2519
|
index: 2,
|
|
2523
|
-
commandId:
|
|
2520
|
+
commandId: ci.id,
|
|
2524
2521
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2525
2522
|
disable: !0
|
|
2526
2523
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2528,7 +2525,7 @@ let gn = class extends jt {
|
|
|
2528
2525
|
{
|
|
2529
2526
|
label: "image-popup.reset",
|
|
2530
2527
|
index: 3,
|
|
2531
|
-
commandId:
|
|
2528
|
+
commandId: di.id,
|
|
2532
2529
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
2533
2530
|
disable: !0
|
|
2534
2531
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2536,15 +2533,15 @@ let gn = class extends jt {
|
|
|
2536
2533
|
];
|
|
2537
2534
|
}
|
|
2538
2535
|
};
|
|
2539
|
-
gn =
|
|
2536
|
+
gn = Tr([
|
|
2540
2537
|
ze(0, _e),
|
|
2541
|
-
ze(1, pe(
|
|
2538
|
+
ze(1, pe(bi)),
|
|
2542
2539
|
ze(2, J),
|
|
2543
2540
|
ze(3, q),
|
|
2544
2541
|
ze(4, Zn)
|
|
2545
2542
|
], gn);
|
|
2546
|
-
var
|
|
2547
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2543
|
+
var yr = Object.getOwnPropertyDescriptor, Pr = (i, e, n, t) => {
|
|
2544
|
+
for (var r = t > 1 ? void 0 : t ? yr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2548
2545
|
(s = i[o]) && (r = s(r) || r);
|
|
2549
2546
|
return r;
|
|
2550
2547
|
}, Le = (i, e) => (n, t) => e(n, t, i);
|
|
@@ -2587,7 +2584,7 @@ let Sn = class extends Ge {
|
|
|
2587
2584
|
_initResize() {
|
|
2588
2585
|
this.disposeWithMe(
|
|
2589
2586
|
Qn(this._context.engine.onTransformChange$).pipe(
|
|
2590
|
-
Gn((e) => e.type ===
|
|
2587
|
+
Gn((e) => e.type === fi.resize),
|
|
2591
2588
|
st(16)
|
|
2592
2589
|
).subscribe(() => {
|
|
2593
2590
|
var t;
|
|
@@ -2603,7 +2600,7 @@ let Sn = class extends Ge {
|
|
|
2603
2600
|
return;
|
|
2604
2601
|
const { left: s, top: a, pageLayoutType: d, pageMarginLeft: c, pageMarginTop: g } = o, { pages: m, skeHeaders: l, skeFooters: f } = n, u = {};
|
|
2605
2602
|
this._liquid.reset();
|
|
2606
|
-
for (let T = 0,
|
|
2603
|
+
for (let T = 0, b = m.length; T < b; T++) {
|
|
2607
2604
|
const P = m[T], { headerId: N, footerId: B, pageWidth: E } = P;
|
|
2608
2605
|
if (N) {
|
|
2609
2606
|
const _ = (O = l.get(N)) == null ? void 0 : O.get(E);
|
|
@@ -2679,35 +2676,33 @@ let Sn = class extends Ge {
|
|
|
2679
2676
|
const n = this._docSkeletonManagerService.getSkeleton();
|
|
2680
2677
|
n != null && (this._refreshDrawing(n), this._drawingManagerService.initializeNotification(this._context.unitId));
|
|
2681
2678
|
};
|
|
2682
|
-
this._lifecycleService.stage
|
|
2683
|
-
e();
|
|
2684
|
-
}, 1e3) : this._lifecycleService.lifecycle$.pipe(Gn((n) => n === En.Steady)).subscribe(e);
|
|
2679
|
+
this._lifecycleService.stage >= En.Rendered ? this._docSkeletonManagerService.getSkeleton() ? e() : setTimeout(e, 500) : this._lifecycleService.lifecycle$.pipe(Gn((n) => n === En.Rendered)).subscribe(e);
|
|
2685
2680
|
}
|
|
2686
2681
|
};
|
|
2687
|
-
Sn =
|
|
2682
|
+
Sn = Pr([
|
|
2688
2683
|
Le(1, pe(te)),
|
|
2689
2684
|
Le(2, $),
|
|
2690
|
-
Le(3,
|
|
2685
|
+
Le(3, Ri),
|
|
2691
2686
|
Le(4, _e),
|
|
2692
|
-
Le(5, pe(
|
|
2687
|
+
Le(5, pe(hn)),
|
|
2693
2688
|
Le(6, q),
|
|
2694
|
-
Le(7, pe(
|
|
2689
|
+
Le(7, pe($t))
|
|
2695
2690
|
], Sn);
|
|
2696
|
-
var Mr = Object.defineProperty,
|
|
2697
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2691
|
+
var Mr = Object.defineProperty, br = Object.getOwnPropertyDescriptor, Rr = (i, e, n) => e in i ? Mr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Er = (i, e, n, t) => {
|
|
2692
|
+
for (var r = t > 1 ? void 0 : t ? br(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2698
2693
|
(s = i[o]) && (r = s(r) || r);
|
|
2699
2694
|
return r;
|
|
2700
|
-
}, _n = (i, e) => (n, t) => e(n, t, i),
|
|
2701
|
-
const
|
|
2702
|
-
let mn = class extends
|
|
2695
|
+
}, _n = (i, e) => (n, t) => e(n, t, i), bt = (i, e, n) => Rr(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2696
|
+
const Nr = "DOC_DRAWING_UI_PLUGIN";
|
|
2697
|
+
let mn = class extends Kt {
|
|
2703
2698
|
constructor(i = zn, e, n, t) {
|
|
2704
2699
|
super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
|
|
2705
|
-
const { ...r } =
|
|
2700
|
+
const { ...r } = Yt(
|
|
2706
2701
|
{},
|
|
2707
2702
|
zn,
|
|
2708
2703
|
this._config
|
|
2709
2704
|
);
|
|
2710
|
-
this._configService.setConfig(
|
|
2705
|
+
this._configService.setConfig(Ui, r);
|
|
2711
2706
|
}
|
|
2712
2707
|
onStarting() {
|
|
2713
2708
|
[
|
|
@@ -2715,7 +2710,7 @@ let mn = class extends Yt {
|
|
|
2715
2710
|
[gn],
|
|
2716
2711
|
[an],
|
|
2717
2712
|
[sn],
|
|
2718
|
-
[
|
|
2713
|
+
[hn],
|
|
2719
2714
|
[ln]
|
|
2720
2715
|
].forEach((e) => this._injector.add(e));
|
|
2721
2716
|
}
|
|
@@ -2729,16 +2724,16 @@ let mn = class extends Yt {
|
|
|
2729
2724
|
this._injector.get(gn), this._injector.get(ln);
|
|
2730
2725
|
}
|
|
2731
2726
|
};
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
mn =
|
|
2735
|
-
|
|
2736
|
-
_n(1, pe(
|
|
2727
|
+
bt(mn, "type", Ie.UNIVER_DOC);
|
|
2728
|
+
bt(mn, "pluginName", Nr);
|
|
2729
|
+
mn = Er([
|
|
2730
|
+
zt(li, ii, Zt, Oi),
|
|
2731
|
+
_n(1, pe(Xt)),
|
|
2737
2732
|
_n(2, J),
|
|
2738
|
-
_n(3,
|
|
2733
|
+
_n(3, qt)
|
|
2739
2734
|
], mn);
|
|
2740
2735
|
export {
|
|
2741
|
-
|
|
2736
|
+
Qi as ClearDocDrawingTransformerOperation,
|
|
2742
2737
|
Pt as DOCS_IMAGE_MENU_ID,
|
|
2743
2738
|
vt as DeleteDocDrawingsCommand,
|
|
2744
2739
|
ln as DocFloatDomController,
|