Skip to content

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

fix(sheets-formula-ui): update configuration interface and default config for sheets formula UI (#5447)

白熱7e14a21391c5
diff --git a/packages/sheets-formula-ui/src/controllers/config.schema.ts b/packages/sheets-formula-ui/src/controllers/config.schema.ts
index 0290f07958..6ca59a35d1 100644
--- a/packages/sheets-formula-ui/src/controllers/config.schema.ts
+++ b/packages/sheets-formula-ui/src/controllers/config.schema.ts
@@ -25,11 +25,11 @@ export const PLUGIN_CONFIG_KEY_BASE = 'sheets-formula-ui.base.config';
export const configSymbolBase = Symbol(PLUGIN_CONFIG_KEY_BASE);
-export interface IUniverSheetsFormulaBaseConfig {
+export interface IUniverSheetsFormulaUIConfig {
menu?: MenuConfig;
notExecuteFormula?: boolean;
description?: IFunctionInfo[];
function?: Array<[Ctor<BaseFunction>, IFunctionNames]>;
}
-export const defaultPluginBaseConfig: IUniverSheetsFormulaBaseConfig = {};
+export const defaultPluginConfig: IUniverSheetsFormulaUIConfig = {};
diff --git a/packages/sheets-formula-ui/src/index.ts b/packages/sheets-formula-ui/src/index.ts
index e340f40e49..802a05f16d 100644
--- a/packages/sheets-formula-ui/src/index.ts
+++ b/packages/sheets-formula-ui/src/index.ts
@@ -23,7 +23,7 @@ export { InsertFunctionOperation } from './commands/operations/insert-function.o
export { MoreFunctionsOperation } from './commands/operations/more-functions.operation';
export { ReferenceAbsoluteOperation } from './commands/operations/reference-absolute.operation';
export { SearchFunctionOperation } from './commands/operations/search-function.operation';
-export type { IUniverSheetsFormulaBaseConfig } from './controllers/config.schema';
+export type { IUniverSheetsFormulaUIConfig } from './controllers/config.schema';
export { FormulaReorderController } from './controllers/formula-reorder.controller';
export { UniverSheetsFormulaUIPlugin } from './plugin';
export { FORMULA_PROMPT_ACTIVATED } from './services/prompt.service';
diff --git a/packages/sheets-formula-ui/src/plugin.ts b/packages/sheets-formula-ui/src/plugin.ts
index ed47504491..935708bdf3 100644
--- a/packages/sheets-formula-ui/src/plugin.ts
+++ b/packages/sheets-formula-ui/src/plugin.ts
@@ -15,7 +15,7 @@
*/
import type { Dependency } from '@univerjs/core';
-import type { IUniverSheetsFormulaBaseConfig } from './controllers/config.schema';
+import type { IUniverSheetsFormulaUIConfig } from './controllers/config.schema';
import { DependentOn, IConfigService, Inject, Injector, merge, Plugin, registerDependencies, touchDependencies, UniverInstanceType } from '@univerjs/core';
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
import { IRenderManagerService } from '@univerjs/engine-render';
@@ -24,7 +24,7 @@ import { EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY, RANGE_SELECTOR_COMPONENT_KEY }
import { BuiltInUIPart, ComponentManager, connectInjector, IUIPartsService } from '@univerjs/ui';
import { FORMULA_UI_PLUGIN_NAME } from './common/plugin-name';
import {
- defaultPluginBaseConfig,
+ defaultPluginConfig,
PLUGIN_CONFIG_KEY_BASE,
} from './controllers/config.schema';
import { FormulaAlertRenderController } from './controllers/formula-alert-render.controller';
@@ -50,7 +50,7 @@ export class UniverSheetsFormulaUIPlugin extends Plugin {
static override type = UniverInstanceType.UNIVER_SHEET;
constructor(
- private readonly _config: Partial<IUniverSheetsFormulaBaseConfig> = defaultPluginBaseConfig,
+ private readonly _config: Partial<IUniverSheetsFormulaUIConfig> = defaultPluginConfig,
@Inject(Injector) override readonly _injector: Injector,
@IRenderManagerService private readonly _renderManagerService: IRenderManagerService,
@IConfigService private readonly _configService: IConfigService,
@@ -60,7 +60,7 @@ export class UniverSheetsFormulaUIPlugin extends Plugin {
// Manage the plugin configuration.
const { menu, ...rest } = merge(
- defaultPluginBaseConfig,
+ defaultPluginConfig,
this._config
);
if (menu) {