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: move formula input UI types into sheets data validation UI (#7069)

白熱13ba97faab0a
diff --git a/common/debugger/package.json b/common/debugger/package.json
index 710e8fb2ec..2929346da4 100644
--- a/common/debugger/package.json
+++ b/common/debugger/package.json
@@ -35,7 +35,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/docs-drawing-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/mockdata": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-drawing-ui": "workspace:*",
diff --git a/common/shared/package.json b/common/shared/package.json
index f621b15185..d100a47940 100644
--- a/common/shared/package.json
+++ b/common/shared/package.json
@@ -52,8 +52,8 @@
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
- "@univerjs/icons": "1.11.0",
- "@univerjs/icons-svg": "^1.11.0",
+ "@univerjs/icons": "1.12.0",
+ "@univerjs/icons-svg": "^1.12.0",
"@univerjs/protocol": "workspace:*",
"typescript": "^6.0.3",
"vue-tsc": "^3.3.2"
diff --git a/examples/package.json b/examples/package.json
index 15ae2b2255..a5c663ef38 100644
--- a/examples/package.json
+++ b/examples/package.json
@@ -35,7 +35,7 @@
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"@univerjs/find-replace": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/mockdata": "workspace:*",
"@univerjs/network": "workspace:*",
"@univerjs/preset-docs-core": "workspace:*",
diff --git a/packages/action-recorder/package.json b/packages/action-recorder/package.json
index 3a38326980..8afd1312b5 100644
--- a/packages/action-recorder/package.json
+++ b/packages/action-recorder/package.json
@@ -76,7 +76,7 @@
"dependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-filter": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages/data-validation/src/index.ts b/packages/data-validation/src/index.ts
index 5bf75f4dbf..20db4169b3 100644
--- a/packages/data-validation/src/index.ts
+++ b/packages/data-validation/src/index.ts
@@ -32,7 +32,7 @@ export { TWO_FORMULA_OPERATOR_COUNT } from './types/const/two-formula-operators'
export { UpdateRuleType } from './types/enum/update-rule-type';
export type { IDataValidationDropdownProps } from './types/interfaces/i-data-validation-drop-down';
export type { IDataValidatorOperatorConfig } from './types/interfaces/i-data-validator-operator-config';
-export type { FormulaInputType, IFormulaInputProps, IFormulaValue } from './types/interfaces/i-formula-input';
+export type { IFormulaValue } from './types/interfaces/i-formula-input';
export type { IUpdateRuleOptionsPayload, IUpdateRulePayload, IUpdateRuleRangePayload, IUpdateRuleSettingPayload } from './types/interfaces/i-update-rule-payload';
export { BaseDataValidator } from './validators/base-data-validator';
export type { IFormulaResult, IValidatorCellInfo } from './validators/base-data-validator';
diff --git a/packages/data-validation/src/types/interfaces/i-formula-input.ts b/packages/data-validation/src/types/interfaces/i-formula-input.ts
index d2a091d4d4..b9fa649e5e 100644
--- a/packages/data-validation/src/types/interfaces/i-formula-input.ts
+++ b/packages/data-validation/src/types/interfaces/i-formula-input.ts
@@ -14,22 +14,7 @@
* limitations under the License.
*/
-import type { IFormulaValidResult } from '../../validators/base-data-validator';
-
export interface IFormulaValue {
formula1?: string;
formula2?: string;
}
-
-export interface IFormulaInputProps {
- isTwoFormula?: boolean;
- value?: IFormulaValue;
- onChange?: (value?: IFormulaValue) => void;
- unitId: string;
- subUnitId: string;
- showError?: boolean;
- validResult?: IFormulaValidResult;
- ruleId: string;
-}
-
-export type FormulaInputType = React.ComponentType<IFormulaInputProps>;
diff --git a/packages/design/package.json b/packages/design/package.json
index 954014c8b1..385c989b32 100644
--- a/packages/design/package.json
+++ b/packages/design/package.json
@@ -81,7 +81,7 @@
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-separator": "^1.1.8",
"@radix-ui/react-slot": "^1.2.4",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"react-transition-group": "^4.4.5",
diff --git a/packages/docs-hyper-link-ui/package.json b/packages/docs-hyper-link-ui/package.json
index 59b966a970..00a3b7e6dc 100644
--- a/packages/docs-hyper-link-ui/package.json
+++ b/packages/docs-hyper-link-ui/package.json
@@ -80,7 +80,7 @@
"@univerjs/docs-hyper-link": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/ui": "workspace:*"
},
"devDependencies": {
diff --git a/packages/docs-quick-insert-ui/package.json b/packages/docs-quick-insert-ui/package.json
index 079193712d..8ecbeaa6f7 100644
--- a/packages/docs-quick-insert-ui/package.json
+++ b/packages/docs-quick-insert-ui/package.json
@@ -83,7 +83,7 @@
"@univerjs/drawing": "workspace:*",
"@univerjs/drawing-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/ui": "workspace:*"
},
"devDependencies": {
diff --git a/packages/docs-quick-insert-ui/src/views/QuickInsertMenu.tsx b/packages/docs-quick-insert-ui/src/views/QuickInsertMenu.tsx
index c2c9d8d627..9c277f85c0 100644
--- a/packages/docs-quick-insert-ui/src/views/QuickInsertMenu.tsx
+++ b/packages/docs-quick-insert-ui/src/views/QuickInsertMenu.tsx
@@ -15,7 +15,6 @@
*/
import type { ComponentManager } from '@univerjs/ui';
-import type { MutableRefObject } from 'react';
import type { DocPopupMenu, IDocPopupMenuItem } from '../services/doc-quick-insert-popup.service';
import { borderBottomClassName, borderClassName, clsx, scrollbarClassName, Tooltip } from '@univerjs/design';
import { useEffect, useMemo, useRef } from 'react';
@@ -23,10 +22,9 @@ import { useEffect, useMemo, useRef } from 'react';
interface IQuickInsertMenuProps {
menus: DocPopupMenu[];
focusedMenuIndex: number;
- focusedMenuRef: MutableRefObject<IDocPopupMenuItem | null>;
- menuNodeMapRef: MutableRefObject<Map<string, HTMLElement>>;
componentManager: ComponentManager;
onFocusedMenuIndexChange: (index: number) => void;
+ onFocusedMenuChange: (menu: IDocPopupMenuItem | null) => void;
onSelect: (menu: IDocPopupMenuItem) => void;
}
@@ -52,21 +50,21 @@ export function QuickInsertMenu(props: IQuickInsertMenuProps) {
const {
menus,
focusedMenuIndex,
- focusedMenuRef,
- menuNodeMapRef,
componentManager,
onFocusedMenuIndexChange,
+ onFocusedMenuChange,
onSelect,
} = props;
const flatMenus = useMemo(() => flattenMenuItems(menus), [menus]);
+ const menuNodeMapRef = useRef(new Map<string, HTMLElement>());
useEffect(() => {
const focusedMenu = Number.isNaN(focusedMenuIndex)
? null
: flatMenus[focusedMenuIndex] ?? null;
- focusedMenuRef.current = focusedMenu;
+ onFocusedMenuChange(focusedMenu);
if (!focusedMenu) {
return;
@@ -75,7 +73,15 @@ export function QuickInsertMenu(props: IQuickInsertMenuProps) {
menuNodeMapRef.current.get(focusedMenu.id)?.scrollIntoView({
block: 'nearest',
});
- }, [flatMenus, focusedMenuIndex, focusedMenuRef, menuNodeMapRef]);
+ }, [flatMenus, focusedMenuIndex, onFocusedMenuChange]);
+
+ useEffect(() => {
+ const menuNodeMap = menuNodeMapRef.current;
+
+ return () => {
+ menuNodeMap.clear();
+ };
+ }, []);
const itemIndexRef = useRef(0);
itemIndexRef.current = 0;
diff --git a/packages/docs-quick-insert-ui/src/views/QuickInsertPopup.tsx b/packages/docs-quick-insert-ui/src/views/QuickInsertPopup.tsx
index 4a2a8916fc..65f6c4198f 100644
--- a/packages/docs-quick-insert-ui/src/views/QuickInsertPopup.tsx
+++ b/packages/docs-quick-insert-ui/src/views/QuickInsertPopup.tsx
@@ -17,7 +17,7 @@
import type { DocPopupMenu, IDocPopupMenuItem } from '../services/doc-quick-insert-popup.service';
import { CommandType, Direction, DisposableCollection, generateRandomId, ICommandService, LocaleService, toDisposable } from '@univerjs/core';
import { ComponentManager, IShortcutService, KeyCode, useDependency, useObservable } from '@univerjs/ui';
-import { useEffect, useMemo, useRef, useState } from 'react';
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { CloseQuickInsertPopupOperation } from '../commands/operations/quick-insert-popup.operation';
import { DocQuickInsertPopupService } from '../services/doc-quick-insert-popup.service';
import { getQuickInsertMenuLeafCount, QuickInsertMenu } from './QuickInsertMenu';
@@ -109,6 +109,10 @@ export const QuickInsertPopup = () => {
commandService.executeCommand(CloseQuickInsertPopupOperation.id);
};
+ const handleFocusedMenuChange = useCallback((menu: IDocPopupMenuItem | null) => {
+ focusedMenuRef.current = menu;
+ }, []);
+
useEffect(() => {
/** Use up or down to navigate the focused menu instead of moving the cursor in documents. */
const disposableCollection = new DisposableCollection();
@@ -209,14 +213,6 @@ export const QuickInsertPopup = () => {
setFocusedMenuIndex(0);
}, [filteredMenus]);
- const menuNodeMapRef = useRef<Map<string, HTMLElement>>(new Map());
-
- useEffect(() => {
- return () => {
- menuNodeMapRef.current.clear();
- };
- }, []);
-
const hasMenus = filteredMenus.length > 0;
const Placeholder = currentPopup?.popup.Placeholder || componentManager.get(QuickInsertPlaceholder.componentKey);
@@ -228,10 +224,9 @@ export const QuickInsertPopup = () => {
<QuickInsertMenu
menus={filteredMenus}
focusedMenuIndex={focusedMenuIndex}
- focusedMenuRef={focusedMenuRef}
- menuNodeMapRef={menuNodeMapRef}
componentManager={componentManager}
onFocusedMenuIndexChange={setFocusedMenuIndex}
+ onFocusedMenuChange={handleFocusedMenuChange}
onSelect={handleMenuSelect}
/>
)
diff --git a/packages/docs-thread-comment-ui/package.json b/packages/docs-thread-comment-ui/package.json
index 8e53d98af0..a43a8af692 100644
--- a/packages/docs-thread-comment-ui/package.json
+++ b/packages/docs-thread-comment-ui/package.json
@@ -78,7 +78,7 @@
"@univerjs/docs": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/thread-comment": "workspace:*",
"@univerjs/thread-comment-ui": "workspace:*",
"@univerjs/ui": "workspace:*"
diff --git a/packages/docs-ui/package.json b/packages/docs-ui/package.json
index b1693cb91d..8cca627686 100644
--- a/packages/docs-ui/package.json
+++ b/packages/docs-ui/package.json
@@ -90,7 +90,7 @@
"@univerjs/docs": "workspace:*",
"@univerjs/drawing": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/ui": "workspace:*"
},
"devDependencies": {
diff --git a/packages/drawing-ui/package.json b/packages/drawing-ui/package.json
index 4c601c1ce6..38880d9867 100644
--- a/packages/drawing-ui/package.json
+++ b/packages/drawing-ui/package.json
@@ -78,7 +78,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/drawing": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/ui": "workspace:*"
},
"devDependencies": {
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 50e652756c..45d6364d4b 100644
--- a/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx
+++ b/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx
@@ -15,10 +15,17 @@
*/
import type { DocumentDataModel } from '@univerjs/core';
-import type * as React from 'react';
-import { BooleanNumber, ICommandService, IUniverInstanceService, LocaleService, PositionedObjectLayoutType, UniverInstanceType } from '@univerjs/core';
+import type { ReactNode } from 'react';
+import {
+ BooleanNumber,
+ ICommandService,
+ IUniverInstanceService,
+ LocaleService,
+ PositionedObjectLayoutType,
+ UniverInstanceType,
+} from '@univerjs/core';
import { borderClassName, clsx, Dropdown, DropdownMenu, Tooltip } from '@univerjs/design';
-import { AutofillDoubleIcon, DeleteIcon, DocSettingIcon, MoreDownIcon } from '@univerjs/icons';
+import { AutofillDoubleIcon, CropIcon, DeleteIcon, DocSettingIcon, MoreDownIcon, TextWrapShapeIcon } from '@univerjs/icons';
import { useDependency } from '@univerjs/ui';
import { useState } from 'react';
@@ -151,7 +158,7 @@ interface IDocImageFloatingToolbarProps {
interface IToolbarDropdownOption<T extends string | number> {
label: string;
value: T;
- icon: React.ReactNode;
+ icon: ReactNode;
}
function getWrappingStyle(documentDataModel: DocumentDataModel | undefined, drawingId: string): TextWrappingStyle {
@@ -186,7 +193,7 @@ function Divider() {
);
}
-function ToolbarGroup(props: { children: React.ReactNode }) {
+function ToolbarGroup(props: { children: ReactNode }) {
return (
<div className="univer-flex univer-h-7 univer-items-center univer-gap-1 univer-px-1">
{props.children}
@@ -194,7 +201,7 @@ function ToolbarGroup(props: { children: React.ReactNode }) {
);
}
-function ToolbarButton(props: { title: string; active?: boolean; disabled?: boolean; children: React.ReactNode; onClick: () => void }) {
+function ToolbarButton(props: { title: string; active?: boolean; disabled?: boolean; children: ReactNode; onClick: () => void }) {
return (
<Tooltip title={props.title} placement="bottom">
<button
@@ -219,30 +226,6 @@ function ToolbarButton(props: { title: string; active?: boolean; disabled?: bool
);
}
-function TextWrapShapeIcon() {
- return (
- <svg viewBox="0 0 20 20" width="1em" height="1em" fill="none" aria-hidden="true">
- <path d="M2.5 4.5H8.2" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />
- <path d="M11.8 4.5H17.5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />
- <path d="M2.5 10H5.7" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />
- <path d="M14.3 10H17.5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />
- <path d="M2.5 15.5H8.2" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />
- <path d="M11.8 15.5H17.5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />
- <rect x="6.8" y="7" width="6.4" height="6" rx="1" stroke="currentColor" strokeWidth="1.4" />
- </svg>
- );
-}
-
-function CropIcon() {
- return (
- <svg viewBox="0 0 20 20" width="1em" height="1em" fill="none" aria-hidden="true">
- <path d="M5 2.8V12.5C5 13.9 6.1 15 7.5 15H17.2" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
- <path d="M2.8 5H12.5C13.9 5 15 6.1 15 7.5V17.2" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
- <path d="M8.3 8.3H11.7V11.7H8.3V8.3Z" stroke="currentColor" strokeWidth="1.2" />
- </svg>
- );
-}
-
function ToolbarDropdownButton<T extends string | number>(props: {
title: string;
value: T;
diff --git a/packages/find-replace/package.json b/packages/find-replace/package.json
index 87eeaf7fd6..645bdb729d 100644
--- a/packages/find-replace/package.json
+++ b/packages/find-replace/package.json
@@ -77,7 +77,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/ui": "workspace:*"
},
"devDependencies": {
diff --git a/packages/sheets-conditional-formatting-ui/package.json b/packages/sheets-conditional-formatting-ui/package.json
index e3ff3f8e88..f884c7288b 100644
--- a/packages/sheets-conditional-formatting-ui/package.json
+++ b/packages/sheets-conditional-formatting-ui/package.json
@@ -78,7 +78,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-conditional-formatting": "workspace:*",
"@univerjs/sheets-formula": "workspace:*",
diff --git a/packages/sheets-conditional-formatting/package.json b/packages/sheets-conditional-formatting/package.json
index 3738ae36ea..69f1439abe 100644
--- a/packages/sheets-conditional-formatting/package.json
+++ b/packages/sheets-conditional-formatting/package.json
@@ -92,7 +92,7 @@
},
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
- "@univerjs/icons-svg": "^1.11.0",
+ "@univerjs/icons-svg": "^1.12.0",
"@univerjs/sheets-formula": "workspace:*",
"rxjs": "^7.8.2",
"typescript": "^6.0.3",
diff --git a/packages/sheets-conditional-formatting/scripts/build-icons.mts b/packages/sheets-conditional-formatting/scripts/build-icons.mts
index f3078ce571..da7a0a39f5 100644
--- a/packages/sheets-conditional-formatting/scripts/build-icons.mts
+++ b/packages/sheets-conditional-formatting/scripts/build-icons.mts
@@ -17,11 +17,11 @@
import fs from 'node:fs';
const progress = [
- ['progress0', '@univerjs/icons-svg/single/progress-0-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
- ['progress25', '@univerjs/icons-svg/single/progress-25-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
- ['progress50', '@univerjs/icons-svg/single/progress-50-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
- ['progress75', '@univerjs/icons-svg/single/progress-75-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
- ['progress100', '@univerjs/icons-svg/single/progress-100-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
+ ['progress0', '@univerjs/icons-svg/double/progress-0-double-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
+ ['progress25', '@univerjs/icons-svg/double/progress-25-double-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
+ ['progress50', '@univerjs/icons-svg/double/progress-50-double-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
+ ['progress75', '@univerjs/icons-svg/double/progress-75-double-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
+ ['progress100', '@univerjs/icons-svg/double/progress-100-double-icon.svg', { black: '#7A7A7A', '#E5E5E5': '#7A7A7A' }],
];
const star = [
diff --git a/packages/sheets-crosshair-highlight/package.json b/packages/sheets-crosshair-highlight/package.json
index 50a3f2596d..44a193657d 100644
--- a/packages/sheets-crosshair-highlight/package.json
+++ b/packages/sheets-crosshair-highlight/package.json
@@ -88,7 +88,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/ui": "workspace:*"
diff --git a/packages/sheets-data-validation-ui/package.json b/packages/sheets-data-validation-ui/package.json
index 4b9c535026..0d19ca139f 100644
--- a/packages/sheets-data-validation-ui/package.json
+++ b/packages/sheets-data-validation-ui/package.json
@@ -80,7 +80,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-data-validation": "workspace:*",
"@univerjs/sheets-formula-ui": "workspace:*",
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/BaseFormulaInput.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/BaseFormulaInput.tsx
index 52c97e67e6..426d70b0c9 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/BaseFormulaInput.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/BaseFormulaInput.tsx
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import type { IFormulaInputProps } from '@univerjs/data-validation';
+import type { IFormulaInputProps } from './interface';
import { LocaleService } from '@univerjs/core';
import { FormLayout, Input } from '@univerjs/design';
import { useDependency } from '@univerjs/ui';
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/CheckboxFormulaInput.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/CheckboxFormulaInput.tsx
index 827f959bad..541bb0585b 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/CheckboxFormulaInput.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/CheckboxFormulaInput.tsx
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import type { IFormulaInputProps } from '@univerjs/data-validation';
+import type { IFormulaInputProps } from './interface';
import { LocaleService } from '@univerjs/core';
import { Checkbox, FormLayout, Input } from '@univerjs/design';
import { useDependency } from '@univerjs/ui';
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/CustomFormulaInput.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/CustomFormulaInput.tsx
index 9774831b78..426f6299c9 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/CustomFormulaInput.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/CustomFormulaInput.tsx
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import type { IFormulaInputProps } from '@univerjs/data-validation';
import type { IFormulaEditorRef } from '@univerjs/sheets-formula-ui';
+import type { IFormulaInputProps } from './interface';
import { borderClassName, clsx, FormLayout } from '@univerjs/design';
import { FormulaEditor } from '@univerjs/sheets-formula-ui';
import { useSidebarClick } from '@univerjs/ui';
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/ListFormulaInput.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/ListFormulaInput.tsx
index 5c44188267..210cf9d076 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/ListFormulaInput.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/ListFormulaInput.tsx
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import type { IFormulaInputProps } from '@univerjs/data-validation';
import type { ListValidator } from '@univerjs/sheets-data-validation';
import type { IFormulaEditorRef } from '@univerjs/sheets-formula-ui';
+import type { IFormulaInputProps } from './interface';
import { awaitTime, DataValidationType, generateRandomId, isFormulaString, LocaleService } from '@univerjs/core';
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
import { borderClassName, clsx, DraggableList, Dropdown, FormLayout, Input, Radio, RadioGroup } from '@univerjs/design';
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/formula-input.ts b/packages/sheets-data-validation-ui/src/views/components/formula-input/formula-input.ts
index cf2819ca5a..20738e5359 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/formula-input.ts
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/formula-input.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import type { FormulaInputType } from '@univerjs/data-validation';
+import type { FormulaInputType } from './interface';
import { BaseFormulaInput } from './BaseFormulaInput';
import { ListFormulaInput } from './ListFormulaInput';
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/index.ts b/packages/sheets-data-validation-ui/src/views/components/formula-input/index.ts
index 992710c91f..987d9d760f 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/index.ts
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/index.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import type { FormulaInputType } from '@univerjs/data-validation';
+import type { FormulaInputType } from './interface';
import {
BASE_FORMULA_INPUT_NAME,
CHECKBOX_FORMULA_INPUT_NAME,
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/interface.ts b/packages/sheets-data-validation-ui/src/views/components/formula-input/interface.ts
new file mode 100644
index 0000000000..2cdf121728
--- /dev/null
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/interface.ts
@@ -0,0 +1,31 @@
+/**
+ * Copyright 2023-present DreamNum Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type { IFormulaValidResult, IFormulaValue } from '@univerjs/data-validation';
+import type { ComponentType } from 'react';
+
+export interface IFormulaInputProps {
+ isTwoFormula?: boolean;
+ value?: IFormulaValue;
+ onChange?: (value?: IFormulaValue) => void;
+ unitId: string;
+ subUnitId: string;
+ showError?: boolean;
+ validResult?: IFormulaValidResult;
+ ruleId: string;
+}
+
+export type FormulaInputType = ComponentType<IFormulaInputProps>;
diff --git a/packages/sheets-filter-ui/package.json b/packages/sheets-filter-ui/package.json
index cb12b38758..cc4c7474f3 100644
--- a/packages/sheets-filter-ui/package.json
+++ b/packages/sheets-filter-ui/package.json
@@ -77,7 +77,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/rpc": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-filter": "workspace:*",
diff --git a/packages/sheets-formula-ui/package.json b/packages/sheets-formula-ui/package.json
index ed78a6e031..ac9c007479 100644
--- a/packages/sheets-formula-ui/package.json
+++ b/packages/sheets-formula-ui/package.json
@@ -91,7 +91,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-formula": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
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 3fb11bbb17..e25d24e017 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
@@ -82,7 +82,7 @@ export const useSheetSelectionChange = (
isSelectingRef: RefObject<FormulaSelectingType>,
unitId: string,
subUnitId: string,
- refSelectionRef: React.MutableRefObject<IRefSelection[]>,
+ getRefSelections: () => IRefSelection[],
isSupportAcrossSheet: boolean,
listenSelectionSet: boolean,
editor?: Editor,
@@ -380,7 +380,7 @@ export const useSheetSelectionChange = (
calcHighlightRanges({
unitId,
subUnitId,
- refSelections: refSelectionRef.current,
+ refSelections: getRefSelections(),
editor,
refSelectionsService,
refSelectionsRenderService,
@@ -392,5 +392,5 @@ export const useSheetSelectionChange = (
});
return () => sub.unsubscribe();
- }, [docSelectionManagerService.textSelection$, editor, refSelectionRef, refSelectionsRenderService, refSelectionsService, sheetSkeletonManagerService, subUnitId, themeService, unitId, univerInstanceService]);
+ }, [docSelectionManagerService.textSelection$, editor, getRefSelections, refSelectionsRenderService, refSelectionsService, sheetSkeletonManagerService, subUnitId, themeService, unitId, univerInstanceService]);
};
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 944b2884df..0adf268eca 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/index.tsx
+++ b/packages/sheets-formula-ui/src/views/formula-editor/index.tsx
@@ -160,6 +160,7 @@ export const FormulaEditor = forwardRef((props: IFormulaEditorProps, ref: Ref<IF
const currentDoc = useObservable(currentDoc$);
const docFocusing = currentDoc?.getUnitId() === editorId;
const refSelections = useRef([] as IRefSelection[]);
+ const getRefSelections = useEvent(() => refSelections.current);
const selectingMode = isSelecting;
// whether to hide formula search and help popup
@@ -339,7 +340,7 @@ export const FormulaEditor = forwardRef((props: IFormulaEditorProps, ref: Ref<IF
isSelectingRef,
unitId,
subUnitId,
- refSelections,
+ getRefSelections,
isSupportAcrossSheet,
Boolean(selectingMode),
editor,
diff --git a/packages/sheets-hyper-link-ui/package.json b/packages/sheets-hyper-link-ui/package.json
index 0b93d0c48b..43de85c709 100644
--- a/packages/sheets-hyper-link-ui/package.json
+++ b/packages/sheets-hyper-link-ui/package.json
@@ -91,7 +91,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-data-validation": "workspace:*",
"@univerjs/sheets-formula-ui": "workspace:*",
diff --git a/packages/sheets-hyper-link-ui/src/services/side-panel.service.ts b/packages/sheets-hyper-link-ui/src/services/side-panel.service.ts
index a500205d54..bf186ff7a3 100644
--- a/packages/sheets-hyper-link-ui/src/services/side-panel.service.ts
+++ b/packages/sheets-hyper-link-ui/src/services/side-panel.service.ts
@@ -23,8 +23,9 @@ export interface ICustomHyperLinkFormProps {
linkId: string;
payload: string;
display: string;
- setByPayload: React.MutableRefObject<boolean>;
+ getIsDisplaySyncedWithPayload: () => boolean;
showError: boolean;
+ setDisplaySyncedWithPayload: (synced: boolean) => void;
setDisplay: (display: string) => void;
setPayload: (payload: string) => void;
}
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 f2338b8fe4..3c07b2b46d 100644
--- a/packages/sheets-hyper-link-ui/src/views/CellLinkEdit/index.tsx
+++ b/packages/sheets-hyper-link-ui/src/views/CellLinkEdit/index.tsx
@@ -87,7 +87,11 @@ export const CellLinkEdit = () => {
const [isFocusRangeSelector, setIsFocusRangeSelector] = useState(false);
- const setByPayload = useRef(false);
+ const isDisplaySyncedWithPayloadRef = useRef(false);
+ const getIsDisplaySyncedWithPayload = useEvent(() => isDisplaySyncedWithPayloadRef.current);
+ const setDisplaySyncedWithPayload = useEvent((synced: boolean) => {
+ isDisplaySyncedWithPayloadRef.current = synced;
+ });
const workbook = univerInstanceService.getCurrentUnitOfType<Workbook>(UniverInstanceType.UNIVER_SHEET);
@@ -166,7 +170,7 @@ export const CellLinkEdit = () => {
case SheetHyperLinkType.URL: {
setPayload(linkInfo.url);
if (linkInfo.url === link.display) {
- setByPayload.current = true;
+ setDisplaySyncedWithPayload(true);
}
break;
}
@@ -182,7 +186,7 @@ export const CellLinkEdit = () => {
const payload = (serializeRangeWithSheet(sheetName, deserializeRangeWithSheet(params.range!).range));
setPayload(payload);
if (payload === link.display) {
- setByPayload.current = true;
+ setDisplaySyncedWithPayload(true);
}
break;
}
@@ -340,9 +344,9 @@ export const CellLinkEdit = () => {
setPayload(newPayload);
- if (newPayload && (setByPayload.current || !display)) {
+ if (newPayload && (getIsDisplaySyncedWithPayload() || !display)) {
setDisplay(newPayload);
- setByPayload.current = true;
+ setDisplaySyncedWithPayload(true);
}
});
@@ -424,7 +428,7 @@ export const CellLinkEdit = () => {
value={display}
onChange={(v) => {
setDisplay(v);
- setByPayload.current = false;
+ setDisplaySyncedWithPayload(false);
}}
placeholder={localeService.t('sheets-hyper-link-ui.form.labelPlaceholder')}
autoFocus
@@ -456,9 +460,9 @@ export const CellLinkEdit = () => {
value={payload}
onChange={(newLink) => {
setPayload(newLink);
- if (newLink && (setByPayload.current || !display || display === newLink)) {
+ if (newLink && (getIsDisplaySyncedWithPayload() || !display || display === newLink)) {
setDisplay(newLink);
- setByPayload.current = true;
+ setDisplaySyncedWithPayload(true);
}
}}
placeholder={localeService.t('sheets-hyper-link-ui.form.linkPlaceholder')}
@@ -508,9 +512,9 @@ export const CellLinkEdit = () => {
setPayload(newPayload);
const label = sheetsOption.find((i) => i.value === newPayload)?.label;
const oldLabel = sheetsOption.find((i) => i.value === payload)?.label;
- if (label && (setByPayload.current || !display || display === oldLabel)) {
+ if (label && (getIsDisplaySyncedWithPayload() || !display || display === oldLabel)) {
setDisplay(label);
- setByPayload.current = true;
+ setDisplaySyncedWithPayload(true);
}
}}
/>
@@ -526,9 +530,9 @@ export const CellLinkEdit = () => {
setPayload(newValue);
const label = definedNames.find((i) => i.value === newValue)?.label;
const oldLabel = definedNames.find((i) => i.value === payload)?.label;
- if (label && (setByPayload.current || !display || display === oldLabel)) {
+ if (label && (getIsDisplaySyncedWithPayload() || !display || display === oldLabel)) {
setDisplay(label);
- setByPayload.current = true;
+ setDisplaySyncedWithPayload(true);
}
}}
/>
@@ -540,10 +544,11 @@ export const CellLinkEdit = () => {
payload={payload}
display={display}
showError={showError}
- setByPayload={setByPayload}
+ getIsDisplaySyncedWithPayload={getIsDisplaySyncedWithPayload}
+ setDisplaySyncedWithPayload={setDisplaySyncedWithPayload}
setDisplay={(newLink) => {
setDisplay(newLink);
- setByPayload.current = true;
+ setDisplaySyncedWithPayload(true);
}}
setPayload={setPayload}
/>
diff --git a/packages/sheets-note-ui/package.json b/packages/sheets-note-ui/package.json
index 74ecbe5926..4973de8e51 100644
--- a/packages/sheets-note-ui/package.json
+++ b/packages/sheets-note-ui/package.json
@@ -74,7 +74,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-note": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages/sheets-numfmt-ui/package.json b/packages/sheets-numfmt-ui/package.json
index 90d52b8a90..169f44aa01 100644
--- a/packages/sheets-numfmt-ui/package.json
+++ b/packages/sheets-numfmt-ui/package.json
@@ -78,7 +78,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-numfmt": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages/sheets-numfmt-ui/src/views/components/Accounting.tsx b/packages/sheets-numfmt-ui/src/views/components/Accounting.tsx
index 14d31b4271..4b2f93ac99 100644
--- a/packages/sheets-numfmt-ui/src/views/components/Accounting.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/Accounting.tsx
@@ -20,7 +20,7 @@ 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 { useContext, useMemo, useState } from 'react';
+import { useContext, useLayoutEffect, useMemo, useState } from 'react';
import { UserHabitCurrencyContext } from '../../controllers/user-habit.controller';
export const isAccountingPanel = (pattern: string) => {
@@ -29,7 +29,7 @@ export const isAccountingPanel = (pattern: string) => {
};
export const AccountingPanel: FC<IBusinessComponentProps> = (props) => {
- const { defaultPattern, action, onChange } = props;
+ const { defaultPattern, onActionChange, onChange } = props;
const [decimal, setDecimal] = useState(() => getDecimalFromPattern(defaultPattern || '', 2));
const userHabitCurrency = useContext(UserHabitCurrencyContext);
@@ -38,7 +38,9 @@ export const AccountingPanel: FC<IBusinessComponentProps> = (props) => {
const localeService = useDependency(LocaleService);
- action.current = () => setPatternDecimal(`_("${suffix}"* #,##0${decimal > 0 ? '.0' : ''}_)`, decimal);
+ useLayoutEffect(() => {
+ onActionChange(() => setPatternDecimal(`_("${suffix}"* #,##0${decimal > 0 ? '.0' : ''}_)`, decimal));
+ }, [decimal, onActionChange, suffix]);
const handleSelect = (v: string) => {
setSuffix(v);
diff --git a/packages/sheets-numfmt-ui/src/views/components/Currency.tsx b/packages/sheets-numfmt-ui/src/views/components/Currency.tsx
index 6940a787a1..bdd0757666 100644
--- a/packages/sheets-numfmt-ui/src/views/components/Currency.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/Currency.tsx
@@ -20,7 +20,7 @@ import { isPatternEqualWithoutDecimal, LocaleService } from '@univerjs/core';
import { InputNumber, Select, SelectList } from '@univerjs/design';
import { getCurrencyFormatOptions, getCurrencyType, getDecimalFromPattern, setPatternDecimal } from '@univerjs/sheets-numfmt';
import { useDependency } from '@univerjs/ui';
-import { useContext, useMemo, useState } from 'react';
+import { useContext, useLayoutEffect, useMemo, useState } from 'react';
import { UserHabitCurrencyContext } from '../../controllers/user-habit.controller';
export const isCurrencyPanel = (pattern: string) => {
@@ -29,6 +29,7 @@ export const isCurrencyPanel = (pattern: string) => {
};
export const CurrencyPanel: FC<IBusinessComponentProps> = (props) => {
+ const { onActionChange, onChange: onValueChange } = props;
const localeService = useDependency(LocaleService);
const userHabitCurrency = useContext(UserHabitCurrencyContext);
const [suffix, setSuffix] = useState(() => getCurrencyType(props.defaultPattern) || userHabitCurrency[0]);
@@ -44,7 +45,9 @@ export const CurrencyPanel: FC<IBusinessComponentProps> = (props) => {
const negativeOptions = useMemo(() => getCurrencyFormatOptions(suffix), [suffix]);
const options = useMemo(() => userHabitCurrency.map((key) => ({ label: key, value: key })), [userHabitCurrency]);
- props.action.current = () => setPatternDecimal(pattern, decimal);
+ useLayoutEffect(() => {
+ onActionChange(() => setPatternDecimal(pattern, decimal));
+ }, [decimal, onActionChange, pattern]);
const onSelect = (value: string) => {
if (value === undefined) {
@@ -53,7 +56,7 @@ export const CurrencyPanel: FC<IBusinessComponentProps> = (props) => {
setSuffix(value);
const pattern = getCurrencyFormatOptions(value)[0].value;
setPattern(pattern);
- props.onChange(setPatternDecimal(pattern, decimal));
+ onValueChange(setPatternDecimal(pattern, decimal));
};
const onChange = (value: any) => {
@@ -61,12 +64,12 @@ export const CurrencyPanel: FC<IBusinessComponentProps> = (props) => {
return;
}
setPattern(value);
- props.onChange(setPatternDecimal(value, decimal));
+ onValueChange(setPatternDecimal(value, decimal));
};
const onDecimalChange = (v: number | null) => {
setDecimal(v || 0);
- props.onChange(setPatternDecimal(pattern, v || 0));
+ onValueChange(setPatternDecimal(pattern, v || 0));
};
return (
diff --git a/packages/sheets-numfmt-ui/src/views/components/CustomFormat.tsx b/packages/sheets-numfmt-ui/src/views/components/CustomFormat.tsx
index 4d94f9085e..992d5e2905 100644
--- a/packages/sheets-numfmt-ui/src/views/components/CustomFormat.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/CustomFormat.tsx
@@ -20,27 +20,29 @@ import { borderClassName, clsx, Input } from '@univerjs/design';
import { CheckMarkIcon } from '@univerjs/icons';
import { CURRENCYFORMAT, DATEFMTLISG, NUMBERFORMAT } from '@univerjs/sheets-numfmt';
import { useDependency } from '@univerjs/ui';
-import { useEffect, useState } from 'react';
+import { useEffect, useLayoutEffect, useState } from 'react';
import { UserHabitController } from '../../controllers/user-habit.controller';
const key = 'customFormat';
const historyPatternKey = 'numfmt_custom_pattern';
export function CustomFormat(props: IBusinessComponentProps) {
- const { defaultPattern, action, onChange } = props;
+ const { defaultPattern, onActionChange, onChange } = props;
const userHabitController = useDependency(UserHabitController);
const localStorageService = useDependency(ILocalStorageService);
const localeService = useDependency(LocaleService);
const [pattern, setPattern] = useState(defaultPattern);
- action.current = () => {
- userHabitController.markHabit(key, pattern);
- localStorageService.getItem<string[]>(historyPatternKey).then((list = []) => {
- const _list = [...new Set([pattern, ...(list || [])])].splice(0, 10).filter((e) => !!e);
- localStorageService.setItem(historyPatternKey, _list);
+ useLayoutEffect(() => {
+ onActionChange(() => {
+ userHabitController.markHabit(key, pattern);
+ localStorageService.getItem<string[]>(historyPatternKey).then((list = []) => {
+ const _list = [...new Set([pattern, ...(list || [])])].splice(0, 10).filter((e) => !!e);
+ localStorageService.setItem(historyPatternKey, _list);
+ });
+ return pattern;
});
- return pattern;
- };
+ }, [localStorageService, onActionChange, pattern, userHabitController]);
const [options, setOptions] = useState<(string | number)[]>([]);
useEffect(() => {
diff --git a/packages/sheets-numfmt-ui/src/views/components/Date.tsx b/packages/sheets-numfmt-ui/src/views/components/Date.tsx
index 99bf31e127..97ed095788 100644
--- a/packages/sheets-numfmt-ui/src/views/components/Date.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/Date.tsx
@@ -19,7 +19,7 @@ import { LocaleService, numfmt } from '@univerjs/core';
import { SelectList } from '@univerjs/design';
import { getDateFormatOptions } from '@univerjs/sheets-numfmt';
import { useDependency } from '@univerjs/ui';
-import { useMemo, useState } from 'react';
+import { useLayoutEffect, useMemo, useState } from 'react';
export const isDatePanel = (pattern: string) => {
const info = numfmt.getFormatInfo(pattern);
@@ -31,7 +31,7 @@ export const isDatePanel = (pattern: string) => {
};
export function DatePanel(props: IBusinessComponentProps) {
- const { onChange, defaultPattern } = props;
+ const { onActionChange, onChange, defaultPattern } = props;
const options = useMemo(getDateFormatOptions, []);
const localeService = useDependency(LocaleService);
@@ -46,8 +46,9 @@ export function DatePanel(props: IBusinessComponentProps) {
return options[0].value;
});
- // FIXME: WTF??
- props.action.current = () => suffix;
+ useLayoutEffect(() => {
+ onActionChange(() => suffix);
+ }, [onActionChange, suffix]);
const handleChange = (v: any) => {
if (v === undefined) {
diff --git a/packages/sheets-numfmt-ui/src/views/components/General.tsx b/packages/sheets-numfmt-ui/src/views/components/General.tsx
index afbca11313..82afd0a71c 100644
--- a/packages/sheets-numfmt-ui/src/views/components/General.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/General.tsx
@@ -18,14 +18,17 @@ import type { FC } from 'react';
import type { IBusinessComponentProps } from './interface';
import { LocaleService } from '@univerjs/core';
import { useDependency } from '@univerjs/ui';
+import { useLayoutEffect } from 'react';
export const isGeneralPanel = (pattern: string) => !pattern;
export const GeneralPanel: FC<IBusinessComponentProps> = (props) => {
const localeService = useDependency(LocaleService);
+ const { onActionChange } = props;
- // FIXME: WTF
- props.action.current = () => '';
+ useLayoutEffect(() => {
+ onActionChange(() => '');
+ }, [onActionChange]);
return (
<div>
diff --git a/packages/sheets-numfmt-ui/src/views/components/ThousandthPercentile.tsx b/packages/sheets-numfmt-ui/src/views/components/ThousandthPercentile.tsx
index 9ec5db6254..2b3c698a63 100644
--- a/packages/sheets-numfmt-ui/src/views/components/ThousandthPercentile.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/ThousandthPercentile.tsx
@@ -19,12 +19,13 @@ import { isPatternEqualWithoutDecimal, LocaleService } from '@univerjs/core';
import { InputNumber, SelectList } from '@univerjs/design';
import { getDecimalFromPattern, getNumberFormatOptions, isPatternHasDecimal, setPatternDecimal } from '@univerjs/sheets-numfmt';
import { useDependency } from '@univerjs/ui';
-import { useMemo, useState } from 'react';
+import { useLayoutEffect, useMemo, useState } from 'react';
export const isThousandthPercentilePanel = (pattern: string) =>
getNumberFormatOptions().some((item) => isPatternEqualWithoutDecimal(item.value, pattern));
export function ThousandthPercentilePanel(props: IBusinessComponentProps) {
+ const { onActionChange, onChange } = props;
const localeService = useDependency(LocaleService);
const options = useMemo(getNumberFormatOptions, []);
@@ -41,7 +42,7 @@ export function ThousandthPercentilePanel(props: IBusinessComponentProps) {
const handleDecimalChange = (decimal: number | null) => {
setDecimal(decimal || 0);
- props.onChange(setPatternDecimal(suffix, Number(decimal || 0)));
+ onChange(setPatternDecimal(suffix, Number(decimal || 0)));
};
const handleClick = (v: any) => {
if (v === undefined) {
@@ -49,10 +50,12 @@ export function ThousandthPercentilePanel(props: IBusinessComponentProps) {
}
setDecimal(getDecimalFromPattern(v, 0));
setSuffix(v);
- props.onChange(v);
+ onChange(v);
};
- props.action.current = () => pattern;
+ useLayoutEffect(() => {
+ onActionChange(() => pattern);
+ }, [onActionChange, pattern]);
return (
<div>
diff --git a/packages/sheets-numfmt-ui/src/views/components/index.tsx b/packages/sheets-numfmt-ui/src/views/components/index.tsx
index 6ba48ae08f..29cb74c3ec 100644
--- a/packages/sheets-numfmt-ui/src/views/components/index.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/index.tsx
@@ -83,6 +83,10 @@ export const SheetNumfmtPanel: FC<ISheetNumfmtPanelProps> = (props) => {
props.onChange({ type: 'change', value: v });
}, []);
+ const handleActionChange = useCallback((action: () => string | null) => {
+ getCurrentPattern.current = action;
+ }, []);
+
const handleConfirm = () => {
const pattern = getCurrentPattern.current() || '';
const currency = getCurrencyType(pattern);
@@ -98,9 +102,9 @@ export const SheetNumfmtPanel: FC<ISheetNumfmtPanelProps> = (props) => {
const subProps: IBusinessComponentProps = {
onChange: handleChange,
+ onActionChange: handleActionChange,
defaultValue,
defaultPattern,
- action: getCurrentPattern,
};
useEffect(() => {
diff --git a/packages/sheets-numfmt-ui/src/views/components/interface.ts b/packages/sheets-numfmt-ui/src/views/components/interface.ts
index d653a950d4..f743fe28af 100644
--- a/packages/sheets-numfmt-ui/src/views/components/interface.ts
+++ b/packages/sheets-numfmt-ui/src/views/components/interface.ts
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-import type { MutableRefObject } from 'react';
-
export interface IBusinessComponentProps {
onChange: (result: string) => void;
+ onActionChange: (action: () => string | null) => void;
defaultValue: number;
defaultPattern: string;
- action: MutableRefObject<() => string | null>;
}
diff --git a/packages/sheets-sort-ui/package.json b/packages/sheets-sort-ui/package.json
index 66ba54a30a..402c861741 100644
--- a/packages/sheets-sort-ui/package.json
+++ b/packages/sheets-sort-ui/package.json
@@ -77,7 +77,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-sort": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages/sheets-table-ui/package.json b/packages/sheets-table-ui/package.json
index d46d0ca631..8702a23f2f 100644
--- a/packages/sheets-table-ui/package.json
+++ b/packages/sheets-table-ui/package.json
@@ -79,7 +79,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-formula-ui": "workspace:*",
"@univerjs/sheets-sort": "workspace:*",
diff --git a/packages/sheets-thread-comment-ui/package.json b/packages/sheets-thread-comment-ui/package.json
index a81a09121f..7efa5684ac 100644
--- a/packages/sheets-thread-comment-ui/package.json
+++ b/packages/sheets-thread-comment-ui/package.json
@@ -77,7 +77,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-thread-comment": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages/sheets-ui/package.json b/packages/sheets-ui/package.json
index 3f1562875e..68ed6c93a3 100644
--- a/packages/sheets-ui/package.json
+++ b/packages/sheets-ui/package.json
@@ -91,7 +91,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/protocol": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@univerjs/telemetry": "workspace:*",
diff --git a/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx b/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
index d39709c441..29a65e9e64 100644
--- a/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
+++ b/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
@@ -20,7 +20,7 @@ import { DocSelectionRenderService, IEditorService } from '@univerjs/docs-ui';
import { DeviceInputEventType } from '@univerjs/engine-render';
import { ComponentManager, DISABLE_AUTO_FOCUS_KEY, MetaKeys, useDependency, useEvent, useObservable, useSidebarClick } from '@univerjs/ui';
import * as React from 'react';
-import { useEffect, useRef, useState } from 'react';
+import { useEffect, useState } from 'react';
import { SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation } from '../../commands/operations/cell-edit.operation';
import { EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY } from '../../common/keys';
import { IEditorBridgeService } from '../../services/editor-bridge.service';
@@ -53,7 +53,6 @@ export const EditorContainer: React.FC<ICellIEditorProps> = () => {
const editorBridgeService = useDependency(IEditorBridgeService);
const visible = useObservable(editorBridgeService.visible$);
const commandService = useDependency(ICommandService);
- const isRefSelecting = useRef<0 | 1 | 2>(0);
const disableAutoFocus = useObservable(
() => contextService.subscribeContextValue$(DISABLE_AUTO_FOCUS_KEY),
false,
@@ -152,7 +151,7 @@ export const EditorContainer: React.FC<ICellIEditorProps> = () => {
useSidebarClick(handleClickSideBar);
- const keyCodeConfig = useKeyEventConfig(isRefSelecting, editState?.unitId);
+ const keyCodeConfig = useKeyEventConfig(editState?.unitId);
const onMoveInEditor = useEvent((keycode: KeyCode, metaKey: MetaKeys) => {
commandService.executeCommand(SetCellEditVisibleArrowOperation.id, {
@@ -193,7 +192,6 @@ export const EditorContainer: React.FC<ICellIEditorProps> = () => {
isSingle={false}
autoScrollbar={false}
onFormulaSelectingChange={(isSelecting: 0 | 1 | 2, isFocusing: boolean) => {
- isRefSelecting.current = isSelecting;
if (!isFocusing) return;
if (isSelecting) {
editorBridgeService.enableForceKeepVisible();
diff --git a/packages/sheets-ui/src/views/editor-container/hooks.ts b/packages/sheets-ui/src/views/editor-container/hooks.ts
index ffe6e08153..db5b42297e 100644
--- a/packages/sheets-ui/src/views/editor-container/hooks.ts
+++ b/packages/sheets-ui/src/views/editor-container/hooks.ts
@@ -22,7 +22,7 @@ import { useMemo } from 'react';
import { SetCellEditVisibleOperation } from '../../commands/operations/cell-edit.operation';
import { IEditorBridgeService } from '../../services/editor-bridge.service';
-export function useKeyEventConfig(isRefSelecting: React.MutableRefObject<0 | 1 | 2>, unitId?: string) {
+export function useKeyEventConfig(unitId?: string) {
const editorBridgeService = useDependency(IEditorBridgeService);
const commandService = useDependency(ICommandService);
diff --git a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
index 32b74af20b..2261545300 100644
--- a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
+++ b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
@@ -82,9 +82,8 @@ export function FormulaBar(props: IProps) {
const [imageDisable, setImageDisable] = useState<boolean>(false);
const componentManager = useDependency(ComponentManager);
const workbook = useObservable(() => univerInstanceService.getCurrentTypeOfUnit$<Workbook>(UniverInstanceType.UNIVER_SHEET), undefined, undefined, [])!;
- const isRefSelecting = useRef<0 | 1 | 2>(0);
const editState = useObservable(editorBridgeService.currentEditCellState$);
- const keyCodeConfig = useKeyEventConfig(isRefSelecting, editState?.unitId);
+ const keyCodeConfig = useKeyEventConfig(editState?.unitId);
const FormulaEditor = componentManager.get(EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY);
const formulaAuxUIParts = useComponentsOfPart(SheetsUIPart.FORMULA_AUX);
const contextService = useDependency(IContextService);
@@ -384,7 +383,6 @@ export function FormulaBar(props: IProps) {
isSingle={false}
keyboardEventConfig={keyCodeConfig}
onFormulaSelectingChange={(isSelecting: 0 | 1 | 2, isFocusing: boolean) => {
- isRefSelecting.current = isSelecting;
if (!isFocusing) return;
if (isSelecting) {
editorBridgeService.enableForceKeepVisible();
diff --git a/packages/slides-ui/package.json b/packages/slides-ui/package.json
index 38fd9e66cd..2d5eeea334 100644
--- a/packages/slides-ui/package.json
+++ b/packages/slides-ui/package.json
@@ -80,7 +80,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/drawing": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/slides": "workspace:*",
"@univerjs/ui": "workspace:*"
},
diff --git a/packages/thread-comment-ui/package.json b/packages/thread-comment-ui/package.json
index 48893b6408..639fcd3c98 100644
--- a/packages/thread-comment-ui/package.json
+++ b/packages/thread-comment-ui/package.json
@@ -77,7 +77,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@univerjs/thread-comment": "workspace:*",
"@univerjs/ui": "workspace:*"
},
diff --git a/packages/ui/package.json b/packages/ui/package.json
index b17768578b..2fe0dd481d 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -89,7 +89,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "1.11.0",
+ "@univerjs/icons": "1.12.0",
"@wendellhu/redi": "1.1.1"
},
"devDependencies": {
diff --git a/packages/uniscript/src/views/components/ScriptEditorPanel.tsx b/packages/uniscript/src/views/components/ScriptEditorPanel.tsx
index 0c5b699695..23f6c4c2cd 100644
--- a/packages/uniscript/src/views/components/ScriptEditorPanel.tsx
+++ b/packages/uniscript/src/views/components/ScriptEditorPanel.tsx
@@ -15,7 +15,6 @@
*/
import type { IDisposable, Nullable } from '@univerjs/core';
-import type { MutableRefObject } from 'react';
import { DisposableCollection, LocaleService, ThemeService, toDisposable } from '@univerjs/core';
import { Button, MessageType } from '@univerjs/design';
import { IMessageService, IShortcutService, useDependency } from '@univerjs/ui';
@@ -88,7 +87,8 @@ export function ScriptEditorPanel() {
};
}, [editorService, shortcutService]);
- const startExecution = useExecution(monacoEditorRef);
+ const getMonacoEditor = useCallback(() => monacoEditorRef.current, []);
+ const startExecution = useExecution(getMonacoEditor);
return (
<div className="univer-h-full">
@@ -104,13 +104,13 @@ export function ScriptEditorPanel() {
);
}
-function useExecution(monacoEditorRef: MutableRefObject<Nullable<editor.IStandaloneCodeEditor>>) {
+function useExecution(getMonacoEditor: () => Nullable<editor.IStandaloneCodeEditor>) {
const scriptService = useDependency(IUniscriptExecutionService);
const messageService = useDependency(IMessageService);
const localeService = useDependency(LocaleService);
return useCallback(() => {
- const model = monacoEditorRef.current?.getModel();
+ const model = getMonacoEditor()?.getModel();
if (model) {
scriptService
.execute(model.getValue())
@@ -127,5 +127,5 @@ function useExecution(monacoEditorRef: MutableRefObject<Nullable<editor.IStandal
});
});
}
- }, [localeService, messageService, monacoEditorRef, scriptService]);
+ }, [getMonacoEditor, localeService, messageService, scriptService]);
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e6b4328f8a..bde6b87016 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -127,8 +127,8 @@ importers:
specifier: workspace:*
version: link:../../packages/engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/mockdata':
specifier: workspace:*
version: link:../mockdata
@@ -373,20 +373,20 @@ importers:
unplugin-vue:
specifier: ^7.2.0
vitest:
specifier: ^4.1.8
devDependencies:
'@types/fs-extra':
specifier: ^11.0.4
version: 11.0.4
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/icons-svg':
- specifier: ^1.11.0
- version: 1.11.0
+ specifier: ^1.12.0
+ version: 1.12.0
'@univerjs/protocol':
specifier: workspace:*
version: link:../../packages/protocol
@@ -404,7 +404,7 @@ importers:
'@storybook/addon-docs':
specifier: ^10.3.6
'@storybook/addon-links':
specifier: ^10.3.6
@@ -536,8 +536,8 @@ importers:
specifier: workspace:*
version: link:../packages/find-replace
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/mockdata':
specifier: workspace:*
version: link:../common/mockdata
@@ -681,7 +681,7 @@ importers:
version: 19.2.7([email protected])
react-mosaic-component:
specifier: ^6.2.0
rxjs:
specifier: ^7.8.2
version: 7.8.2
@@ -747,8 +747,8 @@ importers:
specifier: workspace:*
version: link:../design
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -779,7 +779,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/core:
dependencies:
@@ -837,7 +837,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/data-validation:
dependencies:
@@ -862,7 +862,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/design:
dependencies:
@@ -888,8 +888,8 @@ importers:
specifier: ^1.2.4
version: 1.2.4(@types/[email protected])([email protected])
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
class-variance-authority:
specifier: ^0.7.1
version: 0.7.1
@@ -938,7 +938,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs:
dependencies:
@@ -960,7 +960,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs-drawing:
dependencies:
@@ -979,7 +979,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs-drawing-ui:
dependencies:
@@ -1031,7 +1031,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs-hyper-link:
dependencies:
@@ -1047,7 +1047,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs-hyper-link-ui:
dependencies:
@@ -1070,8 +1070,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1096,7 +1096,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs-mention-ui:
dependencies:
@@ -1139,7 +1139,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs-quick-insert-ui:
dependencies:
@@ -1171,8 +1171,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1197,7 +1197,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs-thread-comment-ui:
dependencies:
@@ -1214,8 +1214,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/thread-comment':
specifier: workspace:*
version: link:../thread-comment
@@ -1246,7 +1246,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/docs-ui:
dependencies:
@@ -1266,8 +1266,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1301,7 +1301,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/drawing:
dependencies:
@@ -1323,7 +1323,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/drawing-ui:
dependencies:
@@ -1340,8 +1340,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1366,7 +1366,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/engine-formula:
dependencies:
@@ -1394,7 +1394,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/engine-render:
dependencies:
@@ -1440,7 +1440,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/find-replace:
dependencies:
@@ -1454,8 +1454,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1480,7 +1480,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/network:
dependencies:
@@ -1499,7 +1499,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/protocol:
dependencies:
@@ -1518,7 +1518,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/rpc:
dependencies:
@@ -1537,7 +1537,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/rpc-node:
dependencies:
@@ -1559,7 +1559,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets:
dependencies:
@@ -1593,7 +1593,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-conditional-formatting:
dependencies:
@@ -1614,8 +1614,8 @@ importers:
specifier: workspace:*
version: link:../../common/shared
'@univerjs/icons-svg':
- specifier: ^1.11.0
- version: 1.11.0
+ specifier: ^1.12.0
+ version: 1.12.0
'@univerjs/sheets-formula':
specifier: workspace:*
version: link:../sheets-formula
@@ -1627,7 +1627,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-conditional-formatting-ui:
dependencies:
@@ -1644,8 +1644,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -1685,7 +1685,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-crosshair-highlight:
dependencies:
@@ -1699,8 +1699,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -1731,7 +1731,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-data-validation:
dependencies:
@@ -1765,7 +1765,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-data-validation-ui:
dependencies:
@@ -1785,8 +1785,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -1826,7 +1826,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-drawing:
dependencies:
@@ -1851,7 +1851,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-drawing-ui:
dependencies:
@@ -1909,7 +1909,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-filter:
dependencies:
@@ -1940,7 +1940,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-filter-ui:
dependencies:
@@ -1954,8 +1954,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/rpc':
specifier: workspace:*
version: link:../rpc
@@ -1995,7 +1995,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-find-replace:
dependencies:
@@ -2026,7 +2026,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-formula:
dependencies:
@@ -2060,7 +2060,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-formula-ui:
dependencies:
@@ -2083,8 +2083,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2118,7 +2118,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-hyper-link:
dependencies:
@@ -2146,7 +2146,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-hyper-link-ui:
dependencies:
@@ -2169,8 +2169,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2210,7 +2210,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-note:
dependencies:
@@ -2241,7 +2241,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-note-ui:
dependencies:
@@ -2255,8 +2255,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2290,7 +2290,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-numfmt:
dependencies:
@@ -2315,7 +2315,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-numfmt-ui:
dependencies:
@@ -2332,8 +2332,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2367,7 +2367,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-sort:
dependencies:
@@ -2389,7 +2389,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-sort-ui:
dependencies:
@@ -2403,8 +2403,8 @@ importers:
specifier: workspace:*
version: link:../engine-formula
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2441,7 +2441,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-table:
dependencies:
@@ -2472,7 +2472,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-table-ui:
dependencies:
@@ -2489,8 +2489,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2530,7 +2530,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-thread-comment:
dependencies:
@@ -2558,7 +2558,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-thread-comment-ui:
dependencies:
@@ -2572,8 +2572,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2613,7 +2613,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/sheets-ui:
dependencies:
@@ -2636,8 +2636,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/protocol':
specifier: workspace:*
version: link:../protocol
@@ -2674,7 +2674,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/slides:
dependencies:
@@ -2696,7 +2696,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/slides-ui:
dependencies:
@@ -2719,8 +2719,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/slides':
specifier: workspace:*
version: link:../slides
@@ -2748,7 +2748,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/telemetry:
dependencies:
@@ -2764,7 +2764,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/themes:
devDependencies:
@@ -2789,7 +2789,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/thread-comment-ui:
dependencies:
@@ -2803,8 +2803,8 @@ importers:
specifier: workspace:*
version: link:../docs-ui
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@univerjs/thread-comment':
specifier: workspace:*
version: link:../thread-comment
@@ -2832,7 +2832,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/ui:
dependencies:
@@ -2846,8 +2846,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: 1.11.0
+ specifier: 1.12.0
'@wendellhu/redi':
specifier: 1.1.1
version: 1.1.1([email protected])
@@ -2884,7 +2884,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/ui-adapter-vue3:
dependencies:
@@ -2903,7 +2903,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
vue:
specifier: ^3.5.34
version: 3.5.34([email protected])
@@ -2925,7 +2925,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/uniscript:
dependencies:
@@ -2968,7 +2968,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages/watermark:
dependencies:
@@ -2990,7 +2990,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
presets:
dependencies:
@@ -3669,7 +3669,7 @@ importers:
version: 6.0.3
vitest:
specifier: ^4.1.8
packages:
@@ -6692,9 +6692,6 @@ packages:
resolution: {integrity: sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg==}
- '@types/[email protected]':
- resolution: {integrity: sha512-G05zqtJhcDLb8uslf5EjCxXg9G1KQxiV8OS0R26IC//Eoyitzqe8z37I7cqvnZlrlSfgocQRfSn/AHBZJJFyGw==}
-
resolution: {integrity: sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg==}
@@ -6898,11 +6895,11 @@ packages:
resolution: {integrity: sha512-EbGRQg4FhrmwLodl+t3JNAnXHWVr9Vp+Zl1QBZVPY4ByfkzIT8cX3K6QWODHtkIZqqJVEWvhHSx3v5PDHsaQag==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@univerjs/[email protected]':
- resolution: {integrity: sha512-AXCthRf2cZ2lh3BsykhqsXtvoJ+dsocUSM9RKxlb1SKIjk8JaqiTMW/DXLr4R0e7Ke/3djyJ1Y4XwRVtgs3ipw==}
+ '@univerjs/[email protected]':
+ resolution: {integrity: sha512-m2RSIsGaC1y66vIqU2FEUvDQ+3CBKBFwa28PUUpg9Rn93AoFs6LXok/FQxE6pibMbMomTjySyVtxgK4ZexCaaQ==}
- '@univerjs/[email protected]':
- resolution: {integrity: sha512-zcWFBPn0jJ11idBE0Jdgy0JHxbloJXuQhyU+Mfyl2/9YOavqF9AhrR+JKina4vgfPqq7G7Byjq+8tnIA7Kxu0A==}
+ '@univerjs/[email protected]':
+ resolution: {integrity: sha512-BV+NESaNz1a8YxZzgRID4reIYnpXskwm236a7mDt3dJcJ9sPb0UjCv2YQMRMQ97njwimK/Vk+h3ZqQB4a3fOSg==}
peerDependencies:
react: 19.2.7
react-dom: 19.2.7
@@ -6993,12 +6990,18 @@ packages:
resolution: {integrity: sha512-BUmHaR1J+O+CKZ9uJucdVTEr1LHsdyvv7vG3eNRhK3CczEHeMd/LtsHAuD7PbrxvI2envCY2v7HI1vC1aBRzKw==}
+ resolution: {integrity: sha512-s99aGxWYig9ErHbct27KXEGhrBYlRI6c4MwAgXErOAbX9xiW37/uMa+XUDO69zLz83dng8UUZ70CTOJrLrYrEQ==}
+
resolution: {integrity: sha512-EbF/T++k0e2MMZlJsBhzK8Sgwt0HcIPOhzn1CTB/lv6sQcyk+OWf8YeiLxZp3ro7MbbLcAfAJ6sEvjFWuNgUCw==}
resolution: {integrity: sha512-k+bprkXxuqhVajgTx5mUHuir7TwQzUKOWR40ng1ncAqQRPnrLngGGgqVEEhOnTMlc8btHYVKmrP8s5Qyg0hvYA==}
+ resolution: {integrity: sha512-JTqp25l8aFfJYF7/KmsXZjAxJz7T+SjmTJLoXVjHtc2BrSgSiW2n9Aem/cWq1OPe68A8JL06B3eVdhlP0H4TVw==}
+
resolution: {integrity: sha512-D/ihr6uZeIt6r+pVZf46RWT1fAsLFMbUP7k8G1VkiiWexriED9GrX3echHd4Abbt17zjlfiFJ8z7a3BxZOPNjg==}
@@ -7051,6 +7054,9 @@ packages:
resolution: {integrity: sha512-zSbjL7gRXwks2ZQLRGCajBtBXEOXW9Ddhn/HvSdrGkE2dqGnumzW8XtusRrxrE9LvqtiqDXQ+A60Hp6mvdYxfA==}
+ resolution: {integrity: sha512-FTW0AFZNaK5/mOqvGBwVfUlNLU38TiQn4+DQgIFUnrBBJQ1crMJ82yeGQLV5jyKFsO8yRukpbuP7x+nRbH6aug==}
+
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==}
@@ -13566,17 +13572,17 @@ snapshots:
'@tybys/wasm-util': 0.10.2
optional: true
dependencies:
- '@emnapi/core': 1.9.2
- '@emnapi/runtime': 1.9.2
+ '@emnapi/core': 1.10.0
+ '@emnapi/runtime': 1.10.0
'@tybys/wasm-util': 0.10.2
optional: true
dependencies:
- '@emnapi/core': 1.10.0
- '@emnapi/runtime': 1.10.0
+ '@emnapi/core': 1.9.2
+ '@emnapi/runtime': 1.9.2
'@tybys/wasm-util': 0.10.2
optional: true
@@ -14302,7 +14308,7 @@ snapshots:
dependencies:
'@emnapi/core': 1.9.2
'@emnapi/runtime': 1.9.2
- '@napi-rs/wasm-runtime': 1.1.4(@emnapi/[email protected])(@emnapi/[email protected])
+ '@napi-rs/wasm-runtime': 1.1.5(@emnapi/[email protected])(@emnapi/[email protected])
optional: true
'@rolldown/[email protected]':
@@ -14452,10 +14458,10 @@ snapshots:
'@standard-schema/[email protected]': {}
dependencies:
'@mdx-js/react': 3.1.1(@types/[email protected])([email protected])
react: 19.2.7
@@ -14522,14 +14528,14 @@ snapshots:
ts-dedent: 2.2.0
dependencies:
unplugin: 2.3.11
optionalDependencies:
esbuild: 0.28.0
rollup: 4.55.1
webpack: 5.106.2(@swc/[email protected])([email protected])
'@storybook/[email protected]': {}
@@ -14853,11 +14859,6 @@ snapshots:
dependencies:
undici-types: 7.24.6
- '@types/[email protected]':
- dependencies:
- undici-types: 7.24.6
- optional: true
-
dependencies:
undici-types: 7.24.6
@@ -15128,9 +15129,9 @@ snapshots:
'@typescript-eslint/types': 8.60.1
eslint-visitor-keys: 5.0.1
- '@univerjs/[email protected]': {}
+ '@univerjs/[email protected]': {}
dependencies:
react: 19.2.7
react-dom: 19.2.7([email protected])
@@ -15200,13 +15201,13 @@ snapshots:
optionalDependencies:
dependencies:
'@vitest/spy': 4.1.8
estree-walker: 3.0.3
magic-string: 0.30.21
optionalDependencies:
'@vitest/[email protected]':
dependencies:
@@ -15274,6 +15275,15 @@ snapshots:
estree-walker: 2.0.2
source-map-js: 1.2.1
+ dependencies:
+ '@babel/parser': 7.29.7
+ '@vue/shared': 3.5.38
+ entities: 7.0.1
+ estree-walker: 2.0.2
+ source-map-js: 1.2.1
+ optional: true
+
dependencies:
'@vue/compiler-core': 3.5.34
@@ -15284,6 +15294,12 @@ snapshots:
'@vue/compiler-core': 3.5.35
'@vue/shared': 3.5.35
+ dependencies:
+ '@vue/compiler-core': 3.5.38
+ '@vue/shared': 3.5.38
+ optional: true
+
dependencies:
'@babel/parser': 7.29.3
@@ -15321,8 +15337,8 @@ snapshots:
dependencies:
'@volar/language-core': 2.4.28
- '@vue/compiler-dom': 3.5.35
- '@vue/shared': 3.5.35
+ '@vue/compiler-dom': 3.5.38
+ '@vue/shared': 3.5.38
alien-signals: 3.2.1
muggle-string: 0.4.1
path-browserify: 1.0.1
@@ -15387,6 +15403,9 @@ snapshots:
'@vue/[email protected]': {}
+ optional: true
+
'@webassemblyjs/[email protected]':
dependencies:
'@webassemblyjs/helper-numbers': 1.13.2
@@ -19508,26 +19527,26 @@ snapshots:
dependencies:
dnd-core: 16.0.1
dependencies:
dnd-core: 16.0.1
dnd-multi-backend: 8.1.2([email protected])
react: 19.2.7
- 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.2.7([email protected])
dependencies:
react: 19.2.7
- 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
@@ -19536,7 +19555,7 @@ snapshots:
hoist-non-react-statics: 3.3.2
react: 19.2.7
optionalDependencies:
- '@types/node': 25.9.2
+ '@types/node': 25.9.3
'@types/react': 19.2.16
@@ -19582,7 +19601,7 @@ snapshots:
dependencies:
classnames: 2.5.1
immutability-helper: 3.1.1
@@ -19590,9 +19609,9 @@ snapshots:
prop-types: 15.8.1
rdndmb-html5-to-touch: 8.1.2([email protected])
react: 19.2.7
- 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:
@@ -20731,14 +20750,14 @@ snapshots:
dependencies:
'@jridgewell/gen-mapping': 0.3.13
'@jridgewell/trace-mapping': 0.3.31
'@vue/reactivity': 3.5.34
obug: 2.1.1
unplugin: 3.0.0
vue: 3.5.35([email protected])
transitivePeerDependencies:
- '@types/node'
@@ -20867,7 +20886,7 @@ snapshots:
tsx: 4.22.3
yaml: 2.9.0
dependencies:
lightningcss: 1.32.0
picomatch: 4.0.4
@@ -20875,7 +20894,7 @@ snapshots:
rolldown: 1.0.0-rc.18
tinyglobby: 0.2.17
optionalDependencies:
- '@types/node': 25.9.2
+ '@types/node': 25.9.3
esbuild: 0.28.0
fsevents: 2.3.3
jiti: 2.7.0
@@ -20914,10 +20933,10 @@ snapshots:
transitivePeerDependencies:
- msw
dependencies:
'@vitest/expect': 4.1.8
'@vitest/pretty-format': 4.1.8
'@vitest/runner': 4.1.8
'@vitest/snapshot': 4.1.8
@@ -20934,10 +20953,10 @@ snapshots:
tinyexec: 1.2.4
tinyglobby: 0.2.17
tinyrainbow: 3.1.0
why-is-node-running: 2.3.0
optionalDependencies:
- '@types/node': 25.9.2
+ '@types/node': 25.9.3
'@vitest/coverage-istanbul': 4.1.8([email protected])
happy-dom: 20.10.1
jsdom: 29.1.1