refactor(ui): restructure menu for better code logic (#4724)

This commit is contained in:
白熱
2025-02-26 22:25:58 +08:00
committed by GitHub
parent 04af678bc3
commit 81244d588a
165 changed files with 1563 additions and 2792 deletions
+2 -2
View File
@@ -37,10 +37,10 @@
"sort-keys": "^5.1.0",
"tailwind-scrollbar": "^3.1.0",
"tailwindcss": "^3.4.17",
"vite": "^6.1.1",
"vite": "^6.2.0",
"vite-plugin-dts": "^4.5.0",
"vite-plugin-external": "^6.0.1",
"vitest": "^3.0.6"
"vitest": "^3.0.7"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
-82
View File
@@ -1,82 +0,0 @@
/**
* 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 { Tools } from '@univerjs/core';
import sheetsformulaenUS from '@univerjs/sheets-formula/locale/en-US';
import sheetsformulafaIR from '@univerjs/sheets-formula/locale/fa-IR';
import sheetsformulafrFR from '@univerjs/sheets-formula/locale/fr-FR';
import sheetsformularuRU from '@univerjs/sheets-formula/locale/ru-RU';
import sheetsformulaviVN from '@univerjs/sheets-formula/locale/vi-VN';
import sheetsformulazhCN from '@univerjs/sheets-formula/locale/zh-CN';
import sheetsformulazhTW from '@univerjs/sheets-formula/locale/zh-TW';
import sheetssortenUS from '@univerjs/sheets-sort/locale/en-US';
import sheetssortfaIR from '@univerjs/sheets-sort/locale/fa-IR';
import sheetssortfrFR from '@univerjs/sheets-sort/locale/fr-FR';
import sheetssortruRU from '@univerjs/sheets-sort/locale/ru-RU';
import sheetssortviVN from '@univerjs/sheets-sort/locale/vi-VN';
import sheetssortzhCN from '@univerjs/sheets-sort/locale/zh-CN';
import sheetssortzhTW from '@univerjs/sheets-sort/locale/zh-TW';
import sheetsenUS from '@univerjs/sheets/locale/en-US';
import sheetsfaIR from '@univerjs/sheets/locale/fa-IR';
import sheetsfrFR from '@univerjs/sheets/locale/fr-FR';
import sheetsruRU from '@univerjs/sheets/locale/ru-RU';
import sheetsviVN from '@univerjs/sheets/locale/vi-VN';
import sheetszhCN from '@univerjs/sheets/locale/zh-CN';
import sheetszhTW from '@univerjs/sheets/locale/zh-TW';
export const enUS = Tools.deepMerge(
{},
sheetsenUS,
sheetsformulaenUS,
sheetssortenUS
);
export const frFR = Tools.deepMerge(
{},
sheetsfrFR,
sheetsformulafrFR,
sheetssortfrFR
);
export const ruRU = Tools.deepMerge(
{},
sheetsruRU,
sheetsformularuRU,
sheetssortruRU
);
export const zhCN = Tools.deepMerge(
{},
sheetszhCN,
sheetsformulazhCN,
sheetssortzhCN
);
export const zhTW = Tools.deepMerge(
{},
sheetszhTW,
sheetsformulazhTW,
sheetssortzhTW
);
export const viVN = Tools.deepMerge(
{},
sheetsviVN,
sheetsformulaviVN,
sheetssortviVN
);
export const faIR = Tools.deepMerge(
{},
sheetsfaIR,
sheetsformulafaIR,
sheetssortfaIR
);
+4 -4
View File
@@ -47,11 +47,11 @@
"@antfu/eslint-config": "4.3.0",
"@commitlint/cli": "^19.7.1",
"@commitlint/config-conventional": "^19.7.1",
"@eslint-react/eslint-plugin": "^1.27.0",
"@eslint-react/eslint-plugin": "^1.28.0",
"@playwright/test": "^1.50.1",
"@release-it-plugins/workspaces": "^4.2.0",
"@release-it/conventional-changelog": "^9.0.4",
"@storybook/react": "8.5.8",
"@storybook/react": "8.6.0",
"@types/node": "^22.13.5",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
@@ -74,9 +74,9 @@
"release-it": "^17.11.0",
"serve": "^14.2.4",
"tsx": "^4.19.3",
"turbo": "^2.4.2",
"turbo": "^2.4.4",
"typescript": "^5.7.3",
"vitest": "^3.0.6"
"vitest": "^3.0.7"
},
"pnpm": {
"onlyBuiltDependencies": [
@@ -81,7 +81,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+9 -3
View File
@@ -20,7 +20,8 @@
"keywords": [],
"exports": {
".": "./src/index.ts",
"./*": "./src/*"
"./*": "./src/*",
"./locale/*": "./src/locale/*.ts"
},
"main": "./src/index.ts",
"types": "./lib/types/index.d.ts",
@@ -39,6 +40,11 @@
"require": "./lib/cjs/*",
"types": "./lib/types/index.d.ts"
},
"./locale/*": {
"import": "./lib/es/locale/*.js",
"require": "./lib/cjs/locale/*.js",
"types": "./lib/types/locale/*.d.ts"
},
"./lib/*": "./lib/*"
}
},
@@ -78,8 +84,8 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6",
"vite": "^6.2.0",
"vitest": "^3.0.7",
"vue": "^3.5.13"
}
}
File diff suppressed because one or more lines are too long
@@ -14,8 +14,6 @@
* limitations under the License.
*/
import React from 'react';
export const FloatButton = () => {
const divStyle = {
width: '100px',
@@ -14,8 +14,6 @@
* limitations under the License.
*/
import React from 'react';
export const RangeLoading = () => {
const divStyle = {
width: '100%',
+1 -1
View File
@@ -16,4 +16,4 @@
import './global.css';
export * from './debugger-plugin';
export { UniverDebuggerPlugin } from './plugin';
@@ -19,15 +19,13 @@ import { LocaleService } from '@univerjs/core';
import { Button, Checkbox, InputNumber } from '@univerjs/design';
import { ILocalFileService, useDependency } from '@univerjs/ui';
import { WATERMARK_IMAGE_ALLOW_IMAGE_LIST } from '@univerjs/watermark';
import React from 'react';
import styles from './index.module.less';
interface IWatermarkImageSettingProps {
config?: IImageWatermarkConfig;
onChange: (config: IImageWatermarkConfig) => void;
}
export const WatermarkImageSetting: React.FC<IWatermarkImageSettingProps> = ({ config, onChange }) => {
export function WatermarkImageSetting({ config, onChange }: IWatermarkImageSettingProps) {
const fileOpenService = useDependency(ILocalFileService);
const localeService = useDependency(LocaleService);
@@ -65,38 +63,38 @@ export const WatermarkImageSetting: React.FC<IWatermarkImageSettingProps> = ({ c
};
return (
<div className={styles.watermarkImageSetting}>
<div className="univer-grid univer-gap-2">
<div className="univer-text-gray-400">{localeService.t('univer-watermark.image')}</div>
<div className={styles.watermarkTextSettingHeader}>{localeService.t('univer-watermark.image')}</div>
<div className={styles.watermarkTextSettingLayout}>
<span>{localeService.t('univer-watermark.image')}</span>
<div className="univer-mb-4 univer-grid univer-gap-1">
<Button
className="univer-mb-2"
onClick={handleUpdateImageUrl}
style={{ marginLeft: 8 }}
>
{config.url ? localeService.t('univer-watermark.replaceImage') : localeService.t('univer-watermark.uploadImage')}
</Button>
<div className={styles.watermarkTextSettingFontStylePart}>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-flex univer-gap-2 univer-text-center">
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.opacity')}</div>
<InputNumber
className="univer-box-border univer-h-7"
value={config.opacity}
max={1}
min={0}
step={0.05}
onChange={(val) => {
if (val != null) {
onChange({ ...config, opacity: Number.parseFloat(val.toString()) });
}
}}
max={1}
min={0}
step={0.05}
className={styles.watermarkInput}
/>
</div>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.keepRatio')}</div>
<Checkbox
className="univer-justify-center univer-self-baseline"
checked={config.maintainAspectRatio}
onChange={(val) => {
if (val === true) {
@@ -110,12 +108,14 @@ export const WatermarkImageSetting: React.FC<IWatermarkImageSettingProps> = ({ c
</div>
</div>
<div className={styles.watermarkTextSettingLayout}>
<div className={styles.watermarkTextSettingFontStylePart}>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-grid univer-gap-2 univer-text-center">
<div className="univer-flex univer-gap-2">
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.width')}</div>
<InputNumber
className="univer-box-border univer-h-7"
value={config.width}
min={20}
onChange={(val) => {
if (val != null) {
const newWidth = Math.max(20, Number.parseInt(val.toString()));
@@ -126,15 +126,15 @@ export const WatermarkImageSetting: React.FC<IWatermarkImageSettingProps> = ({ c
}
}
}}
min={20}
className={styles.watermarkInput}
/>
</div>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.height')}</div>
<InputNumber
className="univer-box-border univer-h-7"
value={config.height}
min={20}
onChange={(val) => {
if (val != null) {
const newHeight = Math.max(20, Number.parseInt(val.toString()));
@@ -145,96 +145,93 @@ export const WatermarkImageSetting: React.FC<IWatermarkImageSettingProps> = ({ c
}
}
}}
min={20}
className={styles.watermarkInput}
/>
</div>
</div>
</div>
<div className={styles.watermarkTextSettingHeader}>{localeService.t('univer-watermark.layout')}</div>
<div className="univer-text-gray-400">{localeService.t('univer-watermark.layout')}</div>
<div className={styles.watermarkTextSettingLayout}>
<div className={styles.watermarkTextSettingFontStylePart}>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-grid univer-gap-2 univer-text-center">
<div className="univer-flex univer-gap-2">
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.rotate')}</div>
<InputNumber
className="univer-box-border univer-h-7"
value={config.rotate}
max={360}
min={-360}
onChange={(val) => {
if (val != null) {
onChange({ ...config, rotate: Number.parseInt(val.toString()) });
}
}}
max={360}
min={-360}
className={styles.watermarkInput}
/>
</div>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.repeat')}</div>
<Checkbox
className="univer-justify-center univer-self-baseline"
checked={config.repeat}
onChange={(val) => onChange({ ...config, repeat: val as boolean })}
/>
</div>
</div>
<div className={styles.watermarkTextSettingFontStylePart}>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-flex univer-gap-2">
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.spacingX')}</div>
<InputNumber
className="univer-box-border univer-h-7"
value={config.spacingX}
min={0}
onChange={(val) => {
if (val != null) {
onChange({ ...config, spacingX: Number.parseInt(val.toString()) });
}
}}
min={0}
className={styles.watermarkInput}
/>
</div>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.spacingY')}</div>
<InputNumber
className="univer-box-border univer-h-7"
value={config.spacingY}
min={0}
onChange={(val) => {
if (val != null) {
onChange({ ...config, spacingY: Number.parseInt(val.toString()) });
}
}}
min={0}
className={styles.watermarkInput}
/>
</div>
</div>
<div className={styles.watermarkTextSettingFontStylePart}>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-flex univer-gap-2">
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.startX')}</div>
<InputNumber
className="univer-box-border univer-h-7"
value={config.x}
min={0}
onChange={(val) => {
if (val != null) {
onChange({ ...config, x: Number.parseInt(val.toString()) });
}
}}
min={0}
className={styles.watermarkInput}
/>
</div>
<div className={styles.watermarkTextSettingLayoutFontWrapper}>
<div className="univer-grid univer-flex-1 univer-gap-1">
<div>{localeService.t('univer-watermark.startY')}</div>
<InputNumber
className="univer-box-border univer-h-7"
value={config.y}
min={0}
onChange={(val) => {
if (val != null) {
onChange({ ...config, y: Number.parseInt(val.toString()) });
}
}}
min={0}
className={styles.watermarkInput}
/>
</div>
</div>
@@ -21,7 +21,6 @@ import { IWatermarkTypeEnum, UNIVER_WATERMARK_STORAGE_KEY } from '@univerjs/engi
import { useDependency, useObservable } from '@univerjs/ui';
import { WatermarkImageBaseConfig, WatermarkService, WatermarkTextBaseConfig } from '@univerjs/watermark';
import React, { useCallback, useEffect, useState } from 'react';
import styles from './index.module.less';
import { WatermarkImageSetting } from './WatermarkImageSetting';
import { WatermarkTextSetting } from './WatermarkTextSetting';
@@ -53,25 +52,28 @@ export const WatermarkPanel: React.FC = () => {
}, [_refresh, getWatermarkConfig]);
return (
<div className={styles.watermarkPanel}>
<div className={styles.watermarkPanelTypeTitle}>{localeService.t('univer-watermark.type')}</div>
<Select
value={watermarkType}
onChange={(v) => {
setWatermarkType(v as IWatermarkTypeEnum);
if (v === IWatermarkTypeEnum.Text) {
handleConfigChange({ text: WatermarkTextBaseConfig }, IWatermarkTypeEnum.Text);
} else if (v === IWatermarkTypeEnum.Image) {
handleConfigChange({ image: WatermarkImageBaseConfig }, IWatermarkTypeEnum.Image);
}
}}
options={[
{ label: localeService.t('univer-watermark.text'), value: IWatermarkTypeEnum.Text },
{ label: localeService.t('univer-watermark.image'), value: IWatermarkTypeEnum.Image },
]}
className={styles.watermarkPanelTypeSelect}
/>
<div className={styles.watermarkPanelSetting}>
<div className="univer-grid univer-gap-3 univer-text-sm">
{/* Watermark type */}
<div className="univer-grid univer-gap-2">
<div className="univer-text-gray-400">{localeService.t('univer-watermark.type')}</div>
<Select
value={watermarkType}
options={[
{ label: localeService.t('univer-watermark.text'), value: IWatermarkTypeEnum.Text },
{ label: localeService.t('univer-watermark.image'), value: IWatermarkTypeEnum.Image },
]}
onChange={(v) => {
setWatermarkType(v as IWatermarkTypeEnum);
if (v === IWatermarkTypeEnum.Text) {
handleConfigChange({ text: WatermarkTextBaseConfig }, IWatermarkTypeEnum.Text);
} else if (v === IWatermarkTypeEnum.Image) {
handleConfigChange({ image: WatermarkImageBaseConfig }, IWatermarkTypeEnum.Image);
}
}}
/>
</div>
<div className="univer-grid univer-gap-2">
{watermarkType === IWatermarkTypeEnum.Text && <WatermarkTextSetting config={config?.text} onChange={(v) => handleConfigChange({ text: v })} />}
{watermarkType === IWatermarkTypeEnum.Image && <WatermarkImageSetting config={config?.image} onChange={(v) => handleConfigChange({ image: v })} />}
</div>
@@ -19,19 +19,17 @@ import { Button } from '@univerjs/design';
import { IWatermarkTypeEnum } from '@univerjs/engine-render';
import { IClipboardInterfaceService, ISidebarService, useDependency } from '@univerjs/ui';
import { WatermarkService, WatermarkTextBaseConfig } from '@univerjs/watermark';
import React from 'react';
import styles from './index.module.less';
export const WatermarkPanelFooter: React.FC = () => {
export function WatermarkPanelFooter() {
const sidebarService = useDependency(ISidebarService);
const watermarkService = useDependency(WatermarkService);
const localeService = useDependency(LocaleService);
const clipboardService = useDependency(IClipboardInterfaceService);
return (
<div className={styles.watermarkPanelFooter}>
<div
className={styles.watermarkPanelFooterReset}
<div className="univer-flex univer-items-center univer-justify-between">
<a
className="univer-text-sm univer-text-primary-600 univer-underline"
onClick={() => {
watermarkService.updateWatermarkConfig({
type: IWatermarkTypeEnum.Text,
@@ -41,11 +39,10 @@ export const WatermarkPanelFooter: React.FC = () => {
}}
>
{localeService.t('univer-watermark.cancel')}
</div>
</a>
<div className={styles.watermarkPanelFooterButtonWrapper}>
<div className="univer-flex univer-items-center univer-gap-2">
<Button
style={{ marginRight: 8 }}
onClick={async () => {
const watermarkConfig = await watermarkService.getWatermarkConfig();
let config;
@@ -19,23 +19,21 @@ import { LocaleService } from '@univerjs/core';
import { Checkbox, clsx, ColorPicker, Dropdown, Input, InputNumber, Select } from '@univerjs/design';
import { BoldSingle, FontColor, ItalicSingle } from '@univerjs/icons';
import { useDependency } from '@univerjs/ui';
import React from 'react';
import styles from './index.module.less';
interface IWatermarkTextSettingProps {
config?: ITextWatermarkConfig;
onChange: (config: ITextWatermarkConfig) => void;
}
export const WatermarkTextSetting: React.FC<IWatermarkTextSettingProps> = (props) => {
export function WatermarkTextSetting(props: IWatermarkTextSettingProps) {
const { config, onChange } = props;
const localeService = useDependency(LocaleService);
if (!config) return null;
return (
<div className={styles.watermarkTextSetting}>
<div className={styles.watermarkTextSettingHeader}>{localeService.t('univer-watermark.style')}</div>
<div className="univer-grid univer-gap-2">
<div className="univer-text-gray-400">{localeService.t('univer-watermark.style')}</div>
<div className="univer-mb-4 univer-grid univer-gap-1">
<div>{localeService.t('univer-watermark.content')}</div>
@@ -46,8 +44,8 @@ export const WatermarkTextSetting: React.FC<IWatermarkTextSettingProps> = (props
/>
</div>
<div className={clsx(styles.watermarkTextSettingFontStyle, 'univer-grid univer-gap-4')}>
<div className={clsx(styles.watermarkTextSettingFontStylePart, 'univer-flex univer-gap-2')}>
<div className="univer-grid univer-gap-4">
<div className="univer-flex univer-gap-2">
<div className="univer-grid univer-gap-1">
<div>{localeService.t('univer-watermark.fontSize')}</div>
<InputNumber
@@ -94,32 +92,44 @@ export const WatermarkTextSetting: React.FC<IWatermarkTextSettingProps> = (props
</div>
<div
className={clsx(styles.watermarkTextSettingFontStylePart, `
className={`
univer-flex univer-justify-around univer-gap-4
`)}
[&_a]:univer-flex [&_a]:univer-size-6 [&_a]:univer-items-center [&_a]:univer-justify-center
[&_a]:univer-rounded
`}
>
<div className={styles.watermarkIconWrapper}>
<Dropdown
overlay={(
<div className="univer-rounded-lg univer-p-4">
<ColorPicker value={config.color} onChange={(val) => onChange({ ...config, color: val })} />
</div>
)}
>
<FontColor className={styles.watermarkIcon} extend={{ colorChannel1: config.color ?? 'rgb(var(--primary-color))' }} />
</Dropdown>
</div>
<div className={clsx(styles.watermarkIconWrapper, { [styles.watermarkIconWrapperSelect]: config.bold })} onClick={() => { onChange({ ...config, bold: !config.bold }); }}>
<BoldSingle className={styles.watermarkIcon} />
</div>
<div className={clsx(styles.watermarkIconWrapper, { [styles.watermarkIconWrapperSelect]: config.italic })} onClick={() => { onChange({ ...config, italic: !config.italic }); }}>
<ItalicSingle className={styles.watermarkIcon} />
</div>
<Dropdown
overlay={(
<div className="univer-rounded-lg univer-p-4">
<ColorPicker value={config.color} onChange={(val) => onChange({ ...config, color: val })} />
</div>
)}
>
<a className="hover:univer-bg-gray-100">
<FontColor extend={{ colorChannel1: config.color ?? '#2c53f1' }} />
</a>
</Dropdown>
<a
className={clsx('hover:univer-bg-gray-100', {
'univer-bg-gray-200': config.bold,
})}
onClick={() => { onChange({ ...config, bold: !config.bold }); }}
>
<BoldSingle />
</a>
<a
className={clsx('hover:univer-bg-gray-100', {
'univer-bg-gray-200': config.italic,
})}
onClick={() => { onChange({ ...config, italic: !config.italic }); }}
>
<ItalicSingle />
</a>
</div>
</div>
{/* Layout */}
<div className={styles.watermarkTextSettingHeader}>{localeService.t('univer-watermark.layout')}</div>
<div className="univer-text-gray-400">{localeService.t('univer-watermark.layout')}</div>
<div className="univer-grid univer-gap-2 univer-text-center">
<div className="univer-flex univer-gap-2">
@@ -1,83 +0,0 @@
.watermark {
&-panel {
margin: 16px 0;
&-type-title {
font-size: 15px;
color: rgb(var(--text-color-secondary));
}
&-type-select {
width: 100%;
margin-top: 16px;
}
&-setting {
width: 100%;
min-height: 100px;
border-radius: 8px;
}
&-footer {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
&-button-wrapper {
display: flex;
align-items: center;
}
&-reset {
cursor: pointer;
white-space: nowrap;
color: rgb(var(--primary-color));
border-bottom: 1px solid rgb(var(--primary-color));
}
}
}
&-text-setting {
font-size: 14px;
&-header {
font-size: 15px;
color: rgb(var(--text-color-secondary));
margin: 16px 0;
}
}
&-image-setting {
font-size: 14px;
}
&-icon {
width: 18px;
height: 18px;
margin: 2px;
&-wrapper {
cursor: pointer;
border-radius: 4px;
width: 24px;
height: 24px;
&-select {
background-color: rgb(var(--grey-100));
}
&:hover {
background-color: rgb(var(--grey-100));
}
&:first-child {
margin-left: 28px;
}
&:last-child {
margin-right: 28px;
}
}
}
}
@@ -72,7 +72,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -73,7 +73,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -85,7 +85,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -61,7 +61,7 @@
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -78,7 +78,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -74,7 +74,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -80,7 +80,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+3 -3
View File
@@ -74,7 +74,7 @@
"fast-diff": "1.3.0",
"kdbush": "^4.0.2",
"lodash-es": "^4.17.21",
"nanoid": "5.1.0",
"nanoid": "5.1.2",
"numeral": "^2.0.6",
"numfmt": "^2.5.2",
"ot-json1": "^1.0.2",
@@ -87,7 +87,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -70,7 +70,7 @@
"@univerjs/sheets": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+3 -2
View File
@@ -70,6 +70,7 @@
"dependencies": {
"@radix-ui/react-dropdown-menu": "^2.1.6",
"@radix-ui/react-popover": "^1.1.6",
"@radix-ui/react-separator": "^1.1.2",
"@rc-component/trigger": "^2.2.6",
"@univerjs/icons": "^0.2.20",
"clsx": "^2.1.1",
@@ -99,7 +100,7 @@
"tailwindcss": "^3.4.17",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import clsx from 'clsx';
import React from 'react';
import type { CSSProperties, ReactNode } from 'react';
import { clsx } from '../../helper/clsx';
import styles from './index.module.less';
@@ -24,10 +24,10 @@ type AvatarSize = number | 'middle' | 'small';
type ImageFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
export interface IAvatarProps {
children?: React.ReactNode;
children?: ReactNode;
/** Semantic DOM style */
style?: React.CSSProperties;
style?: CSSProperties;
/** The title of the image avatar */
title?: string;
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import clsx from 'clsx';
import React from 'react';
import type { CSSProperties, MouseEvent, ReactNode } from 'react';
import { clsx } from '../../helper/clsx';
import styles from './index.module.less';
@@ -23,13 +23,13 @@ export type ButtonType = 'primary' | 'default' | 'text' | 'link';
export type ButtonSize = 'small' | 'middle' | 'large';
export interface IButtonProps {
children?: React.ReactNode;
children?: ReactNode;
/** Semantic DOM class */
className?: string;
/** Semantic DOM style */
style?: React.CSSProperties;
style?: CSSProperties;
/**
* Set button type
@@ -59,7 +59,7 @@ export interface IButtonProps {
disabled?: boolean;
/** Set the handler to handle `click` event */
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
id?: string;
}
@@ -15,8 +15,8 @@
*/
import { CheckMarkSingle } from '@univerjs/icons';
import clsx from 'clsx';
import React, { useContext, useMemo } from 'react';
import { useContext, useMemo } from 'react';
import { clsx } from '../../helper/clsx';
import { ConfigContext } from '../config-provider/ConfigProvider';
import styles from './index.module.less';
@@ -14,14 +14,14 @@
* limitations under the License.
*/
import React from 'react';
import clsx from 'clsx';
import type { CSSProperties, ReactNode } from 'react';
import type { ICheckboxProps } from '../checkbox/Checkbox';
import { Children, cloneElement, isValidElement } from 'react';
import { clsx } from '../../helper/clsx';
import styles from './index.module.less';
export interface ICheckboxGroupProps {
children: React.ReactNode[];
children: ReactNode[];
/**
* The class name of the checkbox group
@@ -31,7 +31,7 @@ export interface ICheckboxGroupProps {
/**
* The style of the checkbox group
*/
style?: React.CSSProperties;
style?: CSSProperties;
/**
* Define which checkbox is selected
@@ -76,9 +76,9 @@ export function CheckboxGroup(props: ICheckboxGroupProps) {
return (
<div className={_className} style={style}>
{React.Children.map(children, (child, index) => {
if (React.isValidElement<ICheckboxProps>(child)) {
return React.cloneElement(child, {
{Children.map(children, (child, index) => {
if (isValidElement<ICheckboxProps>(child)) {
return cloneElement(child, {
key: index,
children: child.props.children,
checked: child.props.value ? value.includes(child.props.value) : false,
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import clsx from 'clsx';
import React, { useRef } from 'react';
import { clsx } from '../../helper/clsx';
import styles from './index.module.less';
@@ -30,21 +30,23 @@ import {
type DropdownMenu = {
type: 'item';
className?: string;
children: ReactNode;
disabled?: boolean;
onSelect?: (item: DropdownMenu) => void;
} | {
type?: 'separator';
className?: string;
} | {
type?: 'radio';
options: { value: string; label: string }[];
className?: string;
value: string;
options: { value: string; label: ReactNode; disabled?: boolean }[];
onSelect?: (item: string) => void;
};
export interface IDropdownProps {
children: ReactNode;
/** @deprecated */
overlay?: ReactNode;
items: DropdownMenu[];
disabled?: boolean;
open?: boolean;
@@ -54,7 +56,6 @@ export interface IDropdownProps {
export function DropdownMenu(props: IDropdownProps & ComponentProps<typeof Content>) {
const {
children,
overlay,
items,
disabled,
open: controlledOpen,
@@ -77,21 +78,17 @@ export function DropdownMenu(props: IDropdownProps & ComponentProps<typeof Conte
controlledOnOpenChange?.(newOpen);
}
// const [showStatusBar, setShowStatusBar] = useState<boolean>(true);
// const [showActivityBar, setShowActivityBar] = useState<boolean>(false);
// const [showPanel, setShowPanel] = useState<boolean>(false);
// const [position, setPosition] = useState('bottom');
function renderMenuItem(item: DropdownMenu, index: number) {
// const { type, children, icon, checked, hidden, onSelect } = item;
const { type } = item;
const { className, type } = item;
if (type === 'separator') {
return <DropdownMenuSeparator key={index} />;
return <DropdownMenuSeparator key={index} className={className} />;
} else if (type === 'radio') {
return (
<DropdownMenuRadioGroup
key={index}
className={className}
value={item.value}
onValueChange={item.onSelect}
>
@@ -99,6 +96,7 @@ export function DropdownMenu(props: IDropdownProps & ComponentProps<typeof Conte
<DropdownMenuRadioItem
key={option.value}
value={option.value}
disabled={option.disabled}
>
{option.label}
</DropdownMenuRadioItem>
@@ -109,6 +107,8 @@ export function DropdownMenu(props: IDropdownProps & ComponentProps<typeof Conte
return (
<DropdownMenuItem
key={index}
className={className}
disabled={item.disabled}
onSelect={() => {
item.onSelect?.(item);
}}
@@ -120,97 +120,12 @@ export function DropdownMenu(props: IDropdownProps & ComponentProps<typeof Conte
}
return (
<DropdownMenuPrimitive open={open} onOpenChange={handleChangeOpen}>
<DropdownMenuPrimitive modal={false} open={open} onOpenChange={handleChangeOpen}>
<DropdownMenuTrigger asChild>
{children}
</DropdownMenuTrigger>
<DropdownMenuContent {...restProps}>
{overlay}
{items.map((item, index) => renderMenuItem(item, index))}
{/*
<DropdownMenuLabel>Appearance</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuCheckboxItem
checked={showStatusBar}
onCheckedChange={setShowStatusBar}
>
Status Bar
</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem
checked={showActivityBar}
onCheckedChange={setShowActivityBar}
disabled
>
Activity Bar
</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem
checked={showPanel}
onCheckedChange={setShowPanel}
>
Panel
</DropdownMenuCheckboxItem>
<DropdownMenuSeparator />
<DropdownMenuLabel>Panel Position</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuRadioGroup value={position} onValueChange={setPosition}>
<DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="right">Right</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
<DropdownMenuSeparator />
<DropdownMenuLabel>My Account</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem>
Profile
<DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
Billing
<DropdownMenuShortcut>⌘B</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
Settings
<DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
Keyboard shortcuts
<DropdownMenuShortcut>⌘K</DropdownMenuShortcut>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem>Team</DropdownMenuItem>
<DropdownMenuSub>
<DropdownMenuSubTrigger>Invite users</DropdownMenuSubTrigger>
<DropdownMenuPortal>
<DropdownMenuSubContent>
<DropdownMenuItem>Email</DropdownMenuItem>
<DropdownMenuItem>Message</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem>More...</DropdownMenuItem>
</DropdownMenuSubContent>
</DropdownMenuPortal>
</DropdownMenuSub>
<DropdownMenuItem>
New Team
<DropdownMenuShortcut>⌘+T</DropdownMenuShortcut>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem>GitHub</DropdownMenuItem>
<DropdownMenuItem>Support</DropdownMenuItem>
<DropdownMenuItem disabled>API</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem>
Log out
<DropdownMenuShortcut>⇧⌘Q</DropdownMenuShortcut>
</DropdownMenuItem> */}
</DropdownMenuContent>
</DropdownMenuPrimitive>
);
@@ -125,7 +125,7 @@ function DropdownMenuSubContent({
data-slot="dropdown-menu-sub-content"
className={clsx(
`
univer-z-50 univer-box-border univer-max-h-[var(--radix-popper-available-height)]
univer-z-[1080] univer-box-border univer-max-h-[var(--radix-popper-available-height)]
univer-overflow-y-auto univer-rounded-md univer-border univer-border-solid univer-border-gray-200
univer-bg-white univer-p-1.5 univer-text-gray-900 univer-shadow-md univer-scrollbar-thin
univer-scrollbar-track-gray-50 univer-scrollbar-thumb-gray-300
@@ -158,7 +158,7 @@ function DropdownMenuContent({
sideOffset={sideOffset}
className={clsx(
`
univer-z-50 univer-box-border univer-max-h-[var(--radix-popper-available-height)]
univer-z-[1080] univer-box-border univer-max-h-[var(--radix-popper-available-height)]
univer-overflow-y-auto univer-rounded-md univer-border univer-border-solid univer-border-gray-200
univer-bg-white univer-p-1.5 univer-text-gray-900 univer-shadow-md univer-scrollbar-thin
univer-scrollbar-track-gray-50 univer-scrollbar-thumb-gray-300
@@ -44,8 +44,10 @@ function PopoverContent({
sideOffset={sideOffset}
className={clsx(
`
univer-z-[1080] univer-rounded-md univer-border univer-border-solid univer-bg-white
univer-text-gray-900 univer-shadow-md univer-outline-hidden univer-border-gray-200
univer-z-[1080] univer-max-h-[var(--radix-popper-available-height)] univer-overflow-y-auto
univer-rounded-md univer-border univer-border-solid univer-border-gray-200 univer-bg-white
univer-text-gray-900 univer-shadow-md univer-outline-hidden univer-scrollbar-thin
univer-scrollbar-track-gray-50 univer-scrollbar-thumb-gray-300
data-[side=bottom]:univer-slide-in-from-top-2
data-[side=left]:univer-slide-in-from-right-2
data-[side=right]:univer-slide-in-from-left-2
@@ -16,8 +16,8 @@
import type { PropsWithChildren } from 'react';
import { MoreUpSingle } from '@univerjs/icons';
import clsx from 'clsx';
import React, { createContext, useContext, useState } from 'react';
import { clsx } from '../../helper/clsx';
import styles from './index.module.less';
@@ -14,14 +14,14 @@
* limitations under the License.
*/
import React from 'react';
import clsx from 'clsx';
import type { CSSProperties, ReactNode } from 'react';
import type { IRadioProps } from '../radio/Radio';
import { Children, cloneElement, isValidElement } from 'react';
import { clsx } from '../../helper/clsx';
import styles from './index.module.less';
export interface IRadioGroupProps {
children: React.ReactNode[];
children: ReactNode[];
/**
* The class name of the checkbox group
@@ -31,7 +31,7 @@ export interface IRadioGroupProps {
/**
* The style of the checkbox group
*/
style?: React.CSSProperties;
style?: CSSProperties;
/**
* Define which radio is selected
@@ -72,9 +72,9 @@ export function RadioGroup(props: IRadioGroupProps) {
return (
<div className={clsx(styles.radioGroup, _className)} style={style}>
{React.Children.map(children, (child, index) => {
if (React.isValidElement<IRadioProps>(child)) {
return React.cloneElement(child, {
{Children.map(children, (child, index) => {
if (isValidElement<IRadioProps>(child)) {
return cloneElement(child, {
key: index,
children: child.props.children,
value: child.props.value,
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import clsx from 'clsx';
import React, { useRef } from 'react';
import { clsx } from '../../helper/clsx';
import styles from './index.module.less';
@@ -15,8 +15,7 @@
*/
import { CheckMarkSingle } from '@univerjs/icons';
import clsx from 'clsx';
import React from 'react';
import { clsx } from '../../helper/clsx';
import styles from './index.module.less';
@@ -14,17 +14,17 @@
* limitations under the License.
*/
import { MoreDownSingle } from '@univerjs/icons';
import clsx from 'clsx';
import RcSelect from 'rc-select';
import React, { useContext } from 'react';
import type { LabelInValueType } from 'rc-select/lib/Select';
import type { CSSProperties, JSXElementConstructor, ReactElement, ReactNode } from 'react';
import { MoreDownSingle } from '@univerjs/icons';
import RcSelect from 'rc-select';
import { useContext } from 'react';
import { clsx } from '../../helper/clsx';
import { ConfigContext } from '../config-provider/ConfigProvider';
import styles from './index.module.less';
interface IOption {
label?: string | React.ReactNode;
label?: string | ReactNode;
value?: string;
options?: IOption[];
}
@@ -46,7 +46,7 @@ export interface ISelectProps {
*/
onChange: (value: string) => void;
style?: React.CSSProperties;
style?: CSSProperties;
/**
* Whether the borderless style is used
@@ -61,14 +61,14 @@ export interface ISelectProps {
mode?: 'combobox' | 'multiple' | 'tags' | undefined;
dropdownRender?: (
menu: React.ReactElement<any, string | React.JSXElementConstructor<any>>
) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
menu: ReactElement<any, string | JSXElementConstructor<any>>
) => ReactElement<any, string | JSXElementConstructor<any>>;
labelRender?: ((props: LabelInValueType) => React.ReactNode) | undefined;
labelRender?: ((props: LabelInValueType) => ReactNode) | undefined;
open?: boolean;
dropdownStyle?: React.CSSProperties;
dropdownStyle?: CSSProperties;
onDropdownVisibleChange?: (open: boolean) => void;
@@ -0,0 +1,45 @@
/**
* 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 { ComponentProps } from 'react';
import { Root } from '@radix-ui/react-separator';
import { clsx } from '../../helper/clsx';
function Separator({
className,
orientation = 'horizontal',
decorative = true,
...props
}: ComponentProps<typeof Root>) {
return (
<Root
data-slot="separator-root"
decorative={decorative}
orientation={orientation}
className={clsx(
`
univer-shrink-0 univer-bg-gray-200
data-[orientation=horizontal]:univer-h-px data-[orientation=horizontal]:univer-w-full
data-[orientation=vertical]:univer-h-full data-[orientation=vertical]:univer-w-px
`,
className
)}
{...props}
/>
);
}
export { Separator };
@@ -0,0 +1,17 @@
/**
* 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.
*/
export { Separator } from './Separator';
+1 -2
View File
@@ -15,11 +15,10 @@
*/
import { DropdownSingle } from '@univerjs/icons';
import clsx from 'clsx';
import VirtualList from 'rc-virtual-list';
import React, { useEffect, useMemo, useState } from 'react';
import { clsx } from '../../helper/clsx';
import { Checkbox } from '../checkbox';
import { Tooltip } from '../tooltip';
import styles from './index.module.less';
import { createCacheWithFindNodePathFromTree, isIntermediated } from './util';
+1
View File
@@ -52,3 +52,4 @@ export { resizeObserverCtor } from './helper/resize-observer';
export { render, unmount } from './helper/react-dom';
export { isBrowser } from './helper/is-browser';
export { DropdownMenu, type IDropdownProps } from './components/dropdown-menu';
export { Separator } from './components/separator';
+2 -2
View File
@@ -86,7 +86,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -18,14 +18,13 @@ import type { ICommandInfo, IDrawingParam, IObjectPositionH, IObjectPositionV, N
import type { IDocDrawing } from '@univerjs/docs-drawing';
import type { IDocumentSkeletonDrawing } from '@univerjs/engine-render';
import { DocumentFlavor, ICommandService, IUniverInstanceService, LocaleService, ObjectRelativeFromH, ObjectRelativeFromV, PositionedObjectLayoutType } from '@univerjs/core';
import { Checkbox, InputNumber, Select } from '@univerjs/design';
import { Checkbox, clsx, InputNumber, Select } from '@univerjs/design';
import { DocSkeletonManagerService, RichTextEditingMutation } from '@univerjs/docs';
import { DocSelectionRenderService } from '@univerjs/docs-ui';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { UpdateDrawingDocTransformCommand } from '../../commands/commands/update-doc-drawing.command';
import styles from './index.module.less';
@@ -358,7 +357,6 @@ export const DocDrawingPosition = (props: IDocDrawingPositionProps) => {
subscription.unsubscribe();
mutationListener.dispose();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
@@ -17,13 +17,12 @@
import type { ICommandInfo, IDrawingParam, Nullable } from '@univerjs/core';
import type { IDocDrawing } from '@univerjs/docs-drawing';
import { BooleanNumber, ICommandService, IUniverInstanceService, LocaleService, PositionedObjectLayoutType, WrapTextType } from '@univerjs/core';
import { InputNumber, Radio, RadioGroup } from '@univerjs/design';
import { clsx, InputNumber, Radio, RadioGroup } from '@univerjs/design';
import { RichTextEditingMutation } from '@univerjs/docs';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { TextWrappingStyle, UpdateDocDrawingDistanceCommand, UpdateDocDrawingWrappingStyleCommand, UpdateDocDrawingWrapTextCommand } from '../../commands/commands/update-doc-drawing.command';
import styles from './index.module.less';
@@ -258,7 +257,6 @@ export const DocDrawingTextWrap = (props: IDocDrawingTextWrapProps) => {
subscription.unsubscribe();
mutationListener.dispose();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
+2 -2
View File
@@ -62,7 +62,7 @@
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -83,7 +83,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -62,7 +62,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -76,7 +76,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -77,7 +77,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -92,7 +92,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -15,7 +15,7 @@
*/
import { PresetListType } from '@univerjs/core';
import React from 'react';
import { clsx } from '@univerjs/design';
import styles from './index.module.less';
export interface IListTypePickerBaseProps {
@@ -30,7 +30,7 @@ interface IListTypePickerProps extends IListTypePickerBaseProps {
export const ListTypePicker = (props: IListTypePickerProps) => {
const { value, onChange, options } = props;
return (
<div className={styles.docListTypePicker}>
<div className={clsx(styles.docListTypePicker, 'univer-theme')}>
{options.map((item) => {
return (
<img
@@ -186,8 +186,9 @@ export class DocHeaderFooterController extends Disposable implements IRenderModu
}
private _initCustomComponents(): void {
const componentManager = this._componentManager;
this.disposeWithMe(componentManager.register(COMPONENT_DOC_HEADER_FOOTER_PANEL, DocHeaderFooterPanel));
if (!this._componentManager.get(COMPONENT_DOC_HEADER_FOOTER_PANEL)) {
this.disposeWithMe(this._componentManager.register(COMPONENT_DOC_HEADER_FOOTER_PANEL, DocHeaderFooterPanel));
}
}
private _init() {
@@ -464,7 +464,6 @@ export function FontFamilySelectorMenuItemFactory(accessor: IAccessor): IMenuSel
selections: FONT_FAMILY_LIST.map((item) => ({
label: {
name: FONT_FAMILY_ITEM_COMPONENT,
hoverable: true,
},
value: item.value,
})),
@@ -555,6 +554,7 @@ export function TextColorSelectorMenuItemFactory(accessor: IAccessor): IMenuSele
label: {
name: COLOR_PICKER_COMPONENT,
hoverable: false,
selectable: false,
},
},
],
@@ -800,11 +800,13 @@ export function OrderListMenuItemFactory(accessor: IAccessor): IMenuSelectorItem
return {
id: OrderListCommand.id,
type: MenuItemType.BUTTON_SELECTOR,
slot: true,
selections: [
{
label: {
name: ORDER_LIST_TYPE_COMPONENT,
hoverable: false,
selectable: false,
},
value$: listValueFactory$(accessor),
},
@@ -821,11 +823,13 @@ export function BulletListMenuItemFactory(accessor: IAccessor): IMenuSelectorIte
return {
id: BulletListCommand.id,
type: MenuItemType.BUTTON_SELECTOR,
slot: true,
selections: [
{
label: {
name: BULLET_LIST_TYPE_COMPONENT,
hoverable: false,
selectable: false,
},
value$: listValueFactory$(accessor),
},
@@ -901,6 +905,7 @@ export function BackgroundColorSelectorMenuItemFactory(accessor: IAccessor): IMe
label: {
name: COLOR_PICKER_COMPONENT,
hoverable: false,
selectable: false,
},
},
],
@@ -17,12 +17,11 @@
import type { IDocumentStyle } from '@univerjs/core';
import type { IHeaderFooterProps } from '../../../commands/commands/doc-header-footer.command';
import { BooleanNumber, ICommandService, IUniverInstanceService, LocaleService, Tools } from '@univerjs/core';
import { Button, Checkbox, InputNumber } from '@univerjs/design';
import { Button, Checkbox, clsx, InputNumber } from '@univerjs/design';
import { DocSkeletonManagerService } from '@univerjs/docs';
import { DocumentEditArea, IRenderManagerService } from '@univerjs/engine-render';
import { ILayoutService, useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { CloseHeaderFooterCommand, CoreHeaderFooterCommandId } from '../../../commands/commands/doc-header-footer.command';
import { DocSelectionRenderService } from '../../../services/selection/doc-selection-render.service';
import styles from './index.module.less';
@@ -15,12 +15,10 @@
*/
import { HorizontalAlign, LocaleService, SpacingRule } from '@univerjs/core';
import { InputNumber, Select, Tooltip } from '@univerjs/design';
import { clsx, InputNumber, Select, Tooltip } from '@univerjs/design';
import { AlignTextBothSingle, HorizontallySingle, LeftJustifyingSingle, RightJustifyingSingle } from '@univerjs/icons';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import * as React from 'react';
import { useMemo } from 'react';
import { useMemo, useRef } from 'react';
import {
useCurrentParagraph,
useFirstParagraphHorizontalAlign,
@@ -38,7 +36,7 @@ const AutoFocusInputNumber = (props: {
value: number; onChange: (v: number) => Promise<unknown>; className?: string; min?: number; max?: number; step?: number;
}) => {
const { value, onChange, className = '', min = 0, max = 100, step = 1 } = props;
const ref = React.useRef<HTMLInputElement>(null);
const ref = useRef<HTMLInputElement>(null);
return (
<InputNumber
step={step}
@@ -19,10 +19,10 @@ import type { ReactNode } from 'react';
import type { Editor } from '../../services/editor/editor';
import type { IKeyboardEventConfig } from './hooks';
import { BuildTextUtils, createInternalEditorID, generateRandomId, getPlainText } from '@univerjs/core';
import { clsx } from '@univerjs/design';
import { DocSkeletonManagerService } from '@univerjs/docs';
import { IRenderManagerService } from '@univerjs/engine-render';
import { useDependency, useEvent, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useLayoutEffect, useMemo, useState } from 'react';
import { IEditorService } from '../../services/editor/editor-manager.service';
import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
+2 -2
View File
@@ -68,7 +68,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -82,7 +82,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -16,10 +16,9 @@
import type { IDrawingParam } from '@univerjs/core';
import { ICommandService, LocaleService } from '@univerjs/core';
import { Select } from '@univerjs/design';
import { clsx, Select } from '@univerjs/design';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useState } from 'react';
import { useState } from 'react';
import { AlignType, SetDrawingAlignOperation } from '../../commands/operations/drawing-align.operation';
import styles from './index.module.less';
@@ -16,12 +16,11 @@
import type { IDrawingParam } from '@univerjs/core';
import { ArrangeTypeEnum, LocaleService } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { Button, clsx } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { BottomSingle, MoveDownSingle, MoveUpSingle, TopmostSingle } from '@univerjs/icons';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import styles from './index.module.less';
export interface IDrawingArrangeProps {
@@ -49,7 +48,6 @@ export const DrawingArrange = (props: IDrawingArrangeProps) => {
return () => {
focusDispose.unsubscribe();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const onArrangeBtnClick = (arrangeType: ArrangeTypeEnum) => {
@@ -17,13 +17,12 @@
import type { IDrawingParam } from '@univerjs/core';
import type { IDrawingGroupUpdateParam } from '@univerjs/drawing';
import { DrawingTypeEnum, LocaleService, Tools } from '@univerjs/core';
import { Button } from '@univerjs/design';
import { Button, clsx } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { getGroupState, IRenderManagerService, transformObjectOutOfGroup } from '@univerjs/engine-render';
import { GroupSingle, UngroupSingle } from '@univerjs/icons';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { getUpdateParams } from '../../utils/get-update-params';
import styles from './index.module.less';
@@ -17,12 +17,11 @@
import type { IDrawingParam, Nullable } from '@univerjs/core';
import type { IChangeObserverConfig, Scene } from '@univerjs/engine-render';
import { debounce, LocaleService } from '@univerjs/core';
import { Checkbox, InputNumber } from '@univerjs/design';
import { Checkbox, clsx, InputNumber } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { MIN_DRAWING_HEIGHT_LIMIT, MIN_DRAWING_WIDTH_LIMIT, RANGE_DRAWING_ROTATION_LIMIT } from '../../utils/config';
import { getUpdateParams } from '../../utils/get-update-params';
import styles from './index.module.less';
@@ -237,7 +236,6 @@ export const DrawingTransform = (props: IDrawingTransformProps) => {
return () => {
subscriptions.forEach((sub) => sub.unsubscribe());
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const handleWidthChange = debounce((val: number | null) => {
@@ -16,11 +16,10 @@
import type { IDrawingParam } from '@univerjs/core';
import { ICommandService, LocaleService } from '@univerjs/core';
import { Button, Select } from '@univerjs/design';
import { Button, clsx, Select } from '@univerjs/design';
import { CreateCopySingle } from '@univerjs/icons';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useRef, useState } from 'react';
import { useEffect, useRef, useState } from 'react';
import { AutoImageCropOperation, CloseImageCropOperation, CropType } from '../../commands/operations/image-crop.operation';
import styles from './index.module.less';
+2 -2
View File
@@ -66,7 +66,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -78,7 +78,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -60,7 +60,7 @@
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -73,8 +73,8 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
},
"browser": {
"fs": false
+2 -2
View File
@@ -90,7 +90,7 @@
"jsdom": "^24.1.1",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -82,7 +82,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -72,7 +72,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -66,7 +66,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -66,7 +66,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -92,7 +92,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -37,46 +37,77 @@ const commandList = [
const commonSelections = [
{
label: 'sheet.cf.ruleType.highlightCell',
label: {
name: 'sheet.cf.ruleType.highlightCell',
selectable: false,
},
value: CF_MENU_OPERATION.highlightCell,
},
{
label: 'sheet.cf.panel.rankAndAverage',
label: {
name: 'sheet.cf.panel.rankAndAverage',
selectable: false,
},
value: CF_MENU_OPERATION.rank,
},
{
label: 'sheet.cf.ruleType.formula',
label: {
name: 'sheet.cf.ruleType.formula',
selectable: false,
},
value: CF_MENU_OPERATION.formula,
},
{
label: 'sheet.cf.ruleType.colorScale',
label: {
name: 'sheet.cf.ruleType.colorScale',
selectable: false,
},
value: CF_MENU_OPERATION.colorScale,
},
{
label: 'sheet.cf.ruleType.dataBar',
label: {
name: 'sheet.cf.ruleType.dataBar',
selectable: false,
},
value: CF_MENU_OPERATION.dataBar,
}, {
label: 'sheet.cf.ruleType.iconSet',
label: {
name: 'sheet.cf.ruleType.iconSet',
selectable: false,
},
value: CF_MENU_OPERATION.icon,
},
{
label: 'sheet.cf.menu.manageConditionalFormatting',
label: {
name: 'sheet.cf.menu.manageConditionalFormatting',
selectable: false,
},
value: CF_MENU_OPERATION.viewRule,
}, {
label: 'sheet.cf.menu.createConditionalFormatting',
label: {
name: 'sheet.cf.menu.createConditionalFormatting',
selectable: false,
},
value: CF_MENU_OPERATION.createRule,
},
{
label: 'sheet.cf.menu.clearRangeRules',
label: {
name: 'sheet.cf.menu.clearRangeRules',
selectable: false,
},
value: CF_MENU_OPERATION.clearRangeRules,
disabled: false,
},
{
label: 'sheet.cf.menu.clearWorkSheetRules',
label: {
name: 'sheet.cf.menu.clearWorkSheetRules',
selectable: false,
},
value: CF_MENU_OPERATION.clearWorkSheetRules,
},
];
// eslint-disable-next-line max-lines-per-function
export const FactoryManageConditionalFormattingRule = (accessor: IAccessor): IMenuSelectorItem => {
const selectionManagerService = accessor.get(SheetsSelectionsService);
const commandService = accessor.get(ICommandService);
@@ -78,7 +78,7 @@
"@univerjs/icons-svg": "^0.2.20",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -88,7 +88,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -14,10 +14,12 @@
* limitations under the License.
*/
import { type IAccessor, UniverInstanceType } from '@univerjs/core';
import { getMenuHiddenObservable, type IMenuSelectorItem, MenuItemType } from '@univerjs/ui';
import { SheetsCrosshairHighlightService } from '../services/crosshair.service';
import type { IAccessor } from '@univerjs/core';
import type { IMenuSelectorItem } from '@univerjs/ui';
import { UniverInstanceType } from '@univerjs/core';
import { getMenuHiddenObservable, MenuItemType } from '@univerjs/ui';
import { SetCrosshairHighlightColorOperation, ToggleCrosshairHighlightOperation } from '../commands/operations/operation';
import { SheetsCrosshairHighlightService } from '../services/crosshair.service';
export const CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT = 'CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT';
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import { clsx } from '@univerjs/design';
import { useDependency, useObservable } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { CROSSHAIR_HIGHLIGHT_COLORS, SheetsCrosshairHighlightService } from '../../services/crosshair.service';
import styles from './index.module.less';
@@ -25,7 +25,7 @@ export interface ICrosshairOverlayProps {
onChange?: (value: string) => void;
}
export function CrosshairOverlay(props: ICrosshairOverlayProps): React.JSX.Element {
export function CrosshairOverlay(props: ICrosshairOverlayProps) {
const { onChange } = props;
const crosshairSrv = useDependency(SheetsCrosshairHighlightService);
@@ -93,7 +93,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -80,7 +80,7 @@
"less": "^4.2.2",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -94,7 +94,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -18,13 +18,12 @@ import type { IDrawingParam, Nullable } from '@univerjs/core';
import type { BaseObject } from '@univerjs/engine-render';
import type { ISheetDrawing } from '@univerjs/sheets-drawing';
import { ICommandService, LocaleService } from '@univerjs/core';
import { Radio, RadioGroup } from '@univerjs/design';
import { clsx, Radio, RadioGroup } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { IRenderManagerService } from '@univerjs/engine-render';
import { SheetDrawingAnchorType } from '@univerjs/sheets-drawing';
import { useDependency } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { SetSheetDrawingCommand } from '../../commands/commands/set-sheet-drawing.command';
import styles from './index.module.less';
+2 -2
View File
@@ -63,7 +63,7 @@
"@univerjs-infra/shared": "workspace:*",
"@univerjs/sheets": "workspace:*",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -86,7 +86,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -72,7 +72,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -83,7 +83,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -94,7 +94,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
@@ -34,27 +34,42 @@ export function InsertFunctionMenuItemFactory(accessor: IAccessor): IMenuItem {
type: MenuItemType.SELECTOR,
selections: [
{
label: 'SUM',
label: {
name: 'SUM',
selectable: false,
},
value: 'SUM',
icon: 'SumSingle',
},
{
label: 'AVERAGE',
label: {
name: 'AVERAGE',
selectable: false,
},
value: 'AVERAGE',
icon: 'AvgSingle',
},
{
label: 'COUNT',
label: {
name: 'COUNT',
selectable: false,
},
value: 'COUNT',
icon: 'CntSingle',
},
{
label: 'MAX',
label: {
name: 'MAX',
selectable: false,
},
value: 'MAX',
icon: 'MaxSingle',
},
{
label: 'MIN',
label: {
name: 'MIN',
selectable: false,
},
value: 'MIN',
icon: 'MinSingle',
},
@@ -17,16 +17,16 @@
import type { DocumentDataModel, IDisposable, ITextRange } from '@univerjs/core';
import type { Editor, IKeyboardEventConfig } from '@univerjs/docs-ui';
import type { KeyCode, MetaKeys } from '@univerjs/ui';
import type { ReactNode } from 'react';
import type { CSSProperties, ReactNode } from 'react';
import type { FormulaSelectingType } from './hooks/use-formula-selection';
import type { IRefSelection } from './hooks/use-highlight';
import { BuildTextUtils, createInternalEditorID, generateRandomId, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { clsx } from '@univerjs/design';
import { DocBackScrollRenderController, DocSelectionRenderService, IEditorService, useKeyboardEvent, useResize } from '@univerjs/docs-ui';
import { IRenderManagerService } from '@univerjs/engine-render';
import { EMBEDDING_FORMULA_EDITOR } from '@univerjs/sheets-ui';
import { useDependency, useEvent, useObservable, useUpdateEffect } from '@univerjs/ui';
import clsx from 'clsx';
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { findIndexFromSequenceNodes, findRefSequenceIndex } from '../range-selector/utils/find-index-from-sequence-nodes';
import { HelpFunction } from './help-function/HelpFunction';
import { useFocus } from './hooks/use-focus';
@@ -72,7 +72,7 @@ export interface IFormulaEditorProps {
*/
disableSelectionOnClick?: boolean;
disableContextMenu?: boolean;
style?: React.CSSProperties;
style?: CSSProperties;
}
const noop = () => { };
+2 -2
View File
@@ -82,7 +82,7 @@
"@univerjs/docs": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -66,7 +66,7 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}
+2 -2
View File
@@ -96,7 +96,7 @@
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.1.1",
"vitest": "^3.0.6"
"vite": "^6.2.0",
"vitest": "^3.0.7"
}
}

Some files were not shown because too many files have changed in this diff Show More