@univerjs/sheets-ui 0.15.1 → 0.15.2-insiders.20260122-b1556b1
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 +39 -17
- package/lib/es/index.js +9690 -9380
- package/lib/index.css +1 -1
- package/lib/index.js +9690 -9380
- package/lib/types/consts/mobile-context.d.ts +25 -0
- package/lib/types/controllers/config.schema.d.ts +5 -0
- package/lib/types/controllers/editor/editing.render-controller.d.ts +3 -2
- package/lib/types/controllers/render-controllers/mobile/mobile-scroll.render-controller.d.ts +18 -4
- package/lib/types/services/clipboard/usm-to-html/convertor.d.ts +1 -1
- package/lib/types/services/selection/mobile-selection-render.service.d.ts +8 -2
- package/lib/umd/index.js +38 -16
- package/package.json +12 -12
- package/LICENSE +0 -176
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
/**
|
|
17
|
+
* Context key indicating that pinch-to-zoom gesture is in progress on mobile.
|
|
18
|
+
* Used to prevent selection operations during pinch zoom.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MOBILE_PINCH_ZOOMING = "MOBILE_PINCH_ZOOMING";
|
|
21
|
+
/**
|
|
22
|
+
* Context key indicating that selection is being expanded on mobile (dragging fill controls).
|
|
23
|
+
* Used to prevent scroll/inertia/zoom operations during selection expansion.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MOBILE_EXPANDING_SELECTION = "MOBILE_EXPANDING_SELECTION";
|
|
@@ -84,6 +84,11 @@ export interface IUniverSheetsUIConfig {
|
|
|
84
84
|
* @default false
|
|
85
85
|
*/
|
|
86
86
|
disableForceStringMark?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Whether to disable the edit.
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
disableEdit?: boolean;
|
|
87
92
|
}
|
|
88
93
|
export declare const defaultPluginConfig: IUniverSheetsUIConfig;
|
|
89
94
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentDataModel, ICellData, IDocumentBody, IDocumentData, IStyleData, Nullable, Styles, Disposable, ICommandService, IContextService, IUndoRedoService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
1
|
+
import { DocumentDataModel, ICellData, IDocumentBody, IDocumentData, IStyleData, Nullable, Styles, Disposable, ICommandService, IConfigService, IContextService, IUndoRedoService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
2
|
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
3
3
|
import { IEditorService } from '@univerjs/docs-ui';
|
|
4
4
|
import { IFunctionService, LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
@@ -23,6 +23,7 @@ export declare class EditingRenderController extends Disposable {
|
|
|
23
23
|
private readonly _sheetInterceptorService;
|
|
24
24
|
private readonly _sheetCellEditorResizeService;
|
|
25
25
|
private readonly _selectionManagerService;
|
|
26
|
+
private readonly _configService;
|
|
26
27
|
/**
|
|
27
28
|
* It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
|
|
28
29
|
*/
|
|
@@ -30,7 +31,7 @@ export declare class EditingRenderController extends Disposable {
|
|
|
30
31
|
/** If the corresponding unit is active and prepared for editing. */
|
|
31
32
|
private _editingUnit;
|
|
32
33
|
_cursorTimeout: NodeJS.Timeout;
|
|
33
|
-
constructor(_undoRedoService: IUndoRedoService, _contextService: IContextService, _renderManagerService: IRenderManagerService, _editorBridgeService: IEditorBridgeService, _cellEditorManagerService: ICellEditorManagerService, _lexerTreeBuilder: LexerTreeBuilder, _functionService: IFunctionService, _textSelectionManagerService: DocSelectionManagerService, _commandService: ICommandService, _localService: LocaleService, _editorService: IEditorService, _univerInstanceService: IUniverInstanceService, _sheetInterceptorService: SheetInterceptorService, _sheetCellEditorResizeService: SheetCellEditorResizeService, _selectionManagerService: SheetsSelectionsService);
|
|
34
|
+
constructor(_undoRedoService: IUndoRedoService, _contextService: IContextService, _renderManagerService: IRenderManagerService, _editorBridgeService: IEditorBridgeService, _cellEditorManagerService: ICellEditorManagerService, _lexerTreeBuilder: LexerTreeBuilder, _functionService: IFunctionService, _textSelectionManagerService: DocSelectionManagerService, _commandService: ICommandService, _localService: LocaleService, _editorService: IEditorService, _univerInstanceService: IUniverInstanceService, _sheetInterceptorService: SheetInterceptorService, _sheetCellEditorResizeService: SheetCellEditorResizeService, _selectionManagerService: SheetsSelectionsService, _configService: IConfigService);
|
|
34
35
|
dispose(): void;
|
|
35
36
|
private get _workbookSelections();
|
|
36
37
|
private _init;
|
package/lib/types/controllers/render-controllers/mobile/mobile-scroll.render-controller.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRange, Workbook, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
1
|
+
import { IRange, Workbook, Disposable, ICommandService, IContextService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
3
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
4
4
|
import { SheetScrollManagerService } from '../../../services/scroll-manager.service';
|
|
@@ -14,7 +14,8 @@ export declare class MobileSheetsScrollRenderController extends Disposable imple
|
|
|
14
14
|
private readonly _selectionManagerService;
|
|
15
15
|
private readonly _scrollManagerService;
|
|
16
16
|
protected readonly _univerInstanceService: IUniverInstanceService;
|
|
17
|
-
|
|
17
|
+
private readonly _contextService;
|
|
18
|
+
constructor(_context: IRenderContext<Workbook>, _sheetSkeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService, _renderManagerService: IRenderManagerService, _selectionManagerService: SheetsSelectionsService, _scrollManagerService: SheetScrollManagerService, _univerInstanceService: IUniverInstanceService, _contextService: IContextService);
|
|
18
19
|
scrollToRange(range: IRange): boolean;
|
|
19
20
|
private _init;
|
|
20
21
|
private _initCommandListener;
|
|
@@ -23,12 +24,25 @@ export declare class MobileSheetsScrollRenderController extends Disposable imple
|
|
|
23
24
|
private _initScrollEventListener;
|
|
24
25
|
private _initSkeletonListener;
|
|
25
26
|
/**
|
|
26
|
-
* for mobile
|
|
27
|
+
* for mobile - iOS-like smooth inertia scrolling
|
|
28
|
+
* Uses native touch events for better mobile experience while keeping onPointerDown$ as trigger
|
|
29
|
+
* to avoid interfering with header events
|
|
27
30
|
*/
|
|
28
31
|
private _initPointerScrollEvent;
|
|
32
|
+
/**
|
|
33
|
+
* Create zoom indicator overlay element
|
|
34
|
+
*/
|
|
35
|
+
private _createZoomIndicator;
|
|
36
|
+
/**
|
|
37
|
+
* Show zoom indicator with percentage
|
|
38
|
+
*/
|
|
39
|
+
private _showZoomIndicator;
|
|
40
|
+
/**
|
|
41
|
+
* Hide zoom indicator with fade out
|
|
42
|
+
*/
|
|
43
|
+
private _hideZoomIndicator;
|
|
29
44
|
private _updateSceneSize;
|
|
30
45
|
private _getSheetObject;
|
|
31
|
-
private _scrollToSelectionByDirection;
|
|
32
46
|
private _scrollToSelection;
|
|
33
47
|
private _getViewportBounding;
|
|
34
48
|
private _scrollToCell;
|
|
@@ -5,5 +5,5 @@ export declare class USMToHtmlService {
|
|
|
5
5
|
convert(matrix: ObjectMatrix<ICellData & {
|
|
6
6
|
rowSpan?: number | undefined;
|
|
7
7
|
colSpan?: number | undefined;
|
|
8
|
-
}>, range: IDiscreteRange, hooks: ISheetClipboardHook[]): string;
|
|
8
|
+
}>, range: IDiscreteRange, hooks: ISheetClipboardHook[], copyId?: string): string;
|
|
9
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Workbook, ICommandService, IContextService, ILogService, Injector, RANGE_TYPE, ThemeService } from '@univerjs/core';
|
|
2
|
-
import { IMouseEvent, IPointerEvent, IRenderContext, IRenderModule, Scene, SpreadsheetSkeleton, Viewport } from '@univerjs/engine-render';
|
|
1
|
+
import { Nullable, Workbook, ICommandService, IContextService, ILogService, Injector, RANGE_TYPE, ThemeService } from '@univerjs/core';
|
|
2
|
+
import { IMouseEvent, IPointerEvent, IRenderContext, IRenderModule, Scene, SpreadsheetSkeleton, Viewport, ScrollTimerType } from '@univerjs/engine-render';
|
|
3
3
|
import { ISelectionWithStyle, SheetsSelectionsService } from '@univerjs/sheets';
|
|
4
4
|
import { IShortcutService } from '@univerjs/ui';
|
|
5
5
|
import { SheetScrollManagerService } from '../scroll-manager.service';
|
|
@@ -25,6 +25,7 @@ export declare class MobileSheetsSelectionRenderService extends BaseSelectionRen
|
|
|
25
25
|
_expandingSelection: boolean;
|
|
26
26
|
protected _selectionControls: MobileSelectionControl[];
|
|
27
27
|
expandingControlMode: ExpandingControl;
|
|
28
|
+
private _anchorCellForExpanding;
|
|
28
29
|
constructor(_context: IRenderContext<Workbook>, injector: Injector, themeService: ThemeService, shortcutService: IShortcutService, selectionManagerService: SheetsSelectionsService, sheetSkeletonManagerService: SheetSkeletonManagerService, _logService: ILogService, _commandService: ICommandService, _contextService: IContextService, _scrollManagerService: SheetScrollManagerService);
|
|
29
30
|
private _init;
|
|
30
31
|
private _initSkeletonChangeListener;
|
|
@@ -56,6 +57,11 @@ export declare class MobileSheetsSelectionRenderService extends BaseSelectionRen
|
|
|
56
57
|
getSelectionControls(): MobileSelectionControl[];
|
|
57
58
|
private _fillControlPointerDownHandler;
|
|
58
59
|
private _changeCurrCellWhenControlPointerDown;
|
|
60
|
+
/**
|
|
61
|
+
* Override base class method to add pinch zoom check.
|
|
62
|
+
* When pinch zooming, we should not process pointer move events for selection.
|
|
63
|
+
*/
|
|
64
|
+
protected _setupPointerMoveListener(viewportMain: Nullable<Viewport>, activeSelectionControl: MobileSelectionControl, rangeType: RANGE_TYPE, scrollTimerType: ScrollTimerType | undefined, moveStartPosX: number, moveStartPosY: number): void;
|
|
59
65
|
/**
|
|
60
66
|
* Not same as _moving in PC (base selection render service)
|
|
61
67
|
* The diff is
|