From 7e14a21391c5fd36ded5a980a1aa7bf0efe52b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E7=86=B1?= Date: Fri, 27 Jun 2025 15:16:49 +0800 Subject: [PATCH] fix(sheets-formula-ui): update configuration interface and default config for sheets formula UI (#5447) --- .../sheets-formula-ui/src/controllers/config.schema.ts | 4 ++-- packages/sheets-formula-ui/src/index.ts | 2 +- packages/sheets-formula-ui/src/plugin.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) 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, 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 = defaultPluginBaseConfig, + private readonly _config: Partial = 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) {