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.

refactor(core & ui): remove the dependency of the core package on React (#4617)

白熱1c61dfe7a069
diff --git a/package.json b/package.json
index c7667afb17..a3ee5a9a37 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"type": "module",
"version": "0.6.0-alpha.0",
"private": true,
- "packageManager": "[email protected]",
+ "packageManager": "[email protected]",
"author": "DreamNum Co., Ltd. <[email protected]>",
"license": "Apache-2.0",
"funding": {
@@ -79,8 +79,8 @@
"vitest": "^3.0.4"
},
"resolutions": {
- "@types/react": "^19.0.2",
- "@types/react-dom": "^19.0.2",
+ "@types/react": "^19.0.8",
+ "@types/react-dom": "^19.0.3",
"react": "19.0.0",
"react-dom": "19.0.0"
},
diff --git a/packages-experimental/action-recorder/src/controllers/action-recorder.controller.tsx b/packages-experimental/action-recorder/src/controllers/action-recorder.controller.tsx
index 5d643a581f..80021a1e9e 100644
--- a/packages-experimental/action-recorder/src/controllers/action-recorder.controller.tsx
+++ b/packages-experimental/action-recorder/src/controllers/action-recorder.controller.tsx
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import { connectInjector, Disposable, ICommandService, Inject, Injector } from '@univerjs/core';
+import { Disposable, ICommandService, Inject, Injector } from '@univerjs/core';
import { RecordSingle } from '@univerjs/icons';
import { AddWorksheetMergeAllCommand,
AddWorksheetMergeCommand,
@@ -68,6 +68,7 @@ import { AutoFillCommand, RefillCommand, SetRangeBoldCommand,
import {
BuiltInUIPart,
ComponentManager,
+ connectInjector,
IMenuManagerService,
IUIPartsService,
} from '@univerjs/ui';
diff --git a/packages-experimental/action-recorder/src/views/components/RecorderPanel.tsx b/packages-experimental/action-recorder/src/views/components/RecorderPanel.tsx
index 0b872f68b5..53bd0af8b3 100644
--- a/packages-experimental/action-recorder/src/views/components/RecorderPanel.tsx
+++ b/packages-experimental/action-recorder/src/views/components/RecorderPanel.tsx
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-import { ICommandService, useDependency } from '@univerjs/core';
+import { ICommandService } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { RecordSingle } from '@univerjs/icons';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback } from 'react';
import { CompleteRecordingActionCommand, StartRecordingActionCommand, StopRecordingActionCommand } from '../../commands/commands/record.command';
diff --git a/packages-experimental/debugger/src/views/watermark/WatermarkImageSetting.tsx b/packages-experimental/debugger/src/views/watermark/WatermarkImageSetting.tsx
index 66e61d1f18..bdd0c07559 100644
--- a/packages-experimental/debugger/src/views/watermark/WatermarkImageSetting.tsx
+++ b/packages-experimental/debugger/src/views/watermark/WatermarkImageSetting.tsx
@@ -15,9 +15,9 @@
*/
import type { IImageWatermarkConfig } from '@univerjs/watermark';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Button, Checkbox, InputNumber } from '@univerjs/design';
-import { ILocalFileService } from '@univerjs/ui';
+import { ILocalFileService, useDependency } from '@univerjs/ui';
import { WATERMARK_IMAGE_ALLOW_IMAGE_LIST } from '@univerjs/watermark';
import React from 'react';
import styles from './index.module.less';
diff --git a/packages-experimental/debugger/src/views/watermark/WatermarkPanel.tsx b/packages-experimental/debugger/src/views/watermark/WatermarkPanel.tsx
index 48fb6e37b1..5bb270a61b 100644
--- a/packages-experimental/debugger/src/views/watermark/WatermarkPanel.tsx
+++ b/packages-experimental/debugger/src/views/watermark/WatermarkPanel.tsx
@@ -15,8 +15,9 @@
*/
import type { IWatermarkConfig, IWatermarkConfigWithType } from '@univerjs/watermark';
-import { ILocalStorageService, LocaleService, useDependency, useObservable } from '@univerjs/core';
+import { ILocalStorageService, LocaleService } from '@univerjs/core';
import { Select } from '@univerjs/design';
+import { useDependency, useObservable } from '@univerjs/ui';
import { IWatermarkTypeEnum, UNIVER_WATERMARK_STORAGE_KEY, WatermarkImageBaseConfig, WatermarkService, WatermarkTextBaseConfig } from '@univerjs/watermark';
import React, { useCallback, useEffect, useState } from 'react';
import styles from './index.module.less';
diff --git a/packages-experimental/debugger/src/views/watermark/WatermarkPanelFooter.tsx b/packages-experimental/debugger/src/views/watermark/WatermarkPanelFooter.tsx
index bd70dc1df6..c718998b70 100644
--- a/packages-experimental/debugger/src/views/watermark/WatermarkPanelFooter.tsx
+++ b/packages-experimental/debugger/src/views/watermark/WatermarkPanelFooter.tsx
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Button } from '@univerjs/design';
-import { IClipboardInterfaceService, ISidebarService } from '@univerjs/ui';
+import { IClipboardInterfaceService, ISidebarService, useDependency } from '@univerjs/ui';
import { IWatermarkTypeEnum, WatermarkService, WatermarkTextBaseConfig } from '@univerjs/watermark';
import React from 'react';
import styles from './index.module.less';
diff --git a/packages-experimental/debugger/src/views/watermark/WatermarkTextSetting.tsx b/packages-experimental/debugger/src/views/watermark/WatermarkTextSetting.tsx
index 3f32d8853f..e2db74c10f 100644
--- a/packages-experimental/debugger/src/views/watermark/WatermarkTextSetting.tsx
+++ b/packages-experimental/debugger/src/views/watermark/WatermarkTextSetting.tsx
@@ -15,9 +15,10 @@
*/
import type { ITextWatermarkConfig } from '@univerjs/watermark';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Checkbox, ColorPicker, DropdownLegacy, Input, InputNumber, Select } from '@univerjs/design';
import { BoldSingle, FontColor, ItalicSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React from 'react';
import styles from './index.module.less';
diff --git a/packages-experimental/uni-formula-ui/src/views/components/DocFormulaPopup.tsx b/packages-experimental/uni-formula-ui/src/views/components/DocFormulaPopup.tsx
index d83da7f630..0d45b80c7d 100644
--- a/packages-experimental/uni-formula-ui/src/views/components/DocFormulaPopup.tsx
+++ b/packages-experimental/uni-formula-ui/src/views/components/DocFormulaPopup.tsx
@@ -16,10 +16,10 @@
import type { IDocumentData, Nullable } from '@univerjs/core';
import type { IUniFormulaPopupInfo } from '../../services/formula-popup.service';
-import { BooleanNumber, createInternalEditorID, DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, HorizontalAlign, ICommandService, LocaleService, useDependency, VerticalAlign, WrapStrategy } from '@univerjs/core';
+import { BooleanNumber, createInternalEditorID, DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, HorizontalAlign, ICommandService, LocaleService, VerticalAlign, WrapStrategy } from '@univerjs/core';
// import { TextEditor } from '@univerjs/docs-ui';
import { CheckMarkSingle, CloseSingle } from '@univerjs/icons';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback, useEffect, useRef, useState } from 'react';
diff --git a/packages-experimental/uni-sheets-ui/src/controllers/uni-sheets-ui.controller.tsx b/packages-experimental/uni-sheets-ui/src/controllers/uni-sheets-ui.controller.tsx
index 123b2e0a5e..93d0a939e5 100644
--- a/packages-experimental/uni-sheets-ui/src/controllers/uni-sheets-ui.controller.tsx
+++ b/packages-experimental/uni-sheets-ui/src/controllers/uni-sheets-ui.controller.tsx
@@ -15,11 +15,11 @@
*/
import type { Workbook } from '@univerjs/core';
-import { connectInjector, ICommandService, IConfigService, Inject, Injector, IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, IConfigService, Inject, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { SetBackgroundColorCommand } from '@univerjs/sheets';
import { SHEETS_IMAGE_MENU_ID } from '@univerjs/sheets-drawing-ui';
import { RenderSheetContent, SetRangeBoldCommand, SetRangeFontFamilyCommand, SetRangeFontSizeCommand, SetRangeItalicCommand, SetRangeStrickThroughCommand, SetRangeTextColorCommand, SetRangeUnderlineCommand, SheetUIController } from '@univerjs/sheets-ui';
-import { BuiltInUIPart, ComponentManager, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService, useObservable } from '@univerjs/ui';
+import { BuiltInUIPart, ComponentManager, connectInjector, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService, useDependency, useObservable } from '@univerjs/ui';
import { BuiltinUniToolbarItemId, generateCloneMutation, UniToolbarService, UniUIPart } from '@univerjs/uniui';
import React from 'react';
import { UniSheetBar } from '../views/uni-sheet-bar/UniSheetBar';
diff --git a/packages-experimental/uni-sheets-ui/src/views/uni-sheet-bar/UniSheetBar.tsx b/packages-experimental/uni-sheets-ui/src/views/uni-sheet-bar/UniSheetBar.tsx
index db57f19599..417215a3d2 100644
--- a/packages-experimental/uni-sheets-ui/src/views/uni-sheet-bar/UniSheetBar.tsx
+++ b/packages-experimental/uni-sheets-ui/src/views/uni-sheet-bar/UniSheetBar.tsx
@@ -16,11 +16,12 @@
import type { ICommandInfo } from '@univerjs/core';
import type { IBaseSheetBarProps } from '@univerjs/sheets-ui';
-import { ICommandService, useDependency } from '@univerjs/core';
+import { ICommandService } from '@univerjs/core';
import { Tooltip } from '@univerjs/design';
import { IncreaseSingle } from '@univerjs/icons';
import { InsertSheetCommand, InsertSheetMutation, RemoveSheetMutation, SetTabColorMutation, SetWorksheetActiveOperation, SetWorksheetHideMutation, SetWorksheetNameMutation, SetWorksheetOrderMutation } from '@univerjs/sheets';
import { useActiveWorkbook } from '@univerjs/sheets-ui';
+import { useDependency } from '@univerjs/ui';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import styles from './index.module.less';
diff --git a/packages-experimental/uni-slides-ui/src/controllers/uni-slides-ui.controller.tsx b/packages-experimental/uni-slides-ui/src/controllers/uni-slides-ui.controller.tsx
index facfc64ef2..ae1ea95731 100644
--- a/packages-experimental/uni-slides-ui/src/controllers/uni-slides-ui.controller.tsx
+++ b/packages-experimental/uni-slides-ui/src/controllers/uni-slides-ui.controller.tsx
@@ -15,9 +15,9 @@
*/
import type { SlideDataModel } from '@univerjs/core';
-import { connectInjector, ICommandService, Inject, Injector, IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, Inject, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { SHAPE_MENU_ID, SlideAddTextCommand, SlideEditorContainer, SLIDES_IMAGE_MENU_ID, SlidesUIController } from '@univerjs/slides-ui';
-import { BuiltInUIPart, ComponentManager, IMenuManagerService, IShortcutService, IUIPartsService, useObservable } from '@univerjs/ui';
+import { BuiltInUIPart, ComponentManager, connectInjector, IMenuManagerService, IShortcutService, IUIPartsService, useDependency, useObservable } from '@univerjs/ui';
import { BuiltinUniToolbarItemId, UniToolbarService, UniUIPart } from '@univerjs/uniui';
import React from 'react';
import { UniSlideSideBar } from '../views/UniSlideSideBar';
diff --git a/packages-experimental/uni-slides-ui/src/views/UniSlideSideBar.tsx b/packages-experimental/uni-slides-ui/src/views/UniSlideSideBar.tsx
index 7b4f761a3b..0ba7736d11 100644
--- a/packages-experimental/uni-slides-ui/src/views/UniSlideSideBar.tsx
+++ b/packages-experimental/uni-slides-ui/src/views/UniSlideSideBar.tsx
@@ -15,11 +15,11 @@
*/
import type { SlideDataModel } from '@univerjs/core';
-import { ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { IRenderManagerService } from '@univerjs/engine-render';
import { IncreaseSingle } from '@univerjs/icons';
import { ActivateSlidePageOperation, AppendSlideOperation, SetSlidePageThumbOperation } from '@univerjs/slides-ui';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
diff --git a/packages-experimental/uniui/src/controllers/uniui-desktop.controller.tsx b/packages-experimental/uniui/src/controllers/uniui-desktop.controller.tsx
index 848d1bad45..758cf8efd6 100644
--- a/packages-experimental/uniui/src/controllers/uniui-desktop.controller.tsx
+++ b/packages-experimental/uniui/src/controllers/uniui-desktop.controller.tsx
@@ -16,10 +16,9 @@
import type { IDisposable } from '@univerjs/core';
import type { IUniverUIConfig, IWorkbenchOptions } from '@univerjs/ui';
-import { connectInjector, Disposable, Inject, Injector, LifecycleService, LifecycleStages, Optional, toDisposable } from '@univerjs/core';
+import { Disposable, Inject, Injector, LifecycleService, LifecycleStages, Optional, toDisposable } from '@univerjs/core';
import { render as createRoot, unmount } from '@univerjs/design';
-import { BuiltInUIPart, CanvasPopup, FloatDom, ILayoutService, IUIPartsService } from '@univerjs/ui';
-import React from 'react';
+import { BuiltInUIPart, CanvasPopup, connectInjector, FloatDom, ILayoutService, IUIPartsService } from '@univerjs/ui';
import { delay, filter, take } from 'rxjs';
import { UniWorkbench } from '../views/workbench/UniWorkbench';
diff --git a/packages-experimental/uniui/src/views/hooks/title.ts b/packages-experimental/uniui/src/views/hooks/title.ts
index 490a86be80..f32bd6eec7 100644
--- a/packages-experimental/uniui/src/views/hooks/title.ts
+++ b/packages-experimental/uniui/src/views/hooks/title.ts
@@ -15,8 +15,8 @@
*/
import type { Nullable } from '@univerjs/core';
-import { IUniverInstanceService, useDependency } from '@univerjs/core';
-import { useObservable } from '@univerjs/ui';
+import { IUniverInstanceService } from '@univerjs/core';
+import { useDependency, useObservable } from '@univerjs/ui';
import { useMemo } from 'react';
export function useUnitTitle(unitId: string): string | undefined {
diff --git a/packages-experimental/uniui/src/views/uni-controls/UniControls.tsx b/packages-experimental/uniui/src/views/uni-controls/UniControls.tsx
index 0ff3230cd6..1c87e22210 100644
--- a/packages-experimental/uniui/src/views/uni-controls/UniControls.tsx
+++ b/packages-experimental/uniui/src/views/uni-controls/UniControls.tsx
@@ -15,10 +15,9 @@
*/
import type { IProjectNode } from '../../services/unit-grid/unit-grid.service';
-import { useDependency } from '@univerjs/core';
import { DropdownLegacy, Tooltip } from '@univerjs/design';
import { CheckMarkSingle, FullscreenSingle, IncreaseSingle, ZoomReduceSingle } from '@univerjs/icons';
-import { ISidebarService } from '@univerjs/ui';
+import { ISidebarService, useDependency } from '@univerjs/ui';
import {
useReactFlow,
} from '@xyflow/react';
diff --git a/packages-experimental/uniui/src/views/uni-sidebar/UniSidebar.tsx b/packages-experimental/uniui/src/views/uni-sidebar/UniSidebar.tsx
index a572d5e40e..367999b637 100644
--- a/packages-experimental/uniui/src/views/uni-sidebar/UniSidebar.tsx
+++ b/packages-experimental/uniui/src/views/uni-sidebar/UniSidebar.tsx
@@ -14,12 +14,11 @@
* limitations under the License.
*/
+import type { ISidebarMethodOptions } from '@univerjs/ui';
import { CloseSingle } from '@univerjs/icons';
-import { useDependency } from '@univerjs/core';
+import { CustomLabel, ILeftSidebarService, ISidebarService, useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useMemo, useRef } from 'react';
-import type { ISidebarMethodOptions } from '@univerjs/ui';
-import { CustomLabel, ILeftSidebarService, ISidebarService, useObservable } from '@univerjs/ui';
import styles from './index.module.less';
export interface IUniSidebarProps {
diff --git a/packages-experimental/uniui/src/views/uni-toolbar/UniFloatToolbar.tsx b/packages-experimental/uniui/src/views/uni-toolbar/UniFloatToolbar.tsx
index 05fd55e540..a60b23b107 100644
--- a/packages-experimental/uniui/src/views/uni-toolbar/UniFloatToolbar.tsx
+++ b/packages-experimental/uniui/src/views/uni-toolbar/UniFloatToolbar.tsx
@@ -14,11 +14,12 @@
* limitations under the License.
*/
+import type { Nullable } from '@univerjs/core';
import type { IMenuItem } from '@univerjs/ui';
import type { IUnitRendererProps } from '../workbench/UniWorkbench';
import { flip, offset, shift, useFloating } from '@floating-ui/react-dom';
-import { IUniverInstanceService, type Nullable, useDependency, useObservable } from '@univerjs/core';
-import { ComponentContainer, IMenuManagerService, ToolbarItem, useComponentsOfPart } from '@univerjs/ui';
+import { IUniverInstanceService } from '@univerjs/core';
+import { ComponentContainer, IMenuManagerService, ToolbarItem, useComponentsOfPart, useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useImperativeHandle, useState } from 'react';
import { DELETE_MENU_ID, DOWNLOAD_MENU_ID, LOCK_MENU_ID, PRINT_MENU_ID, SHARE_MENU_ID, UNI_MENU_POSITIONS, ZEN_MENU_ID } from '../../controllers/menu';
import styles from './index.module.less';
diff --git a/packages-experimental/uniui/src/views/uni-toolbar/UniFormulaBar.tsx b/packages-experimental/uniui/src/views/uni-toolbar/UniFormulaBar.tsx
index 88145d1b17..03fa2b2e5f 100644
--- a/packages-experimental/uniui/src/views/uni-toolbar/UniFormulaBar.tsx
+++ b/packages-experimental/uniui/src/views/uni-toolbar/UniFormulaBar.tsx
@@ -15,13 +15,14 @@
*/
import type { Nullable, Workbook } from '@univerjs/core';
-import { BooleanNumber, DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DocumentFlavor, HorizontalAlign, ICommandService, IPermissionService, IUniverInstanceService, Rectangle, ThemeService, UniverInstanceType, useDependency, useObservable, VerticalAlign, WrapStrategy } from '@univerjs/core';
+import { BooleanNumber, DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DocumentFlavor, HorizontalAlign, ICommandService, IPermissionService, IUniverInstanceService, Rectangle, ThemeService, UniverInstanceType, VerticalAlign, WrapStrategy } from '@univerjs/core';
// import { TextEditor } from '@univerjs/docs-ui';
import { DeviceInputEventType } from '@univerjs/engine-render';
import { CheckMarkSingle, CloseSingle, FxSingle } from '@univerjs/icons';
import { RangeProtectionPermissionEditPoint, RangeProtectionRuleModel, SheetsSelectionsService, WorkbookEditablePermission, WorksheetEditPermission, WorksheetProtectionRuleModel, WorksheetSetCellValuePermission } from '@univerjs/sheets';
import { IEditorBridgeService, IFormulaEditorManagerService, SetCellEditVisibleOperation, useActiveWorkbook } from '@univerjs/sheets-ui';
-import { KeyCode } from '@univerjs/ui';
+// import { TextEditor } from '@univerjs/docs-ui';
+import { KeyCode, useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback, useLayoutEffect, useState } from 'react';
import { EMPTY, merge, switchMap } from 'rxjs';
diff --git a/packages-experimental/uniui/src/views/uni-toolbar/UniToolbar.tsx b/packages-experimental/uniui/src/views/uni-toolbar/UniToolbar.tsx
index 63c840e97a..7fab4c8383 100644
--- a/packages-experimental/uniui/src/views/uni-toolbar/UniToolbar.tsx
+++ b/packages-experimental/uniui/src/views/uni-toolbar/UniToolbar.tsx
@@ -16,9 +16,9 @@
import type { IMenuItem } from '@univerjs/ui';
import type { ComponentType } from 'react';
-import { IUniverInstanceService, UniverInstanceType, useDependency, useObservable } from '@univerjs/core';
+import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { useWorkbooks } from '@univerjs/sheets-ui';
-import { IMenuManagerService, ToolbarItem } from '@univerjs/ui';
+import { IMenuManagerService, ToolbarItem, useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { UNI_MENU_POSITIONS } from '../../controllers/menu';
import { UniToolbarService } from '../../services/toolbar/uni-toolbar-service';
diff --git a/packages-experimental/uniui/src/views/workbench/UniWorkbench.tsx b/packages-experimental/uniui/src/views/workbench/UniWorkbench.tsx
index 77a1207976..fc31ba0bbb 100644
--- a/packages-experimental/uniui/src/views/workbench/UniWorkbench.tsx
+++ b/packages-experimental/uniui/src/views/workbench/UniWorkbench.tsx
@@ -17,23 +17,24 @@
// Refer to packages/ui/src/views/App.tsx
import type { ILocale } from '@univerjs/design';
+import type { IWorkbenchOptions } from '@univerjs/ui';
import type {
NodeTypes,
ReactFlowInstance,
Viewport,
} from '@xyflow/react';
-import { debounce, ICommandService, IContextService, IUniverInstanceService, LocaleService, ThemeService, useDependency } from '@univerjs/core';
+import type { IFloatingToolbarRef } from '../uni-toolbar/UniFloatToolbar';
+import { debounce, ICommandService, IContextService, IUniverInstanceService, LocaleService, ThemeService } from '@univerjs/core';
import { ConfigContext, ConfigProvider, defaultTheme, themeInstance } from '@univerjs/design';
import { IRenderManagerService } from '@univerjs/engine-render';
import { MenuSingle } from '@univerjs/icons';
-import {
- builtInGlobalComponents,
+import { builtInGlobalComponents,
BuiltInUIPart,
ComponentContainer,
ContextMenu,
- type IWorkbenchOptions,
UNI_DISABLE_CHANGING_FOCUS_KEY,
useComponentsOfPart,
+ useDependency,
useObservable,
} from '@univerjs/ui';
import {
@@ -44,8 +45,8 @@ import {
useNodesState,
} from '@xyflow/react';
import clsx from 'clsx';
-import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
+import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { UniFocusUnitOperation } from '../../commands/operations/uni-focus-unit.operation';
import { FlowManagerService } from '../../services/flow/flow-manager.service';
@@ -53,7 +54,7 @@ import { IUnitGridService } from '../../services/unit-grid/unit-grid.service';
import { useUnitFocused, useUnitTitle } from '../hooks/title';
import { DEFAULT_ZOOM, MAX_ZOOM, MIN_ZOOM, UniControlItem, UniControls } from '../uni-controls/UniControls';
import { LeftSidebar, RightSidebar } from '../uni-sidebar/UniSidebar';
-import { type IFloatingToolbarRef, UniFloatingToolbar } from '../uni-toolbar/UniFloatToolbar';
+import { UniFloatingToolbar } from '../uni-toolbar/UniFloatToolbar';
import { UniToolbar } from '../uni-toolbar/UniToolbar';
import styles from './workbench.module.less';
import '@xyflow/react/dist/style.css';
diff --git a/packages/core/package.json b/packages/core/package.json
index 56eeac480c..53f4242414 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -58,7 +58,6 @@
"build": "univer-cli build"
},
"peerDependencies": {
- "react": ">=16.9.0 || >=17 || >=18 || >=19",
"rxjs": ">=7.0.0"
},
"dependencies": {
diff --git a/packages/core/src/common/di.ts b/packages/core/src/common/di.ts
index 599b389635..fb1033cae1 100644
--- a/packages/core/src/common/di.ts
+++ b/packages/core/src/common/di.ts
@@ -17,7 +17,7 @@
import type { Dependency, DependencyIdentifier, Injector } from '@wendellhu/redi';
export * from '@wendellhu/redi';
-export * from '@wendellhu/redi/react-bindings';
+// export * from '@wendellhu/redi/react-bindings';
/**
* Register the dependencies to the injector.
diff --git a/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPanel.tsx b/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPanel.tsx
index d02b068d85..83f9c323e8 100644
--- a/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPanel.tsx
+++ b/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPanel.tsx
@@ -15,9 +15,9 @@
*/
import type { IDrawingParam } from '@univerjs/core';
-import { useDependency } from '@univerjs/core';
import { IDrawingManagerService } from '@univerjs/drawing';
import { DrawingCommonPanel } from '@univerjs/drawing-ui';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { DocDrawingPosition } from './DocDrawingPosition';
import { DocDrawingTextWrap } from './DocDrawingTextWrap';
diff --git a/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPosition.tsx b/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPosition.tsx
index b685064b8b..cda90a9d5d 100644
--- a/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPosition.tsx
+++ b/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPosition.tsx
@@ -17,13 +17,13 @@
import type { ICommandInfo, IDrawingParam, IObjectPositionH, IObjectPositionV, Nullable } from '@univerjs/core';
import type { IDocDrawing } from '@univerjs/docs-drawing';
import type { IDocumentSkeletonDrawing } from '@univerjs/engine-render';
-import { DocumentFlavor, ICommandService, IUniverInstanceService, LocaleService, ObjectRelativeFromH, ObjectRelativeFromV, PositionedObjectLayoutType, useDependency } from '@univerjs/core';
+import { DocumentFlavor, ICommandService, IUniverInstanceService, LocaleService, ObjectRelativeFromH, ObjectRelativeFromV, PositionedObjectLayoutType } from '@univerjs/core';
import { Checkbox, InputNumber, Select } from '@univerjs/design';
import { DocSkeletonManagerService, RichTextEditingMutation } from '@univerjs/docs';
import { DocSelectionRenderService } from '@univerjs/docs-ui';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
-
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { UpdateDrawingDocTransformCommand } from '../../commands/commands/update-doc-drawing.command';
diff --git a/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingTextWrap.tsx b/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingTextWrap.tsx
index 51f5d42618..72da1647f3 100644
--- a/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingTextWrap.tsx
+++ b/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingTextWrap.tsx
@@ -16,11 +16,12 @@
import type { ICommandInfo, IDrawingParam, Nullable } from '@univerjs/core';
import type { IDocDrawing } from '@univerjs/docs-drawing';
-import { BooleanNumber, ICommandService, IUniverInstanceService, LocaleService, PositionedObjectLayoutType, useDependency, WrapTextType } from '@univerjs/core';
+import { BooleanNumber, ICommandService, IUniverInstanceService, LocaleService, PositionedObjectLayoutType, WrapTextType } from '@univerjs/core';
import { InputNumber, Radio, RadioGroup } from '@univerjs/design';
import { RichTextEditingMutation } from '@univerjs/docs';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { TextWrappingStyle, UpdateDocDrawingDistanceCommand, UpdateDocDrawingWrappingStyleCommand, UpdateDocDrawingWrapTextCommand } from '../../commands/commands/update-doc-drawing.command';
diff --git a/packages/docs-hyper-link-ui/src/views/hyper-link-edit/index.tsx b/packages/docs-hyper-link-ui/src/views/hyper-link-edit/index.tsx
index 425e408aef..812cb76e65 100644
--- a/packages/docs-hyper-link-ui/src/views/hyper-link-edit/index.tsx
+++ b/packages/docs-hyper-link-ui/src/views/hyper-link-edit/index.tsx
@@ -15,10 +15,10 @@
*/
import type { DocumentDataModel } from '@univerjs/core';
-import { BuildTextUtils, getBodySlice, ICommandService, IUniverInstanceService, LocaleService, Tools, UniverInstanceType, useDependency, useObservable } from '@univerjs/core';
+import { BuildTextUtils, getBodySlice, ICommandService, IUniverInstanceService, LocaleService, Tools, UniverInstanceType } from '@univerjs/core';
import { Button, FormLayout, Input } from '@univerjs/design';
import { DocSelectionManagerService } from '@univerjs/docs';
-import { KeyCode } from '@univerjs/ui';
+import { KeyCode, useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { AddDocHyperLinkCommand } from '../../commands/commands/add-link.command';
import { UpdateDocHyperLinkCommand } from '../../commands/commands/update-link.command';
diff --git a/packages/docs-hyper-link-ui/src/views/hyper-link-popup/index.tsx b/packages/docs-hyper-link-ui/src/views/hyper-link-popup/index.tsx
index ba1b07bc23..49b13855aa 100644
--- a/packages/docs-hyper-link-ui/src/views/hyper-link-popup/index.tsx
+++ b/packages/docs-hyper-link-ui/src/views/hyper-link-popup/index.tsx
@@ -15,10 +15,10 @@
*/
import type { DocumentDataModel } from '@univerjs/core';
-import { CustomRangeType, ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { CustomRangeType, ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { MessageType, Tooltip } from '@univerjs/design';
import { CopySingle, LinkSingle, UnlinkSingle, WriteSingle } from '@univerjs/icons';
-import { IMessageService, useObservable } from '@univerjs/ui';
+import { IMessageService, useDependency, useObservable } from '@univerjs/ui';
import cs from 'clsx';
import React from 'react';
import { DeleteDocHyperLinkCommand } from '../../commands/commands/delete-link.command';
diff --git a/packages/docs-mention-ui/src/views/mention-edit-popup/index.tsx b/packages/docs-mention-ui/src/views/mention-edit-popup/index.tsx
index a8699ed5ef..d600791b2f 100644
--- a/packages/docs-mention-ui/src/views/mention-edit-popup/index.tsx
+++ b/packages/docs-mention-ui/src/views/mention-edit-popup/index.tsx
@@ -15,9 +15,10 @@
*/
import type { DocumentDataModel, ITypeMentionList } from '@univerjs/core';
-import { ICommandService, IMentionIOService, IUniverInstanceService, Tools, UniverInstanceType, useDependency, useObservable } from '@univerjs/core';
+import { ICommandService, IMentionIOService, IUniverInstanceService, Tools, UniverInstanceType } from '@univerjs/core';
import { DocSelectionManagerService } from '@univerjs/docs';
import { IEditorService } from '@univerjs/docs-ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useMemo, useState } from 'react';
import { filter } from 'rxjs';
import { AddDocMentionCommand } from '../../commands/commands/doc-mention.command';
diff --git a/packages/docs-thread-comment-ui/src/views/doc-thread-comment-panel/index.tsx b/packages/docs-thread-comment-ui/src/views/doc-thread-comment-panel/index.tsx
index bd6fdb142d..30ccbff963 100644
--- a/packages/docs-thread-comment-ui/src/views/doc-thread-comment-panel/index.tsx
+++ b/packages/docs-thread-comment-ui/src/views/doc-thread-comment-panel/index.tsx
@@ -16,13 +16,15 @@
import type { DocumentDataModel } from '@univerjs/core';
import type { IAddDocCommentComment } from '../../commands/commands/add-doc-comment.command';
-import { ICommandService, Injector, isInternalEditorID, IUniverInstanceService, UniverInstanceType, useDependency, useObservable } from '@univerjs/core';
+import type { IDeleteDocCommentComment } from '../../commands/commands/delete-doc-comment.command';
+import { ICommandService, Injector, isInternalEditorID, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { DocSelectionManagerService, RichTextEditingMutation } from '@univerjs/docs';
import { ThreadCommentPanel } from '@univerjs/thread-comment-ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useMemo, useState } from 'react';
import { debounceTime, filter, Observable } from 'rxjs';
import { AddDocCommentComment } from '../../commands/commands/add-doc-comment.command';
-import { DeleteDocCommentComment, type IDeleteDocCommentComment } from '../../commands/commands/delete-doc-comment.command';
+import { DeleteDocCommentComment } from '../../commands/commands/delete-doc-comment.command';
import { StartAddCommentOperation } from '../../commands/operations/show-comment-panel.operation';
import { DEFAULT_DOC_SUBUNIT_ID } from '../../common/const';
import { shouldDisableAddComment } from '../../controllers/menu';
diff --git a/packages/docs-ui/src/controllers/doc-ui.controller.ts b/packages/docs-ui/src/controllers/doc-ui.controller.ts
index 648ca45a12..d5d96e4f59 100644
--- a/packages/docs-ui/src/controllers/doc-ui.controller.ts
+++ b/packages/docs-ui/src/controllers/doc-ui.controller.ts
@@ -16,7 +16,6 @@
import type { IUniverDocsUIConfig } from './config.schema';
import {
- connectInjector,
Disposable,
ICommandService,
IConfigService,
@@ -28,7 +27,7 @@ import {
import { IRenderManagerService } from '@univerjs/engine-render';
import { TodoList } from '@univerjs/icons';
-import { BuiltInUIPart, ComponentManager, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
+import { BuiltInUIPart, ComponentManager, connectInjector, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
import { CoreHeaderFooterCommand, OpenHeaderFooterPanelCommand } from '../commands/commands/doc-header-footer.command';
import { SidebarDocHeaderFooterPanelOperation } from '../commands/operations/doc-header-footer-panel.operation';
import { COLOR_PICKER_COMPONENT, ColorPicker } from '../components/color-picker';
diff --git a/packages/docs-ui/src/views/count-bar/ZoomSlider.tsx b/packages/docs-ui/src/views/count-bar/ZoomSlider.tsx
index d0ab04d0cf..96d4aa454d 100644
--- a/packages/docs-ui/src/views/count-bar/ZoomSlider.tsx
+++ b/packages/docs-ui/src/views/count-bar/ZoomSlider.tsx
@@ -14,16 +14,15 @@
* limitations under the License.
*/
+import type { DocumentDataModel } from '@univerjs/core';
import {
ICommandService,
IUniverInstanceService,
UniverInstanceType,
- useDependency,
- useObservable,
} from '@univerjs/core';
import { Slider } from '@univerjs/design';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
-import type { DocumentDataModel } from '@univerjs/core';
import { SetDocZoomRatioOperation } from '../../commands/operations/set-doc-zoom-ratio.operation';
const ZOOM_MAP = [50, 80, 100, 130, 150, 170, 200, 400];
diff --git a/packages/docs-ui/src/views/header-footer/panel/DocHeaderFooterOptions.tsx b/packages/docs-ui/src/views/header-footer/panel/DocHeaderFooterOptions.tsx
index 93bd552684..ea0bf569bd 100644
--- a/packages/docs-ui/src/views/header-footer/panel/DocHeaderFooterOptions.tsx
+++ b/packages/docs-ui/src/views/header-footer/panel/DocHeaderFooterOptions.tsx
@@ -15,14 +15,15 @@
*/
import type { IDocumentStyle } from '@univerjs/core';
-import { BooleanNumber, ICommandService, IUniverInstanceService, LocaleService, Tools, useDependency } from '@univerjs/core';
+import type { IHeaderFooterProps } from '../../../commands/commands/doc-header-footer.command';
+import { BooleanNumber, ICommandService, IUniverInstanceService, LocaleService, Tools } from '@univerjs/core';
import { Button, Checkbox, InputNumber } from '@univerjs/design';
import { DocSkeletonManagerService } from '@univerjs/docs';
import { DocumentEditArea, IRenderManagerService } from '@univerjs/engine-render';
-import { ILayoutService } from '@univerjs/ui';
+import { ILayoutService, useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
-import { CloseHeaderFooterCommand, CoreHeaderFooterCommandId, type IHeaderFooterProps } from '../../../commands/commands/doc-header-footer.command';
+import { CloseHeaderFooterCommand, CoreHeaderFooterCommandId } from '../../../commands/commands/doc-header-footer.command';
import { DocSelectionRenderService } from '../../../services/selection/doc-selection-render.service';
import styles from './index.module.less';
diff --git a/packages/docs-ui/src/views/header-footer/panel/DocHeaderFooterPanel.tsx b/packages/docs-ui/src/views/header-footer/panel/DocHeaderFooterPanel.tsx
index 7696cbd3e8..6afa6b5a5e 100644
--- a/packages/docs-ui/src/views/header-footer/panel/DocHeaderFooterPanel.tsx
+++ b/packages/docs-ui/src/views/header-footer/panel/DocHeaderFooterPanel.tsx
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-import { IUniverInstanceService, LocaleService, useDependency } from '@univerjs/core';
+import { IUniverInstanceService, LocaleService } from '@univerjs/core';
import { DocSkeletonManagerService } from '@univerjs/docs';
import { DocumentEditArea, IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { DocHeaderFooterOptions } from './DocHeaderFooterOptions';
diff --git a/packages/docs-ui/src/views/paragraph-setting/Setting.tsx b/packages/docs-ui/src/views/paragraph-setting/Setting.tsx
index 40175a65f2..51177abc7e 100644
--- a/packages/docs-ui/src/views/paragraph-setting/Setting.tsx
+++ b/packages/docs-ui/src/views/paragraph-setting/Setting.tsx
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-import { HorizontalAlign, LocaleService, SpacingRule, useDependency } from '@univerjs/core';
+import { HorizontalAlign, LocaleService, SpacingRule } from '@univerjs/core';
import { InputNumber, Select, Tooltip } from '@univerjs/design';
import { AlignTextBothSingle, HorizontallySingle, LeftJustifyingSingle, RightJustifyingSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import * as React from 'react';
import { useMemo } from 'react';
diff --git a/packages/docs-ui/src/views/paragraph-setting/hook/utils.ts b/packages/docs-ui/src/views/paragraph-setting/hook/utils.ts
index c3d0d2ca17..e6ab37f393 100644
--- a/packages/docs-ui/src/views/paragraph-setting/hook/utils.ts
+++ b/packages/docs-ui/src/views/paragraph-setting/hook/utils.ts
@@ -14,17 +14,18 @@
* limitations under the License.
*/
-import { ICommandService, IUniverInstanceService, SpacingRule, UniverInstanceType, useDependency } from '@univerjs/core';
+import type { DocumentDataModel, IParagraph, ISectionBreak } from '@univerjs/core';
+import type { IDocParagraphSettingCommandParams } from '../../../commands/commands/doc-paragraph-setting.command';
+import { ICommandService, IUniverInstanceService, SpacingRule, UniverInstanceType } from '@univerjs/core';
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
import { getNumberUnitValue, IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import { useEffect, useMemo, useRef, useState } from 'react';
import { BehaviorSubject } from 'rxjs';
import { bufferTime, filter, map } from 'rxjs/operators';
-import type { DocumentDataModel, IParagraph, ISectionBreak } from '@univerjs/core';
import { DocParagraphSettingCommand } from '../../../commands/commands/doc-paragraph-setting.command';
import { findNearestSectionBreak, getParagraphsInRanges } from '../../../commands/commands/list.command';
import { DocParagraphSettingController } from '../../../controllers/doc-paragraph-setting.controller';
-import type { IDocParagraphSettingCommandParams } from '../../../commands/commands/doc-paragraph-setting.command';
const useDocRanges = () => {
const docSelectionManagerService = useDependency(DocSelectionManagerService);
diff --git a/packages/docs-ui/src/views/paragraph-setting/index.tsx b/packages/docs-ui/src/views/paragraph-setting/index.tsx
index 937044a347..9e4d103a4a 100644
--- a/packages/docs-ui/src/views/paragraph-setting/index.tsx
+++ b/packages/docs-ui/src/views/paragraph-setting/index.tsx
@@ -16,8 +16,9 @@
import type { ITextRange } from '@univerjs/core';
import type { IRichTextEditingMutationParams, ISetTextSelectionsOperationParams } from '@univerjs/docs';
-import { debounce, generateRandomId, ICommandService, LocaleService, useDependency, useObservable } from '@univerjs/core';
+import { debounce, generateRandomId, ICommandService, LocaleService } from '@univerjs/core';
import { RichTextEditingMutation, SetTextSelectionsOperation } from '@univerjs/docs';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { DocParagraphSettingCommand } from '../../commands/commands/doc-paragraph-setting.command';
import { ParagraphSetting } from './Setting';
diff --git a/packages/docs-ui/src/views/rich-text-editor/hooks/use-editor.ts b/packages/docs-ui/src/views/rich-text-editor/hooks/use-editor.ts
index 023edf3fdc..238f9d94a0 100644
--- a/packages/docs-ui/src/views/rich-text-editor/hooks/use-editor.ts
+++ b/packages/docs-ui/src/views/rich-text-editor/hooks/use-editor.ts
@@ -17,7 +17,7 @@
import type { IDocumentData, Nullable } from '@univerjs/core';
import type { RefObject } from 'react';
import type { Editor } from '../../../services/editor/editor';
-import { useDependency } from '@univerjs/core';
+import { useDependency } from '@univerjs/ui';
import { useLayoutEffect, useMemo, useState } from 'react';
import { IEditorService } from '../../../services/editor/editor-manager.service';
diff --git a/packages/docs-ui/src/views/rich-text-editor/hooks/use-keyboard-event.ts b/packages/docs-ui/src/views/rich-text-editor/hooks/use-keyboard-event.ts
index 3ade6642bc..4924033702 100644
--- a/packages/docs-ui/src/views/rich-text-editor/hooks/use-keyboard-event.ts
+++ b/packages/docs-ui/src/views/rich-text-editor/hooks/use-keyboard-event.ts
@@ -16,9 +16,9 @@
import type { KeyCode, MetaKeys } from '@univerjs/ui';
import type { Editor } from '../../../services/editor/editor';
-import { CommandType, DisposableCollection, generateRandomId, ICommandService, useDependency } from '@univerjs/core';
+import { CommandType, DisposableCollection, generateRandomId, ICommandService } from '@univerjs/core';
import { DeviceInputEventType } from '@univerjs/engine-render';
-import { IShortcutService } from '@univerjs/ui';
+import { IShortcutService, useDependency } from '@univerjs/ui';
import { useEffect, useMemo } from 'react';
export interface IKeyboardEventConfig {
diff --git a/packages/docs-ui/src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts b/packages/docs-ui/src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
index 06c982dcd7..1e031e86d6 100644
--- a/packages/docs-ui/src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
+++ b/packages/docs-ui/src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
@@ -15,9 +15,9 @@
*/
import type { Editor } from '../../../services/editor/editor';
-import { CommandType, Direction, DisposableCollection, ICommandService, useDependency } from '@univerjs/core';
+import { CommandType, Direction, DisposableCollection, ICommandService } from '@univerjs/core';
import { DeviceInputEventType } from '@univerjs/engine-render';
-import { IShortcutService, KeyCode, MetaKeys } from '@univerjs/ui';
+import { IShortcutService, KeyCode, MetaKeys, useDependency } from '@univerjs/ui';
import { useEffect, useRef } from 'react';
import { MoveCursorOperation, MoveSelectionOperation } from '../../../commands/operations/doc-cursor.operation';
diff --git a/packages/docs-ui/src/views/rich-text-editor/hooks/use-on-change.ts b/packages/docs-ui/src/views/rich-text-editor/hooks/use-on-change.ts
index a61bd52771..50c899919e 100644
--- a/packages/docs-ui/src/views/rich-text-editor/hooks/use-on-change.ts
+++ b/packages/docs-ui/src/views/rich-text-editor/hooks/use-on-change.ts
@@ -17,8 +17,9 @@
import type { IDocumentData } from '@univerjs/core';
import type { IRichTextEditingMutationParams } from '@univerjs/docs';
import type { Editor } from '../../../services/editor/editor';
-import { ICommandService, useDependency } from '@univerjs/core';
+import { ICommandService } from '@univerjs/core';
import { RichTextEditingMutation } from '@univerjs/docs';
+import { useDependency } from '@univerjs/ui';
import { useEffect } from 'react';
export function useOnChange(editor: Editor | undefined, onChange: (data: IDocumentData) => void) {
diff --git a/packages/docs-ui/src/views/rich-text-editor/index.tsx b/packages/docs-ui/src/views/rich-text-editor/index.tsx
index 75e9042a5b..ba6f0ee566 100644
--- a/packages/docs-ui/src/views/rich-text-editor/index.tsx
+++ b/packages/docs-ui/src/views/rich-text-editor/index.tsx
@@ -17,10 +17,10 @@
import type { IDocumentData } from '@univerjs/core';
import type { Editor } from '../../services/editor/editor';
import type { IKeyboardEventConfig } from './hooks';
-import { BuildTextUtils, createInternalEditorID, generateRandomId, useDependency, useObservable } from '@univerjs/core';
+import { BuildTextUtils, createInternalEditorID, generateRandomId } from '@univerjs/core';
import { DocSkeletonManagerService } from '@univerjs/docs';
import { IRenderManagerService } from '@univerjs/engine-render';
-import { useEvent } from '@univerjs/ui';
+import { useDependency, useEvent, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from 'react';
import { IEditorService } from '../../services/editor/editor-manager.service';
diff --git a/packages/docs-ui/src/views/table/create/TableCreate.tsx b/packages/docs-ui/src/views/table/create/TableCreate.tsx
index 91b4ad9552..8f00c68910 100644
--- a/packages/docs-ui/src/views/table/create/TableCreate.tsx
+++ b/packages/docs-ui/src/views/table/create/TableCreate.tsx
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-import React, { useEffect, useState } from 'react';
-import { LocaleService, useDependency } from '@univerjs/core';
-
+import { LocaleService } from '@univerjs/core';
import { InputNumber } from '@univerjs/design';
+import { useDependency } from '@univerjs/ui';
+
+import React, { useEffect, useState } from 'react';
import styles from './index.module.less';
interface IDocCreateTableConfirmProps {
diff --git a/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx b/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx
index ea11c2d8f5..20a6510216 100644
--- a/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx
+++ b/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx
@@ -15,9 +15,10 @@
*/
import type { IDrawingSearch } from '@univerjs/core';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { DropdownLegacy } from '@univerjs/design';
import { Autofill, MoreDownSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useState } from 'react';
import styles from './index.module.less';
diff --git a/packages/drawing-ui/src/views/panel/DrawingAlign.tsx b/packages/drawing-ui/src/views/panel/DrawingAlign.tsx
index a03c50d68c..dbc038a264 100644
--- a/packages/drawing-ui/src/views/panel/DrawingAlign.tsx
+++ b/packages/drawing-ui/src/views/panel/DrawingAlign.tsx
@@ -15,10 +15,11 @@
*/
import type { IDrawingParam } from '@univerjs/core';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
-import React, { useState } from 'react';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { Select } from '@univerjs/design';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
+import React, { useState } from 'react';
import { AlignType, SetDrawingAlignOperation } from '../../commands/operations/drawing-align.operation';
import styles from './index.module.less';
diff --git a/packages/drawing-ui/src/views/panel/DrawingArrange.tsx b/packages/drawing-ui/src/views/panel/DrawingArrange.tsx
index 41dca77cdd..2170a470c6 100644
--- a/packages/drawing-ui/src/views/panel/DrawingArrange.tsx
+++ b/packages/drawing-ui/src/views/panel/DrawingArrange.tsx
@@ -15,10 +15,11 @@
*/
import type { IDrawingParam } from '@univerjs/core';
-import { ArrangeTypeEnum, LocaleService, useDependency } from '@univerjs/core';
+import { ArrangeTypeEnum, LocaleService } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { BottomSingle, MoveDownSingle, MoveUpSingle, TopmostSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import styles from './index.module.less';
diff --git a/packages/drawing-ui/src/views/panel/DrawingCommonPanel.tsx b/packages/drawing-ui/src/views/panel/DrawingCommonPanel.tsx
index cca2ba28f6..3ae4685a0b 100644
--- a/packages/drawing-ui/src/views/panel/DrawingCommonPanel.tsx
+++ b/packages/drawing-ui/src/views/panel/DrawingCommonPanel.tsx
@@ -14,9 +14,11 @@
* limitations under the License.
*/
-import { type IDrawingParam, LocaleService, useDependency } from '@univerjs/core';
+import type { IDrawingParam } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { getUpdateParams } from '../../utils/get-update-params';
import { DrawingAlign } from './DrawingAlign';
diff --git a/packages/drawing-ui/src/views/panel/DrawingGroup.tsx b/packages/drawing-ui/src/views/panel/DrawingGroup.tsx
index e8365f95b6..37493b24fc 100644
--- a/packages/drawing-ui/src/views/panel/DrawingGroup.tsx
+++ b/packages/drawing-ui/src/views/panel/DrawingGroup.tsx
@@ -14,12 +14,14 @@
* limitations under the License.
*/
+import type { IDrawingParam } from '@univerjs/core';
import type { IDrawingGroupUpdateParam } from '@univerjs/drawing';
-import { DrawingTypeEnum, type IDrawingParam, LocaleService, Tools, useDependency } from '@univerjs/core';
+import { DrawingTypeEnum, LocaleService, Tools } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { getGroupState, IRenderManagerService, transformObjectOutOfGroup } from '@univerjs/engine-render';
import { GroupSingle, UngroupSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { getUpdateParams } from '../../utils/get-update-params';
diff --git a/packages/drawing-ui/src/views/panel/DrawingTransform.tsx b/packages/drawing-ui/src/views/panel/DrawingTransform.tsx
index bf72d07c9b..ef3a4bc4fa 100644
--- a/packages/drawing-ui/src/views/panel/DrawingTransform.tsx
+++ b/packages/drawing-ui/src/views/panel/DrawingTransform.tsx
@@ -16,10 +16,11 @@
import type { IDrawingParam, Nullable } from '@univerjs/core';
import type { IChangeObserverConfig, Scene } from '@univerjs/engine-render';
-import { debounce, LocaleService, useDependency } from '@univerjs/core';
+import { debounce, LocaleService } from '@univerjs/core';
import { Checkbox, InputNumber } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { MIN_DRAWING_HEIGHT_LIMIT, MIN_DRAWING_WIDTH_LIMIT, RANGE_DRAWING_ROTATION_LIMIT } from '../../utils/config';
diff --git a/packages/drawing-ui/src/views/panel/ImageCropper.tsx b/packages/drawing-ui/src/views/panel/ImageCropper.tsx
index eac23c8260..2b146869fc 100644
--- a/packages/drawing-ui/src/views/panel/ImageCropper.tsx
+++ b/packages/drawing-ui/src/views/panel/ImageCropper.tsx
@@ -15,11 +15,12 @@
*/
import type { IDrawingParam } from '@univerjs/core';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
-import React, { useEffect, useRef, useState } from 'react';
-import { CreateCopySingle } from '@univerjs/icons';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { Button, Select } from '@univerjs/design';
+import { CreateCopySingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
+import React, { useEffect, useRef, useState } from 'react';
import { AutoImageCropOperation, CloseImageCropOperation, CropType } from '../../commands/operations/image-crop.operation';
import styles from './index.module.less';
diff --git a/packages/find-replace/src/views/dialog/FindReplaceDialog.stories.tsx b/packages/find-replace/src/views/dialog/FindReplaceDialog.stories.tsx
index a96ea771e2..5fe1e5ac12 100644
--- a/packages/find-replace/src/views/dialog/FindReplaceDialog.stories.tsx
+++ b/packages/find-replace/src/views/dialog/FindReplaceDialog.stories.tsx
@@ -16,15 +16,15 @@
import type { Meta } from '@storybook/react';
import type { Dependency } from '@univerjs/core';
-import { LocaleService, LocaleType, RediContext } from '@univerjs/core';
-import React, { useContext, useMemo, useState } from 'react';
+import { LocaleService, LocaleType } from '@univerjs/core';
+import { DesktopLayoutService, ILayoutService, RediContext } from '@univerjs/ui';
-import { DesktopLayoutService, ILayoutService } from '@univerjs/ui';
-import { FindReplaceService, IFindReplaceService } from '../../services/find-replace.service';
+import React, { useContext, useMemo, useState } from 'react';
import { FindReplaceController } from '../../controllers/find-replace.controller';
import enUS from '../../locale/en-US';
-import zhCN from '../../locale/zh-CN';
import ruRU from '../../locale/ru-RU';
+import zhCN from '../../locale/zh-CN';
+import { FindReplaceService, IFindReplaceService } from '../../services/find-replace.service';
import { FindReplaceDialog } from './FindReplaceDialog';
const meta: Meta = {
diff --git a/packages/find-replace/src/views/dialog/FindReplaceDialog.tsx b/packages/find-replace/src/views/dialog/FindReplaceDialog.tsx
index 9fdad8cdfb..dcf6215af9 100644
--- a/packages/find-replace/src/views/dialog/FindReplaceDialog.tsx
+++ b/packages/find-replace/src/views/dialog/FindReplaceDialog.tsx
@@ -16,9 +16,9 @@
import type { IDisposable, Nullable } from '@univerjs/core';
import type { ForwardedRef } from 'react';
-import { ICommandService, IContextService, LocaleService, useDependency } from '@univerjs/core';
+import { ICommandService, IContextService, LocaleService } from '@univerjs/core';
import { Button, Checkbox, FormDualColumnLayout, FormLayout, Input, MessageType, Select } from '@univerjs/design';
-import { ILayoutService, IMessageService, useObservable } from '@univerjs/ui';
+import { ILayoutService, IMessageService, useDependency, useObservable } from '@univerjs/ui';
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
import { fromEvent } from 'rxjs';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/color-picker/index.tsx b/packages/sheets-conditional-formatting-ui/src/components/color-picker/index.tsx
index da4b6c0dcf..1f903ea01b 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/color-picker/index.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/color-picker/index.tsx
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-import { ColorKit, useDependency } from '@univerjs/core';
+import { ColorKit } from '@univerjs/core';
import { DropdownLegacy, ColorPicker as OriginColorPicker } from '@univerjs/design';
import { MoreDownSingle } from '@univerjs/icons';
-import { ComponentManager } from '@univerjs/ui';
+import { ComponentManager, useDependency } from '@univerjs/ui';
import React, { useMemo } from 'react';
import styles from './index.module.less';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/conditional-style-editor/index.tsx b/packages/sheets-conditional-formatting-ui/src/components/conditional-style-editor/index.tsx
index bdf4c4db41..808d379083 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/conditional-style-editor/index.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/conditional-style-editor/index.tsx
@@ -15,9 +15,9 @@
*/
import type { IHighlightCell } from '@univerjs/sheets-conditional-formatting';
-import { BooleanNumber, useDependency } from '@univerjs/core';
+import { BooleanNumber } from '@univerjs/core';
import { removeUndefinedAttr } from '@univerjs/sheets-conditional-formatting';
-import { ComponentManager } from '@univerjs/ui';
+import { ComponentManager, useDependency } from '@univerjs/ui';
import cl from 'clsx';
import React, { useEffect, useState } from 'react';
import { ColorPicker } from '../color-picker';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/ColorScale.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/ColorScale.tsx
index 78cdf18215..fa42793a0d 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/ColorScale.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/ColorScale.tsx
@@ -17,12 +17,11 @@
import type { Workbook } from '@univerjs/core';
import type { IColorScale, IConditionalFormattingRuleConfig } from '@univerjs/sheets-conditional-formatting';
import type { IStyleEditorProps } from './type';
-
-import { IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { InputNumber, Select } from '@univerjs/design';
import { CFRuleType, CFValueType, createDefaultValueByValueType } from '@univerjs/sheets-conditional-formatting';
import { FormulaEditor } from '@univerjs/sheets-formula-ui';
-import { useSidebarClick } from '@univerjs/ui';
+import { useDependency, useSidebarClick } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { ColorPicker } from '../../color-picker';
import { Preview } from '../../preview';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/DataBar.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/DataBar.tsx
index a57102bd84..fb865bd51d 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/DataBar.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/DataBar.tsx
@@ -17,12 +17,12 @@
import type { Workbook } from '@univerjs/core';
import type { IConditionalFormattingRuleConfig, IValueConfig } from '@univerjs/sheets-conditional-formatting';
import type { IStyleEditorProps } from './type';
-import { IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { Checkbox, InputNumber, Radio, RadioGroup, Select } from '@univerjs/design';
-
import { CFRuleType, CFValueType, createDefaultValueByValueType, defaultDataBarNativeColor, defaultDataBarPositiveColor } from '@univerjs/sheets-conditional-formatting';
+
import { FormulaEditor } from '@univerjs/sheets-formula-ui';
-import { useSidebarClick } from '@univerjs/ui';
+import { useDependency, useSidebarClick } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { ColorPicker } from '../../color-picker';
import { Preview } from '../../preview';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/Formula.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/Formula.tsx
index 8b90d6396c..b8eea47e7e 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/Formula.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/Formula.tsx
@@ -17,10 +17,10 @@
import type { Workbook } from '@univerjs/core';
import type { IAverageHighlightCell, IConditionalFormattingRuleConfig, IHighlightCell, IRankHighlightCell } from '@univerjs/sheets-conditional-formatting';
import type { IStyleEditorProps } from './type';
-import { IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { CFRuleType, CFSubRuleType } from '@univerjs/sheets-conditional-formatting';
import { FormulaEditor } from '@univerjs/sheets-formula-ui';
-import { useSidebarClick } from '@univerjs/ui';
+import { useDependency, useSidebarClick } from '@univerjs/ui';
import React, { useEffect, useRef, useState } from 'react';
import { ConditionalStyleEditor } from '../../conditional-style-editor';
import { Preview } from '../../preview';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/HighlightCell.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/HighlightCell.tsx
index e9a6a3e7b1..0b4918427b 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/HighlightCell.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/HighlightCell.tsx
@@ -22,7 +22,7 @@ import type {
ITimePeriodHighlightCell,
} from '@univerjs/sheets-conditional-formatting';
import type { IStyleEditorProps } from './type';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Input, InputNumber, Select } from '@univerjs/design';
import {
CFNumberOperator,
@@ -32,6 +32,7 @@ import {
CFTimePeriodOperator,
createDefaultValue,
} from '@univerjs/sheets-conditional-formatting';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useMemo, useState } from 'react';
import { ConditionalStyleEditor } from '../../conditional-style-editor';
import { Preview } from '../../preview';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/IconSet.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/IconSet.tsx
index 448cd02002..8c5ba3adb5 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/IconSet.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/IconSet.tsx
@@ -18,10 +18,9 @@ import type { Workbook } from '@univerjs/core';
import type { IIconSet, IIconType } from '@univerjs/sheets-conditional-formatting';
import type { IStyleEditorProps } from './type';
-import { get, IUniverInstanceService, LocaleService, set, Tools, UniverInstanceType, useDependency } from '@univerjs/core';
+import { get, IUniverInstanceService, LocaleService, set, Tools, UniverInstanceType } from '@univerjs/core';
import { Checkbox, DropdownLegacy, InputNumber, Select } from '@univerjs/design';
import { MoreDownSingle, SlashSingle } from '@univerjs/icons';
-
import {
CFNumberOperator,
CFRuleType,
@@ -34,8 +33,9 @@ import {
iconGroup,
iconMap,
} from '@univerjs/sheets-conditional-formatting';
+
import { FormulaEditor } from '@univerjs/sheets-formula-ui';
-import { ILayoutService, useScrollYOverContainer, useSidebarClick } from '@univerjs/ui';
+import { ILayoutService, useDependency, useScrollYOverContainer, useSidebarClick } from '@univerjs/ui';
import React, { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/Rank.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/Rank.tsx
index 92ff09d563..9ff7c47c41 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/Rank.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/Rank.tsx
@@ -16,9 +16,10 @@
import type { IAverageHighlightCell, IConditionalFormattingRuleConfig, IHighlightCell, IRankHighlightCell } from '@univerjs/sheets-conditional-formatting';
import type { IStyleEditorProps } from './type';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Checkbox, InputNumber, Select } from '@univerjs/design';
import { CFNumberOperator, CFRuleType, CFSubRuleType } from '@univerjs/sheets-conditional-formatting';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { ConditionalStyleEditor } from '../../conditional-style-editor';
import { Preview } from '../../preview';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx
index aa71431124..40d11a6d3e 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx
@@ -21,13 +21,13 @@ import type { IAddCfCommandParams } from '../../../commands/commands/add-cf.comm
import type { ISetCfCommandParams } from '../../../commands/commands/set-cf.command';
import type { IStyleEditorProps } from './type';
-import { ICommandService, InterceptorManager, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, InterceptorManager, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { Button, Select } from '@univerjs/design';
import { deserializeRangeWithSheet, serializeRange } from '@univerjs/engine-formula';
import { RemoveSheetMutation, setEndForRange, SetWorksheetActiveOperation, SheetsSelectionsService } from '@univerjs/sheets';
import { CFRuleType, CFSubRuleType, ConditionalFormattingRuleModel } from '@univerjs/sheets-conditional-formatting';
import { RangeSelector } from '@univerjs/sheets-formula-ui';
-import { useSidebarClick } from '@univerjs/ui';
+import { useDependency, useSidebarClick } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { AddCfCommand } from '../../../commands/commands/add-cf.command';
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-list/index.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-list/index.tsx
index 18b2c984b2..4e3381e773 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-list/index.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-list/index.tsx
@@ -19,14 +19,14 @@ import type { IConditionFormattingRule } from '@univerjs/sheets-conditional-form
import type { IDeleteCfCommandParams } from '../../../commands/commands/delete-cf.command';
import type { IMoveCfCommand } from '../../../commands/commands/move-cf.command';
-import { ICommandService, Injector, IUniverInstanceService, LocaleService, Rectangle, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, Injector, IUniverInstanceService, LocaleService, Rectangle, UniverInstanceType } from '@univerjs/core';
import { Select, Tooltip } from '@univerjs/design';
import { serializeRange } from '@univerjs/engine-formula';
import { DeleteSingle, IncreaseSingle, SequenceSingle } from '@univerjs/icons';
import { checkRangesEditablePermission, SetSelectionsOperation, SetWorksheetActiveOperation, SheetsSelectionsService } from '@univerjs/sheets';
import { AddConditionalRuleMutation, CFRuleType, CFSubRuleType, ConditionalFormattingRuleModel, DeleteConditionalRuleMutation, MoveConditionalRuleMutation, SetConditionalRuleMutation } from '@univerjs/sheets-conditional-formatting';
import { useHighlightRange } from '@univerjs/sheets-ui';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import GridLayout from 'react-grid-layout';
import { debounceTime, Observable } from 'rxjs';
diff --git a/packages/sheets-crosshair-highlight/src/views/components/CrosshairHighlight.tsx b/packages/sheets-crosshair-highlight/src/views/components/CrosshairHighlight.tsx
index 9c713dbf1d..286e90e4a5 100644
--- a/packages/sheets-crosshair-highlight/src/views/components/CrosshairHighlight.tsx
+++ b/packages/sheets-crosshair-highlight/src/views/components/CrosshairHighlight.tsx
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import { useDependency, useObservable } from '@univerjs/core';
-import React, { useCallback } from 'react';
+import { useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
+import React, { useCallback } from 'react';
import { CROSSHAIR_HIGHLIGHT_COLORS, SheetsCrosshairHighlightService } from '../../services/crosshair.service';
import styles from './index.module.less';
diff --git a/packages/sheets-data-validation-ui/src/views/components/date-dropdown/index.tsx b/packages/sheets-data-validation-ui/src/views/components/date-dropdown/index.tsx
index b7649a0251..ad51e76b3d 100644
--- a/packages/sheets-data-validation-ui/src/views/components/date-dropdown/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/date-dropdown/index.tsx
@@ -18,14 +18,14 @@ import type { CellValue, Nullable } from '@univerjs/core';
import type { DateValidator } from '@univerjs/sheets-data-validation';
import type { IEditorBridgeServiceVisibleParam } from '@univerjs/sheets-ui';
import type { IDropdownComponentProps } from '../../../services/dropdown-manager.service';
-import { CellValueType, DataValidationErrorStyle, dayjs, ICommandService, LocaleService, numfmt, useDependency } from '@univerjs/core';
+import { CellValueType, DataValidationErrorStyle, dayjs, ICommandService, LocaleService, numfmt } from '@univerjs/core';
import { Button, DatePanel } from '@univerjs/design';
import { DeviceInputEventType } from '@univerjs/engine-render';
import { SetRangeValuesCommand } from '@univerjs/sheets';
import { getCellValueOrigin, SheetDataValidationModel } from '@univerjs/sheets-data-validation';
import { getPatternType } from '@univerjs/sheets-numfmt';
import { SetCellEditVisibleOperation } from '@univerjs/sheets-ui';
-import { KeyCode } from '@univerjs/ui';
+import { KeyCode, useDependency } from '@univerjs/ui';
import React, { useState } from 'react';
import { DataValidationRejectInputController } from '../../../controllers/dv-reject-input.controller';
import styles from './index.module.less';
diff --git a/packages/sheets-data-validation-ui/src/views/components/detail/index.tsx b/packages/sheets-data-validation-ui/src/views/components/detail/index.tsx
index ac6ec02bf7..3dc310bcdf 100644
--- a/packages/sheets-data-validation-ui/src/views/components/detail/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/detail/index.tsx
@@ -16,15 +16,15 @@
import type { DataValidationOperator, DataValidationType, IDataValidationRuleBase, IDataValidationRuleOptions, IExecutionOptions, ISheetDataValidationRule, IUnitRange, Workbook } from '@univerjs/core';
import type { IUpdateSheetDataValidationRangeCommandParams } from '@univerjs/sheets-data-validation';
-import { debounce, ICommandService, isUnitRangesEqual, IUniverInstanceService, LocaleService, RedoCommand, shallowEqual, UndoCommand, UniverInstanceType, useDependency } from '@univerjs/core';
+import { debounce, ICommandService, isUnitRangesEqual, IUniverInstanceService, LocaleService, RedoCommand, shallowEqual, UndoCommand, UniverInstanceType } from '@univerjs/core';
import { DataValidationModel, DataValidatorRegistryScope, DataValidatorRegistryService, getRuleOptions, getRuleSetting, TWO_FORMULA_OPERATOR_COUNT } from '@univerjs/data-validation';
import { Button, Checkbox, FormLayout, Select } from '@univerjs/design';
import { deserializeRangeWithSheet, serializeRange } from '@univerjs/engine-formula';
import { SheetsSelectionsService } from '@univerjs/sheets';
import { RemoveSheetDataValidationCommand, UpdateSheetDataValidationOptionsCommand, UpdateSheetDataValidationRangeCommand, UpdateSheetDataValidationSettingCommand } from '@univerjs/sheets-data-validation';
import { RangeSelector } from '@univerjs/sheets-formula-ui';
+import { ComponentManager, useDependency, useEvent, useObservable, useSidebarClick } from '@univerjs/ui';
-import { ComponentManager, useEvent, useObservable, useSidebarClick } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { DataValidationPanelService } from '../../../services/data-validation-panel.service';
import { DataValidationOptions } from '../options';
diff --git a/packages/sheets-data-validation-ui/src/views/components/drop-down/CellDropdown.tsx b/packages/sheets-data-validation-ui/src/views/components/drop-down/CellDropdown.tsx
index 89c33ed547..be0f07b3c2 100644
--- a/packages/sheets-data-validation-ui/src/views/components/drop-down/CellDropdown.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/drop-down/CellDropdown.tsx
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-import { useDependency } from '@univerjs/core';
-import { ComponentManager, useObservable } from '@univerjs/ui';
+import { ComponentManager, useDependency, useObservable } from '@univerjs/ui';
import React from 'react';
import { DataValidationDropdownManagerService } from '../../../services/dropdown-manager.service';
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/base-formula-input.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/base-formula-input.tsx
index f4157a5cdc..cd6ba60ea4 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/base-formula-input.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/base-formula-input.tsx
@@ -15,9 +15,9 @@
*/
import type { IFormulaInputProps } from '@univerjs/data-validation';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { FormLayout, Input } from '@univerjs/design';
-import React from 'react';
+import { useDependency } from '@univerjs/ui';
import styles from './index.module.less';
export const BaseFormulaInput = (props: IFormulaInputProps) => {
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/checkbox-formula-input.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/checkbox-formula-input.tsx
index 39d8d9e824..892351c838 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/checkbox-formula-input.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/checkbox-formula-input.tsx
@@ -15,8 +15,9 @@
*/
import type { IFormulaInputProps } from '@univerjs/data-validation';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Checkbox, FormLayout, Input } from '@univerjs/design';
+import { useDependency } from '@univerjs/ui';
import React, { useState } from 'react';
import styles from './index.module.less';
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/list-formula-input.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/list-formula-input.tsx
index f0c83ba9a0..4e31d83aa5 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/list-formula-input.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/list-formula-input.tsx
@@ -14,15 +14,16 @@
* limitations under the License.
*/
+import type { IFormulaInputProps } from '@univerjs/data-validation';
import type { ListValidator } from '@univerjs/sheets-data-validation';
-import { DataValidationType, isFormulaString, LocaleService, Tools, useDependency } from '@univerjs/core';
-import { DataValidationModel, DataValidatorRegistryService, type IFormulaInputProps } from '@univerjs/data-validation';
+import { DataValidationType, isFormulaString, LocaleService, Tools } from '@univerjs/core';
+import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
import { DraggableList, FormLayout, Input, Radio, RadioGroup, Select } from '@univerjs/design';
import { DeleteSingle, IncreaseSingle, SequenceSingle } from '@univerjs/icons';
import { DataValidationFormulaController, deserializeListOptions, serializeListOptions } from '@univerjs/sheets-data-validation';
import { FormulaEditor } from '@univerjs/sheets-formula-ui';
+import { useDependency, useEvent, useObservable, useSidebarClick } from '@univerjs/ui';
-import { useEvent, useObservable, useSidebarClick } from '@univerjs/ui';
import cs from 'clsx';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { debounceTime } from 'rxjs';
diff --git a/packages/sheets-data-validation-ui/src/views/components/item/index.tsx b/packages/sheets-data-validation-ui/src/views/components/item/index.tsx
index 2eb0e050f4..c81e971944 100644
--- a/packages/sheets-data-validation-ui/src/views/components/item/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/item/index.tsx
@@ -14,13 +14,14 @@
* limitations under the License.
*/
-import { ICommandService, type ISheetDataValidationRule } from '@univerjs/core';
-import { useDependency } from '@univerjs/core';
+import type { ISheetDataValidationRule } from '@univerjs/core';
+import { ICommandService } from '@univerjs/core';
import { DataValidatorRegistryService } from '@univerjs/data-validation';
import { serializeRange } from '@univerjs/engine-formula';
import { DeleteSingle } from '@univerjs/icons';
import { RemoveSheetDataValidationCommand } from '@univerjs/sheets-data-validation';
import { IMarkSelectionService } from '@univerjs/sheets-ui';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useRef, useState } from 'react';
import styles from './index.module.less';
diff --git a/packages/sheets-data-validation-ui/src/views/components/list-dropdown/index.tsx b/packages/sheets-data-validation-ui/src/views/components/list-dropdown/index.tsx
index b60e274f99..5865e271f6 100644
--- a/packages/sheets-data-validation-ui/src/views/components/list-dropdown/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/list-dropdown/index.tsx
@@ -21,7 +21,7 @@ import type { ListMultipleValidator } from '@univerjs/sheets-data-validation';
import type { IEditorBridgeServiceVisibleParam } from '@univerjs/sheets-ui';
import type { IUniverSheetsDataValidationUIConfig } from '../../../controllers/config.schema';
import type { IDropdownComponentProps } from '../../../services/dropdown-manager.service';
-import { BuildTextUtils, DataValidationRenderMode, DataValidationType, ICommandService, IConfigService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { BuildTextUtils, DataValidationRenderMode, DataValidationType, ICommandService, IConfigService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { DataValidationModel } from '@univerjs/data-validation';
import { Scrollbar } from '@univerjs/design';
import { RichTextEditingMutation } from '@univerjs/docs';
@@ -30,7 +30,7 @@ import { CheckMarkSingle } from '@univerjs/icons';
import { RangeProtectionPermissionEditPoint, SetRangeValuesCommand, SheetPermissionCheckController, WorkbookEditablePermission, WorksheetEditPermission } from '@univerjs/sheets';
import { deserializeListOptions, getDataValidationCellValue, serializeListOptions, SheetDataValidationModel } from '@univerjs/sheets-data-validation';
import { IEditorBridgeService, SetCellEditVisibleOperation } from '@univerjs/sheets-ui';
-import { KeyCode, RectPopup, useObservable } from '@univerjs/ui';
+import { KeyCode, RectPopup, useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useMemo, useState } from 'react';
import { debounceTime } from 'rxjs';
import { OpenValidationPanelOperation } from '../../../commands/operations/data-validation.operation';
diff --git a/packages/sheets-data-validation-ui/src/views/components/list/index.tsx b/packages/sheets-data-validation-ui/src/views/components/list/index.tsx
index 679ba9a52e..422533b6fe 100644
--- a/packages/sheets-data-validation-ui/src/views/components/list/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/list/index.tsx
@@ -16,11 +16,11 @@
import type { ISheetDataValidationRule, Workbook } from '@univerjs/core';
import type { IAddSheetDataValidationCommandParams } from '@univerjs/sheets-data-validation';
-import { ICommandService, Injector, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, Injector, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { checkRangesEditablePermission } from '@univerjs/sheets';
import { AddSheetDataValidationCommand, createDefaultNewRule, RemoveSheetAllDataValidationCommand, SheetDataValidationModel } from '@univerjs/sheets-data-validation';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { DataValidationPanelService } from '../../../services/data-validation-panel.service';
import { DataValidationItem } from '../item';
diff --git a/packages/sheets-data-validation-ui/src/views/components/options/index.tsx b/packages/sheets-data-validation-ui/src/views/components/options/index.tsx
index 6bc49b4967..e53b7bd97d 100644
--- a/packages/sheets-data-validation-ui/src/views/components/options/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/options/index.tsx
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-import { DataValidationErrorStyle, type IDataValidationRuleOptions, LocaleService } from '@univerjs/core';
-import { useDependency } from '@univerjs/core';
+import type { IDataValidationRuleOptions } from '@univerjs/core';
+import { DataValidationErrorStyle, LocaleService } from '@univerjs/core';
import { Checkbox, FormLayout, Input, Radio, RadioGroup } from '@univerjs/design';
import { MoreDownSingle, MoreUpSingle } from '@univerjs/icons';
-import { ComponentManager } from '@univerjs/ui';
+import { ComponentManager, useDependency } from '@univerjs/ui';
import React, { useState } from 'react';
import styles from './index.module.less';
diff --git a/packages/sheets-data-validation-ui/src/views/components/panel/index.tsx b/packages/sheets-data-validation-ui/src/views/components/panel/index.tsx
index fb056aad58..1cef3e1262 100644
--- a/packages/sheets-data-validation-ui/src/views/components/panel/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/panel/index.tsx
@@ -14,9 +14,7 @@
* limitations under the License.
*/
-import { useDependency } from '@univerjs/core';
-import { useObservable } from '@univerjs/ui';
-import React from 'react';
+import { useDependency, useObservable } from '@univerjs/ui';
import { DataValidationPanelService } from '../../../services/data-validation-panel.service';
import { DataValidationDetail } from '../detail';
import { DataValidationList } from '../list';
diff --git a/packages/sheets-data-validation-ui/src/views/components/render-mode/index.tsx b/packages/sheets-data-validation-ui/src/views/components/render-mode/index.tsx
index 28ee0a17d4..b65a516ea2 100644
--- a/packages/sheets-data-validation-ui/src/views/components/render-mode/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/render-mode/index.tsx
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-import { type IDataValidationRuleOptions, LocaleService } from '@univerjs/core';
-import { DataValidationRenderMode, useDependency } from '@univerjs/core';
+import type { IDataValidationRuleOptions } from '@univerjs/core';
+import { DataValidationRenderMode, LocaleService } from '@univerjs/core';
import { FormLayout, Radio, RadioGroup } from '@univerjs/design';
-import React from 'react';
+import { useDependency } from '@univerjs/ui';
export interface IListRenderModeInputProps {
value: IDataValidationRuleOptions;
diff --git a/packages/sheets-data-validation-ui/src/views/components/show-time/index.tsx b/packages/sheets-data-validation-ui/src/views/components/show-time/index.tsx
index 37799904bb..28183918d7 100644
--- a/packages/sheets-data-validation-ui/src/views/components/show-time/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/show-time/index.tsx
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-import { type IDataValidationRuleOptions, LocaleService } from '@univerjs/core';
-import { useDependency } from '@univerjs/core';
+import type { IDataValidationRuleOptions } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Checkbox, FormLayout } from '@univerjs/design';
+import { useDependency } from '@univerjs/ui';
import React from 'react';
export interface IDateShowTimeOptionProps {
diff --git a/packages/sheets-drawing-ui/src/controllers/drawing-popup-menu.controller.ts b/packages/sheets-drawing-ui/src/controllers/drawing-popup-menu.controller.ts
index fd20e051fe..670cdd38ec 100644
--- a/packages/sheets-drawing-ui/src/controllers/drawing-popup-menu.controller.ts
+++ b/packages/sheets-drawing-ui/src/controllers/drawing-popup-menu.controller.ts
@@ -17,12 +17,12 @@
import type { IDisposable, Nullable, Workbook } from '@univerjs/core';
import type { BaseObject, Scene } from '@univerjs/engine-render';
import type { ISheetFloatDom } from '@univerjs/sheets-drawing';
-import { connectInjector, DrawingTypeEnum, FOCUSING_COMMON_DRAWINGS, ICommandService, IContextService, Inject, Injector, IUniverInstanceService, RxDisposable, toDisposable, UniverInstanceType } from '@univerjs/core';
+import { DrawingTypeEnum, FOCUSING_COMMON_DRAWINGS, ICommandService, IContextService, Inject, Injector, IUniverInstanceService, RxDisposable, toDisposable, UniverInstanceType } from '@univerjs/core';
import { IDrawingManagerService, SetDrawingSelectedOperation } from '@univerjs/drawing';
import { COMPONENT_IMAGE_POPUP_MENU, ImageCropperObject, ImageResetSizeOperation, OpenImageCropOperation } from '@univerjs/drawing-ui';
import { IRenderManagerService } from '@univerjs/engine-render';
import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
-import { BuiltInUIPart, IUIPartsService } from '@univerjs/ui';
+import { BuiltInUIPart, connectInjector, IUIPartsService } from '@univerjs/ui';
import { takeUntil } from 'rxjs';
import { RemoveSheetDrawingCommand } from '../commands/commands/remove-sheet-drawing.command';
diff --git a/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingAnchor.tsx b/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingAnchor.tsx
index a5ee033c41..5e3590de45 100644
--- a/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingAnchor.tsx
+++ b/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingAnchor.tsx
@@ -17,11 +17,12 @@
import type { IDrawingParam, Nullable } from '@univerjs/core';
import type { BaseObject } from '@univerjs/engine-render';
import type { ISheetDrawing } from '@univerjs/sheets-drawing';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { Radio, RadioGroup } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
import { SheetDrawingAnchorType } from '@univerjs/sheets-drawing';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { SetSheetDrawingCommand } from '../../commands/commands/set-sheet-drawing.command';
diff --git a/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingPanel.tsx b/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingPanel.tsx
index 9cb63bfc61..7c87ce4abb 100644
--- a/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingPanel.tsx
+++ b/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingPanel.tsx
@@ -15,9 +15,9 @@
*/
import type { IDrawingParam } from '@univerjs/core';
-import { useDependency } from '@univerjs/core';
import { IDrawingManagerService } from '@univerjs/drawing';
import { DrawingCommonPanel } from '@univerjs/drawing-ui';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import styles from './index.module.less';
import { SheetDrawingAnchor } from './SheetDrawingAnchor';
diff --git a/packages/sheets-drawing-ui/src/views/upload-loading/UploadLoading.tsx b/packages/sheets-drawing-ui/src/views/upload-loading/UploadLoading.tsx
index f36ce50a0f..f78015614e 100644
--- a/packages/sheets-drawing-ui/src/views/upload-loading/UploadLoading.tsx
+++ b/packages/sheets-drawing-ui/src/views/upload-loading/UploadLoading.tsx
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
-import React, { useEffect } from 'react';
+import { LocaleService } from '@univerjs/core';
import { IImageIoService } from '@univerjs/drawing';
+import { useDependency } from '@univerjs/ui';
+import React, { useEffect } from 'react';
import styles from './index.module.less';
diff --git a/packages/sheets-filter-ui/src/views/components/SheetsFilterByConditionsPanel.tsx b/packages/sheets-filter-ui/src/views/components/SheetsFilterByConditionsPanel.tsx
index f9a883d990..e6f877591c 100644
--- a/packages/sheets-filter-ui/src/views/components/SheetsFilterByConditionsPanel.tsx
+++ b/packages/sheets-filter-ui/src/views/components/SheetsFilterByConditionsPanel.tsx
@@ -17,10 +17,10 @@
import type { ISelectProps } from '@univerjs/design';
import type { FilterOperator, IFilterConditionFormParams } from '../../models/conditions';
import type { ByConditionsModel } from '../../services/sheets-filter-panel.service';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Input, Radio, RadioGroup, Select } from '@univerjs/design';
+import { useDependency, useObservable } from '@univerjs/ui';
-import { useObservable } from '@univerjs/ui';
import React, { useCallback, useMemo } from 'react';
import { FilterConditionItems } from '../../models/conditions';
diff --git a/packages/sheets-filter-ui/src/views/components/SheetsFilterByValuesPanel.tsx b/packages/sheets-filter-ui/src/views/components/SheetsFilterByValuesPanel.tsx
index b421001527..4ba6b0c82b 100644
--- a/packages/sheets-filter-ui/src/views/components/SheetsFilterByValuesPanel.tsx
+++ b/packages/sheets-filter-ui/src/views/components/SheetsFilterByValuesPanel.tsx
@@ -15,9 +15,9 @@
*/
import type { ByValuesModel, IFilterByValueWithTreeItem } from '../../services/sheets-filter-panel.service';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Button, Checkbox, Input, Tree } from '@univerjs/design';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useCallback } from 'react';
import { statisticFilterByValueItems } from '../../models/utils';
import styles from './index.module.less';
diff --git a/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.stories.tsx b/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.stories.tsx
index f26a106e0a..2c7d72e74d 100644
--- a/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.stories.tsx
+++ b/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.stories.tsx
@@ -17,11 +17,11 @@
import type { Meta } from '@storybook/react';
import type { Injector, IWorkbookData } from '@univerjs/core';
import type { IOpenFilterPanelOperationParams } from '../../commands/operations/sheets-filter.operation';
-import { CommandType, ICommandService, ILogService, LocaleService, LocaleType, LogLevel, Plugin, RediContext, Univer, UniverInstanceType } from '@univerjs/core';
+import { CommandType, ICommandService, ILogService, LocaleService, LocaleType, LogLevel, Plugin, Univer, UniverInstanceType } from '@univerjs/core';
import { RefRangeService, SheetInterceptorService, SheetsSelectionsService, WorksheetProtectionPointModel } from '@univerjs/sheets';
import { ClearSheetsFilterCriteriaCommand, ReCalcSheetsFilterCommand, SetSheetsFilterCriteriaCommand, SmartToggleSheetsFilterCommand, UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';
import { SetCellEditVisibleOperation } from '@univerjs/sheets-ui';
-import { IShortcutService, ShortcutService } from '@univerjs/ui';
+import { IShortcutService, RediContext, ShortcutService } from '@univerjs/ui';
import React, { useState } from 'react';
import { WithCustomFilterModelFactory, WithValuesFilterModelFactory } from '../../__testing__/data';
import { ChangeFilterByOperation, CloseFilterPanelOperation, OpenFilterPanelOperation } from '../../commands/operations/sheets-filter.operation';
diff --git a/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.tsx b/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.tsx
index 189e3e84c4..634eaaf627 100644
--- a/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.tsx
+++ b/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.tsx
@@ -16,12 +16,12 @@
import type { ISegmentedProps } from '@univerjs/design';
import type { ByConditionsModel, ByValuesModel } from '../../services/sheets-filter-panel.service';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { Button, Segmented } from '@univerjs/design';
import { SheetsFilterService } from '@univerjs/sheets-filter';
-
import { SheetsUIPart } from '@univerjs/sheets-ui';
-import { ComponentContainer, useComponentsOfPart, useObservable } from '@univerjs/ui';
+
+import { ComponentContainer, useComponentsOfPart, useDependency, useObservable } from '@univerjs/ui';
import React, { useCallback, useMemo } from 'react';
import { of } from 'rxjs';
import { ChangeFilterByOperation, CloseFilterPanelOperation } from '../../commands/operations/sheets-filter.operation';
diff --git a/packages/sheets-formula-ui/src/controllers/formula-ui.controller.ts b/packages/sheets-formula-ui/src/controllers/formula-ui.controller.ts
index 7763345d1e..2c20b988a2 100644
--- a/packages/sheets-formula-ui/src/controllers/formula-ui.controller.ts
+++ b/packages/sheets-formula-ui/src/controllers/formula-ui.controller.ts
@@ -15,11 +15,11 @@
*/
import type { Dependency } from '@univerjs/core';
-import { connectInjector, Disposable, ICommandService, Inject, Injector, UniverInstanceType } from '@univerjs/core';
+import { Disposable, ICommandService, Inject, Injector, UniverInstanceType } from '@univerjs/core';
import { IRenderManagerService } from '@univerjs/engine-render';
import { SheetsUIPart } from '@univerjs/sheets-ui';
-import { BuiltInUIPart, ComponentManager, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
+import { BuiltInUIPart, ComponentManager, connectInjector, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
import { SheetOnlyPasteFormulaCommand } from '../commands/commands/formula-clipboard.command';
import { SelectEditorFormulaOperation } from '../commands/operations/editor-formula.operation';
import { HelpFunctionOperation } from '../commands/operations/help-function.operation';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/help-function/HelpFunction.tsx b/packages/sheets-formula-ui/src/views/formula-editor/help-function/HelpFunction.tsx
index 9d11f89f4b..520e738c2a 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/help-function/HelpFunction.tsx
+++ b/packages/sheets-formula-ui/src/views/formula-editor/help-function/HelpFunction.tsx
@@ -16,10 +16,10 @@
import type { Editor } from '@univerjs/docs-ui';
import type { IFunctionParam } from '@univerjs/engine-formula';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { CloseSingle, MoreSingle } from '@univerjs/icons';
+import { RectPopup, useDependency } from '@univerjs/ui';
-import { RectPopup } from '@univerjs/ui';
import React, { useMemo, useState } from 'react';
import { generateParam } from '../../../services/utils';
import { useEditorPosition } from '../hooks/use-editor-position';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-editor-position.ts b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-editor-position.ts
index 7337768df6..a981269a4b 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-editor-position.ts
+++ b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-editor-position.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import { IUniverInstanceService, useDependency } from '@univerjs/core';
+import { IUniverInstanceService } from '@univerjs/core';
import { IEditorService } from '@univerjs/docs-ui';
-import { ISidebarService, useEvent } from '@univerjs/ui';
+import { ISidebarService, useDependency, useEvent } from '@univerjs/ui';
import { useEffect, useMemo } from 'react';
import { BehaviorSubject, throttleTime } from 'rxjs';
import useResizeScrollObserver from './use-resize-scroll-observer';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-describe.ts b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-describe.ts
index e0010e3436..7a166cd320 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-describe.ts
+++ b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-describe.ts
@@ -16,9 +16,9 @@
import type { Editor } from '@univerjs/docs-ui';
import type { IFunctionInfo } from '@univerjs/engine-formula';
-import { useDependency } from '@univerjs/core';
import { LexerTreeBuilder } from '@univerjs/engine-formula';
import { IDescriptionService } from '@univerjs/sheets-formula';
+import { useDependency } from '@univerjs/ui';
import { useEffect, useRef, useState } from 'react';
import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs';
import { useStateRef } from './use-state-ref';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-search.ts b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-search.ts
index d48b9259db..b4f4dd037d 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-search.ts
+++ b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-search.ts
@@ -17,9 +17,9 @@
import type { Editor } from '@univerjs/docs-ui';
import type { ISearchItem } from '@univerjs/sheets-formula';
import type { INode } from '../../range-selector/hooks/use-formula-token';
-import { useDependency } from '@univerjs/core';
import { matchToken, sequenceNodeType } from '@univerjs/engine-formula';
import { IDescriptionService } from '@univerjs/sheets-formula';
+import { useDependency } from '@univerjs/ui';
import { useEffect, useRef, useState } from 'react';
import { debounceTime } from 'rxjs';
import { findIndexFromSequenceNodes } from '../../range-selector/utils/find-index-from-sequence-nodes';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-selection.ts b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-selection.ts
index 9a25d301bd..83704eb3df 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-selection.ts
+++ b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-formula-selection.ts
@@ -15,12 +15,12 @@
*/
import type { IAccessor } from '@univerjs/core';
-import { Injector, IUniverInstanceService, useDependency } from '@univerjs/core';
+import { Injector, IUniverInstanceService } from '@univerjs/core';
import { DocSelectionManagerService } from '@univerjs/docs';
import { DocSelectionRenderService } from '@univerjs/docs-ui';
import { isFormulaLexerToken, LexerTreeBuilder, matchRefDrawToken, matchToken, sequenceNodeType } from '@univerjs/engine-formula';
import { IRenderManagerService } from '@univerjs/engine-render';
-import { useEvent } from '@univerjs/ui';
+import { useDependency, useEvent } from '@univerjs/ui';
import { useEffect, useRef, useState } from 'react';
import { filter, map } from 'rxjs';
import { RefSelectionsRenderService } from '../../../services/render-services/ref-selections.render-service';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-sheet-selection-change.ts b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-sheet-selection-change.ts
index bfda24746f..034dc61c5a 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-sheet-selection-change.ts
+++ b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-sheet-selection-change.ts
@@ -21,13 +21,13 @@ import type { Editor } from '@univerjs/docs-ui';
import type { ISelectionWithCoord, ISetSelectionsOperationParams } from '@univerjs/sheets';
import type { IRefSelection } from '../../range-selector/hooks/use-highlight';
import type { INode } from '../../range-selector/utils/filter-reference-node';
-import { DisposableCollection, ICommandService, IUniverInstanceService, ThemeService, useDependency, useObservable } from '@univerjs/core';
+import { DisposableCollection, ICommandService, IUniverInstanceService, ThemeService } from '@univerjs/core';
import { DocSelectionManagerService } from '@univerjs/docs';
import { deserializeRangeWithSheet, sequenceNodeType, serializeRange, serializeRangeWithSheet } from '@univerjs/engine-formula';
import { IRenderManagerService } from '@univerjs/engine-render';
import { IRefSelectionsService, SetSelectionsOperation } from '@univerjs/sheets';
import { SheetSkeletonManagerService } from '@univerjs/sheets-ui';
-import { useEvent } from '@univerjs/ui';
+import { useDependency, useEvent, useObservable } from '@univerjs/ui';
import { useEffect, useMemo, useRef } from 'react';
import { merge } from 'rxjs';
import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-verify.ts b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-verify.ts
index 9d7dc8d14e..991f200eb2 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-verify.ts
+++ b/packages/sheets-formula-ui/src/views/formula-editor/hooks/use-verify.ts
@@ -15,8 +15,8 @@
*/
import type { IFormulaEditorProps } from '../index';
-import { useDependency } from '@univerjs/core';
import { LexerTreeBuilder, operatorToken } from '@univerjs/engine-formula';
+import { useDependency } from '@univerjs/ui';
import { useEffect, useRef } from 'react';
export const useVerify = (isNeed: boolean, onVerify: IFormulaEditorProps['onVerify'], formulaText: string) => {
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/index.tsx b/packages/sheets-formula-ui/src/views/formula-editor/index.tsx
index 535ef87afb..05fc9afb1b 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/index.tsx
+++ b/packages/sheets-formula-ui/src/views/formula-editor/index.tsx
@@ -21,11 +21,11 @@ import type { ReactNode } from 'react';
import type { IRefSelection } from '../range-selector/hooks/use-highlight';
import type { IKeyboardEventConfig } from '../range-selector/hooks/use-keyboard-event';
import type { FormulaSelectingType } from './hooks/use-formula-selection';
-import { BuildTextUtils, createInternalEditorID, generateRandomId, IUniverInstanceService, UniverInstanceType, useDependency, useObservable } from '@univerjs/core';
+import { BuildTextUtils, createInternalEditorID, generateRandomId, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { DocBackScrollRenderController, DocSelectionRenderService, IEditorService } from '@univerjs/docs-ui';
import { IRenderManagerService } from '@univerjs/engine-render';
import { EMBEDDING_FORMULA_EDITOR } from '@univerjs/sheets-ui';
-import { useEvent, useUpdateEffect } from '@univerjs/ui';
+import { useDependency, useEvent, useObservable, useUpdateEffect } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { useFocus } from '../range-selector/hooks/use-focus';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/search-function/SearchFunction.tsx b/packages/sheets-formula-ui/src/views/formula-editor/search-function/SearchFunction.tsx
index 8c730f5027..047c5a1bfc 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/search-function/SearchFunction.tsx
+++ b/packages/sheets-formula-ui/src/views/formula-editor/search-function/SearchFunction.tsx
@@ -16,9 +16,9 @@
import type { Editor } from '@univerjs/docs-ui';
import type { ISequenceNode } from '@univerjs/engine-formula';
-import { CommandType, DisposableCollection, ICommandService, useDependency } from '@univerjs/core';
+import { CommandType, DisposableCollection, ICommandService } from '@univerjs/core';
import { DeviceInputEventType } from '@univerjs/engine-render';
-import { IShortcutService, KeyCode, RectPopup } from '@univerjs/ui';
+import { IShortcutService, KeyCode, RectPopup, useDependency } from '@univerjs/ui';
import React, { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
import { useEditorPosition } from '../hooks/use-editor-position';
import { useFormulaSearch } from '../hooks/use-formula-search';
diff --git a/packages/sheets-formula-ui/src/views/formula-progress/FormulaProgress.tsx b/packages/sheets-formula-ui/src/views/formula-progress/FormulaProgress.tsx
index 9aa0681270..1fa79229ef 100644
--- a/packages/sheets-formula-ui/src/views/formula-progress/FormulaProgress.tsx
+++ b/packages/sheets-formula-ui/src/views/formula-progress/FormulaProgress.tsx
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-import { ICommandService, useDependency, useObservable } from '@univerjs/core';
+import { ICommandService } from '@univerjs/core';
import { SetFormulaCalculationStopMutation } from '@univerjs/engine-formula';
import { TriggerCalculationController } from '@univerjs/sheets-formula';
-import { ProgressBar } from '@univerjs/ui';
+import { ProgressBar, useDependency, useObservable } from '@univerjs/ui';
import React, { useCallback } from 'react';
export function FormulaProgressBar() {
diff --git a/packages/sheets-formula-ui/src/views/more-functions/MoreFunctions.tsx b/packages/sheets-formula-ui/src/views/more-functions/MoreFunctions.tsx
index 27c1f5e2ec..5d1f4a4426 100644
--- a/packages/sheets-formula-ui/src/views/more-functions/MoreFunctions.tsx
+++ b/packages/sheets-formula-ui/src/views/more-functions/MoreFunctions.tsx
@@ -15,12 +15,13 @@
*/
import type { IFunctionInfo } from '@univerjs/engine-formula';
-import { DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, IUniverInstanceService, LocaleService, useDependency } from '@univerjs/core';
+import { DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, IUniverInstanceService, LocaleService } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { IEditorService } from '@univerjs/docs-ui';
import { DeviceInputEventType } from '@univerjs/engine-render';
import { getSheetCommandTarget } from '@univerjs/sheets';
import { IEditorBridgeService, SetCellEditVisibleOperation, useActiveWorkbook } from '@univerjs/sheets-ui';
+import { useDependency } from '@univerjs/ui';
import React, { useState } from 'react';
import styles from './index.module.less';
import { InputParams } from './input-params/InputParams';
diff --git a/packages/sheets-formula-ui/src/views/more-functions/select-function/SelectFunction.tsx b/packages/sheets-formula-ui/src/views/more-functions/select-function/SelectFunction.tsx
index c426edf31d..1accb73957 100644
--- a/packages/sheets-formula-ui/src/views/more-functions/select-function/SelectFunction.tsx
+++ b/packages/sheets-formula-ui/src/views/more-functions/select-function/SelectFunction.tsx
@@ -17,12 +17,12 @@
import type { IFunctionInfo, IFunctionParam } from '@univerjs/engine-formula';
import type { ISearchItem } from '@univerjs/sheets-formula';
import type { ISidebarMethodOptions } from '@univerjs/ui';
-import { LocaleService, useDependency, useObservable } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Input, Select } from '@univerjs/design';
import { FunctionType } from '@univerjs/engine-formula';
import { CheckMarkSingle } from '@univerjs/icons';
import { IDescriptionService } from '@univerjs/sheets-formula';
-import { ISidebarService } from '@univerjs/ui';
+import { ISidebarService, useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { getFunctionTypeValues } from '../../../services/utils';
import { FunctionHelp } from '../function-help/FunctionHelp';
diff --git a/packages/sheets-formula-ui/src/views/prompt/help-function/HelpFunction.tsx b/packages/sheets-formula-ui/src/views/prompt/help-function/HelpFunction.tsx
index 9d835faa65..26e46fbb08 100644
--- a/packages/sheets-formula-ui/src/views/prompt/help-function/HelpFunction.tsx
+++ b/packages/sheets-formula-ui/src/views/prompt/help-function/HelpFunction.tsx
@@ -16,12 +16,12 @@
import type { IFunctionInfo, IFunctionParam } from '@univerjs/engine-formula';
import type { IHelpFunctionOperationParams } from '../../../services/prompt.service';
-import { IUniverInstanceService, LocaleService, useDependency, useInjector } from '@univerjs/core';
+import { IUniverInstanceService, LocaleService } from '@univerjs/core';
import { Popup } from '@univerjs/design';
import { IEditorService } from '@univerjs/docs-ui';
import { CloseSingle, DetailsSingle, MoreSingle } from '@univerjs/icons';
+import { ILayoutService, ISidebarService, useDependency, useInjector } from '@univerjs/ui';
-import { ILayoutService, ISidebarService } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { throttleTime } from 'rxjs';
import { IFormulaPromptService } from '../../../services/prompt.service';
diff --git a/packages/sheets-formula-ui/src/views/prompt/search-function/SearchFunction.tsx b/packages/sheets-formula-ui/src/views/prompt/search-function/SearchFunction.tsx
index 986c0bd2ca..ff1070df49 100644
--- a/packages/sheets-formula-ui/src/views/prompt/search-function/SearchFunction.tsx
+++ b/packages/sheets-formula-ui/src/views/prompt/search-function/SearchFunction.tsx
@@ -17,9 +17,10 @@
import type { ISearchItem } from '@univerjs/sheets-formula';
import type { INavigateParam, ISearchFunctionOperationParams } from '../../../services/prompt.service';
-import { Direction, IUniverInstanceService, useDependency } from '@univerjs/core';
+import { Direction, IUniverInstanceService } from '@univerjs/core';
import { Popup } from '@univerjs/design';
import { IEditorService } from '@univerjs/docs-ui';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useRef, useState } from 'react';
import { IFormulaPromptService } from '../../../services/prompt.service';
import styles from './index.module.less';
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-editor-input.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-editor-input.ts
index 2d0aaf12d3..65ae4fe860 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-editor-input.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-editor-input.ts
@@ -15,9 +15,9 @@
*/
import type { Editor } from '@univerjs/docs-ui';
-import { useDependency } from '@univerjs/core';
import { matchToken } from '@univerjs/engine-formula';
import { IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import { useEffect } from 'react';
import { RefSelectionsRenderService } from '../../../services/render-services/ref-selections.render-service';
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-focus.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-focus.ts
index dc85fdc538..aac8d7cc77 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-focus.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-focus.ts
@@ -15,9 +15,9 @@
*/
import type { Editor } from '@univerjs/docs-ui';
-import { Tools, useDependency } from '@univerjs/core';
+import { Tools } from '@univerjs/core';
import { IEditorService } from '@univerjs/docs-ui';
-import { useEvent } from '@univerjs/ui';
+import { useDependency, useEvent } from '@univerjs/ui';
export const useFocus = (editor?: Editor) => {
const editorService = useDependency(IEditorService);
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-formula-token.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-formula-token.ts
index 26c9c640d5..d8fe616d21 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-formula-token.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-formula-token.ts
@@ -15,8 +15,8 @@
*/
import type { ISequenceNode } from '@univerjs/engine-formula';
-import { useDependency } from '@univerjs/core';
import { LexerTreeBuilder } from '@univerjs/engine-formula';
+import { useDependency } from '@univerjs/ui';
import { useCallback } from 'react';
export type INode = (string | ISequenceNode);
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-highlight.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-highlight.ts
index 75d7b2008e..e178e92a28 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-highlight.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-highlight.ts
@@ -19,13 +19,14 @@ import type { Editor } from '@univerjs/docs-ui';
import type { ISequenceNode } from '@univerjs/engine-formula';
import type { ISelectionWithStyle, SheetsSelectionsService } from '@univerjs/sheets';
import type { INode } from './use-formula-token';
-import { getBodySlice, ICommandService, IUniverInstanceService, ThemeService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { getBodySlice, ICommandService, IUniverInstanceService, ThemeService, UniverInstanceType } from '@univerjs/core';
import { ReplaceTextRunsCommand } from '@univerjs/docs-ui';
import { deserializeRangeWithSheet, sequenceNodeType } from '@univerjs/engine-formula';
import { IRenderManagerService } from '@univerjs/engine-render';
import { IRefSelectionsService, setEndForRange } from '@univerjs/sheets';
import { IDescriptionService } from '@univerjs/sheets-formula';
import { SheetSkeletonManagerService } from '@univerjs/sheets-ui';
+import { useDependency } from '@univerjs/ui';
import { useCallback, useEffect, useMemo } from 'react';
import { genFormulaRefSelectionStyle } from '../../../common/selection';
import { RefSelectionsRenderService } from '../../../services/render-services/ref-selections.render-service';
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-left-and-right-arrow.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-left-and-right-arrow.ts
index c606030a00..fb577f901c 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-left-and-right-arrow.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-left-and-right-arrow.ts
@@ -15,11 +15,11 @@
*/
import type { Editor } from '@univerjs/docs-ui';
-import { CommandType, Direction, DisposableCollection, ICommandService, useDependency } from '@univerjs/core';
+import { CommandType, Direction, DisposableCollection, ICommandService } from '@univerjs/core';
import { MoveCursorOperation, MoveSelectionOperation } from '@univerjs/docs-ui';
import { DeviceInputEventType } from '@univerjs/engine-render';
import { ExpandSelectionCommand, JumpOver, MoveSelectionCommand } from '@univerjs/sheets-ui';
-import { IShortcutService, KeyCode, MetaKeys } from '@univerjs/ui';
+import { IShortcutService, KeyCode, MetaKeys, useDependency } from '@univerjs/ui';
import { useEffect, useRef } from 'react';
import { FormulaSelectingType } from '../../formula-editor/hooks/use-formula-selection';
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-only-one-range.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-only-one-range.ts
index b89c731500..f056be5dd2 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-only-one-range.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-only-one-range.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import { useDependency } from '@univerjs/core';
import { IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import { useEffect } from 'react';
import { RefSelectionsRenderService } from '../../../services/render-services/ref-selections.render-service';
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-refactor-effect.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-refactor-effect.ts
index a1af2c65b2..47f367c578 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-refactor-effect.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-refactor-effect.ts
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-import { EDITOR_ACTIVATED, IContextService, useDependency } from '@univerjs/core';
+import { EDITOR_ACTIVATED, IContextService } from '@univerjs/core';
import { IRenderManagerService } from '@univerjs/engine-render';
import { IRefSelectionsService, REF_SELECTIONS_ENABLED } from '@univerjs/sheets';
-import { IContextMenuService } from '@univerjs/ui';
+import { IContextMenuService, useDependency } from '@univerjs/ui';
import { useEffect, useLayoutEffect } from 'react';
import { RefSelectionsRenderService } from '../../../services/render-services/ref-selections.render-service';
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-reset-selection.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-reset-selection.ts
index 5b3f22d1ce..e5b0dfccb6 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-reset-selection.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-reset-selection.ts
@@ -15,8 +15,9 @@
*/
import type { Workbook } from '@univerjs/core';
-import { IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { SheetsSelectionsService } from '@univerjs/sheets';
+import { useDependency } from '@univerjs/ui';
import { useCallback } from 'react';
export const useResetSelection = (isNeed: boolean, unitId: string, subUnitId: string) => {
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-sheet-selection-change.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-sheet-selection-change.ts
index ea9da72325..39733c1702 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-sheet-selection-change.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-sheet-selection-change.ts
@@ -20,9 +20,10 @@ import type { Workbook } from '@univerjs/core';
import type { ISelectionWithCoord } from '@univerjs/sheets';
import type { INode } from '../utils/filter-reference-node';
-import { DisposableCollection, IUniverInstanceService, useDependency } from '@univerjs/core';
+import { DisposableCollection, IUniverInstanceService } from '@univerjs/core';
import { deserializeRangeWithSheet, matchToken, sequenceNodeType, serializeRange, serializeRangeWithSheet } from '@univerjs/engine-formula';
import { IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import { useEffect, useMemo, useRef } from 'react';
import { distinctUntilChanged, map, merge } from 'rxjs';
import { throttleTime } from 'rxjs/operators';
diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-switch-sheet.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-switch-sheet.ts
index 9b35b0f197..23a4d6fb07 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/hooks/use-switch-sheet.ts
+++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/use-switch-sheet.ts
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-import { DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, useDependency } from '@univerjs/core';
+import { DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService } from '@univerjs/core';
import { IEditorService } from '@univerjs/docs-ui';
import { IRenderManagerService } from '@univerjs/engine-render';
import { SetWorksheetActiveOperation } from '@univerjs/sheets';
+import { useDependency } from '@univerjs/ui';
import { useEffect } from 'react';
import { RefSelectionsRenderService } from '../../../services/render-services/ref-selections.render-service';
diff --git a/packages/sheets-formula-ui/src/views/range-selector/index.tsx b/packages/sheets-formula-ui/src/views/range-selector/index.tsx
index da5e1dd294..01de10cd71 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/index.tsx
+++ b/packages/sheets-formula-ui/src/views/range-selector/index.tsx
@@ -19,17 +19,17 @@ import type { IRichTextEditingMutationParams } from '@univerjs/docs';
import type { Editor } from '@univerjs/docs-ui';
import type { ReactNode } from 'react';
import type { IRefSelection } from './hooks/use-highlight';
-import { BuildTextUtils, createInternalEditorID, generateRandomId, ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency, useObservable } from '@univerjs/core';
+import { BuildTextUtils, createInternalEditorID, generateRandomId, ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { Button, Dialog, Input, Tooltip } from '@univerjs/design';
import { RichTextEditingMutation } from '@univerjs/docs';
import { DocBackScrollRenderController, IEditorService } from '@univerjs/docs-ui';
import { deserializeRangeWithSheet, LexerTreeBuilder, matchToken, sequenceNodeType } from '@univerjs/engine-formula';
import { IRenderManagerService } from '@univerjs/engine-render';
import { CloseSingle, DeleteSingle, IncreaseSingle, SelectRangeSingle } from '@univerjs/icons';
-
import { IDescriptionService } from '@univerjs/sheets-formula';
import { RANGE_SELECTOR_SYMBOLS, SetCellEditVisibleOperation } from '@univerjs/sheets-ui';
-import { useEvent } from '@univerjs/ui';
+
+import { useDependency, useEvent, useObservable } from '@univerjs/ui';
import cl from 'clsx';
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
diff --git a/packages/sheets-hyper-link-ui/src/views/CellLinkEdit/index.tsx b/packages/sheets-hyper-link-ui/src/views/CellLinkEdit/index.tsx
index 32e9376fc0..7a515cbb2c 100644
--- a/packages/sheets-hyper-link-ui/src/views/CellLinkEdit/index.tsx
+++ b/packages/sheets-hyper-link-ui/src/views/CellLinkEdit/index.tsx
@@ -16,7 +16,7 @@
import type { DocumentDataModel, Nullable, Workbook } from '@univerjs/core';
import type { ISetSelectionsOperationParams } from '@univerjs/sheets';
-import { BuildTextUtils, ColorKit, CustomRangeType, DataStreamTreeTokenType, DisposableCollection, DOCS_ZEN_EDITOR_UNIT_ID_KEY, FOCUSING_SHEET, generateRandomId, ICommandService, IContextService, isValidRange, IUniverInstanceService, LocaleService, ThemeService, Tools, UniverInstanceType, useDependency } from '@univerjs/core';
+import { BuildTextUtils, ColorKit, CustomRangeType, DataStreamTreeTokenType, DisposableCollection, DOCS_ZEN_EDITOR_UNIT_ID_KEY, FOCUSING_SHEET, generateRandomId, ICommandService, IContextService, isValidRange, IUniverInstanceService, LocaleService, ThemeService, Tools, UniverInstanceType } from '@univerjs/core';
import { Button, FormLayout, Input, Select } from '@univerjs/design';
import { DocSelectionManagerService } from '@univerjs/docs';
import { DocBackScrollRenderController, DocSelectionRenderService } from '@univerjs/docs-ui';
@@ -26,7 +26,7 @@ import { SetSelectionsOperation, SetWorksheetActiveOperation } from '@univerjs/s
import { RangeSelector } from '@univerjs/sheets-formula-ui';
import { AddHyperLinkCommand, AddRichHyperLinkCommand, SheetHyperLinkType, SheetsHyperLinkParserService, UpdateHyperLinkCommand, UpdateRichHyperLinkCommand } from '@univerjs/sheets-hyper-link';
import { IEditorBridgeService, IMarkSelectionService, ScrollToRangeOperation } from '@univerjs/sheets-ui';
-import { IZenZoneService, KeyCode, useEvent, useObservable } from '@univerjs/ui';
+import { IZenZoneService, KeyCode, useDependency, useEvent, useObservable } from '@univerjs/ui';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { CloseHyperLinkPopupOperation } from '../../commands/operations/popup.operations';
import { isLegalLink, serializeUrl } from '../../common/util';
diff --git a/packages/sheets-hyper-link-ui/src/views/CellLinkPopup/index.tsx b/packages/sheets-hyper-link-ui/src/views/CellLinkPopup/index.tsx
index d70e2e88fa..a1bd94b40a 100644
--- a/packages/sheets-hyper-link-ui/src/views/CellLinkPopup/index.tsx
+++ b/packages/sheets-hyper-link-ui/src/views/CellLinkPopup/index.tsx
@@ -16,12 +16,12 @@
import type { ICustomRange, Nullable, Workbook } from '@univerjs/core';
import type { IHyperLinkPopup } from '../../services/popup.service';
-import { DOCS_ZEN_EDITOR_UNIT_ID_KEY, ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { DOCS_ZEN_EDITOR_UNIT_ID_KEY, ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { MessageType, Tooltip } from '@univerjs/design';
import { AllBorderSingle, CopySingle, LinkSingle, UnlinkSingle, WriteSingle, Xlsx } from '@univerjs/icons';
import { CancelHyperLinkCommand, CancelRichHyperLinkCommand, SheetHyperLinkType, SheetsHyperLinkParserService } from '@univerjs/sheets-hyper-link';
import { IEditorBridgeService } from '@univerjs/sheets-ui';
-import { IMessageService, IZenZoneService } from '@univerjs/ui';
+import { IMessageService, IZenZoneService, useDependency } from '@univerjs/ui';
import cs from 'clsx';
import React, { useEffect, useState } from 'react';
import { OpenHyperLinkEditPanelOperation } from '../../commands/operations/popup.operations';
diff --git a/packages/sheets-numfmt-ui/src/views/components/accounting/index.tsx b/packages/sheets-numfmt-ui/src/views/components/accounting/index.tsx
index a1937da9c6..fdd2166c08 100644
--- a/packages/sheets-numfmt-ui/src/views/components/accounting/index.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/accounting/index.tsx
@@ -16,9 +16,10 @@
import type { FC } from 'react';
import type { IBusinessComponentProps } from '../interface';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { InputNumber, Select } from '@univerjs/design';
import { getCurrencyType, getDecimalFromPattern, setPatternDecimal } from '@univerjs/sheets-numfmt';
+import { useDependency } from '@univerjs/ui';
import React, { useContext, useMemo, useState } from 'react';
import { UserHabitCurrencyContext } from '../../../controllers/user-habit.controller';
diff --git a/packages/sheets-numfmt-ui/src/views/components/currency/index.tsx b/packages/sheets-numfmt-ui/src/views/components/currency/index.tsx
index 5dfde3bd84..67b2e95e16 100644
--- a/packages/sheets-numfmt-ui/src/views/components/currency/index.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/currency/index.tsx
@@ -16,9 +16,10 @@
import type { FC } from 'react';
import type { IBusinessComponentProps } from '../interface';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { InputNumber, Select, SelectList } from '@univerjs/design';
import { getCurrencyFormatOptions, getCurrencyType, getDecimalFromPattern, isPatternEqualWithoutDecimal, setPatternDecimal } from '@univerjs/sheets-numfmt';
+import { useDependency } from '@univerjs/ui';
import React, { useContext, useMemo, useState } from 'react';
import { UserHabitCurrencyContext } from '../../../controllers/user-habit.controller';
diff --git a/packages/sheets-numfmt-ui/src/views/components/custom-format/index.tsx b/packages/sheets-numfmt-ui/src/views/components/custom-format/index.tsx
index 3bac0e896a..d049cced7d 100644
--- a/packages/sheets-numfmt-ui/src/views/components/custom-format/index.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/custom-format/index.tsx
@@ -15,10 +15,11 @@
*/
import type { IBusinessComponentProps } from '../interface';
-import { ILocalStorageService, LocaleService, useDependency } from '@univerjs/core';
+import { ILocalStorageService, LocaleService } from '@univerjs/core';
import { Input } from '@univerjs/design';
import { CheckMarkSingle } from '@univerjs/icons';
import { CURRENCYFORMAT, DATEFMTLISG, NUMBERFORMAT } from '@univerjs/sheets-numfmt';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { UserHabitController } from '../../../controllers/user-habit.controller';
import styles from './index.module.less';
diff --git a/packages/sheets-numfmt-ui/src/views/components/date/index.tsx b/packages/sheets-numfmt-ui/src/views/components/date/index.tsx
index c300ca3248..ab7345c7ad 100644
--- a/packages/sheets-numfmt-ui/src/views/components/date/index.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/date/index.tsx
@@ -16,9 +16,10 @@
import type { FC } from 'react';
import type { IBusinessComponentProps } from '../interface';
-import { LocaleService, numfmt, useDependency } from '@univerjs/core';
+import { LocaleService, numfmt } from '@univerjs/core';
import { SelectList } from '@univerjs/design';
import { getDateFormatOptions } from '@univerjs/sheets-numfmt';
+import { useDependency } from '@univerjs/ui';
import React, { useMemo, useState } from 'react';
export const isDatePanel = (pattern: string) => {
diff --git a/packages/sheets-numfmt-ui/src/views/components/general/index.tsx b/packages/sheets-numfmt-ui/src/views/components/general/index.tsx
index 695ec73c32..a91c6097eb 100644
--- a/packages/sheets-numfmt-ui/src/views/components/general/index.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/general/index.tsx
@@ -16,8 +16,8 @@
import type { FC } from 'react';
import type { IBusinessComponentProps } from '../interface';
-import { LocaleService, useDependency } from '@univerjs/core';
-import React from 'react';
+import { LocaleService } from '@univerjs/core';
+import { useDependency } from '@univerjs/ui';
export const isGeneralPanel = (pattern: string) => !pattern;
diff --git a/packages/sheets-numfmt-ui/src/views/components/index.tsx b/packages/sheets-numfmt-ui/src/views/components/index.tsx
index 0c31b25015..f977d4fd83 100644
--- a/packages/sheets-numfmt-ui/src/views/components/index.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/index.tsx
@@ -17,9 +17,10 @@
import type { ISelectProps } from '@univerjs/design';
import type { FC } from 'react';
import type { IBusinessComponentProps } from './interface';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Button, Select } from '@univerjs/design';
import { getCurrencyType } from '@univerjs/sheets-numfmt';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { UserHabitCurrencyContext } from '../../controllers/user-habit.controller';
import { useCurrencyOptions } from '../hooks/use-currency-options';
diff --git a/packages/sheets-numfmt-ui/src/views/components/more-numfmt-type/MoreNumfmtType.tsx b/packages/sheets-numfmt-ui/src/views/components/more-numfmt-type/MoreNumfmtType.tsx
index e3873570a6..44ab721d60 100644
--- a/packages/sheets-numfmt-ui/src/views/components/more-numfmt-type/MoreNumfmtType.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/more-numfmt-type/MoreNumfmtType.tsx
@@ -16,11 +16,10 @@
import type { FormatType } from '@univerjs/sheets';
-import { ICommandService, LocaleService, Range, useDependency } from '@univerjs/core';
+import { ICommandService, LocaleService, Range } from '@univerjs/core';
import { SheetsSelectionsService } from '@univerjs/sheets';
import { getPatternPreview, getPatternType, SetNumfmtCommand, SheetsNumfmtCellContentController } from '@univerjs/sheets-numfmt';
-import { ILayoutService } from '@univerjs/ui';
-import React from 'react';
+import { ILayoutService, useDependency } from '@univerjs/ui';
import { OpenNumfmtPanelOperator } from '../../../commands/operations/open.numfmt.panel.operation';
import { MENU_OPTIONS } from '../../../controllers/menu';
diff --git a/packages/sheets-numfmt-ui/src/views/components/stories/Panel.stories.tsx b/packages/sheets-numfmt-ui/src/views/components/stories/Panel.stories.tsx
index 74f129446a..621d3ef7c3 100644
--- a/packages/sheets-numfmt-ui/src/views/components/stories/Panel.stories.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/stories/Panel.stories.tsx
@@ -17,7 +17,8 @@
import type { Meta, StoryObj } from '@storybook/react';
import type { Dependency } from '@univerjs/core';
import type { ISheetNumfmtPanelProps } from '../index';
-import { LocaleService, LocaleType, RediContext } from '@univerjs/core';
+import { LocaleService, LocaleType } from '@univerjs/core';
+import { RediContext } from '@univerjs/ui';
import React, { useContext, useState } from 'react';
import { UserHabitController } from '../../../controllers/user-habit.controller';
import enUS from '../../../locale/en-US';
diff --git a/packages/sheets-numfmt-ui/src/views/components/thousandth-percentile/index.tsx b/packages/sheets-numfmt-ui/src/views/components/thousandth-percentile/index.tsx
index 4a5800c6c7..2f8ee54ef8 100644
--- a/packages/sheets-numfmt-ui/src/views/components/thousandth-percentile/index.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/thousandth-percentile/index.tsx
@@ -16,9 +16,10 @@
import type { FC } from 'react';
import type { IBusinessComponentProps } from '../interface';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { InputNumber, SelectList } from '@univerjs/design';
import { getDecimalFromPattern, getNumberFormatOptions, isPatternEqualWithoutDecimal, isPatternHasDecimal, setPatternDecimal } from '@univerjs/sheets-numfmt';
+import { useDependency } from '@univerjs/ui';
import React, { useMemo, useState } from 'react';
export const isThousandthPercentilePanel = (pattern: string) =>
diff --git a/packages/sheets-numfmt-ui/src/views/hooks/use-currency-options.ts b/packages/sheets-numfmt-ui/src/views/hooks/use-currency-options.ts
index a105d801ce..4cb8a6af7e 100644
--- a/packages/sheets-numfmt-ui/src/views/hooks/use-currency-options.ts
+++ b/packages/sheets-numfmt-ui/src/views/hooks/use-currency-options.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import { useDependency } from '@univerjs/core';
import { currencySymbols } from '@univerjs/sheets-numfmt';
+import { useDependency } from '@univerjs/ui';
import { useEffect, useState } from 'react';
import { UserHabitController } from '../../controllers/user-habit.controller';
diff --git a/packages/sheets-sort-ui/src/controllers/sheets-sort-ui.controller.ts b/packages/sheets-sort-ui/src/controllers/sheets-sort-ui.controller.ts
index bf6003c396..37c3afa680 100644
--- a/packages/sheets-sort-ui/src/controllers/sheets-sort-ui.controller.ts
+++ b/packages/sheets-sort-ui/src/controllers/sheets-sort-ui.controller.ts
@@ -17,12 +17,12 @@
import type { UIPartsService } from '@univerjs/ui';
import type { ISheetSortLocation } from '../services/sheets-sort-ui.service';
-import { connectInjector, ICommandService, Inject, Injector, LocaleService, RxDisposable } from '@univerjs/core';
+import { ICommandService, Inject, Injector, LocaleService, RxDisposable } from '@univerjs/core';
import { serializeRange } from '@univerjs/engine-formula';
import { AscendingSingle, CustomSortSingle, DescendingSingle, ExpandAscendingSingle, ExpandDescendingSingle } from '@univerjs/icons';
import { SortRangeCommand } from '@univerjs/sheets-sort';
import { SheetsRenderService, SheetsUIPart } from '@univerjs/sheets-ui';
-import { ComponentManager, IDialogService, ILayoutService, IMenuManagerService, IUIPartsService } from '@univerjs/ui';
+import { ComponentManager, connectInjector, IDialogService, ILayoutService, IMenuManagerService, IUIPartsService } from '@univerjs/ui';
import { takeUntil } from 'rxjs';
import { SortRangeAscCommand, SortRangeAscExtCommand, SortRangeAscExtInCtxMenuCommand, SortRangeAscInCtxMenuCommand, SortRangeCustomCommand, SortRangeCustomInCtxMenuCommand, SortRangeDescCommand, SortRangeDescExtCommand, SortRangeDescExtInCtxMenuCommand, SortRangeDescInCtxMenuCommand } from '../commands/commands/sheets-sort.command';
import { SheetsSortUIService } from '../services/sheets-sort-ui.service';
diff --git a/packages/sheets-sort-ui/src/views/CustomSortPanel.tsx b/packages/sheets-sort-ui/src/views/CustomSortPanel.tsx
index 523f3e4b1e..1b8321f886 100644
--- a/packages/sheets-sort-ui/src/views/CustomSortPanel.tsx
+++ b/packages/sheets-sort-ui/src/views/CustomSortPanel.tsx
@@ -15,10 +15,12 @@
*/
import type { IRange, Nullable } from '@univerjs/core';
-import { LocaleService, LocaleType, throttle, useDependency } from '@univerjs/core';
+import type { IOrderRule } from '@univerjs/sheets-sort';
+import { LocaleService, LocaleType, throttle } from '@univerjs/core';
import { Button, Checkbox, DraggableList, DropdownLegacy, Radio, RadioGroup } from '@univerjs/design';
import { CheckMarkSingle, DeleteEmptySingle, IncreaseSingle, MoreDownSingle, SequenceSingle } from '@univerjs/icons';
-import { type IOrderRule, SheetsSortService, SortType } from '@univerjs/sheets-sort';
+import { SheetsSortService, SortType } from '@univerjs/sheets-sort';
+import { useDependency } from '@univerjs/ui';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { SheetsSortUIService } from '../services/sheets-sort-ui.service';
diff --git a/packages/sheets-sort-ui/src/views/EmbedSortBtn.tsx b/packages/sheets-sort-ui/src/views/EmbedSortBtn.tsx
index 6e0301acba..2e6498bf6f 100644
--- a/packages/sheets-sort-ui/src/views/EmbedSortBtn.tsx
+++ b/packages/sheets-sort-ui/src/views/EmbedSortBtn.tsx
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-import { type IRange, IUniverInstanceService, LocaleService } from '@univerjs/core';
-import { useDependency } from '@univerjs/core';
+import type { IRange } from '@univerjs/core';
+import { IUniverInstanceService, LocaleService } from '@univerjs/core';
import { AscendingSingle, DescendingSingle } from '@univerjs/icons';
import { getSheetCommandTarget } from '@univerjs/sheets';
+import { useDependency } from '@univerjs/ui';
import React, { useCallback } from 'react';
import { SheetsSortUIService } from '../services/sheets-sort-ui.service';
import styles from './index.module.less';
diff --git a/packages/sheets-sort-ui/src/views/ExtendConfirm.tsx b/packages/sheets-sort-ui/src/views/ExtendConfirm.tsx
index a0122ba656..0deb572308 100644
--- a/packages/sheets-sort-ui/src/views/ExtendConfirm.tsx
+++ b/packages/sheets-sort-ui/src/views/ExtendConfirm.tsx
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { Radio, RadioGroup } from '@univerjs/design';
+import { useDependency } from '@univerjs/ui';
import React, { useState } from 'react';
import styles from './index.module.less';
diff --git a/packages/sheets-thread-comment-ui/src/views/sheets-thread-comment-cell/index.tsx b/packages/sheets-thread-comment-ui/src/views/sheets-thread-comment-cell/index.tsx
index 25cb1c8126..07376a15fd 100644
--- a/packages/sheets-thread-comment-ui/src/views/sheets-thread-comment-cell/index.tsx
+++ b/packages/sheets-thread-comment-ui/src/views/sheets-thread-comment-cell/index.tsx
@@ -15,11 +15,10 @@
*/
import type { Workbook } from '@univerjs/core';
-import { IUniverInstanceService, Tools, UniverInstanceType, useDependency } from '@univerjs/core';
+import { IUniverInstanceService, Tools, UniverInstanceType } from '@univerjs/core';
import { SheetsThreadCommentModel } from '@univerjs/sheets-thread-comment';
import { ThreadCommentTree } from '@univerjs/thread-comment-ui';
-import { useObservable } from '@univerjs/ui';
-import React from 'react';
+import { useDependency, useObservable } from '@univerjs/ui';
import { SheetsThreadCommentPopupService } from '../../services/sheets-thread-comment-popup.service';
export const SheetsThreadCommentCell = () => {
diff --git a/packages/sheets-thread-comment-ui/src/views/sheets-thread-comment-panel/index.tsx b/packages/sheets-thread-comment-ui/src/views/sheets-thread-comment-panel/index.tsx
index 293039a226..863e78d57e 100644
--- a/packages/sheets-thread-comment-ui/src/views/sheets-thread-comment-panel/index.tsx
+++ b/packages/sheets-thread-comment-ui/src/views/sheets-thread-comment-panel/index.tsx
@@ -16,11 +16,11 @@
import type { Workbook } from '@univerjs/core';
import type { IThreadComment } from '@univerjs/thread-comment';
-import { ICommandService, IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { singleReferenceToGrid } from '@univerjs/engine-formula';
import { IMarkSelectionService } from '@univerjs/sheets-ui';
import { ThreadCommentPanel, ThreadCommentPanelService } from '@univerjs/thread-comment-ui';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
import { map } from 'rxjs';
import { ShowAddSheetCommentModalOperation } from '../../commands/operations/comment.operation';
diff --git a/packages/sheets-ui/src/components/border-panel/BorderPanel.tsx b/packages/sheets-ui/src/components/border-panel/BorderPanel.tsx
index b47f879817..341686d1f9 100644
--- a/packages/sheets-ui/src/components/border-panel/BorderPanel.tsx
+++ b/packages/sheets-ui/src/components/border-panel/BorderPanel.tsx
@@ -14,16 +14,18 @@
* limitations under the License.
*/
-import { BorderStyleTypes, useDependency } from '@univerjs/core';
+import type { IBorderInfo } from '@univerjs/sheets';
+import type { IBorderPanelProps } from './interface';
+import { BorderStyleTypes } from '@univerjs/core';
import { ColorPicker, DropdownLegacy, Menu, MenuItem } from '@univerjs/design';
import { MoreDownSingle, PaintBucket } from '@univerjs/icons';
-import { BorderStyleManagerService, type IBorderInfo } from '@univerjs/sheets';
-import { ComponentManager } from '@univerjs/ui';
-import React from 'react';
+import { BorderStyleManagerService } from '@univerjs/sheets';
+import { ComponentManager, useDependency } from '@univerjs/ui';
+import React from 'react';
import { BorderLine } from './border-line/BorderLine';
import styles from './index.module.less';
-import { BORDER_LINE_CHILDREN, type IBorderPanelProps } from './interface';
+import { BORDER_LINE_CHILDREN } from './interface';
const BORDER_SIZE_CHILDREN = [
{
diff --git a/packages/sheets-ui/src/components/hook.ts b/packages/sheets-ui/src/components/hook.ts
index 4c36754fac..0e1de0243e 100644
--- a/packages/sheets-ui/src/components/hook.ts
+++ b/packages/sheets-ui/src/components/hook.ts
@@ -15,9 +15,9 @@
*/
import type { Workbook } from '@univerjs/core';
-import { IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { IRenderManagerService } from '@univerjs/engine-render';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import { useMemo } from 'react';
import { map, merge, of, startWith } from 'rxjs';
import { SheetSkeletonManagerService } from '../services/sheet-skeleton-manager.service';
diff --git a/packages/sheets-ui/src/components/menu-item-input/MenuItemInput.tsx b/packages/sheets-ui/src/components/menu-item-input/MenuItemInput.tsx
index 572a71f8c8..08818fad74 100644
--- a/packages/sheets-ui/src/components/menu-item-input/MenuItemInput.tsx
+++ b/packages/sheets-ui/src/components/menu-item-input/MenuItemInput.tsx
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
+import type { IMenuItemInputProps } from './interface';
+import { LocaleService } from '@univerjs/core';
import { InputNumber } from '@univerjs/design';
-import { IContextMenuService } from '@univerjs/ui';
+import { IContextMenuService, useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import styles from './index.module.less';
-import type { IMenuItemInputProps } from './interface';
export const MenuItemInput = (props: IMenuItemInputProps) => {
const { prefix, suffix, value, onChange, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER } = props;
diff --git a/packages/sheets-ui/src/controllers/clipboard/clipboard.controller.ts b/packages/sheets-ui/src/controllers/clipboard/clipboard.controller.ts
index 287fd890ed..5fd2e1a589 100644
--- a/packages/sheets-ui/src/controllers/clipboard/clipboard.controller.ts
+++ b/packages/sheets-ui/src/controllers/clipboard/clipboard.controller.ts
@@ -47,7 +47,6 @@ import type { IUniverSheetsUIConfig } from '../config.schema';
import {
BooleanNumber,
- connectInjector,
convertBodyToHtml,
DEFAULT_WORKSHEET_COLUMN_WIDTH,
DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY,
@@ -63,9 +62,7 @@ import {
isFormulaString,
IUniverInstanceService,
LocaleService,
-
ObjectMatrix,
-
RxDisposable,
Tools,
UniverInstanceType,
@@ -89,7 +86,7 @@ import {
SetWorksheetColWidthMutation,
SetWorksheetRowHeightMutation,
} from '@univerjs/sheets';
-import { BuiltInUIPart, IMessageService, IUIPartsService } from '@univerjs/ui';
+import { BuiltInUIPart, connectInjector, IMessageService, IUIPartsService } from '@univerjs/ui';
import { Subject, takeUntil } from 'rxjs';
import { AddWorksheetMergeCommand } from '../../commands/commands/add-worksheet-merge.command';
import {
diff --git a/packages/sheets-ui/src/controllers/mobile/mobile-sheet-ui.controller.ts b/packages/sheets-ui/src/controllers/mobile/mobile-sheet-ui.controller.ts
index 65465633cc..72973214a1 100644
--- a/packages/sheets-ui/src/controllers/mobile/mobile-sheet-ui.controller.ts
+++ b/packages/sheets-ui/src/controllers/mobile/mobile-sheet-ui.controller.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import { connectInjector, Disposable, ICommandService, Inject, Injector, UniverInstanceType } from '@univerjs/core';
+import { Disposable, ICommandService, Inject, Injector, UniverInstanceType } from '@univerjs/core';
import {
SetBoldCommand,
SetFontFamilyCommand,
@@ -23,7 +23,7 @@ import {
SetStrikeThroughCommand,
SetUnderlineCommand,
} from '@univerjs/sheets';
-import { BuiltInUIPart, ComponentManager, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
+import { BuiltInUIPart, ComponentManager, connectInjector, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
import {
AddWorksheetMergeAllCommand,
diff --git a/packages/sheets-ui/src/controllers/permission/sheet-permission-render.controller.ts b/packages/sheets-ui/src/controllers/permission/sheet-permission-render.controller.ts
index ba3c08b822..0200472f8d 100644
--- a/packages/sheets-ui/src/controllers/permission/sheet-permission-render.controller.ts
+++ b/packages/sheets-ui/src/controllers/permission/sheet-permission-render.controller.ts
@@ -17,11 +17,11 @@
import type { IRenderContext, IRenderModule, Spreadsheet } from '@univerjs/engine-render';
import type { MenuConfig } from '@univerjs/ui';
import type { IUniverSheetsUIConfig } from '../config.schema';
-import { connectInjector, Disposable, IConfigService, Inject, Injector, IPermissionService, IUniverInstanceService } from '@univerjs/core';
+import { Disposable, IConfigService, Inject, Injector, IPermissionService, IUniverInstanceService } from '@univerjs/core';
import { IRenderManagerService } from '@univerjs/engine-render';
import { CheckMarkSingle, DeleteSingle, LockSingle, ProtectSingle, WriteSingle } from '@univerjs/icons';
import { RangeProtectionRuleModel, WorksheetProtectionRuleModel } from '@univerjs/sheets';
-import { ComponentManager, IUIPartsService } from '@univerjs/ui';
+import { ComponentManager, connectInjector, IUIPartsService } from '@univerjs/ui';
import { merge, throttleTime } from 'rxjs';
import { permissionCheckIconKey, permissionDeleteIconKey, permissionEditIconKey, permissionLockIconKey, permissionMenuIconKey, UNIVER_SHEET_PERMISSION_BACKGROUND, UNIVER_SHEET_PERMISSION_DIALOG, UNIVER_SHEET_PERMISSION_PANEL, UNIVER_SHEET_PERMISSION_USER_DIALOG, UNIVER_SHEET_PERMISSION_USER_PART } from '../../consts/permission';
import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
diff --git a/packages/sheets-ui/src/controllers/sheet-ui.controller.ts b/packages/sheets-ui/src/controllers/sheet-ui.controller.ts
index edf443cb10..44d7a1fdb2 100644
--- a/packages/sheets-ui/src/controllers/sheet-ui.controller.ts
+++ b/packages/sheets-ui/src/controllers/sheet-ui.controller.ts
@@ -15,7 +15,7 @@
*/
import type { IUniverSheetsUIConfig } from './config.schema';
-import { connectInjector, Disposable, ICommandService, IConfigService, Inject, Injector, UniverInstanceType } from '@univerjs/core';
+import { Disposable, ICommandService, IConfigService, Inject, Injector, UniverInstanceType } from '@univerjs/core';
import { DocSelectionRenderService } from '@univerjs/docs-ui';
import { IRenderManagerService } from '@univerjs/engine-render';
@@ -28,7 +28,7 @@ import {
SetStrikeThroughCommand,
SetUnderlineCommand,
} from '@univerjs/sheets';
-import { BuiltInUIPart, ComponentManager, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
+import { BuiltInUIPart, ComponentManager, connectInjector, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
import {
AddWorksheetMergeAllCommand,
AddWorksheetMergeCommand,
diff --git a/packages/sheets-ui/src/hooks/use-highlight-range.ts b/packages/sheets-ui/src/hooks/use-highlight-range.ts
index 51f36ebd09..efbc6f80b8 100644
--- a/packages/sheets-ui/src/hooks/use-highlight-range.ts
+++ b/packages/sheets-ui/src/hooks/use-highlight-range.ts
@@ -15,7 +15,7 @@
*/
import type { IRange } from '@univerjs/core';
-import { useDependency } from '@univerjs/core';
+import { useDependency } from '@univerjs/ui';
import { useEffect } from 'react';
import { IMarkSelectionService } from '../services/mark-selection/mark-selection.service';
diff --git a/packages/sheets-ui/src/views/clipboard/ClipboardPopupMenu.tsx b/packages/sheets-ui/src/views/clipboard/ClipboardPopupMenu.tsx
index 34dbf276d4..7afe7b9ca9 100644
--- a/packages/sheets-ui/src/views/clipboard/ClipboardPopupMenu.tsx
+++ b/packages/sheets-ui/src/views/clipboard/ClipboardPopupMenu.tsx
@@ -16,10 +16,11 @@
import type { IDiscreteRange } from '../../controllers/utils/range-tools';
import type { IPasteHookKeyType } from '../../services/clipboard/type';
-import { ICommandService, IUniverInstanceService, LocaleService, useDependency, useObservable } from '@univerjs/core';
+import { ICommandService, IUniverInstanceService, LocaleService } from '@univerjs/core';
import { DropdownOverlay, DropdownProvider, DropdownTrigger } from '@univerjs/design';
import { convertTransformToOffsetX, convertTransformToOffsetY, IRenderManagerService } from '@univerjs/engine-render';
import { CheckMarkSingle, MoreDownSingle, PasteSpecial } from '@univerjs/icons';
+import { useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import { useState } from 'react';
import { SheetOptionalPasteCommand } from '../../commands/commands/clipboard.command';
diff --git a/packages/sheets-ui/src/views/count-bar/ZoomSlider.tsx b/packages/sheets-ui/src/views/count-bar/ZoomSlider.tsx
index 2e32b163ad..ca627e547a 100644
--- a/packages/sheets-ui/src/views/count-bar/ZoomSlider.tsx
+++ b/packages/sheets-ui/src/views/count-bar/ZoomSlider.tsx
@@ -20,11 +20,10 @@ import {
ICommandService,
IUniverInstanceService,
UniverInstanceType,
- useDependency,
- useObservable,
} from '@univerjs/core';
import { Slider } from '@univerjs/design';
import { SetWorksheetActiveOperation } from '@univerjs/sheets';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useCallback, useEffect, useState } from 'react';
import { SetZoomRatioCommand } from '../../commands/commands/set-zoom-ratio.command';
diff --git a/packages/sheets-ui/src/views/defined-name/DefinedName.tsx b/packages/sheets-ui/src/views/defined-name/DefinedName.tsx
index 61f7348dc7..529e4862e3 100644
--- a/packages/sheets-ui/src/views/defined-name/DefinedName.tsx
+++ b/packages/sheets-ui/src/views/defined-name/DefinedName.tsx
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-import { useDependency } from '@univerjs/core';
-
import { DropdownOverlay, DropdownProvider, DropdownTrigger } from '@univerjs/design';
+
import { IDefinedNamesService } from '@univerjs/engine-formula';
import { MoreDownSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { DefinedNameOverlay } from './DefinedNameOverlay';
@@ -48,8 +48,8 @@ export function DefinedName({ disable }: { disable: boolean }) {
<div className={styles.definedName}>
<input
className={clsx(`
- univer-border-none univer-absolute univer-w-full univer-h-full univer-appearance-none
- univer-box-border univer-px-1.5
+ univer-absolute univer-box-border univer-h-full univer-w-full univer-appearance-none
+ univer-border-none univer-px-1.5
focus:univer-outline-none
`, {
[styles.defineNameInputDisable]: disable,
@@ -63,12 +63,13 @@ export function DefinedName({ disable }: { disable: boolean }) {
<DropdownTrigger>
<a
className={clsx(`
- univer-flex univer-items-center univer-justify-center univer-px-1 univer-cursor-pointer
- univer-absolute univer-right-0 univer-h-full univer-transition-colors univer-duration-200
+ univer-absolute univer-right-0 univer-flex univer-h-full univer-cursor-pointer
+ univer-items-center univer-justify-center univer-px-1 univer-transition-colors
+ univer-duration-200
hover:univer-bg-gray-100
`,
{
- 'univer-text-gray-300 univer-cursor-not-allowed hover:univer-bg-transparent': disable,
+ 'univer-cursor-not-allowed univer-text-gray-300 hover:univer-bg-transparent': disable,
})}
>
<MoreDownSingle />
diff --git a/packages/sheets-ui/src/views/defined-name/DefinedNameContainer.tsx b/packages/sheets-ui/src/views/defined-name/DefinedNameContainer.tsx
index 49cc3ad468..2c8e035091 100644
--- a/packages/sheets-ui/src/views/defined-name/DefinedNameContainer.tsx
+++ b/packages/sheets-ui/src/views/defined-name/DefinedNameContainer.tsx
@@ -17,11 +17,12 @@
import type { Nullable, Workbook } from '@univerjs/core';
import type { IDefinedNamesServiceParam, ISetDefinedNameMutationParam } from '@univerjs/engine-formula';
-import { ICommandService, IUniverInstanceService, LocaleService, Tools, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, IUniverInstanceService, LocaleService, Tools, UniverInstanceType } from '@univerjs/core';
import { Confirm, Tooltip } from '@univerjs/design';
import { IDefinedNamesService, serializeRangeWithSheet } from '@univerjs/engine-formula';
import { CheckMarkSingle, DeleteSingle, IncreaseSingle } from '@univerjs/icons';
import { InsertDefinedNameCommand, RemoveDefinedNameCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SetDefinedNameCommand, SetWorksheetShowCommand, SheetsSelectionsService } from '@univerjs/sheets';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { DefinedNameInput } from './DefinedNameInput';
diff --git a/packages/sheets-ui/src/views/defined-name/DefinedNameInput.tsx b/packages/sheets-ui/src/views/defined-name/DefinedNameInput.tsx
index f73b99947b..343ad3ec4c 100644
--- a/packages/sheets-ui/src/views/defined-name/DefinedNameInput.tsx
+++ b/packages/sheets-ui/src/views/defined-name/DefinedNameInput.tsx
@@ -15,16 +15,15 @@
*/
import type { Nullable, Workbook } from '@univerjs/core';
-
-import { AbsoluteRefType, IUniverInstanceService, LocaleService, Tools, UniverInstanceType, useDependency } from '@univerjs/core';
+import type { IDefinedNamesServiceParam } from '@univerjs/engine-formula';
+import { AbsoluteRefType, IUniverInstanceService, LocaleService, Tools, UniverInstanceType } from '@univerjs/core';
import { Button, Input, Radio, RadioGroup, Select } from '@univerjs/design';
-import { IDefinedNamesService, type IDefinedNamesServiceParam, IFunctionService, isReferenceStrings, isReferenceStringWithEffectiveColumn, LexerTreeBuilder, operatorToken } from '@univerjs/engine-formula';
+import { IDefinedNamesService, IFunctionService, isReferenceStrings, isReferenceStringWithEffectiveColumn, LexerTreeBuilder, operatorToken } from '@univerjs/engine-formula';
import { hasCJKText } from '@univerjs/engine-render';
import { ErrorSingle } from '@univerjs/icons';
import { SCOPE_WORKBOOK_VALUE_DEFINED_NAME } from '@univerjs/sheets';
-import { ComponentManager, useSidebarClick } from '@univerjs/ui';
+import { ComponentManager, useDependency, useSidebarClick } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
-
import { EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY, RANGE_SELECTOR_COMPONENT_KEY } from '../../common/keys';
import styles from './index.module.less';
diff --git a/packages/sheets-ui/src/views/defined-name/DefinedNameOverlay.tsx b/packages/sheets-ui/src/views/defined-name/DefinedNameOverlay.tsx
index c5b8498de4..72bacbec90 100644
--- a/packages/sheets-ui/src/views/defined-name/DefinedNameOverlay.tsx
+++ b/packages/sheets-ui/src/views/defined-name/DefinedNameOverlay.tsx
@@ -17,10 +17,10 @@
import type { Workbook } from '@univerjs/core';
import type { IDefinedNamesServiceParam } from '@univerjs/engine-formula';
-import { ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { IDefinedNamesService } from '@univerjs/engine-formula';
import { SetWorksheetShowCommand } from '@univerjs/sheets';
-import { ISidebarService } from '@univerjs/ui';
+import { ISidebarService, useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { SidebarDefinedNameOperation } from '../../commands/operations/sidebar-defined-name.operation';
import { DEFINED_NAME_CONTAINER } from './component-name';
@@ -99,8 +99,9 @@ export function DefinedNameOverlay(props: IDefinedNameOverlayProps) {
<div className="univer-w-[300px]">
<ul
className={`
- univer-max-h-[360px] univer-overflow-y-auto univer-scrollbar-thin univer-scrollbar-thumb-gray-300
- univer-scrollbar-track-transparent univer-scrollbar-w-[4px] univer-m-0 univer-list-none univer-p-0
+ univer-m-0 univer-max-h-[360px] univer-list-none univer-overflow-y-auto univer-p-0
+ univer-scrollbar-thin univer-scrollbar-track-transparent univer-scrollbar-thumb-gray-300
+ univer-scrollbar-w-[4px]
`}
>
{definedNames.map((definedName, index) => {
@@ -108,7 +109,7 @@ export function DefinedNameOverlay(props: IDefinedNameOverlayProps) {
<li
key={index}
className={`
- univer-px-2 univer-cursor-pointer univer-transition-colors univer-duration-200
+ univer-cursor-pointer univer-px-2 univer-transition-colors univer-duration-200
dark:hover:univer-bg-gray-600
hover:univer-bg-gray-100
`}
@@ -116,14 +117,14 @@ export function DefinedNameOverlay(props: IDefinedNameOverlayProps) {
>
<div
className={`
- univer-flex univer-py-1 univer-items-center univer-justify-between univer-border-b
- univer-border-solid univer-border-0 univer-border-gray-200 univer-gap-2
+ univer-flex univer-items-center univer-justify-between univer-gap-2 univer-border-0
+ univer-border-b univer-border-solid univer-border-gray-200 univer-py-1
`}
>
<div
className={`
- univer-text-gray-600 univer-text-sm univer-overflow-hidden univer-text-ellipsis
- univer-flex-shrink-0 univer-w-[50%] univer-whitespace-nowrap
+ univer-w-[50%] univer-flex-shrink-0 univer-overflow-hidden univer-text-ellipsis
+ univer-whitespace-nowrap univer-text-sm univer-text-gray-600
`}
title={definedName.name}
>
@@ -131,8 +132,8 @@ export function DefinedNameOverlay(props: IDefinedNameOverlayProps) {
</div>
<div
className={`
- univer-text-gray-400 univer-text-xs univer-flex-shrink-0 univer-overflow-hidden
- univer-text-ellipsis univer-w-[50%] univer-whitespace-nowrap
+ univer-w-[50%] univer-flex-shrink-0 univer-overflow-hidden univer-text-ellipsis
+ univer-whitespace-nowrap univer-text-xs univer-text-gray-400
`}
title={definedName.formulaOrRefString}
>
@@ -146,13 +147,13 @@ export function DefinedNameOverlay(props: IDefinedNameOverlayProps) {
<div
className={`
- univer-p-2 univer-cursor-pointer univer-transition-colors univer-duration-200
+ univer-cursor-pointer univer-p-2 univer-transition-colors univer-duration-200
dark:hover:univer-bg-gray-600
hover:univer-bg-gray-100
`}
onClick={openSlider}
>
- <div className="univer-text-sm univer-font-semibold univer-text-gray-600 univer-mb-2">
+ <div className="univer-mb-2 univer-text-sm univer-font-semibold univer-text-gray-600">
{localeService.t('definedName.managerTitle')}
</div>
<div className="univer-text-xs univer-text-gray-400">
diff --git a/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx b/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
index 7d5d6721f9..894b2b1e60 100644
--- a/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
+++ b/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
@@ -15,10 +15,10 @@
*/
import type { KeyCode } from '@univerjs/ui';
-import { DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, IContextService, useDependency } from '@univerjs/core';
+import { DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, IContextService } from '@univerjs/core';
import { IEditorService } from '@univerjs/docs-ui';
import { DeviceInputEventType } from '@univerjs/engine-render';
-import { ComponentManager, DISABLE_AUTO_FOCUS_KEY, MetaKeys, useEvent, useObservable, useSidebarClick } from '@univerjs/ui';
+import { ComponentManager, DISABLE_AUTO_FOCUS_KEY, MetaKeys, useDependency, useEvent, useObservable, useSidebarClick } from '@univerjs/ui';
import React, { useEffect, useRef, useState } from 'react';
import { SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation } from '../../commands/operations/cell-edit.operation';
diff --git a/packages/sheets-ui/src/views/editor-container/hooks.ts b/packages/sheets-ui/src/views/editor-container/hooks.ts
index c3a3d390bd..d0c372a8fb 100644
--- a/packages/sheets-ui/src/views/editor-container/hooks.ts
+++ b/packages/sheets-ui/src/views/editor-container/hooks.ts
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-import { ICommandService, useDependency, useObservable } from '@univerjs/core';
+import { ICommandService } from '@univerjs/core';
import { DocSelectionRenderService } from '@univerjs/docs-ui';
import { DeviceInputEventType, IRenderManagerService } from '@univerjs/engine-render';
-import { KeyCode } from '@univerjs/ui';
+import { KeyCode, useDependency, useObservable } from '@univerjs/ui';
import { useMemo } from 'react';
import { SetCellEditVisibleOperation } from '../../commands/operations/cell-edit.operation';
import { IEditorBridgeService } from '../../services/editor-bridge.service';
diff --git a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
index 88ac7cb00b..d6aa15a6ea 100644
--- a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
+++ b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
@@ -16,12 +16,12 @@
import type { Workbook } from '@univerjs/core';
import type { IEditorBridgeServiceVisibleParam } from '../../services/editor-bridge.service';
-import { DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, FOCUSING_FX_BAR_EDITOR, ICommandService, IContextService, IPermissionService, IUniverInstanceService, UniverInstanceType, useDependency, useObservable } from '@univerjs/core';
+import { DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, FOCUSING_FX_BAR_EDITOR, ICommandService, IContextService, IPermissionService, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { IEditorService } from '@univerjs/docs-ui';
import { DeviceInputEventType } from '@univerjs/engine-render';
import { CheckMarkSingle, CloseSingle, DropdownSingle, FxSingle } from '@univerjs/icons';
import { RangeProtectionCache, RangeProtectionRuleModel, SheetsSelectionsService, UnitAction, WorksheetEditPermission, WorksheetProtectionRuleModel, WorksheetViewPermission } from '@univerjs/sheets';
-import { ComponentContainer, ComponentManager, KeyCode, useComponentsOfPart } from '@univerjs/ui';
+import { ComponentContainer, ComponentManager, KeyCode, useComponentsOfPart, useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { EMPTY, merge, of, switchMap } from 'rxjs';
diff --git a/packages/sheets-ui/src/views/mobile/sheet-bar/MobileSheetBar.tsx b/packages/sheets-ui/src/views/mobile/sheet-bar/MobileSheetBar.tsx
index 75e2cf0a56..a090110074 100644
--- a/packages/sheets-ui/src/views/mobile/sheet-bar/MobileSheetBar.tsx
+++ b/packages/sheets-ui/src/views/mobile/sheet-bar/MobileSheetBar.tsx
@@ -17,7 +17,7 @@
import type { ICommandInfo, Workbook } from '@univerjs/core';
import type { ISetWorksheetActiveOperationParams } from '@univerjs/sheets';
import type { IBaseSheetBarProps } from '../../sheet-bar/sheet-bar-tabs/SheetBarItem';
-import { ICommandService, useDependency } from '@univerjs/core';
+import { ICommandService } from '@univerjs/core';
import {
InsertSheetMutation,
RemoveSheetMutation,
@@ -26,10 +26,11 @@ import {
SetWorksheetNameMutation,
SetWorksheetOrderMutation,
} from '@univerjs/sheets';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback, useEffect, useRef, useState } from 'react';
-import { useActiveWorkbook } from '../../../components/hook';
+import { useActiveWorkbook } from '../../../components/hook';
import styles from './index.module.less';
export function MobileSheetBar() {
diff --git a/packages/sheets-ui/src/views/operate-container/AutoFillPopupMenu.tsx b/packages/sheets-ui/src/views/operate-container/AutoFillPopupMenu.tsx
index 5f16922dbf..1693080f88 100644
--- a/packages/sheets-ui/src/views/operate-container/AutoFillPopupMenu.tsx
+++ b/packages/sheets-ui/src/views/operate-container/AutoFillPopupMenu.tsx
@@ -15,13 +15,13 @@
*/
import type { ICommandInfo, IExecutionOptions } from '@univerjs/core';
-import { ICommandService, IUniverInstanceService, LocaleService, toDisposable, useDependency } from '@univerjs/core';
+import { ICommandService, IUniverInstanceService, LocaleService, toDisposable } from '@univerjs/core';
import { DropdownLegacy } from '@univerjs/design';
import { convertTransformToOffsetX, convertTransformToOffsetY, IRenderManagerService } from '@univerjs/engine-render';
import { Autofill, CheckMarkSingle, MoreDownSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
-
import { RefillCommand } from '../../commands/commands/refill.command';
import { SetScrollOperation } from '../../commands/operations/scroll.operation';
import { useActiveWorkbook } from '../../components/hook';
diff --git a/packages/sheets-ui/src/views/permission/error-msg-dialog/index.tsx b/packages/sheets-ui/src/views/permission/error-msg-dialog/index.tsx
index ebb9b89b03..22147adf8c 100644
--- a/packages/sheets-ui/src/views/permission/error-msg-dialog/index.tsx
+++ b/packages/sheets-ui/src/views/permission/error-msg-dialog/index.tsx
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
-import React from 'react';
+import { LocaleService } from '@univerjs/core';
import { Button } from '@univerjs/design';
-import { IDialogService } from '@univerjs/ui';
+import { IDialogService, useDependency } from '@univerjs/ui';
import styles from './index.module.less';
import { UNIVER_SHEET_PERMISSION_ALERT_DIALOG_ID } from './interface';
diff --git a/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailFooterPart.tsx b/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailFooterPart.tsx
index dd933b7fcf..e5f790798e 100644
--- a/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailFooterPart.tsx
+++ b/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailFooterPart.tsx
@@ -17,12 +17,11 @@
import type { IRange, Workbook } from '@univerjs/core';
import type { IRangeProtectionRule } from '@univerjs/sheets';
import type { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
-import { IAuthzIoService, ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { IAuthzIoService, ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { ObjectScope, UnitAction, UnitRole } from '@univerjs/protocol';
import { AddRangeProtectionCommand, AddWorksheetProtectionCommand, EditStateEnum, SetProtectionCommand, UnitObject, ViewStateEnum } from '@univerjs/sheets';
-import { ISidebarService } from '@univerjs/ui';
-import React from 'react';
+import { ISidebarService, useDependency } from '@univerjs/ui';
import { getUserListEqual } from '../../../common/utils';
import { UNIVER_SHEET_PERMISSION_PANEL } from '../../../consts/permission';
import { SheetPermissionPanelModel } from '../../../services/permission/sheet-permission-panel.model';
diff --git a/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailMainPart.tsx b/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailMainPart.tsx
index bfad5427a1..4fabc89582 100644
--- a/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailMainPart.tsx
+++ b/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailMainPart.tsx
@@ -15,11 +15,11 @@
*/
import type { IRange, Workbook } from '@univerjs/core';
-import { Injector, isValidRange, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { Injector, isValidRange, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { FormLayout, Input } from '@univerjs/design';
import { deserializeRangeWithSheet, serializeRange } from '@univerjs/engine-formula';
import { setEndForRange } from '@univerjs/sheets';
-import { ComponentManager } from '@univerjs/ui';
+import { ComponentManager, useDependency } from '@univerjs/ui';
import React, { useMemo } from 'react';
import { RANGE_SELECTOR_COMPONENT_KEY } from '../../../common/keys';
import { checkRangeValid } from '../util';
diff --git a/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailPanel.tsx b/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailPanel.tsx
index 89203fdf68..1d2cf77ccf 100644
--- a/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailPanel.tsx
+++ b/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailPanel.tsx
@@ -16,9 +16,9 @@
import type { IRange, Workbook } from '@univerjs/core';
import type { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
-import { Injector, IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { EditStateEnum, ViewStateEnum } from '@univerjs/sheets';
-import { ComponentContainer, ISidebarService, useComponentsOfPart, useSidebarClick } from '@univerjs/ui';
+import { ComponentContainer, ISidebarService, useComponentsOfPart, useDependency, useSidebarClick } from '@univerjs/ui';
import React, { useEffect, useRef, useState } from 'react';
import { UNIVER_SHEET_PERMISSION_USER_PART } from '../../../consts/permission';
import { checkRangeValid, generateDefaultRule, generateRuleByUnitType } from '../util';
diff --git a/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailUserPart.tsx b/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailUserPart.tsx
index 851123b68f..dd58808820 100644
--- a/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailUserPart.tsx
+++ b/packages/sheets-ui/src/views/permission/panel-detail/PermissionDetailUserPart.tsx
@@ -16,11 +16,11 @@
import type { Workbook } from '@univerjs/core';
import type { ICollaborator } from '@univerjs/protocol';
-import { IAuthzIoService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency, useObservable, UserManagerService } from '@univerjs/core';
+import { IAuthzIoService, IUniverInstanceService, LocaleService, UniverInstanceType, UserManagerService } from '@univerjs/core';
import { Avatar, FormLayout, Radio, RadioGroup, Select } from '@univerjs/design';
import { UnitRole } from '@univerjs/protocol';
import { EditStateEnum, ViewStateEnum } from '@univerjs/sheets';
-import { IDialogService } from '@univerjs/ui';
+import { IDialogService, useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect } from 'react';
import { UNIVER_SHEET_PERMISSION_USER_DIALOG, UNIVER_SHEET_PERMISSION_USER_DIALOG_ID } from '../../../consts/permission';
import { SheetPermissionUserManagerService } from '../../../services/permission/sheet-permission-user-list.service';
diff --git a/packages/sheets-ui/src/views/permission/panel-list/index.tsx b/packages/sheets-ui/src/views/permission/panel-list/index.tsx
index ce3a568fab..d6add22e50 100644
--- a/packages/sheets-ui/src/views/permission/panel-list/index.tsx
+++ b/packages/sheets-ui/src/views/permission/panel-list/index.tsx
@@ -18,13 +18,13 @@ import type { IRange, Workbook } from '@univerjs/core';
import type { IPermissionPoint } from '@univerjs/protocol';
import type { IRangeProtectionRule, IWorksheetProtectionRule } from '@univerjs/sheets';
import type { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
-import { IAuthzIoService, ICommandService, IPermissionService, IUniverInstanceService, LocaleService, Tools, UniverInstanceType, useDependency, UserManagerService } from '@univerjs/core';
+import { IAuthzIoService, ICommandService, IPermissionService, IUniverInstanceService, LocaleService, Tools, UniverInstanceType, UserManagerService } from '@univerjs/core';
import { Avatar, Button, Tooltip } from '@univerjs/design';
import { serializeRange } from '@univerjs/engine-formula';
import { DeleteSingle, WriteSingle } from '@univerjs/icons';
import { UnitAction, UnitObject } from '@univerjs/protocol';
import { baseProtectionActions, DeleteRangeProtectionCommand, DeleteWorksheetProtectionCommand, RangeProtectionRuleModel, SetWorksheetActiveOperation, WorkbookCreateProtectPermission, WorksheetProtectionRuleModel } from '@univerjs/sheets';
-import { ISidebarService, useObservable } from '@univerjs/ui';
+import { ISidebarService, useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback, useEffect, useState } from 'react';
diff --git a/packages/sheets-ui/src/views/permission/panel/index.tsx b/packages/sheets-ui/src/views/permission/panel/index.tsx
index ed5d3b6556..9451950f21 100644
--- a/packages/sheets-ui/src/views/permission/panel/index.tsx
+++ b/packages/sheets-ui/src/views/permission/panel/index.tsx
@@ -15,10 +15,10 @@
*/
import type { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
-import { IUniverInstanceService, useDependency } from '@univerjs/core';
+import { IUniverInstanceService } from '@univerjs/core';
import { serializeRangeWithSheet } from '@univerjs/engine-formula';
import { getSheetCommandTarget, SheetsSelectionsService } from '@univerjs/sheets';
-import React from 'react';
+import { useDependency } from '@univerjs/ui';
import { SheetPermissionPanelModel } from '../../../services/permission/sheet-permission-panel.model';
import { SheetPermissionPanelDetail } from '../panel-detail/PermissionDetailPanel';
import { SheetPermissionPanelList } from '../panel-list';
diff --git a/packages/sheets-ui/src/views/permission/permission-dialog/index.tsx b/packages/sheets-ui/src/views/permission/permission-dialog/index.tsx
index dbabcb3249..37c4dadbb3 100644
--- a/packages/sheets-ui/src/views/permission/permission-dialog/index.tsx
+++ b/packages/sheets-ui/src/views/permission/permission-dialog/index.tsx
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-import React, { useEffect, useState } from 'react';
-
-import { Button, Switch } from '@univerjs/design';
-import clsx from 'clsx';
-import { IAuthzIoService, ICommandService, IPermissionService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
import type { Workbook } from '@univerjs/core';
-import { IDialogService } from '@univerjs/ui';
-import { getAllWorksheetPermissionPoint, SetWorksheetPermissionPointsCommand, WorksheetProtectionPointModel } from '@univerjs/sheets';
+
import type { ICollaborator, UnitAction } from '@univerjs/protocol';
+import { IAuthzIoService, ICommandService, IPermissionService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
+import { Button, Switch } from '@univerjs/design';
import { ObjectScope, UnitObject, UnitRole } from '@univerjs/protocol';
-import Spin from '../spin';
+import { getAllWorksheetPermissionPoint, SetWorksheetPermissionPointsCommand, WorksheetProtectionPointModel } from '@univerjs/sheets';
+import { IDialogService, useDependency } from '@univerjs/ui';
+import clsx from 'clsx';
+import React, { useEffect, useState } from 'react';
import { defaultWorksheetUnitActionList, subUnitPermissionTypeMap, UNIVER_SHEET_PERMISSION_DIALOG_ID } from '../../../consts/permission';
+import Spin from '../spin';
import styles from './index.module.less';
interface IPermissionMap {
diff --git a/packages/sheets-ui/src/views/permission/user-dialog/index.tsx b/packages/sheets-ui/src/views/permission/user-dialog/index.tsx
index 8a2c8e7d28..cbc889f124 100644
--- a/packages/sheets-ui/src/views/permission/user-dialog/index.tsx
+++ b/packages/sheets-ui/src/views/permission/user-dialog/index.tsx
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
+import type { ICollaborator } from '@univerjs/protocol';
+import { LocaleService } from '@univerjs/core';
import { Avatar, Button, Input } from '@univerjs/design';
import { CheckMarkSingle } from '@univerjs/icons';
-import { type ICollaborator, UnitRole } from '@univerjs/protocol';
-import { IDialogService } from '@univerjs/ui';
+import { UnitRole } from '@univerjs/protocol';
+import { IDialogService, useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useState } from 'react';
import { UNIVER_SHEET_PERMISSION_USER_DIALOG_ID } from '../../../consts/permission';
diff --git a/packages/sheets-ui/src/views/sheet-bar/SheetBar.tsx b/packages/sheets-ui/src/views/sheet-bar/SheetBar.tsx
index f4bee5f107..57b98e2964 100644
--- a/packages/sheets-ui/src/views/sheet-bar/SheetBar.tsx
+++ b/packages/sheets-ui/src/views/sheet-bar/SheetBar.tsx
@@ -15,11 +15,11 @@
*/
import type { IScrollState } from './sheet-bar-tabs/utils/slide-tab-bar';
-import { ICommandService, IPermissionService, useDependency } from '@univerjs/core';
+import { ICommandService, IPermissionService } from '@univerjs/core';
import { IncreaseSingle, MoreSingle } from '@univerjs/icons';
import { InsertSheetCommand, WorkbookCreateSheetPermission, WorkbookEditablePermission } from '@univerjs/sheets';
+import { useDependency, useObservable } from '@univerjs/ui';
-import { useObservable } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { useActiveWorkbook } from '../../components/hook';
import { ISheetBarService } from '../../services/sheet-bar/sheet-bar.service';
diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/SheetBarMenu.tsx b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/SheetBarMenu.tsx
index 8cfed9d79a..020692c854 100644
--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/SheetBarMenu.tsx
+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/SheetBarMenu.tsx
@@ -15,7 +15,7 @@
*/
import type { ICommandInfo, Workbook } from '@univerjs/core';
-import { BooleanNumber, DisposableCollection, ICommandService, IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { BooleanNumber, DisposableCollection, ICommandService, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { DropdownLegacy } from '@univerjs/design';
import { CheckMarkSingle, ConvertSingle, EyelashSingle } from '@univerjs/icons';
import {
@@ -29,7 +29,7 @@ import {
SetWorksheetShowCommand,
WorksheetProtectionRuleModel,
} from '@univerjs/sheets';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useCallback, useEffect, useState } from 'react';
import { ISheetBarService } from '../../../services/sheet-bar/sheet-bar.service';
diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarItem.tsx b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarItem.tsx
index d965be39aa..1e8dbc6058 100644
--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarItem.tsx
+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarItem.tsx
@@ -15,7 +15,8 @@
*/
import type { BooleanNumber } from '@univerjs/core';
-import { ColorKit, ThemeService, useDependency } from '@univerjs/core';
+import { ColorKit, ThemeService } from '@univerjs/core';
+import { useDependency } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import styles from './index.module.less';
diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.tsx b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.tsx
index 837026b6d0..678772679c 100644
--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.tsx
+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.tsx
@@ -18,10 +18,10 @@ import type { ICommandInfo } from '@univerjs/core';
import type { IUniverUIConfig } from '@univerjs/ui';
import type { IBaseSheetBarProps } from './SheetBarItem';
import type { IScrollState } from './utils/slide-tab-bar';
-import { ICommandService, IConfigService, IPermissionService, LocaleService, nameCharacterCheck, Quantity, useDependency } from '@univerjs/core';
+import { ICommandService, IConfigService, IPermissionService, LocaleService, nameCharacterCheck, Quantity } from '@univerjs/core';
import { DropdownLegacy } from '@univerjs/design';
-
import { LockSingle } from '@univerjs/icons';
+
import {
InsertSheetMutation,
RangeProtectionRuleModel,
@@ -37,7 +37,7 @@ import {
WorkbookRenameSheetPermission,
WorksheetProtectionRuleModel,
} from '@univerjs/sheets';
-import { ContextMenuPosition, IConfirmService, UI_PLUGIN_CONFIG_KEY, UIMenu, useObservable } from '@univerjs/ui';
+import { ContextMenuPosition, IConfirmService, UI_PLUGIN_CONFIG_KEY, UIMenu, useDependency, useObservable } from '@univerjs/ui';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { merge } from 'rxjs';
import { useActiveWorkbook } from '../../../components/hook';
diff --git a/packages/sheets-ui/src/views/sheet-container/SheetContainer.tsx b/packages/sheets-ui/src/views/sheet-container/SheetContainer.tsx
index 63f30103e3..13db9eda91 100644
--- a/packages/sheets-ui/src/views/sheet-container/SheetContainer.tsx
+++ b/packages/sheets-ui/src/views/sheet-container/SheetContainer.tsx
@@ -15,8 +15,8 @@
*/
import type { Workbook } from '@univerjs/core';
-import { IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
-import { ContextMenuPosition, IMenuManagerService, ToolbarItem, useObservable } from '@univerjs/ui';
+import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
+import { ContextMenuPosition, IMenuManagerService, ToolbarItem, useDependency, useObservable } from '@univerjs/ui';
import React, { useMemo } from 'react';
import { useActiveWorkbook } from '../../components/hook';
diff --git a/packages/sheets-ui/src/views/status-bar/CopyableStatisticItem.tsx b/packages/sheets-ui/src/views/status-bar/CopyableStatisticItem.tsx
index a388d27264..6eeacb2b45 100644
--- a/packages/sheets-ui/src/views/status-bar/CopyableStatisticItem.tsx
+++ b/packages/sheets-ui/src/views/status-bar/CopyableStatisticItem.tsx
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-import { LocaleService, numfmt, useDependency } from '@univerjs/core';
+import type { IFunctionNames } from '@univerjs/engine-formula';
+import { LocaleService, numfmt } from '@univerjs/core';
import { MessageType, Tooltip } from '@univerjs/design';
import { FUNCTION_NAMES_MATH, FUNCTION_NAMES_STATISTICAL, FUNCTION_NAMES_TEXT } from '@univerjs/engine-formula';
-import { IClipboardInterfaceService, IMessageService } from '@univerjs/ui';
+import { IClipboardInterfaceService, IMessageService, useDependency } from '@univerjs/ui';
import React from 'react';
-import type { IFunctionNames } from '@univerjs/engine-formula';
import styles from './index.module.less';
diff --git a/packages/sheets-ui/src/views/status-bar/StatusBar.tsx b/packages/sheets-ui/src/views/status-bar/StatusBar.tsx
index afe4154041..184edb52ec 100644
--- a/packages/sheets-ui/src/views/status-bar/StatusBar.tsx
+++ b/packages/sheets-ui/src/views/status-bar/StatusBar.tsx
@@ -14,12 +14,13 @@
* limitations under the License.
*/
-import { debounce, useDependency } from '@univerjs/core';
+import type { IStatisticItem } from './CopyableStatisticItem';
+import { debounce } from '@univerjs/core';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useState } from 'react';
import { IStatusBarService } from '../../services/status-bar.service';
-import type { IStatisticItem } from './CopyableStatisticItem';
import { CopyableStatisticItem } from './CopyableStatisticItem';
import styles from './index.module.less';
diff --git a/packages/sheets-zen-editor/src/views/zen-editor/ZenEditor.tsx b/packages/sheets-zen-editor/src/views/zen-editor/ZenEditor.tsx
index c7819bebb4..8f969d6436 100644
--- a/packages/sheets-zen-editor/src/views/zen-editor/ZenEditor.tsx
+++ b/packages/sheets-zen-editor/src/views/zen-editor/ZenEditor.tsx
@@ -15,9 +15,10 @@
*/
import type { IDocumentData } from '@univerjs/core';
-import { DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_ZEN_EDITOR_UNIT_ID_KEY, DocumentFlavor, ICommandService, useDependency } from '@univerjs/core';
+import { DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_ZEN_EDITOR_UNIT_ID_KEY, DocumentFlavor, ICommandService } from '@univerjs/core';
import { IEditorService } from '@univerjs/docs-ui';
import { CheckMarkSingle, CloseSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useRef } from 'react';
diff --git a/packages/slides-ui/src/components/image-popup-menu/ImagePopupMenu.tsx b/packages/slides-ui/src/components/image-popup-menu/ImagePopupMenu.tsx
index 81678fc0f3..21bd5ce9a1 100644
--- a/packages/slides-ui/src/components/image-popup-menu/ImagePopupMenu.tsx
+++ b/packages/slides-ui/src/components/image-popup-menu/ImagePopupMenu.tsx
@@ -15,9 +15,10 @@
*/
import type { IDrawingSearch } from '@univerjs/core';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { DropdownLegacy } from '@univerjs/design';
import { Autofill, MoreDownSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useState } from 'react';
import styles from './index.module.less';
diff --git a/packages/slides-ui/src/components/panels/ArrangePanel.tsx b/packages/slides-ui/src/components/panels/ArrangePanel.tsx
index 89e3fe8b23..f8ee4f5edd 100644
--- a/packages/slides-ui/src/components/panels/ArrangePanel.tsx
+++ b/packages/slides-ui/src/components/panels/ArrangePanel.tsx
@@ -14,15 +14,16 @@
* limitations under the License.
*/
-import React from 'react';
-
import type { Nullable } from '@univerjs/core';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
-import clsx from 'clsx';
+
+import type { Image, Rect, RichText } from '@univerjs/engine-render';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { BottomSingle, MoveDownSingle, MoveUpSingle, TopmostSingle } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
+import clsx from 'clsx';
-import type { Image, Rect, RichText } from '@univerjs/engine-render';
+import React from 'react';
import { UpdateSlideElementOperation } from '../../commands/operations/update-element.operation';
import { CanvasView } from '../../controllers/canvas-view';
import styles from './index.module.less';
diff --git a/packages/slides-ui/src/components/panels/FillPanel.tsx b/packages/slides-ui/src/components/panels/FillPanel.tsx
index 68d0323810..d5bfd63ed7 100644
--- a/packages/slides-ui/src/components/panels/FillPanel.tsx
+++ b/packages/slides-ui/src/components/panels/FillPanel.tsx
@@ -17,9 +17,10 @@
import type { Nullable } from '@univerjs/core';
import type { Rect } from '@univerjs/engine-render';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { ColorPicker, DropdownLegacy } from '@univerjs/design';
import { MoreDownSingle, PaintBucket } from '@univerjs/icons';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React from 'react';
diff --git a/packages/slides-ui/src/components/panels/TransformPanel.tsx b/packages/slides-ui/src/components/panels/TransformPanel.tsx
index 3f45d1ee09..f04aed83c5 100644
--- a/packages/slides-ui/src/components/panels/TransformPanel.tsx
+++ b/packages/slides-ui/src/components/panels/TransformPanel.tsx
@@ -14,13 +14,14 @@
* limitations under the License.
*/
-import React, { useEffect, useState } from 'react';
-
import type { Nullable } from '@univerjs/core';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
-import clsx from 'clsx';
-import { InputNumber } from '@univerjs/design';
+
import type { BaseObject, IChangeObserverConfig, Image, Rect, RichText } from '@univerjs/engine-render';
+import { ICommandService, LocaleService } from '@univerjs/core';
+import { InputNumber } from '@univerjs/design';
+import { useDependency } from '@univerjs/ui';
+import clsx from 'clsx';
+import React, { useEffect, useState } from 'react';
import { UpdateSlideElementOperation } from '../../commands/operations/update-element.operation';
import { CanvasView } from '../../controllers/canvas-view';
import styles from './index.module.less';
diff --git a/packages/slides-ui/src/components/sidebar/Sidebar.tsx b/packages/slides-ui/src/components/sidebar/Sidebar.tsx
index b153ded0e3..132bff6f6b 100644
--- a/packages/slides-ui/src/components/sidebar/Sidebar.tsx
+++ b/packages/slides-ui/src/components/sidebar/Sidebar.tsx
@@ -15,14 +15,16 @@
*/
import type { Nullable, SlideDataModel } from '@univerjs/core';
-import { IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
-import { type BaseObject, ObjectType } from '@univerjs/engine-render';
+import type { BaseObject } from '@univerjs/engine-render';
+import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
+import { ObjectType } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import React from 'react';
+import { CanvasView } from '../../controllers/canvas-view';
import ArrangePanel from '../panels/ArrangePanel';
-import TransformPanel from '../panels/TransformPanel';
import FillPanel from '../panels/FillPanel';
-import { CanvasView } from '../../controllers/canvas-view';
+import TransformPanel from '../panels/TransformPanel';
import styles from './index.module.less';
export const COMPONENT_SLIDE_SIDEBAR = 'COMPONENT_SLIDE_SIDEBAR';
diff --git a/packages/slides-ui/src/components/slide-bar/SlideBar.tsx b/packages/slides-ui/src/components/slide-bar/SlideBar.tsx
index 7d67a8abd3..2caa59ed5c 100644
--- a/packages/slides-ui/src/components/slide-bar/SlideBar.tsx
+++ b/packages/slides-ui/src/components/slide-bar/SlideBar.tsx
@@ -15,9 +15,10 @@
*/
import type { SlideDataModel } from '@univerjs/core';
-import { ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { Scrollbar } from '@univerjs/design';
import { IRenderManagerService } from '@univerjs/engine-render';
+import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { ActivateSlidePageOperation } from '../../commands/operations/activate.operation';
diff --git a/packages/slides-ui/src/controllers/slide-ui.controller.ts b/packages/slides-ui/src/controllers/slide-ui.controller.ts
index 44b998d4f3..feaff6d145 100644
--- a/packages/slides-ui/src/controllers/slide-ui.controller.ts
+++ b/packages/slides-ui/src/controllers/slide-ui.controller.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import { connectInjector, Disposable, ICommandService, Inject, Injector } from '@univerjs/core';
+import { Disposable, ICommandService, Inject, Injector } from '@univerjs/core';
import { AddImageSingle, GraphSingle, TextSingle } from '@univerjs/icons';
-import { BuiltInUIPart, ComponentManager, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
+import { BuiltInUIPart, ComponentManager, connectInjector, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
import { ActivateSlidePageOperation } from '../commands/operations/activate.operation';
import { AppendSlideOperation } from '../commands/operations/append-slide.operation';
import { DeleteSlideElementOperation } from '../commands/operations/delete-element.operation';
diff --git a/packages/slides-ui/src/views/editor-container/EditorContainer.tsx b/packages/slides-ui/src/views/editor-container/EditorContainer.tsx
index 95eb7a645c..adca50d9aa 100644
--- a/packages/slides-ui/src/views/editor-container/EditorContainer.tsx
+++ b/packages/slides-ui/src/views/editor-container/EditorContainer.tsx
@@ -15,11 +15,11 @@
*/
import type { IDocumentData } from '@univerjs/core';
-import { DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, IContextService, useDependency } from '@univerjs/core';
+import { DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, IContextService } from '@univerjs/core';
import { IEditorService } from '@univerjs/docs-ui';
-
import { FIX_ONE_PIXEL_BLUR_OFFSET } from '@univerjs/engine-render';
-import { DISABLE_AUTO_FOCUS_KEY, useObservable } from '@univerjs/ui';
+
+import { DISABLE_AUTO_FOCUS_KEY, useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useState } from 'react';
import { SLIDE_EDITOR_ID } from '../../const';
// import { ICellEditorManagerService } from '../../services/editor/cell-editor-manager.service';
diff --git a/packages/thread-comment-ui/src/views/thread-comment-editor/index.tsx b/packages/thread-comment-ui/src/views/thread-comment-editor/index.tsx
index 52ec24faf5..8910c94a71 100644
--- a/packages/thread-comment-ui/src/views/thread-comment-editor/index.tsx
+++ b/packages/thread-comment-ui/src/views/thread-comment-editor/index.tsx
@@ -17,10 +17,10 @@
import type { IDocumentBody, IDocumentData } from '@univerjs/core';
import type { Editor, IKeyboardEventConfig } from '@univerjs/docs-ui';
import type { IThreadComment } from '@univerjs/thread-comment';
-import { BuildTextUtils, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, LocaleService, Tools, UniverInstanceType, useDependency } from '@univerjs/core';
+import { BuildTextUtils, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, LocaleService, Tools, UniverInstanceType } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { BreakLineCommand, IEditorService, RichTextEditor } from '@univerjs/docs-ui';
-import { KeyCode } from '@univerjs/ui';
+import { KeyCode, useDependency } from '@univerjs/ui';
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
import { SetActiveCommentOperation } from '../../commands/operations/comment.operations';
import styles from './index.module.less';
diff --git a/packages/thread-comment-ui/src/views/thread-comment-panel/index.tsx b/packages/thread-comment-ui/src/views/thread-comment-panel/index.tsx
index d448eed501..45351fab83 100644
--- a/packages/thread-comment-ui/src/views/thread-comment-panel/index.tsx
+++ b/packages/thread-comment-ui/src/views/thread-comment-panel/index.tsx
@@ -18,11 +18,11 @@ import type { Nullable } from '@univerjs/core';
import type { IThreadComment } from '@univerjs/thread-comment';
import type { Observable } from 'rxjs';
import type { IThreadCommentTreeProps } from '../thread-comment-tree';
-import { ICommandService, LocaleService, UniverInstanceType, useDependency, UserManagerService } from '@univerjs/core';
+import { ICommandService, LocaleService, UniverInstanceType, UserManagerService } from '@univerjs/core';
import { Button, Select } from '@univerjs/design';
import { IncreaseSingle } from '@univerjs/icons';
import { ThreadCommentModel } from '@univerjs/thread-comment';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { SetActiveCommentOperation } from '../../commands/operations/comment.operations';
import { ThreadCommentPanelService } from '../../services/thread-comment-panel.service';
diff --git a/packages/thread-comment-ui/src/views/thread-comment-tree/index.tsx b/packages/thread-comment-ui/src/views/thread-comment-tree/index.tsx
index 0260b5d9ed..2e5b10ffef 100644
--- a/packages/thread-comment-ui/src/views/thread-comment-tree/index.tsx
+++ b/packages/thread-comment-ui/src/views/thread-comment-tree/index.tsx
@@ -14,14 +14,14 @@
* limitations under the License.
*/
+import type { IUser, UniverInstanceType } from '@univerjs/core';
import type { IAddCommentCommandParams, IThreadComment, IUpdateCommentCommandParams } from '@univerjs/thread-comment';
import type { IThreadCommentEditorInstance } from '../thread-comment-editor';
-import { generateRandomId, useDependency } from '@univerjs/core';
-import { ICommandService, type IUser, LocaleService, type UniverInstanceType, UserManagerService } from '@univerjs/core';
+import { generateRandomId, ICommandService, LocaleService, UserManagerService } from '@univerjs/core';
import { DropdownLegacy, Menu, MenuItem, Tooltip } from '@univerjs/design';
import { DeleteSingle, MoreHorizontalSingle, ReplyToCommentSingle, ResolvedSingle, SolveSingle } from '@univerjs/icons';
import { AddCommentCommand, DeleteCommentCommand, DeleteCommentTreeCommand, getDT, ResolveCommentCommand, ThreadCommentModel, UpdateCommentCommand } from '@univerjs/thread-comment';
-import { useObservable } from '@univerjs/ui';
+import { useDependency, useObservable } from '@univerjs/ui';
import cs from 'clsx';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { debounceTime } from 'rxjs';
diff --git a/packages/ui/package.json b/packages/ui/package.json
index d02558eeb2..b1f2c7247c 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -79,6 +79,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"@univerjs/icons": "^0.2.14",
+ "@wendellhu/redi": "0.17.1",
"clsx": "^2.1.1",
"localforage": "^1.10.0",
"rc-notification": "^5.6.2",
diff --git a/packages/ui/src/components/custom-label/CustomLabel.tsx b/packages/ui/src/components/custom-label/CustomLabel.tsx
index 83666d05d4..b257befeb6 100644
--- a/packages/ui/src/components/custom-label/CustomLabel.tsx
+++ b/packages/ui/src/components/custom-label/CustomLabel.tsx
@@ -16,11 +16,12 @@
import type { Observable } from 'rxjs';
import type { IMenuSelectorItem } from '../../services/menu/menu';
-import { ColorKit, LocaleService, useDependency } from '@univerjs/core';
+import { ColorKit, LocaleService } from '@univerjs/core';
import React, { useEffect, useMemo, useState } from 'react';
import { isObservable } from 'rxjs';
import { ComponentManager } from '../../common/component-manager';
+import { useDependency } from '../../utils/di';
export type ICustomLabelProps<T = undefined> = {
value?: string | number | undefined;
diff --git a/packages/ui/src/components/font-family/FontFamily.tsx b/packages/ui/src/components/font-family/FontFamily.tsx
index ef9aa0cb82..a2d455590b 100644
--- a/packages/ui/src/components/font-family/FontFamily.tsx
+++ b/packages/ui/src/components/font-family/FontFamily.tsx
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
+import type { IFontFamilyProps } from './interface';
+import { LocaleService } from '@univerjs/core';
import React, { useMemo } from 'react';
+import { useDependency } from '../../utils/di';
import styles from './index.module.less';
-import type { IFontFamilyProps } from './interface';
export const FontFamily = (props: IFontFamilyProps) => {
const { value } = props;
diff --git a/packages/ui/src/components/font-family/FontFamilyItem.tsx b/packages/ui/src/components/font-family/FontFamilyItem.tsx
index bd7d2f66a2..ef17c90ab6 100644
--- a/packages/ui/src/components/font-family/FontFamilyItem.tsx
+++ b/packages/ui/src/components/font-family/FontFamilyItem.tsx
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
+import type { IFontFamilyItemProps } from './interface';
+import { LocaleService } from '@univerjs/core';
import React from 'react';
+import { useDependency } from '../../utils/di';
import styles from './index.module.less';
-import type { IFontFamilyItemProps } from './interface';
export const FontFamilyItem = (props: IFontFamilyItemProps) => {
const { value } = props;
diff --git a/packages/ui/src/components/font-size/FontSize.tsx b/packages/ui/src/components/font-size/FontSize.tsx
index 105a5814c2..c114d8e38a 100644
--- a/packages/ui/src/components/font-size/FontSize.tsx
+++ b/packages/ui/src/components/font-size/FontSize.tsx
@@ -14,12 +14,11 @@
* limitations under the License.
*/
+import type { IFontSizeProps } from './interface';
import { InputNumber } from '@univerjs/design';
import React, { useMemo, useState } from 'react';
-
-import { useObservable } from '../hooks/observable';
+import { useObservable } from '../../utils/di';
import styles from './index.module.less';
-import type { IFontSizeProps } from './interface';
export const FontSize = (props: IFontSizeProps) => {
const { value, min, max, onChange, disabled$ } = props;
diff --git a/packages/ui/src/components/hooks/__tests__/observable.spec.ts b/packages/ui/src/components/hooks/__tests__/observable.spec.ts
index be18f16c06..b854d46dd5 100644
--- a/packages/ui/src/components/hooks/__tests__/observable.spec.ts
+++ b/packages/ui/src/components/hooks/__tests__/observable.spec.ts
@@ -18,9 +18,8 @@ import type { Observable } from 'rxjs';
import { renderHook } from '@testing-library/react';
import { act, useState } from 'react';
import { of, Subject } from 'rxjs';
-
import { describe, expect, it } from 'vitest';
-import { useObservable } from '../observable';
+import { useObservable } from '../../../utils/di';
// New to testing React Hooks? You can refer to https://mayashavin.com/articles/test-react-hooks-with-vitest .
diff --git a/packages/ui/src/components/hooks/index.ts b/packages/ui/src/components/hooks/index.ts
index b1082a7325..be6b8b3e48 100644
--- a/packages/ui/src/components/hooks/index.ts
+++ b/packages/ui/src/components/hooks/index.ts
@@ -15,7 +15,6 @@
*/
export { useEvent } from './event';
-export { useObservable, useObservableRef } from './observable';
export { useUpdateEffect } from './update-effect';
export { useClickOutSide } from './use-click-out-side';
export { useVirtualList } from './virtual-list';
diff --git a/packages/ui/src/components/hooks/locale.ts b/packages/ui/src/components/hooks/locale.ts
index 18a6bc349b..5822d674ab 100644
--- a/packages/ui/src/components/hooks/locale.ts
+++ b/packages/ui/src/components/hooks/locale.ts
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
+import { useDependency } from '../../utils/di';
export function useLocaleService() {
return useDependency(LocaleService);
diff --git a/packages/ui/src/components/menu/common/hook.ts b/packages/ui/src/components/menu/common/hook.ts
index b081669d50..44c32a1fd1 100644
--- a/packages/ui/src/components/menu/common/hook.ts
+++ b/packages/ui/src/components/menu/common/hook.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import { useObservable } from '@univerjs/core';
import type { IDisplayMenuItem, IMenuItem } from '../../../services/menu/menu';
+import { useObservable } from '../../../utils/di';
export function useMenuItemState(
menuItem: IDisplayMenuItem<IMenuItem>
diff --git a/packages/ui/src/components/menu/desktop/Menu.tsx b/packages/ui/src/components/menu/desktop/Menu.tsx
index e03daa409b..3087484fd3 100644
--- a/packages/ui/src/components/menu/desktop/Menu.tsx
+++ b/packages/ui/src/components/menu/desktop/Menu.tsx
@@ -22,7 +22,7 @@ import type {
IValueOption,
MenuItemDefaultValueType,
} from '../../../services/menu/menu';
-import { isRealNum, useDependency } from '@univerjs/core';
+import { isRealNum } from '@univerjs/core';
import {
Menu as DesignMenu,
MenuItem as DesignMenuItem,
@@ -37,9 +37,9 @@ import { combineLatest, isObservable, of } from 'rxjs';
import { ILayoutService } from '../../../services/layout/layout.service';
import { MenuItemType } from '../../../services/menu/menu';
import { IMenuManagerService } from '../../../services/menu/menu-manager.service';
+import { useDependency, useObservable } from '../../../utils/di';
import { CustomLabel } from '../../custom-label/CustomLabel';
import { useScrollYOverContainer } from '../../hooks/layout';
-import { useObservable } from '../../hooks/observable';
import styles from './index.module.less';
// TODO: @jikkai disabled and hidden are not working
diff --git a/packages/ui/src/components/menu/mobile/MobileMenu.stories.tsx b/packages/ui/src/components/menu/mobile/MobileMenu.stories.tsx
index 76efd734e5..2b579bde7f 100644
--- a/packages/ui/src/components/menu/mobile/MobileMenu.stories.tsx
+++ b/packages/ui/src/components/menu/mobile/MobileMenu.stories.tsx
@@ -15,12 +15,13 @@
*/
import type { Meta } from '@storybook/react';
+import { Inject, Injector, LocaleType, Plugin, Univer, UniverInstanceType } from '@univerjs/core';
import React, { useState } from 'react';
-import { Inject, Injector, LocaleType, Plugin, RediContext, Univer, UniverInstanceType } from '@univerjs/core';
-import { IShortcutService, ShortcutService } from '../../../services/shortcut/shortcut.service';
-import { IPlatformService, PlatformService } from '../../../services/platform/platform.service';
import { ComponentManager } from '../../../common';
import { ContextMenuPosition } from '../../../services/menu/types';
+import { IPlatformService, PlatformService } from '../../../services/platform/platform.service';
+import { IShortcutService, ShortcutService } from '../../../services/shortcut/shortcut.service';
+import { RediContext } from '../../../utils/di';
import { MobileMenu } from './MobileMenu';
const meta: Meta = {
diff --git a/packages/ui/src/components/menu/mobile/MobileMenu.tsx b/packages/ui/src/components/menu/mobile/MobileMenu.tsx
index 8eaaf27385..aab77a796c 100644
--- a/packages/ui/src/components/menu/mobile/MobileMenu.tsx
+++ b/packages/ui/src/components/menu/mobile/MobileMenu.tsx
@@ -14,16 +14,15 @@
* limitations under the License.
*/
-import React, { useMemo } from 'react';
-import { useDependency, useObservable } from '@univerjs/core';
-import { clsx } from 'clsx';
-import type { IBaseMenuProps } from '../desktop/Menu';
import type { IDisplayMenuItem, IMenuItem, IValueOption, MenuItemDefaultValueType } from '../../../services/menu/menu';
-import { MenuItemType } from '../../../services/menu/menu';
-
-import { CustomLabel } from '../../custom-label';
import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
+import type { IBaseMenuProps } from '../desktop/Menu';
+import { clsx } from 'clsx';
+import React, { useMemo } from 'react';
+import { MenuItemType } from '../../../services/menu/menu';
import { IMenuManagerService } from '../../../services/menu/menu-manager.service';
+import { useDependency, useObservable } from '../../../utils/di';
+import { CustomLabel } from '../../custom-label';
import styles from './index.module.less';
/**
diff --git a/packages/ui/src/components/progress-bar/ProgressBar.tsx b/packages/ui/src/components/progress-bar/ProgressBar.tsx
index ad85b0dbca..2f1cf5006a 100644
--- a/packages/ui/src/components/progress-bar/ProgressBar.tsx
+++ b/packages/ui/src/components/progress-bar/ProgressBar.tsx
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-import { ThemeService, useDependency } from '@univerjs/core';
+import { ThemeService } from '@univerjs/core';
import { Tooltip } from '@univerjs/design';
import { CloseSingle } from '@univerjs/icons';
import React, { useEffect, useRef } from 'react';
+import { useDependency } from '../../utils/di';
import styles from './index.module.less';
export interface IProgressBarProps {
diff --git a/packages/ui/src/controllers/ui/ui-desktop.controller.tsx b/packages/ui/src/controllers/ui/ui-desktop.controller.tsx
index 44be8bd8f2..7401df1d3d 100644
--- a/packages/ui/src/controllers/ui/ui-desktop.controller.tsx
+++ b/packages/ui/src/controllers/ui/ui-desktop.controller.tsx
@@ -18,15 +18,14 @@ import type { IDisposable, UnitModel } from '@univerjs/core';
import type { RenderUnit } from '@univerjs/engine-render';
import type { IUniverUIConfig } from '../config.schema';
import type { IWorkbenchOptions } from './ui.controller';
-import { connectInjector, Disposable, Inject, Injector, isInternalEditorID, IUniverInstanceService, LifecycleService, LifecycleStages, Optional, toDisposable } from '@univerjs/core';
+import { Disposable, Inject, Injector, isInternalEditorID, IUniverInstanceService, LifecycleService, LifecycleStages, Optional, toDisposable } from '@univerjs/core';
import { render as createRoot, unmount } from '@univerjs/design';
-
import { IRenderManagerService } from '@univerjs/engine-render';
-import React from 'react';
import { filter, take } from 'rxjs';
import { ILayoutService } from '../../services/layout/layout.service';
import { IMenuManagerService } from '../../services/menu/menu-manager.service';
import { BuiltInUIPart, IUIPartsService } from '../../services/parts/parts.service';
+import { connectInjector } from '../../utils/di';
import { FloatDom } from '../../views/components/dom/FloatDom';
import { CanvasPopup } from '../../views/components/popup/CanvasPopup';
import { Ribbon } from '../../views/components/ribbon/Ribbon';
diff --git a/packages/ui/src/controllers/ui/ui-mobile.controller.tsx b/packages/ui/src/controllers/ui/ui-mobile.controller.tsx
index 80ef46aebd..b0455ceaa9 100644
--- a/packages/ui/src/controllers/ui/ui-mobile.controller.tsx
+++ b/packages/ui/src/controllers/ui/ui-mobile.controller.tsx
@@ -17,7 +17,7 @@
import type { IDisposable } from '@univerjs/core';
import type { IUniverUIConfig } from '../config.schema';
import type { IUIController, IWorkbenchOptions } from './ui.controller';
-import { connectInjector, Disposable, Inject, Injector, IUniverInstanceService, LifecycleService, LifecycleStages, Optional, toDisposable, UniverInstanceType } from '@univerjs/core';
+import { Disposable, Inject, Injector, IUniverInstanceService, LifecycleService, LifecycleStages, Optional, toDisposable, UniverInstanceType } from '@univerjs/core';
import { render as createRoot, unmount } from '@univerjs/design';
import { IRenderManagerService } from '@univerjs/engine-render';
@@ -26,6 +26,7 @@ import React from 'react';
import { ILayoutService } from '../../services/layout/layout.service';
import { IMenuManagerService } from '../../services/menu/menu-manager.service';
import { BuiltInUIPart, IUIPartsService } from '../../services/parts/parts.service';
+import { connectInjector } from '../../utils/di';
import { FloatDom } from '../../views/components/dom/FloatDom';
import { CanvasPopup } from '../../views/components/popup/CanvasPopup';
import { MobileApp } from '../../views/MobileApp';
diff --git a/packages/ui/src/facade/f-univer.ts b/packages/ui/src/facade/f-univer.ts
index 940cc08a06..d4fc9c247b 100644
--- a/packages/ui/src/facade/f-univer.ts
+++ b/packages/ui/src/facade/f-univer.ts
@@ -18,9 +18,9 @@ import type { IDisposable } from '@univerjs/core';
import type { IMessageProps } from '@univerjs/design';
import type { BuiltInUIPart, ComponentType, IComponentOptions, IDialogPartMethodOptions, ISidebarMethodOptions } from '@univerjs/ui';
import type { IFacadeMenuItem, IFacadeSubmenuItem } from './f-menu-builder';
-import { connectInjector, FUniver } from '@univerjs/core';
+import { FUniver } from '@univerjs/core';
import { IRenderManagerService } from '@univerjs/engine-render';
-import { ComponentManager, CopyCommand, IDialogService, IMessageService, ISidebarService, IUIPartsService, PasteCommand } from '@univerjs/ui';
+import { ComponentManager, connectInjector, CopyCommand, IDialogService, IMessageService, ISidebarService, IUIPartsService, PasteCommand } from '@univerjs/ui';
import { FMenu, FSubmenu } from './f-menu-builder';
import { FShortcut } from './f-shortcut';
diff --git a/packages/ui/src/services/confirm/desktop-confirm.service.ts b/packages/ui/src/services/confirm/desktop-confirm.service.ts
index 4ed6937e8f..4b97866b96 100644
--- a/packages/ui/src/services/confirm/desktop-confirm.service.ts
+++ b/packages/ui/src/services/confirm/desktop-confirm.service.ts
@@ -14,12 +14,13 @@
* limitations under the License.
*/
+import type { IDisposable } from '@univerjs/core';
import type { IConfirmPartMethodOptions } from '../../views/components/confirm-part/interface';
import type { IConfirmService } from './confirm.service';
-import { connectInjector, Disposable, toDisposable } from '@univerjs/core';
-import { type IDisposable, Inject, Injector } from '@univerjs/core';
+import { Disposable, Inject, Injector, toDisposable } from '@univerjs/core';
import { BehaviorSubject } from 'rxjs';
+import { connectInjector } from '../../utils/di';
import { ConfirmPart } from '../../views/components/confirm-part/ConfirmPart';
import { BuiltInUIPart, IUIPartsService } from '../parts/parts.service';
diff --git a/packages/ui/src/services/dialog/desktop-dialog.service.ts b/packages/ui/src/services/dialog/desktop-dialog.service.ts
index 4d96521ecc..a63fb518e2 100644
--- a/packages/ui/src/services/dialog/desktop-dialog.service.ts
+++ b/packages/ui/src/services/dialog/desktop-dialog.service.ts
@@ -14,12 +14,13 @@
* limitations under the License.
*/
+import type { IDisposable } from '@univerjs/core';
import type { IDialogPartMethodOptions } from '../../views/components/dialog-part/interface';
import type { IDialogService } from './dialog.service';
-import { connectInjector, Disposable, toDisposable } from '@univerjs/core';
-import { type IDisposable, Inject, Injector } from '@univerjs/core';
+import { Disposable, Inject, Injector, toDisposable } from '@univerjs/core';
import { Subject } from 'rxjs';
+import { connectInjector } from '../../utils/di';
import { DialogPart } from '../../views/components/dialog-part/DialogPart';
import { BuiltInUIPart, IUIPartsService } from '../parts/parts.service';
diff --git a/packages/ui/src/services/message/desktop-message.service.ts b/packages/ui/src/services/message/desktop-message.service.ts
index ef7e9b6261..6508d79e07 100644
--- a/packages/ui/src/services/message/desktop-message.service.ts
+++ b/packages/ui/src/services/message/desktop-message.service.ts
@@ -16,9 +16,9 @@
import type { IMessageProps } from '@univerjs/design';
import type { IMessageService } from './message.service';
-import { connectInjector, Disposable, Inject, Injector } from '@univerjs/core';
+import { Disposable, Inject, Injector } from '@univerjs/core';
import { message, Messager, removeMessage } from '@univerjs/design';
-
+import { connectInjector } from '../../utils/di';
import { BuiltInUIPart, IUIPartsService } from '../parts/parts.service';
export class DesktopMessageService extends Disposable implements IMessageService {
diff --git a/packages/ui/src/services/notification/desktop-notification.service.ts b/packages/ui/src/services/notification/desktop-notification.service.ts
index b3d6d98c22..ef2ba21769 100644
--- a/packages/ui/src/services/notification/desktop-notification.service.ts
+++ b/packages/ui/src/services/notification/desktop-notification.service.ts
@@ -14,13 +14,14 @@
* limitations under the License.
*/
-import { connectInjector, Disposable, toDisposable } from '@univerjs/core';
-import { type IDisposable, Inject, Injector } from '@univerjs/core';
-
+import type { IDisposable } from '@univerjs/core';
import type { INotificationOptions } from '../../components/notification/Notification';
+
+import type { INotificationService } from './notification.service';
+import { Disposable, Inject, Injector, toDisposable } from '@univerjs/core';
import { notification, Notification } from '../../components/notification/Notification';
+import { connectInjector } from '../../utils/di';
import { BuiltInUIPart, IUIPartsService } from '../parts/parts.service';
-import type { INotificationService } from './notification.service';
export class DesktopNotificationService extends Disposable implements INotificationService {
constructor(
diff --git a/packages/ui/src/services/sidebar/hooks/use-sidebar-click.ts b/packages/ui/src/services/sidebar/hooks/use-sidebar-click.ts
index b4631f17b6..fb41824c79 100644
--- a/packages/ui/src/services/sidebar/hooks/use-sidebar-click.ts
+++ b/packages/ui/src/services/sidebar/hooks/use-sidebar-click.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import { useDependency } from '@univerjs/core';
import { useEffect } from 'react';
+import { useDependency } from '../../../utils/di';
import { ISidebarService } from '../sidebar.service';
/**
* Response panel to a click event.
diff --git a/packages/ui/src/components/hooks/observable.ts b/packages/ui/src/utils/di.ts
similarity index 94%
rename from packages/ui/src/components/hooks/observable.ts
rename to packages/ui/src/utils/di.ts
index 4384275578..c6f134ce3d 100644
--- a/packages/ui/src/components/hooks/observable.ts
+++ b/packages/ui/src/utils/di.ts
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-/* eslint-disable ts/no-explicit-any */
-
import type { Nullable } from '@univerjs/core';
import type { RefObject } from 'react';
import type { Observable } from 'rxjs';
import { useEffect, useRef } from 'react';
+export * from '@wendellhu/redi/react-bindings';
+
type ObservableOrFn<T> = Observable<T> | (() => Observable<T>);
function unwrap<T>(o: ObservableOrFn<T>): Observable<T> {
@@ -31,8 +31,7 @@ function unwrap<T>(o: ObservableOrFn<T>): Observable<T> {
return o;
}
-export { useObservable } from '@univerjs/core';
-declare module '@univerjs/core' {
+declare module '@univerjs/ui' {
export function useObservable<T>(observable: ObservableOrFn<T>, defaultValue: T | undefined, shouldHaveSyncValue?: true): T;
export function useObservable<T>(observable: Nullable<ObservableOrFn<T>>, defaultValue: T): T;
export function useObservable<T>(observable: Nullable<ObservableOrFn<T>>, defaultValue?: undefined): T | undefined;
diff --git a/packages/ui/src/utils/index.ts b/packages/ui/src/utils/index.ts
index 979bee0be1..3f64859294 100644
--- a/packages/ui/src/utils/index.ts
+++ b/packages/ui/src/utils/index.ts
@@ -15,4 +15,5 @@
*/
export * from './cell';
+export * from './di';
export * from './util';
diff --git a/packages/ui/src/views/MobileApp.tsx b/packages/ui/src/views/MobileApp.tsx
index f566e1c7a0..85dded233c 100644
--- a/packages/ui/src/views/MobileApp.tsx
+++ b/packages/ui/src/views/MobileApp.tsx
@@ -16,10 +16,11 @@
import type { ILocale } from '@univerjs/design';
import type { IWorkbenchOptions } from '../controllers/ui/ui.controller';
-import { LocaleService, ThemeService, useDependency } from '@univerjs/core';
+import { LocaleService, ThemeService } from '@univerjs/core';
import { ConfigProvider, defaultTheme, themeInstance } from '@univerjs/design';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { BuiltInUIPart } from '../services/parts/parts.service';
+import { useDependency } from '../utils/di';
import { ComponentContainer, useComponentsOfPart } from './components/ComponentContainer';
import { MobileContextMenu } from './components/context-menu/MobileContextMenu';
import { Sidebar } from './components/sidebar/Sidebar';
diff --git a/packages/ui/src/views/components/ComponentContainer.tsx b/packages/ui/src/views/components/ComponentContainer.tsx
index 848ab1ff3c..69a3663921 100644
--- a/packages/ui/src/views/components/ComponentContainer.tsx
+++ b/packages/ui/src/views/components/ComponentContainer.tsx
@@ -17,11 +17,10 @@
import type { Injector } from '@univerjs/core';
import type { ComponentType } from 'react';
import type { ComponentRenderer } from '../../services/parts/parts.service';
-import { useDependency } from '@univerjs/core';
import React, { useMemo, useRef } from 'react';
import { debounceTime, filter, map, startWith } from 'rxjs';
-import { useObservable } from '../../components/hooks/observable';
import { IUIPartsService } from '../../services/parts/parts.service';
+import { useDependency, useObservable } from '../../utils/di';
export interface IComponentContainerProps {
components?: Set<ComponentType>;
diff --git a/packages/ui/src/views/components/confirm-part/ConfirmPart.tsx b/packages/ui/src/views/components/confirm-part/ConfirmPart.tsx
index 173cb0a8e9..22f186ede9 100644
--- a/packages/ui/src/views/components/confirm-part/ConfirmPart.tsx
+++ b/packages/ui/src/views/components/confirm-part/ConfirmPart.tsx
@@ -16,12 +16,12 @@
import type { IConfirmProps } from '@univerjs/design';
import type { IConfirmPartMethodOptions } from './interface';
-import { useDependency } from '@univerjs/core';
import { Confirm } from '@univerjs/design';
-
import React, { useEffect, useState } from 'react';
+
import { CustomLabel } from '../../../components/custom-label/CustomLabel';
import { IConfirmService } from '../../../services/confirm/confirm.service';
+import { useDependency } from '../../../utils/di';
export function ConfirmPart() {
const confirmService = useDependency(IConfirmService);
diff --git a/packages/ui/src/views/components/context-menu/ContextMenu.tsx b/packages/ui/src/views/components/context-menu/ContextMenu.tsx
index 58a89c25ed..5e4f110e6d 100644
--- a/packages/ui/src/views/components/context-menu/ContextMenu.tsx
+++ b/packages/ui/src/views/components/context-menu/ContextMenu.tsx
@@ -14,14 +14,15 @@
* limitations under the License.
*/
-import { ICommandService, useDependency, useInjector } from '@univerjs/core';
+import type { IMouseEvent } from '@univerjs/engine-render';
+import { ICommandService } from '@univerjs/core';
import { Popup } from '@univerjs/design';
import React, { useEffect, useRef, useState } from 'react';
-import type { IMouseEvent } from '@univerjs/engine-render';
-
import { Menu } from '../../../components/menu/desktop/Menu';
+
import { IContextMenuService } from '../../../services/contextmenu/contextmenu.service';
import { ILayoutService } from '../../../services/layout/layout.service';
+import { useDependency, useInjector } from '../../../utils/di';
export function DesktopContextMenu() {
const contentRef = useRef<HTMLDivElement>(null);
diff --git a/packages/ui/src/views/components/context-menu/MobileContextMenu.tsx b/packages/ui/src/views/components/context-menu/MobileContextMenu.tsx
index f8618d6a66..b73140f7c2 100644
--- a/packages/ui/src/views/components/context-menu/MobileContextMenu.tsx
+++ b/packages/ui/src/views/components/context-menu/MobileContextMenu.tsx
@@ -14,12 +14,13 @@
* limitations under the License.
*/
-import { ICommandService, useDependency } from '@univerjs/core';
-import React, { useEffect, useRef, useState } from 'react';
-import { Popup } from '@univerjs/design';
import type { IMouseEvent } from '@univerjs/engine-render';
-import { IContextMenuService } from '../../../services/contextmenu/contextmenu.service';
+import { ICommandService } from '@univerjs/core';
+import { Popup } from '@univerjs/design';
+import React, { useEffect, useRef, useState } from 'react';
import { MobileMenu } from '../../../components/menu/mobile/MobileMenu';
+import { IContextMenuService } from '../../../services/contextmenu/contextmenu.service';
+import { useDependency } from '../../../utils/di';
export function MobileContextMenu() {
const [visible, setVisible] = useState(false);
diff --git a/packages/ui/src/views/components/dialog-part/DialogPart.tsx b/packages/ui/src/views/components/dialog-part/DialogPart.tsx
index e01feee92d..c569393383 100644
--- a/packages/ui/src/views/components/dialog-part/DialogPart.tsx
+++ b/packages/ui/src/views/components/dialog-part/DialogPart.tsx
@@ -15,13 +15,12 @@
*/
import type { IDialogProps } from '@univerjs/design';
+import type { IDialogPartMethodOptions } from './interface';
import { Dialog } from '@univerjs/design';
-import { useDependency } from '@univerjs/core';
import React, { useEffect, useState } from 'react';
-
import { CustomLabel } from '../../../components/custom-label/CustomLabel';
import { IDialogService } from '../../../services/dialog/dialog.service';
-import type { IDialogPartMethodOptions } from './interface';
+import { useDependency } from '../../../utils/di';
export function DialogPart() {
const dialogService = useDependency(IDialogService);
diff --git a/packages/ui/src/views/components/dom/FloatDom.tsx b/packages/ui/src/views/components/dom/FloatDom.tsx
index 1c9c76db7e..c228d764bf 100644
--- a/packages/ui/src/views/components/dom/FloatDom.tsx
+++ b/packages/ui/src/views/components/dom/FloatDom.tsx
@@ -15,12 +15,12 @@
*/
import type { IFloatDom } from '../../../services/dom/canvas-dom-layer.service';
-import { IUniverInstanceService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import React, { memo, useEffect, useMemo, useRef } from 'react';
import { distinctUntilChanged, first } from 'rxjs';
import { ComponentManager } from '../../../common';
-import { useObservable } from '../../../components/hooks/observable';
import { CanvasFloatDomService } from '../../../services/dom/canvas-dom-layer.service';
+import { useDependency, useObservable } from '../../../utils/di';
import styles from './index.module.less';
const FloatDomSingle = memo((props: { layer: IFloatDom; id: string }) => {
diff --git a/packages/ui/src/views/components/global-zone/GlobalZone.tsx b/packages/ui/src/views/components/global-zone/GlobalZone.tsx
index 789702c855..07a490614b 100644
--- a/packages/ui/src/views/components/global-zone/GlobalZone.tsx
+++ b/packages/ui/src/views/components/global-zone/GlobalZone.tsx
@@ -14,13 +14,11 @@
* limitations under the License.
*/
-import { useDependency } from '@univerjs/core';
import clsx from 'clsx';
import React, { useEffect, useMemo, useState } from 'react';
import { ComponentManager } from '../../../common/component-manager';
-import { useObservable } from '../../../components/hooks/observable';
import { IGlobalZoneService } from '../../../services/global-zone/global-zone.service';
-
+import { useDependency, useObservable } from '../../../utils/di';
import styles from './index.module.less';
export function GlobalZone() {
diff --git a/packages/ui/src/views/components/popup/CanvasPopup.tsx b/packages/ui/src/views/components/popup/CanvasPopup.tsx
index 0f9e3b665b..00262ad0cc 100644
--- a/packages/ui/src/views/components/popup/CanvasPopup.tsx
+++ b/packages/ui/src/views/components/popup/CanvasPopup.tsx
@@ -15,12 +15,11 @@
*/
import type { IPopup } from '../../../services/popup/canvas-popup.service';
-import { useDependency } from '@univerjs/core';
import React, { useEffect, useMemo, useState } from 'react';
import { animationFrameScheduler, combineLatest, map, of, throttleTime } from 'rxjs';
import { ComponentManager } from '../../../common';
-import { useObservable, useObservableRef } from '../../../components/hooks/observable';
import { ICanvasPopupService } from '../../../services/popup/canvas-popup.service';
+import { useDependency, useObservable, useObservableRef } from '../../../utils/di';
import { RectPopup } from './RectPopup';
interface ISingleCanvasPopupProps {
diff --git a/packages/ui/src/views/components/popup/dom-popup.tsx b/packages/ui/src/views/components/popup/dom-popup.tsx
index c25c02bf82..cbf7ad3b8c 100644
--- a/packages/ui/src/views/components/popup/dom-popup.tsx
+++ b/packages/ui/src/views/components/popup/dom-popup.tsx
@@ -17,7 +17,7 @@
import type { IPopup } from '../../../services/popup/canvas-popup.service';
import React, { useEffect, useMemo, useState } from 'react';
import { animationFrameScheduler, combineLatest, map, of, throttleTime } from 'rxjs';
-import { useObservableRef } from '../../../components/hooks/observable';
+import { useObservableRef } from '../../../utils/di';
import { RectPopup } from './RectPopup';
interface ISingleDOMPopupProps {
diff --git a/packages/ui/src/views/components/popup/single-canvas-popup.tsx b/packages/ui/src/views/components/popup/single-canvas-popup.tsx
index 9d18895e18..efb09d74b3 100644
--- a/packages/ui/src/views/components/popup/single-canvas-popup.tsx
+++ b/packages/ui/src/views/components/popup/single-canvas-popup.tsx
@@ -17,7 +17,7 @@
import type { IPopup } from '../../../services/popup/canvas-popup.service';
import React, { useEffect, useMemo, useState } from 'react';
import { animationFrameScheduler, combineLatest, map, of, throttleTime } from 'rxjs';
-import { useObservableRef } from '../../../components/hooks/observable';
+import { useObservableRef } from '../../../utils/di';
import { RectPopup } from './RectPopup';
interface ISingleCanvasPopupProps {
diff --git a/packages/ui/src/views/components/ribbon/Ribbon.tsx b/packages/ui/src/views/components/ribbon/Ribbon.tsx
index a6f3b54138..8c04e0ccda 100644
--- a/packages/ui/src/views/components/ribbon/Ribbon.tsx
+++ b/packages/ui/src/views/components/ribbon/Ribbon.tsx
@@ -16,12 +16,13 @@
import type { ComponentType } from 'react';
import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import { clsx } from '@univerjs/design';
import { MoreFunctionSingle } from '@univerjs/icons';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { IMenuManagerService } from '../../../services/menu/menu-manager.service';
import { MenuManagerPosition, RibbonPosition } from '../../../services/menu/types';
+import { useDependency } from '../../../utils/di';
import { ComponentContainer } from '../ComponentContainer';
import { ToolbarButton } from '../ribbon/Button/ToolbarButton';
import styles from './index.module.less';
diff --git a/packages/ui/src/views/components/ribbon/ToolbarItem.tsx b/packages/ui/src/views/components/ribbon/ToolbarItem.tsx
index 395ebdefff..be18a41f78 100644
--- a/packages/ui/src/views/components/ribbon/ToolbarItem.tsx
+++ b/packages/ui/src/views/components/ribbon/ToolbarItem.tsx
@@ -17,17 +17,17 @@
import type { IDropdownLegacyProps } from '@univerjs/design';
import type { IDisplayMenuItem, IMenuItem, IMenuSelectorItem, IValueOption } from '../../../services/menu/menu';
import type { ITooltipWrapperRef } from './TooltipButtonWrapper';
-import { ICommandService, LocaleService, useDependency } from '@univerjs/core';
+import { ICommandService, LocaleService } from '@univerjs/core';
import { MoreDownSingle } from '@univerjs/icons';
import clsx from 'clsx';
import React, { forwardRef, useMemo } from 'react';
import { isObservable, Observable } from 'rxjs';
import { ComponentManager } from '../../../common/component-manager';
import { CustomLabel } from '../../../components/custom-label/CustomLabel';
-import { useObservable } from '../../../components/hooks/observable';
import { Menu } from '../../../components/menu/desktop/Menu';
import { ILayoutService } from '../../../services/layout/layout.service';
import { MenuItemType } from '../../../services/menu/menu';
+import { useDependency, useObservable } from '../../../utils/di';
import { ToolbarButton } from './Button/ToolbarButton';
import { useToolbarItemStatus } from './hook';
import styles from './index.module.less';
diff --git a/packages/ui/src/views/components/shortcut-panel/ShortcutPanel.tsx b/packages/ui/src/views/components/shortcut-panel/ShortcutPanel.tsx
index 2bd5fd2c71..cec4000185 100644
--- a/packages/ui/src/views/components/shortcut-panel/ShortcutPanel.tsx
+++ b/packages/ui/src/views/components/shortcut-panel/ShortcutPanel.tsx
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-import { LocaleService, useDependency } from '@univerjs/core';
+import { LocaleService } from '@univerjs/core';
import React, { useCallback, useEffect } from 'react';
-import { useObservable } from '../../../components/hooks/observable';
import { IShortcutService } from '../../../services/shortcut/shortcut.service';
+import { useDependency, useObservable } from '../../../utils/di';
import styles from './index.module.less';
interface IRenderShortcutItem {
diff --git a/packages/ui/src/views/components/sidebar/Sidebar.tsx b/packages/ui/src/views/components/sidebar/Sidebar.tsx
index caf967c3b1..afbbac2f39 100644
--- a/packages/ui/src/views/components/sidebar/Sidebar.tsx
+++ b/packages/ui/src/views/components/sidebar/Sidebar.tsx
@@ -15,13 +15,12 @@
*/
import type { ISidebarMethodOptions } from './interface';
-import { useDependency } from '@univerjs/core';
import { CloseSingle } from '@univerjs/icons';
import clsx from 'clsx';
import React, { useEffect, useMemo, useRef } from 'react';
import { CustomLabel } from '../../../components/custom-label/CustomLabel';
-import { useObservable } from '../../../components/hooks/observable';
import { ISidebarService } from '../../../services/sidebar/sidebar.service';
+import { useDependency, useObservable } from '../../../utils/di';
import styles from './index.module.less';
export function Sidebar() {
diff --git a/packages/ui/src/views/components/zen-zone/ZenZone.tsx b/packages/ui/src/views/components/zen-zone/ZenZone.tsx
index 08f7737b66..620696c6fe 100644
--- a/packages/ui/src/views/components/zen-zone/ZenZone.tsx
+++ b/packages/ui/src/views/components/zen-zone/ZenZone.tsx
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-import { useDependency, useObservable } from '@univerjs/core';
import clsx from 'clsx';
import React, { useEffect, useMemo, useState } from 'react';
import { ComponentManager } from '../../../common/component-manager';
import { IZenZoneService } from '../../../services/zen-zone/zen-zone.service';
+import { useDependency, useObservable } from '../../../utils/di';
import styles from './index.module.less';
export function ZenZone() {
diff --git a/packages/ui/src/views/workbench/Workbench.tsx b/packages/ui/src/views/workbench/Workbench.tsx
index 25891bc7a6..09eb7745e0 100644
--- a/packages/ui/src/views/workbench/Workbench.tsx
+++ b/packages/ui/src/views/workbench/Workbench.tsx
@@ -17,13 +17,13 @@
import type { DocumentDataModel, IDocumentData, Nullable } from '@univerjs/core';
import type { ILocale } from '@univerjs/design';
import type { IWorkbenchOptions } from '../../controllers/ui/ui.controller';
-import { DocumentFlavor, IUniverInstanceService, LocaleService, ThemeService, UniverInstanceType, useDependency } from '@univerjs/core';
+import { DocumentFlavor, IUniverInstanceService, LocaleService, ThemeService, UniverInstanceType } from '@univerjs/core';
import { ConfigContext, ConfigProvider, defaultTheme, themeInstance } from '@univerjs/design';
-
import clsx from 'clsx';
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { BuiltInUIPart } from '../../services/parts/parts.service';
+import { useDependency } from '../../utils/di';
import { ComponentContainer, useComponentsOfPart } from '../components/ComponentContainer';
import { DesktopContextMenu } from '../components/context-menu/ContextMenu';
diff --git a/packages/uniscript/src/views/components/ScriptEditorPanel.tsx b/packages/uniscript/src/views/components/ScriptEditorPanel.tsx
index 20423da463..5bfa637bbe 100644
--- a/packages/uniscript/src/views/components/ScriptEditorPanel.tsx
+++ b/packages/uniscript/src/views/components/ScriptEditorPanel.tsx
@@ -15,9 +15,9 @@
*/
import type { IDisposable, Nullable } from '@univerjs/core';
-import { DisposableCollection, LocaleService, toDisposable, useDependency } from '@univerjs/core';
+import { DisposableCollection, LocaleService, toDisposable } from '@univerjs/core';
import { Button, MessageType } from '@univerjs/design';
-import { IMessageService, IShortcutService } from '@univerjs/ui';
+import { IMessageService, IShortcutService, useDependency } from '@univerjs/ui';
import { editor } from 'monaco-editor';
import React, { useCallback, useEffect, useRef } from 'react';
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4f61720ce5..c81e0bef4b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5,8 +5,8 @@ settings:
excludeLinksFromLockfile: false
overrides:
- '@types/react': ^19.0.2
- '@types/react-dom': ^19.0.2
+ '@types/react': ^19.0.8
+ '@types/react-dom': ^19.0.3
react: 19.0.0
react-dom: 19.0.0
@@ -42,11 +42,11 @@ importers:
specifier: ^22.10.10
version: 22.10.10
'@types/react':
- specifier: ^19.0.2
- version: 19.0.2
+ specifier: ^19.0.8
+ version: 19.0.8
'@types/react-dom':
- specifier: ^19.0.2
- version: 19.0.2(@types/[email protected])
+ specifier: ^19.0.3
+ version: 19.0.3(@types/[email protected])
'@univerjs-infra/shared':
specifier: workspace:*
version: link:common/shared
@@ -188,7 +188,7 @@ importers:
'@storybook/addon-essentials':
specifier: ^8.5.1
'@storybook/addon-interactions':
specifier: ^8.5.1
@@ -450,7 +450,7 @@ importers:
version: 19.0.0([email protected])
react-mosaic-component:
specifier: ^6.1.1
devDependencies:
'@types/fs-extra':
specifier: ^11.0.4
@@ -1056,7 +1056,7 @@ importers:
version: link:../../packages/ui
'@xyflow/react':
specifier: ^12.3.5
clsx:
specifier: ^2.1.1
version: 2.1.1
@@ -1130,9 +1130,6 @@ importers:
rbush:
specifier: ^4.0.1
version: 4.0.1
- react:
- specifier: 19.0.0
- version: 19.0.0
devDependencies:
'@types/lodash-es':
specifier: ^4.17.12
@@ -1252,13 +1249,13 @@ importers:
devDependencies:
'@testing-library/react':
specifier: ^16.2.0
'@types/react-grid-layout':
specifier: ^1.3.5
version: 1.3.5
'@types/react-transition-group':
specifier: ^4.4.12
- version: 4.4.12(@types/[email protected])
+ version: 4.4.12(@types/[email protected])
'@univerjs-infra/shared':
specifier: workspace:*
version: link:../../common/shared
@@ -3363,6 +3360,9 @@ importers:
'@univerjs/icons':
specifier: ^0.2.14
+ '@wendellhu/redi':
+ specifier: 0.17.1
+ version: 0.17.1
clsx:
specifier: ^2.1.1
version: 2.1.1
@@ -3382,7 +3382,7 @@ importers:
devDependencies:
'@testing-library/react':
specifier: ^16.2.0
'@univerjs-infra/shared':
specifier: workspace:*
version: link:../../common/shared
@@ -4621,7 +4621,7 @@ packages:
'@mdx-js/[email protected]':
resolution: {integrity: sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==}
peerDependencies:
- '@types/react': ^19.0.2
+ '@types/react': ^19.0.8
react: 19.0.0
'@microsoft/[email protected]':
@@ -5240,8 +5240,8 @@ packages:
engines: {node: '>=18'}
peerDependencies:
'@testing-library/dom': ^10.0.0
- '@types/react': ^19.0.2
- '@types/react-dom': ^19.0.2
+ '@types/react': ^19.0.8
+ '@types/react-dom': ^19.0.3
react: 19.0.0
react-dom: 19.0.0
peerDependenciesMeta:
@@ -5370,10 +5370,10 @@ packages:
resolution: {integrity: sha512-+N+2H39P8X+Hy1I5mC6awlTX54k3FhiUmvt7HWzGJZvF+syUAAxP/stwppS8JE84YHqFgRMv6fCy31202CMFxQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-c1s+7TKFaDRRxr1TxccIX2u7sfCnc3RxkVyBIUA2lCpyqCF+QoAwQ/CBg7bsMdVwP120HEH143VQezKtef5nCg==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-0Knk+HJiMP/qOZgMyNFamlIjw9OFCsyC2ZbigmEEyXXixgre6IQpm/4V+r3qH4GC1JPvRJKInw+on2rV6YZLeA==}
peerDependencies:
- '@types/react': ^19.0.2
+ '@types/react': ^19.0.8
resolution: {integrity: sha512-WH/po1gcEcoR6y857yAnPGug+ZhkF4PaTUxgAbwfeSH/QOgVSakKHBXoPGad/sEznmkiaK3pqHk+etdWisoeBQ==}
@@ -5381,10 +5381,10 @@ packages:
resolution: {integrity: sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==}
peerDependencies:
- '@types/react': ^19.0.2
+ '@types/react': ^19.0.8
- '@types/[email protected]':
- resolution: {integrity: sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-9P/o1IGdfmQxrujGbIMDyYaaCykhLKc0NGCtYcECNUr9UAaDe4gwvV9bR6tvd5Br1SG0j+PBpbKr2UYY8CwqSw==}
resolution: {integrity: sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==}
@@ -9702,7 +9702,7 @@ packages:
peerDependencies:
'@types/hoist-non-react-statics': '>= 3.3.1'
'@types/node': '>= 12'
- '@types/react': ^19.0.2
+ '@types/react': ^19.0.8
react: 19.0.0
peerDependenciesMeta:
'@types/hoist-non-react-statics':
@@ -11080,7 +11080,7 @@ packages:
resolution: {integrity: sha512-/BPMyLKJPtFEvVL0E9E9BTUM63MNyhPGlvxk1XjrfWTUlV+BR8jufjsovHzrtR6YNcBEcL7cMHovL1n9xHawEg==}
engines: {node: '>=12.7.0'}
peerDependencies:
- '@types/react': ^19.0.2
+ '@types/react': ^19.0.8
immer: '>=9.0.6'
react: 19.0.0
peerDependenciesMeta:
@@ -12222,10 +12222,10 @@ snapshots:
'@js-sdsl/[email protected]': {}
dependencies:
'@types/mdx': 2.0.13
- '@types/react': 19.0.2
+ '@types/react': 19.0.8
react: 19.0.0
'@microsoft/[email protected](@types/[email protected])':
@@ -12567,9 +12567,9 @@ snapshots:
storybook: 8.5.1([email protected])
ts-dedent: 2.2.0
dependencies:
- '@mdx-js/react': 3.1.0(@types/[email protected])([email protected])
+ '@mdx-js/react': 3.1.0(@types/[email protected])([email protected])
'@storybook/csf-plugin': 8.5.1([email protected]([email protected]))
@@ -12580,12 +12580,12 @@ snapshots:
transitivePeerDependencies:
- '@types/react'
dependencies:
'@storybook/addon-actions': 8.5.1([email protected]([email protected]))
'@storybook/addon-backgrounds': 8.5.1([email protected]([email protected]))
'@storybook/addon-controls': 8.5.1([email protected]([email protected]))
- '@storybook/addon-docs': 8.5.1(@types/[email protected])([email protected]([email protected]))
+ '@storybook/addon-docs': 8.5.1(@types/[email protected])([email protected]([email protected]))
'@storybook/addon-highlight': 8.5.1([email protected]([email protected]))
'@storybook/addon-measure': 8.5.1([email protected]([email protected]))
'@storybook/addon-outline': 8.5.1([email protected]([email protected]))
@@ -12945,15 +12945,15 @@ snapshots:
lodash: 4.17.21
redent: 3.0.0
dependencies:
'@babel/runtime': 7.26.7
'@testing-library/dom': 10.4.0
react: 19.0.0
react-dom: 19.0.0([email protected])
optionalDependencies:
- '@types/react': 19.0.2
- '@types/react-dom': 19.0.2(@types/[email protected])
+ '@types/react': 19.0.8
+ '@types/react-dom': 19.0.3(@types/[email protected])
'@testing-library/[email protected](@testing-library/[email protected])':
dependencies:
@@ -13080,19 +13080,19 @@ snapshots:
'@types/[email protected]': {}
dependencies:
- '@types/react': 19.0.2
+ '@types/react': 19.0.8
dependencies:
- '@types/react': 19.0.2
+ '@types/react': 19.0.8
dependencies:
- '@types/react': 19.0.2
+ '@types/react': 19.0.8
- '@types/[email protected]':
+ '@types/[email protected]':
dependencies:
csstype: 3.1.3
@@ -13534,13 +13534,13 @@ snapshots:
'@xtuc/[email protected]': {}
dependencies:
'@xyflow/system': 0.0.46
classcat: 5.0.5
react: 19.0.0
react-dom: 19.0.0([email protected])
- zustand: 4.5.4(@types/[email protected])([email protected])
+ zustand: 4.5.4(@types/[email protected])([email protected])
transitivePeerDependencies:
- '@types/react'
- immer
@@ -18115,26 +18115,26 @@ snapshots:
dependencies:
dnd-core: 16.0.1
dependencies:
dnd-core: 16.0.1
dnd-multi-backend: 8.1.2([email protected])
react: 19.0.0
- react-dnd: 16.0.1(@types/[email protected])(@types/[email protected])([email protected])
+ react-dnd: 16.0.1(@types/[email protected])(@types/[email protected])([email protected])
react-dom: 19.0.0([email protected])
dependencies:
react: 19.0.0
- react-dnd: 16.0.1(@types/[email protected])(@types/[email protected])([email protected])
+ react-dnd: 16.0.1(@types/[email protected])(@types/[email protected])([email protected])
dependencies:
'@react-dnd/invariant': 4.0.2
dnd-core: 16.0.1
dependencies:
'@react-dnd/invariant': 4.0.2
'@react-dnd/shallowequal': 4.0.2
@@ -18144,7 +18144,7 @@ snapshots:
react: 19.0.0
optionalDependencies:
'@types/node': 22.10.10
- '@types/react': 19.0.2
+ '@types/react': 19.0.8
dependencies:
@@ -18205,7 +18205,7 @@ snapshots:
dependencies:
classnames: 2.5.1
immutability-helper: 3.1.1
@@ -18213,9 +18213,9 @@ snapshots:
prop-types: 15.8.1
rdndmb-html5-to-touch: 8.1.2([email protected])
react: 19.0.0
- react-dnd: 16.0.1(@types/[email protected])(@types/[email protected])([email protected])
+ react-dnd: 16.0.1(@types/[email protected])(@types/[email protected])([email protected])
react-dnd-html5-backend: 16.0.1
react-dnd-touch-backend: 16.0.1
uuid: 9.0.1
transitivePeerDependencies:
@@ -19694,11 +19694,11 @@ snapshots:
dependencies:
use-sync-external-store: 1.2.0([email protected])
optionalDependencies:
- '@types/react': 19.0.2
+ '@types/react': 19.0.8
react: 19.0.0