@univerjs/docs-drawing-ui 0.5.1 → 0.5.2-nightly.202412291605
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 +2 -2
- package/lib/es/index.js +247 -243
- package/lib/index.css +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +14 -14
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Se = (i, e, n) =>
|
|
4
|
-
import { Disposable as Xe, UndoCommand as
|
|
5
|
-
import { IDocDrawingService as je, UniverDocsDrawingPlugin as
|
|
6
|
-
import { IDrawingManagerService as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as
|
|
7
|
-
import { DrawingCommonPanel as
|
|
8
|
-
import { IRenderManagerService as Q, DocumentEditArea as Ue, Liquid as
|
|
9
|
-
import { IMessageService as
|
|
1
|
+
var Pt = Object.defineProperty;
|
|
2
|
+
var Tt = (i, e, n) => e in i ? Pt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var Se = (i, e, n) => Tt(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Disposable as Xe, UndoCommand as yt, RedoCommand as bt, IUniverInstanceService as J, ICommandService as z, JSONX as q, PositionedObjectLayoutType as k, CommandType as X, BooleanNumber as re, ObjectRelativeFromH as ee, ObjectRelativeFromV as G, Tools as Pe, TextX as In, TextXActionType as Y, toDisposable as Ae, throttle as xn, COLORS as Mt, MemoryCursor as Rt, IUndoRedoService as $n, BuildTextUtils as Nt, ArrangeTypeEnum as Je, Inject as we, LocaleService as ln, DrawingTypeEnum as Et, WrapTextType as $e, FOCUSING_COMMON_DRAWINGS as tn, IContextService as zn, UniverInstanceType as Te, Direction as ue, useDependency as pe, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as At, RxDisposable as jt, SHEET_EDITOR_UNITS as Lt, LifecycleService as Bt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ut, fromEventSubject as Ft, LifecycleStages as Pn, DependentOn as kt, Injector as Ht, Plugin as Wt, merge as Gt, IConfigService as Vt } from "@univerjs/core";
|
|
5
|
+
import { IDocDrawingService as je, UniverDocsDrawingPlugin as $t } from "@univerjs/docs-drawing";
|
|
6
|
+
import { IDrawingManagerService as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as zt, DRAWING_IMAGE_COUNT_LIMIT as Tn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as qt, getImageSize as Xt, getDrawingShapeKeyByDrawingSearch as Kt, IImageIoService as Yt, DRAWING_IMAGE_WIDTH_LIMIT as yn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, UniverDrawingPlugin as Jt } from "@univerjs/drawing";
|
|
7
|
+
import { DrawingCommonPanel as Zt, ImageCropperObject as Qt, COMPONENT_IMAGE_POPUP_MENU as ei, OpenImageCropOperation as ni, ImageResetSizeOperation as ti, UniverDrawingUIPlugin as ii } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as Q, DocumentEditArea as Ue, Liquid as qn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as ri, Rect as oi, getColor as si, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ai } from "@univerjs/engine-render";
|
|
9
|
+
import { IMessageService as ci, ILocalFileService as di, ISidebarService as li, MenuItemType as Xn, getMenuHiddenObservable as Kn, RibbonStartGroup as gi, KeyCode as Fe, ComponentManager as mi, IMenuManagerService as ui, IShortcutService as fi, UniverUIPlugin as hi } from "@univerjs/ui";
|
|
10
10
|
import { RichTextEditingMutation as Z, DocSkeletonManagerService as oe, DocSelectionManagerService as _n } from "@univerjs/docs";
|
|
11
|
-
import { DocSelectionRenderService as ye, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as En, getAnchorBounding as
|
|
12
|
-
import { BehaviorSubject as
|
|
13
|
-
import { MessageType as Ln, InputNumber as Be, Select as Bn, Checkbox as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
var
|
|
17
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
11
|
+
import { DocSelectionRenderService as ye, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as En, getAnchorBounding as pi, TEXT_RANGE_LAYER_INDEX as wi, getDocObject as vi, getCustomBlockIdsInSelections as Ii, docDrawingPositionToTransform as _i, DocCanvasPopManagerService as Si, IEditorService as Ci, SetDocZoomRatioOperation as Di } from "@univerjs/docs-ui";
|
|
12
|
+
import { BehaviorSubject as Oi, debounceTime as Yn, Observable as xi, takeUntil as An, filter as jn } from "rxjs";
|
|
13
|
+
import { MessageType as Ln, InputNumber as Be, Select as Bn, Checkbox as Pi, RadioGroup as Un, Radio as xe } from "@univerjs/design";
|
|
14
|
+
import Ti, { forwardRef as Jn, useRef as yi, createElement as Zn, useState as ie, useEffect as Sn } from "react";
|
|
15
|
+
const bi = "docs-drawing-ui.config", Fn = {};
|
|
16
|
+
var Mi = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
|
|
17
|
+
for (var r = t > 1 ? void 0 : t ? Ri(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
18
18
|
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
19
|
-
return t && r &&
|
|
19
|
+
return t && r && Mi(e, n, r), r;
|
|
20
20
|
}, We = (i, e) => (n, t) => e(n, t, i);
|
|
21
|
-
function
|
|
21
|
+
function Ei(i) {
|
|
22
22
|
var t, r, o, s;
|
|
23
23
|
if (q.isNoop(i) || !Array.isArray(i))
|
|
24
24
|
return null;
|
|
@@ -41,7 +41,7 @@ function Ni(i) {
|
|
|
41
41
|
});
|
|
42
42
|
return n;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ai(i) {
|
|
45
45
|
if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
|
|
46
46
|
return [];
|
|
47
47
|
const e = [];
|
|
@@ -68,7 +68,7 @@ let rn = class extends Xe {
|
|
|
68
68
|
this._commandService.beforeCommandExecuted((i) => {
|
|
69
69
|
if (i.id !== Z.id)
|
|
70
70
|
return;
|
|
71
|
-
const e = i.params, { unitId: n, actions: t } = e, r =
|
|
71
|
+
const e = i.params, { unitId: n, actions: t } = e, r = Ei(t);
|
|
72
72
|
if (r != null)
|
|
73
73
|
for (const { type: o, drawingId: s, drawing: a } of r)
|
|
74
74
|
o === "add" ? this._addDrawings(n, [a]) : this._removeDrawings(n, [s]);
|
|
@@ -78,12 +78,12 @@ let rn = class extends Xe {
|
|
|
78
78
|
if (i.id !== Z.id)
|
|
79
79
|
return;
|
|
80
80
|
const e = i.params, { unitId: n, actions: t } = e;
|
|
81
|
-
|
|
81
|
+
Ai(t).length > 0 && this._updateDrawingsOrder(n);
|
|
82
82
|
})
|
|
83
83
|
), this.disposeWithMe(
|
|
84
84
|
this._commandService.onCommandExecuted((i) => {
|
|
85
85
|
var s;
|
|
86
|
-
if (i.id !==
|
|
86
|
+
if (i.id !== yt.id && i.id !== bt.id)
|
|
87
87
|
return;
|
|
88
88
|
const e = (s = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : s.getUnitId(), n = this._drawingManagerService.getFocusDrawings();
|
|
89
89
|
if (e == null || n.length === 0)
|
|
@@ -124,7 +124,7 @@ let rn = class extends Xe {
|
|
|
124
124
|
t.orderNotification(o), r.orderNotification(o);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
-
rn =
|
|
127
|
+
rn = Ni([
|
|
128
128
|
We(0, J),
|
|
129
129
|
We(1, z),
|
|
130
130
|
We(2, ve),
|
|
@@ -133,7 +133,7 @@ rn = Ri([
|
|
|
133
133
|
], rn);
|
|
134
134
|
class gn {
|
|
135
135
|
constructor() {
|
|
136
|
-
Se(this, "_refreshDrawings$", new
|
|
136
|
+
Se(this, "_refreshDrawings$", new Oi(null));
|
|
137
137
|
Se(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
|
|
138
138
|
}
|
|
139
139
|
refreshDrawings(e) {
|
|
@@ -141,14 +141,14 @@ class gn {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
var me = /* @__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))(me || {});
|
|
144
|
-
const
|
|
144
|
+
const ji = {
|
|
145
145
|
inline: k.INLINE,
|
|
146
146
|
wrapSquare: k.WRAP_SQUARE,
|
|
147
147
|
wrapTopAndBottom: k.WRAP_TOP_AND_BOTTOM,
|
|
148
148
|
inFrontOfText: k.WRAP_NONE,
|
|
149
149
|
behindText: k.WRAP_NONE
|
|
150
150
|
};
|
|
151
|
-
function
|
|
151
|
+
function Qn(i, e, n, t, r, o, s) {
|
|
152
152
|
var p, h;
|
|
153
153
|
const a = new In(), d = q.getInstance(), c = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), u = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
154
154
|
if (l == null || u == null)
|
|
@@ -225,7 +225,7 @@ function Zn(i, e, n, t, r, o, s) {
|
|
|
225
225
|
return c;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
const
|
|
228
|
+
const et = {
|
|
229
229
|
id: "doc.command.update-doc-drawing-wrapping-style",
|
|
230
230
|
type: X.COMMAND,
|
|
231
231
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
@@ -238,7 +238,7 @@ const Qn = {
|
|
|
238
238
|
return !1;
|
|
239
239
|
const p = l.getEditArea(), h = u.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = c, O = q.getInstance(), D = [], { drawings: x = {} } = m.getSnapshot();
|
|
240
240
|
for (const R of n) {
|
|
241
|
-
const { drawingId: I } = R, j = x[I].layoutType, H =
|
|
241
|
+
const { drawingId: I } = R, j = x[I].layoutType, H = ji[t];
|
|
242
242
|
if (j !== H) {
|
|
243
243
|
const C = O.replaceOp(["drawings", I, "layoutType"], j, H);
|
|
244
244
|
D.push(C);
|
|
@@ -311,7 +311,7 @@ const Qn = {
|
|
|
311
311
|
const T = o.syncExecuteCommand(b.id, b.params);
|
|
312
312
|
return h.refreshControls(), !!T;
|
|
313
313
|
}
|
|
314
|
-
},
|
|
314
|
+
}, nt = {
|
|
315
315
|
id: "doc.command.update-doc-drawing-distance",
|
|
316
316
|
type: X.COMMAND,
|
|
317
317
|
handler: (i, e) => {
|
|
@@ -341,7 +341,7 @@ const Qn = {
|
|
|
341
341
|
};
|
|
342
342
|
return u.params.actions = c.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(u.id, u.params);
|
|
343
343
|
}
|
|
344
|
-
},
|
|
344
|
+
}, tt = {
|
|
345
345
|
id: "doc.command.update-doc-drawing-wrap-text",
|
|
346
346
|
type: X.COMMAND,
|
|
347
347
|
handler: (i, e) => {
|
|
@@ -401,7 +401,7 @@ const Qn = {
|
|
|
401
401
|
const v = n.syncExecuteCommand(h.id, h.params);
|
|
402
402
|
return a.refreshControls(), !!v;
|
|
403
403
|
}
|
|
404
|
-
},
|
|
404
|
+
}, it = {
|
|
405
405
|
id: "doc.command.move-inline-drawing",
|
|
406
406
|
type: X.COMMAND,
|
|
407
407
|
handler: (i, e) => {
|
|
@@ -417,7 +417,7 @@ const Qn = {
|
|
|
417
417
|
const { drawing: m, unitId: p, offset: h, segmentId: v, segmentPage: w, needRefreshDrawings: S } = e;
|
|
418
418
|
if (S)
|
|
419
419
|
return r.refreshDrawings(a), d.refreshControls(), !0;
|
|
420
|
-
const O = [], { drawingId: D } = m, x = (R = t.getSegment()) != null ? R : "", b =
|
|
420
|
+
const O = [], { drawingId: D } = m, x = (R = t.getSegment()) != null ? R : "", b = Qn(
|
|
421
421
|
v,
|
|
422
422
|
x,
|
|
423
423
|
w,
|
|
@@ -441,7 +441,7 @@ const Qn = {
|
|
|
441
441
|
const N = c.syncExecuteCommand(T.id, T.params);
|
|
442
442
|
return d.refreshControls(), !!N;
|
|
443
443
|
}
|
|
444
|
-
},
|
|
444
|
+
}, rt = {
|
|
445
445
|
id: "doc.command.transform-non-inline-drawing",
|
|
446
446
|
type: X.COMMAND,
|
|
447
447
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -455,7 +455,7 @@ const Qn = {
|
|
|
455
455
|
const s = o.getTransformerByCreate(), a = i.get(z), c = i.get(J).getCurrentUniverDocInstance();
|
|
456
456
|
if (c == null)
|
|
457
457
|
return !1;
|
|
458
|
-
const { drawing: l, unitId: u, offset: m, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (W = t.getSegment()) != null ? W : "", D =
|
|
458
|
+
const { drawing: l, unitId: u, offset: m, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (W = t.getSegment()) != null ? W : "", D = Qn(
|
|
459
459
|
h,
|
|
460
460
|
O,
|
|
461
461
|
v,
|
|
@@ -498,20 +498,20 @@ const Qn = {
|
|
|
498
498
|
return s.refreshControls(), !!H;
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
|
-
var
|
|
502
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
501
|
+
var Li = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Ui = (i, e, n, t) => {
|
|
502
|
+
for (var r = t > 1 ? void 0 : t ? Bi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
503
503
|
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
504
|
-
return t && r &&
|
|
504
|
+
return t && r && Li(e, n, r), r;
|
|
505
505
|
}, Ze = (i, e) => (n, t) => e(n, t, i);
|
|
506
|
-
const
|
|
507
|
-
function
|
|
506
|
+
const Fi = "__InlineDrawingAnchor__";
|
|
507
|
+
function kn(i) {
|
|
508
508
|
const { path: e } = i;
|
|
509
509
|
return e.some((n) => n === "cells");
|
|
510
510
|
}
|
|
511
511
|
let on = class extends Xe {
|
|
512
512
|
constructor(e, n, t, r) {
|
|
513
513
|
super();
|
|
514
|
-
Se(this, "_liquid", new
|
|
514
|
+
Se(this, "_liquid", new qn());
|
|
515
515
|
Se(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
|
|
516
516
|
// Use to cache the drawings is under transforming or scaling.
|
|
517
517
|
Se(this, "_transformerCache", /* @__PURE__ */ new Map());
|
|
@@ -704,7 +704,7 @@ let on = class extends Xe {
|
|
|
704
704
|
if (p == null)
|
|
705
705
|
return;
|
|
706
706
|
const b = o == null ? void 0 : o.findPositionByGlyph(p, v), T = this._getDocObject();
|
|
707
|
-
if (b == null || o == null || T == null ||
|
|
707
|
+
if (b == null || o == null || T == null || kn(b))
|
|
708
708
|
return;
|
|
709
709
|
const N = {
|
|
710
710
|
...b,
|
|
@@ -754,8 +754,8 @@ let on = class extends Xe {
|
|
|
754
754
|
this._liquid.reset();
|
|
755
755
|
const K = F.type;
|
|
756
756
|
for (const he of s) {
|
|
757
|
-
const { headerId: mn, footerId: un, pageHeight:
|
|
758
|
-
if (A > -1 &&
|
|
757
|
+
const { headerId: mn, footerId: un, pageHeight: Dt, pageWidth: Dn, marginLeft: On, marginBottom: Ot } = he, xt = s.indexOf(he);
|
|
758
|
+
if (A > -1 && xt === A) {
|
|
759
759
|
switch (K) {
|
|
760
760
|
case Rn.HEADER: {
|
|
761
761
|
const He = (De = a.get(mn)) == null ? void 0 : De.get(Dn);
|
|
@@ -772,7 +772,7 @@ let on = class extends Xe {
|
|
|
772
772
|
const He = (Me = d.get(un)) == null ? void 0 : Me.get(Dn);
|
|
773
773
|
if (He)
|
|
774
774
|
this._liquid.translatePagePadding({
|
|
775
|
-
marginTop:
|
|
775
|
+
marginTop: Dt - Ot + He.marginTop,
|
|
776
776
|
marginLeft: On
|
|
777
777
|
});
|
|
778
778
|
else
|
|
@@ -819,7 +819,7 @@ let on = class extends Xe {
|
|
|
819
819
|
if (j == null)
|
|
820
820
|
return;
|
|
821
821
|
const se = r == null ? void 0 : r.findPositionByGlyph(j, A), Le = this._getDocObject();
|
|
822
|
-
if (se == null || r == null || Le == null ||
|
|
822
|
+
if (se == null || r == null || Le == null || kn(se))
|
|
823
823
|
return;
|
|
824
824
|
const be = {
|
|
825
825
|
...se,
|
|
@@ -853,7 +853,7 @@ let on = class extends Xe {
|
|
|
853
853
|
// Update inline drawing when use transformer to move it.
|
|
854
854
|
_moveInlineDrawing(e, n, t) {
|
|
855
855
|
const r = this._getInlineDrawingAnchor(e, n, t), { offset: o, segmentId: s, segmentPage: a } = r != null ? r : {};
|
|
856
|
-
return this._commandService.executeCommand(
|
|
856
|
+
return this._commandService.executeCommand(it.id, {
|
|
857
857
|
unitId: e.unitId,
|
|
858
858
|
subUnitId: e.unitId,
|
|
859
859
|
drawing: e,
|
|
@@ -906,7 +906,7 @@ let on = class extends Xe {
|
|
|
906
906
|
if (t && r.top !== n.top)
|
|
907
907
|
return;
|
|
908
908
|
const o = this._getDrawingAnchor(e, r), { offset: s, docTransform: a, segmentId: d, segmentPage: c } = o != null ? o : {};
|
|
909
|
-
return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(
|
|
909
|
+
return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(rt.id, {
|
|
910
910
|
unitId: e.unitId,
|
|
911
911
|
subUnitId: e.unitId,
|
|
912
912
|
drawing: e,
|
|
@@ -926,7 +926,7 @@ let on = class extends Xe {
|
|
|
926
926
|
return { scene: t, transformer: r };
|
|
927
927
|
}
|
|
928
928
|
_getTransformCoordForDocumentOffset(e, n, t, r) {
|
|
929
|
-
const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(
|
|
929
|
+
const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(ri.FromArray([t, r]));
|
|
930
930
|
if (s)
|
|
931
931
|
return o.clone().invert().applyPoint(s);
|
|
932
932
|
}
|
|
@@ -937,23 +937,23 @@ let on = class extends Xe {
|
|
|
937
937
|
const { mainComponent: r, scene: o } = t, s = r, {
|
|
938
938
|
docsLeft: a,
|
|
939
939
|
docsTop: d
|
|
940
|
-
} = s.getOffsetConfig(), c =
|
|
940
|
+
} = s.getOffsetConfig(), c = pi(n), { left: l, top: u, height: m } = c, p = l + a, h = u + d;
|
|
941
941
|
if (this._anchorShape) {
|
|
942
942
|
this._anchorShape.transformByState({ left: p, top: h, height: m }), this._anchorShape.show();
|
|
943
943
|
return;
|
|
944
944
|
}
|
|
945
|
-
const v = 6, w = new
|
|
945
|
+
const v = 6, w = new oi(Fi + Pe.generateRandomId(v), {
|
|
946
946
|
left: p,
|
|
947
947
|
top: h,
|
|
948
948
|
height: m,
|
|
949
949
|
strokeWidth: 2,
|
|
950
|
-
stroke:
|
|
950
|
+
stroke: si(Mt.darkGray, 1),
|
|
951
951
|
evented: !1
|
|
952
952
|
});
|
|
953
|
-
this._anchorShape = w, o.addObject(w,
|
|
953
|
+
this._anchorShape = w, o.addObject(w, wi);
|
|
954
954
|
}
|
|
955
955
|
_getDocObject() {
|
|
956
|
-
return
|
|
956
|
+
return vi(this._univerInstanceService, this._renderManagerService);
|
|
957
957
|
}
|
|
958
958
|
_getPageContentSize(e) {
|
|
959
959
|
const n = this._renderManagerService.getRenderById(e.unitId), t = n == null ? void 0 : n.with(oe).getSkeleton(), r = 500, o = 500, s = t == null ? void 0 : t.getSkeletonData();
|
|
@@ -984,7 +984,7 @@ let on = class extends Xe {
|
|
|
984
984
|
};
|
|
985
985
|
}
|
|
986
986
|
};
|
|
987
|
-
on =
|
|
987
|
+
on = Ui([
|
|
988
988
|
Ze(0, z),
|
|
989
989
|
Ze(1, J),
|
|
990
990
|
Ze(2, ve),
|
|
@@ -998,23 +998,23 @@ var fe = function() {
|
|
|
998
998
|
}
|
|
999
999
|
return i;
|
|
1000
1000
|
}, fe.apply(this, arguments);
|
|
1001
|
-
},
|
|
1001
|
+
}, ki = function(i, e) {
|
|
1002
1002
|
var n = {};
|
|
1003
1003
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
1004
1004
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1005
1005
|
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
1006
1006
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
1007
1007
|
return n;
|
|
1008
|
-
},
|
|
1009
|
-
var n = i.icon, t = i.id, r = i.className, o = i.extend, s =
|
|
1010
|
-
return
|
|
1008
|
+
}, ot = Jn(function(i, e) {
|
|
1009
|
+
var n = i.icon, t = i.id, r = i.className, o = i.extend, s = ki(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = yi("_".concat(Gi()));
|
|
1010
|
+
return st(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, fe({ ref: e, className: a }, s), o);
|
|
1011
1011
|
});
|
|
1012
|
-
function
|
|
1013
|
-
return
|
|
1014
|
-
return
|
|
1012
|
+
function st(i, e, n, t, r) {
|
|
1013
|
+
return Zn(i.tag, fe(fe({ key: e }, Hi(i, n, r)), t), (Wi(i, n).children || []).map(function(o, s) {
|
|
1014
|
+
return st(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
|
|
1015
1015
|
}));
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1017
|
+
function Hi(i, e, n) {
|
|
1018
1018
|
var t = fe({}, i.attrs);
|
|
1019
1019
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
1020
1020
|
var r = e.defIds;
|
|
@@ -1023,24 +1023,24 @@ function ki(i, e, n) {
|
|
|
1023
1023
|
typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1024
1024
|
})), t;
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function Wi(i, e) {
|
|
1027
1027
|
var n, t = e.defIds;
|
|
1028
1028
|
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) {
|
|
1029
1029
|
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;
|
|
1030
1030
|
}) }) : i;
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Gi() {
|
|
1033
1033
|
return Math.random().toString(36).substring(2, 8);
|
|
1034
1034
|
}
|
|
1035
|
-
|
|
1036
|
-
var
|
|
1037
|
-
return
|
|
1035
|
+
ot.displayName = "UniverIcon";
|
|
1036
|
+
var Vi = { 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" } }] }, at = Jn(function(i, e) {
|
|
1037
|
+
return Zn(ot, Object.assign({}, i, {
|
|
1038
1038
|
id: "add-image-single",
|
|
1039
1039
|
ref: e,
|
|
1040
|
-
icon:
|
|
1040
|
+
icon: Vi
|
|
1041
1041
|
}));
|
|
1042
1042
|
});
|
|
1043
|
-
|
|
1043
|
+
at.displayName = "AddImageSingle";
|
|
1044
1044
|
const Cn = {
|
|
1045
1045
|
id: "doc.command.remove-doc-image",
|
|
1046
1046
|
type: X.COMMAND,
|
|
@@ -1050,7 +1050,7 @@ const Cn = {
|
|
|
1050
1050
|
const n = i.get(z), t = i.get(J), r = i.get(Q), o = t.getCurrentUniverDocInstance();
|
|
1051
1051
|
if (e == null || o == null)
|
|
1052
1052
|
return !1;
|
|
1053
|
-
const s = r.getRenderById(e.unitId).with(ye), { drawings: a } = e, d = (b = s.getSegment()) != null ? b : "", c = new In(), l = q.getInstance(), u = (N = (T = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : T.customBlocks) != null ? N : [], m = a.map((R) => u.find((I) => I.blockId === R.drawingId)).filter((R) => !!R).sort((R, I) => R.startIndex > I.startIndex ? 1 : -1), p = a[0].unitId, h = new
|
|
1053
|
+
const s = r.getRenderById(e.unitId).with(ye), { drawings: a } = e, d = (b = s.getSegment()) != null ? b : "", c = new In(), l = q.getInstance(), u = (N = (T = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : T.customBlocks) != null ? N : [], m = a.map((R) => u.find((I) => I.blockId === R.drawingId)).filter((R) => !!R).sort((R, I) => R.startIndex > I.startIndex ? 1 : -1), p = a[0].unitId, h = new Rt();
|
|
1054
1054
|
h.reset();
|
|
1055
1055
|
const v = m[0].startIndex, w = [
|
|
1056
1056
|
{
|
|
@@ -1083,7 +1083,7 @@ const Cn = {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
return S.params.actions = O.reduce((R, I) => q.compose(R, I), null), !!n.syncExecuteCommand(S.id, S.params);
|
|
1085
1085
|
}
|
|
1086
|
-
},
|
|
1086
|
+
}, ct = {
|
|
1087
1087
|
id: "doc.command.delete-drawing",
|
|
1088
1088
|
type: X.COMMAND,
|
|
1089
1089
|
handler: (i) => {
|
|
@@ -1104,11 +1104,11 @@ const Cn = {
|
|
|
1104
1104
|
drawings: o
|
|
1105
1105
|
});
|
|
1106
1106
|
}
|
|
1107
|
-
},
|
|
1107
|
+
}, dt = {
|
|
1108
1108
|
id: "doc.command.group-doc-image",
|
|
1109
1109
|
type: X.COMMAND,
|
|
1110
1110
|
handler: (i, e) => {
|
|
1111
|
-
i.get(z), i.get(
|
|
1111
|
+
i.get(z), i.get($n);
|
|
1112
1112
|
const n = i.get(je);
|
|
1113
1113
|
if (!e) return !1;
|
|
1114
1114
|
const t = [];
|
|
@@ -1118,7 +1118,7 @@ const Cn = {
|
|
|
1118
1118
|
});
|
|
1119
1119
|
}), n.getGroupDrawingOp(e), !1;
|
|
1120
1120
|
}
|
|
1121
|
-
},
|
|
1121
|
+
}, lt = {
|
|
1122
1122
|
id: "doc.command.insert-doc-image",
|
|
1123
1123
|
type: X.COMMAND,
|
|
1124
1124
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1140,9 +1140,9 @@ const Cn = {
|
|
|
1140
1140
|
len: l
|
|
1141
1141
|
});
|
|
1142
1142
|
else {
|
|
1143
|
-
const I =
|
|
1143
|
+
const I = Nt.selection.delete([o], m, 0, null, !1);
|
|
1144
1144
|
p.push(...I);
|
|
1145
|
-
const j =
|
|
1145
|
+
const j = Ii(m, [o]), H = (B = s.getDrawings()) != null ? B : {}, A = (R = s.getDrawingsOrder()) != null ? R : [], W = j.sort((_, C) => A.indexOf(_) > A.indexOf(C) ? -1 : A.indexOf(_) < A.indexOf(C) ? 1 : 0);
|
|
1146
1146
|
if (W.length > 0)
|
|
1147
1147
|
for (const _ of W) {
|
|
1148
1148
|
const C = H[_], M = A.indexOf(_);
|
|
@@ -1179,7 +1179,7 @@ const Cn = {
|
|
|
1179
1179
|
};
|
|
1180
1180
|
return x.params.actions = v.reduce((I, j) => q.compose(I, j), null), !!n.syncExecuteCommand(x.id, x.params);
|
|
1181
1181
|
}
|
|
1182
|
-
},
|
|
1182
|
+
}, gt = {
|
|
1183
1183
|
id: "doc.command.set-drawing-arrange",
|
|
1184
1184
|
type: X.COMMAND,
|
|
1185
1185
|
handler: (i, e) => {
|
|
@@ -1206,11 +1206,11 @@ const Cn = {
|
|
|
1206
1206
|
};
|
|
1207
1207
|
return p.params.actions = u.reduce((v, w) => q.compose(v, w), null), !!n.syncExecuteCommand(p.id, p.params);
|
|
1208
1208
|
}
|
|
1209
|
-
},
|
|
1209
|
+
}, mt = {
|
|
1210
1210
|
id: "doc.command.ungroup-doc-image",
|
|
1211
1211
|
type: X.COMMAND,
|
|
1212
1212
|
handler: (i, e) => {
|
|
1213
|
-
i.get(z), i.get(
|
|
1213
|
+
i.get(z), i.get($n);
|
|
1214
1214
|
const n = i.get(je);
|
|
1215
1215
|
if (!e) return !1;
|
|
1216
1216
|
const t = [];
|
|
@@ -1221,10 +1221,10 @@ const Cn = {
|
|
|
1221
1221
|
}), n.getUngroupDrawingOp(e), !1;
|
|
1222
1222
|
}
|
|
1223
1223
|
};
|
|
1224
|
-
var
|
|
1225
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1224
|
+
var $i = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, qi = (i, e, n, t) => {
|
|
1225
|
+
for (var r = t > 1 ? void 0 : t ? zi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1226
1226
|
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
1227
|
-
return t && r &&
|
|
1227
|
+
return t && r && $i(e, n, r), r;
|
|
1228
1228
|
}, ge = (i, e) => (n, t) => e(n, t, i);
|
|
1229
1229
|
let sn = class extends Xe {
|
|
1230
1230
|
constructor(i, e, n, t, r, o, s, a, d, c, l, u, m) {
|
|
@@ -1233,7 +1233,7 @@ let sn = class extends Xe {
|
|
|
1233
1233
|
async insertDocImage() {
|
|
1234
1234
|
const i = await this._fileOpenerService.openFile({
|
|
1235
1235
|
multiple: !0,
|
|
1236
|
-
accept:
|
|
1236
|
+
accept: zt.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
1237
1237
|
}), e = i.length;
|
|
1238
1238
|
return e > Tn ? (this._messageService.show({
|
|
1239
1239
|
type: Ln.Error,
|
|
@@ -1250,7 +1250,7 @@ let sn = class extends Xe {
|
|
|
1250
1250
|
let s = "";
|
|
1251
1251
|
switch (o) {
|
|
1252
1252
|
case hn.ERROR_EXCEED_SIZE:
|
|
1253
|
-
s = this._localeService.t("update-status.exceedMaxSize", String(
|
|
1253
|
+
s = this._localeService.t("update-status.exceedMaxSize", String(qt / (1024 * 1024)));
|
|
1254
1254
|
break;
|
|
1255
1255
|
case hn.ERROR_IMAGE_TYPE:
|
|
1256
1256
|
s = this._localeService.t("update-status.invalidImageType");
|
|
@@ -1270,7 +1270,7 @@ let sn = class extends Xe {
|
|
|
1270
1270
|
for (const r of e) {
|
|
1271
1271
|
if (r == null)
|
|
1272
1272
|
continue;
|
|
1273
|
-
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: u } = await
|
|
1273
|
+
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: u } = await Xt(d || "");
|
|
1274
1274
|
this._imageIoService.addImageSourceCache(o, s, u);
|
|
1275
1275
|
let m = 1;
|
|
1276
1276
|
if (c > yn || l > bn) {
|
|
@@ -1284,10 +1284,10 @@ let sn = class extends Xe {
|
|
|
1284
1284
|
unitId: n,
|
|
1285
1285
|
subUnitId: n,
|
|
1286
1286
|
drawingId: o,
|
|
1287
|
-
drawingType:
|
|
1287
|
+
drawingType: Et.DRAWING_IMAGE,
|
|
1288
1288
|
imageSourceType: s,
|
|
1289
1289
|
source: a,
|
|
1290
|
-
transform:
|
|
1290
|
+
transform: _i(p),
|
|
1291
1291
|
docTransform: p,
|
|
1292
1292
|
behindDoc: re.FALSE,
|
|
1293
1293
|
title: "",
|
|
@@ -1302,7 +1302,7 @@ let sn = class extends Xe {
|
|
|
1302
1302
|
};
|
|
1303
1303
|
this._isInsertInHeaderFooter() && (h.isMultiTransform = re.TRUE, h.transforms = h.transform ? [h.transform] : null), t.push(h);
|
|
1304
1304
|
}
|
|
1305
|
-
this._commandService.executeCommand(
|
|
1305
|
+
this._commandService.executeCommand(lt.id, {
|
|
1306
1306
|
unitId: n,
|
|
1307
1307
|
drawings: t
|
|
1308
1308
|
});
|
|
@@ -1336,7 +1336,7 @@ let sn = class extends Xe {
|
|
|
1336
1336
|
_updateOrderListener() {
|
|
1337
1337
|
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
|
|
1338
1338
|
const { unitId: e, subUnitId: n, drawingIds: t, arrangeType: r } = i;
|
|
1339
|
-
this._commandService.executeCommand(
|
|
1339
|
+
this._commandService.executeCommand(gt.id, {
|
|
1340
1340
|
unitId: e,
|
|
1341
1341
|
subUnitId: n,
|
|
1342
1342
|
drawingIds: t,
|
|
@@ -1346,9 +1346,9 @@ let sn = class extends Xe {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
_groupDrawingListener() {
|
|
1348
1348
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
|
|
1349
|
-
this._commandService.executeCommand(
|
|
1349
|
+
this._commandService.executeCommand(dt.id, i);
|
|
1350
1350
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
|
|
1351
|
-
this._commandService.executeCommand(
|
|
1351
|
+
this._commandService.executeCommand(mt.id, i);
|
|
1352
1352
|
});
|
|
1353
1353
|
}
|
|
1354
1354
|
_getCurrentSceneAndTransformer() {
|
|
@@ -1361,7 +1361,7 @@ let sn = class extends Xe {
|
|
|
1361
1361
|
_transformDrawingListener() {
|
|
1362
1362
|
const i = this._getCurrentSceneAndTransformer();
|
|
1363
1363
|
if (i && i.transformer)
|
|
1364
|
-
this.disposeWithMe(i.transformer.changeEnd$.pipe(
|
|
1364
|
+
this.disposeWithMe(i.transformer.changeEnd$.pipe(Yn(30)).subscribe((e) => {
|
|
1365
1365
|
this._docSelectionManagerService.refreshSelection();
|
|
1366
1366
|
}));
|
|
1367
1367
|
else
|
|
@@ -1409,7 +1409,7 @@ let sn = class extends Xe {
|
|
|
1409
1409
|
return;
|
|
1410
1410
|
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === Ue.BODY;
|
|
1411
1411
|
for (const d of Object.keys(o)) {
|
|
1412
|
-
const c = o[d], l =
|
|
1412
|
+
const c = o[d], l = Kt({ unitId: n, drawingId: c.drawingId, subUnitId: n }), u = e.fuzzyMathObjects(l, !0);
|
|
1413
1413
|
if (u.length)
|
|
1414
1414
|
for (const m of u)
|
|
1415
1415
|
e.detachTransformerFrom(m), m.setOpacity(0.5), (s && c.isMultiTransform !== re.TRUE || !s && c.isMultiTransform === re.TRUE) && (e.attachTransformerTo(m), m.setOpacity(1));
|
|
@@ -1443,21 +1443,21 @@ let sn = class extends Xe {
|
|
|
1443
1443
|
this._docSelectionManagerService.replaceDocRanges(t);
|
|
1444
1444
|
}
|
|
1445
1445
|
};
|
|
1446
|
-
sn =
|
|
1446
|
+
sn = qi([
|
|
1447
1447
|
ge(1, z),
|
|
1448
1448
|
ge(2, we(_n)),
|
|
1449
1449
|
ge(3, Q),
|
|
1450
|
-
ge(4,
|
|
1450
|
+
ge(4, Yt),
|
|
1451
1451
|
ge(5, je),
|
|
1452
1452
|
ge(6, ve),
|
|
1453
|
-
ge(7,
|
|
1454
|
-
ge(8,
|
|
1453
|
+
ge(7, zn),
|
|
1454
|
+
ge(8, ci),
|
|
1455
1455
|
ge(9, we(ln)),
|
|
1456
1456
|
ge(10, we(ye)),
|
|
1457
1457
|
ge(11, we(gn)),
|
|
1458
|
-
ge(12,
|
|
1458
|
+
ge(12, di)
|
|
1459
1459
|
], sn);
|
|
1460
|
-
const
|
|
1460
|
+
const ut = {
|
|
1461
1461
|
id: "doc.command.insert-float-image",
|
|
1462
1462
|
type: X.COMMAND,
|
|
1463
1463
|
handler: (i) => {
|
|
@@ -1495,7 +1495,7 @@ const mt = {
|
|
|
1495
1495
|
});
|
|
1496
1496
|
return u.refreshControls(), !!h;
|
|
1497
1497
|
}
|
|
1498
|
-
},
|
|
1498
|
+
}, Xi = {
|
|
1499
1499
|
id: "doc.operation.clear-drawing-transformer",
|
|
1500
1500
|
type: X.MUTATION,
|
|
1501
1501
|
handler: (i, e) => {
|
|
@@ -1505,16 +1505,16 @@ const mt = {
|
|
|
1505
1505
|
(o = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || o.debounceRefreshControls();
|
|
1506
1506
|
}), !0;
|
|
1507
1507
|
}
|
|
1508
|
-
},
|
|
1508
|
+
}, ft = "COMPONENT_DOC_DRAWING_PANEL", ht = {
|
|
1509
1509
|
id: "sidebar.operation.doc-image",
|
|
1510
1510
|
type: X.COMMAND,
|
|
1511
1511
|
handler: async (i, e) => {
|
|
1512
|
-
const n = i.get(
|
|
1512
|
+
const n = i.get(li), t = i.get(ln), r = i.get(ve);
|
|
1513
1513
|
switch (e.value) {
|
|
1514
1514
|
case "open":
|
|
1515
1515
|
n.open({
|
|
1516
1516
|
header: { title: t.t("docImage.panel.title") },
|
|
1517
|
-
children: { label:
|
|
1517
|
+
children: { label: ft },
|
|
1518
1518
|
onClose: () => {
|
|
1519
1519
|
r.focusDrawing(null);
|
|
1520
1520
|
},
|
|
@@ -1528,12 +1528,12 @@ const mt = {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
return !0;
|
|
1530
1530
|
}
|
|
1531
|
-
},
|
|
1531
|
+
}, pt = {
|
|
1532
1532
|
id: "doc.operation.edit-doc-image",
|
|
1533
1533
|
type: X.OPERATION,
|
|
1534
1534
|
handler: (i, e) => {
|
|
1535
1535
|
const n = i.get(ve), t = i.get(z);
|
|
1536
|
-
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(
|
|
1536
|
+
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(ht.id, { value: "open" }), !0);
|
|
1537
1537
|
}
|
|
1538
1538
|
};
|
|
1539
1539
|
var pn = { exports: {} }, Ge = {};
|
|
@@ -1546,11 +1546,11 @@ var pn = { exports: {} }, Ge = {};
|
|
|
1546
1546
|
* This source code is licensed under the MIT license found in the
|
|
1547
1547
|
* LICENSE file in the root directory of this source tree.
|
|
1548
1548
|
*/
|
|
1549
|
-
var
|
|
1550
|
-
function
|
|
1551
|
-
if (
|
|
1552
|
-
|
|
1553
|
-
var i =
|
|
1549
|
+
var Hn;
|
|
1550
|
+
function Ki() {
|
|
1551
|
+
if (Hn) return Ge;
|
|
1552
|
+
Hn = 1;
|
|
1553
|
+
var i = Ti, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1554
1554
|
function s(a, d, c) {
|
|
1555
1555
|
var l, u = {}, m = null, p = null;
|
|
1556
1556
|
c !== void 0 && (m = "" + c), d.key !== void 0 && (m = "" + d.key), d.ref !== void 0 && (p = d.ref);
|
|
@@ -1560,41 +1560,41 @@ function Xi() {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
return Ge.Fragment = n, Ge.jsx = s, Ge.jsxs = s, Ge;
|
|
1562
1562
|
}
|
|
1563
|
-
var
|
|
1564
|
-
function
|
|
1565
|
-
return
|
|
1563
|
+
var Wn;
|
|
1564
|
+
function Yi() {
|
|
1565
|
+
return Wn || (Wn = 1, pn.exports = Ki()), pn.exports;
|
|
1566
1566
|
}
|
|
1567
|
-
var g =
|
|
1568
|
-
function
|
|
1567
|
+
var g = Yi();
|
|
1568
|
+
function wt(i) {
|
|
1569
1569
|
var e, n, t = "";
|
|
1570
1570
|
if (typeof i == "string" || typeof i == "number") t += i;
|
|
1571
1571
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
1572
1572
|
var r = i.length;
|
|
1573
|
-
for (e = 0; e < r; e++) i[e] && (n =
|
|
1573
|
+
for (e = 0; e < r; e++) i[e] && (n = wt(i[e])) && (t && (t += " "), t += n);
|
|
1574
1574
|
} else for (n in i) i[n] && (t && (t += " "), t += n);
|
|
1575
1575
|
return t;
|
|
1576
1576
|
}
|
|
1577
1577
|
function V() {
|
|
1578
|
-
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e =
|
|
1578
|
+
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = wt(i)) && (t && (t += " "), t += e);
|
|
1579
1579
|
return t;
|
|
1580
1580
|
}
|
|
1581
|
-
const
|
|
1582
|
-
imageCommonPanel:
|
|
1583
|
-
imageCommonPanelGrid:
|
|
1584
|
-
imageCommonPanelBorder:
|
|
1585
|
-
imageCommonPanelTitle:
|
|
1586
|
-
imageCommonPanelSubtitle:
|
|
1587
|
-
imageCommonPanelRow:
|
|
1588
|
-
imageCommonPanelRowVertical:
|
|
1589
|
-
imageCommonPanelColumn:
|
|
1590
|
-
imageCommonPanelColumnCenter:
|
|
1591
|
-
imageCommonPanelInline:
|
|
1592
|
-
imageCommonPanelSpan2:
|
|
1593
|
-
imageCommonPanelSpan3:
|
|
1594
|
-
imageCommonPanelInput:
|
|
1595
|
-
sheetImageMenu:
|
|
1596
|
-
sheetImageMenuInput:
|
|
1597
|
-
},
|
|
1581
|
+
const Ji = "univer-image-common-panel", Zi = "univer-image-common-panel-grid", Qi = "univer-image-common-panel-border", er = "univer-image-common-panel-title", nr = "univer-image-common-panel-subtitle", tr = "univer-image-common-panel-row", ir = "univer-image-common-panel-row-vertical", rr = "univer-image-common-panel-column", or = "univer-image-common-panel-column-center", sr = "univer-image-common-panel-inline", ar = "univer-image-common-panel-span2", cr = "univer-image-common-panel-span3", dr = "univer-image-common-panel-input", lr = "univer-sheet-image-menu", gr = "univer-sheet-image-menu-input", f = {
|
|
1582
|
+
imageCommonPanel: Ji,
|
|
1583
|
+
imageCommonPanelGrid: Zi,
|
|
1584
|
+
imageCommonPanelBorder: Qi,
|
|
1585
|
+
imageCommonPanelTitle: er,
|
|
1586
|
+
imageCommonPanelSubtitle: nr,
|
|
1587
|
+
imageCommonPanelRow: tr,
|
|
1588
|
+
imageCommonPanelRowVertical: ir,
|
|
1589
|
+
imageCommonPanelColumn: rr,
|
|
1590
|
+
imageCommonPanelColumnCenter: or,
|
|
1591
|
+
imageCommonPanelInline: sr,
|
|
1592
|
+
imageCommonPanelSpan2: ar,
|
|
1593
|
+
imageCommonPanelSpan3: cr,
|
|
1594
|
+
imageCommonPanelInput: dr,
|
|
1595
|
+
sheetImageMenu: lr,
|
|
1596
|
+
sheetImageMenuInput: gr
|
|
1597
|
+
}, Gn = -1e3, Vn = 1e3, mr = (i) => {
|
|
1598
1598
|
const e = pe(z), n = pe(ln), t = pe(ve), r = pe(Q), o = pe(J), { drawings: s } = i, a = s[0];
|
|
1599
1599
|
if (a == null)
|
|
1600
1600
|
return;
|
|
@@ -1759,8 +1759,8 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
1759
1759
|
/* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
|
|
1760
1760
|
Be,
|
|
1761
1761
|
{
|
|
1762
|
-
min:
|
|
1763
|
-
max:
|
|
1762
|
+
min: Gn,
|
|
1763
|
+
max: Vn,
|
|
1764
1764
|
precision: 1,
|
|
1765
1765
|
disabled: w,
|
|
1766
1766
|
value: O.posOffset,
|
|
@@ -1794,8 +1794,8 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
1794
1794
|
/* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
|
|
1795
1795
|
Be,
|
|
1796
1796
|
{
|
|
1797
|
-
min:
|
|
1798
|
-
max:
|
|
1797
|
+
min: Gn,
|
|
1798
|
+
max: Vn,
|
|
1799
1799
|
precision: 1,
|
|
1800
1800
|
disabled: w,
|
|
1801
1801
|
value: x.posOffset,
|
|
@@ -1823,9 +1823,9 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
1823
1823
|
] }) })
|
|
1824
1824
|
] }),
|
|
1825
1825
|
/* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSubtitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-position.options") }) }) }),
|
|
1826
|
-
/* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
|
|
1826
|
+
/* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(Pi, { disabled: w, checked: T, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
|
|
1827
1827
|
] });
|
|
1828
|
-
}, Qe = 0, en = 100,
|
|
1828
|
+
}, Qe = 0, en = 100, ur = (i) => {
|
|
1829
1829
|
const e = pe(z), n = pe(ln), t = pe(ve), r = pe(Q), o = pe(J), { drawings: s } = i, a = s[0];
|
|
1830
1830
|
if (a == null)
|
|
1831
1831
|
return null;
|
|
@@ -1848,7 +1848,7 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
1848
1848
|
subUnitId: y,
|
|
1849
1849
|
drawingId: E
|
|
1850
1850
|
}));
|
|
1851
|
-
e.executeCommand(
|
|
1851
|
+
e.executeCommand(et.id, {
|
|
1852
1852
|
unitId: M,
|
|
1853
1853
|
subUnitId: P,
|
|
1854
1854
|
drawings: L,
|
|
@@ -1865,7 +1865,7 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
1865
1865
|
subUnitId: P.subUnitId,
|
|
1866
1866
|
drawingId: P.drawingId
|
|
1867
1867
|
}));
|
|
1868
|
-
e.executeCommand(
|
|
1868
|
+
e.executeCommand(tt.id, {
|
|
1869
1869
|
unitId: C[0].unitId,
|
|
1870
1870
|
subUnitId: C[0].unitId,
|
|
1871
1871
|
drawings: M,
|
|
@@ -1885,7 +1885,7 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
1885
1885
|
subUnitId: U.subUnitId,
|
|
1886
1886
|
drawingId: U.drawingId
|
|
1887
1887
|
}));
|
|
1888
|
-
e.executeCommand(
|
|
1888
|
+
e.executeCommand(nt.id, {
|
|
1889
1889
|
unitId: P[0].unitId,
|
|
1890
1890
|
subUnitId: P[0].unitId,
|
|
1891
1891
|
drawings: L,
|
|
@@ -2038,7 +2038,7 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
2038
2038
|
] }) })
|
|
2039
2039
|
] })
|
|
2040
2040
|
] });
|
|
2041
|
-
},
|
|
2041
|
+
}, fr = () => {
|
|
2042
2042
|
const i = pe(ve), e = i.getFocusDrawings(), [n, t] = ie(e);
|
|
2043
2043
|
return Sn(() => {
|
|
2044
2044
|
const r = i.focus$.subscribe((o) => {
|
|
@@ -2048,13 +2048,13 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
2048
2048
|
r.unsubscribe();
|
|
2049
2049
|
};
|
|
2050
2050
|
}, []), !!(n != null && n.length) && /* @__PURE__ */ g.jsxs("div", { className: f.imageCommonPanel, children: [
|
|
2051
|
-
/* @__PURE__ */ g.jsx(
|
|
2052
|
-
/* @__PURE__ */ g.jsx(
|
|
2053
|
-
/* @__PURE__ */ g.jsx(
|
|
2051
|
+
/* @__PURE__ */ g.jsx(Zt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
|
|
2052
|
+
/* @__PURE__ */ g.jsx(ur, { drawings: n }),
|
|
2053
|
+
/* @__PURE__ */ g.jsx(mr, { drawings: n })
|
|
2054
2054
|
] });
|
|
2055
|
-
},
|
|
2055
|
+
}, vt = "addition-and-subtraction-single", It = "doc.menu.image", _t = ut.id, hr = (i) => {
|
|
2056
2056
|
const e = i.get(_n), n = i.get(J);
|
|
2057
|
-
return new
|
|
2057
|
+
return new xi((t) => {
|
|
2058
2058
|
const r = e.textSelection$.subscribe(() => {
|
|
2059
2059
|
var s;
|
|
2060
2060
|
const o = e.getActiveTextRange();
|
|
@@ -2076,40 +2076,40 @@ const Yi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", Z
|
|
|
2076
2076
|
return () => r.unsubscribe();
|
|
2077
2077
|
});
|
|
2078
2078
|
};
|
|
2079
|
-
function
|
|
2079
|
+
function pr(i) {
|
|
2080
2080
|
return {
|
|
2081
|
-
id:
|
|
2082
|
-
type:
|
|
2083
|
-
icon:
|
|
2081
|
+
id: It,
|
|
2082
|
+
type: Xn.SUBITEMS,
|
|
2083
|
+
icon: vt,
|
|
2084
2084
|
tooltip: "docImage.title",
|
|
2085
|
-
disabled$:
|
|
2086
|
-
hidden$:
|
|
2085
|
+
disabled$: hr(i),
|
|
2086
|
+
hidden$: Kn(i, Te.UNIVER_DOC)
|
|
2087
2087
|
};
|
|
2088
2088
|
}
|
|
2089
|
-
function
|
|
2089
|
+
function wr(i) {
|
|
2090
2090
|
return {
|
|
2091
|
-
id:
|
|
2091
|
+
id: _t,
|
|
2092
2092
|
title: "docImage.upload.float",
|
|
2093
|
-
type:
|
|
2094
|
-
hidden$:
|
|
2093
|
+
type: Xn.BUTTON,
|
|
2094
|
+
hidden$: Kn(i, Te.UNIVER_DOC)
|
|
2095
2095
|
};
|
|
2096
2096
|
}
|
|
2097
|
-
const
|
|
2098
|
-
[
|
|
2099
|
-
[
|
|
2097
|
+
const vr = {
|
|
2098
|
+
[gi.LAYOUT]: {
|
|
2099
|
+
[It]: {
|
|
2100
2100
|
order: 0,
|
|
2101
|
-
menuItemFactory:
|
|
2102
|
-
[
|
|
2101
|
+
menuItemFactory: pr,
|
|
2102
|
+
[_t]: {
|
|
2103
2103
|
order: 0,
|
|
2104
|
-
menuItemFactory:
|
|
2104
|
+
menuItemFactory: wr
|
|
2105
2105
|
}
|
|
2106
2106
|
}
|
|
2107
2107
|
}
|
|
2108
2108
|
};
|
|
2109
2109
|
function Ye(i) {
|
|
2110
|
-
return i.getContextValue(
|
|
2110
|
+
return i.getContextValue(At) && i.getContextValue(tn);
|
|
2111
2111
|
}
|
|
2112
|
-
const
|
|
2112
|
+
const Ir = {
|
|
2113
2113
|
id: Ke.id,
|
|
2114
2114
|
description: "shortcut.doc.drawing-move-down",
|
|
2115
2115
|
group: "4_doc-drawing-view",
|
|
@@ -2119,7 +2119,7 @@ const vr = {
|
|
|
2119
2119
|
staticParameters: {
|
|
2120
2120
|
direction: ue.DOWN
|
|
2121
2121
|
}
|
|
2122
|
-
},
|
|
2122
|
+
}, _r = {
|
|
2123
2123
|
id: Ke.id,
|
|
2124
2124
|
description: "shortcut.doc.drawing-move-up",
|
|
2125
2125
|
group: "4_doc-drawing-view",
|
|
@@ -2129,7 +2129,7 @@ const vr = {
|
|
|
2129
2129
|
staticParameters: {
|
|
2130
2130
|
direction: ue.UP
|
|
2131
2131
|
}
|
|
2132
|
-
},
|
|
2132
|
+
}, Sr = {
|
|
2133
2133
|
id: Ke.id,
|
|
2134
2134
|
description: "shortcut.doc.drawing-move-left",
|
|
2135
2135
|
group: "4_doc-drawing-view",
|
|
@@ -2139,7 +2139,7 @@ const vr = {
|
|
|
2139
2139
|
staticParameters: {
|
|
2140
2140
|
direction: ue.LEFT
|
|
2141
2141
|
}
|
|
2142
|
-
},
|
|
2142
|
+
}, Cr = {
|
|
2143
2143
|
id: Ke.id,
|
|
2144
2144
|
description: "shortcut.doc.drawing-move-right",
|
|
2145
2145
|
group: "4_doc-drawing-view",
|
|
@@ -2149,8 +2149,8 @@ const vr = {
|
|
|
2149
2149
|
staticParameters: {
|
|
2150
2150
|
direction: ue.RIGHT
|
|
2151
2151
|
}
|
|
2152
|
-
},
|
|
2153
|
-
id:
|
|
2152
|
+
}, Dr = {
|
|
2153
|
+
id: ct.id,
|
|
2154
2154
|
description: "shortcut.doc.drawing-delete",
|
|
2155
2155
|
group: "4_doc-drawing-view",
|
|
2156
2156
|
// when focusing on any other input tag do not trigger this shortcut
|
|
@@ -2158,10 +2158,10 @@ const vr = {
|
|
|
2158
2158
|
binding: Fe.DELETE,
|
|
2159
2159
|
mac: Fe.BACKSPACE
|
|
2160
2160
|
};
|
|
2161
|
-
var
|
|
2162
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2161
|
+
var Or = Object.defineProperty, xr = Object.getOwnPropertyDescriptor, Pr = (i, e, n, t) => {
|
|
2162
|
+
for (var r = t > 1 ? void 0 : t ? xr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2163
2163
|
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
2164
|
-
return t && r &&
|
|
2164
|
+
return t && r && Or(e, n, r), r;
|
|
2165
2165
|
}, nn = (i, e) => (n, t) => e(n, t, i);
|
|
2166
2166
|
let an = class extends Xe {
|
|
2167
2167
|
constructor(i, e, n, t) {
|
|
@@ -2169,40 +2169,40 @@ let an = class extends Xe {
|
|
|
2169
2169
|
}
|
|
2170
2170
|
_initCustomComponents() {
|
|
2171
2171
|
const i = this._componentManager;
|
|
2172
|
-
this.disposeWithMe(i.register(
|
|
2172
|
+
this.disposeWithMe(i.register(vt, at)), this.disposeWithMe(i.register(ft, fr));
|
|
2173
2173
|
}
|
|
2174
2174
|
_initMenus() {
|
|
2175
|
-
this._menuManagerService.mergeMenu(
|
|
2175
|
+
this._menuManagerService.mergeMenu(vr);
|
|
2176
2176
|
}
|
|
2177
2177
|
_initCommands() {
|
|
2178
2178
|
[
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
Qn,
|
|
2179
|
+
ut,
|
|
2180
|
+
lt,
|
|
2182
2181
|
et,
|
|
2183
2182
|
nt,
|
|
2184
|
-
qe,
|
|
2185
2183
|
tt,
|
|
2184
|
+
qe,
|
|
2186
2185
|
it,
|
|
2186
|
+
rt,
|
|
2187
2187
|
Cn,
|
|
2188
|
-
ft,
|
|
2189
|
-
qi,
|
|
2190
2188
|
ht,
|
|
2191
|
-
|
|
2192
|
-
|
|
2189
|
+
Xi,
|
|
2190
|
+
pt,
|
|
2191
|
+
dt,
|
|
2192
|
+
mt,
|
|
2193
2193
|
Ke,
|
|
2194
|
-
|
|
2195
|
-
|
|
2194
|
+
ct,
|
|
2195
|
+
gt
|
|
2196
2196
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
2197
2197
|
}
|
|
2198
2198
|
_initShortcuts() {
|
|
2199
2199
|
[
|
|
2200
2200
|
// sheet drawing shortcuts
|
|
2201
|
-
vr,
|
|
2202
2201
|
Ir,
|
|
2203
2202
|
_r,
|
|
2204
2203
|
Sr,
|
|
2205
|
-
Cr
|
|
2204
|
+
Cr,
|
|
2205
|
+
Dr
|
|
2206
2206
|
].forEach((i) => {
|
|
2207
2207
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2208
2208
|
});
|
|
@@ -2211,18 +2211,18 @@ let an = class extends Xe {
|
|
|
2211
2211
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2212
2212
|
}
|
|
2213
2213
|
};
|
|
2214
|
-
an =
|
|
2215
|
-
nn(0, we(
|
|
2216
|
-
nn(1,
|
|
2214
|
+
an = Pr([
|
|
2215
|
+
nn(0, we(mi)),
|
|
2216
|
+
nn(1, ui),
|
|
2217
2217
|
nn(2, z),
|
|
2218
|
-
nn(3,
|
|
2218
|
+
nn(3, fi)
|
|
2219
2219
|
], an);
|
|
2220
|
-
var
|
|
2221
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2220
|
+
var Tr = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, br = (i, e, n, t) => {
|
|
2221
|
+
for (var r = t > 1 ? void 0 : t ? yr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2222
2222
|
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
2223
|
-
return t && r &&
|
|
2223
|
+
return t && r && Tr(e, n, r), r;
|
|
2224
2224
|
}, Ve = (i, e) => (n, t) => e(n, t, i);
|
|
2225
|
-
let cn = class extends
|
|
2225
|
+
let cn = class extends jt {
|
|
2226
2226
|
constructor(e, n, t, r, o) {
|
|
2227
2227
|
super();
|
|
2228
2228
|
Se(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
@@ -2244,7 +2244,7 @@ let cn = class extends At {
|
|
|
2244
2244
|
_hasCropObject(e) {
|
|
2245
2245
|
const n = e.getAllObjects();
|
|
2246
2246
|
for (const t of n)
|
|
2247
|
-
if (t instanceof
|
|
2247
|
+
if (t instanceof Qt)
|
|
2248
2248
|
return !0;
|
|
2249
2249
|
return !1;
|
|
2250
2250
|
}
|
|
@@ -2275,7 +2275,7 @@ let cn = class extends At {
|
|
|
2275
2275
|
const { unitId: l, subUnitId: u, drawingId: m } = c, p = this._canvasPopManagerService.attachPopupToObject(
|
|
2276
2276
|
a,
|
|
2277
2277
|
{
|
|
2278
|
-
componentKey:
|
|
2278
|
+
componentKey: ei,
|
|
2279
2279
|
direction: "horizontal",
|
|
2280
2280
|
offset: [2, 0],
|
|
2281
2281
|
extraProps: {
|
|
@@ -2316,9 +2316,9 @@ let cn = class extends At {
|
|
|
2316
2316
|
{
|
|
2317
2317
|
label: "image-popup.edit",
|
|
2318
2318
|
index: 0,
|
|
2319
|
-
commandId:
|
|
2319
|
+
commandId: pt.id,
|
|
2320
2320
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2321
|
-
disable: !!
|
|
2321
|
+
disable: !!Lt.includes(e)
|
|
2322
2322
|
},
|
|
2323
2323
|
{
|
|
2324
2324
|
label: "image-popup.delete",
|
|
@@ -2330,7 +2330,7 @@ let cn = class extends At {
|
|
|
2330
2330
|
{
|
|
2331
2331
|
label: "image-popup.crop",
|
|
2332
2332
|
index: 2,
|
|
2333
|
-
commandId:
|
|
2333
|
+
commandId: ni.id,
|
|
2334
2334
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2335
2335
|
disable: !0
|
|
2336
2336
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2338,7 +2338,7 @@ let cn = class extends At {
|
|
|
2338
2338
|
{
|
|
2339
2339
|
label: "image-popup.reset",
|
|
2340
2340
|
index: 3,
|
|
2341
|
-
commandId:
|
|
2341
|
+
commandId: ti.id,
|
|
2342
2342
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
2343
2343
|
disable: !0
|
|
2344
2344
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2346,22 +2346,22 @@ let cn = class extends At {
|
|
|
2346
2346
|
];
|
|
2347
2347
|
}
|
|
2348
2348
|
};
|
|
2349
|
-
cn =
|
|
2349
|
+
cn = br([
|
|
2350
2350
|
Ve(0, ve),
|
|
2351
|
-
Ve(1, we(
|
|
2351
|
+
Ve(1, we(Si)),
|
|
2352
2352
|
Ve(2, Q),
|
|
2353
2353
|
Ve(3, J),
|
|
2354
|
-
Ve(4,
|
|
2354
|
+
Ve(4, zn)
|
|
2355
2355
|
], cn);
|
|
2356
|
-
var
|
|
2357
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2356
|
+
var Mr = Object.defineProperty, Rr = Object.getOwnPropertyDescriptor, Nr = (i, e, n, t) => {
|
|
2357
|
+
for (var r = t > 1 ? void 0 : t ? Rr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2358
2358
|
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
2359
|
-
return t && r &&
|
|
2359
|
+
return t && r && Mr(e, n, r), r;
|
|
2360
2360
|
}, Ee = (i, e) => (n, t) => e(n, t, i);
|
|
2361
2361
|
let vn = class extends Xe {
|
|
2362
2362
|
constructor(e, n, t, r, o, s, a, d) {
|
|
2363
2363
|
super();
|
|
2364
|
-
Se(this, "_liquid", new
|
|
2364
|
+
Se(this, "_liquid", new qn());
|
|
2365
2365
|
this._context = e, this._docSkeletonManagerService = n, this._commandService = t, this._editorService = r, this._drawingManagerService = o, this._docRefreshDrawingsService = s, this._univerInstanceService = a, this._lifecycleService = d, this._initialize(), this._commandExecutedListener();
|
|
2366
2366
|
}
|
|
2367
2367
|
_initialize() {
|
|
@@ -2375,7 +2375,7 @@ let vn = class extends Xe {
|
|
|
2375
2375
|
});
|
|
2376
2376
|
}
|
|
2377
2377
|
_commandExecutedListener() {
|
|
2378
|
-
const e = [Z.id,
|
|
2378
|
+
const e = [Z.id, Di.id];
|
|
2379
2379
|
this.disposeWithMe(
|
|
2380
2380
|
this._commandService.onCommandExecuted((n) => {
|
|
2381
2381
|
if (e.includes(n.id)) {
|
|
@@ -2385,7 +2385,7 @@ let vn = class extends Xe {
|
|
|
2385
2385
|
const a = this._docSkeletonManagerService.getSkeleton();
|
|
2386
2386
|
if (a == null)
|
|
2387
2387
|
return;
|
|
2388
|
-
if (this._editorService.isEditor(o) && o !==
|
|
2388
|
+
if (this._editorService.isEditor(o) && o !== Ut) {
|
|
2389
2389
|
s == null || s.makeDirty();
|
|
2390
2390
|
return;
|
|
2391
2391
|
}
|
|
@@ -2396,9 +2396,9 @@ let vn = class extends Xe {
|
|
|
2396
2396
|
}
|
|
2397
2397
|
_initResize() {
|
|
2398
2398
|
this.disposeWithMe(
|
|
2399
|
-
|
|
2400
|
-
jn((e) => e.type ===
|
|
2401
|
-
|
|
2399
|
+
Ft(this._context.engine.onTransformChange$).pipe(
|
|
2400
|
+
jn((e) => e.type === ai.resize),
|
|
2401
|
+
Yn(16)
|
|
2402
2402
|
).subscribe(() => {
|
|
2403
2403
|
var t;
|
|
2404
2404
|
const e = this._docSkeletonManagerService.getSkeleton(), { scene: n } = this._context;
|
|
@@ -2494,26 +2494,30 @@ let vn = class extends Xe {
|
|
|
2494
2494
|
}, 1e3) : this._lifecycleService.lifecycle$.pipe(jn((n) => n === Pn.Steady)).subscribe(e);
|
|
2495
2495
|
}
|
|
2496
2496
|
};
|
|
2497
|
-
vn =
|
|
2497
|
+
vn = Nr([
|
|
2498
2498
|
Ee(1, we(oe)),
|
|
2499
2499
|
Ee(2, z),
|
|
2500
|
-
Ee(3,
|
|
2500
|
+
Ee(3, Ci),
|
|
2501
2501
|
Ee(4, ve),
|
|
2502
2502
|
Ee(5, we(gn)),
|
|
2503
2503
|
Ee(6, J),
|
|
2504
|
-
Ee(7, we(
|
|
2504
|
+
Ee(7, we(Bt))
|
|
2505
2505
|
], vn);
|
|
2506
|
-
var
|
|
2507
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2506
|
+
var St = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, Ar = (i, e, n) => e in i ? St(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, jr = (i, e, n, t) => {
|
|
2507
|
+
for (var r = t > 1 ? void 0 : t ? Er(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2508
2508
|
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
2509
|
-
return t && r &&
|
|
2510
|
-
}, wn = (i, e) => (n, t) => e(n, t, i),
|
|
2511
|
-
const
|
|
2512
|
-
let dn = class extends
|
|
2513
|
-
constructor(i =
|
|
2509
|
+
return t && r && St(e, n, r), r;
|
|
2510
|
+
}, wn = (i, e) => (n, t) => e(n, t, i), Ct = (i, e, n) => Ar(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2511
|
+
const Lr = "DOC_DRAWING_UI_PLUGIN";
|
|
2512
|
+
let dn = class extends Wt {
|
|
2513
|
+
constructor(i = Fn, e, n, t) {
|
|
2514
2514
|
super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
|
|
2515
|
-
const { ...r } =
|
|
2516
|
-
|
|
2515
|
+
const { ...r } = Gt(
|
|
2516
|
+
{},
|
|
2517
|
+
Fn,
|
|
2518
|
+
this._config
|
|
2519
|
+
);
|
|
2520
|
+
this._configService.setConfig(bi, r);
|
|
2517
2521
|
}
|
|
2518
2522
|
onStarting() {
|
|
2519
2523
|
[
|
|
@@ -2534,26 +2538,26 @@ let dn = class extends Ht {
|
|
|
2534
2538
|
this._injector.get(cn);
|
|
2535
2539
|
}
|
|
2536
2540
|
};
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
dn =
|
|
2540
|
-
|
|
2541
|
-
wn(1, we(
|
|
2541
|
+
Ct(dn, "type", Te.UNIVER_DOC);
|
|
2542
|
+
Ct(dn, "pluginName", Lr);
|
|
2543
|
+
dn = jr([
|
|
2544
|
+
kt(ii, Jt, $t, hi),
|
|
2545
|
+
wn(1, we(Ht)),
|
|
2542
2546
|
wn(2, Q),
|
|
2543
|
-
wn(3,
|
|
2547
|
+
wn(3, Vt)
|
|
2544
2548
|
], dn);
|
|
2545
2549
|
export {
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2550
|
+
Xi as ClearDocDrawingTransformerOperation,
|
|
2551
|
+
It as DOCS_IMAGE_MENU_ID,
|
|
2552
|
+
ct as DeleteDocDrawingsCommand,
|
|
2553
|
+
pt as EditDocDrawingOperation,
|
|
2554
|
+
dt as GroupDocDrawingCommand,
|
|
2555
|
+
lt as InsertDocDrawingCommand,
|
|
2556
|
+
ut as InsertDocImageCommand,
|
|
2553
2557
|
Ke as MoveDocDrawingsCommand,
|
|
2554
2558
|
Cn as RemoveDocDrawingCommand,
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2559
|
+
gt as SetDocDrawingArrangeCommand,
|
|
2560
|
+
ht as SidebarDocDrawingOperation,
|
|
2561
|
+
mt as UngroupDocDrawingCommand,
|
|
2558
2562
|
dn as UniverDocsDrawingUIPlugin
|
|
2559
2563
|
};
|