@univerjs/docs-drawing-ui 0.9.2 → 0.9.3-nightly.202507250750
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/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/es/index.js +130 -130
- package/lib/es/locale/ca-ES.js +62 -0
- package/lib/es/locale/es-ES.js +62 -0
- package/lib/index.js +130 -130
- package/lib/locale/ca-ES.js +62 -0
- package/lib/locale/es-ES.js +62 -0
- package/lib/types/locale/ca-ES.d.ts +3 -0
- package/lib/types/locale/es-ES.d.ts +3 -0
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -0
- package/lib/umd/locale/es-ES.js +1 -0
- package/package.json +22 -13
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var ve = (i, e, t) =>
|
|
4
|
-
import { CommandType as q, ICommandService as j, IUniverInstanceService as z, TextX as _t, JSONX as $, MemoryCursor as
|
|
1
|
+
var Pn = Object.defineProperty;
|
|
2
|
+
var xn = (i, e, t) => e in i ? Pn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var ve = (i, e, t) => xn(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommandType as q, ICommandService as j, IUniverInstanceService as z, TextX as _t, JSONX as $, MemoryCursor as Nn, TextXActionType as Y, IUndoRedoService as Kt, BuildTextUtils as Un, ArrangeTypeEnum as Ze, Tools as Pe, Inject as Z, IContextService as Yt, LocaleService as lt, Disposable as Ne, WrapTextType as ze, PositionedObjectLayoutType as k, BooleanNumber as oe, DrawingTypeEnum as xe, ObjectRelativeFromV as W, ObjectRelativeFromH as J, FOCUSING_COMMON_DRAWINGS as nt, UniverInstanceType as we, Direction as he, DisposableCollection as Ln, toDisposable as Se, fromEventSubject as Zt, generateRandomId as Qt, DocumentFlavor as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as St, FOCUSING_UNIVER_EDITOR as Bn, UndoCommand as Fn, RedoCommand as kn, Injector as Jt, DOC_DRAWING_PRINTING_COMPONENT_KEY as Wn, throttle as Et, COLORS as Gn, RxDisposable as Hn, LifecycleService as jn, LifecycleStages as Rt, DependentOn as Vn, IConfigService as $n, Plugin as zn, merge as Xn } from "@univerjs/core";
|
|
5
5
|
import { IDocDrawingService as Ue, UniverDocsDrawingPlugin as qn } from "@univerjs/docs-drawing";
|
|
6
6
|
import { RichTextEditingMutation as ee, DocSelectionManagerService as Dt, DocSkeletonManagerService as te } from "@univerjs/docs";
|
|
7
|
-
import { DocSelectionRenderService as
|
|
8
|
-
import { IRenderManagerService as Q, DocumentEditArea as ke, getCurrentTypeOfRenderer as nr, CURSOR_TYPE as xt, Liquid as
|
|
9
|
-
import { MessageType as Lt, clsx as
|
|
7
|
+
import { DocSelectionRenderService as Me, getRichTextEditPath as Xe, getCustomBlockIdsInSelections as Kn, docDrawingPositionToTransform as en, VIEWPORT_KEY as tn, SetDocZoomRatioOperation as nn, DocPrintInterceptorService as Yn, NodePositionConvertToCursor as At, getOneTextSelectionRange as Pt, getAnchorBounding as Zn, TEXT_RANGE_LAYER_INDEX as Qn, getDocObject as Jn, DocCanvasPopManagerService as er, IEditorService as tr } from "@univerjs/docs-ui";
|
|
8
|
+
import { IRenderManagerService as Q, DocumentEditArea as ke, getCurrentTypeOfRenderer as nr, CURSOR_TYPE as xt, Liquid as rn, PageLayoutType as Nt, DocumentSkeletonPageType as Ut, Vector2 as rr, Rect as ir, getColor as or, TRANSFORM_CHANGE_OBSERVABLE_TYPE as sr } from "@univerjs/engine-render";
|
|
9
|
+
import { MessageType as Lt, clsx as on, InputNumber as Fe, Select as Bt, Checkbox as ar, RadioGroup as Ft, Radio as ye, render as cr, unmount as dr } from "@univerjs/design";
|
|
10
10
|
import { IImageIoService as gr, IDrawingManagerService as fe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as lr, DRAWING_IMAGE_COUNT_LIMIT as kt, ImageUploadStatusType as mt, DRAWING_IMAGE_ALLOW_SIZE as ur, getImageSize as hr, getDrawingShapeKeyByDrawingSearch as fr, DRAWING_IMAGE_WIDTH_LIMIT as Wt, DRAWING_IMAGE_HEIGHT_LIMIT as Gt, UniverDrawingPlugin as pr } from "@univerjs/drawing";
|
|
11
|
-
import { IMessageService as mr, ILocalFileService as wr, ISidebarService as vr, CanvasFloatDomService as Ir, useDependency as me, getMenuHiddenObservable as
|
|
12
|
-
import { BehaviorSubject as Ot, debounceTime as
|
|
13
|
-
import { DrawingRenderService as
|
|
11
|
+
import { IMessageService as mr, ILocalFileService as wr, ISidebarService as vr, CanvasFloatDomService as Ir, useDependency as me, getMenuHiddenObservable as sn, MenuItemType as an, RibbonInsertGroup as _r, KeyCode as We, ComponentManager as cn, IMenuManagerService as Sr, IShortcutService as Dr, PrintFloatDomSingle as Or, connectInjector as Tr, UniverUIPlugin as yr } from "@univerjs/ui";
|
|
12
|
+
import { BehaviorSubject as Ot, debounceTime as dn, map as Ht, switchMap as Mr, of as br, Observable as Cr, takeUntil as jt, filter as Vt } from "rxjs";
|
|
13
|
+
import { DrawingRenderService as gn, DrawingCommonPanel as Er, ImageCropperObject as Rr, COMPONENT_IMAGE_POPUP_MENU as Ar, OpenImageCropOperation as Pr, ImageResetSizeOperation as xr, UniverDrawingUIPlugin as Nr } from "@univerjs/drawing-ui";
|
|
14
14
|
import { jsxs as X, jsx as y } from "react/jsx-runtime";
|
|
15
15
|
import { useState as ie, useEffect as Tt, useMemo as Ur } from "react";
|
|
16
16
|
const yt = {
|
|
@@ -22,7 +22,7 @@ const yt = {
|
|
|
22
22
|
const t = i.get(j), n = i.get(z), r = i.get(Q), o = n.getCurrentUniverDocInstance();
|
|
23
23
|
if (e == null || o == null)
|
|
24
24
|
return !1;
|
|
25
|
-
const s = r.getRenderById(e.unitId).with(
|
|
25
|
+
const s = r.getRenderById(e.unitId).with(Me), { drawings: c } = e, d = (C = s.getSegment()) != null ? C : "", a = new _t(), g = $.getInstance(), u = (A = (M = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : M.customBlocks) != null ? A : [], l = c.map((R) => u.find((v) => v.blockId === R.drawingId)).filter((R) => !!R).sort((R, v) => R.startIndex > v.startIndex ? 1 : -1), f = c[0].unitId, h = new Nn();
|
|
26
26
|
h.reset();
|
|
27
27
|
const m = l[0].startIndex, p = [
|
|
28
28
|
{
|
|
@@ -55,7 +55,7 @@ const yt = {
|
|
|
55
55
|
}
|
|
56
56
|
return w.params.actions = D.reduce((R, v) => $.compose(R, v), null), !!t.syncExecuteCommand(w.id, w.params);
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, ln = {
|
|
59
59
|
id: "doc.command.delete-drawing",
|
|
60
60
|
type: q.COMMAND,
|
|
61
61
|
handler: (i) => {
|
|
@@ -76,7 +76,7 @@ const yt = {
|
|
|
76
76
|
drawings: o
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
},
|
|
79
|
+
}, un = {
|
|
80
80
|
id: "doc.command.group-doc-image",
|
|
81
81
|
type: q.COMMAND,
|
|
82
82
|
handler: (i, e) => {
|
|
@@ -114,7 +114,7 @@ const yt = {
|
|
|
114
114
|
len: g
|
|
115
115
|
});
|
|
116
116
|
else {
|
|
117
|
-
const v =
|
|
117
|
+
const v = Un.selection.delete([o], l, 0, null, !1);
|
|
118
118
|
f.push(...v);
|
|
119
119
|
const N = Kn(l, [o]), G = (L = s.getDrawings()) != null ? L : {}, x = (R = s.getDrawingsOrder()) != null ? R : [], H = N.sort((I, _) => x.indexOf(I) > x.indexOf(_) ? -1 : x.indexOf(I) < x.indexOf(_) ? 1 : 0);
|
|
120
120
|
if (H.length > 0)
|
|
@@ -153,7 +153,7 @@ const yt = {
|
|
|
153
153
|
};
|
|
154
154
|
return O.params.actions = m.reduce((v, N) => $.compose(v, N), null), !!t.syncExecuteCommand(O.id, O.params);
|
|
155
155
|
}
|
|
156
|
-
},
|
|
156
|
+
}, hn = {
|
|
157
157
|
id: "doc.command.set-drawing-arrange",
|
|
158
158
|
type: q.COMMAND,
|
|
159
159
|
handler: (i, e) => {
|
|
@@ -168,7 +168,7 @@ const yt = {
|
|
|
168
168
|
if (g == null)
|
|
169
169
|
return !1;
|
|
170
170
|
const u = [];
|
|
171
|
-
let l =
|
|
171
|
+
let l = Pe.deepClone(g);
|
|
172
172
|
l = l.slice(3), l.unshift("drawingsOrder"), u.push(l);
|
|
173
173
|
const f = {
|
|
174
174
|
id: ee.id,
|
|
@@ -180,7 +180,7 @@ const yt = {
|
|
|
180
180
|
};
|
|
181
181
|
return f.params.actions = u.reduce((m, p) => $.compose(m, p), null), !!t.syncExecuteCommand(f.id, f.params);
|
|
182
182
|
}
|
|
183
|
-
},
|
|
183
|
+
}, fn = {
|
|
184
184
|
id: "doc.command.ungroup-doc-image",
|
|
185
185
|
type: q.COMMAND,
|
|
186
186
|
handler: (i, e) => {
|
|
@@ -272,7 +272,7 @@ let rt = class extends Ne {
|
|
|
272
272
|
drawingType: xe.DRAWING_IMAGE,
|
|
273
273
|
imageSourceType: s,
|
|
274
274
|
source: c,
|
|
275
|
-
transform:
|
|
275
|
+
transform: en(f),
|
|
276
276
|
docTransform: f,
|
|
277
277
|
behindDoc: oe.FALSE,
|
|
278
278
|
title: "",
|
|
@@ -320,7 +320,7 @@ let rt = class extends Ne {
|
|
|
320
320
|
_updateOrderListener() {
|
|
321
321
|
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
|
|
322
322
|
const { unitId: e, subUnitId: t, drawingIds: n, arrangeType: r } = i;
|
|
323
|
-
this._commandService.executeCommand(
|
|
323
|
+
this._commandService.executeCommand(hn.id, {
|
|
324
324
|
unitId: e,
|
|
325
325
|
subUnitId: t,
|
|
326
326
|
drawingIds: n,
|
|
@@ -330,9 +330,9 @@ let rt = class extends Ne {
|
|
|
330
330
|
}
|
|
331
331
|
_groupDrawingListener() {
|
|
332
332
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
|
|
333
|
-
this._commandService.executeCommand(
|
|
333
|
+
this._commandService.executeCommand(un.id, i);
|
|
334
334
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
|
|
335
|
-
this._commandService.executeCommand(
|
|
335
|
+
this._commandService.executeCommand(fn.id, i);
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
_getCurrentSceneAndTransformer() {
|
|
@@ -345,7 +345,7 @@ let rt = class extends Ne {
|
|
|
345
345
|
_transformDrawingListener() {
|
|
346
346
|
const i = this._getCurrentSceneAndTransformer();
|
|
347
347
|
if (i && i.transformer)
|
|
348
|
-
this.disposeWithMe(i.transformer.changeEnd$.pipe(
|
|
348
|
+
this.disposeWithMe(i.transformer.changeEnd$.pipe(dn(30)).subscribe((e) => {
|
|
349
349
|
this._docSelectionManagerService.refreshSelection();
|
|
350
350
|
}));
|
|
351
351
|
else
|
|
@@ -449,11 +449,11 @@ rt = Br([
|
|
|
449
449
|
le(7, Yt),
|
|
450
450
|
le(8, mr),
|
|
451
451
|
le(9, Z(lt)),
|
|
452
|
-
le(10, Z(
|
|
452
|
+
le(10, Z(Me)),
|
|
453
453
|
le(11, Z(ut)),
|
|
454
454
|
le(12, wr)
|
|
455
455
|
], rt);
|
|
456
|
-
const
|
|
456
|
+
const pn = {
|
|
457
457
|
id: "doc.command.insert-float-image",
|
|
458
458
|
type: q.COMMAND,
|
|
459
459
|
handler: (i) => {
|
|
@@ -470,7 +470,7 @@ const Fr = {
|
|
|
470
470
|
inFrontOfText: k.WRAP_NONE,
|
|
471
471
|
behindText: k.WRAP_NONE
|
|
472
472
|
};
|
|
473
|
-
function
|
|
473
|
+
function mn(i, e, t, n, r, o, s) {
|
|
474
474
|
var f, h;
|
|
475
475
|
const c = new _t(), d = $.getInstance(), a = [], g = o.getSelfOrHeaderFooterModel(e).getBody(), u = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
476
476
|
if (g == null || u == null)
|
|
@@ -547,7 +547,7 @@ function pn(i, e, t, n, r, o, s) {
|
|
|
547
547
|
return a;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const
|
|
550
|
+
const wn = {
|
|
551
551
|
id: "doc.command.update-doc-drawing-wrapping-style",
|
|
552
552
|
type: q.COMMAND,
|
|
553
553
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
@@ -633,7 +633,7 @@ const mn = {
|
|
|
633
633
|
const M = o.syncExecuteCommand(C.id, C.params);
|
|
634
634
|
return h.refreshControls(), !!M;
|
|
635
635
|
}
|
|
636
|
-
},
|
|
636
|
+
}, vn = {
|
|
637
637
|
id: "doc.command.update-doc-drawing-distance",
|
|
638
638
|
type: q.COMMAND,
|
|
639
639
|
handler: (i, e) => {
|
|
@@ -663,7 +663,7 @@ const mn = {
|
|
|
663
663
|
};
|
|
664
664
|
return u.params.actions = a.reduce((f, h) => $.compose(f, h), null), !!t.syncExecuteCommand(u.id, u.params);
|
|
665
665
|
}
|
|
666
|
-
},
|
|
666
|
+
}, In = {
|
|
667
667
|
id: "doc.command.update-doc-drawing-wrap-text",
|
|
668
668
|
type: q.COMMAND,
|
|
669
669
|
handler: (i, e) => {
|
|
@@ -705,7 +705,7 @@ const mn = {
|
|
|
705
705
|
const { drawings: a, unitId: g } = e, u = $.getInstance(), l = [], { drawings: f = {} } = d.getSnapshot();
|
|
706
706
|
for (const p of a) {
|
|
707
707
|
const { drawingId: w, key: D, value: S } = p, O = f[w].docTransform[D];
|
|
708
|
-
if (!
|
|
708
|
+
if (!Pe.diffValue(O, S)) {
|
|
709
709
|
const C = u.replaceOp(["drawings", w, "docTransform", D], O, S);
|
|
710
710
|
l.push(C);
|
|
711
711
|
}
|
|
@@ -723,14 +723,14 @@ const mn = {
|
|
|
723
723
|
const m = t.syncExecuteCommand(h.id, h.params);
|
|
724
724
|
return c.refreshControls(), !!m;
|
|
725
725
|
}
|
|
726
|
-
},
|
|
726
|
+
}, _n = {
|
|
727
727
|
id: "doc.command.move-inline-drawing",
|
|
728
728
|
type: q.COMMAND,
|
|
729
729
|
handler: (i, e) => {
|
|
730
730
|
var L, R;
|
|
731
731
|
if (e == null)
|
|
732
732
|
return !1;
|
|
733
|
-
const t = i.get(Q), n = (L = t.getRenderById(e.unitId)) == null ? void 0 : L.with(
|
|
733
|
+
const t = i.get(Q), n = (L = t.getRenderById(e.unitId)) == null ? void 0 : L.with(Me), r = i.get(ut), o = t.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, c = o == null ? void 0 : o.with(te).getSkeleton();
|
|
734
734
|
if (s == null || n == null)
|
|
735
735
|
return !1;
|
|
736
736
|
const d = s.getTransformerByCreate(), a = i.get(j), u = i.get(z).getCurrentUniverDocInstance();
|
|
@@ -739,7 +739,7 @@ const mn = {
|
|
|
739
739
|
const { drawing: l, unitId: f, offset: h, segmentId: m, segmentPage: p, needRefreshDrawings: w } = e;
|
|
740
740
|
if (w)
|
|
741
741
|
return r.refreshDrawings(c), d.refreshControls(), !0;
|
|
742
|
-
const D = [], { drawingId: S } = l, O = (R = n.getSegment()) != null ? R : "", C =
|
|
742
|
+
const D = [], { drawingId: S } = l, O = (R = n.getSegment()) != null ? R : "", C = mn(
|
|
743
743
|
m,
|
|
744
744
|
O,
|
|
745
745
|
p,
|
|
@@ -763,7 +763,7 @@ const mn = {
|
|
|
763
763
|
const A = a.syncExecuteCommand(M.id, M.params);
|
|
764
764
|
return d.refreshControls(), !!A;
|
|
765
765
|
}
|
|
766
|
-
},
|
|
766
|
+
}, Sn = {
|
|
767
767
|
id: "doc.command.transform-non-inline-drawing",
|
|
768
768
|
type: q.COMMAND,
|
|
769
769
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -771,13 +771,13 @@ const mn = {
|
|
|
771
771
|
var x, H;
|
|
772
772
|
if (e == null)
|
|
773
773
|
return !1;
|
|
774
|
-
const t = i.get(Q), n = (x = t.getRenderById(e.unitId)) == null ? void 0 : x.with(
|
|
774
|
+
const t = i.get(Q), n = (x = t.getRenderById(e.unitId)) == null ? void 0 : x.with(Me), r = t.getRenderById(e.unitId), o = r == null ? void 0 : r.scene;
|
|
775
775
|
if (o == null || n == null)
|
|
776
776
|
return !1;
|
|
777
777
|
const s = o.getTransformerByCreate(), c = i.get(j), a = i.get(z).getCurrentUniverDocInstance();
|
|
778
778
|
if (a == null)
|
|
779
779
|
return !1;
|
|
780
|
-
const { drawing: g, unitId: u, offset: l, docTransform: f, segmentId: h, segmentPage: m } = e, p = [], { drawingId: w } = g, D = (H = n.getSegment()) != null ? H : "", S =
|
|
780
|
+
const { drawing: g, unitId: u, offset: l, docTransform: f, segmentId: h, segmentPage: m } = e, p = [], { drawingId: w } = g, D = (H = n.getSegment()) != null ? H : "", S = mn(
|
|
781
781
|
h,
|
|
782
782
|
D,
|
|
783
783
|
m,
|
|
@@ -790,19 +790,19 @@ const mn = {
|
|
|
790
790
|
return !1;
|
|
791
791
|
S.length > 0 && p.push(...S);
|
|
792
792
|
const O = $.getInstance(), { drawings: C = {} } = a.getSnapshot(), M = C[w].docTransform, { positionH: A, positionV: L, size: R, angle: v } = M;
|
|
793
|
-
if (!
|
|
793
|
+
if (!Pe.diffValue(A, f.positionH)) {
|
|
794
794
|
const I = O.replaceOp(["drawings", w, "docTransform", "positionH"], A, f.positionH);
|
|
795
795
|
p.push(I);
|
|
796
796
|
}
|
|
797
|
-
if (!
|
|
797
|
+
if (!Pe.diffValue(L, f.positionV)) {
|
|
798
798
|
const I = O.replaceOp(["drawings", w, "docTransform", "positionV"], L, f.positionV);
|
|
799
799
|
p.push(I);
|
|
800
800
|
}
|
|
801
|
-
if (!
|
|
801
|
+
if (!Pe.diffValue(R, f.size)) {
|
|
802
802
|
const I = O.replaceOp(["drawings", w, "docTransform", "size"], R, f.size);
|
|
803
803
|
p.push(I);
|
|
804
804
|
}
|
|
805
|
-
if (!
|
|
805
|
+
if (!Pe.diffValue(v, f.angle)) {
|
|
806
806
|
const I = O.replaceOp(["drawings", w, "docTransform", "angle"], v, f.angle);
|
|
807
807
|
p.push(I);
|
|
808
808
|
}
|
|
@@ -860,7 +860,7 @@ const mn = {
|
|
|
860
860
|
(o = (r = t.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || o.debounceRefreshControls();
|
|
861
861
|
}), !0;
|
|
862
862
|
}
|
|
863
|
-
},
|
|
863
|
+
}, Dn = "COMPONENT_DOC_DRAWING_PANEL", On = {
|
|
864
864
|
id: "sidebar.operation.doc-image",
|
|
865
865
|
type: q.COMMAND,
|
|
866
866
|
handler: async (i, e) => {
|
|
@@ -869,7 +869,7 @@ const mn = {
|
|
|
869
869
|
case "open":
|
|
870
870
|
t.open({
|
|
871
871
|
header: { title: n.t("docImage.panel.title") },
|
|
872
|
-
children: { label:
|
|
872
|
+
children: { label: Dn },
|
|
873
873
|
onClose: () => {
|
|
874
874
|
r.focusDrawing(null);
|
|
875
875
|
},
|
|
@@ -883,12 +883,12 @@ const mn = {
|
|
|
883
883
|
}
|
|
884
884
|
return !0;
|
|
885
885
|
}
|
|
886
|
-
},
|
|
886
|
+
}, Tn = {
|
|
887
887
|
id: "doc.operation.edit-doc-image",
|
|
888
888
|
type: q.OPERATION,
|
|
889
889
|
handler: (i, e) => {
|
|
890
890
|
const t = i.get(fe), n = i.get(j);
|
|
891
|
-
return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(
|
|
891
|
+
return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(On.id, { value: "open" }), !0);
|
|
892
892
|
}
|
|
893
893
|
};
|
|
894
894
|
var Wr = Object.getOwnPropertyDescriptor, Gr = (i, e, t, n) => {
|
|
@@ -896,8 +896,8 @@ var Wr = Object.getOwnPropertyDescriptor, Gr = (i, e, t, n) => {
|
|
|
896
896
|
(s = i[o]) && (r = s(r) || r);
|
|
897
897
|
return r;
|
|
898
898
|
}, Be = (i, e) => (t, n) => e(t, n, i);
|
|
899
|
-
function
|
|
900
|
-
const { top: r, left: o, bottom: s, right: c } = i, d = c - o, a = s - r, g = e.getViewport(
|
|
899
|
+
function yn(i, e, t = 1, n = 0) {
|
|
900
|
+
const { top: r, left: o, bottom: s, right: c } = i, d = c - o, a = s - r, g = e.getViewport(tn.VIEW_MAIN), { viewportScrollX: u, viewportScrollY: l } = g, { scaleX: f, scaleY: h } = e.getAncestorScale();
|
|
901
901
|
return {
|
|
902
902
|
startX: (o - u) * f,
|
|
903
903
|
startY: (r - l) * h,
|
|
@@ -915,7 +915,7 @@ function Tn(i, e, t = 1, n = 0) {
|
|
|
915
915
|
}
|
|
916
916
|
function wt(i, e) {
|
|
917
917
|
const { top: t, left: n, width: r, height: o, angle: s, opacity: c } = i;
|
|
918
|
-
return
|
|
918
|
+
return yn({ top: t, left: n, bottom: t + o, right: n + r }, e.scene, c, s);
|
|
919
919
|
}
|
|
920
920
|
let it = class extends Ne {
|
|
921
921
|
constructor(e, t, n, r, o, s) {
|
|
@@ -966,7 +966,7 @@ let it = class extends Ne {
|
|
|
966
966
|
if (!(c == null || c.length === 0))
|
|
967
967
|
for (const d of c) {
|
|
968
968
|
this._addHoverForRect(d);
|
|
969
|
-
const a = new
|
|
969
|
+
const a = new Ln(), g = wt(d, o.renderUnit), u = new Ot(g), l = o.canvas, f = s.data, h = {
|
|
970
970
|
dispose: a,
|
|
971
971
|
rect: d,
|
|
972
972
|
position$: u,
|
|
@@ -1044,7 +1044,7 @@ let it = class extends Ne {
|
|
|
1044
1044
|
return r ? { render: r, unitId: n } : null;
|
|
1045
1045
|
}),
|
|
1046
1046
|
Mr(
|
|
1047
|
-
(t) => t ? Zt(t.render.scene.getViewport(
|
|
1047
|
+
(t) => t ? Zt(t.render.scene.getViewport(tn.VIEW_MAIN).onScrollAfter$).pipe(Ht(() => ({ unitId: t.unitId }))) : br(null)
|
|
1048
1048
|
)
|
|
1049
1049
|
).subscribe((t) => {
|
|
1050
1050
|
if (!t) return;
|
|
@@ -1052,7 +1052,7 @@ let it = class extends Ne {
|
|
|
1052
1052
|
e(n);
|
|
1053
1053
|
})
|
|
1054
1054
|
), this.disposeWithMe(this._commandService.onCommandExecuted((t) => {
|
|
1055
|
-
if (t.id ===
|
|
1055
|
+
if (t.id === nn.id) {
|
|
1056
1056
|
const n = t.params, { unitId: r } = n;
|
|
1057
1057
|
e(r);
|
|
1058
1058
|
}
|
|
@@ -1080,7 +1080,7 @@ let it = class extends Ne {
|
|
|
1080
1080
|
posOffset: 0
|
|
1081
1081
|
},
|
|
1082
1082
|
angle: 0
|
|
1083
|
-
}, f = (w = t.drawingId) != null ? w :
|
|
1083
|
+
}, f = (w = t.drawingId) != null ? w : Qt(), h = {
|
|
1084
1084
|
unitId: n.getUnitId(),
|
|
1085
1085
|
drawings: [
|
|
1086
1086
|
{
|
|
@@ -1093,7 +1093,7 @@ let it = class extends Ne {
|
|
|
1093
1093
|
description: "",
|
|
1094
1094
|
docTransform: l,
|
|
1095
1095
|
layoutType: k.INLINE,
|
|
1096
|
-
transform:
|
|
1096
|
+
transform: en(l)
|
|
1097
1097
|
}
|
|
1098
1098
|
]
|
|
1099
1099
|
};
|
|
@@ -1103,7 +1103,7 @@ let it = class extends Ne {
|
|
|
1103
1103
|
it = Gr([
|
|
1104
1104
|
Be(0, Q),
|
|
1105
1105
|
Be(1, fe),
|
|
1106
|
-
Be(2, Z(
|
|
1106
|
+
Be(2, Z(gn)),
|
|
1107
1107
|
Be(3, Z(Ir)),
|
|
1108
1108
|
Be(4, z),
|
|
1109
1109
|
Be(5, j)
|
|
@@ -1166,7 +1166,7 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1166
1166
|
value: E
|
|
1167
1167
|
}))
|
|
1168
1168
|
});
|
|
1169
|
-
const B = (b = r.getRenderById(d)) == null ? void 0 : b.with(
|
|
1169
|
+
const B = (b = r.getRenderById(d)) == null ? void 0 : b.with(Me);
|
|
1170
1170
|
B && B.blur(), f.refreshControls();
|
|
1171
1171
|
}
|
|
1172
1172
|
function N(_) {
|
|
@@ -1182,19 +1182,19 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1182
1182
|
const K = (re = r.getRenderById(P)) == null ? void 0 : re.with(te).getSkeleton(), se = K == null ? void 0 : K.getSkeletonData();
|
|
1183
1183
|
if (se == null)
|
|
1184
1184
|
return;
|
|
1185
|
-
const { pages: Le, skeHeaders:
|
|
1185
|
+
const { pages: Le, skeHeaders: be, skeFooters: Ge } = se;
|
|
1186
1186
|
for (const ce of Le) {
|
|
1187
|
-
const { marginLeft: De, skeDrawings: Oe, headerId:
|
|
1187
|
+
const { marginLeft: De, skeDrawings: Oe, headerId: Ce, footerId: Ee, pageWidth: Te } = ce;
|
|
1188
1188
|
if (Oe.has(b)) {
|
|
1189
1189
|
V = Oe.get(b), F = De;
|
|
1190
1190
|
break;
|
|
1191
1191
|
}
|
|
1192
|
-
const de = (Ie =
|
|
1192
|
+
const de = (Ie = be.get(Ce)) == null ? void 0 : Ie.get(Te);
|
|
1193
1193
|
if (de != null && de.skeDrawings.has(b)) {
|
|
1194
1194
|
V = de == null ? void 0 : de.skeDrawings.get(b), F = De;
|
|
1195
1195
|
break;
|
|
1196
1196
|
}
|
|
1197
|
-
const ge = (_e = Ge.get(
|
|
1197
|
+
const ge = (_e = Ge.get(Ee)) == null ? void 0 : _e.get(Te);
|
|
1198
1198
|
if (ge != null && ge.skeDrawings.has(b)) {
|
|
1199
1199
|
V = ge == null ? void 0 : ge.skeDrawings.get(b), F = De;
|
|
1200
1200
|
break;
|
|
@@ -1211,17 +1211,17 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1211
1211
|
v("positionH", ne);
|
|
1212
1212
|
}
|
|
1213
1213
|
function G(_) {
|
|
1214
|
-
var Oe,
|
|
1214
|
+
var Oe, Ce, Ee, Te, de, ge;
|
|
1215
1215
|
const E = O.relativeFrom, T = O.posOffset, U = Number(_);
|
|
1216
1216
|
if (E === U)
|
|
1217
1217
|
return;
|
|
1218
1218
|
const B = n.getFocusDrawings();
|
|
1219
1219
|
if (B.length === 0)
|
|
1220
1220
|
return;
|
|
1221
|
-
const { drawingId: b, unitId: P } = B[0], V = o.getUniverDocInstance(P), F = (Oe = r.getRenderById(P)) == null ? void 0 : Oe.with(te).getSkeleton(), K = (
|
|
1222
|
-
if (
|
|
1221
|
+
const { drawingId: b, unitId: P } = B[0], V = o.getUniverDocInstance(P), F = (Oe = r.getRenderById(P)) == null ? void 0 : Oe.with(te).getSkeleton(), K = (Ce = r.getRenderById(P)) == null ? void 0 : Ce.with(Me), se = K == null ? void 0 : K.getSegment(), Le = K == null ? void 0 : K.getSegmentPage(), be = (Te = (Ee = V == null ? void 0 : V.getSelfOrHeaderFooterModel(se).getBody()) == null ? void 0 : Ee.customBlocks) == null ? void 0 : Te.find((Re) => Re.blockId === b);
|
|
1222
|
+
if (be == null || F == null || K == null)
|
|
1223
1223
|
return;
|
|
1224
|
-
const { startIndex: Ge } =
|
|
1224
|
+
const { startIndex: Ge } = be, ae = F.findNodeByCharIndex(Ge, se, Le), ne = (de = ae == null ? void 0 : ae.parent) == null ? void 0 : de.parent, re = ne == null ? void 0 : ne.parent, Ie = re == null ? void 0 : re.lines.find((Re) => Re.paragraphIndex === (ne == null ? void 0 : ne.paragraphIndex) && Re.paragraphStart), _e = (ge = re == null ? void 0 : re.parent) == null ? void 0 : ge.parent;
|
|
1225
1225
|
if (ae == null || ne == null || Ie == null || re == null || _e == null)
|
|
1226
1226
|
return;
|
|
1227
1227
|
let ce = 0;
|
|
@@ -1267,7 +1267,7 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1267
1267
|
}, []), /* @__PURE__ */ X(
|
|
1268
1268
|
"div",
|
|
1269
1269
|
{
|
|
1270
|
-
className:
|
|
1270
|
+
className: on("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
|
|
1271
1271
|
"univer-hidden": !L
|
|
1272
1272
|
}),
|
|
1273
1273
|
children: [
|
|
@@ -1412,7 +1412,7 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1412
1412
|
subUnitId: b,
|
|
1413
1413
|
drawingId: P
|
|
1414
1414
|
}));
|
|
1415
|
-
e.executeCommand(
|
|
1415
|
+
e.executeCommand(wn.id, {
|
|
1416
1416
|
unitId: E,
|
|
1417
1417
|
subUnitId: T,
|
|
1418
1418
|
drawings: U,
|
|
@@ -1429,7 +1429,7 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1429
1429
|
subUnitId: T.subUnitId,
|
|
1430
1430
|
drawingId: T.drawingId
|
|
1431
1431
|
}));
|
|
1432
|
-
e.executeCommand(
|
|
1432
|
+
e.executeCommand(In.id, {
|
|
1433
1433
|
unitId: _[0].unitId,
|
|
1434
1434
|
subUnitId: _[0].unitId,
|
|
1435
1435
|
drawings: E,
|
|
@@ -1449,7 +1449,7 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1449
1449
|
subUnitId: B.subUnitId,
|
|
1450
1450
|
drawingId: B.drawingId
|
|
1451
1451
|
}));
|
|
1452
|
-
e.executeCommand(
|
|
1452
|
+
e.executeCommand(vn.id, {
|
|
1453
1453
|
unitId: T[0].unitId,
|
|
1454
1454
|
subUnitId: T[0].unitId,
|
|
1455
1455
|
drawings: U,
|
|
@@ -1515,7 +1515,7 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1515
1515
|
}, []), /* @__PURE__ */ X(
|
|
1516
1516
|
"div",
|
|
1517
1517
|
{
|
|
1518
|
-
className:
|
|
1518
|
+
className: on("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
|
|
1519
1519
|
"univer-hidden": !L
|
|
1520
1520
|
}),
|
|
1521
1521
|
children: [
|
|
@@ -1656,7 +1656,7 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1656
1656
|
/* @__PURE__ */ y(Vr, { drawings: t }),
|
|
1657
1657
|
/* @__PURE__ */ y(jr, { drawings: t })
|
|
1658
1658
|
] });
|
|
1659
|
-
},
|
|
1659
|
+
}, Mn = "doc.menu.image", bn = pn.id, zr = (i) => {
|
|
1660
1660
|
const e = i.get(Dt), t = i.get(z);
|
|
1661
1661
|
return new Cr((n) => {
|
|
1662
1662
|
const r = e.textSelection$.subscribe(() => {
|
|
@@ -1682,28 +1682,28 @@ const Hr = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, jr = (i) => {
|
|
|
1682
1682
|
};
|
|
1683
1683
|
function Xr(i) {
|
|
1684
1684
|
return {
|
|
1685
|
-
id:
|
|
1686
|
-
type:
|
|
1685
|
+
id: Mn,
|
|
1686
|
+
type: an.SUBITEMS,
|
|
1687
1687
|
icon: "AddImageIcon",
|
|
1688
1688
|
tooltip: "docImage.title",
|
|
1689
1689
|
disabled$: zr(i),
|
|
1690
|
-
hidden$:
|
|
1690
|
+
hidden$: sn(i, we.UNIVER_DOC, void 0, St)
|
|
1691
1691
|
};
|
|
1692
1692
|
}
|
|
1693
1693
|
function qr(i) {
|
|
1694
1694
|
return {
|
|
1695
|
-
id:
|
|
1695
|
+
id: bn,
|
|
1696
1696
|
title: "docImage.upload.float",
|
|
1697
|
-
type:
|
|
1698
|
-
hidden$:
|
|
1697
|
+
type: an.BUTTON,
|
|
1698
|
+
hidden$: sn(i, we.UNIVER_DOC, void 0, St)
|
|
1699
1699
|
};
|
|
1700
1700
|
}
|
|
1701
1701
|
const Kr = {
|
|
1702
1702
|
[_r.MEDIA]: {
|
|
1703
|
-
[
|
|
1703
|
+
[Mn]: {
|
|
1704
1704
|
order: 0,
|
|
1705
1705
|
menuItemFactory: Xr,
|
|
1706
|
-
[
|
|
1706
|
+
[bn]: {
|
|
1707
1707
|
order: 0,
|
|
1708
1708
|
menuItemFactory: qr
|
|
1709
1709
|
}
|
|
@@ -1754,7 +1754,7 @@ const Yr = {
|
|
|
1754
1754
|
direction: he.RIGHT
|
|
1755
1755
|
}
|
|
1756
1756
|
}, ei = {
|
|
1757
|
-
id:
|
|
1757
|
+
id: ln.id,
|
|
1758
1758
|
description: "shortcut.drawing-delete",
|
|
1759
1759
|
group: "4_drawing-view",
|
|
1760
1760
|
// when focusing on any other input tag do not trigger this shortcut
|
|
@@ -1773,30 +1773,30 @@ let ot = class extends Ne {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
_initCustomComponents() {
|
|
1775
1775
|
const i = this._componentManager;
|
|
1776
|
-
this.disposeWithMe(i.register(
|
|
1776
|
+
this.disposeWithMe(i.register(Dn, $r));
|
|
1777
1777
|
}
|
|
1778
1778
|
_initMenus() {
|
|
1779
1779
|
this._menuManagerService.mergeMenu(Kr);
|
|
1780
1780
|
}
|
|
1781
1781
|
_initCommands() {
|
|
1782
1782
|
[
|
|
1783
|
-
|
|
1783
|
+
pn,
|
|
1784
1784
|
Mt,
|
|
1785
|
-
mn,
|
|
1786
1785
|
wn,
|
|
1787
1786
|
vn,
|
|
1788
|
-
qe,
|
|
1789
1787
|
In,
|
|
1788
|
+
qe,
|
|
1790
1789
|
_n,
|
|
1790
|
+
Sn,
|
|
1791
1791
|
yt,
|
|
1792
|
-
Dn,
|
|
1793
|
-
kr,
|
|
1794
1792
|
On,
|
|
1795
|
-
|
|
1796
|
-
|
|
1793
|
+
kr,
|
|
1794
|
+
Tn,
|
|
1795
|
+
un,
|
|
1796
|
+
fn,
|
|
1797
1797
|
Ke,
|
|
1798
|
-
|
|
1799
|
-
|
|
1798
|
+
ln,
|
|
1799
|
+
hn
|
|
1800
1800
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
1801
1801
|
}
|
|
1802
1802
|
_initShortcuts() {
|
|
@@ -1816,7 +1816,7 @@ let ot = class extends Ne {
|
|
|
1816
1816
|
}
|
|
1817
1817
|
};
|
|
1818
1818
|
ot = ni([
|
|
1819
|
-
et(0, Z(
|
|
1819
|
+
et(0, Z(cn)),
|
|
1820
1820
|
et(1, Sr),
|
|
1821
1821
|
et(2, j),
|
|
1822
1822
|
et(3, Dr)
|
|
@@ -1941,7 +1941,7 @@ st = ii([
|
|
|
1941
1941
|
], st);
|
|
1942
1942
|
const ai = (i) => {
|
|
1943
1943
|
const { floatDomInfos: e, scene: t, offset: n, bound: r } = i, o = r.right - r.left, s = r.bottom - r.top, c = Ur(() => e.map((d) => {
|
|
1944
|
-
const { width: a = 0, height: g = 0, left: u = 0, top: l = 0 } = d.transform, h =
|
|
1944
|
+
const { width: a = 0, height: g = 0, left: u = 0, top: l = 0 } = d.transform, h = yn(
|
|
1945
1945
|
{
|
|
1946
1946
|
left: u,
|
|
1947
1947
|
right: u + a,
|
|
@@ -2043,10 +2043,10 @@ let at = class extends Ne {
|
|
|
2043
2043
|
};
|
|
2044
2044
|
at = di([
|
|
2045
2045
|
Ve(0, Z(Yn)),
|
|
2046
|
-
Ve(1, Z(
|
|
2046
|
+
Ve(1, Z(gn)),
|
|
2047
2047
|
Ve(2, fe),
|
|
2048
|
-
Ve(3, Z(
|
|
2049
|
-
Ve(4, Z(
|
|
2048
|
+
Ve(3, Z(cn)),
|
|
2049
|
+
Ve(4, Z(Jt))
|
|
2050
2050
|
], at);
|
|
2051
2051
|
var gi = Object.getOwnPropertyDescriptor, li = (i, e, t, n) => {
|
|
2052
2052
|
for (var r = n > 1 ? void 0 : n ? gi(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
@@ -2061,7 +2061,7 @@ function qt(i) {
|
|
|
2061
2061
|
let ct = class extends Ne {
|
|
2062
2062
|
constructor(e, t, n, r) {
|
|
2063
2063
|
super();
|
|
2064
|
-
ve(this, "_liquid", new
|
|
2064
|
+
ve(this, "_liquid", new rn());
|
|
2065
2065
|
ve(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
|
|
2066
2066
|
// Use to cache the drawings is under transforming or scaling.
|
|
2067
2067
|
ve(this, "_transformerCache", /* @__PURE__ */ new Map());
|
|
@@ -2242,7 +2242,7 @@ let ct = class extends Ne {
|
|
|
2242
2242
|
const w = 0.5, D = this._getTransformCoordForDocumentOffset(d, a, t, n);
|
|
2243
2243
|
if (D == null)
|
|
2244
2244
|
return;
|
|
2245
|
-
const S = (x = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : x.with(
|
|
2245
|
+
const S = (x = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : x.with(Me);
|
|
2246
2246
|
if (S == null)
|
|
2247
2247
|
return;
|
|
2248
2248
|
const O = o == null ? void 0 : o.findNodeByCoord(D, g, u, l, {
|
|
@@ -2268,7 +2268,7 @@ let ct = class extends Ne {
|
|
|
2268
2268
|
}
|
|
2269
2269
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2270
2270
|
_getDrawingAnchor(e, t) {
|
|
2271
|
-
var Ie, _e, ce, De, Oe,
|
|
2271
|
+
var Ie, _e, ce, De, Oe, Ce, Ee, Te, de, ge, Re;
|
|
2272
2272
|
const n = this._renderManagerService.getRenderById(e.unitId), r = n == null ? void 0 : n.with(te).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
|
|
2273
2273
|
if (o == null || n == null)
|
|
2274
2274
|
return;
|
|
@@ -2287,7 +2287,7 @@ let ct = class extends Ne {
|
|
|
2287
2287
|
}, { x: _, y: E } = g.getViewportScrollXY(l), T = this._getTransformCoordForDocumentOffset(u, l, D - _, S - E);
|
|
2288
2288
|
if (T == null)
|
|
2289
2289
|
return;
|
|
2290
|
-
const U = (Ie = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : Ie.with(
|
|
2290
|
+
const U = (Ie = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : Ie.with(Me);
|
|
2291
2291
|
if (U == null)
|
|
2292
2292
|
return;
|
|
2293
2293
|
const B = r == null ? void 0 : r.findNodeByCoord(T, f, h, m, {
|
|
@@ -2307,8 +2307,8 @@ let ct = class extends Ne {
|
|
|
2307
2307
|
this._liquid.reset();
|
|
2308
2308
|
const K = F.type;
|
|
2309
2309
|
for (const pe of s) {
|
|
2310
|
-
const { headerId: ht, footerId: ft, pageHeight:
|
|
2311
|
-
if (x > -1 &&
|
|
2310
|
+
const { headerId: ht, footerId: ft, pageHeight: En, pageWidth: bt, marginLeft: Ct, marginBottom: Rn } = pe, An = s.indexOf(pe);
|
|
2311
|
+
if (x > -1 && An === x) {
|
|
2312
2312
|
switch (K) {
|
|
2313
2313
|
case Ut.HEADER: {
|
|
2314
2314
|
const He = (Oe = c.get(ht)) == null ? void 0 : Oe.get(bt);
|
|
@@ -2322,10 +2322,10 @@ let ct = class extends Ne {
|
|
|
2322
2322
|
break;
|
|
2323
2323
|
}
|
|
2324
2324
|
case Ut.FOOTER: {
|
|
2325
|
-
const He = (
|
|
2325
|
+
const He = (Ce = d.get(ft)) == null ? void 0 : Ce.get(bt);
|
|
2326
2326
|
if (He)
|
|
2327
2327
|
this._liquid.translatePagePadding({
|
|
2328
|
-
marginTop:
|
|
2328
|
+
marginTop: En - Rn + He.marginTop,
|
|
2329
2329
|
marginLeft: Ct
|
|
2330
2330
|
});
|
|
2331
2331
|
else
|
|
@@ -2339,7 +2339,7 @@ let ct = class extends Ne {
|
|
|
2339
2339
|
break;
|
|
2340
2340
|
this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, f, h, m);
|
|
2341
2341
|
}
|
|
2342
|
-
switch (A.relativeFrom === W.LINE ? N = b.divides[0].glyphGroup[0] : N = (ge = (de = (Te = (
|
|
2342
|
+
switch (A.relativeFrom === W.LINE ? N = b.divides[0].glyphGroup[0] : N = (ge = (de = (Te = (Ee = V.divides) == null ? void 0 : Ee[0]) == null ? void 0 : Te.glyphGroup) == null ? void 0 : de[0]) != null ? ge : N, I.positionH = {
|
|
2343
2343
|
relativeFrom: L.relativeFrom,
|
|
2344
2344
|
posOffset: D - this._liquid.x - p
|
|
2345
2345
|
}, L.relativeFrom) {
|
|
@@ -2374,10 +2374,10 @@ let ct = class extends Ne {
|
|
|
2374
2374
|
const se = r == null ? void 0 : r.findPositionByGlyph(N, x), Le = this._getDocObject();
|
|
2375
2375
|
if (se == null || r == null || Le == null || qt(se))
|
|
2376
2376
|
return;
|
|
2377
|
-
const
|
|
2377
|
+
const be = {
|
|
2378
2378
|
...se,
|
|
2379
2379
|
isBack: H
|
|
2380
|
-
}, Ge = Le.document.getOffsetConfig(), ae = new At(Ge, r), { cursorList: ne } = ae.getRangePointData(
|
|
2380
|
+
}, Ge = Le.document.getOffsetConfig(), ae = new At(Ge, r), { cursorList: ne } = ae.getRangePointData(be, be), { startOffset: re } = (Re = Pt(ne)) != null ? Re : {};
|
|
2381
2381
|
if (re != null)
|
|
2382
2382
|
return { offset: re, docTransform: I, segmentId: G, segmentPage: x };
|
|
2383
2383
|
}
|
|
@@ -2406,7 +2406,7 @@ let ct = class extends Ne {
|
|
|
2406
2406
|
// Update inline drawing when use transformer to move it.
|
|
2407
2407
|
_moveInlineDrawing(e, t, n) {
|
|
2408
2408
|
const r = this._getInlineDrawingAnchor(e, t, n), { offset: o, segmentId: s, segmentPage: c } = r != null ? r : {};
|
|
2409
|
-
return this._commandService.executeCommand(
|
|
2409
|
+
return this._commandService.executeCommand(_n.id, {
|
|
2410
2410
|
unitId: e.unitId,
|
|
2411
2411
|
subUnitId: e.unitId,
|
|
2412
2412
|
drawing: e,
|
|
@@ -2435,7 +2435,7 @@ let ct = class extends Ne {
|
|
|
2435
2435
|
const { marginBottom: O, pageHeight: C } = S, M = u.indexOf(S), A = u[M + 1];
|
|
2436
2436
|
if (A == null)
|
|
2437
2437
|
continue;
|
|
2438
|
-
if (
|
|
2438
|
+
if (Pe.hasIntersectionBetweenTwoRanges(
|
|
2439
2439
|
o,
|
|
2440
2440
|
o + c,
|
|
2441
2441
|
this._liquid.y + h + C - O,
|
|
@@ -2459,7 +2459,7 @@ let ct = class extends Ne {
|
|
|
2459
2459
|
if (n && r.top !== t.top)
|
|
2460
2460
|
return;
|
|
2461
2461
|
const o = this._getDrawingAnchor(e, r), { offset: s, docTransform: c, segmentId: d, segmentPage: a } = o != null ? o : {};
|
|
2462
|
-
return s == null || c == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, t]])) : this._commandService.executeCommand(
|
|
2462
|
+
return s == null || c == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, t]])) : this._commandService.executeCommand(Sn.id, {
|
|
2463
2463
|
unitId: e.unitId,
|
|
2464
2464
|
subUnitId: e.unitId,
|
|
2465
2465
|
drawing: e,
|
|
@@ -2495,7 +2495,7 @@ let ct = class extends Ne {
|
|
|
2495
2495
|
this._anchorShape.transformByState({ left: f, top: h, height: l }), this._anchorShape.show();
|
|
2496
2496
|
return;
|
|
2497
2497
|
}
|
|
2498
|
-
const m = 6, p = new ir(ui +
|
|
2498
|
+
const m = 6, p = new ir(ui + Qt(m), {
|
|
2499
2499
|
left: f,
|
|
2500
2500
|
top: h,
|
|
2501
2501
|
height: l,
|
|
@@ -2642,7 +2642,7 @@ let dt = class extends Hn {
|
|
|
2642
2642
|
{
|
|
2643
2643
|
label: "image-popup.edit",
|
|
2644
2644
|
index: 0,
|
|
2645
|
-
commandId:
|
|
2645
|
+
commandId: Tn.id,
|
|
2646
2646
|
commandParams: { unitId: e, subUnitId: t, drawingId: n },
|
|
2647
2647
|
// disable: !!SHEET_EDITOR_UNITS.includes(unitId) || drawingType === DrawingTypeEnum.DRAWING_DOM,
|
|
2648
2648
|
disable: !0
|
|
@@ -2684,11 +2684,11 @@ var pi = Object.getOwnPropertyDescriptor, mi = (i, e, t, n) => {
|
|
|
2684
2684
|
for (var r = n > 1 ? void 0 : n ? pi(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2685
2685
|
(s = i[o]) && (r = s(r) || r);
|
|
2686
2686
|
return r;
|
|
2687
|
-
},
|
|
2687
|
+
}, Ae = (i, e) => (t, n) => e(t, n, i);
|
|
2688
2688
|
let It = class extends Ne {
|
|
2689
2689
|
constructor(e, t, n, r, o, s, c, d) {
|
|
2690
2690
|
super();
|
|
2691
|
-
ve(this, "_liquid", new
|
|
2691
|
+
ve(this, "_liquid", new rn());
|
|
2692
2692
|
this._context = e, this._docSkeletonManagerService = t, this._commandService = n, this._editorService = r, this._drawingManagerService = o, this._docRefreshDrawingsService = s, this._univerInstanceService = c, this._lifecycleService = d, this._initialize(), this._commandExecutedListener();
|
|
2693
2693
|
}
|
|
2694
2694
|
_initialize() {
|
|
@@ -2702,7 +2702,7 @@ let It = class extends Ne {
|
|
|
2702
2702
|
});
|
|
2703
2703
|
}
|
|
2704
2704
|
_commandExecutedListener() {
|
|
2705
|
-
const e = [ee.id,
|
|
2705
|
+
const e = [ee.id, nn.id];
|
|
2706
2706
|
this.disposeWithMe(
|
|
2707
2707
|
this._commandService.onCommandExecuted((t) => {
|
|
2708
2708
|
if (e.includes(t.id)) {
|
|
@@ -2725,7 +2725,7 @@ let It = class extends Ne {
|
|
|
2725
2725
|
this.disposeWithMe(
|
|
2726
2726
|
Zt(this._context.engine.onTransformChange$).pipe(
|
|
2727
2727
|
Vt((e) => e.type === sr.resize),
|
|
2728
|
-
|
|
2728
|
+
dn(16)
|
|
2729
2729
|
).subscribe(() => {
|
|
2730
2730
|
var n;
|
|
2731
2731
|
const e = this._docSkeletonManagerService.getSkeleton(), { scene: t } = this._context;
|
|
@@ -2820,19 +2820,19 @@ let It = class extends Ne {
|
|
|
2820
2820
|
}
|
|
2821
2821
|
};
|
|
2822
2822
|
It = mi([
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2823
|
+
Ae(1, Z(te)),
|
|
2824
|
+
Ae(2, j),
|
|
2825
|
+
Ae(3, tr),
|
|
2826
|
+
Ae(4, fe),
|
|
2827
|
+
Ae(5, Z(ut)),
|
|
2828
|
+
Ae(6, z),
|
|
2829
|
+
Ae(7, Z(jn))
|
|
2830
2830
|
], It);
|
|
2831
2831
|
var wi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Ii = (i, e, t) => e in i ? wi(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, _i = (i, e, t, n) => {
|
|
2832
2832
|
for (var r = n > 1 ? void 0 : n ? vi(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2833
2833
|
(s = i[o]) && (r = s(r) || r);
|
|
2834
2834
|
return r;
|
|
2835
|
-
}, vt = (i, e) => (t, n) => e(t, n, i),
|
|
2835
|
+
}, vt = (i, e) => (t, n) => e(t, n, i), Cn = (i, e, t) => Ii(i, typeof e != "symbol" ? e + "" : e, t);
|
|
2836
2836
|
const Si = "DOC_DRAWING_UI_PLUGIN";
|
|
2837
2837
|
let gt = class extends zn {
|
|
2838
2838
|
constructor(i = $t, e, t, n) {
|
|
@@ -2865,27 +2865,27 @@ let gt = class extends zn {
|
|
|
2865
2865
|
this._injector.get(dt), this._injector.get(it);
|
|
2866
2866
|
}
|
|
2867
2867
|
};
|
|
2868
|
-
|
|
2869
|
-
|
|
2868
|
+
Cn(gt, "type", we.UNIVER_DOC);
|
|
2869
|
+
Cn(gt, "pluginName", Si);
|
|
2870
2870
|
gt = _i([
|
|
2871
2871
|
Vn(Nr, pr, qn, yr),
|
|
2872
|
-
vt(1, Z(
|
|
2872
|
+
vt(1, Z(Jt)),
|
|
2873
2873
|
vt(2, Q),
|
|
2874
2874
|
vt(3, $n)
|
|
2875
2875
|
], gt);
|
|
2876
2876
|
export {
|
|
2877
2877
|
kr as ClearDocDrawingTransformerOperation,
|
|
2878
|
-
|
|
2879
|
-
|
|
2878
|
+
Mn as DOCS_IMAGE_MENU_ID,
|
|
2879
|
+
ln as DeleteDocDrawingsCommand,
|
|
2880
2880
|
it as DocFloatDomController,
|
|
2881
|
-
|
|
2882
|
-
|
|
2881
|
+
Tn as EditDocDrawingOperation,
|
|
2882
|
+
un as GroupDocDrawingCommand,
|
|
2883
2883
|
Mt as InsertDocDrawingCommand,
|
|
2884
|
-
|
|
2884
|
+
pn as InsertDocImageCommand,
|
|
2885
2885
|
Ke as MoveDocDrawingsCommand,
|
|
2886
2886
|
yt as RemoveDocDrawingCommand,
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2887
|
+
hn as SetDocDrawingArrangeCommand,
|
|
2888
|
+
On as SidebarDocDrawingOperation,
|
|
2889
|
+
fn as UngroupDocDrawingCommand,
|
|
2890
2890
|
gt as UniverDocsDrawingUIPlugin
|
|
2891
2891
|
};
|