Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(sheet): ui dependency in sort (#2580)

YuHong1c670360c739
diff --git a/packages/sheets-sort-ui/src/services/sheets-sort-ui.service.tsx b/packages/sheets-sort-ui/src/services/sheets-sort-ui.service.tsx
index aecbd19d44..d66d719bed 100644
--- a/packages/sheets-sort-ui/src/services/sheets-sort-ui.service.tsx
+++ b/packages/sheets-sort-ui/src/services/sheets-sort-ui.service.tsx
@@ -26,9 +26,9 @@ import { Disposable, ICommandService,
UniverInstanceType,
} from '@univerjs/core';
+import type { ISheetRangeLocation } from '@univerjs/sheets';
import { getPrimaryForRange, NORMAL_SELECTION_PLUGIN_NAME, SelectionManagerService, SetSelectionsOperation } from '@univerjs/sheets';
import { Inject } from '@wendellhu/redi';
-import type { ISheetRangeLocation } from '@univerjs/sheets-ui';
import { expandToContinuousRange } from '@univerjs/sheets-ui';
import type { ISortOption } from '@univerjs/sheets-sort';
diff --git a/packages/sheets-sort/package.json b/packages/sheets-sort/package.json
index 876a874859..cda5434533 100644
--- a/packages/sheets-sort/package.json
+++ b/packages/sheets-sort/package.json
@@ -62,7 +62,6 @@
"@univerjs/core": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/sheets": "workspace:*",
- "@univerjs/sheets-ui": "workspace:*",
"@wendellhu/redi": "0.15.4"
},
"devDependencies": {
@@ -70,7 +69,6 @@
"@univerjs/engine-formula": "workspace:*",
"@univerjs/shared": "workspace:*",
"@univerjs/sheets": "workspace:*",
- "@univerjs/sheets-ui": "workspace:*",
"@wendellhu/redi": "^0.15.4",
"rxjs": "^7.8.1",
"typescript": "^5.4.5",
diff --git a/packages/sheets-sort/src/commands/__tests__/create-command-test-bed.ts b/packages/sheets-sort/src/commands/__tests__/create-command-test-bed.ts
index 3f76aebdae..dd664f0348 100644
--- a/packages/sheets-sort/src/commands/__tests__/create-command-test-bed.ts
+++ b/packages/sheets-sort/src/commands/__tests__/create-command-test-bed.ts
@@ -17,7 +17,6 @@
import { BooleanNumber, ILogService, IUniverInstanceService, type IWorkbookData, LocaleService, LocaleType, LogLevel, Plugin, Tools, Univer, UniverInstanceType, type Workbook } from '@univerjs/core';
import type { Dependency } from '@wendellhu/redi';
import { Inject, Injector } from '@wendellhu/redi';
-import { SheetsRenderService } from '@univerjs/sheets-ui';
import { SelectionManagerService, SheetInterceptorService } from '@univerjs/sheets';
import { FormulaDataModel } from '@univerjs/engine-formula';
import enUS from '../../locale/en-US';
@@ -144,7 +143,6 @@ export function createCommandTestBed(workbookData?: IWorkbookData, dependencies?
override onStarting(injector: Injector): void {
injector.add([SheetsSortService]);
injector.add([SheetsSortController]);
- injector.add([SheetsRenderService, { useClass: mockSheetsRenderService }]);
injector.add([SelectionManagerService, { useClass: mockSelectionManagerService as any }]);
injector.add([SheetInterceptorService]);
injector.add([FormulaDataModel, { useClass: mockFormulaDataModel }]);
@@ -172,11 +170,6 @@ export function createCommandTestBed(workbookData?: IWorkbookData, dependencies?
};
}
-class mockSheetsRenderService {
- registerSkeletonChangingMutations(id: string) {
- }
-}
-
class mockSelectionManagerService {
replace() {
}
diff --git a/packages/sheets-sort/src/services/sheets-sort.service.ts b/packages/sheets-sort/src/services/sheets-sort.service.ts
index 5ed9a1af16..f301b98234 100644
--- a/packages/sheets-sort/src/services/sheets-sort.service.ts
+++ b/packages/sheets-sort/src/services/sheets-sort.service.ts
@@ -21,8 +21,8 @@ import { Disposable, ICommandService,
OnLifecycle,
Rectangle,
} from '@univerjs/core';
-import type { ISheetRangeLocation } from '@univerjs/sheets-ui';
+import type { ISheetRangeLocation } from '@univerjs/sheets';
import { getSheetCommandTarget } from '@univerjs/sheets';
import { Inject } from '@wendellhu/redi';
import { FormulaDataModel } from '@univerjs/engine-formula';
diff --git a/packages/sheets-ui/src/index.ts b/packages/sheets-ui/src/index.ts
index 76cbddff2b..c3aa49b43f 100644
--- a/packages/sheets-ui/src/index.ts
+++ b/packages/sheets-ui/src/index.ts
@@ -59,7 +59,7 @@ export {
PREDEFINED_HOOK_NAME,
SheetClipboardService,
} from './services/clipboard/clipboard.service';
-export type { ICellDataWithSpanInfo, ISheetClipboardHook, ISheetRangeLocation, ISheetDiscreteRangeLocation, ICopyPastePayload } from './services/clipboard/type';
+export type { ICellDataWithSpanInfo, ISheetClipboardHook, ISheetDiscreteRangeLocation, ICopyPastePayload } from './services/clipboard/type';
export { COPY_TYPE } from './services/clipboard/type';
export { getRepeatRange } from './services/clipboard/utils';
export { CellEditorManagerService, ICellEditorManagerService } from './services/editor/cell-editor-manager.service';
diff --git a/packages/sheets-ui/src/services/clipboard/type.ts b/packages/sheets-ui/src/services/clipboard/type.ts
index eced9ca8e1..3c80592ae7 100644
--- a/packages/sheets-ui/src/services/clipboard/type.ts
+++ b/packages/sheets-ui/src/services/clipboard/type.ts
@@ -65,12 +65,6 @@ export interface ICopyPastePayload {
pasteType: string;
}
-export interface ISheetRangeLocation {
- range: IRange;
- subUnitId: string;
- unitId: string;
-}
-
export interface ISheetDiscreteRangeLocation {
range: IDiscreteRange;
subUnitId: string;
diff --git a/packages/sheets/src/basics/selection.ts b/packages/sheets/src/basics/selection.ts
index fda54026a9..c72990795b 100644
--- a/packages/sheets/src/basics/selection.ts
+++ b/packages/sheets/src/basics/selection.ts
@@ -145,6 +145,12 @@ export interface ISelectionWithStyle extends ISelection {
style: Nullable<ISelectionStyle>;
}
+export interface ISheetRangeLocation {
+ range: IRange;
+ subUnitId: string;
+ unitId: string;
+}
+
// The default configuration of the selection.
export function getNormalSelectionStyle(themeService: ThemeService): ISelectionStyle {
const styleSheet = themeService.getCurrentTheme();
diff --git a/packages/sheets/src/index.ts b/packages/sheets/src/index.ts
index da004a3d52..0362617fed 100644
--- a/packages/sheets/src/index.ts
+++ b/packages/sheets/src/index.ts
@@ -38,6 +38,7 @@ export {
type ISelectionWidgetConfig,
type ISelectionWithCoordAndStyle,
type ISelectionWithStyle,
+ type ISheetRangeLocation,
SELECTION_CONTROL_BORDER_BUFFER_COLOR,
SELECTION_CONTROL_BORDER_BUFFER_WIDTH,
transformCellDataToSelectionData,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d93b93f6fa..30ac74a8c3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1791,9 +1791,6 @@ importers:
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
- '@univerjs/sheets-ui':
- specifier: workspace:*
- version: link:../sheets-ui
'@wendellhu/redi':
specifier: ^0.15.4
version: 0.15.4