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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
feat(engine-formula): move register-other-formula-service to engine-formula (#6328)
WEI ZHANG6fd9e3618ffa
diff --git a/packages-experimental/uni-formula-ui/package.json b/packages-experimental/uni-formula-ui/package.jsonindex 70b88eeb24..54131438da 100644--- a/packages-experimental/uni-formula-ui/package.json+++ b/packages-experimental/uni-formula-ui/package.json@@ -70,10 +70,10 @@"@univerjs/design": "workspace:*","@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*",+ "@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*","@univerjs/icons": "^1.0.2","@univerjs/rpc": "workspace:*",- "@univerjs/sheets-formula": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*","@univerjs/slides-ui": "workspace:*","@univerjs/ui": "workspace:*",diff --git a/packages-experimental/uni-formula-ui/src/services/uni-formula.service.ts b/packages-experimental/uni-formula-ui/src/services/uni-formula.service.tsindex 92b0aae567..3f8e4ce612 100644--- a/packages-experimental/uni-formula-ui/src/services/uni-formula.service.ts+++ b/packages-experimental/uni-formula-ui/src/services/uni-formula.service.ts@@ -41,9 +41,9 @@ import {UniverInstanceType,} from '@univerjs/core';import { replaceSelectionFactory } from '@univerjs/docs';+import { OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/engine-formula';import { RichText } from '@univerjs/engine-render';import { DataSyncPrimaryController } from '@univerjs/rpc';-import { OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/sheets-formula';import { CanvasView } from '@univerjs/slides-ui';import { DumbUniFormulaService, IUniFormulaService } from '@univerjs/uni-formula';import { take } from 'rxjs';diff --git a/packages/sheets-formula/src/commands/mutations/formula.mutation.ts b/packages/engine-formula/src/commands/mutations/formula.mutation.tssimilarity index 100%rename from packages/sheets-formula/src/commands/mutations/formula.mutation.tsrename to packages/engine-formula/src/commands/mutations/formula.mutation.tsdiff --git a/packages/engine-formula/src/index.ts b/packages/engine-formula/src/index.tsindex afc08a2155..fee2d8bd0d 100644--- a/packages/engine-formula/src/index.ts+++ b/packages/engine-formula/src/index.ts@@ -49,6 +49,7 @@ export { isReferenceString } from './basics/regex';export { convertUnitDataToRuntime } from './basics/runtime';export { compareToken, matchToken, OPERATOR_TOKEN_SET, operatorToken, prefixToken, SUFFIX_TOKEN_SET } from './basics/token';export { DEFAULT_TOKEN_LAMBDA_FUNCTION_NAME, DEFAULT_TOKEN_LET_FUNCTION_NAME, DEFAULT_TOKEN_TYPE_LAMBDA_PARAMETER, DEFAULT_TOKEN_TYPE_PARAMETER, DEFAULT_TOKEN_TYPE_ROOT } from './basics/token-type';+export { OtherFormulaMarkDirty } from './commands/mutations/formula.mutation';export { RegisterFunctionMutation } from './commands/mutations/register-function.mutation';export { type ISetArrayFormulaDataMutationParams, SetArrayFormulaDataMutation } from './commands/mutations/set-array-formula-data.mutation';export { type ISetDefinedNameMutationParam, type ISetDefinedNameMutationSearchParam, RemoveDefinedNameMutation, SetDefinedNameMutation } from './commands/mutations/set-defined-name.mutation';@@ -189,12 +190,17 @@ export { DependencyManagerService } from './services/dependency-manager.service'export { DependencyManagerBaseService } from './services/dependency-manager.service';export { FeatureCalculationManagerService, IFeatureCalculationManagerService } from './services/feature-calculation-manager.service';export type { IFeatureCalculationManagerParam } from './services/feature-calculation-manager.service';+export type { IFormulaInfo, IOtherFormulaResult } from './services/formula-common';+export { FormulaResultStatus } from './services/formula-common';export { FunctionService } from './services/function.service';export { IFunctionService } from './services/function.service';export { GlobalComputingStatusService } from './services/global-computing-status.service';export { HyperlinkEngineFormulaService, IHyperlinkEngineFormulaService } from './services/hyperlink-engine-formula.service';export { IOtherFormulaManagerService, OtherFormulaManagerService } from './services/other-formula-manager.service';+export { OtherFormulaBizType, RegisterOtherFormulaService } from './services/register-other-formula.service';+export { FormulaExecutedStateType, FormulaExecuteStageType, FormulaRuntimeService, type IAllRuntimeData, type IExecutionInProgressParams, IFormulaRuntimeService } from './services/runtime.service';export { ISheetRowFilteredService, SheetRowFilteredService } from './services/sheet-row-filtered.service';export { ISuperTableService } from './services/super-table.service';+export { SuperTableService } from './services/super-table.service';diff --git a/packages/engine-formula/src/plugin.ts b/packages/engine-formula/src/plugin.tsindex 5140249dba..85817be98d 100644--- a/packages/engine-formula/src/plugin.ts+++ b/packages/engine-formula/src/plugin.ts@@ -54,6 +54,7 @@ import { FunctionService, IFunctionService } from './services/function.service';import { GlobalComputingStatusService } from './services/global-computing-status.service';import { HyperlinkEngineFormulaService, IHyperlinkEngineFormulaService } from './services/hyperlink-engine-formula.service';import { IOtherFormulaManagerService, OtherFormulaManagerService } from './services/other-formula-manager.service';+import { RegisterOtherFormulaService } from './services/register-other-formula.service';import { FormulaRuntimeService, IFormulaRuntimeService } from './services/runtime.service';import { ISheetRowFilteredService, SheetRowFilteredService } from './services/sheet-row-filtered.service';import { ISuperTableService, SuperTableService } from './services/super-table.service';@@ -117,6 +118,7 @@ export class UniverFormulaEnginePlugin extends Plugin {[IFunctionService, { useClass: FunctionService }],[IDefinedNamesService, { useClass: DefinedNamesService }],[IActiveDirtyManagerService, { useClass: ActiveDirtyManagerService }],+ [RegisterOtherFormulaService],[IHyperlinkEngineFormulaService, { useClass: HyperlinkEngineFormulaService }],[ISheetRowFilteredService, { useClass: SheetRowFilteredService }],[ISuperTableService, { useClass: SuperTableService }],diff --git a/packages/sheets-formula/src/services/formula-common.ts b/packages/engine-formula/src/services/formula-common.tssimilarity index 100%rename from packages/sheets-formula/src/services/formula-common.tsrename to packages/engine-formula/src/services/formula-common.tsdiff --git a/packages/sheets-formula/src/services/register-other-formula.service.ts b/packages/engine-formula/src/services/register-other-formula.service.tssimilarity index 94%rename from packages/sheets-formula/src/services/register-other-formula.service.tsrename to packages/engine-formula/src/services/register-other-formula.service.tsindex dca1fadbe0..46c87825ec 100644--- a/packages/sheets-formula/src/services/register-other-formula.service.ts+++ b/packages/engine-formula/src/services/register-other-formula.service.ts@@ -15,13 +15,17 @@*/import type { IRange, Nullable } from '@univerjs/core';-import type { IRemoveOtherFormulaMutationParams, ISetFormulaCalculationResultMutation, ISetOtherFormulaMutationParams } from '@univerjs/engine-formula';+import type { IOtherFormulaMarkDirtyParams } from '../commands/mutations/formula.mutation';+import type { ISetFormulaCalculationResultMutation } from '../commands/mutations/set-formula-calculation.mutation';+import type { IRemoveOtherFormulaMutationParams, ISetOtherFormulaMutationParams } from '../commands/mutations/set-other-formula.mutation';import type { IOtherFormulaResult } from './formula-common';import { Disposable, generateRandomId, ICommandService, Inject, LifecycleService, ObjectMatrix } from '@univerjs/core';-import { IActiveDirtyManagerService, RemoveOtherFormulaMutation, SetFormulaCalculationResultMutation, SetOtherFormulaMutation } from '@univerjs/engine-formula';import { BehaviorSubject, bufferWhen, filter, Subject } from 'rxjs';import { OtherFormulaMarkDirty } from '../commands/mutations/formula.mutation';+import { SetFormulaCalculationResultMutation } from '../commands/mutations/set-formula-calculation.mutation';+import { RemoveOtherFormulaMutation, SetOtherFormulaMutation } from '../commands/mutations/set-other-formula.mutation';+import { IActiveDirtyManagerService } from './active-dirty-manager.service';import { FormulaResultStatus } from './formula-common';export enum OtherFormulaBizType {diff --git a/packages/sheets-conditional-formatting/src/facade/__tests__/create-test-bed.ts b/packages/sheets-conditional-formatting/src/facade/__tests__/create-test-bed.tsindex cd0648aec2..d0076149db 100644--- a/packages/sheets-conditional-formatting/src/facade/__tests__/create-test-bed.ts+++ b/packages/sheets-conditional-formatting/src/facade/__tests__/create-test-bed.ts@@ -33,7 +33,7 @@ import {UniverInstanceType,} from '@univerjs/core';import { FUniver } from '@univerjs/core/facade';-import { ActiveDirtyManagerService, DefinedNamesService, FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService, ISheetRowFilteredService, LexerTreeBuilder, SheetRowFilteredService } from '@univerjs/engine-formula';+import { ActiveDirtyManagerService, DefinedNamesService, FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService, ISheetRowFilteredService, LexerTreeBuilder, RegisterOtherFormulaService, SheetRowFilteredService } from '@univerjs/engine-formula';import { Engine, IRenderingEngine, IRenderManagerService, RenderManagerService } from '@univerjs/engine-render';import {RefRangeService,@@ -42,7 +42,6 @@ import {SheetsSelectionsService,} from '@univerjs/sheets';import { ConditionalFormattingFormulaService, ConditionalFormattingRuleModel, ConditionalFormattingService, ConditionalFormattingViewModel } from '@univerjs/sheets-conditional-formatting';-import { RegisterOtherFormulaService } from '@univerjs/sheets-formula';import enUS from '@univerjs/sheets/locale/en-US';import zhCN from '@univerjs/sheets/locale/zh-CN';diff --git a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/__test__/test.util.ts b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/__test__/test.util.tsindex acd94deef0..b04fedd5dd 100644--- a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/__test__/test.util.ts+++ b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/__test__/test.util.ts@@ -16,9 +16,8 @@import type { Dependency, IWorkbookData } from '@univerjs/core';import { ICommandService, Inject, Injector, IUniverInstanceService, LocaleType, Plugin, Univer, UniverInstanceType } from '@univerjs/core';-import { IActiveDirtyManagerService } from '@univerjs/engine-formula';+import { IActiveDirtyManagerService, RegisterOtherFormulaService } from '@univerjs/engine-formula';import { SheetInterceptorService } from '@univerjs/sheets';-import { RegisterOtherFormulaService } from '@univerjs/sheets-formula';import { AddConditionalRuleMutation } from '../../../commands/mutations/add-conditional-rule.mutation';import { DeleteConditionalRuleMutation } from '../../../commands/mutations/delete-conditional-rule.mutation';import { MoveConditionalRuleMutation } from '../../../commands/mutations/move-conditional-rule.mutation';diff --git a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/color-scale-calculate-unit.ts b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/color-scale-calculate-unit.tsindex a20b7a5664..307f060f76 100644--- a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/color-scale-calculate-unit.ts+++ b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/color-scale-calculate-unit.ts@@ -17,12 +17,14 @@import type { IColorScale, IConditionFormattingRule } from '../type';import type { IContext } from './base-calculate-unit';import { CellValueType, ColorKit, ObjectMatrix, Range } from '@univerjs/core';+import { FormulaResultStatus } from '@univerjs/engine-formula';import { isObject } from '@univerjs/engine-render';-import { FormulaResultStatus } from '@univerjs/sheets-formula';import { CFValueType } from '../../base/const';import { BaseCalculateUnit, CalculateEmitStatus } from './base-calculate-unit';import { filterRange, getColorScaleFromValue, getValueByType, isNullable } from './utils';+;+interface IConfigItem {value: number;color: ColorKit;diff --git a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/data-bar-calculate-unit.ts b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/data-bar-calculate-unit.tsindex 63dd37af92..858191db2e 100644--- a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/data-bar-calculate-unit.ts+++ b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/data-bar-calculate-unit.ts@@ -18,12 +18,14 @@ import type { ICellData } from '@univerjs/core';import type { IConditionFormattingRule, IDataBar } from '../type';import type { IContext } from './base-calculate-unit';import { CellValueType, ObjectMatrix, Range } from '@univerjs/core';-import { FormulaResultStatus } from '@univerjs/sheets-formula';+import { FormulaResultStatus } from '@univerjs/engine-formula';import { CFValueType } from '../../base/const';import { defaultDataBarNativeColor, defaultDataBarPositiveColor, defaultPlaceholderColor } from '../../render/data-bar.render';import { BaseCalculateUnit, CalculateEmitStatus } from './base-calculate-unit';import { filterRange, getValueByType, isNullable } from './utils';+;+const getSafeValue = (v: number) => Math.max(Math.min(100, v), 0);const getValue = (row: number, col: number, getCell: (row: number, col: number) => ICellData) => {diff --git a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/highlight-cell-calculate-unit.ts b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/highlight-cell-calculate-unit.tsindex d862134cb9..0ca4d94ca6 100644--- a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/highlight-cell-calculate-unit.ts+++ b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/highlight-cell-calculate-unit.ts@@ -18,13 +18,14 @@ import type { IStyleData, Nullable } from '@univerjs/core';import type { IAverageHighlightCell, IFormulaHighlightCell, IHighlightCell, INumberHighlightCell, IRankHighlightCell, ITextHighlightCell, ITimePeriodHighlightCell } from '../type';import type { IContext } from './base-calculate-unit';import { CellValueType, dayjs, Range, Tools } from '@univerjs/core';-import { ERROR_TYPE_SET } from '@univerjs/engine-formula';-import { FormulaResultStatus } from '@univerjs/sheets-formula';+import { ERROR_TYPE_SET, FormulaResultStatus } from '@univerjs/engine-formula';import { CFNumberOperator, CFSubRuleType, CFTextOperator, CFTimePeriodOperator } from '../../base/const';import { ConditionalFormattingFormulaService } from '../../services/conditional-formatting-formula.service';import { BaseCalculateUnit, CalculateEmitStatus } from './base-calculate-unit';import { compareWithNumber, getCellValue, isFloatsEqual, isNullable, serialTimeToTimestamp } from './utils';+;+interface IConfig {value: any;type: CFSubRuleType;diff --git a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/icon-set-calculate-unit.ts b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/icon-set-calculate-unit.tsindex 14a016de36..3463afadce 100644--- a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/icon-set-calculate-unit.ts+++ b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/icon-set-calculate-unit.ts@@ -19,11 +19,13 @@ import type { CFNumberOperator } from '../../base/const';import type { IIconSet } from '../type';import type { IContext } from './base-calculate-unit';import { CellValueType, ObjectMatrix, Range } from '@univerjs/core';-import { FormulaResultStatus } from '@univerjs/sheets-formula';+import { FormulaResultStatus } from '@univerjs/engine-formula';import { CFValueType } from '../../base/const';import { BaseCalculateUnit, CalculateEmitStatus } from './base-calculate-unit';import { compareWithNumber, filterRange, getOppositeOperator, getValueByType, isNullable } from './utils';+;+const getValue = (row: number, col: number, getCell: (row: number, col: number) => ICellData) => {const cell = getCell(row, col);if (cell && cell.t === CellValueType.NUMBER) {diff --git a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/utils.ts b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/utils.tsindex f67534e086..a6a04915ba 100644--- a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/utils.ts+++ b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/utils.ts@@ -18,12 +18,13 @@ import type { CellValue, ICellData, IObjectMatrixPrimitiveType, IRange, Nullableimport type { IConditionFormattingRule, IValueConfig } from '../../models/type';import type { IContext } from './base-calculate-unit';import { BooleanNumber, CellValueType, ColorKit, dayjs, ObjectMatrix, Range } from '@univerjs/core';-import { BooleanValue } from '@univerjs/engine-formula';-import { FormulaResultStatus } from '@univerjs/sheets-formula';+import { BooleanValue, FormulaResultStatus } from '@univerjs/engine-formula';import { CFNumberOperator, CFValueType } from '../../base/const';import { ConditionalFormattingFormulaService } from '../../services/conditional-formatting-formula.service';import { ConditionalFormattingViewModel } from '../conditional-formatting-view-model';+;+export function isFloatsEqual(a: number, b: number) {return Math.abs(a - b) < Number.EPSILON;}diff --git a/packages/sheets-conditional-formatting/src/plugin.ts b/packages/sheets-conditional-formatting/src/plugin.tsindex 3c06861a2c..7ab92e39e5 100644--- a/packages/sheets-conditional-formatting/src/plugin.ts+++ b/packages/sheets-conditional-formatting/src/plugin.ts@@ -16,7 +16,8 @@import type { Dependency } from '@univerjs/core';import type { IUniverSheetsConditionalFormattingConfig } from './controllers/config.schema';-import { ICommandService, IConfigService, Inject, Injector, merge, Plugin, touchDependencies, UniverInstanceType } from '@univerjs/core';+import { DependentOn, ICommandService, IConfigService, Inject, Injector, merge, Plugin, touchDependencies, UniverInstanceType } from '@univerjs/core';+import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';import { SHEET_CONDITIONAL_FORMATTING_PLUGIN } from './base/const';import { AddCfCommand } from './commands/commands/add-cf.command';import { ClearRangeCfCommand } from './commands/commands/clear-range-cf.command';@@ -37,6 +38,7 @@ import { ConditionalFormattingViewModel } from './models/conditional-formatting-import { ConditionalFormattingFormulaService } from './services/conditional-formatting-formula.service';import { ConditionalFormattingService } from './services/conditional-formatting.service';+@DependentOn(UniverFormulaEnginePlugin)export class UniverSheetsConditionalFormattingPlugin extends Plugin {static override pluginName = SHEET_CONDITIONAL_FORMATTING_PLUGIN;static override type = UniverInstanceType.UNIVER_SHEET;diff --git a/packages/sheets-conditional-formatting/src/services/conditional-formatting-formula.service.ts b/packages/sheets-conditional-formatting/src/services/conditional-formatting-formula.service.tsindex f8a72f0269..6037c63f1e 100644--- a/packages/sheets-conditional-formatting/src/services/conditional-formatting-formula.service.ts+++ b/packages/sheets-conditional-formatting/src/services/conditional-formatting-formula.service.ts@@ -15,10 +15,10 @@*/import type { ICellData, IRange, Nullable } from '@univerjs/core';-import type { IOtherFormulaResult } from '@univerjs/sheets-formula';+import type { IOtherFormulaResult } from '@univerjs/engine-formula';import type { IConditionalFormattingRuleConfig, IConditionFormattingRule } from '../models/type';import { BooleanNumber, CellValueType, Disposable, Inject, ObjectMatrix, RefAlias } from '@univerjs/core';-import { FormulaResultStatus, OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/sheets-formula';+import { FormulaResultStatus, OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/engine-formula';import { Subject } from 'rxjs';import { CFRuleType, CFSubRuleType, CFValueType } from '../base/const';diff --git a/packages/sheets-data-validation/src/facade/__tests__/create-test-bed.ts b/packages/sheets-data-validation/src/facade/__tests__/create-test-bed.tsindex e2d3ec61df..61a77b17b6 100644--- a/packages/sheets-data-validation/src/facade/__tests__/create-test-bed.ts+++ b/packages/sheets-data-validation/src/facade/__tests__/create-test-bed.ts@@ -31,7 +31,7 @@ import {} from '@univerjs/core';import { FUniver } from '@univerjs/core/facade';import { UniverDataValidationPlugin } from '@univerjs/data-validation';-import { ActiveDirtyManagerService, DefinedNamesService, FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService, ISheetRowFilteredService, LexerTreeBuilder, SheetRowFilteredService } from '@univerjs/engine-formula';+import { ActiveDirtyManagerService, DefinedNamesService, FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService, ISheetRowFilteredService, LexerTreeBuilder, RegisterOtherFormulaService, SheetRowFilteredService } from '@univerjs/engine-formula';import {RefRangeService,SheetInterceptorService,@@ -39,7 +39,6 @@ import {SheetsSelectionsService,} from '@univerjs/sheets';import { DataValidationCacheService, DataValidationCustomFormulaService, DataValidationFormulaService, DataValidationListCacheService, SheetDataValidationModel, SheetsDataValidationValidatorService } from '@univerjs/sheets-data-validation';-import { RegisterOtherFormulaService } from '@univerjs/sheets-formula';import enUS from '@univerjs/sheets/locale/en-US';import zhCN from '@univerjs/sheets/locale/zh-CN';diff --git a/packages/sheets-data-validation/src/facade/__tests__/create-worksheet-test-bed.ts b/packages/sheets-data-validation/src/facade/__tests__/create-worksheet-test-bed.tsindex ae28e21895..a12b5d84aa 100644--- a/packages/sheets-data-validation/src/facade/__tests__/create-worksheet-test-bed.ts+++ b/packages/sheets-data-validation/src/facade/__tests__/create-worksheet-test-bed.ts@@ -31,7 +31,7 @@ import {} from '@univerjs/core';import { FUniver } from '@univerjs/core/facade';import { UniverDataValidationPlugin } from '@univerjs/data-validation';-import { ActiveDirtyManagerService, DefinedNamesService, FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService, ISheetRowFilteredService, LexerTreeBuilder, SheetRowFilteredService } from '@univerjs/engine-formula';+import { ActiveDirtyManagerService, DefinedNamesService, FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService, ISheetRowFilteredService, LexerTreeBuilder, RegisterOtherFormulaService, SheetRowFilteredService } from '@univerjs/engine-formula';import {RefRangeService,@@ -40,7 +40,6 @@ import {SheetsSelectionsService,} from '@univerjs/sheets';import { DataValidationCacheService, DataValidationCustomFormulaService, DataValidationFormulaService, DataValidationListCacheService, SheetDataValidationModel, SheetsDataValidationValidatorService } from '@univerjs/sheets-data-validation';-import { RegisterOtherFormulaService } from '@univerjs/sheets-formula';import enUS from '@univerjs/sheets/locale/en-US';import zhCN from '@univerjs/sheets/locale/zh-CN';diff --git a/packages/sheets-data-validation/src/services/dv-custom-formula.service.ts b/packages/sheets-data-validation/src/services/dv-custom-formula.service.tsindex 949ca5f757..98b2e6f8b9 100644--- a/packages/sheets-data-validation/src/services/dv-custom-formula.service.ts+++ b/packages/sheets-data-validation/src/services/dv-custom-formula.service.ts@@ -17,7 +17,7 @@import type { IRange, ISheetDataValidationRule } from '@univerjs/core';import { Disposable, Inject, isFormulaString, IUniverInstanceService, Rectangle, UniverInstanceType } from '@univerjs/core';import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';-import { OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/sheets-formula';+import { OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/engine-formula';import { getFormulaCellData, shouldOffsetFormulaByRange } from '../utils/formula';import { DataValidationCacheService } from './dv-cache.service';diff --git a/packages/sheets-data-validation/src/services/dv-formula.service.ts b/packages/sheets-data-validation/src/services/dv-formula.service.tsindex 3d3c0ac2f5..0be58f89ec 100644--- a/packages/sheets-data-validation/src/services/dv-formula.service.ts+++ b/packages/sheets-data-validation/src/services/dv-formula.service.ts@@ -15,10 +15,10 @@*/import type { ISheetDataValidationRule, Nullable } from '@univerjs/core';-import type { IFormulaInfo, IOtherFormulaResult } from '@univerjs/sheets-formula';+import type { IFormulaInfo, IOtherFormulaResult } from '@univerjs/engine-formula';import { DataValidationType, Disposable, Inject, isFormulaString, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';-import { OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/sheets-formula';+import { OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/engine-formula';import { shouldOffsetFormulaByRange } from '../utils/formula';import { DataValidationCacheService } from './dv-cache.service';import { DataValidationListCacheService } from './dv-list-cache.service';diff --git a/packages/sheets-data-validation/src/services/dv-list-cache.service.ts b/packages/sheets-data-validation/src/services/dv-list-cache.service.tsindex f4287889fb..d232d5f658 100644--- a/packages/sheets-data-validation/src/services/dv-list-cache.service.ts+++ b/packages/sheets-data-validation/src/services/dv-list-cache.service.ts@@ -15,7 +15,7 @@*/import type { ICellData, IDataValidationRule, Nullable } from '@univerjs/core';-import type { IOtherFormulaResult } from '@univerjs/sheets-formula';+import type { IOtherFormulaResult } from '@univerjs/engine-formula';import { Disposable, Inject, Injector, isFormulaString, numfmt } from '@univerjs/core';import { DataValidationModel } from '@univerjs/data-validation';import { isLegalFormulaResult } from '../utils/formula';diff --git a/packages/sheets-formula/src/controllers/formula.controller.ts b/packages/sheets-formula/src/controllers/formula.controller.tsindex ad6860f05e..1b98fb0ce5 100644--- a/packages/sheets-formula/src/controllers/formula.controller.ts+++ b/packages/sheets-formula/src/controllers/formula.controller.ts@@ -15,9 +15,9 @@*/import { Disposable, ICommandService } from '@univerjs/core';+import { OtherFormulaMarkDirty } from '@univerjs/engine-formula';import { InsertFunctionCommand } from '../commands/commands/insert-function.command';import { QuickSumCommand } from '../commands/commands/quick-sum.command';-import { OtherFormulaMarkDirty } from '../commands/mutations/formula.mutation';export class FormulaController extends Disposable {constructor(diff --git a/packages/sheets-formula/src/controllers/trigger-calculation.controller.ts b/packages/sheets-formula/src/controllers/trigger-calculation.controller.tsindex 2df2bf2604..4624b48a44 100644--- a/packages/sheets-formula/src/controllers/trigger-calculation.controller.ts+++ b/packages/sheets-formula/src/controllers/trigger-calculation.controller.ts@@ -34,6 +34,7 @@ import {FormulaExecutedStateType,FormulaExecuteStageType,IActiveDirtyManagerService,+ RegisterOtherFormulaService,SetFormulaCalculationNotificationMutation,SetFormulaCalculationStartMutation,SetFormulaCalculationStopMutation,@@ -47,7 +48,6 @@ import {SetStyleCommand,} from '@univerjs/sheets';import { BehaviorSubject } from 'rxjs';-import { RegisterOtherFormulaService } from '../services/register-other-formula.service';import { CalculationMode, PLUGIN_CONFIG_KEY_BASE } from './config.schema';/**diff --git a/packages/sheets-formula/src/index.ts b/packages/sheets-formula/src/index.tsindex f5a3e60875..e4e4b8e74c 100644--- a/packages/sheets-formula/src/index.ts+++ b/packages/sheets-formula/src/index.ts@@ -16,7 +16,7 @@export { type IInsertFunction, type IInsertFunctionCommandParams, InsertFunctionCommand } from './commands/commands/insert-function.command';export { QuickSumCommand } from './commands/commands/quick-sum.command';-export { OtherFormulaMarkDirty } from './commands/mutations/formula.mutation';+export { CalculationMode, PLUGIN_CONFIG_KEY_BASE } from './controllers/config.schema';export type { IUniverSheetsFormulaBaseConfig, IUniverSheetsFormulaRemoteConfig } from './controllers/config.schema';export { ImageFormulaCellInterceptorController } from './controllers/image-formula-cell-interceptor.controller';@@ -26,13 +26,11 @@ export { UpdateFormulaController } from './controllers/update-formula.controllerexport { UniverRemoteSheetsFormulaPlugin, UniverSheetsFormulaPlugin } from './plugin';export { DescriptionService, IDescriptionService } from './services/description.service';export type { ISearchItem, ISearchItemWithType } from './services/description.service';-export type { IFormulaInfo, IOtherFormulaResult } from './services/formula-common';-export { FormulaResultStatus } from './services/formula-common';+export { FormulaRefRangeService } from './services/formula-ref-range.service';export type { IRegisterAsyncFunction, IRegisterFunction, ISingleFunctionRegisterParams } from './services/register-function.service';export type { IRegisterFunctionParams, IUnregisterFunctionParams } from './services/register-function.service';export { RegisterFunctionService } from './services/register-function.service';export { IRegisterFunctionService } from './services/register-function.service';-export { OtherFormulaBizType, RegisterOtherFormulaService } from './services/register-other-formula.service';export { IRemoteRegisterFunctionService, RemoteRegisterFunctionService } from './services/remote/remote-register-function.service';export { calculateFormula } from './util/calculate';diff --git a/packages/sheets-formula/src/plugin.ts b/packages/sheets-formula/src/plugin.tsindex 7683600b57..edc61c1602 100644--- a/packages/sheets-formula/src/plugin.ts+++ b/packages/sheets-formula/src/plugin.ts@@ -39,7 +39,6 @@ import { UpdateFormulaController } from './controllers/update-formula.controllerimport { DescriptionService, IDescriptionService } from './services/description.service';import { FormulaRefRangeService } from './services/formula-ref-range.service';import { IRegisterFunctionService, RegisterFunctionService } from './services/register-function.service';-import { RegisterOtherFormulaService } from './services/register-other-formula.service';import { IRemoteRegisterFunctionService, RemoteRegisterFunctionService, RemoteRegisterFunctionServiceName } from './services/remote/remote-register-function.service';@DependentOn(UniverFormulaEnginePlugin)@@ -100,7 +99,6 @@ export class UniverSheetsFormulaPlugin extends Plugin {[IDescriptionService, { useClass: DescriptionService }],[FormulaController],[FormulaRefRangeService],- [RegisterOtherFormulaService],[ArrayFormulaCellInterceptorController],[ImageFormulaCellInterceptorController],[TriggerCalculationController],diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 9b5b4484f6..53a4e3176b 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -822,6 +822,9 @@ importers:'@univerjs/docs-ui':specifier: workspace:*version: link:../../packages/docs-ui+ '@univerjs/engine-formula':+ specifier: workspace:*+ version: link:../../packages/engine-formula'@univerjs/engine-render':specifier: workspace:*version: link:../../packages/engine-render@@ -831,9 +834,6 @@ importers:'@univerjs/rpc':specifier: workspace:*version: link:../../packages/rpc- '@univerjs/sheets-formula':- specifier: workspace:*- version: link:../../packages/sheets-formula'@univerjs/sheets-formula-ui':specifier: workspace:*version: link:../../packages/sheets-formula-ui