@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.
@@ -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 _sheetDrawingService;
9
+ private readonly _drawingService;
10
+ private readonly _clipboardInterfaceService;
11
+ private readonly _commandService;
9
12
  private _copyInfo;
10
- constructor(_sheetClipboardService: ISheetClipboardService, _renderManagerService: IRenderManagerService, _sheetDrawingService: ISheetDrawingService);
13
+ constructor(_sheetClipboardService: ISheetClipboardService, _renderManagerService: IRenderManagerService, _drawingService: IDrawingManagerService, _clipboardInterfaceService: IClipboardInterfaceService, _commandService: ICommandService);
14
+ private get _focusedDrawings();
11
15
  private _initCopyPaste;
12
- private _collect;
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
- private _insertFloatImage;
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
- constructor(_componentManager: ComponentManager, _menuManagerService: IMenuManagerService, _commandService: ICommandService, _shortcutService: IShortcutService);
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, IDOMRangeLayout } from '@univerjs/sheets-drawing-ui';
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: IDOMRangeLayout, id?: string): Nullable<{
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: IDOMRangeLayout, id?: string): Nullable<{
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: IDOMRangeLayout, id?: string): Nullable<{
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: IDOMRangeLayout, id?: string): Nullable<{
247
+ addFloatDomToColumnHeader(column: number, layer: IFICanvasFloatDom, domLayout: IDOMAnchor, id?: string): Nullable<{
248
248
  id: string;
249
249
  dispose: () => void;
250
250
  }>;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import './global.css';
17
17
  export { UniverSheetsDrawingUIPlugin } from './plugin';
18
- export { type ICanvasFloatDom, type IDOMRangeLayout, SheetCanvasFloatDomManagerService } from './services/canvas-float-dom-manager.service';
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 IDOMRangeLayout {
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, domPos: IDOMRangeLayout, propId?: string): {
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, domLayout: IDOMRangeLayout, propId?: string): {
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) => React.JSX.Element | undefined;
5
+ export declare const SheetDrawingAnchor: (props: ISheetDrawingAnchorProps) => import("react/jsx-runtime").JSX.Element | undefined;
@@ -1,2 +1,16 @@
1
- import { default as React } from 'react';
2
- export declare const SheetDrawingPanel: () => false | React.JSX.Element;
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
- import { default as React } from 'react';
2
- export declare const UploadLoading: () => React.JSX.Element;
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;