@univerjs/sheets-drawing-ui 0.5.5 → 0.6.0-alpha.0
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 -9
- package/lib/es/facade.js +3 -0
- package/lib/es/index.js +1605 -1383
- package/lib/types/controllers/sheet-drawing-copy-paste.controller.d.ts +11 -5
- package/lib/types/controllers/sheet-drawing-update.controller.d.ts +2 -2
- package/lib/types/controllers/sheet-drawing.controller.d.ts +5 -1
- package/lib/types/facade/f-enum.d.ts +3 -0
- package/lib/types/facade/f-event.d.ts +6 -0
- package/lib/types/facade/f-over-grid-image.d.ts +6 -0
- package/lib/types/facade/f-univer.d.ts +6 -0
- package/lib/types/facade/f-worksheet.d.ts +5 -5
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +13 -4
- package/lib/types/views/sheet-image-panel/SheetDrawingAnchor.d.ts +1 -2
- package/lib/types/views/sheet-image-panel/SheetDrawingPanel.d.ts +16 -2
- package/lib/types/views/upload-loading/UploadLoading.d.ts +16 -2
- package/lib/umd/index.js +1 -9
- package/package.json +16 -16
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { Disposable } from '@univerjs/core';
|
|
1
|
+
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
|
+
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
2
3
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
-
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
|
|
4
4
|
import { ISheetClipboardService } from '@univerjs/sheets-ui';
|
|
5
|
+
import { IClipboardInterfaceService } from '@univerjs/ui';
|
|
5
6
|
export declare class SheetsDrawingCopyPasteController extends Disposable {
|
|
6
7
|
private _sheetClipboardService;
|
|
7
8
|
private readonly _renderManagerService;
|
|
8
|
-
private readonly
|
|
9
|
+
private readonly _drawingService;
|
|
10
|
+
private readonly _clipboardInterfaceService;
|
|
11
|
+
private readonly _commandService;
|
|
9
12
|
private _copyInfo;
|
|
10
|
-
constructor(_sheetClipboardService: ISheetClipboardService, _renderManagerService: IRenderManagerService,
|
|
13
|
+
constructor(_sheetClipboardService: ISheetClipboardService, _renderManagerService: IRenderManagerService, _drawingService: IDrawingManagerService, _clipboardInterfaceService: IClipboardInterfaceService, _commandService: ICommandService);
|
|
14
|
+
private get _focusedDrawings();
|
|
11
15
|
private _initCopyPaste;
|
|
12
|
-
private
|
|
16
|
+
private _createDrawingsCopyInfoByRange;
|
|
17
|
+
private _generateSingleDrawingPasteMutations;
|
|
13
18
|
private _generateMutations;
|
|
19
|
+
private _generateRangeDrawingsPasteMutations;
|
|
14
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAccessor, Workbook, Disposable, ICommandService, IContextService, Injector, LocaleService } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
2
3
|
import { ISheetLocationBase, SheetsSelectionsService } from '@univerjs/sheets';
|
|
3
4
|
import { IDrawingManagerService, IImageIoService } from '@univerjs/drawing';
|
|
4
|
-
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
5
5
|
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
|
|
6
6
|
import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
|
|
7
7
|
import { ILocalFileService, IMessageService } from '@univerjs/ui';
|
|
@@ -35,7 +35,7 @@ export declare class SheetDrawingUpdateController extends Disposable implements
|
|
|
35
35
|
constructor(_context: IRenderContext<Workbook>, _skeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService, _selectionRenderService: ISheetSelectionRenderService, _imageIoService: IImageIoService, _fileOpenerService: ILocalFileService, _sheetDrawingService: ISheetDrawingService, _drawingManagerService: IDrawingManagerService, _contextService: IContextService, _messageService: IMessageService, _localeService: LocaleService, selectionManagerService: SheetsSelectionsService, _injector: Injector);
|
|
36
36
|
insertFloatImage(): Promise<boolean>;
|
|
37
37
|
insertCellImage(): Promise<boolean>;
|
|
38
|
-
|
|
38
|
+
insertFloatImageByFile(file: File): Promise<boolean | undefined>;
|
|
39
39
|
private _insertCellImage;
|
|
40
40
|
private _getUnitInfo;
|
|
41
41
|
private _getImagePosition;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
|
+
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
3
|
+
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
2
4
|
import { ComponentManager, IMenuManagerService, IShortcutService } from '@univerjs/ui';
|
|
3
5
|
export declare class SheetDrawingUIController extends Disposable {
|
|
4
6
|
private readonly _componentManager;
|
|
5
7
|
private readonly _menuManagerService;
|
|
6
8
|
private readonly _commandService;
|
|
7
9
|
private readonly _shortcutService;
|
|
8
|
-
|
|
10
|
+
private readonly _drawingManagerService;
|
|
11
|
+
private readonly _sheetsSelectionsService;
|
|
12
|
+
constructor(_componentManager: ComponentManager, _menuManagerService: IMenuManagerService, _commandService: ICommandService, _shortcutService: IShortcutService, _drawingManagerService: IDrawingManagerService, _sheetsSelectionsService: SheetsSelectionsService);
|
|
9
13
|
private _initCustomComponents;
|
|
10
14
|
private _initMenus;
|
|
11
15
|
private _initCommands;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { DrawingTypeEnum, FEnum, ImageSourceType } from '@univerjs/core';
|
|
2
2
|
import { SheetDrawingAnchorType } from '@univerjs/sheets-drawing';
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
3
6
|
export interface IFDrawingEnumMixin {
|
|
4
7
|
/** Please refer to {@link DrawingTypeEnum}. */
|
|
5
8
|
DrawingType: typeof DrawingTypeEnum;
|
|
@@ -2,6 +2,9 @@ import { IDrawingSearch, IEventBase, FEventName } from '@univerjs/core';
|
|
|
2
2
|
import { ISheetImage } from '@univerjs/sheets-drawing';
|
|
3
3
|
import { FWorkbook } from '@univerjs/sheets/facade';
|
|
4
4
|
import { FOverGridImage } from './f-over-grid-image';
|
|
5
|
+
/**
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
5
8
|
interface IFDrawingEventNameMixin {
|
|
6
9
|
/**
|
|
7
10
|
* Triggered before floating image insertion.
|
|
@@ -217,6 +220,9 @@ export interface IOverGridImageSelectedParam extends IEventBase {
|
|
|
217
220
|
*/
|
|
218
221
|
selectedImages: FOverGridImage[];
|
|
219
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* @ignore
|
|
225
|
+
*/
|
|
220
226
|
interface IFSheetsUIEventParamConfig {
|
|
221
227
|
BeforeOverGridImageChange: IBeforeOverGridImageChangeParam;
|
|
222
228
|
OverGridImageChanged: IOverGridImageChangedParam;
|
|
@@ -3,6 +3,9 @@ import { ICellOverGridPosition } from '@univerjs/sheets';
|
|
|
3
3
|
import { ISheetImage, SheetDrawingAnchorType } from '@univerjs/sheets-drawing';
|
|
4
4
|
export interface IFOverGridImage extends Omit<ISheetImage, 'sheetTransform' | 'transform'>, ICellOverGridPosition, IRotationSkewFlipTransform, Required<ISize> {
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @hideconstructor
|
|
8
|
+
*/
|
|
6
9
|
export declare class FOverGridImageBuilder {
|
|
7
10
|
protected readonly _injector: Injector;
|
|
8
11
|
private _image;
|
|
@@ -232,6 +235,9 @@ export declare class FOverGridImageBuilder {
|
|
|
232
235
|
setSubUnitId(subUnitId: string): FOverGridImageBuilder;
|
|
233
236
|
buildAsync(): Promise<ISheetImage>;
|
|
234
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* @hideconstructor
|
|
240
|
+
*/
|
|
235
241
|
export declare class FOverGridImage extends FBase {
|
|
236
242
|
private _image;
|
|
237
243
|
protected readonly _commandService: ICommandService;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Injector, FUniver } from '@univerjs/core';
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
*/
|
|
2
5
|
export declare class FUniverDrawingMixin extends FUniver {
|
|
6
|
+
/**
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
3
9
|
_initialize(injector: Injector): void;
|
|
4
10
|
private _beforeOverGridImageInsert;
|
|
5
11
|
private _overGridImageInserted;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IDisposable, IFBlobSource, Nullable } from '@univerjs/core';
|
|
2
2
|
import { FRange, FWorksheet } from '@univerjs/sheets/facade';
|
|
3
3
|
import { ISheetImage } from '@univerjs/sheets-drawing';
|
|
4
|
-
import { ICanvasFloatDom,
|
|
4
|
+
import { ICanvasFloatDom, IDOMAnchor } from '@univerjs/sheets-drawing-ui';
|
|
5
5
|
import { IFComponentKey } from '@univerjs/sheets-ui/facade';
|
|
6
6
|
import { FOverGridImage, FOverGridImageBuilder } from './f-over-grid-image';
|
|
7
7
|
export interface IFICanvasFloatDom extends Omit<ICanvasFloatDom, 'componentKey' | 'unitId' | 'subUnitId'>, IFComponentKey {
|
|
@@ -86,7 +86,7 @@ export interface IFWorksheetLegacy {
|
|
|
86
86
|
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
|
-
addFloatDomToRange(range: FRange, layer: IFICanvasFloatDom, domLayout:
|
|
89
|
+
addFloatDomToRange(range: FRange, layer: IFICanvasFloatDom, domLayout: IDOMAnchor, id?: string): Nullable<{
|
|
90
90
|
id: string;
|
|
91
91
|
dispose: () => void;
|
|
92
92
|
}>;
|
|
@@ -114,7 +114,7 @@ export interface IFWorksheetLegacy {
|
|
|
114
114
|
}
|
|
115
115
|
*```
|
|
116
116
|
*/
|
|
117
|
-
addFloatDomToColumnHeader(column: number, layer: IFICanvasFloatDom, domPos:
|
|
117
|
+
addFloatDomToColumnHeader(column: number, layer: IFICanvasFloatDom, domPos: IDOMAnchor, id?: string): Nullable<{
|
|
118
118
|
id: string;
|
|
119
119
|
dispose: () => void;
|
|
120
120
|
}>;
|
|
@@ -240,11 +240,11 @@ export declare class FWorksheetLegacy extends FWorksheet implements IFWorksheetL
|
|
|
240
240
|
id: string;
|
|
241
241
|
dispose: () => void;
|
|
242
242
|
}>;
|
|
243
|
-
addFloatDomToRange(fRange: FRange, layer: IFICanvasFloatDom, domLayout:
|
|
243
|
+
addFloatDomToRange(fRange: FRange, layer: IFICanvasFloatDom, domLayout: IDOMAnchor, id?: string): Nullable<{
|
|
244
244
|
id: string;
|
|
245
245
|
dispose: () => void;
|
|
246
246
|
}>;
|
|
247
|
-
addFloatDomToColumnHeader(column: number, layer: IFICanvasFloatDom, domLayout:
|
|
247
|
+
addFloatDomToColumnHeader(column: number, layer: IFICanvasFloatDom, domLayout: IDOMAnchor, id?: string): Nullable<{
|
|
248
248
|
id: string;
|
|
249
249
|
dispose: () => void;
|
|
250
250
|
}>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import './global.css';
|
|
17
17
|
export { UniverSheetsDrawingUIPlugin } from './plugin';
|
|
18
|
-
export { type ICanvasFloatDom, type
|
|
18
|
+
export { type ICanvasFloatDom, type IDOMAnchor, SheetCanvasFloatDomManagerService } from './services/canvas-float-dom-manager.service';
|
|
19
19
|
export { SHEETS_IMAGE_MENU_ID } from './views/menu/image.menu';
|
|
20
20
|
export { DeleteDrawingsCommand } from './commands/commands/delete-drawings.command';
|
|
21
21
|
export { GroupSheetDrawingCommand } from './commands/commands/group-sheet-drawing.command';
|
|
@@ -52,8 +52,9 @@ interface ICanvasFloatDomInfo {
|
|
|
52
52
|
subUnitId: string;
|
|
53
53
|
boundsOfViewArea?: IBoundRectNoAngle;
|
|
54
54
|
scrollDirectionResponse?: ScrollDirectionResponse;
|
|
55
|
+
domAnchor?: IDOMAnchor;
|
|
55
56
|
}
|
|
56
|
-
export interface
|
|
57
|
+
export interface IDOMAnchor {
|
|
57
58
|
width: number;
|
|
58
59
|
height: number;
|
|
59
60
|
horizonOffsetAlign?: 'left' | 'right';
|
|
@@ -88,9 +89,12 @@ export declare class SheetCanvasFloatDomManagerService extends Disposable {
|
|
|
88
89
|
private readonly _sheetDrawingService;
|
|
89
90
|
protected readonly _lifecycleService: LifecycleService;
|
|
90
91
|
/**
|
|
91
|
-
* for update dom container position when scrolling
|
|
92
|
+
* for update dom container position when scrolling and zoom
|
|
92
93
|
*/
|
|
93
94
|
private _domLayerMap;
|
|
95
|
+
/**
|
|
96
|
+
* for update dom container position when scrolling and zoom
|
|
97
|
+
*/
|
|
94
98
|
private _domLayerInfoMap;
|
|
95
99
|
private _transformChange$;
|
|
96
100
|
transformChange$: import('rxjs').Observable<{
|
|
@@ -113,6 +117,11 @@ export declare class SheetCanvasFloatDomManagerService extends Disposable {
|
|
|
113
117
|
private _hooks;
|
|
114
118
|
constructor(_renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _drawingManagerService: IDrawingManagerService, _canvasFloatDomService: CanvasFloatDomService, _sheetDrawingService: ISheetDrawingService, _lifecycleService: LifecycleService);
|
|
115
119
|
private _bindScrollEvent;
|
|
120
|
+
/**
|
|
121
|
+
* For scrolling and zoom
|
|
122
|
+
* @param unitId
|
|
123
|
+
* @param subUnitId
|
|
124
|
+
*/
|
|
116
125
|
private _ensureMap;
|
|
117
126
|
getFloatDomInfo(id: string): ICanvasFloatDomInfo | undefined;
|
|
118
127
|
private _getSceneAndTransformerByDrawingSearch;
|
|
@@ -129,11 +138,11 @@ export declare class SheetCanvasFloatDomManagerService extends Disposable {
|
|
|
129
138
|
} | undefined;
|
|
130
139
|
private _removeDom;
|
|
131
140
|
addHook(hook: ISheetCanvasFloatDomHook): IDisposable;
|
|
132
|
-
addFloatDomToRange(range: IRange, config: ICanvasFloatDom,
|
|
141
|
+
addFloatDomToRange(range: IRange, config: ICanvasFloatDom, domAnchor: Partial<IDOMAnchor>, propId?: string): {
|
|
133
142
|
id: string;
|
|
134
143
|
dispose: () => void;
|
|
135
144
|
} | undefined;
|
|
136
|
-
addFloatDomToColumnHeader(column: number, config: ICanvasFloatDom,
|
|
145
|
+
addFloatDomToColumnHeader(column: number, config: ICanvasFloatDom, domLayoutParam: IDOMAnchor, propId?: string): {
|
|
137
146
|
id: string;
|
|
138
147
|
dispose: () => void;
|
|
139
148
|
} | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IDrawingParam } from '@univerjs/core';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
export interface ISheetDrawingAnchorProps {
|
|
4
3
|
drawings: IDrawingParam[];
|
|
5
4
|
}
|
|
6
|
-
export declare const SheetDrawingAnchor: (props: ISheetDrawingAnchorProps) =>
|
|
5
|
+
export declare const SheetDrawingAnchor: (props: ISheetDrawingAnchorProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SheetDrawingPanel: () => false | import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const UploadLoading: () => import("react/jsx-runtime").JSX.Element;
|