@univerjs/sheets-drawing-ui 0.6.0-nightly.202502111606 → 0.6.0-nightly.202502121606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +59 -59
- package/lib/types/facade/index.d.ts +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/locale/zh-CN.d.ts +1 -1
- package/lib/types/views/sheet-image-panel/SheetDrawingPanel.d.ts +1 -1
- package/lib/types/views/sheet-image-panel/component-name.d.ts +1 -1
- package/lib/types/views/upload-component/component-name.d.ts +1 -1
- package/lib/types/views/upload-loading/UploadLoading.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var Or = Object.defineProperty;
|
|
2
2
|
var Pr = (i, n, e) => n in i ? Or(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
3
|
var Q = (i, n, e) => Pr(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
-
import { CommandType as te, ICommandService as G, IUndoRedoService as Ye, sequenceExecute as jn, LocaleService as xt, IUniverInstanceService as Ge,
|
|
5
|
-
import { DocDrawingController as
|
|
6
|
-
import { SetDrawingSelectedOperation as Lt, IImageIoService as Wn, IDrawingManagerService as oe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as wn, DRAWING_IMAGE_COUNT_LIMIT as _n, ImageUploadStatusType as Be, DRAWING_IMAGE_ALLOW_SIZE as vn, getImageSize as Sn, DRAWING_IMAGE_WIDTH_LIMIT as In, DRAWING_IMAGE_HEIGHT_LIMIT as Cn, ImageSourceType as
|
|
7
|
-
import { ImageCropperObject as
|
|
8
|
-
import { IRenderManagerService as ne, precisionTo as vt, getGroupState as
|
|
9
|
-
import { ISheetDrawingService as ae, SetDrawingApplyMutation as U, DrawingApplyType as A, SheetDrawingAnchorType as P, UniverSheetsDrawingPlugin as
|
|
10
|
-
import { SheetCanvasPopManagerService as
|
|
11
|
-
import { ISidebarService as
|
|
4
|
+
import { CommandType as te, ICommandService as G, IUndoRedoService as Ye, sequenceExecute as jn, LocaleService as xt, IUniverInstanceService as Ge, Inject as N, Injector as tt, IContextService as Bn, RxDisposable as Ur, UniverInstanceType as k, toDisposable as Ar, FOCUSING_COMMON_DRAWINGS as Fe, DrawingTypeEnum as F, Disposable as le, ArrangeTypeEnum as mt, createDocumentModelWithStyle as Nr, ObjectRelativeFromH as jr, ObjectRelativeFromV as Br, BooleanNumber as Wr, PositionedObjectLayoutType as $r, WrapTextType as xr, BuildTextUtils as Lr, Range as Fr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as wt, InterceptorEffectEnum as kr, ObjectMatrix as Yr, Tools as ye, UserManagerService as Gr, IPermissionService as Xr, Rectangle as Vr, Direction as Ie, FOCUSING_FX_BAR_EDITOR as Hr, EDITOR_ACTIVATED as zr, FOCUSING_PANEL_EDITOR as Kr, LifecycleService as Zr, LifecycleStages as Jr, DisposableCollection as _t, fromEventSubject as qr, generateRandomId as Ht, DependentOn as Qr, Plugin as ei, merge as ti, registerDependencies as ni, touchDependencies as zt, IConfigService as ri } from "@univerjs/core";
|
|
5
|
+
import { DocDrawingController as ii, UniverDocsDrawingPlugin as si } from "@univerjs/docs-drawing";
|
|
6
|
+
import { SetDrawingSelectedOperation as Lt, IImageIoService as Wn, IDrawingManagerService as oe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as wn, DRAWING_IMAGE_COUNT_LIMIT as _n, ImageUploadStatusType as Be, DRAWING_IMAGE_ALLOW_SIZE as vn, getImageSize as Sn, DRAWING_IMAGE_WIDTH_LIMIT as In, DRAWING_IMAGE_HEIGHT_LIMIT as Cn, ImageSourceType as oi, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as ai } from "@univerjs/drawing";
|
|
7
|
+
import { ImageCropperObject as ci, COMPONENT_IMAGE_POPUP_MENU as di, OpenImageCropOperation as li, ImageResetSizeOperation as ui, DrawingRenderService as $n, DrawingCommonPanel as hi, UniverDrawingUIPlugin as gi } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as ne, precisionTo as vt, getGroupState as fi, transformObjectOutOfGroup as mi, RENDER_CLASS_TYPE as We, Rect as $e, ObjectType as bn, DRAWING_OBJECT_LAYER_INDEX as Kt, SHEET_VIEWPORT_KEY as xn } from "@univerjs/engine-render";
|
|
9
|
+
import { ISheetDrawingService as ae, SetDrawingApplyMutation as U, DrawingApplyType as A, SheetDrawingAnchorType as P, UniverSheetsDrawingPlugin as pi } from "@univerjs/sheets-drawing";
|
|
10
|
+
import { SheetCanvasPopManagerService as wi, convertPositionSheetOverGridToAbsolute as _i, ISheetSelectionRenderService as Xe, SheetSkeletonManagerService as V, attachRangeWithCoord as Ln, IEditorBridgeService as vi, IAutoFillService as Si, HoverManagerService as Ii, PREDEFINED_HOOK_NAME as Le, COPY_TYPE as be, discreteRangeToRange as Rn, virtualizeDiscreteRanges as Ci, ISheetClipboardService as bi, SheetPrintInterceptorService as Ri, getCurrentRangeDisable$ as Di, SetZoomRatioOperation as Dn, SetScrollOperation as Mi } from "@univerjs/sheets-ui";
|
|
11
|
+
import { ISidebarService as yi, useDependency as Te, IUIPartsService as Ti, BuiltInUIPart as Ei, connectInjector as Oi, ILocalFileService as Pi, IMessageService as Ui, IClipboardInterfaceService as Ai, MenuItemType as cn, getMenuHiddenObservable as Fn, RibbonStartGroup as Ni, KeyCode as ke, ComponentManager as ji, IMenuManagerService as Bi, IShortcutService as Wi, CanvasFloatDomService as $i } from "@univerjs/ui";
|
|
12
12
|
import { takeUntil as Mn, combineLatest as St, switchMap as Se, EMPTY as pe, tap as yn, map as Ee, distinctUntilChanged as Tn, Subject as Zt, filter as xi, take as Li, BehaviorSubject as Ze, of as En } from "rxjs";
|
|
13
13
|
import { SheetInterceptorService as Ft, getSheetCommandTarget as H, SheetsSelectionsService as dn, SetRangeValuesCommand as Fi, SetWorksheetRowHeightMutation as kn, SetWorksheetColWidthMutation as Yn, SetWorksheetRowIsAutoHeightMutation as ki, SetWorksheetRowAutoHeightMutation as Gn, AddWorksheetMergeMutation as Yi, RemoveWorksheetMergeMutation as Gi, AFTER_CELL_EDIT as Xi, INTERCEPTOR_POINT as Vi, InterceptCellContentPriority as Hi, WorkbookViewPermission as On, WorksheetViewPermission as Pn, WorkbookEditablePermission as Qt, WorksheetEditPermission as en, InsertRowCommand as Xn, InsertColCommand as Vn, RemoveRowCommand as Hn, RemoveColCommand as zn, DeleteRangeMoveLeftCommand as Kn, DeleteRangeMoveUpCommand as Zn, InsertRangeMoveDownCommand as Jn, InsertRangeMoveRightCommand as qn, DeltaRowHeightCommand as tn, SetRowHeightCommand as nn, 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 zi, SetRowHiddenMutation as Ki, SetColVisibleMutation as Zi, SetColHiddenMutation as Ji, SetWorksheetActiveOperation as qi, RangeProtectionPermissionEditPoint as Qi, SetFrozenMutation as es, COMMAND_LISTENER_SKELETON_CHANGE as ts } from "@univerjs/sheets";
|
|
14
14
|
import { jsx as ee, jsxs as Tt } from "react/jsx-runtime";
|
|
@@ -58,7 +58,7 @@ const as = "sheets-drawing-ui.config", Un = {}, L = {
|
|
|
58
58
|
id: "sidebar.operation.sheet-image",
|
|
59
59
|
type: te.COMMAND,
|
|
60
60
|
handler: async (i, n) => {
|
|
61
|
-
const e = i.get(
|
|
61
|
+
const e = i.get(yi), t = i.get(xt), r = i.get(Ge), s = i.get(G);
|
|
62
62
|
if (!H(r)) return !1;
|
|
63
63
|
switch (n.value) {
|
|
64
64
|
case "open":
|
|
@@ -92,7 +92,7 @@ const as = "sheets-drawing-ui.config", Un = {}, L = {
|
|
|
92
92
|
univerCircleAnimation: us,
|
|
93
93
|
uploadLoadingBodyText: hs
|
|
94
94
|
}, gs = () => {
|
|
95
|
-
const i =
|
|
95
|
+
const i = Te(Wn), n = Te(xt), [e, t] = ns.useState(0);
|
|
96
96
|
return ln(() => {
|
|
97
97
|
const r = i.change$.subscribe((s) => {
|
|
98
98
|
t(s);
|
|
@@ -117,7 +117,7 @@ let Et = class extends Ur {
|
|
|
117
117
|
this._injector = n, this._drawingManagerService = e, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._commandService = c, this._init();
|
|
118
118
|
}
|
|
119
119
|
_init() {
|
|
120
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(Mn(this.dispose$)).subscribe((n) => this._create(n)), this._univerInstanceService.getTypeOfUnitDisposed$(k.UNIVER_SHEET).pipe(Mn(this.dispose$)).subscribe((n) => this._dispose(n)), this._univerInstanceService.getAllUnitsForType(k.UNIVER_SHEET).forEach((n) => this._create(n)), this._uiPartsService.registerComponent(
|
|
120
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(Mn(this.dispose$)).subscribe((n) => this._create(n)), this._univerInstanceService.getTypeOfUnitDisposed$(k.UNIVER_SHEET).pipe(Mn(this.dispose$)).subscribe((n) => this._dispose(n)), this._univerInstanceService.getAllUnitsForType(k.UNIVER_SHEET).forEach((n) => this._create(n)), this._uiPartsService.registerComponent(Ei.CONTENT, () => Oi(gs, this._injector));
|
|
121
121
|
}
|
|
122
122
|
_dispose(n) {
|
|
123
123
|
const e = n.getUnitId();
|
|
@@ -132,7 +132,7 @@ let Et = class extends Ur {
|
|
|
132
132
|
_hasCropObject(n) {
|
|
133
133
|
const e = n.getAllObjectsByOrder();
|
|
134
134
|
for (const t of e)
|
|
135
|
-
if (t instanceof
|
|
135
|
+
if (t instanceof ci)
|
|
136
136
|
return !0;
|
|
137
137
|
return !1;
|
|
138
138
|
}
|
|
@@ -146,7 +146,7 @@ let Et = class extends Ur {
|
|
|
146
146
|
return;
|
|
147
147
|
let r;
|
|
148
148
|
this.disposeWithMe(
|
|
149
|
-
|
|
149
|
+
Ar(
|
|
150
150
|
t.createControl$.subscribe(() => {
|
|
151
151
|
if (this._contextService.setContextValue(Fe, !0), this._hasCropObject(e))
|
|
152
152
|
return;
|
|
@@ -167,7 +167,7 @@ let Et = class extends Ur {
|
|
|
167
167
|
r == null || r.dispose();
|
|
168
168
|
const p = this._canvasPopManagerService.getFeatureMenu(d, l, g, h);
|
|
169
169
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
170
|
-
componentKey:
|
|
170
|
+
componentKey: di,
|
|
171
171
|
direction: "horizontal",
|
|
172
172
|
offset: [2, 0],
|
|
173
173
|
extraProps: {
|
|
@@ -209,14 +209,14 @@ let Et = class extends Ur {
|
|
|
209
209
|
{
|
|
210
210
|
label: "image-popup.crop",
|
|
211
211
|
index: 2,
|
|
212
|
-
commandId:
|
|
212
|
+
commandId: li.id,
|
|
213
213
|
commandParams: { unitId: n, subUnitId: e, drawingId: t },
|
|
214
214
|
disable: r === F.DRAWING_DOM
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
label: "image-popup.reset",
|
|
218
218
|
index: 3,
|
|
219
|
-
commandId:
|
|
219
|
+
commandId: ui.id,
|
|
220
220
|
commandParams: [{ unitId: n, subUnitId: e, drawingId: t }],
|
|
221
221
|
disable: r === F.DRAWING_DOM
|
|
222
222
|
}
|
|
@@ -226,18 +226,18 @@ let Et = class extends Ur {
|
|
|
226
226
|
Et = ps([
|
|
227
227
|
we(0, N(tt)),
|
|
228
228
|
we(1, oe),
|
|
229
|
-
we(2, N(
|
|
229
|
+
we(2, N(wi)),
|
|
230
230
|
we(3, ne),
|
|
231
231
|
we(4, Ge),
|
|
232
232
|
we(5, Bn),
|
|
233
|
-
we(6, N(
|
|
233
|
+
we(6, N(Ti)),
|
|
234
234
|
we(7, G)
|
|
235
235
|
], Et);
|
|
236
236
|
function z(i, n, e) {
|
|
237
237
|
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: c = 0, skewY: u = 0 } = i, d = e.getCurrent();
|
|
238
238
|
if (d == null)
|
|
239
239
|
return;
|
|
240
|
-
const l =
|
|
240
|
+
const l = _i(
|
|
241
241
|
d.unitId,
|
|
242
242
|
d.sheetId,
|
|
243
243
|
{ from: t, to: r },
|
|
@@ -319,7 +319,7 @@ sn = vs([
|
|
|
319
319
|
function Ss(i) {
|
|
320
320
|
const n = [];
|
|
321
321
|
return i.forEach((e) => {
|
|
322
|
-
const { parent: t, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = t, c =
|
|
322
|
+
const { parent: t, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = t, c = fi(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
323
323
|
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = l;
|
|
324
324
|
return {
|
|
325
325
|
unitId: h,
|
|
@@ -352,7 +352,7 @@ function Is(i) {
|
|
|
352
352
|
if (c == null)
|
|
353
353
|
return;
|
|
354
354
|
const u = r.map((l) => {
|
|
355
|
-
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m =
|
|
355
|
+
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = mi(g || {}, c, c.width || 0, c.height || 0);
|
|
356
356
|
return {
|
|
357
357
|
unitId: h,
|
|
358
358
|
subUnitId: f,
|
|
@@ -606,7 +606,7 @@ let et = class extends le {
|
|
|
606
606
|
const d = this._workbookSelections.getCurrentLastSelection();
|
|
607
607
|
if (!d)
|
|
608
608
|
return !1;
|
|
609
|
-
const l =
|
|
609
|
+
const l = Nr("", {}), g = pr(
|
|
610
610
|
this._injector,
|
|
611
611
|
{
|
|
612
612
|
unitId: this._context.unitId,
|
|
@@ -626,11 +626,11 @@ let et = class extends le {
|
|
|
626
626
|
height: g.height
|
|
627
627
|
},
|
|
628
628
|
positionH: {
|
|
629
|
-
relativeFrom:
|
|
629
|
+
relativeFrom: jr.PAGE,
|
|
630
630
|
posOffset: 0
|
|
631
631
|
},
|
|
632
632
|
positionV: {
|
|
633
|
-
relativeFrom:
|
|
633
|
+
relativeFrom: Br.PARAGRAPH,
|
|
634
634
|
posOffset: 0
|
|
635
635
|
},
|
|
636
636
|
angle: 0
|
|
@@ -643,17 +643,17 @@ let et = class extends le {
|
|
|
643
643
|
source: s,
|
|
644
644
|
transform: is(h),
|
|
645
645
|
docTransform: h,
|
|
646
|
-
behindDoc:
|
|
646
|
+
behindDoc: Wr.FALSE,
|
|
647
647
|
title: "",
|
|
648
648
|
description: "",
|
|
649
|
-
layoutType:
|
|
649
|
+
layoutType: $r.INLINE,
|
|
650
650
|
// Insert inline drawing by default.
|
|
651
|
-
wrapText:
|
|
651
|
+
wrapText: xr.BOTH_SIDES,
|
|
652
652
|
distB: 0,
|
|
653
653
|
distL: 0,
|
|
654
654
|
distR: 0,
|
|
655
655
|
distT: 0
|
|
656
|
-
}, p =
|
|
656
|
+
}, p = Lr.drawing.add({
|
|
657
657
|
documentDataModel: l,
|
|
658
658
|
drawings: [f],
|
|
659
659
|
selection: {
|
|
@@ -842,7 +842,7 @@ let Ot = class extends le {
|
|
|
842
842
|
e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
843
843
|
}
|
|
844
844
|
n && e.length && e.forEach((t) => {
|
|
845
|
-
const r =
|
|
845
|
+
const r = Fr.transformRange(t, n.worksheet);
|
|
846
846
|
for (let s = r.startRow; s <= r.endRow; s++)
|
|
847
847
|
for (let o = r.startColumn; o <= r.endColumn; o++)
|
|
848
848
|
on(this._injector, { unitId: n.unitId, subUnitId: n.subUnitId, row: s, col: o }, n.worksheet.getCellRaw(s, o));
|
|
@@ -867,7 +867,7 @@ let Ot = class extends le {
|
|
|
867
867
|
this._sheetInterceptorService.intercept(
|
|
868
868
|
Vi.CELL_CONTENT,
|
|
869
869
|
{
|
|
870
|
-
effect:
|
|
870
|
+
effect: kr.Style,
|
|
871
871
|
priority: Hi.CELL_IMAGE,
|
|
872
872
|
handler: (i, n, e) => {
|
|
873
873
|
var t;
|
|
@@ -884,8 +884,8 @@ Ot = Ts([
|
|
|
884
884
|
De(2, Ge),
|
|
885
885
|
De(3, N(tt)),
|
|
886
886
|
De(4, oe),
|
|
887
|
-
De(5, N(
|
|
888
|
-
De(6, N(
|
|
887
|
+
De(5, N(ii)),
|
|
888
|
+
De(6, N(vi))
|
|
889
889
|
], Ot);
|
|
890
890
|
var Es = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, Ps = (i, n, e, t) => {
|
|
891
891
|
for (var r = t > 1 ? void 0 : t ? Os(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -901,7 +901,7 @@ let Pt = class extends le {
|
|
|
901
901
|
this._autoFillService.addHook({
|
|
902
902
|
id: "sheet-cell-image-autofill",
|
|
903
903
|
onBeforeSubmit: (i, n, e, t) => {
|
|
904
|
-
new
|
|
904
|
+
new Yr(t).forValue((r, s, o) => {
|
|
905
905
|
on(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
906
906
|
});
|
|
907
907
|
}
|
|
@@ -910,7 +910,7 @@ let Pt = class extends le {
|
|
|
910
910
|
}
|
|
911
911
|
};
|
|
912
912
|
Pt = Ps([
|
|
913
|
-
An(0, N(
|
|
913
|
+
An(0, N(Si)),
|
|
914
914
|
An(1, N(tt))
|
|
915
915
|
], Pt);
|
|
916
916
|
var Us = Object.defineProperty, As = Object.getOwnPropertyDescriptor, Ns = (i, n, e, t) => {
|
|
@@ -930,7 +930,7 @@ let Ut = class extends le {
|
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
932
|
Ut = Ns([
|
|
933
|
-
bt(0, N(
|
|
933
|
+
bt(0, N(Ii)),
|
|
934
934
|
bt(1, N(ne)),
|
|
935
935
|
bt(2, N(dn)),
|
|
936
936
|
bt(3, N($n))
|
|
@@ -1018,7 +1018,7 @@ let At = class extends le {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
setTimeout(() => {
|
|
1020
1020
|
const c = Ls();
|
|
1021
|
-
o.drawingType === F.DRAWING_IMAGE && o.imageSourceType ===
|
|
1021
|
+
o.drawingType === F.DRAWING_IMAGE && o.imageSourceType === oi.BASE64 ? xs(o.source) : this._clipboardInterfaceService.writeText(""), c();
|
|
1022
1022
|
}, 200);
|
|
1023
1023
|
const a = {
|
|
1024
1024
|
unitId: o.unitId,
|
|
@@ -1132,7 +1132,7 @@ let At = class extends le {
|
|
|
1132
1132
|
...d,
|
|
1133
1133
|
unitId: t,
|
|
1134
1134
|
subUnitId: r,
|
|
1135
|
-
drawingId: o ? d.drawingId :
|
|
1135
|
+
drawingId: o ? d.drawingId : ye.generateRandomId(),
|
|
1136
1136
|
transform: h.transform,
|
|
1137
1137
|
sheetTransform: h.sheetTransform
|
|
1138
1138
|
};
|
|
@@ -1186,7 +1186,7 @@ let At = class extends le {
|
|
|
1186
1186
|
pasteTo: { unitId: t, subUnitId: r, range: Rn(o) },
|
|
1187
1187
|
pasteType: s
|
|
1188
1188
|
}, c);
|
|
1189
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1189
|
+
const { ranges: [l, g], mapFunc: h } = Ci([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1190
1190
|
startRow: f,
|
|
1191
1191
|
endRow: f,
|
|
1192
1192
|
startColumn: p,
|
|
@@ -1231,7 +1231,7 @@ let At = class extends le {
|
|
|
1231
1231
|
}
|
|
1232
1232
|
};
|
|
1233
1233
|
At = Ws([
|
|
1234
|
-
Je(0,
|
|
1234
|
+
Je(0, bi),
|
|
1235
1235
|
Je(1, ne),
|
|
1236
1236
|
Je(2, oe),
|
|
1237
1237
|
Je(3, Ai),
|
|
@@ -1413,9 +1413,9 @@ let Nt = class extends le {
|
|
|
1413
1413
|
Nt = Ys([
|
|
1414
1414
|
qe(0, oe),
|
|
1415
1415
|
qe(1, ne),
|
|
1416
|
-
qe(2,
|
|
1416
|
+
qe(2, Xr),
|
|
1417
1417
|
qe(3, Ge),
|
|
1418
|
-
qe(4, N(
|
|
1418
|
+
qe(4, N(Gr))
|
|
1419
1419
|
], Nt);
|
|
1420
1420
|
var Gs = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, Vs = (i, n, e, t) => {
|
|
1421
1421
|
for (var r = t > 1 ? void 0 : t ? Xs(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1455,7 +1455,7 @@ let jt = class extends le {
|
|
|
1455
1455
|
return e(i);
|
|
1456
1456
|
const { scaleX: u, scaleY: d } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = c.order.map((h) => c.data[h]).filter((h) => h.drawingType !== F.DRAWING_DOM);
|
|
1457
1457
|
return g.length ? (g.forEach((h) => {
|
|
1458
|
-
if (!h.groupId && h.transform &&
|
|
1458
|
+
if (!h.groupId && h.transform && ye.isDefine(h.transform.left) && ye.isDefine(h.transform.top) && ye.isDefine(h.transform.width) && ye.isDefine(h.transform.height)) {
|
|
1459
1459
|
const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, d, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, d, { x: 0, y: 0 });
|
|
1460
1460
|
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);
|
|
1461
1461
|
}
|
|
@@ -1467,7 +1467,7 @@ let jt = class extends le {
|
|
|
1467
1467
|
}
|
|
1468
1468
|
};
|
|
1469
1469
|
jt = Vs([
|
|
1470
|
-
Rt(0, N(
|
|
1470
|
+
Rt(0, N(Ri)),
|
|
1471
1471
|
Rt(1, N($n)),
|
|
1472
1472
|
Rt(2, oe),
|
|
1473
1473
|
Rt(3, ne)
|
|
@@ -2224,7 +2224,7 @@ let an = class extends le {
|
|
|
2224
2224
|
const { from: d, to: l } = a, { row: g, column: h } = d, { row: f, column: p } = l;
|
|
2225
2225
|
for (let m = 0; m < e.length; m++) {
|
|
2226
2226
|
const w = e[m], { startRow: S, endRow: C, startColumn: D, endColumn: v } = w;
|
|
2227
|
-
if (
|
|
2227
|
+
if (Vr.intersects(
|
|
2228
2228
|
{
|
|
2229
2229
|
startRow: S,
|
|
2230
2230
|
endRow: C,
|
|
@@ -2366,7 +2366,7 @@ function ro(i) {
|
|
|
2366
2366
|
icon: Cr,
|
|
2367
2367
|
tooltip: "sheetImage.title",
|
|
2368
2368
|
hidden$: Fn(i, k.UNIVER_SHEET),
|
|
2369
|
-
disabled$:
|
|
2369
|
+
disabled$: Di(i, { workbookTypes: [Qt], worksheetTypes: [en], rangeTypes: [Qi] })
|
|
2370
2370
|
};
|
|
2371
2371
|
}
|
|
2372
2372
|
function io(i) {
|
|
@@ -2416,7 +2416,7 @@ function Dt() {
|
|
|
2416
2416
|
}
|
|
2417
2417
|
const Co = (i) => {
|
|
2418
2418
|
var C;
|
|
2419
|
-
const n =
|
|
2419
|
+
const n = Te(G), e = Te(xt), t = Te(oe), r = Te(ne), { drawings: s } = i, o = s[0];
|
|
2420
2420
|
if (o == null)
|
|
2421
2421
|
return;
|
|
2422
2422
|
const { unitId: a } = o, c = r.getRenderById(a), u = c == null ? void 0 : c.scene;
|
|
@@ -2484,7 +2484,7 @@ const Co = (i) => {
|
|
|
2484
2484
|
] }) }) })
|
|
2485
2485
|
] });
|
|
2486
2486
|
}, bo = () => {
|
|
2487
|
-
const i =
|
|
2487
|
+
const i = Te(oe), n = i.getFocusDrawings(), [e, t] = rn(n);
|
|
2488
2488
|
return ln(() => {
|
|
2489
2489
|
const r = i.focus$.subscribe((s) => {
|
|
2490
2490
|
t(s);
|
|
@@ -2493,7 +2493,7 @@ const Co = (i) => {
|
|
|
2493
2493
|
r.unsubscribe();
|
|
2494
2494
|
};
|
|
2495
2495
|
}, []), !!(e != null && e.length) && /* @__PURE__ */ Tt("div", { className: ve.imageCommonPanel, children: [
|
|
2496
|
-
/* @__PURE__ */ ee(
|
|
2496
|
+
/* @__PURE__ */ ee(hi, { drawings: e }),
|
|
2497
2497
|
/* @__PURE__ */ ee(Co, { drawings: e })
|
|
2498
2498
|
] });
|
|
2499
2499
|
}, Ro = {
|
|
@@ -2513,7 +2513,7 @@ const Co = (i) => {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
};
|
|
2515
2515
|
function it(i) {
|
|
2516
|
-
return !i.getContextValue(
|
|
2516
|
+
return !i.getContextValue(Hr) && !i.getContextValue(zr) && !i.getContextValue(Kr) && i.getContextValue(Fe);
|
|
2517
2517
|
}
|
|
2518
2518
|
const Do = {
|
|
2519
2519
|
id: rt.id,
|
|
@@ -2643,7 +2643,7 @@ function Bo(i, n, e, t, r) {
|
|
|
2643
2643
|
top: M,
|
|
2644
2644
|
left: E
|
|
2645
2645
|
};
|
|
2646
|
-
b && (
|
|
2646
|
+
b && (ye.isDefine(y.top) && (y.top = b.top), ye.isDefine(y.left) && (y.left = b.left)), _ === "HORIZONTAL" && (v = 0), _ === "VERTICAL" && (D = 0);
|
|
2647
2647
|
let T = 0, I = 0;
|
|
2648
2648
|
const R = e.rowStartY(d - g) + M, O = e.colStartX(u - l) + E, B = e.rowStartY(d) + M, K = e.colStartX(u) + E;
|
|
2649
2649
|
if (l === 0)
|
|
@@ -2706,7 +2706,7 @@ let Wt = class extends le {
|
|
|
2706
2706
|
this._renderManagerService = n, this._univerInstanceService = e, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
2707
2707
|
}
|
|
2708
2708
|
_bindScrollEvent() {
|
|
2709
|
-
this._lifecycleService.lifecycle$.pipe(xi((n) => n ===
|
|
2709
|
+
this._lifecycleService.lifecycle$.pipe(xi((n) => n === Jr.Rendered), Li(1)).subscribe(() => {
|
|
2710
2710
|
this._scrollUpdateListener();
|
|
2711
2711
|
});
|
|
2712
2712
|
}
|
|
@@ -2855,7 +2855,7 @@ let Wt = class extends le {
|
|
|
2855
2855
|
return r ? { render: r, unitId: t, subUnitId: e.getSheetId() } : null;
|
|
2856
2856
|
}),
|
|
2857
2857
|
Se(
|
|
2858
|
-
(e) => e ?
|
|
2858
|
+
(e) => e ? qr(e.render.scene.getViewport(xn.VIEW_MAIN).onScrollAfter$).pipe(Ee(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : En(null)
|
|
2859
2859
|
)
|
|
2860
2860
|
).subscribe((e) => {
|
|
2861
2861
|
if (!e) return;
|
|
@@ -3356,7 +3356,7 @@ let Wt = class extends le {
|
|
|
3356
3356
|
d();
|
|
3357
3357
|
return;
|
|
3358
3358
|
}
|
|
3359
|
-
(ts.indexOf(m.id) > -1 || m.id ===
|
|
3359
|
+
(ts.indexOf(m.id) > -1 || m.id === Mi.id || m.id === Dn.id) && d();
|
|
3360
3360
|
}));
|
|
3361
3361
|
const g = (m, w) => {
|
|
3362
3362
|
r = m, s = w, d();
|
|
@@ -3407,7 +3407,7 @@ Wt = jo([
|
|
|
3407
3407
|
Me(3, oe),
|
|
3408
3408
|
Me(4, N($i)),
|
|
3409
3409
|
Me(5, ae),
|
|
3410
|
-
Me(6, N(
|
|
3410
|
+
Me(6, N(Zr))
|
|
3411
3411
|
], Wt);
|
|
3412
3412
|
function Qe(i, n, e) {
|
|
3413
3413
|
const t = e.getCellWithCoordByIndex(i, n), r = t.isMergedMainCell ? t.mergeInfo : t;
|
|
@@ -3461,10 +3461,10 @@ var Dr = Object.defineProperty, Wo = Object.getOwnPropertyDescriptor, $o = (i, n
|
|
|
3461
3461
|
return t && r && Dr(n, e, r), r;
|
|
3462
3462
|
}, qt = (i, n) => (e, t) => n(e, t, i), Mr = (i, n, e) => $o(i, typeof n != "symbol" ? n + "" : n, e);
|
|
3463
3463
|
const Lo = "SHEET_IMAGE_UI_PLUGIN";
|
|
3464
|
-
let $t = class extends
|
|
3464
|
+
let $t = class extends ei {
|
|
3465
3465
|
constructor(i = Un, n, e, t) {
|
|
3466
3466
|
super(), this._config = i, this._injector = n, this._renderManagerService = e, this._configService = t;
|
|
3467
|
-
const { menu: r, ...s } =
|
|
3467
|
+
const { menu: r, ...s } = ti(
|
|
3468
3468
|
{},
|
|
3469
3469
|
Un,
|
|
3470
3470
|
this._config
|
|
@@ -3472,7 +3472,7 @@ let $t = class extends ti {
|
|
|
3472
3472
|
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(as, s);
|
|
3473
3473
|
}
|
|
3474
3474
|
onStarting() {
|
|
3475
|
-
|
|
3475
|
+
ni(this._injector, [
|
|
3476
3476
|
[Wt],
|
|
3477
3477
|
[Bt],
|
|
3478
3478
|
[Et],
|
|
@@ -3517,10 +3517,10 @@ let $t = class extends ti {
|
|
|
3517
3517
|
Mr($t, "type", k.UNIVER_SHEET);
|
|
3518
3518
|
Mr($t, "pluginName", Lo);
|
|
3519
3519
|
$t = xo([
|
|
3520
|
-
|
|
3520
|
+
Qr(ai, si, gi, pi),
|
|
3521
3521
|
qt(1, N(tt)),
|
|
3522
3522
|
qt(2, ne),
|
|
3523
|
-
qt(3,
|
|
3523
|
+
qt(3, ri)
|
|
3524
3524
|
], $t);
|
|
3525
3525
|
export {
|
|
3526
3526
|
L as ClearSheetDrawingTransformerOperation,
|
package/lib/types/index.d.ts
CHANGED