@univerjs/sheets-ui 0.5.5-nightly.202501210404 → 0.5.5-nightly.202501210734

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.
@@ -7,6 +7,7 @@ export interface ISheetPasteParams {
7
7
  export interface ISheetPasteByShortKeyParams {
8
8
  htmlContent?: string;
9
9
  textContent?: string;
10
+ files?: File[];
10
11
  }
11
12
  export declare const SheetPasteCommand: IMultiCommand;
12
13
  export declare const SheetPasteShortKeyCommand: ICommand;
@@ -15,6 +15,7 @@ export declare class SheetClipboardController extends RxDisposable {
15
15
  protected readonly _uiPartsService: IUIPartsService;
16
16
  constructor(_injector: Injector, _currentUniverSheet: IUniverInstanceService, _renderManagerService: IRenderManagerService, _commandService: ICommandService, _contextService: IContextService, _configService: IConfigService, _sheetClipboardService: ISheetClipboardService, _messageService: IMessageService, _localService: LocaleService, _uiPartsService: IUIPartsService);
17
17
  private _pasteWithDoc;
18
+ private _resolveClipboardFiles;
18
19
  private _init;
19
20
  private _initCopyingHooks;
20
21
  private _initPastingHook;
@@ -31,7 +31,7 @@ export interface ISheetClipboardService {
31
31
  copy(): Promise<boolean>;
32
32
  cut(): Promise<boolean>;
33
33
  paste(item: ClipboardItem, pasteType?: string): Promise<boolean>;
34
- legacyPaste(html?: string, text?: string): Promise<boolean>;
34
+ legacyPaste(html?: string, text?: string, files?: File[]): Promise<boolean>;
35
35
  rePasteWithPasteType(type: IPasteHookKeyType): boolean;
36
36
  disposePasteOptionsCache(): void;
37
37
  generateCopyContent(workbookId: string, worksheetId: string, range: IRange): Nullable<ICopyContent>;
@@ -74,14 +74,17 @@ export declare class SheetClipboardService extends Disposable implements ISheetC
74
74
  copy(copyType?: COPY_TYPE): Promise<boolean>;
75
75
  cut(): Promise<boolean>;
76
76
  paste(item: ClipboardItem, pasteType?: "default-paste"): Promise<boolean>;
77
- legacyPaste(html?: string, text?: string): Promise<boolean>;
77
+ legacyPaste(html?: string, text?: string, files?: File[]): Promise<boolean>;
78
78
  rePasteWithPasteType(type: IPasteHookKeyType): boolean;
79
79
  updatePasteOptionsCache(cache: IPasteOptionCache | null): void;
80
80
  addClipboardHook(hook: ISheetClipboardHook): IDisposable;
81
81
  getClipboardHooks(): ISheetClipboardHook[];
82
82
  private _generateCopyContent;
83
83
  private _notifyClipboardHook;
84
+ private _executePaste;
85
+ private _pasteFiles;
84
86
  private _pastePlainText;
87
+ private _pasteUnrecognized;
85
88
  private _pasteHTML;
86
89
  private _pasteExternal;
87
90
  private _pasteInternal;
@@ -83,7 +83,7 @@ export interface ISheetClipboardHook {
83
83
  * @param subUnitId
84
84
  * @param range
85
85
  */
86
- onBeforeCopy?(unitId: string, subUnitId: string, range: IRange): void;
86
+ onBeforeCopy?(unitId: string, subUnitId: string, range: IRange, copyType: COPY_TYPE): void;
87
87
  /**
88
88
  * Properties that would be appended to the td element.
89
89
  *
@@ -177,6 +177,14 @@ export interface ISheetClipboardHook {
177
177
  undos: IMutationInfo[];
178
178
  redos: IMutationInfo[];
179
179
  };
180
+ onPasteFiles?(pasteTo: ISheetDiscreteRangeLocation, files: File[], payload: ICopyPastePayload): {
181
+ undos: IMutationInfo[];
182
+ redos: IMutationInfo[];
183
+ };
184
+ onPasteUnrecognized?(pasteTo: ISheetDiscreteRangeLocation): {
185
+ undos: IMutationInfo[];
186
+ redos: IMutationInfo[];
187
+ };
180
188
  /**
181
189
  * Would be called after paste content has been written into Univer.
182
190
  * Features could do some cleaning up jobs here.