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
fix(docs): double click trigger defaule value (fs,ff,cl,bg) (#6664)
Roman Sergeevbbb41bb2aa46
diff --git a/packages/docs-ui/src/commands/commands/inline-format.command.ts b/packages/docs-ui/src/commands/commands/inline-format.command.tsindex 20dc04791a..0beddc4a27 100644--- a/packages/docs-ui/src/commands/commands/inline-format.command.ts+++ b/packages/docs-ui/src/commands/commands/inline-format.command.ts@@ -359,7 +359,7 @@ export const SetInlineFormatCommand: ICommand<ISetInlineFormatCommandParams> = {docMenuStyleService.setStyleCache({- [key]: cacheStyle?.[key] !== undefined+ [key]: cacheStyle?.[key] !== undefined && isNeedReverseValue(key)? getReverseFormatValue(cacheStyle,key,@@ -419,6 +419,10 @@ function isTextDecoration(value: unknown | ITextDecoration): value is ITextDecorreturn value !== null && typeof value === 'object';}+function isNeedReverseValue(key: keyof IStyleBase): boolean {+ return !(/fs|ff|cl|bg/.test(key));+}+function getReverseFormatValue(ts: Nullable<ITextStyle>, key: keyof IStyleBase, preCommandId: string) {if (/bl|it/.test(key)) {return ts?.[key] === BooleanNumber.TRUE ? BooleanNumber.FALSE : BooleanNumber.TRUE;