@univerjs/sheets-drawing-ui 0.9.2 → 0.9.3-nightly.202507250819
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/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/es/index.js +235 -235
- package/lib/es/locale/ca-ES.js +39 -0
- package/lib/es/locale/es-ES.js +39 -0
- package/lib/index.js +235 -235
- package/lib/locale/ca-ES.js +39 -0
- package/lib/locale/es-ES.js +39 -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 +14 -14
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var yr = Object.defineProperty;
|
|
2
2
|
var Tr = (i, t, e) => t in i ? yr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var ee = (i, t, e) => Tr(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { precisionTo as
|
|
5
|
-
import { convertPositionSheetOverGridToAbsolute as Pr, SheetSkeletonManagerService as V, ISheetSelectionRenderService as xe, attachRangeWithCoord as Yn, SheetCanvasPopManagerService as Ar, HoverManagerService as Nr, IEditorBridgeService as kr, IAutoFillService as Wr, EditingRenderController as Br, SetCellEditVisibleOperation as pn, PREDEFINED_HOOK_NAME as
|
|
6
|
-
import { CommandType as Z, ICommandService as
|
|
4
|
+
import { precisionTo as pt, IRenderManagerService as J, transformObjectOutOfGroup as Er, getGroupState as Or, getCurrentTypeOfRenderer as sn, CURSOR_TYPE as Ur, RENDER_CLASS_TYPE as Oe, Rect as Ue, ObjectType as mn, DRAWING_OBJECT_LAYER_INDEX as Ft, SHEET_VIEWPORT_KEY as xn } from "@univerjs/engine-render";
|
|
5
|
+
import { convertPositionSheetOverGridToAbsolute as Pr, SheetSkeletonManagerService as V, ISheetSelectionRenderService as xe, attachRangeWithCoord as Yn, SheetCanvasPopManagerService as Ar, HoverManagerService as Nr, IEditorBridgeService as kr, IAutoFillService as Wr, EditingRenderController as Br, SetCellEditVisibleOperation as pn, PREDEFINED_HOOK_NAME as We, COPY_TYPE as ve, discreteRangeToRange as wn, virtualizeDiscreteRanges as jr, ISheetClipboardService as $r, SetZoomRatioOperation as _n, SetScrollOperation as Fr, SheetPrintInterceptorService as xr, getCurrentRangeDisable$ as Yr } from "@univerjs/sheets-ui";
|
|
6
|
+
import { CommandType as Z, ICommandService as X, IUndoRedoService as Ye, sequenceExecute as Gn, DrawingTypeEnum as B, ArrangeTypeEnum as wt, Inject as A, IContextService as Xn, LocaleService as nt, Injector as Ge, Disposable as ne, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as Sn, ObjectRelativeFromH as vn, WrapTextType as In, PositionedObjectLayoutType as Cn, BooleanNumber as Dn, BuildTextUtils as Ht, ImageSourceType as Rn, generateRandomId as Qe, FOCUSING_COMMON_DRAWINGS as $e, IUniverInstanceService as Se, UniverInstanceType as F, Direction as _e, IImageIoService as Gr, RxDisposable as Xr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Lr, ObjectMatrix as Vr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Hr, IPermissionService as zr, UserManagerService as Kr, LifecycleService as Jr, LifecycleStages as Zr, DisposableCollection as _t, fromEventSubject as qr, Tools as je, PRINT_CHART_COMPONENT_KEY as Qr, Rectangle as ei, FOCUSING_FX_BAR_EDITOR as ti, EDITOR_ACTIVATED as ni, FOCUSING_PANEL_EDITOR as ri, DependentOn as ii, IConfigService as si, Plugin as oi, merge as ai, registerDependencies as ci, touchDependencies as xt } from "@univerjs/core";
|
|
7
7
|
import { ISheetDrawingService as re, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as di } from "@univerjs/sheets-drawing";
|
|
8
8
|
import { SheetInterceptorService as At, SheetsSelectionsService as on, SetRangeValuesCommand as bn, getSheetCommandTarget as se, INTERCEPTOR_POINT as li, InterceptCellContentPriority as ui, WorkbookViewPermission as Mn, WorksheetViewPermission as yn, WorkbookEditablePermission as zt, WorksheetEditPermission as Kt, SetFrozenMutation as hi, SetWorksheetRowAutoHeightMutation as gi, COMMAND_LISTENER_SKELETON_CHANGE as fi, InsertRowCommand as Ln, InsertColCommand as Vn, RemoveRowCommand as Hn, RemoveColCommand as zn, DeleteRangeMoveLeftCommand as Kn, DeleteRangeMoveUpCommand as Jn, InsertRangeMoveDownCommand as Zn, InsertRangeMoveRightCommand as qn, DeltaRowHeightCommand as Jt, SetRowHeightCommand as Zt, DeltaColumnWidthCommand as Qn, SetColWidthCommand as er, SetRowHiddenCommand as tr, SetSpecificRowsVisibleCommand as nr, SetSpecificColsVisibleCommand as rr, SetColHiddenCommand as ir, MoveColsCommand as sr, MoveRowsCommand as or, MoveRangeCommand as ar, SetRowVisibleMutation as mi, SetRowHiddenMutation as pi, SetColVisibleMutation as wi, SetColHiddenMutation as _i, SetWorksheetRowHeightMutation as Si, SetWorksheetColWidthMutation as vi, SetWorksheetActiveOperation as Ii, RangeProtectionPermissionEditPoint as Ci } from "@univerjs/sheets";
|
|
9
9
|
import { MessageType as pe, render as Di, unmount as Ri, clsx as bi, RadioGroup as Mi, Radio as Yt } from "@univerjs/design";
|
|
10
10
|
import { docDrawingPositionToTransform as Tn, ReplaceSnapshotCommand as yi, InnerPasteCommand as Ti } from "@univerjs/docs-ui";
|
|
11
|
-
import { IImageIoService as Ei, IDrawingManagerService as ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as En, DRAWING_IMAGE_COUNT_LIMIT as On, ImageUploadStatusType as
|
|
11
|
+
import { IImageIoService as Ei, IDrawingManagerService as ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as En, DRAWING_IMAGE_COUNT_LIMIT as On, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as Un, getImageSize as Gt, SetDrawingSelectedOperation as Nt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as An, ImageSourceType as Oi, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as Ui } from "@univerjs/drawing";
|
|
12
12
|
import { ILocalFileService as Pi, IMessageService as cr, ISidebarService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as Bi, ComponentManager as dr, connectInjector as ji, useDependency as qe, getMenuHiddenObservable as an, MenuItemType as cn, RibbonInsertGroup as $i, KeyCode as Fe, IMenuManagerService as Fi, IShortcutService as xi } from "@univerjs/ui";
|
|
13
|
-
import { DocDrawingController as Yi, UniverDocsDrawingPlugin as
|
|
14
|
-
import { ImageCropperObject as
|
|
15
|
-
import { takeUntil as Nn, throttleTime as Ji, combineLatest as
|
|
13
|
+
import { DocDrawingController as Yi, UniverDocsDrawingPlugin as Gi } from "@univerjs/docs-drawing";
|
|
14
|
+
import { ImageCropperObject as Xi, COMPONENT_IMAGE_POPUP_MENU as Li, OpenImageCropOperation as Vi, ImageResetSizeOperation as Hi, DrawingRenderService as lr, DrawingCommonPanel as zi, UniverDrawingUIPlugin as Ki } from "@univerjs/drawing-ui";
|
|
15
|
+
import { takeUntil as Nn, throttleTime as Ji, combineLatest as St, switchMap as we, EMPTY as fe, tap as kn, map as Re, distinctUntilChanged as Wn, Subject as Xt, filter as Zi, take as qi, BehaviorSubject as ke, of as Bn } from "rxjs";
|
|
16
16
|
import { jsx as oe, jsxs as qt } from "react/jsx-runtime";
|
|
17
17
|
import { useMemo as Qi, useState as Qt, useEffect as ur } from "react";
|
|
18
18
|
function z(i, t, e) {
|
|
@@ -45,17 +45,17 @@ function $(i, t) {
|
|
|
45
45
|
return;
|
|
46
46
|
const g = {
|
|
47
47
|
column: l.actualColumn,
|
|
48
|
-
columnOffset:
|
|
48
|
+
columnOffset: pt(e - l.startX, 1),
|
|
49
49
|
row: l.actualRow,
|
|
50
|
-
rowOffset:
|
|
50
|
+
rowOffset: pt(n - l.startY, 1)
|
|
51
51
|
}, h = t.getCellWithCoordByOffset(e + r, n + s);
|
|
52
52
|
if (h == null)
|
|
53
53
|
return;
|
|
54
54
|
const f = {
|
|
55
55
|
column: h.actualColumn,
|
|
56
|
-
columnOffset:
|
|
56
|
+
columnOffset: pt(e + r - h.startX, 1),
|
|
57
57
|
row: h.actualRow,
|
|
58
|
-
rowOffset:
|
|
58
|
+
rowOffset: pt(n + s - h.startY, 1)
|
|
59
59
|
};
|
|
60
60
|
return {
|
|
61
61
|
flipY: o,
|
|
@@ -77,20 +77,20 @@ const Y = {
|
|
|
77
77
|
(s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
78
78
|
}), !0;
|
|
79
79
|
}
|
|
80
|
-
},
|
|
80
|
+
}, rt = {
|
|
81
81
|
id: "sheet.command.remove-sheet-image",
|
|
82
82
|
type: Z.COMMAND,
|
|
83
83
|
handler: (i, t) => {
|
|
84
84
|
var v, I, R;
|
|
85
|
-
const e = i.get(
|
|
85
|
+
const e = i.get(X), n = i.get(Ye), r = i.get(At), s = i.get(re);
|
|
86
86
|
if (!t) return !1;
|
|
87
87
|
const { drawings: o } = t, a = [];
|
|
88
88
|
o.forEach((S) => {
|
|
89
89
|
const { unitId: C } = S;
|
|
90
90
|
a.push(C);
|
|
91
91
|
});
|
|
92
|
-
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id:
|
|
93
|
-
return
|
|
92
|
+
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: rt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
|
|
93
|
+
return Gn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
94
94
|
unitID: u,
|
|
95
95
|
undoMutations: [
|
|
96
96
|
...(I = f.preUndos) != null ? I : [],
|
|
@@ -110,7 +110,7 @@ const Y = {
|
|
|
110
110
|
id: "sheet.command.delete-drawing",
|
|
111
111
|
type: Z.COMMAND,
|
|
112
112
|
handler: (i) => {
|
|
113
|
-
const t = i.get(
|
|
113
|
+
const t = i.get(X), n = i.get(re).getFocusDrawings();
|
|
114
114
|
if (n.length === 0)
|
|
115
115
|
return !1;
|
|
116
116
|
const r = n[0].unitId, s = n.map((o) => {
|
|
@@ -122,7 +122,7 @@ const Y = {
|
|
|
122
122
|
drawingType: c
|
|
123
123
|
};
|
|
124
124
|
});
|
|
125
|
-
return t.executeCommand(
|
|
125
|
+
return t.executeCommand(rt.id, {
|
|
126
126
|
unitId: r,
|
|
127
127
|
drawings: s
|
|
128
128
|
});
|
|
@@ -192,7 +192,7 @@ const gr = {
|
|
|
192
192
|
id: "sheet.command.group-sheet-image",
|
|
193
193
|
type: Z.COMMAND,
|
|
194
194
|
handler: (i, t) => {
|
|
195
|
-
const e = i.get(
|
|
195
|
+
const e = i.get(X), n = i.get(Ye), r = i.get(re);
|
|
196
196
|
if (!t) return !1;
|
|
197
197
|
const s = [];
|
|
198
198
|
t.forEach(({ parent: h, children: f }) => {
|
|
@@ -218,10 +218,10 @@ const gr = {
|
|
|
218
218
|
type: Z.COMMAND,
|
|
219
219
|
handler: (i, t) => {
|
|
220
220
|
var v, I, R;
|
|
221
|
-
const e = i.get(
|
|
221
|
+
const e = i.get(X), n = i.get(Ye), r = i.get(re), s = i.get(At);
|
|
222
222
|
if (!t) return !1;
|
|
223
223
|
const o = t.drawings, a = o.map((S) => S.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: kt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
224
|
-
return
|
|
224
|
+
return Gn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
225
225
|
unitID: u,
|
|
226
226
|
undoMutations: [
|
|
227
227
|
...(I = f.preUndos) != null ? I : [],
|
|
@@ -241,11 +241,11 @@ const gr = {
|
|
|
241
241
|
id: "sheet.command.set-drawing-arrange",
|
|
242
242
|
type: Z.COMMAND,
|
|
243
243
|
handler: (i, t) => {
|
|
244
|
-
const e = i.get(
|
|
244
|
+
const e = i.get(X), n = i.get(Ye);
|
|
245
245
|
if (!t) return !1;
|
|
246
246
|
const r = i.get(re), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
|
|
247
247
|
let c;
|
|
248
|
-
if (d ===
|
|
248
|
+
if (d === wt.forward ? c = r.getForwardDrawingsOp(u) : d === wt.backward ? c = r.getBackwardDrawingOp(u) : d === wt.front ? c = r.getFrontDrawingsOp(u) : d === wt.back && (c = r.getBackDrawingsOp(u)), c == null)
|
|
249
249
|
return !1;
|
|
250
250
|
const { objects: l, redo: g, undo: h } = c;
|
|
251
251
|
return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (n.pushUndoRedo({
|
|
@@ -262,7 +262,7 @@ const gr = {
|
|
|
262
262
|
id: "sheet.command.set-sheet-image",
|
|
263
263
|
type: Z.COMMAND,
|
|
264
264
|
handler: (i, t) => {
|
|
265
|
-
const e = i.get(
|
|
265
|
+
const e = i.get(X), n = i.get(Ye), r = i.get(re);
|
|
266
266
|
if (!t) return !1;
|
|
267
267
|
const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
268
268
|
return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
|
|
@@ -281,7 +281,7 @@ const gr = {
|
|
|
281
281
|
id: "sheet.command.ungroup-sheet-image",
|
|
282
282
|
type: Z.COMMAND,
|
|
283
283
|
handler: (i, t) => {
|
|
284
|
-
const e = i.get(
|
|
284
|
+
const e = i.get(X), n = i.get(Ye), r = i.get(re);
|
|
285
285
|
if (!t) return !1;
|
|
286
286
|
const s = [];
|
|
287
287
|
t.forEach(({ parent: h, children: f }) => {
|
|
@@ -326,7 +326,7 @@ function en(i, t, e, n, r) {
|
|
|
326
326
|
height: n * _
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
let
|
|
329
|
+
let et = class extends ne {
|
|
330
330
|
constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
|
|
331
331
|
super();
|
|
332
332
|
ee(this, "_workbookSelections");
|
|
@@ -358,20 +358,20 @@ let Qe = class extends ne {
|
|
|
358
358
|
e = await this._imageIoService.saveImage(t);
|
|
359
359
|
} catch (v) {
|
|
360
360
|
const I = v.message;
|
|
361
|
-
I ===
|
|
361
|
+
I === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
362
362
|
type: pe.Error,
|
|
363
363
|
content: this._localeService.t("update-status.exceedMaxSize", String(Un / (1024 * 1024)))
|
|
364
|
-
}) : I ===
|
|
364
|
+
}) : I === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
365
365
|
type: pe.Error,
|
|
366
366
|
content: this._localeService.t("update-status.invalidImageType")
|
|
367
|
-
}) : I ===
|
|
367
|
+
}) : I === Pe.ERROR_IMAGE && this._messageService.show({
|
|
368
368
|
type: pe.Error,
|
|
369
369
|
content: this._localeService.t("update-status.invalidImage")
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
if (e == null)
|
|
373
373
|
return;
|
|
374
|
-
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await
|
|
374
|
+
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Gt(u || ""), { width: h, height: f } = this._context.scene;
|
|
375
375
|
this._imageIoService.addImageSourceCache(d, a, g);
|
|
376
376
|
let p = 1;
|
|
377
377
|
if (c > Pn || l > An) {
|
|
@@ -404,20 +404,20 @@ let Qe = class extends ne {
|
|
|
404
404
|
n = await this._imageIoService.saveImage(t);
|
|
405
405
|
} catch (S) {
|
|
406
406
|
const C = S.message;
|
|
407
|
-
C ===
|
|
407
|
+
C === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
408
408
|
type: pe.Error,
|
|
409
409
|
content: this._localeService.t("update-status.exceedMaxSize", String(Un / (1024 * 1024)))
|
|
410
|
-
}) : C ===
|
|
410
|
+
}) : C === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
411
411
|
type: pe.Error,
|
|
412
412
|
content: this._localeService.t("update-status.invalidImageType")
|
|
413
|
-
}) : C ===
|
|
413
|
+
}) : C === Pe.ERROR_IMAGE && this._messageService.show({
|
|
414
414
|
type: pe.Error,
|
|
415
415
|
content: this._localeService.t("update-status.invalidImage")
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
if (n == null)
|
|
419
419
|
return !1;
|
|
420
|
-
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await
|
|
420
|
+
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Gt(a || "");
|
|
421
421
|
this._imageIoService.addImageSourceCache(o, s, c);
|
|
422
422
|
const l = this._workbookSelections.getCurrentLastSelection();
|
|
423
423
|
if (!l)
|
|
@@ -496,7 +496,7 @@ let Qe = class extends ne {
|
|
|
496
496
|
// eslint-disable-next-line max-lines-per-function
|
|
497
497
|
async insertCellImageByUrl(t, e) {
|
|
498
498
|
var g, h;
|
|
499
|
-
const { width: n, height: r, image: s } = await
|
|
499
|
+
const { width: n, height: r, image: s } = await Gt(t || "");
|
|
500
500
|
this._imageIoService.addImageSourceCache(t, Rn.URL, s);
|
|
501
501
|
const o = this._workbookSelections.getCurrentLastSelection();
|
|
502
502
|
if (!o)
|
|
@@ -532,7 +532,7 @@ let Qe = class extends ne {
|
|
|
532
532
|
}, c = {
|
|
533
533
|
unitId: a.getUnitId(),
|
|
534
534
|
subUnitId: a.getUnitId(),
|
|
535
|
-
drawingId:
|
|
535
|
+
drawingId: Qe(),
|
|
536
536
|
drawingType: B.DRAWING_IMAGE,
|
|
537
537
|
imageSourceType: Rn.URL,
|
|
538
538
|
source: t,
|
|
@@ -668,20 +668,20 @@ let Qe = class extends ne {
|
|
|
668
668
|
);
|
|
669
669
|
}
|
|
670
670
|
};
|
|
671
|
-
|
|
671
|
+
et = rs([
|
|
672
672
|
te(1, A(V)),
|
|
673
|
-
te(2,
|
|
673
|
+
te(2, X),
|
|
674
674
|
te(3, xe),
|
|
675
675
|
te(4, Ei),
|
|
676
676
|
te(5, Pi),
|
|
677
677
|
te(6, re),
|
|
678
678
|
te(7, ie),
|
|
679
|
-
te(8,
|
|
679
|
+
te(8, Xn),
|
|
680
680
|
te(9, cr),
|
|
681
|
-
te(10, A(
|
|
681
|
+
te(10, A(nt)),
|
|
682
682
|
te(11, A(on)),
|
|
683
|
-
te(12, A(
|
|
684
|
-
],
|
|
683
|
+
te(12, A(Ge))
|
|
684
|
+
], et);
|
|
685
685
|
const Bt = {
|
|
686
686
|
id: "sheet.command.insert-float-image",
|
|
687
687
|
type: Z.COMMAND,
|
|
@@ -691,7 +691,7 @@ const Bt = {
|
|
|
691
691
|
F.UNIVER_SHEET,
|
|
692
692
|
e,
|
|
693
693
|
n
|
|
694
|
-
)) == null ? void 0 : o.with(
|
|
694
|
+
)) == null ? void 0 : o.with(et);
|
|
695
695
|
if (!r)
|
|
696
696
|
return !1;
|
|
697
697
|
const s = t == null ? void 0 : t.files;
|
|
@@ -711,13 +711,13 @@ const Bt = {
|
|
|
711
711
|
F.UNIVER_SHEET,
|
|
712
712
|
t,
|
|
713
713
|
e
|
|
714
|
-
)) == null ? void 0 : n.with(
|
|
714
|
+
)) == null ? void 0 : n.with(et).insertCellImage()) != null ? r : !1;
|
|
715
715
|
}
|
|
716
|
-
},
|
|
716
|
+
}, it = {
|
|
717
717
|
id: "sheet.command.move-drawing",
|
|
718
718
|
type: Z.COMMAND,
|
|
719
719
|
handler: (i, t) => {
|
|
720
|
-
const e = i.get(
|
|
720
|
+
const e = i.get(X), n = i.get(re), r = i.get(xe), { direction: s } = t, o = n.getFocusDrawings();
|
|
721
721
|
if (o.length === 0)
|
|
722
722
|
return !1;
|
|
723
723
|
const a = o[0].unitId, d = o.map((c) => {
|
|
@@ -740,7 +740,7 @@ const Bt = {
|
|
|
740
740
|
id: "sidebar.operation.sheet-image",
|
|
741
741
|
type: Z.COMMAND,
|
|
742
742
|
handler: async (i, t) => {
|
|
743
|
-
const e = i.get(Ai), n = i.get(
|
|
743
|
+
const e = i.get(Ai), n = i.get(nt), r = i.get(Se), s = i.get(X);
|
|
744
744
|
if (!se(r)) return !1;
|
|
745
745
|
switch (t.value) {
|
|
746
746
|
case "open":
|
|
@@ -764,7 +764,7 @@ const Bt = {
|
|
|
764
764
|
id: "sheet.operation.edit-sheet-image",
|
|
765
765
|
type: Z.OPERATION,
|
|
766
766
|
handler: (i, t) => {
|
|
767
|
-
const e = i.get(
|
|
767
|
+
const e = i.get(X);
|
|
768
768
|
return t == null ? !1 : (e.syncExecuteCommand(Nt.id, [t]), e.executeCommand(wr.id, { value: "open" }), !0);
|
|
769
769
|
}
|
|
770
770
|
}, ss = "sheets-drawing-ui.config", jn = {};
|
|
@@ -773,7 +773,7 @@ var os = Object.getOwnPropertyDescriptor, as = (i, t, e, n) => {
|
|
|
773
773
|
(o = i[s]) && (r = o(r) || r);
|
|
774
774
|
return r;
|
|
775
775
|
}, ce = (i, t) => (e, n) => t(e, n, i);
|
|
776
|
-
let Rt = class extends
|
|
776
|
+
let Rt = class extends Xr {
|
|
777
777
|
constructor(t, e, n, r, s, o, a, d, u, c) {
|
|
778
778
|
super();
|
|
779
779
|
ee(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
@@ -808,7 +808,7 @@ let Rt = class extends Gr {
|
|
|
808
808
|
_hasCropObject(t) {
|
|
809
809
|
const e = t.getAllObjectsByOrder();
|
|
810
810
|
for (const n of e)
|
|
811
|
-
if (n instanceof
|
|
811
|
+
if (n instanceof Xi)
|
|
812
812
|
return !0;
|
|
813
813
|
return !1;
|
|
814
814
|
}
|
|
@@ -876,7 +876,7 @@ let Rt = class extends Gr {
|
|
|
876
876
|
{
|
|
877
877
|
label: "image-popup.delete",
|
|
878
878
|
index: 1,
|
|
879
|
-
commandId:
|
|
879
|
+
commandId: rt.id,
|
|
880
880
|
commandParams: { unitId: t, drawings: [{ unitId: t, subUnitId: e, drawingId: n }] },
|
|
881
881
|
disable: !1
|
|
882
882
|
},
|
|
@@ -898,22 +898,22 @@ let Rt = class extends Gr {
|
|
|
898
898
|
}
|
|
899
899
|
};
|
|
900
900
|
Rt = as([
|
|
901
|
-
ce(0, A(
|
|
902
|
-
ce(1, A(
|
|
901
|
+
ce(0, A(Ge)),
|
|
902
|
+
ce(1, A(nt)),
|
|
903
903
|
ce(2, ie),
|
|
904
904
|
ce(3, A(Ar)),
|
|
905
905
|
ce(4, J),
|
|
906
906
|
ce(5, Se),
|
|
907
907
|
ce(6, cr),
|
|
908
|
-
ce(7,
|
|
909
|
-
ce(8,
|
|
910
|
-
ce(9,
|
|
908
|
+
ce(7, Xn),
|
|
909
|
+
ce(8, Gr),
|
|
910
|
+
ce(9, X)
|
|
911
911
|
], Rt);
|
|
912
912
|
var cs = Object.getOwnPropertyDescriptor, ds = (i, t, e, n) => {
|
|
913
913
|
for (var r = n > 1 ? void 0 : n ? cs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
914
914
|
(o = i[s]) && (r = o(r) || r);
|
|
915
915
|
return r;
|
|
916
|
-
},
|
|
916
|
+
}, vt = (i, t) => (e, n) => t(e, n, i);
|
|
917
917
|
let tn = class extends ne {
|
|
918
918
|
constructor(t, e, n, r, s) {
|
|
919
919
|
super();
|
|
@@ -939,16 +939,16 @@ let tn = class extends ne {
|
|
|
939
939
|
}
|
|
940
940
|
};
|
|
941
941
|
tn = ds([
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
942
|
+
vt(1, A(Nr)),
|
|
943
|
+
vt(2, A(on)),
|
|
944
|
+
vt(3, A(lr)),
|
|
945
|
+
vt(4, A(V))
|
|
946
946
|
], tn);
|
|
947
947
|
var ls = Object.getOwnPropertyDescriptor, us = (i, t, e, n) => {
|
|
948
948
|
for (var r = n > 1 ? void 0 : n ? ls(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
949
949
|
(o = i[s]) && (r = o(r) || r);
|
|
950
950
|
return r;
|
|
951
|
-
},
|
|
951
|
+
}, It = (i, t) => (e, n) => t(e, n, i);
|
|
952
952
|
let nn = class extends ne {
|
|
953
953
|
constructor(i, t, e, n, r) {
|
|
954
954
|
super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
|
|
@@ -970,16 +970,16 @@ let nn = class extends ne {
|
|
|
970
970
|
}
|
|
971
971
|
};
|
|
972
972
|
nn = us([
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
973
|
+
It(1, re),
|
|
974
|
+
It(2, ie),
|
|
975
|
+
It(3, A(xe)),
|
|
976
|
+
It(4, A(V))
|
|
977
977
|
], nn);
|
|
978
978
|
var hs = Object.getOwnPropertyDescriptor, gs = (i, t, e, n) => {
|
|
979
979
|
for (var r = n > 1 ? void 0 : n ? hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
980
980
|
(o = i[s]) && (r = o(r) || r);
|
|
981
981
|
return r;
|
|
982
|
-
},
|
|
982
|
+
}, Ae = (i, t) => (e, n) => t(e, n, i);
|
|
983
983
|
function Sr(i, t, e) {
|
|
984
984
|
var n, r, s, o;
|
|
985
985
|
if (((r = (n = e == null ? void 0 : e.p) == null ? void 0 : n.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
|
|
@@ -1008,7 +1008,7 @@ let bt = class extends ne {
|
|
|
1008
1008
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
1009
1009
|
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(Ze), this._docDrawingController.loadDrawingDataForUnit(Ze), this._drawingManagerService.initializeNotification(Ze)) : this._drawingManagerService.removeDrawingDataForUnit(Ze);
|
|
1010
1010
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
1011
|
-
i.id === yi.id && i.params.unitId ===
|
|
1011
|
+
i.id === yi.id && i.params.unitId === Be && (this._drawingManagerService.removeDrawingDataForUnit(Be), this._docDrawingController.loadDrawingDataForUnit(Be), this._drawingManagerService.initializeNotification(Be));
|
|
1012
1012
|
}));
|
|
1013
1013
|
}
|
|
1014
1014
|
_initCellContentInterceptor() {
|
|
@@ -1028,12 +1028,12 @@ let bt = class extends ne {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
};
|
|
1030
1030
|
bt = gs([
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1031
|
+
Ae(0, X),
|
|
1032
|
+
Ae(1, A(At)),
|
|
1033
|
+
Ae(2, A(Ge)),
|
|
1034
|
+
Ae(3, ie),
|
|
1035
|
+
Ae(4, A(Yi)),
|
|
1036
|
+
Ae(5, A(kr))
|
|
1037
1037
|
], bt);
|
|
1038
1038
|
var fs = Object.getOwnPropertyDescriptor, ms = (i, t, e, n) => {
|
|
1039
1039
|
for (var r = n > 1 ? void 0 : n ? fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1059,7 +1059,7 @@ let Mt = class extends ne {
|
|
|
1059
1059
|
};
|
|
1060
1060
|
Mt = ms([
|
|
1061
1061
|
$n(0, A(Wr)),
|
|
1062
|
-
$n(1, A(
|
|
1062
|
+
$n(1, A(Ge))
|
|
1063
1063
|
], Mt);
|
|
1064
1064
|
var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
|
|
1065
1065
|
for (var r = n > 1 ? void 0 : n ? ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1069,7 +1069,7 @@ var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
|
|
|
1069
1069
|
const _s = [
|
|
1070
1070
|
Ze,
|
|
1071
1071
|
Hr,
|
|
1072
|
-
|
|
1072
|
+
Be
|
|
1073
1073
|
];
|
|
1074
1074
|
let yt = class extends ne {
|
|
1075
1075
|
constructor(i, t, e, n, r) {
|
|
@@ -1098,7 +1098,7 @@ let yt = class extends ne {
|
|
|
1098
1098
|
return;
|
|
1099
1099
|
const o = s.getUnitId();
|
|
1100
1100
|
if (_s.includes(o)) {
|
|
1101
|
-
if (o !==
|
|
1101
|
+
if (o !== Be) {
|
|
1102
1102
|
const a = () => {
|
|
1103
1103
|
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(pn.id, {
|
|
1104
1104
|
visible: !1
|
|
@@ -1134,11 +1134,11 @@ let yt = class extends ne {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
};
|
|
1136
1136
|
yt = ws([
|
|
1137
|
-
He(0,
|
|
1137
|
+
He(0, X),
|
|
1138
1138
|
He(1, Se),
|
|
1139
1139
|
He(2, Ni),
|
|
1140
1140
|
He(3, J),
|
|
1141
|
-
He(4, A(
|
|
1141
|
+
He(4, A(nt))
|
|
1142
1142
|
], yt);
|
|
1143
1143
|
var Ss = Object.getOwnPropertyDescriptor, vs = (i, t, e, n) => {
|
|
1144
1144
|
for (var r = n > 1 ? void 0 : n ? Ss(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1169,10 +1169,10 @@ function Ds() {
|
|
|
1169
1169
|
};
|
|
1170
1170
|
}
|
|
1171
1171
|
const Fn = [
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1172
|
+
We.SPECIAL_PASTE_COL_WIDTH,
|
|
1173
|
+
We.SPECIAL_PASTE_VALUE,
|
|
1174
|
+
We.SPECIAL_PASTE_FORMAT,
|
|
1175
|
+
We.SPECIAL_PASTE_FORMULA
|
|
1176
1176
|
];
|
|
1177
1177
|
let Tt = class extends ne {
|
|
1178
1178
|
constructor(t, e, n, r, s) {
|
|
@@ -1196,7 +1196,7 @@ let Tt = class extends ne {
|
|
|
1196
1196
|
unitId: t,
|
|
1197
1197
|
drawings: [o]
|
|
1198
1198
|
};
|
|
1199
|
-
this._commandService.executeCommand(
|
|
1199
|
+
this._commandService.executeCommand(rt.id, d);
|
|
1200
1200
|
}
|
|
1201
1201
|
setTimeout(() => {
|
|
1202
1202
|
const d = Ds();
|
|
@@ -1220,10 +1220,10 @@ let Tt = class extends ne {
|
|
|
1220
1220
|
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, ve.COPY);
|
|
1221
1221
|
},
|
|
1222
1222
|
onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
|
|
1223
|
-
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1223
|
+
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: We.DEFAULT_PASTE }, ve.COPY) : { undos: [], redos: [] },
|
|
1224
1224
|
onPasteFiles: (t, e) => {
|
|
1225
1225
|
if (this._copyInfo)
|
|
1226
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1226
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: We.DEFAULT_PASTE }, ve.COPY);
|
|
1227
1227
|
{
|
|
1228
1228
|
const n = e.filter((r) => r.type.includes("image"));
|
|
1229
1229
|
if (n.length)
|
|
@@ -1314,7 +1314,7 @@ let Tt = class extends ne {
|
|
|
1314
1314
|
...c,
|
|
1315
1315
|
unitId: n,
|
|
1316
1316
|
subUnitId: r,
|
|
1317
|
-
drawingId: o ? c.drawingId :
|
|
1317
|
+
drawingId: o ? c.drawingId : Qe(),
|
|
1318
1318
|
transform: h.transform,
|
|
1319
1319
|
sheetTransform: h.sheetTransform
|
|
1320
1320
|
};
|
|
@@ -1417,7 +1417,7 @@ Tt = vs([
|
|
|
1417
1417
|
ze(1, J),
|
|
1418
1418
|
ze(2, ie),
|
|
1419
1419
|
ze(3, ki),
|
|
1420
|
-
ze(4,
|
|
1420
|
+
ze(4, X)
|
|
1421
1421
|
], Tt);
|
|
1422
1422
|
var Rs = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
|
|
1423
1423
|
for (var r = n > 1 ? void 0 : n ? Rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1429,7 +1429,7 @@ let Et = class extends ne {
|
|
|
1429
1429
|
super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1430
1430
|
}
|
|
1431
1431
|
_initDrawingVisible() {
|
|
1432
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e =
|
|
1432
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = St([i, t]);
|
|
1433
1433
|
this.disposeWithMe(
|
|
1434
1434
|
e.pipe(
|
|
1435
1435
|
we(([n, r]) => n ? n.activeSheet$.pipe(
|
|
@@ -1454,11 +1454,11 @@ let Et = class extends ne {
|
|
|
1454
1454
|
if (!a)
|
|
1455
1455
|
return;
|
|
1456
1456
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1457
|
-
u.classType ===
|
|
1457
|
+
u.classType === Oe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
|
|
1458
1458
|
});
|
|
1459
1459
|
}
|
|
1460
1460
|
_initDrawingEditable() {
|
|
1461
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e =
|
|
1461
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = St([i, t]);
|
|
1462
1462
|
this.disposeWithMe(
|
|
1463
1463
|
e.pipe(
|
|
1464
1464
|
we(([n, r]) => n ? n.activeSheet$.pipe(
|
|
@@ -1483,13 +1483,13 @@ let Et = class extends ne {
|
|
|
1483
1483
|
if (!a)
|
|
1484
1484
|
return;
|
|
1485
1485
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1486
|
-
u.classType ===
|
|
1486
|
+
u.classType === Oe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
|
|
1487
1487
|
});
|
|
1488
1488
|
}
|
|
1489
1489
|
_initViewPermissionChange() {
|
|
1490
1490
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1491
1491
|
this.disposeWithMe(
|
|
1492
|
-
|
|
1492
|
+
St([i, t]).pipe(
|
|
1493
1493
|
we(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1494
1494
|
we((r) => {
|
|
1495
1495
|
if (!r)
|
|
@@ -1502,10 +1502,10 @@ let Et = class extends ne {
|
|
|
1502
1502
|
new Mn(s).id,
|
|
1503
1503
|
new yn(s, o).id
|
|
1504
1504
|
]).pipe(
|
|
1505
|
-
|
|
1505
|
+
Re((l) => l.every((g) => g.value)),
|
|
1506
1506
|
Wn()
|
|
1507
1507
|
).pipe(
|
|
1508
|
-
|
|
1508
|
+
Re((l) => ({
|
|
1509
1509
|
permission: l,
|
|
1510
1510
|
scene: d,
|
|
1511
1511
|
transformer: u,
|
|
@@ -1520,7 +1520,7 @@ let Et = class extends ne {
|
|
|
1520
1520
|
this._drawingManagerService.setDrawingVisible(e);
|
|
1521
1521
|
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1522
1522
|
e ? this._drawingManagerService.addNotification(u) : (a.forEach((c) => {
|
|
1523
|
-
c.classType ===
|
|
1523
|
+
c.classType === Oe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
|
|
1524
1524
|
}), r.clearSelectedObjects());
|
|
1525
1525
|
},
|
|
1526
1526
|
complete: () => {
|
|
@@ -1537,7 +1537,7 @@ let Et = class extends ne {
|
|
|
1537
1537
|
_initEditPermissionChange() {
|
|
1538
1538
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1539
1539
|
this.disposeWithMe(
|
|
1540
|
-
|
|
1540
|
+
St([i, t]).pipe(
|
|
1541
1541
|
we(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1542
1542
|
we((r) => {
|
|
1543
1543
|
if (!r)
|
|
@@ -1550,10 +1550,10 @@ let Et = class extends ne {
|
|
|
1550
1550
|
new zt(s).id,
|
|
1551
1551
|
new Kt(s, o).id
|
|
1552
1552
|
]).pipe(
|
|
1553
|
-
|
|
1553
|
+
Re((l) => l.every((g) => g.value)),
|
|
1554
1554
|
Wn()
|
|
1555
1555
|
).pipe(
|
|
1556
|
-
|
|
1556
|
+
Re((l) => ({
|
|
1557
1557
|
permission: l,
|
|
1558
1558
|
scene: d,
|
|
1559
1559
|
transformer: u,
|
|
@@ -1568,9 +1568,9 @@ let Et = class extends ne {
|
|
|
1568
1568
|
this._drawingManagerService.setDrawingEditable(e);
|
|
1569
1569
|
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1570
1570
|
e ? (a.forEach((c) => {
|
|
1571
|
-
c.classType ===
|
|
1571
|
+
c.classType === Oe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
|
|
1572
1572
|
}), this._drawingManagerService.addNotification(u)) : (a.forEach((c) => {
|
|
1573
|
-
c.classType ===
|
|
1573
|
+
c.classType === Oe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
|
|
1574
1574
|
}), r.clearSelectedObjects());
|
|
1575
1575
|
},
|
|
1576
1576
|
complete: () => {
|
|
@@ -1585,7 +1585,7 @@ let Et = class extends ne {
|
|
|
1585
1585
|
return;
|
|
1586
1586
|
const d = this._drawingManagerService.getDrawingData(n, s), u = Object.values(d);
|
|
1587
1587
|
this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((l) => {
|
|
1588
|
-
l.classType ===
|
|
1588
|
+
l.classType === Oe.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
|
|
1589
1589
|
});
|
|
1590
1590
|
}
|
|
1591
1591
|
})
|
|
@@ -1621,7 +1621,7 @@ function Ir(i, t, e, n, r, s = !1) {
|
|
|
1621
1621
|
top: s ? 0 : T,
|
|
1622
1622
|
left: s ? 0 : D
|
|
1623
1623
|
};
|
|
1624
|
-
w && (
|
|
1624
|
+
w && (je.isDefine(E.top) && (E.top = w.top), je.isDefine(E.left) && (E.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (S = 0);
|
|
1625
1625
|
let M = 0, b = 0;
|
|
1626
1626
|
const N = e.rowStartY(l - h) + T, x = e.colStartX(c - g) + D, q = e.rowStartY(l) + T, H = e.colStartX(c) + D;
|
|
1627
1627
|
if (g === 0)
|
|
@@ -1630,18 +1630,18 @@ function Ir(i, t, e, n, r, s = !1) {
|
|
|
1630
1630
|
const k = p - (x - D), ae = m - (x - D);
|
|
1631
1631
|
m < H ? (M = k * o, b = ae * o) : p <= H && m >= H ? (M = k * o, b = Math.max(R, (m - S) * o)) : p > H && (f.left = !1, M = Math.max((p - S) * o, R), b = Math.max((m - S) * o, R));
|
|
1632
1632
|
}
|
|
1633
|
-
let L = 0,
|
|
1633
|
+
let L = 0, G = 0;
|
|
1634
1634
|
if (h === 0)
|
|
1635
|
-
f.top = !1, L = (_ - C) * a,
|
|
1635
|
+
f.top = !1, L = (_ - C) * a, G = (v - C) * a;
|
|
1636
1636
|
else {
|
|
1637
1637
|
const k = _ - (N - T), ae = v - (N - T);
|
|
1638
|
-
v < q ? (L = k * a,
|
|
1638
|
+
v < q ? (L = k * a, G = ae * a) : _ <= q && v >= q ? (L = k * a, G = Math.max(I, (v - C) * a)) : _ > q && (f.top = !1, L = Math.max((_ - C) * a, I), G = Math.max((v - C) * a, I));
|
|
1639
1639
|
}
|
|
1640
|
-
return M = Math.max(M, E.left), L = Math.max(L, E.top), b = Math.max(b, E.left),
|
|
1640
|
+
return M = Math.max(M, E.left), L = Math.max(L, E.top), b = Math.max(b, E.left), G = Math.max(G, E.top), {
|
|
1641
1641
|
left: M,
|
|
1642
1642
|
right: b,
|
|
1643
1643
|
top: L,
|
|
1644
|
-
bottom:
|
|
1644
|
+
bottom: G,
|
|
1645
1645
|
absolute: f
|
|
1646
1646
|
};
|
|
1647
1647
|
}
|
|
@@ -1663,18 +1663,18 @@ const ge = (i, t, e, n, r) => {
|
|
|
1663
1663
|
absolute: l.absolute
|
|
1664
1664
|
};
|
|
1665
1665
|
};
|
|
1666
|
-
let
|
|
1666
|
+
let tt = class extends ne {
|
|
1667
1667
|
constructor(t, e, n, r, s, o, a) {
|
|
1668
1668
|
super();
|
|
1669
1669
|
/**
|
|
1670
1670
|
* for update dom container position when scrolling and zoom
|
|
1671
1671
|
*/
|
|
1672
1672
|
ee(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1673
|
-
ee(this, "_transformChange$", new
|
|
1673
|
+
ee(this, "_transformChange$", new Xt());
|
|
1674
1674
|
ee(this, "transformChange$", this._transformChange$.asObservable());
|
|
1675
|
-
ee(this, "_add$", new
|
|
1675
|
+
ee(this, "_add$", new Xt());
|
|
1676
1676
|
ee(this, "add$", this._add$.asObservable());
|
|
1677
|
-
ee(this, "_remove$", new
|
|
1677
|
+
ee(this, "_remove$", new Xt());
|
|
1678
1678
|
ee(this, "remove$", this._remove$.asObservable());
|
|
1679
1679
|
this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
1680
1680
|
}
|
|
@@ -1741,9 +1741,9 @@ let et = class extends ne {
|
|
|
1741
1741
|
const k = h ? h.backgroundColor : "white";
|
|
1742
1742
|
M.fill = k, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
|
|
1743
1743
|
}
|
|
1744
|
-
const N = new
|
|
1744
|
+
const N = new Ue(T, M);
|
|
1745
1745
|
b && N.setObjectType(mn.CHART), p.addObject(N, Ft), a.allowTransform !== !1 && p.attachTransformerTo(N);
|
|
1746
|
-
const x = new
|
|
1746
|
+
const x = new _t(), q = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new ke(q), L = {
|
|
1747
1747
|
dispose: x,
|
|
1748
1748
|
rect: N,
|
|
1749
1749
|
position$: H,
|
|
@@ -1770,7 +1770,7 @@ let et = class extends ne {
|
|
|
1770
1770
|
data: h,
|
|
1771
1771
|
unitId: n
|
|
1772
1772
|
});
|
|
1773
|
-
const
|
|
1773
|
+
const G = N.onTransformChange$.subscribeEvent(() => {
|
|
1774
1774
|
const k = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet);
|
|
1775
1775
|
H.next(
|
|
1776
1776
|
k
|
|
@@ -1778,7 +1778,7 @@ let et = class extends ne {
|
|
|
1778
1778
|
});
|
|
1779
1779
|
x.add(() => {
|
|
1780
1780
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1781
|
-
}),
|
|
1781
|
+
}), G && x.add(G), this._domLayerInfoMap.set(s, L);
|
|
1782
1782
|
});
|
|
1783
1783
|
})
|
|
1784
1784
|
), this.disposeWithMe(
|
|
@@ -1809,13 +1809,13 @@ let et = class extends ne {
|
|
|
1809
1809
|
this.disposeWithMe(
|
|
1810
1810
|
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
|
|
1811
1811
|
we((e) => e ? e.activeSheet$ : Bn(null)),
|
|
1812
|
-
|
|
1812
|
+
Re((e) => {
|
|
1813
1813
|
if (!e) return null;
|
|
1814
1814
|
const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
|
|
1815
1815
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
1816
1816
|
}),
|
|
1817
1817
|
we(
|
|
1818
|
-
(e) => e ? qr(e.render.scene.getViewport(xn.VIEW_MAIN).onScrollAfter$).pipe(
|
|
1818
|
+
(e) => e ? qr(e.render.scene.getViewport(xn.VIEW_MAIN).onScrollAfter$).pipe(Re(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : Bn(null)
|
|
1819
1819
|
)
|
|
1820
1820
|
).subscribe((e) => {
|
|
1821
1821
|
if (!e) return;
|
|
@@ -1838,7 +1838,7 @@ let et = class extends ne {
|
|
|
1838
1838
|
const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1839
1839
|
if (s && o) {
|
|
1840
1840
|
const { scene: a } = o, d = Ie({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
|
|
1841
|
-
u && u instanceof
|
|
1841
|
+
u && u instanceof Ue && u.setProps(r);
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
1844
|
_getPosition(t, e) {
|
|
@@ -1882,7 +1882,7 @@ let et = class extends ne {
|
|
|
1882
1882
|
...n
|
|
1883
1883
|
});
|
|
1884
1884
|
const s = this._getSceneAndTransformerByDrawingSearch(e.unitId);
|
|
1885
|
-
if (s) {
|
|
1885
|
+
if (s && n.drawingType !== B.DRAWING_CHART) {
|
|
1886
1886
|
const { scene: o } = s, a = this._domLayerInfoMap.get(e.drawingId);
|
|
1887
1887
|
a != null && a.rect && (n.allowTransform === !1 ? o.detachTransformerFrom(a.rect) : o.attachTransformerTo(a.rect));
|
|
1888
1888
|
}
|
|
@@ -1907,7 +1907,7 @@ let et = class extends ne {
|
|
|
1907
1907
|
});
|
|
1908
1908
|
if (!n)
|
|
1909
1909
|
throw new Error("cannot find current target!");
|
|
1910
|
-
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e :
|
|
1910
|
+
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : Qe(), l = this._getPosition(o, r);
|
|
1911
1911
|
if (l == null)
|
|
1912
1912
|
return;
|
|
1913
1913
|
const g = {
|
|
@@ -1966,10 +1966,10 @@ let et = class extends ne {
|
|
|
1966
1966
|
if (!u) return;
|
|
1967
1967
|
const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(V).getWorksheetSkeleton(a);
|
|
1968
1968
|
if (!c) return;
|
|
1969
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r :
|
|
1969
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Qe(), { position: p, position$: m } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
1970
1970
|
if (this._getPosition(p, o) == null)
|
|
1971
1971
|
return;
|
|
1972
|
-
const v = d.scene, { scaleX: I } = v.getAncestorScale(), R =
|
|
1972
|
+
const v = d.scene, { scaleX: I } = v.getAncestorScale(), R = Ct(p, n, I), S = {
|
|
1973
1973
|
unitId: o,
|
|
1974
1974
|
subUnitId: a,
|
|
1975
1975
|
drawingId: f,
|
|
@@ -1997,50 +1997,50 @@ let et = class extends ne {
|
|
|
1997
1997
|
const H = q.getWorksheetSkeleton(T);
|
|
1998
1998
|
if (!H)
|
|
1999
1999
|
return;
|
|
2000
|
-
const { transform: L, drawingType:
|
|
2001
|
-
if (
|
|
2000
|
+
const { transform: L, drawingType: G, data: K } = b;
|
|
2001
|
+
if (G !== B.DRAWING_DOM && G !== B.DRAWING_CHART)
|
|
2002
2002
|
return;
|
|
2003
2003
|
const k = this._getSceneAndTransformerByDrawingSearch(D);
|
|
2004
2004
|
if (k == null)
|
|
2005
2005
|
return;
|
|
2006
|
-
const { scene: ae, canvas:
|
|
2006
|
+
const { scene: ae, canvas: be } = k;
|
|
2007
2007
|
if (L == null || x !== T)
|
|
2008
2008
|
return;
|
|
2009
|
-
const { left:
|
|
2009
|
+
const { left: ot, top: at, width: ct, height: dt, angle: jt, flipX: $t, flipY: lt, skewX: ut, skewY: Me } = L, ht = Ie({ unitId: D, subUnitId: T, drawingId: E }), de = ae.getObject(ht);
|
|
2010
2010
|
if (de != null) {
|
|
2011
|
-
de.transformByState({ left:
|
|
2011
|
+
de.transformByState({ left: ot, top: at, width: ct, height: dt, angle: jt, flipX: $t, flipY: lt, skewX: ut, skewY: Me });
|
|
2012
2012
|
return;
|
|
2013
2013
|
}
|
|
2014
2014
|
const Q = {
|
|
2015
|
-
left:
|
|
2015
|
+
left: ot,
|
|
2016
2016
|
// from floatDomParam.transform
|
|
2017
|
-
top:
|
|
2018
|
-
width:
|
|
2019
|
-
height:
|
|
2017
|
+
top: at,
|
|
2018
|
+
width: ct,
|
|
2019
|
+
height: dt,
|
|
2020
2020
|
zIndex: this._drawingManagerService.getDrawingOrder(D, T).length - 1
|
|
2021
|
-
},
|
|
2022
|
-
if (
|
|
2021
|
+
}, ye = G === B.DRAWING_CHART;
|
|
2022
|
+
if (ye) {
|
|
2023
2023
|
const W = K ? K.backgroundColor : "white";
|
|
2024
2024
|
Q.fill = W, Q.rotateEnabled = !1, K && K.border && (Q.stroke = K.border), Q.paintFirst = "stroke", Q.strokeWidth = 1, Q.borderEnabled = !1, Q.radius = 8;
|
|
2025
2025
|
}
|
|
2026
|
-
const le = new
|
|
2027
|
-
|
|
2028
|
-
const ue = new
|
|
2029
|
-
top:
|
|
2030
|
-
left:
|
|
2031
|
-
bottom:
|
|
2032
|
-
right:
|
|
2026
|
+
const le = new Ue(ht, Q);
|
|
2027
|
+
ye && le.setObjectType(mn.CHART), ae.addObject(le, Ft), b.allowTransform !== !1 && ae.attachTransformerTo(le);
|
|
2028
|
+
const ue = new _t(), gt = ae.getMainViewport(), { rowHeaderWidth: Te, columnHeaderHeight: Xe } = H.skeleton, ft = {
|
|
2029
|
+
top: Xe,
|
|
2030
|
+
left: Te,
|
|
2031
|
+
bottom: gt.bottom,
|
|
2032
|
+
right: gt.right
|
|
2033
2033
|
}, he = {
|
|
2034
2034
|
dispose: ue,
|
|
2035
2035
|
rect: le,
|
|
2036
|
-
boundsOfViewArea:
|
|
2036
|
+
boundsOfViewArea: ft,
|
|
2037
2037
|
domAnchor: n,
|
|
2038
2038
|
unitId: D,
|
|
2039
2039
|
subUnitId: T
|
|
2040
|
-
}, j = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he),
|
|
2041
|
-
he.position$ =
|
|
2040
|
+
}, j = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he), Ee = new ke(j);
|
|
2041
|
+
he.position$ = Ee;
|
|
2042
2042
|
let Le = {
|
|
2043
|
-
position$:
|
|
2043
|
+
position$: Ee,
|
|
2044
2044
|
id: E,
|
|
2045
2045
|
componentKey: b.componentKey,
|
|
2046
2046
|
onPointerDown: () => {
|
|
@@ -2050,7 +2050,7 @@ let et = class extends ne {
|
|
|
2050
2050
|
onPointerUp: () => {
|
|
2051
2051
|
},
|
|
2052
2052
|
onWheel: (W) => {
|
|
2053
|
-
|
|
2053
|
+
be.dispatchEvent(new WheelEvent(W.type, W));
|
|
2054
2054
|
},
|
|
2055
2055
|
data: K,
|
|
2056
2056
|
unitId: D
|
|
@@ -2058,17 +2058,17 @@ let et = class extends ne {
|
|
|
2058
2058
|
e.eventPassThrough && (Le = {
|
|
2059
2059
|
...Le,
|
|
2060
2060
|
onPointerDown: (W) => {
|
|
2061
|
-
|
|
2061
|
+
be.dispatchEvent(new PointerEvent(W.type, W));
|
|
2062
2062
|
},
|
|
2063
2063
|
onPointerMove: (W) => {
|
|
2064
|
-
|
|
2064
|
+
be.dispatchEvent(new PointerEvent(W.type, W));
|
|
2065
2065
|
},
|
|
2066
2066
|
onPointerUp: (W) => {
|
|
2067
|
-
|
|
2067
|
+
be.dispatchEvent(new PointerEvent(W.type, W));
|
|
2068
2068
|
}
|
|
2069
2069
|
}), this._canvasFloatDomService.addFloatDom(Le), this.disposeWithMe(m.subscribe((W) => {
|
|
2070
2070
|
var un, hn, gn, fn;
|
|
2071
|
-
const ln =
|
|
2071
|
+
const ln = Ct({
|
|
2072
2072
|
startX: W.startX,
|
|
2073
2073
|
startY: W.startY,
|
|
2074
2074
|
endX: W.endX,
|
|
@@ -2079,28 +2079,28 @@ let et = class extends ne {
|
|
|
2079
2079
|
left: p.absolute.left,
|
|
2080
2080
|
top: p.absolute.top
|
|
2081
2081
|
}
|
|
2082
|
-
}, n), Rr = Ie({ unitId: D, subUnitId: T, drawingId: E }), br = new
|
|
2082
|
+
}, n), Rr = Ie({ unitId: D, subUnitId: T, drawingId: E }), br = new Ue(Rr, {
|
|
2083
2083
|
left: ln.startX,
|
|
2084
2084
|
top: ln.startY,
|
|
2085
2085
|
width: (gn = n.width) != null ? gn : W.width,
|
|
2086
2086
|
height: (fn = n.height) != null ? fn : W.height,
|
|
2087
2087
|
zIndex: this._drawingManagerService.getDrawingOrder(D, T).length - 1
|
|
2088
2088
|
}), Mr = ge(br, k.renderUnit.scene, H.skeleton, M.worksheet, he);
|
|
2089
|
-
|
|
2089
|
+
Ee.next(Mr);
|
|
2090
2090
|
}));
|
|
2091
2091
|
const Ve = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(V);
|
|
2092
2092
|
Ve == null || Ve.currentSkeleton$.subscribe((W) => {
|
|
2093
2093
|
W && H.sheetId !== W.sheetId && this._removeDom(f, !0);
|
|
2094
2094
|
});
|
|
2095
|
-
const
|
|
2095
|
+
const mt = le.onTransformChange$.subscribeEvent(() => {
|
|
2096
2096
|
const W = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he);
|
|
2097
|
-
|
|
2097
|
+
Ee.next(
|
|
2098
2098
|
W
|
|
2099
2099
|
);
|
|
2100
2100
|
});
|
|
2101
2101
|
ue.add(() => {
|
|
2102
2102
|
this._canvasFloatDomService.removeFloatDom(E);
|
|
2103
|
-
}),
|
|
2103
|
+
}), mt && ue.add(mt), this._domLayerInfoMap.set(E, he);
|
|
2104
2104
|
}
|
|
2105
2105
|
return {
|
|
2106
2106
|
id: f,
|
|
@@ -2124,7 +2124,7 @@ let et = class extends ne {
|
|
|
2124
2124
|
if (!u) return;
|
|
2125
2125
|
const c = (R = this._renderManagerService.getRenderById(o)) == null ? void 0 : R.with(V).getWorksheetSkeleton(a);
|
|
2126
2126
|
if (!c) return;
|
|
2127
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r :
|
|
2127
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Qe(), { position: p, position$: m } = this._createRangePositionObserver({
|
|
2128
2128
|
startRow: 0,
|
|
2129
2129
|
endRow: 0,
|
|
2130
2130
|
startColumn: t,
|
|
@@ -2163,15 +2163,15 @@ let et = class extends ne {
|
|
|
2163
2163
|
const { transform: q, data: H } = E, L = this._getSceneAndTransformerByDrawingSearch(w);
|
|
2164
2164
|
if (L == null)
|
|
2165
2165
|
return;
|
|
2166
|
-
const { scene:
|
|
2166
|
+
const { scene: G, canvas: K } = L;
|
|
2167
2167
|
if (q == null || b !== y)
|
|
2168
2168
|
return;
|
|
2169
|
-
const { left: k, top: ae, width:
|
|
2170
|
-
if (
|
|
2171
|
-
|
|
2169
|
+
const { left: k, top: ae, width: be, height: ot, angle: at, flipX: ct, flipY: dt, skewX: jt, skewY: $t } = q, lt = Ie({ unitId: w, subUnitId: y, drawingId: D }), ut = G.getObject(lt);
|
|
2170
|
+
if (ut != null) {
|
|
2171
|
+
ut.transformByState({ left: k, top: ae, width: be, height: ot, angle: at, flipX: ct, flipY: dt, skewX: jt, skewY: $t });
|
|
2172
2172
|
return;
|
|
2173
2173
|
}
|
|
2174
|
-
const
|
|
2174
|
+
const Me = Ct({
|
|
2175
2175
|
startX: _.startX,
|
|
2176
2176
|
startY: 0,
|
|
2177
2177
|
endX: p.endX,
|
|
@@ -2182,20 +2182,20 @@ let et = class extends ne {
|
|
|
2182
2182
|
left: p.absolute.left,
|
|
2183
2183
|
top: p.absolute.top
|
|
2184
2184
|
}
|
|
2185
|
-
}, n),
|
|
2186
|
-
left:
|
|
2187
|
-
top:
|
|
2188
|
-
width:
|
|
2189
|
-
height:
|
|
2185
|
+
}, n), ht = {
|
|
2186
|
+
left: Me.startX,
|
|
2187
|
+
top: Me.startY,
|
|
2188
|
+
width: Me.width,
|
|
2189
|
+
height: Me.height,
|
|
2190
2190
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2191
|
-
}, de = new
|
|
2192
|
-
|
|
2193
|
-
const Q = new
|
|
2191
|
+
}, de = new Ue(lt, ht);
|
|
2192
|
+
G.addObject(de, Ft), E.allowTransform !== !1 && G.attachTransformerTo(de);
|
|
2193
|
+
const Q = new _t(), ye = G.getMainViewport(), le = {
|
|
2194
2194
|
top: 0,
|
|
2195
2195
|
//viewMain.top,
|
|
2196
|
-
left:
|
|
2197
|
-
bottom:
|
|
2198
|
-
right:
|
|
2196
|
+
left: ye.left,
|
|
2197
|
+
bottom: ye.bottom,
|
|
2198
|
+
right: ye.right
|
|
2199
2199
|
}, ue = {
|
|
2200
2200
|
dispose: Q,
|
|
2201
2201
|
rect: de,
|
|
@@ -2206,10 +2206,10 @@ let et = class extends ne {
|
|
|
2206
2206
|
domAnchor: n,
|
|
2207
2207
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2208
2208
|
/* HORIZONTAL */
|
|
2209
|
-
},
|
|
2210
|
-
ue.position$ =
|
|
2211
|
-
let
|
|
2212
|
-
position$:
|
|
2209
|
+
}, gt = ge(de, L.renderUnit.scene, x.skeleton, T.worksheet, ue), Te = new ke(gt);
|
|
2210
|
+
ue.position$ = Te;
|
|
2211
|
+
let Xe = {
|
|
2212
|
+
position$: Te,
|
|
2213
2213
|
id: D,
|
|
2214
2214
|
componentKey: E.componentKey,
|
|
2215
2215
|
onPointerDown: () => {
|
|
@@ -2224,8 +2224,8 @@ let et = class extends ne {
|
|
|
2224
2224
|
data: H,
|
|
2225
2225
|
unitId: w
|
|
2226
2226
|
};
|
|
2227
|
-
e.eventPassThrough && (
|
|
2228
|
-
...
|
|
2227
|
+
e.eventPassThrough && (Xe = {
|
|
2228
|
+
...Xe,
|
|
2229
2229
|
onPointerDown: (j) => {
|
|
2230
2230
|
K.dispatchEvent(new PointerEvent(j.type, j));
|
|
2231
2231
|
},
|
|
@@ -2235,15 +2235,15 @@ let et = class extends ne {
|
|
|
2235
2235
|
onPointerUp: (j) => {
|
|
2236
2236
|
K.dispatchEvent(new PointerEvent(j.type, j));
|
|
2237
2237
|
}
|
|
2238
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2239
|
-
const
|
|
2238
|
+
}), this._canvasFloatDomService.addFloatDom(Xe);
|
|
2239
|
+
const ft = de.onTransformChange$.subscribeEvent(() => {
|
|
2240
2240
|
const j = ge(de, L.renderUnit.scene, x.skeleton, T.worksheet, ue);
|
|
2241
|
-
|
|
2241
|
+
Te.next(
|
|
2242
2242
|
j
|
|
2243
2243
|
);
|
|
2244
2244
|
});
|
|
2245
2245
|
this.disposeWithMe(m.subscribe((j) => {
|
|
2246
|
-
const
|
|
2246
|
+
const Ee = Ct({
|
|
2247
2247
|
startX: j.startX,
|
|
2248
2248
|
startY: 0,
|
|
2249
2249
|
endX: j.endX,
|
|
@@ -2254,21 +2254,21 @@ let et = class extends ne {
|
|
|
2254
2254
|
left: p.absolute.left,
|
|
2255
2255
|
top: p.absolute.top
|
|
2256
2256
|
}
|
|
2257
|
-
}, n), Le = Ie({ unitId: w, subUnitId: y, drawingId: D }), Ve = new
|
|
2258
|
-
left:
|
|
2257
|
+
}, n), Le = Ie({ unitId: w, subUnitId: y, drawingId: D }), Ve = new Ue(Le, {
|
|
2258
|
+
left: Ee.startX,
|
|
2259
2259
|
top: 0,
|
|
2260
2260
|
width: n.width,
|
|
2261
2261
|
height: n.height,
|
|
2262
2262
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2263
|
-
}),
|
|
2264
|
-
|
|
2263
|
+
}), mt = ge(Ve, L.renderUnit.scene, x.skeleton, T.worksheet, ue);
|
|
2264
|
+
Te.next(mt);
|
|
2265
2265
|
}));
|
|
2266
2266
|
const he = (C = this._renderManagerService.getRenderById(w)) == null ? void 0 : C.with(V);
|
|
2267
2267
|
he == null || he.currentSkeleton$.subscribe((j) => {
|
|
2268
2268
|
j && c.sheetId !== j.sheetId && this._removeDom(f, !0);
|
|
2269
2269
|
}), Q.add(() => {
|
|
2270
2270
|
this._canvasFloatDomService.removeFloatDom(D);
|
|
2271
|
-
}),
|
|
2271
|
+
}), ft && Q.add(ft), this._domLayerInfoMap.set(D, ue);
|
|
2272
2272
|
}
|
|
2273
2273
|
return {
|
|
2274
2274
|
id: f,
|
|
@@ -2290,10 +2290,10 @@ let et = class extends ne {
|
|
|
2290
2290
|
// eslint-disable-next-line max-lines-per-function
|
|
2291
2291
|
_createRangePositionObserver(t, e, n) {
|
|
2292
2292
|
let { startRow: r, startColumn: s } = t;
|
|
2293
|
-
const o = Je(r, s, n), a = new
|
|
2293
|
+
const o = Je(r, s, n), a = new ke(o), d = Je(t.endRow, t.endColumn, n), u = new ke(d), c = () => {
|
|
2294
2294
|
const m = Je(r, s, n), _ = Je(t.endRow, t.endColumn, n);
|
|
2295
2295
|
a.next(m), u.next(_);
|
|
2296
|
-
}, l = new
|
|
2296
|
+
}, l = new _t();
|
|
2297
2297
|
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((m) => {
|
|
2298
2298
|
if (m.id === gi.id && m.params.rowsAutoHeightInfo.findIndex((v) => v.row === r) > -1) {
|
|
2299
2299
|
c();
|
|
@@ -2316,7 +2316,7 @@ let et = class extends ne {
|
|
|
2316
2316
|
endX: d.right,
|
|
2317
2317
|
endY: d.bottom
|
|
2318
2318
|
}), f = a.pipe(
|
|
2319
|
-
|
|
2319
|
+
Re((m) => {
|
|
2320
2320
|
const _ = Je(t.endRow, t.endColumn, n);
|
|
2321
2321
|
return {
|
|
2322
2322
|
rotate: 0,
|
|
@@ -2343,15 +2343,15 @@ let et = class extends ne {
|
|
|
2343
2343
|
};
|
|
2344
2344
|
}
|
|
2345
2345
|
};
|
|
2346
|
-
|
|
2346
|
+
tt = ys([
|
|
2347
2347
|
Ce(0, A(J)),
|
|
2348
2348
|
Ce(1, Se),
|
|
2349
|
-
Ce(2, A(
|
|
2349
|
+
Ce(2, A(X)),
|
|
2350
2350
|
Ce(3, ie),
|
|
2351
2351
|
Ce(4, A(Wi)),
|
|
2352
2352
|
Ce(5, re),
|
|
2353
2353
|
Ce(6, A(Jr))
|
|
2354
|
-
],
|
|
2354
|
+
], tt);
|
|
2355
2355
|
function Je(i, t, e) {
|
|
2356
2356
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
2357
2357
|
return {
|
|
@@ -2361,22 +2361,22 @@ function Je(i, t, e) {
|
|
|
2361
2361
|
bottom: r.endY
|
|
2362
2362
|
};
|
|
2363
2363
|
}
|
|
2364
|
-
function
|
|
2364
|
+
function Ct(i, t, e) {
|
|
2365
2365
|
var u, c;
|
|
2366
2366
|
e = e != null ? e : 1;
|
|
2367
2367
|
const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (c = t == null ? void 0 : t.height) != null ? c : r;
|
|
2368
2368
|
let a = 0, d = 0;
|
|
2369
2369
|
if (t) {
|
|
2370
2370
|
if (t.horizonOffsetAlign === "right") {
|
|
2371
|
-
const l =
|
|
2371
|
+
const l = Dt(t.marginX, n * e);
|
|
2372
2372
|
a = i.endX - l - s;
|
|
2373
2373
|
} else
|
|
2374
|
-
a = i.startX +
|
|
2374
|
+
a = i.startX + Dt(t.marginX, n);
|
|
2375
2375
|
if (t.verticalOffsetAlign === "bottom") {
|
|
2376
|
-
const l =
|
|
2376
|
+
const l = Dt(t.marginY, r * e);
|
|
2377
2377
|
d = i.endY - l - o;
|
|
2378
2378
|
} else
|
|
2379
|
-
d = i.startY +
|
|
2379
|
+
d = i.startY + Dt(t.marginY, r);
|
|
2380
2380
|
}
|
|
2381
2381
|
return {
|
|
2382
2382
|
rotate: 0,
|
|
@@ -2392,7 +2392,7 @@ function It(i, t, e) {
|
|
|
2392
2392
|
}
|
|
2393
2393
|
};
|
|
2394
2394
|
}
|
|
2395
|
-
function
|
|
2395
|
+
function Dt(i, t) {
|
|
2396
2396
|
if (i === void 0) return 0;
|
|
2397
2397
|
if (typeof i == "number") return i;
|
|
2398
2398
|
const e = Number.parseFloat(i);
|
|
@@ -2422,7 +2422,7 @@ const Ts = (i) => {
|
|
|
2422
2422
|
height: d * f,
|
|
2423
2423
|
absolute: g.absolute
|
|
2424
2424
|
}, m = {
|
|
2425
|
-
position$: new
|
|
2425
|
+
position$: new ke(p),
|
|
2426
2426
|
position: p,
|
|
2427
2427
|
id: o.drawingId,
|
|
2428
2428
|
componentKey: o.componentKey,
|
|
@@ -2480,7 +2480,7 @@ let Ot = class extends ne {
|
|
|
2480
2480
|
return e(i);
|
|
2481
2481
|
const { scaleX: u, scaleY: c } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((h) => d.data[h]);
|
|
2482
2482
|
return g.length ? (g.forEach((h) => {
|
|
2483
|
-
if (!h.groupId && h.transform &&
|
|
2483
|
+
if (!h.groupId && h.transform && je.isDefine(h.transform.left) && je.isDefine(h.transform.top) && je.isDefine(h.transform.width) && je.isDefine(h.transform.height)) {
|
|
2484
2484
|
const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
|
|
2485
2485
|
f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
|
|
2486
2486
|
}
|
|
@@ -2532,9 +2532,9 @@ Ot = Os([
|
|
|
2532
2532
|
De(1, A(lr)),
|
|
2533
2533
|
De(2, ie),
|
|
2534
2534
|
De(3, J),
|
|
2535
|
-
De(4, A(
|
|
2535
|
+
De(4, A(tt)),
|
|
2536
2536
|
De(5, A(dr)),
|
|
2537
|
-
De(6, A(
|
|
2537
|
+
De(6, A(Ge))
|
|
2538
2538
|
], Ot);
|
|
2539
2539
|
var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
|
|
2540
2540
|
for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -3315,7 +3315,7 @@ let rn = class extends ne {
|
|
|
3315
3315
|
};
|
|
3316
3316
|
rn = Ps([
|
|
3317
3317
|
me(1, J),
|
|
3318
|
-
me(2,
|
|
3318
|
+
me(2, X),
|
|
3319
3319
|
me(3, xe),
|
|
3320
3320
|
me(4, A(V)),
|
|
3321
3321
|
me(5, A(At)),
|
|
@@ -3325,7 +3325,7 @@ rn = Ps([
|
|
|
3325
3325
|
], rn);
|
|
3326
3326
|
const ks = (i) => {
|
|
3327
3327
|
var v;
|
|
3328
|
-
const t = qe(
|
|
3328
|
+
const t = qe(X), e = qe(nt), n = qe(ie), r = qe(J), { drawings: s } = i, o = s[0];
|
|
3329
3329
|
if (o == null)
|
|
3330
3330
|
return;
|
|
3331
3331
|
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
@@ -3461,46 +3461,46 @@ const Fs = {
|
|
|
3461
3461
|
}
|
|
3462
3462
|
}
|
|
3463
3463
|
};
|
|
3464
|
-
function
|
|
3464
|
+
function st(i) {
|
|
3465
3465
|
return !i.getContextValue(ti) && !i.getContextValue(ni) && !i.getContextValue(ri) && i.getContextValue($e);
|
|
3466
3466
|
}
|
|
3467
3467
|
const xs = {
|
|
3468
|
-
id:
|
|
3468
|
+
id: it.id,
|
|
3469
3469
|
description: "shortcut.drawing-move-down",
|
|
3470
3470
|
group: "4_drawing-view",
|
|
3471
3471
|
binding: Fe.ARROW_DOWN,
|
|
3472
3472
|
priority: 100,
|
|
3473
|
-
preconditions:
|
|
3473
|
+
preconditions: st,
|
|
3474
3474
|
staticParameters: {
|
|
3475
3475
|
direction: _e.DOWN
|
|
3476
3476
|
}
|
|
3477
3477
|
}, Ys = {
|
|
3478
|
-
id:
|
|
3478
|
+
id: it.id,
|
|
3479
3479
|
description: "shortcut.drawing-move-up",
|
|
3480
3480
|
group: "4_drawing-view",
|
|
3481
3481
|
binding: Fe.ARROW_UP,
|
|
3482
3482
|
priority: 100,
|
|
3483
|
-
preconditions:
|
|
3483
|
+
preconditions: st,
|
|
3484
3484
|
staticParameters: {
|
|
3485
3485
|
direction: _e.UP
|
|
3486
3486
|
}
|
|
3487
|
-
},
|
|
3488
|
-
id:
|
|
3487
|
+
}, Gs = {
|
|
3488
|
+
id: it.id,
|
|
3489
3489
|
description: "shortcut.drawing-move-left",
|
|
3490
3490
|
group: "4_drawing-view",
|
|
3491
3491
|
binding: Fe.ARROW_LEFT,
|
|
3492
3492
|
priority: 100,
|
|
3493
|
-
preconditions:
|
|
3493
|
+
preconditions: st,
|
|
3494
3494
|
staticParameters: {
|
|
3495
3495
|
direction: _e.LEFT
|
|
3496
3496
|
}
|
|
3497
|
-
},
|
|
3498
|
-
id:
|
|
3497
|
+
}, Xs = {
|
|
3498
|
+
id: it.id,
|
|
3499
3499
|
description: "shortcut.drawing-move-right",
|
|
3500
3500
|
group: "4_drawing-view",
|
|
3501
3501
|
binding: Fe.ARROW_RIGHT,
|
|
3502
3502
|
priority: 100,
|
|
3503
|
-
preconditions:
|
|
3503
|
+
preconditions: st,
|
|
3504
3504
|
staticParameters: {
|
|
3505
3505
|
direction: _e.RIGHT
|
|
3506
3506
|
}
|
|
@@ -3509,7 +3509,7 @@ const xs = {
|
|
|
3509
3509
|
description: "shortcut.drawing-delete",
|
|
3510
3510
|
group: "4_drawing-view",
|
|
3511
3511
|
// when focusing on any other input tag do not trigger this shortcut
|
|
3512
|
-
preconditions:
|
|
3512
|
+
preconditions: st,
|
|
3513
3513
|
binding: Fe.DELETE,
|
|
3514
3514
|
mac: Fe.BACKSPACE
|
|
3515
3515
|
};
|
|
@@ -3517,7 +3517,7 @@ var Vs = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
|
|
|
3517
3517
|
for (var r = n > 1 ? void 0 : n ? Vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3518
3518
|
(o = i[s]) && (r = o(r) || r);
|
|
3519
3519
|
return r;
|
|
3520
|
-
},
|
|
3520
|
+
}, Ne = (i, t) => (e, n) => t(e, n, i);
|
|
3521
3521
|
let Ut = class extends ne {
|
|
3522
3522
|
constructor(i, t, e, n, r, s) {
|
|
3523
3523
|
super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
@@ -3534,14 +3534,14 @@ let Ut = class extends ne {
|
|
|
3534
3534
|
Bt,
|
|
3535
3535
|
dn,
|
|
3536
3536
|
kt,
|
|
3537
|
-
|
|
3537
|
+
rt,
|
|
3538
3538
|
Wt,
|
|
3539
3539
|
wr,
|
|
3540
3540
|
Y,
|
|
3541
3541
|
_r,
|
|
3542
3542
|
gr,
|
|
3543
3543
|
mr,
|
|
3544
|
-
|
|
3544
|
+
it,
|
|
3545
3545
|
hr,
|
|
3546
3546
|
fr
|
|
3547
3547
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
@@ -3551,8 +3551,8 @@ let Ut = class extends ne {
|
|
|
3551
3551
|
// sheet drawing shortcuts
|
|
3552
3552
|
xs,
|
|
3553
3553
|
Ys,
|
|
3554
|
-
Xs,
|
|
3555
3554
|
Gs,
|
|
3555
|
+
Xs,
|
|
3556
3556
|
Ls
|
|
3557
3557
|
].forEach((i) => {
|
|
3558
3558
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
@@ -3563,12 +3563,12 @@ let Ut = class extends ne {
|
|
|
3563
3563
|
}
|
|
3564
3564
|
};
|
|
3565
3565
|
Ut = Hs([
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3566
|
+
Ne(0, A(dr)),
|
|
3567
|
+
Ne(1, Fi),
|
|
3568
|
+
Ne(2, X),
|
|
3569
|
+
Ne(3, xi),
|
|
3570
|
+
Ne(4, ie),
|
|
3571
|
+
Ne(5, A(on))
|
|
3572
3572
|
], Ut);
|
|
3573
3573
|
var zs = Object.defineProperty, Ks = Object.getOwnPropertyDescriptor, Js = (i, t, e) => t in i ? zs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Zs = (i, t, e, n) => {
|
|
3574
3574
|
for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -3588,7 +3588,7 @@ let Pt = class extends oi {
|
|
|
3588
3588
|
}
|
|
3589
3589
|
onStarting() {
|
|
3590
3590
|
ci(this._injector, [
|
|
3591
|
-
[
|
|
3591
|
+
[tt],
|
|
3592
3592
|
[Ut],
|
|
3593
3593
|
[Rt],
|
|
3594
3594
|
[Ot],
|
|
@@ -3598,7 +3598,7 @@ let Pt = class extends oi {
|
|
|
3598
3598
|
[Mt],
|
|
3599
3599
|
[yt]
|
|
3600
3600
|
]), xt(this._injector, [
|
|
3601
|
-
[
|
|
3601
|
+
[tt]
|
|
3602
3602
|
]);
|
|
3603
3603
|
}
|
|
3604
3604
|
onReady() {
|
|
@@ -3621,7 +3621,7 @@ let Pt = class extends oi {
|
|
|
3621
3621
|
}
|
|
3622
3622
|
_registerRenderModules() {
|
|
3623
3623
|
[
|
|
3624
|
-
[
|
|
3624
|
+
[et],
|
|
3625
3625
|
[rn],
|
|
3626
3626
|
[nn],
|
|
3627
3627
|
[tn]
|
|
@@ -3633,8 +3633,8 @@ let Pt = class extends oi {
|
|
|
3633
3633
|
Dr(Pt, "type", F.UNIVER_SHEET);
|
|
3634
3634
|
Dr(Pt, "pluginName", qs);
|
|
3635
3635
|
Pt = Zs([
|
|
3636
|
-
ii(Ui,
|
|
3637
|
-
Lt(1, A(
|
|
3636
|
+
ii(Ui, Gi, Ki, di),
|
|
3637
|
+
Lt(1, A(Ge)),
|
|
3638
3638
|
Lt(2, J),
|
|
3639
3639
|
Lt(3, si)
|
|
3640
3640
|
], Pt);
|
|
@@ -3645,13 +3645,13 @@ export {
|
|
|
3645
3645
|
gr as GroupSheetDrawingCommand,
|
|
3646
3646
|
Bt as InsertFloatImageCommand,
|
|
3647
3647
|
kt as InsertSheetDrawingCommand,
|
|
3648
|
-
|
|
3649
|
-
|
|
3648
|
+
it as MoveDrawingsCommand,
|
|
3649
|
+
rt as RemoveSheetDrawingCommand,
|
|
3650
3650
|
Cr as SHEETS_IMAGE_MENU_ID,
|
|
3651
3651
|
fr as SetDrawingArrangeCommand,
|
|
3652
3652
|
Wt as SetSheetDrawingCommand,
|
|
3653
|
-
|
|
3654
|
-
|
|
3653
|
+
tt as SheetCanvasFloatDomManagerService,
|
|
3654
|
+
et as SheetDrawingUpdateController,
|
|
3655
3655
|
wr as SidebarSheetDrawingOperation,
|
|
3656
3656
|
mr as UngroupSheetDrawingCommand,
|
|
3657
3657
|
Pt as UniverSheetsDrawingUIPlugin,
|