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: preact => react (#115)

白熱0487ab5cbbd0
diff --git a/examples/univer-doc-ts/esbuild.config.js b/examples/univer-doc-ts/esbuild.config.js
index a43cbc28d9..abc98bfa74 100644
--- a/examples/univer-doc-ts/esbuild.config.js
+++ b/examples/univer-doc-ts/esbuild.config.js
@@ -1,7 +1,6 @@
require('esbuild').build({
bundle: true,
color: true,
- alias: { react: 'preact/compat' },
loader: { '.svg': 'file' },
sourcemap: false,
plugins: [
diff --git a/examples/univer-preact-ts/.gitignore b/examples/univer-preact-ts/.gitignore
deleted file mode 100644
index 12e1bd6bec..0000000000
--- a/examples/univer-preact-ts/.gitignore
+++ /dev/null
@@ -1,101 +0,0 @@
-#ide
-*.DS_Store
-.idea
-.vscode
-
-#npm
-package-lock.json
-
-dist
-lib
-docs/.vuepress/dist
-
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-lerna-debug.log*
-
-# Runtime config
-pids
-*.pid
-*.seed
-*.pid.lock
-
-# Directory for instrumented libs generated by jscoverage/JSCover
-lib-cov
-
-# Coverage directory used by tools like istanbul
-coverage
-
-# nyc test coverage
-.nyc_output
-
-# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
-.grunt
-
-# Bower dependency directory (https://bower.io/)
-bower_components
-
-# node-waf configuration
-.lock-wscript
-
-# Compiled binary addons (https://nodejs.org/api/addons.html)
-build/Release
-
-# Dependency directories
-node_modules
-jspm_packages/
-
-# TypeScript v1 declaration files
-typings/
-
-# Optional npm cache directory
-.npm
-
-# Optional eslint cache
-.eslintcache
-
-# Optional REPL History
-.node_repl_history
-
-# Output of 'npm pack'
-*.tgz
-
-# Yarn Integrity file
-.yarn-integrity
-
-# dotenv environment variables file
-.env
-
-# next.js build output
-.next
-
-#lerna-changelog
-.changelog
-
-
-#editor workspace file
-.idea/
-
-
-.DS_Store
-
-.history
-# examples
-
-
-# Production
-/build
-
-# Generated files
-.docusaurus
-.cache-loader
-
-# Misc
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
diff --git a/examples/univer-preact-ts/README-zh.md b/examples/univer-preact-ts/README-zh.md
deleted file mode 100644
index d780fdb19a..0000000000
--- a/examples/univer-preact-ts/README-zh.md
+++ /dev/null
@@ -1,55 +0,0 @@
-# style-univer
-
-简体中文 | [English](./README.md)
-
-## 介绍
-
-UniverSheet Spreadsheet 插件
-
-### 安装
-
-```shell
-npm i univer-preact-ts
-```
-
-### 使用
-
-```js
-import {Spreadsheet} from 'univer-preact-ts'
-
-const univerSheet = new UniverSheet();
-univerSheet.installPlugin(new Spreadsheet());
-```
-
-## 本地开发
-
-### 环境
-
-- [Node.js](https://nodejs.org/en/) Version >= 10
-- [npm](https://www.npmjs.com/) Version >= 6
-
-### 安装
-
-```
-pnpm install
-```
-
-### 开发
-
-```
-# 当前目录 ./packages/preact-ts/
-npm run dev
-
-# 或者项目根目录 ./
-pnpm run --filter univer-preact-ts dev
-```
-
-### 打包
-
-```
-# 当前目录 ./packages/preact-ts/
-npm run build
-
-# 或者根目录 ./
-pnpm run --filter univer-preact-ts build
-```
diff --git a/examples/univer-preact-ts/README.md b/examples/univer-preact-ts/README.md
deleted file mode 100644
index ba2b8f6cb2..0000000000
--- a/examples/univer-preact-ts/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-# style-univer
-
-English| [简体中文](./README-zh.md)
-
-## Introduction
-
-UniverSheet Plugin Spreadsheet
-
-### Installation
-
-```shell
-npm i univer-preact-ts
-```
-
-### Usage
-
-```js
-import {Spreadsheet} from 'univer-preact-ts'
-
-const univerSheet = new UniverSheet();
-univerSheet.installPlugin(new Spreadsheet());
-```
-
-## Local development
-
-### Requirements
-
-- [Node.js](https://nodejs.org/en/) Version >= 10
-- [npm](https://www.npmjs.com/) Version >= 6
-
-### Installation
-
-```
-pnpm install
-```
-
-### Development
-
-```
-# Current directory ./packages/preact-ts/
-npm run dev
-
-# Or project root directory ./
-pnpm run --filter univer-preact-ts dev
-```
-
-### Package
-
-```
-# Current directory ./packages/preact-ts/
-npm run build
-
-# Or root directory ./
-pnpm run --filter univer-preact-ts build
-```
diff --git a/examples/univer-preact-ts/index.html b/examples/univer-preact-ts/index.html
deleted file mode 100644
index 0d8fbde566..0000000000
--- a/examples/univer-preact-ts/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8" />
- <link rel="icon" type="image/svg+xml" href="favicon.svg" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>UniverSheet</title>
- <style>
- html,
- body {
- height: 100%;
- }
- </style>
-</head>
-
-<body>
- <div id="app" style="z-index: 1; position: fixed; font-size: 20px; color: green;"></div>
- <div id="universheet-demo" style="height: 90vh;"></div>
- <div id="universheet-demo-down" style="height: 50vh;"></div>
- <script type="module" src="/src/main.tsx"></script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/examples/univer-preact-ts/jest.config.js b/examples/univer-preact-ts/jest.config.js
deleted file mode 100644
index a1ab72c760..0000000000
--- a/examples/univer-preact-ts/jest.config.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
-module.exports = {
- preset: 'ts-jest',
- testEnvironment: 'jsdom',
- moduleFileExtensions: ['js', 'ts', 'tsx'],
-
- roots: ['<rootDir>/src'],
- testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
- transform: {
- '^.+\\.(ts|tsx)$': 'ts-jest',
- '^.+\\.tsx?$': 'babel-jest', // https://github.com/kulshekhar/ts-jest/issues/937#issuecomment-455431207
- },
- globals: {
- 'ts-jest': {
- tsConfig: 'tsconfig.json',
- },
- },
-};
diff --git a/examples/univer-preact-ts/package.json b/examples/univer-preact-ts/package.json
deleted file mode 100644
index 2ba88c19b4..0000000000
--- a/examples/univer-preact-ts/package.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "name": "univer-preact-ts",
- "version": "0.0.1",
- "description": "UniverSheet normal preact-ts",
- "keywords": [],
- "author": "DreamNum <[email protected]>",
- "license": "MIT",
- "directories": {
- "lib": "lib"
- },
- "private": true,
- "scripts": {
- "test": "jest",
- "dev": "vite",
- "build": "tsc && vite build",
- "watch": "vite build",
- "serve": "vite preview"
- },
- "devDependencies": {
- "@preact/preset-vite": "2.0.0",
- "@testing-library/preact": "^2.0.1",
- "@types/jest": "^27.5.2",
- "@types/node": "^18.14.0",
- "enzyme": "^3.11.0",
- "enzyme-adapter-preact-pure": "^3.3.0",
- "identity-obj-proxy": "^3.0.0",
- "jest-dev-server": "^6.1.1",
- "jest-environment-jsdom": "^29.0.3",
- "less": "^4.1.1",
- "prettier": "^2.3.2",
- "ts-jest": "29.0.1",
- "ts-node": "^10.9.1",
- "typescript": "^4.4.1-rc",
- "vite": "^2.4.4",
- "vite-plugin-external": "1.2.3"
- },
- "dependencies": {
- "@univerjs/base-docs": "workspace:^0.0.1",
- "@univerjs/base-render": "workspace:^0.0.1",
- "@univerjs/base-sheets": "workspace:^0.0.1",
- "@univerjs/base-slides": "workspace:^0.0.1",
- "@univerjs/base-ui": "workspace:^0.0.1",
- "@univerjs/common-plugin-collaboration": "workspace:^0.0.1",
- "@univerjs/common-plugin-data": "workspace:^0.0.1",
- "@univerjs/core": "workspace:^0.0.1",
- "@univerjs/sheets-plugin-operation": "workspace:^0.0.1",
- "@univerjs/sheets-plugin-formula": "workspace:^0.0.1",
- "@univerjs/sheets-plugin-import-xlsx": "workspace:^0.0.1",
- "@univerjs/sheets-plugin-numfmt": "workspace:^0.0.1",
- "@univerjs/ui-plugin-docs": "workspace:^0.0.1",
- "@univerjs/ui-plugin-sheets": "workspace:^0.0.1",
- "@univerjs/ui-plugin-slides": "workspace:^0.0.1",
- "preact": "^10.12.1"
- }
-}
\ No newline at end of file
diff --git a/examples/univer-preact-ts/src/Types/index.d.ts b/examples/univer-preact-ts/src/Types/index.d.ts
deleted file mode 100644
index 51d88a4b64..0000000000
--- a/examples/univer-preact-ts/src/Types/index.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/// <reference types="vite/client" />
-
-export * from '../index';
-declare module 'univer-preact-ts' {}
-
-
-// use css module
-declare module '*.less' {
- const resource: { [key: string]: string };
- export = resource;
-}
diff --git a/examples/univer-preact-ts/src/Types/preact.d.ts b/examples/univer-preact-ts/src/Types/preact.d.ts
deleted file mode 100644
index 21573e1251..0000000000
--- a/examples/univer-preact-ts/src/Types/preact.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-/// <reference types="enzyme-adapter-preact-pure" />
-import JSX = preact.JSX;
-
-declare module 'enzyme';
\ No newline at end of file
diff --git a/examples/univer-preact-ts/src/index.ts b/examples/univer-preact-ts/src/index.ts
deleted file mode 100644
index 7c228f8753..0000000000
--- a/examples/univer-preact-ts/src/index.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-import { Univer, IDocumentData, ISlideData, IWorkbookConfig, UniverDoc, UniverSheet, UniverSlide, IUniverData } from '@univerjs/core';
-import { RenderEngine } from '@univerjs/base-render';
-
-import { ISheetPluginConfig, SheetPlugin } from '@univerjs/base-sheets';
-import { SheetUIPlugin, ISheetUIPluginConfig } from '@univerjs/ui-plugin-sheets';
-import { DocUIPlugin, IDocUIPluginConfig } from '@univerjs/ui-plugin-docs';
-import { SlideUIPlugin, ISlideUIPluginConfig } from '@univerjs/ui-plugin-slides';
-import { IDocPluginConfig, DocPlugin } from '@univerjs/base-docs';
-import { ISlidePluginConfig, SlidePlugin } from '@univerjs/base-slides';
-// import { CollaborationPlugin, ICollaborationPluginConfig } from '@univerjs/common-plugin-collaboration';
-import { IFormulaConfig } from '@univerjs/sheets-plugin-formula';
-import { CollaborationPlugin, ICollaborationPluginConfig } from '@univerjs/common-plugin-collaboration';
-import { OperationPlugin } from '@univerjs/sheets-plugin-operation';
-import { ImportXlsxPlugin } from '@univerjs/sheets-plugin-import-xlsx';
-// import { INumfmtPluginConfig, NumfmtPlugin } from '@univerjs/sheets-plugin-numfmt';
-// import { OperationPlugin } from '@univerjs/sheets-plugin-operation';
-// import { ImportXlsxPlugin } from '@univerjs/sheets-plugin-import-xlsx';
-
-interface ISheetPropsCustom {
- univerConfig?: Partial<IUniverData>;
- coreConfig?: Partial<IWorkbookConfig>;
- baseSheetsConfig?: ISheetPluginConfig;
- uiSheetsConfig?: ISheetUIPluginConfig;
- // numfmtConfig?: INumfmtPluginConfig;
- formulaConfig?: IFormulaConfig;
- collaborationConfig?: ICollaborationPluginConfig;
-}
-
-/**
- * Initialize the core and all plugins
- */
-class UniverSheetCustom {
- init(config: ISheetPropsCustom = {}): UniverSheet {
- const univer = new Univer(config.univerConfig);
-
- // base-render
- univer.install(new RenderEngine());
- // universheet instance
- const universheet = UniverSheet.newInstance(config.coreConfig);
- univer.addUniverSheet(universheet);
-
- // base-sheets
- universheet.installPlugin(new SheetPlugin(config.baseSheetsConfig));
-
- // ui-plugin-sheets
- univer.install(new SheetUIPlugin(config.uiSheetsConfig));
- univer.install(new CollaborationPlugin(config.collaborationConfig));
- // universheet.installPlugin(new NumfmtPlugin(config.numfmtConfig));
- // FormulaPlugin.create(config.formulaConfig).installTo(universheet);
-
- universheet.installPlugin(new OperationPlugin());
- universheet.installPlugin(new ImportXlsxPlugin());
-
- return universheet;
- }
-}
-/**
- * Wrapped into a function,easy to use
- * @param config
- * @returns
- */
-const univerSheetCustom = function (config?: ISheetPropsCustom) {
- return new UniverSheetCustom().init(config);
-};
-
-interface IDocPropsCustom {
- univerConfig?: Partial<IUniverData>;
- coreConfig?: Partial<IDocumentData>;
- baseDocsConfig?: IDocPluginConfig;
- uiDocsConfig?: IDocUIPluginConfig;
-}
-
-/**
- * Initialize the core and all plugins
- */
-class UniverDocCustom {
- init(config: IDocPropsCustom = {}): UniverDoc {
- const univer = new Univer(config.univerConfig);
-
- // base-render
- univer.install(new RenderEngine());
-
- // univerdoc instance
- const univerdoc = UniverDoc.newInstance(config.coreConfig);
- univer.addUniverDoc(univerdoc);
-
- // base-docs
- univerdoc.installPlugin(new DocPlugin(config.baseDocsConfig));
-
- // ui-plugin-sheets
- univer.install(new DocUIPlugin(config.uiDocsConfig));
-
- return univerdoc;
- }
-}
-/**
- * Wrapped into a function,easy to use
- * @param config
- * @returns
- */
-const univerDocCustom = function (config?: IDocPropsCustom) {
- return new UniverDocCustom().init(config);
-};
-
-interface ISlidePropsCustom {
- univerConfig?: Partial<IUniverData>;
- coreConfig?: Partial<ISlideData>;
- baseSlidesConfig?: ISlidePluginConfig;
- uiSlidesConfig?: ISlideUIPluginConfig;
-}
-
-/**
- * Initialize the core and all plugins
- */
-class UniverSlideCustom {
- init(config: ISlidePropsCustom = {}): UniverSlide {
- const univer = new Univer(config.univerConfig);
-
- // base-render
- univer.install(new RenderEngine());
- // universlide instance
- const universlide = UniverSlide.newInstance(config.coreConfig);
- univer.addUniverSlide(universlide);
-
- // base-slides
- universlide.installPlugin(new SlidePlugin(config.baseSlidesConfig));
- // ui-plugin-slides
- univer.install(new SlideUIPlugin(config.uiSlidesConfig));
-
- return universlide;
- }
-}
-/**
- * Wrapped into a function,easy to use
- * @param config
- * @returns
- */
-const univerSlideCustom = function (config?: ISlidePropsCustom) {
- return new UniverSlideCustom().init(config);
-};
-
-export { univerSheetCustom, univerDocCustom, univerSlideCustom };
-
-export * as UniverCore from '@univerjs/core';
-export * as BaseRender from '@univerjs/base-render';
-export * as BaseComponent from '@univerjs/base-ui';
-export * as BaseSheets from '@univerjs/base-sheets';
-export * as BaseDocs from '@univerjs/base-docs';
-export * as BaseSlides from '@univerjs/base-slides';
-export * as UIPluginSheets from '@univerjs/ui-plugin-sheets';
-export * as UIPluginDocs from '@univerjs/ui-plugin-docs';
-export * as UIPluginSlides from '@univerjs/ui-plugin-slides';
-export * as CommonPluginData from '@univerjs/common-plugin-data';
-// export * as CommonPluginCollaboration from '@univerjs/common-plugin-collaboration';
-// export * as SheetsPluginFormula from '@univerjs/sheets-plugin-formula';
-// export * as SheetsPluginNumfmt from '@univerjs/sheets-plugin-numfmt';
-// export * as SheetsPluginClipboard from '@univerjs/sheets-plugin-operation';
-// export * as SheetsPluginImportXlsx from '@univerjs/sheets-plugin-import-xlsx';
diff --git a/examples/univer-preact-ts/src/main.tsx b/examples/univer-preact-ts/src/main.tsx
deleted file mode 100644
index 2aec98d83d..0000000000
--- a/examples/univer-preact-ts/src/main.tsx
+++ /dev/null
@@ -1,388 +0,0 @@
-import { DEFAULT_WORKBOOK_DATA_DEMO7 } from '@univerjs/common-plugin-data';
-import { Tools } from '@univerjs/core';
-import { univerSheetCustom } from '.';
-
-const baseSheetsConfig = {
- selections: {
- 'sheet-01': [
- {
- selection: {
- startRow: 0,
- endRow: 0,
- startColumn: 3,
- endColumn: 3,
- },
- cell: {
- row: 0,
- column: 3,
- },
- },
- ],
- },
-};
-let uiSheetsConfig = {
- container: 'universheet-demo',
- layout: {
- sheetContainerConfig: {
- infoBar: false,
- formulaBar: false,
- toolbar: true,
- sheetBar: true,
- countBar: false,
- rightMenu: false,
- },
- },
-};
-
-let columnCount = 8;
-if (window.innerWidth < 1366) {
- columnCount = 5;
-}
-const defaultWorkbookData = Tools.deepClone(DEFAULT_WORKBOOK_DATA_DEMO7);
-// defaultWorkbookData.id = 'workbook-01';
-// defaultWorkbookData.styles = null;
-// defaultWorkbookData.namedRanges = null;
-// defaultWorkbookData.sheets = {
-// 'sheet-01': {
-// type: 0,
-// id: 'sheet-01',
-// name: 'sheet1',
-// columnCount,
-// status: 1,
-// cellData: {
-// '0': {
-// '0': {
-// m: '',
-// v: '',
-// },
-// },
-// },
-// },
-// };
-
-const ipAddress = 'localhost:8500';
-// const ipAddress = '47.100.177.253:8500'
-const config = { type: 'sheet', template: 'DEMO1' };
-
-insertButton();
-insertUpdateButton();
-
-interface Message {
- id: string;
- config: string;
-}
-function insertInputBox(id: string) {
- // 创建一个输入框元素
- const box = document.createElement('input');
- box.type = 'text';
-
- document.body.appendChild(box);
-
- box.style.position = 'fixed';
- box.style.right = '0';
- box.style.top = '70px';
- box.addEventListener('blur', (e) => {
- const txt = (e.target as HTMLInputElement).value;
- const message = {
- type: 'data',
- data: txt,
- };
- sendMessage(message);
- });
-
- const url = `${`ws://${ipAddress}/ws/`}${id}`;
- const socket = new WebSocket(url);
-
- // 连接建立时触发的事件
- socket.onopen = function (event) {
- console.log('WebSocket connected');
- };
-
- // 接收到消息时触发的事件
- socket.onmessage = function (event) {
- const message = JSON.parse(event.data);
- console.log('Received message:', message);
- };
-
- // 连接关闭时触发的事件
- socket.onclose = function (event) {
- console.log('WebSocket closed:', event);
- };
-
- // 发送消息
- function sendMessage(message: object) {
- socket.send(JSON.stringify(message));
- }
-}
-// openDocs()
-function insertUpdateButton() {
- // 创建一个输入框元素
- const input = document.createElement('input');
- input.type = 'text';
-
- document.body.appendChild(input);
-
- input.style.position = 'fixed';
- input.style.right = '0';
- input.style.top = '30px';
-
- // 创建一个按钮元素
- const button = document.createElement('button');
- button.textContent = '确定';
-
- document.body.appendChild(button);
-
- button.style.position = 'fixed';
- button.style.right = '0';
- button.style.top = '50px';
-
- // 添加按钮点击事件处理程序
- button.addEventListener('click', () => {
- // 获取输入框的值
- const inputValue = input.value;
- openDocs(inputValue, (json: Message) => {
- const universheetconfig = json.config;
- const id = json.id;
-
- const downUISheetsConfig = {
- container: 'universheet-demo',
- };
- const univerSheet = univerSheetCustom({
- univerConfig: {
- id,
- },
- coreConfig: JSON.parse(universheetconfig),
- uiSheetsConfig: downUISheetsConfig,
- collaborationConfig: {
- url: `${`ws://${ipAddress}/ws/`}${id}`,
- },
- });
-
- // const ids = univerSheet.getWorkBook().getContext().getUniver().getGlobalContext().getUniverId();
- // console.info('ids===',ids)
-
- // insertInputBox(id)
- });
-
- // insertInputBox(inputValue)
- });
-}
-
-function insertButton() {
- // 创建一个按钮元素
- const button = document.createElement('button');
- // 设置按钮文本
- button.textContent = 'New Docs';
- // 将按钮添加到body元素中
- document.body.appendChild(button);
-
- button.style.position = 'fixed';
- button.style.right = '0';
- button.style.top = '0';
-
- // 添加按钮点击事件处理程序
- button.addEventListener('click', () => {
- newDocs(`http://${ipAddress}/new`, config, (json: Message) => {
- const id = json.id;
- const config = json.config;
-
- if (config === 'default') {
- const universheet = univerSheetCustom({
- uiSheetsConfig,
- coreConfig: defaultWorkbookData,
- });
-
- const universheetconfig = universheet.getWorkBook().getConfig();
-
- updateDocs(id, universheetconfig);
- }
- });
- });
-}
-function newDocs(url: string, params: object, cb?: (json: Message) => void) {
- fetch(url, {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify(params),
- })
- .then((response) => {
- if (response.ok) {
- return response.json();
- }
- throw new Error(response.statusText);
- })
- .then((document) => {
- // 处理获取到的文档信息
- console.log(document);
- cb && cb(document);
- })
- .catch((error) => {
- console.error(error);
- });
-}
-
-function openDocs(id: string, cb?: (obj: Message) => void) {
- // 定义请求参数
- const data = new FormData();
- data.append('id', id);
-
- // 创建 XMLHttpRequest 对象
- const xhr = new XMLHttpRequest();
-
- // 监听请求完成事件
- xhr.onload = function () {
- if (xhr.status === 200) {
- const document = JSON.parse(xhr.responseText);
- // 处理获取到的文档信息
- console.log(document);
- cb && cb(document);
- } else {
- console.error(xhr.statusText);
- }
- };
-
- // 发送 POST 请求
- xhr.open('POST', `http://${ipAddress}/open`, true);
- xhr.send(data);
-}
-function updateDocs(id: string, config: object, cb?: (obj: object) => void) {
- // 定义请求参数
- const data = new FormData();
- data.append('id', id);
- data.append('config', JSON.stringify(config));
-
- // 创建 XMLHttpRequest 对象
- const xhr = new XMLHttpRequest();
-
- // 监听请求完成事件
- xhr.onload = function () {
- if (xhr.status === 200) {
- const document = JSON.parse(xhr.responseText);
- // 处理获取到的文档信息
- console.log(document);
- cb && cb(document);
- } else {
- console.error(xhr.statusText);
- }
- };
-
- // 发送 POST 请求
- xhr.open('POST', `http://${ipAddress}/update`, true);
- xhr.send(data);
-}
-
-// const sheetConfigDown = {
-// container: 'universheet-demo-down',
-// layout: {
-// sheetContainerConfig: {
-// infoBar: false,
-// formulaBar: false,
-// toolbar: false,
-// sheetBar: true,
-// countBar: false,
-// rightMenu: false,
-// },
-// },
-// selections: {
-// 'sheet-001': [
-// {
-// selection: {
-// startRow: 0,
-// endRow: 0,
-// startColumn: 0,
-// endColumn: 0,
-// },
-// cell: {
-// row: 0,
-// column: 0,
-// },
-// },
-// ],
-// },
-// };
-
-// const defaultWorkbookDataDown = Tools.deepClone(DEFAULT_WORKBOOK_DATA_DOWN);
-// defaultWorkbookDataDown.id = 'workbook-02';
-// defaultWorkbookDataDown.styles = null;
-// defaultWorkbookDataDown.namedRanges = null;
-// defaultWorkbookDataDown.sheets = {
-// 'sheet-001': {
-// type: 0,
-// id: 'sheet-001',
-// name: 'sheet001',
-// columnCount,
-// status: 1,
-// },
-// 'sheet-002': {
-// type: 0,
-// id: 'sheet-002',
-// name: 'sheet002',
-// columnCount: columnCount + 10,
-// },
-// };
-
-// univerSheetCustom({
-// coreConfig: defaultWorkbookDataDown,
-// baseSheetsConfig: sheetConfigDown,
-// });
-
-// run('universheet-demo')
-// run('universheet-demo-down')
-// function run(container:string) {
-// const sheetConfig = {
-// container,
-// layout: {
-// innerRight: false,
-// outerLeft: false,
-// toolbarConfig: {
-// paintFormat: false,
-// currencyFormat: false,
-// percentageFormat: false,
-// numberDecrease: false,
-// numberIncrease: false,
-// moreFormats: false,
-// },
-// },
-// selections: {
-// 'sheet-01': [
-// {
-// selection: {
-// startRow: 0,
-// endRow: 0,
-// startColumn: 3,
-// endColumn: 3,
-// },
-// cell: {
-// row: 0,
-// column: 3,
-// },
-// },
-// ],
-// },
-// };
-
-// let columnCount = 8
-// if(window.innerWidth < 1366){
-// columnCount = 5;
-// }
-// const defaultWorkbookData = Tools.deepClone(DEFAULT_WORKBOOK_DATA);
-// defaultWorkbookData.id = Tools.generateRandomId(6);
-// defaultWorkbookData.styles = null;
-// defaultWorkbookData.namedRanges = null;
-// defaultWorkbookData.sheets = {
-// 'sheet-01':{
-// type: 0,
-// id: 'sheet-01',
-// name: 'sheet1',
-// columnCount,
-// status:1
-// }
-// };
-
-// univerSheetCustom({
-// coreConfig:defaultWorkbookData,
-// baseSheetsConfig: sheetConfig,
-// });
-// }
diff --git a/examples/univer-preact-ts/tsconfig.json b/examples/univer-preact-ts/tsconfig.json
deleted file mode 100644
index 69b5c31f0b..0000000000
--- a/examples/univer-preact-ts/tsconfig.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "extends": "../../tsconfig.json",
- "compilerOptions": {
- "rootDir": "./",
- "outDir": "lib",
- "moduleResolution": "Node", //This value is needed for Node.js.
- "baseUrl": "./",
- "esModuleInterop": true, // auto allowSyntheticDefaultImports true
- "strictPropertyInitialization": false
- },
- "include": [
- "src/**/*",
- "test/**/*.test.(ts|tsx|js)"
- ]
-}
\ No newline at end of file
diff --git a/examples/univer-preact-ts/vite.config.ts b/examples/univer-preact-ts/vite.config.ts
deleted file mode 100644
index b2c450014c..0000000000
--- a/examples/univer-preact-ts/vite.config.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { defineConfig } from 'vite';
-import path from 'path';
-import preact from '@preact/preset-vite';
-import legacy from '@vitejs/plugin-legacy';
-import { name, version } from './package.json';
-import createExternal from 'vite-plugin-external';
-
-const resolve = (url: string) => path.resolve(__dirname, url);
-
-export default defineConfig({
- build: {
- lib: {
- entry: resolve('src/index.ts'),
- name: 'UniverPreactTs',
- formats: ['es', 'cjs', 'umd', 'iife'],
- fileName: 'univer-preact-ts',
- },
- outDir: './lib',
- //sourcemap: true,
- },
- define: {
- pkgJson: { name, version },
- },
- css: {
- modules: {
- localsConvention: 'camelCaseOnly', // dash to camelCase conversion// .apply-color -> applyColor
- generateScopedName: 'univer-[local]', // custom prefix class name
- },
- preprocessorOptions: {
- less: {
- javascriptEnabled: true,
- },
- },
- },
- server: {
- port: 3103,
- open: true, // Automatically open the app in the browser on server start.
- },
- plugins: [
- preact(),
- // legacy({
- // targets: ['ie >= 11'],
- // additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
- // }),
- createExternal({
- externals: {
- // '@univerjs/core': '@univerjs/core',
- // '@univerjs/style-univer': '@univerjs/style-univer',
- // preact: 'preact',
- // react: 'react',
- },
- }),
- ],
-});
diff --git a/examples/univer-sheet-ts/esbuild.config.js b/examples/univer-sheet-ts/esbuild.config.js
index a43cbc28d9..abc98bfa74 100644
--- a/examples/univer-sheet-ts/esbuild.config.js
+++ b/examples/univer-sheet-ts/esbuild.config.js
@@ -1,7 +1,6 @@
require('esbuild').build({
bundle: true,
color: true,
- alias: { react: 'preact/compat' },
loader: { '.svg': 'file' },
sourcemap: false,
plugins: [
diff --git a/examples/univer-slide-ts/esbuild.config.js b/examples/univer-slide-ts/esbuild.config.js
index a43cbc28d9..abc98bfa74 100644
--- a/examples/univer-slide-ts/esbuild.config.js
+++ b/examples/univer-slide-ts/esbuild.config.js
@@ -1,7 +1,6 @@
require('esbuild').build({
bundle: true,
color: true,
- alias: { react: 'preact/compat' },
loader: { '.svg': 'file' },
sourcemap: false,
plugins: [
diff --git a/package.json b/package.json
index cce5dc4a1d..6e315a490d 100644
--- a/package.json
+++ b/package.json
@@ -50,6 +50,8 @@
"@types/jest": "28.1.8",
"@types/node": "^18.14.0",
"@types/numeral": "^2.0.2",
+ "@types/react": "^18.2.21",
+ "@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"cross-env": "^7.0.3",
@@ -89,6 +91,8 @@
]
},
"dependencies": {
- "pnpm": "^8.6.4"
+ "pnpm": "^8.6.4",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0"
}
}
\ No newline at end of file
diff --git a/packages/base-ui/esbuild.config.js b/packages/base-ui/esbuild.config.js
index 19e710ecfa..f2a525abd3 100644
--- a/packages/base-ui/esbuild.config.js
+++ b/packages/base-ui/esbuild.config.js
@@ -2,7 +2,6 @@ const baseconfig = require('../../esbuild.config');
require('esbuild').build({
...baseconfig,
- alias: { react: 'preact/compat' },
globalName: 'UniverBaseUi',
outfile: './lib/univer-base-ui.js',
});
diff --git a/packages/base-ui/src/BaseComponent.ts b/packages/base-ui/src/BaseComponent.ts
index 18b63c4e16..a333049d8d 100644
--- a/packages/base-ui/src/BaseComponent.ts
+++ b/packages/base-ui/src/BaseComponent.ts
@@ -1,5 +1,5 @@
-import { ComponentClass } from 'preact';
-import { ForwardFn } from 'preact/compat';
+import { ComponentClass } from 'react';
+import { ForwardFn } from 'react';
import { BasePlugin } from '@univerjs/core';
import { Context } from '@univerjs/core/src/Basics/Context';
import { Description } from './Interfaces';
diff --git a/packages/base-ui/src/Common/AppContext.tsx b/packages/base-ui/src/Common/AppContext.tsx
index 8c94657d2c..317bab62ae 100644
--- a/packages/base-ui/src/Common/AppContext.tsx
+++ b/packages/base-ui/src/Common/AppContext.tsx
@@ -2,7 +2,7 @@
* Use createContext to provide global language and skin settings
*/
import { LocaleService, ObserverManager } from '@univerjs/core';
-import { createContext } from 'preact';
+import { createContext } from 'react';
import { Injector } from '@wendellhu/redi';
import { LocaleType } from '../Enum';
diff --git a/packages/base-ui/src/Common/ComponentManager.ts b/packages/base-ui/src/Common/ComponentManager.ts
index 795b88cab3..2521762ab5 100644
--- a/packages/base-ui/src/Common/ComponentManager.ts
+++ b/packages/base-ui/src/Common/ComponentManager.ts
@@ -48,6 +48,7 @@ import {
TopVerticalIcon,
UnderLineIcon,
VerticalBorderIcon,
+ FxIcon,
} from '../Components/Icon';
import { Item } from '../Components/Item/Item';
@@ -108,6 +109,7 @@ export class ComponentManager {
BorderMediumDashDot,
BorderMediumDashDotDot,
BorderThick,
+ FxIcon,
};
for (const k in iconList) {
diff --git a/packages/base-ui/src/Common/CustomHook.tsx b/packages/base-ui/src/Common/CustomHook.tsx
index b2c585e5d8..a1023e0fa1 100644
--- a/packages/base-ui/src/Common/CustomHook.tsx
+++ b/packages/base-ui/src/Common/CustomHook.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useRef, useState } from 'preact/compat';
+import { useEffect, useRef, useState } from 'react';
/**
*
diff --git a/packages/base-ui/src/Components/Button/Button.tsx b/packages/base-ui/src/Components/Button/Button.tsx
index 0849063b32..4cc6bcb640 100644
--- a/packages/base-ui/src/Components/Button/Button.tsx
+++ b/packages/base-ui/src/Components/Button/Button.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
import { BaseButtonProps } from '../../BaseComponent';
import { joinClassNames } from '../../Utils';
import { LoadingIcon } from '../Icon';
@@ -101,7 +101,7 @@ class Button extends Component<BaseButtonProps, IState> {
);
};
- override componentWillReceiveProps(props: BaseButtonProps) {
+ override UNSAFE_componentWillReceiveProps(props: BaseButtonProps) {
this.setState({
isActive: props.active,
});
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashDot.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashDot.tsx
index 5d033d44d5..fcf401ef4d 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashDot.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashDot.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderDashDot extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'DashDot', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="DashDot"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashDotDot.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashDotDot.tsx
index fb0efac38d..3c5e5e02ef 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashDotDot.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashDotDot.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderDashDotDot extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'DashDotDot', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="DashDotDot"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashed.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashed.tsx
index bc5f511ea2..1cce10f771 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashed.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDashed.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderDashed extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- let ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'Dashed', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="Dashed"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDotted.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDotted.tsx
index ce311d8892..bf7f52d028 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDotted.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderDotted.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderDotted extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'Dotted', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="Dotted"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderHair.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderHair.tsx
index 5f0d7aea08..ad6e431330 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderHair.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderHair.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderHair extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'Hair', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="Hair"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMedium.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMedium.tsx
index 8bff801354..07b6521568 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMedium.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMedium.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderMedium extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'Medium', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="Medium"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashDot.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashDot.tsx
index 4ba45285e5..c3f207e810 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashDot.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashDot.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderMediumDashDot extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'MediumDashDot', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="MediumDashDot"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashDotDot.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashDotDot.tsx
index 0d70e2ad14..d490749baa 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashDotDot.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashDotDot.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderMediumDashDotDot extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'MediumDashDotDot', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="MediumDashDotDot"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
export class UniverBorderMediumDashDotDot implements IconComponent {
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashed.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashed.tsx
index 3270fdeaaf..8ca17163d8 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashed.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderMediumDashed.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderMediumDashed extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'MediumDashed', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="MediumDashed"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderThick.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderThick.tsx
index 1a703a89dd..20c37facae 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderThick.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderThick.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderThick extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'Thick', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="Thick"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderThin.tsx b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderThin.tsx
index b828a84d4d..10da63d201 100644
--- a/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderThin.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/BorderLine/BorderThin.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef, RefObject } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../../BaseComponent';
import { IconComponent } from '../../../Interfaces';
import { CanvasIcon } from '../CanvasIcon';
@@ -10,19 +10,20 @@ interface IProps {
interface IState {}
class BorderThin extends Component<IProps, IState> {
- ref = createRef();
-
- drawLine(ref: RefObject<CanvasIcon>) {
- const canvas = ref.current! as unknown as HTMLCanvasElement;
- const ctx = canvas.getContext('2d')!;
- this.ref.current.setLineDash(ctx, 'Thin', 'h', 0, 5, 100, 5);
- ctx.stroke();
- ctx.closePath();
- }
-
render() {
const { width = '100', height = '10' } = this.props;
- return <CanvasIcon ref={this.ref} width={width} height={height} drawLine={(dom) => this.drawLine(dom)} />;
+ return (
+ <CanvasIcon
+ width={width}
+ height={height}
+ type="Thin"
+ hv="h"
+ mSt={0}
+ mEd={5}
+ lineSt={100}
+ lineEd={5}
+ />
+ );
}
}
diff --git a/packages/base-ui/src/Components/CanvasIcon/CanvasIcon.tsx b/packages/base-ui/src/Components/CanvasIcon/CanvasIcon.tsx
index 8f4658e45c..69de1b564f 100644
--- a/packages/base-ui/src/Components/CanvasIcon/CanvasIcon.tsx
+++ b/packages/base-ui/src/Components/CanvasIcon/CanvasIcon.tsx
@@ -1,24 +1,29 @@
-import { Component, createRef, RefObject } from 'preact';
+import { useEffect, useRef } from 'react';
import Style from './index.module.less';
type IProps = {
width: string;
height: string;
- drawLine: (dom: RefObject<CanvasIcon>) => void;
+ type: string;
+ hv: string;
+ mSt: number;
+ mEd: number;
+ lineSt: number;
+ lineEd: number;
};
type IState = {};
-class CanvasIcon extends Component<IProps, IState> {
- canvasRef = createRef();
+export function CanvasIcon(props: IProps) {
+ const { type, hv, mSt: m_st, mEd: m_ed, lineSt: line_st, lineEd: line_ed } = props
- override componentDidMount() {
- this.drawLine();
- }
+ const canvasRef = useRef<HTMLCanvasElement>(null);
- drawLine() {
- const canvas = this.canvasRef;
- this.props.drawLine(canvas);
- }
+ useEffect(() => {
+ if (!canvasRef.current) return;
+
+ const ctx = canvasRef.current.getContext('2d')!;
+ setLineDash(ctx);
+ }, [])
/**
*
@@ -30,23 +35,23 @@ class CanvasIcon extends Component<IProps, IState> {
* @param line_st End X
* @param line_ed End Y
*/
- setLineDash(ctx: CanvasRenderingContext2D, type: string, hv: string, m_st: number, m_ed: number, line_st: number, line_ed: number) {
- const borderType: { [index: string]: string } = {
- '0': 'none',
- '1': 'Thin',
- '2': 'Hair',
- '3': 'Dotted',
- '4': 'Dashed',
- '5': 'DashDot',
- '6': 'DashDotDot',
- '7': 'Double',
- '8': 'Medium',
- '9': 'MediumDashed',
- '10': 'MediumDashDot',
- '11': 'MediumDashDotDot',
- '12': 'SlantedDashDot',
- '13': 'Thick',
- };
+ function setLineDash(ctx: CanvasRenderingContext2D) {
+ // const borderType: { [index: string]: string } = {
+ // '0': 'none',
+ // '1': 'Thin',
+ // '2': 'Hair',
+ // '3': 'Dotted',
+ // '4': 'Dashed',
+ // '5': 'DashDot',
+ // '6': 'DashDotDot',
+ // '7': 'Double',
+ // '8': 'Medium',
+ // '9': 'MediumDashed',
+ // '10': 'MediumDashDot',
+ // '11': 'MediumDashDotDot',
+ // '12': 'SlantedDashDot',
+ // '13': 'Thick',
+ // };
try {
if (type === 'Hair') {
@@ -87,11 +92,10 @@ class CanvasIcon extends Component<IProps, IState> {
ctx.lineTo(line_st, line_ed);
ctx.lineWidth = 1;
}
- }
- render() {
- return <canvas ref={this.canvasRef} className={Style.canvas} width={this.props.width} height={this.props.height} />;
+ ctx.stroke();
+ ctx.closePath();
}
-}
-export { CanvasIcon };
+ return <canvas ref={canvasRef} className={Style.canvas} width={props.width} height={props.height} />;
+}
diff --git a/packages/base-ui/src/Components/CellRange/CellRange.tsx b/packages/base-ui/src/Components/CellRange/CellRange.tsx
index ecd55311d8..7f4ac53275 100644
--- a/packages/base-ui/src/Components/CellRange/CellRange.tsx
+++ b/packages/base-ui/src/Components/CellRange/CellRange.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { Icon, Modal } from '..';
import { BaseComponentProps } from '../../BaseComponent';
import { ModalButtonGroup } from '../../Interfaces';
@@ -62,7 +62,7 @@ export class CellRange extends Component<BaseCellRangeModalProps, IState> {
onChange?.(e);
};
- override componentWillReceiveProps(props: BaseCellRangeModalProps) {
+ override UNSAFE_componentWillReceiveProps(props: BaseCellRangeModalProps) {
if (props.value !== this.state.value) {
this.setState({
value: props.value,
@@ -81,7 +81,7 @@ export class CellRange extends Component<BaseCellRangeModalProps, IState> {
<Icon.Sheet.TableIcon />
</span>
<Modal title={title} visible={show} group={this.group}>
- <Input readonly={true} placeholder={contentPlaceholder} value={value} ref={this.ref}></Input>
+ <Input readOnly={true} placeholder={contentPlaceholder} value={value} ref={this.ref}></Input>
</Modal>
</div>
);
diff --git a/packages/base-ui/src/Components/Checkbox/Checkbox.tsx b/packages/base-ui/src/Components/Checkbox/Checkbox.tsx
index 37ad72184a..75d659415b 100644
--- a/packages/base-ui/src/Components/Checkbox/Checkbox.tsx
+++ b/packages/base-ui/src/Components/Checkbox/Checkbox.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseCheckboxProps, CheckboxComponent } from '../../Interfaces';
import { joinClassNames } from '../../Utils';
@@ -34,11 +34,11 @@ export class Checkbox extends Component<BaseCheckboxProps, CheckboxState> {
this.setState((prevState) => ({ classes: classGroup, check: checked }));
};
- override componentWillMount() {
+ override UNSAFE_componentWillMount() {
this.handleStyle(this.props.checked, this.props.disabled);
}
- override componentWillReceiveProps(nextProps: BaseCheckboxProps) {
+ override UNSAFE_componentWillReceiveProps(nextProps: BaseCheckboxProps) {
this.handleStyle(nextProps.checked, nextProps.disabled);
}
@@ -50,9 +50,9 @@ export class Checkbox extends Component<BaseCheckboxProps, CheckboxState> {
this.props.onChange?.(e);
};
- render(props: BaseCheckboxProps, state: CheckboxState) {
- const { classes, check } = state;
- const { value, name, disabled, children } = props;
+ render() {
+ const { classes, check } = this.state;
+ const { value, name, disabled, children } = this.props;
return (
<label className={styles.checkboxWrapper}>
<span className={classes}>
diff --git a/packages/base-ui/src/Components/Checkbox/Group.tsx b/packages/base-ui/src/Components/Checkbox/Group.tsx
index a9b434921d..f14e6c6645 100644
--- a/packages/base-ui/src/Components/Checkbox/Group.tsx
+++ b/packages/base-ui/src/Components/Checkbox/Group.tsx
@@ -1,4 +1,4 @@
-import { useRef } from 'preact/hooks';
+import { useRef } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseCheckboxGroupProps, CheckboxGroupComponent } from '../../Interfaces';
import { Checkbox } from './Checkbox';
@@ -50,7 +50,7 @@ export const CheckboxGroup = (props: BaseCheckboxGroupProps) => {
return (
<div className={styles.checkboxGroup} ref={ref}>
{options.map((item) => (
- <Checkbox name={item.name} disabled={item.disabled} checked={item.checked} onChange={handelChange} value={item.value}>
+ <Checkbox key={item.name} name={item.name} disabled={item.disabled} checked={item.checked} onChange={handelChange} value={item.value}>
{item.label}
</Checkbox>
))}
diff --git a/packages/base-ui/src/Components/Collapse/Collapse.tsx b/packages/base-ui/src/Components/Collapse/Collapse.tsx
index f0d7d74b8e..1d7e4d935f 100644
--- a/packages/base-ui/src/Components/Collapse/Collapse.tsx
+++ b/packages/base-ui/src/Components/Collapse/Collapse.tsx
@@ -1,4 +1,4 @@
-import { useState } from 'preact/hooks';
+import { useState } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BasePanelProps, BaseCollapseProps, CollapseComponent, PanelComponent } from '../../Interfaces';
import { joinClassNames } from '../../Utils';
diff --git a/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx b/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
index 08123052ff..98f4b7a8db 100644
--- a/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
+++ b/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
@@ -1,4 +1,4 @@
-import { Component, JSX, createRef } from 'preact';
+import { Component, JSX, createRef } from 'react';
import { BaseColorPickerProps, ColorPickerComponent, JSXComponent } from '../..';
import { ICustomComponentProps } from '../../services/menu/menu';
import { Button, Tooltip } from '../index';
@@ -152,10 +152,10 @@ class ColorPicker extends Component<BaseColorPickerProps & ICustomComponentProps
>
<div className={styles.picker}>
<div className={styles.pickerSwatches}>
- {this.state.presetColors.map((presetColor) => (
- <div className={styles.pickerSwatchesItem}>
+ {this.state.presetColors.map((presetColor, index) => (
+ <div key={index} className={styles.pickerSwatchesItem}>
{presetColor.map((item) => (
- <span className={styles.pickerSwatch} style={{ background: item }}>
+ <span key={item} className={styles.pickerSwatch} style={{ background: item }}>
<Tooltip title={item} placement="top">
<button
key={item}
diff --git a/packages/base-ui/src/Components/ColorPicker/ColorPickerPanel/ColorPickerPanel.tsx b/packages/base-ui/src/Components/ColorPicker/ColorPickerPanel/ColorPickerPanel.tsx
index 84d4b58290..1a7e0b7f87 100644
--- a/packages/base-ui/src/Components/ColorPicker/ColorPickerPanel/ColorPickerPanel.tsx
+++ b/packages/base-ui/src/Components/ColorPicker/ColorPickerPanel/ColorPickerPanel.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
import { HexColorInput, RgbaStringColorPicker } from 'react-colorful';
import { debounce } from '../../../Utils';
diff --git a/packages/base-ui/src/Components/ColorPicker/RgbaColorInput/RgbaColorInput.tsx b/packages/base-ui/src/Components/ColorPicker/RgbaColorInput/RgbaColorInput.tsx
index e5f3a6c142..5b0e39981b 100644
--- a/packages/base-ui/src/Components/ColorPicker/RgbaColorInput/RgbaColorInput.tsx
+++ b/packages/base-ui/src/Components/ColorPicker/RgbaColorInput/RgbaColorInput.tsx
@@ -1,5 +1,5 @@
import { Color, Nullable } from '@univerjs/core';
-import { useRef } from 'preact/hooks';
+import { useRef } from 'react';
import { Input } from '../../Input';
interface IProps {
diff --git a/packages/base-ui/src/Components/ColorPicker/test/index.test.tsx b/packages/base-ui/src/Components/ColorPicker/test/index.test.tsx
index 3940f52cd3..2023a06070 100644
--- a/packages/base-ui/src/Components/ColorPicker/test/index.test.tsx
+++ b/packages/base-ui/src/Components/ColorPicker/test/index.test.tsx
@@ -1,6 +1,6 @@
// import Enzyme, { mount } from 'enzyme';
// import Adapter from 'enzyme-adapter-preact-pure';
-// import { h } from 'preact';
+// import { h } from 'react';
// import { render, fireEvent, screen, findByText } from '@testing-library/preact';
// import { ColorPicker } from '..';
// Enzyme.configure({ adapter: new Adapter() });
diff --git a/packages/base-ui/src/Components/ColorPickerCircleButton/ColorPickerCircleButton.tsx b/packages/base-ui/src/Components/ColorPickerCircleButton/ColorPickerCircleButton.tsx
index 3a55e3ff97..9225610b4f 100644
--- a/packages/base-ui/src/Components/ColorPickerCircleButton/ColorPickerCircleButton.tsx
+++ b/packages/base-ui/src/Components/ColorPickerCircleButton/ColorPickerCircleButton.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseColorPickerCircleButtonProps, ColorPickerCircleButtonComponent } from '../../Interfaces';
import { NextIcon } from '../Icon';
@@ -23,8 +23,8 @@ export class ColorPickerCircleButton extends Component<BaseColorPickerCircleButt
this.colorRef.current.showSelect(this.ref.current);
};
- render(props: BaseColorPickerCircleButtonProps) {
- const { color, onClick, onCancel, style, colorPickerStyle } = props;
+ render() {
+ const { color, onClick, onCancel, style, colorPickerStyle } = this.props;
return (
<div style={style} className={Styles.colorPickerCircleButton} ref={this.ref} onClick={this.handleColorSelectButtonClick}>
diff --git a/packages/base-ui/src/Components/Confirm/Confirm.tsx b/packages/base-ui/src/Components/Confirm/Confirm.tsx
index a39766161d..10840e8aa4 100644
--- a/packages/base-ui/src/Components/Confirm/Confirm.tsx
+++ b/packages/base-ui/src/Components/Confirm/Confirm.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
import { Modal } from '../Modal';
import { CustomLabel } from '../CustomLabel';
import styles from './index.module.less';
@@ -49,7 +49,7 @@ export class Confirm extends Component<BaseConfirmProps, IState> {
return group;
}
- override componentWillReceiveProps(props: BaseConfirmProps): void {
+ override UNSAFE_componentWillReceiveProps(props: BaseConfirmProps): void {
if (props.show !== this.props.show) {
this.setState({
show: props.show,
diff --git a/packages/base-ui/src/Components/Container/Container.tsx b/packages/base-ui/src/Components/Container/Container.tsx
index 89b05340b2..f1280bc053 100644
--- a/packages/base-ui/src/Components/Container/Container.tsx
+++ b/packages/base-ui/src/Components/Container/Container.tsx
@@ -1,5 +1,5 @@
-import { ComponentChildren, Ref } from 'preact';
-import { forwardRef } from 'preact/compat';
+import { ComponentChildren, Ref } from 'react';
+import { forwardRef } from 'react';
type IProps = {
children?: ComponentChildren;
diff --git a/packages/base-ui/src/Components/CustomLabel/CustomLabel.tsx b/packages/base-ui/src/Components/CustomLabel/CustomLabel.tsx
index 0a6b9033b7..98a2647d44 100644
--- a/packages/base-ui/src/Components/CustomLabel/CustomLabel.tsx
+++ b/packages/base-ui/src/Components/CustomLabel/CustomLabel.tsx
@@ -1,5 +1,5 @@
-import { Component, isValidElement, JSX } from 'preact';
-import { useContext } from 'preact/hooks';
+import { Component, isValidElement, JSX } from 'react';
+import { useContext } from 'react';
import { AppContext, AppContextValues, ICustomComponent } from '../../Common';
import { IBaseCustomLabelProps } from '../../Interfaces';
diff --git a/packages/base-ui/src/Components/Drag/Drag-back.tsx b/packages/base-ui/src/Components/Drag/Drag-back.tsx
index 167682c3a1..0979373e26 100644
--- a/packages/base-ui/src/Components/Drag/Drag-back.tsx
+++ b/packages/base-ui/src/Components/Drag/Drag-back.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseDragProps, DragComponent } from '../../Interfaces';
import styles from './index.module.less';
diff --git a/packages/base-ui/src/Components/Drag/Drag.tsx b/packages/base-ui/src/Components/Drag/Drag.tsx
index 69c86d32aa..635fe42e0c 100644
--- a/packages/base-ui/src/Components/Drag/Drag.tsx
+++ b/packages/base-ui/src/Components/Drag/Drag.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseDragProps, DragComponent } from '../../Interfaces';
import styles from './index.module.less';
diff --git a/packages/base-ui/src/Components/Dropdown/Dropdown.tsx b/packages/base-ui/src/Components/Dropdown/Dropdown.tsx
index 2e534777fc..4124114584 100644
--- a/packages/base-ui/src/Components/Dropdown/Dropdown.tsx
+++ b/packages/base-ui/src/Components/Dropdown/Dropdown.tsx
@@ -1,5 +1,4 @@
-import { JSX, createRef } from 'preact';
-import { PureComponent } from 'preact/compat';
+import { JSX, createRef, PureComponent } from 'react';
import { Icon } from '..';
import { JSXComponent } from '../../BaseComponent';
import { BaseDropdownProps, DropdownComponent } from '../../Interfaces';
diff --git a/packages/base-ui/src/Components/FilterSelect/FilterSelect.tsx b/packages/base-ui/src/Components/FilterSelect/FilterSelect.tsx
index cb43e7f8f0..e69c500889 100644
--- a/packages/base-ui/src/Components/FilterSelect/FilterSelect.tsx
+++ b/packages/base-ui/src/Components/FilterSelect/FilterSelect.tsx
@@ -1,5 +1,5 @@
// import { JSXComponent } from '../../BaseComponent';
-// import { Component, createRef } from 'preact';
+// import { Component, createRef } from 'react';
// import { BaseFilterSelectProps, FilterSelectComponent } from '../../Interfaces';
// import { ColorPicker, Icon, Ul } from '../index';
// import styles from './index.module.less';
diff --git a/packages/base-ui/src/Components/FormatModal/FormatModal.tsx b/packages/base-ui/src/Components/FormatModal/FormatModal.tsx
index 6655047a75..676205d19f 100644
--- a/packages/base-ui/src/Components/FormatModal/FormatModal.tsx
+++ b/packages/base-ui/src/Components/FormatModal/FormatModal.tsx
@@ -1,5 +1,5 @@
// import { Nullable, Observer, Workbook } from '@univerjs/core';
-// import { Component } from 'preact';
+// import { Component } from 'react';
// import { BaseFormatModalProps } from '../../Interfaces';
// import { Modal, Ul } from '../index';
// import styles from './index.module.less';
@@ -126,7 +126,7 @@
// }
// };
-// componentWillMount() {
+// UNSAFE_componentWillMount() {
// this.setLocale();
// this._localeObserver = this._context
diff --git a/packages/base-ui/src/Components/Grid/Grid.tsx b/packages/base-ui/src/Components/Grid/Grid.tsx
index 2e1a7bd682..b58356914f 100644
--- a/packages/base-ui/src/Components/Grid/Grid.tsx
+++ b/packages/base-ui/src/Components/Grid/Grid.tsx
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
type BaseGridProps = {
children?: ComponentChildren;
@@ -16,13 +16,13 @@ export const Grid = (props: BaseGridProps) => {
const { children, style, className } = props;
return (
- <div class="flexrow">
- <div class="flexcol col-1">THING 1</div>
- <div class="flexcol col-2">THING 2</div>
- <div class="flexcol col-3">THING 3</div>
- <div class="flexcol col-4">THING 4</div>
- <div class="flexcol col-5">THING 5</div>
- <div class="flexcol col-6">THING 6</div>
+ <div className="flexrow">
+ <div className="flexcol col-1">THING 1</div>
+ <div className="flexcol col-2">THING 2</div>
+ <div className="flexcol col-3">THING 3</div>
+ <div className="flexcol col-4">THING 4</div>
+ <div className="flexcol col-5">THING 5</div>
+ <div className="flexcol col-6">THING 6</div>
</div>
);
};
diff --git a/packages/base-ui/src/Components/Icon/Cell/index.tsx b/packages/base-ui/src/Components/Icon/Cell/index.tsx
index 3b54e6ba29..5914e159c5 100644
--- a/packages/base-ui/src/Components/Icon/Cell/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Cell/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const FillColorIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5567" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5567" width="1em" height="1em" fill="currentColor">
<path
d="M730.24 562.176l-253.44 253.44-217.173333-217.258667 253.44-253.44 217.173333 217.258667z m-72.405333-0.042667L512.981333 417.28l-180.992 180.992 144.810667 144.853333 181.034667-181.034666z"
p-id="5568"
@@ -18,7 +18,7 @@ export const FillColorIcon = (props: BaseIconProps) => (
export const FullBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5695" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5695" width="1em" height="1em" fill="currentColor">
<path
d="M213.333333 810.666667V256h42.666667v554.666667zM725.333333 810.666667V256h42.666667v554.666667zM469.333333 810.666667V256h42.666667v554.666667z"
p-id="5696"
@@ -33,7 +33,7 @@ export const FullBorderIcon = (props: BaseIconProps) => (
export const TopBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5823" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5823" width="1em" height="1em" fill="currentColor">
<path d="M213.333333 256h554.666667v42.666667H213.333333z" p-id="5824"></path>
<path
d="M213.333333 426.666667h42.666667v42.666666H213.333333zM213.333333 597.333333h42.666667v42.666667H213.333333zM213.333333 341.333333h42.666667v42.666667H213.333333zM213.333333 512h42.666667v42.666667H213.333333zM213.333333 682.666667h42.666667v42.666666H213.333333zM469.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 597.333333h42.666667v42.666667h-42.666667zM725.333333 341.333333h42.666667v42.666667h-42.666667zM725.333333 512h42.666667v42.666667h-42.666667zM725.333333 682.666667h42.666667v42.666666h-42.666667zM725.333333 768h42.666667v42.666667h-42.666667zM469.333333 597.333333h42.666667v42.666667h-42.666667zM469.333333 341.333333h42.666667v42.666667h-42.666667zM469.333333 512h42.666667v42.666667h-42.666667zM469.333333 682.666667h42.666667v42.666666h-42.666667zM213.333333 768h42.666667v42.666667H213.333333zM384 768h42.666667v42.666667H384zM554.666667 768h42.666666v42.666667h-42.666666zM298.666667 768h42.666666v42.666667H298.666667zM469.333333 768h42.666667v42.666667h-42.666667zM640 768h42.666667v42.666667h-42.666667zM384 512h42.666667v42.666667H384zM554.666667 512h42.666666v42.666667h-42.666666zM298.666667 512h42.666666v42.666667H298.666667z"
@@ -46,7 +46,7 @@ export const TopBorderIcon = (props: BaseIconProps) => (
export const BottomBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5952" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5952" width="1em" height="1em" fill="currentColor">
<path d="M768 810.666667H213.333333v-42.666667h554.666667z" p-id="5953"></path>
<path
d="M768 640h-42.666667v-42.666667h42.666667zM768 469.333333h-42.666667v-42.666666h42.666667zM768 725.333333h-42.666667v-42.666666h42.666667zM768 554.666667h-42.666667v-42.666667h42.666667zM768 384h-42.666667V341.333333h42.666667z"
@@ -75,7 +75,7 @@ export const BottomBorderIcon = (props: BaseIconProps) => (
export const LeftBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6085" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6085" width="1em" height="1em" fill="currentColor">
<path d="M213.333333 810.666667V256h42.666667v554.666667z" p-id="6086"></path>
<path
d="M384 810.666667v-42.666667h42.666667v42.666667zM554.666667 810.666667v-42.666667h42.666666v42.666667zM298.666667 810.666667v-42.666667h42.666666v42.666667zM469.333333 810.666667v-42.666667h42.666667v42.666667zM640 810.666667v-42.666667h42.666667v42.666667z"
@@ -100,7 +100,7 @@ export const LeftBorderIcon = (props: BaseIconProps) => (
export const RightBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6217" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6217" width="1em" height="1em" fill="currentColor">
<path d="M768 256v554.666667h-42.666667V256z" p-id="6218"></path>
<path
d="M597.333333 256v42.666667h-42.666666V256zM426.666667 256v42.666667H384V256zM682.666667 256v42.666667h-42.666667V256zM512 256v42.666667h-42.666667V256zM341.333333 256v42.666667H298.666667V256z"
@@ -129,7 +129,7 @@ export const RightBorderIcon = (props: BaseIconProps) => (
export const NoneBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6350" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6350" width="1em" height="1em" fill="currentColor">
<path
d="M384 810.666667v-42.666667h42.666667v42.666667zM554.666667 810.666667v-42.666667h42.666666v42.666667zM298.666667 810.666667v-42.666667h42.666666v42.666667zM469.333333 810.666667v-42.666667h42.666667v42.666667zM640 810.666667v-42.666667h42.666667v42.666667zM384 554.666667v-42.666667h42.666667v42.666667zM384 298.666667V256h42.666667v42.666667zM554.666667 298.666667V256h42.666666v42.666667zM298.666667 298.666667V256h42.666666v42.666667zM469.333333 298.666667V256h42.666667v42.666667zM640 298.666667V256h42.666667v42.666667zM725.333333 298.666667V256h42.666667v42.666667zM213.333333 298.666667V256h42.666667v42.666667zM554.666667 554.666667v-42.666667h42.666666v42.666667zM298.666667 554.666667v-42.666667h42.666666v42.666667zM469.333333 554.666667v-42.666667h42.666667v42.666667zM640 554.666667v-42.666667h42.666667v42.666667z"
p-id="6351"
@@ -148,7 +148,7 @@ export const NoneBorderIcon = (props: BaseIconProps) => (
export const OuterBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6479" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6479" width="1em" height="1em" fill="currentColor">
<path d="M213.333333 810.666667V256h42.666667v554.666667zM725.333333 810.666667V256h42.666667v554.666667z" p-id="6480"></path>
<path d="M213.333333 256h554.666667v42.666667H213.333333zM213.333333 768h554.666667v42.666667H213.333333z" p-id="6481"></path>
<path
@@ -162,7 +162,7 @@ export const OuterBorderIcon = (props: BaseIconProps) => (
export const InnerBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6609" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6609" width="1em" height="1em" fill="currentColor">
<path d="M213.333333 512h554.666667v42.666667H213.333333z" p-id="6610"></path>
<path d="M512 256v554.666667h-42.666667V256z" p-id="6611"></path>
<path
@@ -175,7 +175,7 @@ export const InnerBorderIcon = (props: BaseIconProps) => (
export const StripingBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6866" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6866" width="1em" height="1em" fill="currentColor">
<path d="M213.333333 512h554.666667v42.666667H213.333333z" p-id="6867"></path>
<path
d="M213.333333 426.666667h42.666667v42.666666H213.333333zM213.333333 597.333333h42.666667v42.666667H213.333333zM213.333333 341.333333h42.666667v42.666667H213.333333zM213.333333 682.666667h42.666667v42.666666H213.333333zM725.333333 426.666667h42.666667v42.666666h-42.666667zM469.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 597.333333h42.666667v42.666667h-42.666667zM469.333333 597.333333h42.666667v42.666667h-42.666667zM725.333333 341.333333h42.666667v42.666667h-42.666667zM469.333333 341.333333h42.666667v42.666667h-42.666667zM725.333333 682.666667h42.666667v42.666666h-42.666667zM469.333333 682.666667h42.666667v42.666666h-42.666667zM725.333333 768h42.666667v42.666667h-42.666667zM725.333333 256h42.666667v42.666667h-42.666667zM213.333333 768h42.666667v42.666667H213.333333zM213.333333 256h42.666667v42.666667H213.333333zM384 768h42.666667v42.666667H384zM384 256h42.666667v42.666667H384zM554.666667 768h42.666666v42.666667h-42.666666zM554.666667 256h42.666666v42.666667h-42.666666zM298.666667 768h42.666666v42.666667H298.666667zM298.666667 256h42.666666v42.666667H298.666667zM469.333333 768h42.666667v42.666667h-42.666667zM469.333333 256h42.666667v42.666667h-42.666667zM640 768h42.666667v42.666667h-42.666667zM640 256h42.666667v42.666667h-42.666667z"
@@ -187,7 +187,7 @@ export const StripingBorderIcon = (props: BaseIconProps) => (
export const VerticalBorderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6994" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6994" width="1em" height="1em" fill="currentColor">
<path
d="M213.333333 426.666667h42.666667v42.666666H213.333333zM213.333333 597.333333h42.666667v42.666667H213.333333zM213.333333 341.333333h42.666667v42.666667H213.333333zM213.333333 682.666667h42.666667v42.666666H213.333333zM725.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 597.333333h42.666667v42.666667h-42.666667zM725.333333 341.333333h42.666667v42.666667h-42.666667zM725.333333 682.666667h42.666667v42.666666h-42.666667zM725.333333 768h42.666667v42.666667h-42.666667zM725.333333 256h42.666667v42.666667h-42.666667zM725.333333 512h42.666667v42.666667h-42.666667zM213.333333 768h42.666667v42.666667H213.333333zM213.333333 256h42.666667v42.666667H213.333333zM213.333333 512h42.666667v42.666667H213.333333zM384 768h42.666667v42.666667H384zM384 256h42.666667v42.666667H384zM384 512h42.666667v42.666667H384zM554.666667 768h42.666666v42.666667h-42.666666zM554.666667 256h42.666666v42.666667h-42.666666zM554.666667 512h42.666666v42.666667h-42.666666zM298.666667 768h42.666666v42.666667H298.666667zM298.666667 256h42.666666v42.666667H298.666667zM298.666667 512h42.666666v42.666667H298.666667zM469.333333 768h42.666667v42.666667h-42.666667zM469.333333 256h42.666667v42.666667h-42.666667zM469.333333 512h42.666667v42.666667h-42.666667zM640 768h42.666667v42.666667h-42.666667zM640 256h42.666667v42.666667h-42.666667zM640 512h42.666667v42.666667h-42.666667z"
p-id="6995"
@@ -199,7 +199,7 @@ export const VerticalBorderIcon = (props: BaseIconProps) => (
export const MergeIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7122" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7122" width="1em" height="1em" fill="currentColor">
<path d="M810.666667 213.333333v597.333334H213.333333V213.333333h597.333334z m-42.666667 42.666667H256v512h512V256z" p-id="7123"></path>
<path
d="M389.162667 426.666667l90.538666 90.496-90.538666 90.538666-30.165334-30.165333 37.802667-37.845333-119.466667 0.042666v-42.666666l121.856-0.042667-40.192-40.192 30.165334-30.165333zM645.162667 426.666667L554.666667 517.162667l90.496 90.538666 30.165333-30.165333-37.76-37.845333 119.466667 0.042666v-42.666666l-121.856-0.042667 40.149333-40.192-30.165333-30.165333z"
diff --git a/packages/base-ui/src/Components/Icon/Data/index.tsx b/packages/base-ui/src/Components/Icon/Data/index.tsx
index 0a2c44cef8..79f51baf5b 100644
--- a/packages/base-ui/src/Components/Icon/Data/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Data/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const PivotableIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7578" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7578" width="1em" height="1em" fill="currentColor">
<path
d="M256 362.666667v298.666666l256 149.333334 256-149.333334v-298.666666L512 213.333333 256 362.666667zM725.333333 640l-213.333333 128-213.333333-128V384l213.333333-128 213.333333 128v256z m-189.354666 40.021333a18.645333 18.645333 0 0 1-18.645334 18.645334 18.304 18.304 0 0 1-18.688-18.645334V535.466667l-130.645333-75.349334a18.645333 18.645333 0 0 1 4.565333-34.133333 18.304 18.304 0 0 1 14.08 2.005333l130.688 74.666667 129.578667-74.666667a18.304 18.304 0 0 1 25.386667 6.698667 18.645333 18.645333 0 0 1-6.784 25.386667l-129.536 74.666666v145.237334z"
p-id="7579"
@@ -14,7 +14,7 @@ export const PivotableIcon = (props: BaseIconProps) => (
export const SumIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7451" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7451" width="1em" height="1em" fill="currentColor">
<path
d="M774.058667 213.333333v42.666667H310.784l236.288 256-236.330667 256h463.317334v42.666667H213.333333l275.669334-298.666667L213.333333 213.333333z"
p-id="7452"
@@ -25,7 +25,7 @@ export const SumIcon = (props: BaseIconProps) => (
export const OrderIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6675" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6675" width="1em" height="1em" fill="currentColor">
<path
d="M704 256a21.333333 21.333333 0 0 1 21.333333 21.333333v469.333334a21.333333 21.333333 0 1 1-42.666666 0v-469.333334c0-11.776 9.472-21.333333 21.333333-21.333333zM512 384c11.776 0 21.333333 7.68 21.333333 17.194667v221.610666c0 9.514667-9.472 17.194667-21.333333 17.194667-11.776 0-21.333333-7.68-21.333333-17.194667V401.194667c0-4.565333 2.218667-8.96 6.186666-12.16A24.32 24.32 0 0 1 512 384zM320 256a21.333333 21.333333 0 0 1 21.333333 21.333333v469.333334a21.333333 21.333333 0 1 1-42.666666 0v-469.333334c0-11.776 9.472-21.333333 21.333333-21.333333z m283.562667 368.896a21.333333 21.333333 0 0 1 30.165333 30.165333l-106.666667 106.666667a21.333333 21.333333 0 0 1-30.165333 0l-106.666667-106.666667a21.333333 21.333333 0 0 1 30.165334-30.165333L512 716.501333l91.605333-91.562666z m0.298666-225.834667a21.333333 21.333333 0 0 0 30.165334-30.165333l-106.666667-106.666667a21.333333 21.333333 0 0 0-30.165333 0l-106.666667 106.666667a21.333333 21.333333 0 0 0 30.165333 30.165333l91.562667-91.562666 91.605333 91.562666z"
p-id="6676"
@@ -36,7 +36,7 @@ export const OrderIcon = (props: BaseIconProps) => (
export const OrderDESCIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6548" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6548" width="1em" height="1em" fill="currentColor">
<path
d="M430.848 666.197333H366.592V236.074667a6.656 6.656 0 0 0-6.741333-6.528h-47.36a6.656 6.656 0 0 0-6.741334 6.528v430.122666H241.493333c-5.674667 0-8.874667 6.314667-5.333333 10.538667l94.72 115.2a6.912 6.912 0 0 0 10.624 0l94.72-115.2c3.413333-4.224 0.298667-10.538667-5.376-10.538667zM582.442667 806.698667l20.992-61.098667h103.68l21.205333 61.098667h43.690667L672.64 533.333333h-34.688l-99.370667 273.365334h43.861334z m112.896-97.877334h-79.872l39.552-119.424h0.768l39.552 119.466667zM742.570667 486.698667v-39.168h-124.288l124.288-203.093334V213.333333h-169.685334v36.949334h119.04l-123.904 201.941333v34.474667z"
p-id="6549"
@@ -47,7 +47,7 @@ export const OrderDESCIcon = (props: BaseIconProps) => (
export const OrderASCIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6294" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6294" width="1em" height="1em" fill="currentColor">
<path
d="M430.848 357.76H366.592v430.165333a6.656 6.656 0 0 1-6.741333 6.485334h-47.36a6.656 6.656 0 0 1-6.741334-6.485334V357.76H241.493333c-5.674667 0-8.874667-6.314667-5.333333-10.538667l94.72-115.2a6.912 6.912 0 0 1 10.624 0l94.72 115.2c3.413333 4.224 0.298667 10.538667-5.376 10.538667zM582.442667 486.698667l20.992-61.098667h103.68l21.205333 61.098667h43.690667L672.64 213.333333h-34.688l-99.370667 273.365334h43.861334z m112.896-97.877334h-79.872l39.552-119.424h0.768l39.552 119.466667zM742.570667 806.698667v-39.168h-124.288l124.288-203.093334V533.333333h-169.685334v36.949334h119.04l-123.904 201.941333v34.474667z"
p-id="6295"
@@ -58,7 +58,7 @@ export const OrderASCIcon = (props: BaseIconProps) => (
export const FilterIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6802" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6802" width="1em" height="1em" fill="currentColor">
<path
d="M736 213.333333H328.533333C288 213.333333 256 245.333333 256 285.866667c0 17.066667 6.4 34.133333 17.066667 46.933333 0 2.133333 2.133333 2.133333 2.133333 4.266667l160 160v168.533333c0 6.4 2.133333 10.666667 6.4 14.933333l145.066667 123.733334c4.266667 2.133333 8.533333 4.266667 12.8 4.266666 6.4 0 10.666667-2.133333 14.933333-6.4 4.266667-4.266667 4.266667-10.666667 4.266667-14.933333V503.466667l170.666666-166.4 2.133334-2.133334c10.666667-12.8 17.066667-29.866667 17.066666-46.933333 0-42.666667-32-74.666667-72.533333-74.666667z m23.466667 93.866667s-2.133333 2.133333 0 0l-172.8 172.8c-4.266667 4.266667-6.4 8.533333-6.4 14.933333v251.733334l-104.533334-87.466667V490.666667c0-6.4-2.133333-10.666667-6.4-14.933334l-162.133333-166.4-2.133333-2.133333c-6.4-6.4-8.533333-12.8-8.533334-21.333333 0-17.066667 14.933333-32 32-32h407.466667c17.066667 0 32 14.933333 32 32 0 8.533333-4.266667 14.933333-8.533333 21.333333z"
p-id="6803"
@@ -69,7 +69,7 @@ export const FilterIcon = (props: BaseIconProps) => (
export const FilterRankIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6929" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6929" width="1em" height="1em" fill="currentColor">
<path
d="M736 213.333333H328.533333C288 213.333333 256 245.333333 256 285.866667c0 17.066667 6.4 34.133333 17.066667 46.933333 0 2.133333 2.133333 2.133333 2.133333 4.266667l160 160v168.533333c0 6.4 2.133333 10.666667 6.4 14.933333l145.066667 123.733334c4.266667 2.133333 8.533333 4.266667 12.8 4.266666 6.4 0 10.666667-2.133333 14.933333-6.4 4.266667-4.266667 4.266667-10.666667 4.266667-14.933333V503.466667l170.666666-166.4 2.133334-2.133334c10.666667-12.8 17.066667-29.866667 17.066666-46.933333 0-42.666667-32-74.666667-72.533333-74.666667z m23.466667 93.866667s-2.133333 2.133333 0 0l-172.8 172.8c-4.266667 4.266667-6.4 8.533333-6.4 14.933333v251.733334l-104.533334-87.466667V490.666667c0-6.4-2.133333-10.666667-6.4-14.933334l-162.133333-166.4-2.133333-2.133333c-6.4-6.4-8.533333-12.8-8.533334-21.333333 0-17.066667 14.933333-32 32-32h407.466667c17.066667 0 32 14.933333 32 32 0 8.533333-4.266667 14.933333-8.533333 21.333333z"
p-id="6930"
@@ -84,7 +84,7 @@ export const FilterRankIcon = (props: BaseIconProps) => (
export const CleanIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7193" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7193" width="1em" height="1em" fill="currentColor">
<path
d="M214.016 722.432h593.92v42.410667H214.016v-42.410667z m578.048-312.106667l-180.693333-181.077333A53.376 53.376 0 0 0 573.738667 213.333333a45.653333 45.653333 0 0 0-32.64 13.226667l-313.941334 314.965333c-18.56 18.602667-17.322667 50.261333 2.688 70.4l68.010667 68.096h298.24l198.698667-199.338666c18.56-18.602667 17.322667-50.261333-2.730667-70.357334z m-213.546667 227.242667H315.434667L259.84 581.888c-3.968-4.010667-4.053333-9.088-2.730667-10.453333L430.08 398.08l193.92 193.92-45.44 45.568z"
p-id="7194"
@@ -95,7 +95,7 @@ export const CleanIcon = (props: BaseIconProps) => (
export const CheckIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} className={props.className} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5912" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5912" width="1em" height="1em" fill="currentColor">
<path
d="M764.330667 592.170667l30.165333 30.165333L734.165333 682.666667l60.330667 60.330666-30.165333 30.165334-60.330667-60.330667-60.330667 60.330667-30.165333-30.165334L673.834667 682.666667l-60.330667-60.330667 30.165333-30.165333 60.330667 60.330666 60.330667-60.330666zM725.333333 512v42.666667H256v128h256v42.666666H213.333333v-213.333333h512z m47.829334-209.664l30.165333 30.165333L682.666667 453.12l-30.165334 30.165333-90.496-90.453333 30.165334-30.208 60.330666 60.330667 120.661334-120.661334zM725.333333 256v42.666667H256v128h256v42.666666H213.333333V256h512z"
p-id="5913"
diff --git a/packages/base-ui/src/Components/Icon/Delete/index.tsx b/packages/base-ui/src/Components/Icon/Delete/index.tsx
index daa0b32572..8158491374 100644
--- a/packages/base-ui/src/Components/Icon/Delete/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Delete/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const DeleteIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="logo" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1214" width="1em" height="1em">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1214" width="1em" height="1em">
<path
d="M840 288H688v-56c0-40-32-72-72-72h-208C368 160 336 192 336 232V288h-152c-12.8 0-24 11.2-24 24s11.2 24 24 24h656c12.8 0 24-11.2 24-24s-11.2-24-24-24zM384 288v-56c0-12.8 11.2-24 24-24h208c12.8 0 24 11.2 24 24V288H384zM758.4 384c-12.8 0-24 11.2-24 24v363.2c0 24-19.2 44.8-44.8 44.8H332.8c-24 0-44.8-19.2-44.8-44.8V408c0-12.8-11.2-24-24-24s-24 11.2-24 24v363.2c0 51.2 41.6 92.8 92.8 92.8h358.4c51.2 0 92.8-41.6 92.8-92.8V408c-1.6-12.8-12.8-24-25.6-24z"
p-id="1215"
diff --git a/packages/base-ui/src/Components/Icon/Font/index.tsx b/packages/base-ui/src/Components/Icon/Font/index.tsx
index fdc6bb68d7..d234db092b 100644
--- a/packages/base-ui/src/Components/Icon/Font/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Font/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const BoldIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5565" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5565" width="1em" height="1em" fill="currentColor">
<path
d="M298.666667 213.333333h224a174.208 174.208 0 0 1 141.952 275.242667A174.208 174.208 0 0 1 572.458667 810.666667H298.666667V213.333333z m273.792 348.458667l-174.250667-0.042667v149.333334h174.250667a74.666667 74.666667 0 0 0 6.101333-149.077334l-6.101333-0.213333zM398.208 312.874667v149.333333h124.458667a74.666667 74.666667 0 0 0 6.144-149.077333l-6.144-0.256H398.208z"
p-id="5566"
@@ -14,7 +14,7 @@ export const BoldIcon = (props: BaseIconProps) => (
export const ItalicIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5692" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5692" width="1em" height="1em" fill="currentColor">
<path d="M469.333333 256h170.666667v42.666667h-170.666667z" p-id="5693"></path>
<path d="M573.738667 284.586667l-81.493334 462.208-41.984-7.381334 81.493334-462.208z" p-id="5694"></path>
<path d="M384 725.333333h170.666667v42.666667H384z" p-id="5695"></path>
@@ -24,7 +24,7 @@ export const ItalicIcon = (props: BaseIconProps) => (
export const DeleteLineIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5311" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5311" width="1em" height="1em" fill="currentColor">
<path d="M298.666667 256h426.666666v42.666667H298.666667z" p-id="5312"></path>
<path
d="M533.290667 554.666667l0.042666 192h-42.666666l-0.042667-192h42.666667z m0.042666-277.333334l-0.042666 234.666667h-42.666667l0.042667-234.666667h42.666666zM320 256v85.333333h-42.666667V256zM746.666667 256v85.333333h-42.666667V256z"
@@ -37,7 +37,7 @@ export const DeleteLineIcon = (props: BaseIconProps) => (
export const UnderLineIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em" fill="currentColor">
<path
d="M362.666667 256v298.666667a149.333333 149.333333 0 0 0 298.453333 8.192L661.333333 554.666667V256h42.666667v298.666667a192 192 0 0 1-383.786667 9.045333L320 554.666667V256h42.666667z"
p-id="5319"
@@ -60,7 +60,7 @@ export const UnderLineIcon = (props: BaseIconProps) => (
export const TextColorIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5440" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5440" width="1em" height="1em" fill="currentColor">
<path
d="M549.546667 256l194.133333 533.333333h-45.354667l-77.653333-213.333333H421.632l-77.653333 213.333333H298.666667L492.757333 256h56.789334z m-28.416 46.634667L437.162667 533.333333h167.978666l-84.010666-230.698666z"
p-id="5441"
diff --git a/packages/base-ui/src/Components/Icon/Format/index.tsx b/packages/base-ui/src/Components/Icon/Format/index.tsx
index 694857dd36..153e4961ff 100644
--- a/packages/base-ui/src/Components/Icon/Format/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Format/index.tsx
@@ -1,118 +1,118 @@
-import { BaseIconProps } from '../../../Interfaces';
-import { Icon } from '../AddIcon';
-
-export const BackIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5692" width="1em" height="1em" fill="currentColor">
- <path
- d="M737.664 419.328H426.666667v42.666667h311.296l-84.48 84.437333a21.333333 21.333333 0 0 0 30.208 30.165333l120.746666-120.704a21.290667 21.290667 0 0 0 0-30.165333l-120.746666-120.661333a21.333333 21.333333 0 0 0-30.165334 30.165333l84.138667 84.096zM213.333333 632.661333a213.333333 213.333333 0 0 1 213.333334-213.333333v42.666667a170.666667 170.666667 0 0 0-170.666667 170.666666H213.333333z m0 0h42.666667v64a21.333333 21.333333 0 0 1-42.666667 0v-64z"
- p-id="5693"
- ></path>
- </svg>
- </Icon>
-);
-
-export const ForwardIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5565" width="1em" height="1em" fill="currentColor">
- <path
- d="M287.018667 419.328h310.997333v42.666667H286.72l84.48 84.437333a21.333333 21.333333 0 1 1-30.208 30.165333l-120.746667-120.704a21.248 21.248 0 0 1 0-30.165333l120.746667-120.661333a21.333333 21.333333 0 0 1 30.165333 30.165333L287.018667 419.328z m524.330666 213.333333a213.333333 213.333333 0 0 0-213.333333-213.333333v42.666667a170.666667 170.666667 0 0 1 170.666667 170.666666h42.666666z m0 0h-42.666666v64a21.333333 21.333333 0 1 0 42.666666 0v-64z"
- p-id="5566"
- ></path>
- </svg>
- </Icon>
-);
-
-export const FormatIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5955" width="1em" height="1em" fill="currentColor">
- <path
- d="M725.333333 213.333333v85.333334h85.333334v234.666666h-298.666667V597.333333h21.333333v213.333334h-85.333333v-213.333334h21.333333v-106.666666h298.666667V341.333333h-42.666667v85.333334H213.333333V213.333333h512z m-42.666666 42.666667H256v128h426.666667V256z"
- p-id="5956"
- ></path>
- </svg>
- </Icon>
-);
-
-export const NextIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="nextIcon" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5311" width="1em" height="1em" fill="currentColor">
- <path d="M512 682.666667L170.666667 341.333333h682.666666z" p-id="5312"></path>
- </svg>
- </Icon>
-);
-
-export const RightIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="rightIcon" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5311" width="1em" height="1em" fill="currentColor">
- <path d="M682.666667 512l-341.333334 341.333333V170.666667z" p-id="5312"></path>
- </svg>
- </Icon>
-);
-
-export const CorrectIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5311" width="1em" height="1em" fill="currentColor">
- <path d="M268.032 523.434667l60.373333-60.330667 211.2 211.2-60.373333 60.330667z" p-id="5312"></path>
- <path d="M780.928 312.234667l60.373333 60.330666-331.904 331.861334-60.330666-60.330667z" p-id="5313"></path>
- </svg>
- </Icon>
-);
-
-export const LtIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg width="1em" height="1em" fill="currentColor" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1732">
- <path d="M224.45 538.68l575.11-346.21-0.05-68.75-575.03 345.61-0.03 69.35z" p-id="1733"></path>
- <path d="M224.45 538.68l575.08 356.96v-69.52L224.48 469.33l-0.03 69.35z" p-id="1734"></path>
- </svg>
- </Icon>
-);
-
-export const CloseIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em" fill="currentColor">
- <path d="M330.965333 270.634667l422.4 422.4-60.330666 60.330666-422.4-422.4z" p-id="5319"></path>
- <path d="M753.365333 330.965333l-422.4 422.4-60.330666-60.330666 422.4-422.4z" p-id="5320"></path>
- </svg>
- </Icon>
-);
-
-export const MenuIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5446" width="1em" height="1em" fill="currentColor">
- <path
- d="M213.333333 469.333333h597.333334v85.333334H213.333333zM213.333333 213.333333h597.333334v85.333334H213.333333zM213.333333 725.333333h597.333334v85.333334H213.333333z"
- p-id="5447"
- ></path>
- </svg>
- </Icon>
-);
-
-export const HideIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6513" width="1em" height="1em" fill="currentColor">
- <path
- d="M512 219.428571c161.645714 0 307.931429 97.499429 438.857143 292.571429-130.925714 195.072-277.211429 292.571429-438.857143 292.571429S204.068571 707.072 73.142857 512c130.925714-195.072 277.211429-292.571429 438.857143-292.571429z m0 73.142858c-124.123429 0-241.225143 65.462857-365.714286 219.428571 119.661714 147.968 231.424 213.577143 365.714286 219.428571 124.196571 0 241.298286-65.462857 365.714286-219.428571-119.588571-147.968-231.350857-213.577143-365.714286-219.428571z"
- p-id="6514"
- ></path>
- <path d="M818.614857 146.285714l51.712 51.712L197.997714 870.4 146.285714 818.688z" p-id="6515"></path>
- <path
- d="M512 365.714286a146.285714 146.285714 0 1 1 0 292.571428 146.285714 146.285714 0 0 1 0-292.571428z m0 73.142857a73.142857 73.142857 0 1 0 0 146.285714 73.142857 73.142857 0 0 0 0-146.285714z"
- p-id="6516"
- ></path>
- </svg>
- </Icon>
-);
-
-export default {
- BackIcon,
- ForwardIcon,
- FormatIcon,
- NextIcon,
- RightIcon,
- CorrectIcon,
- LtIcon,
- CloseIcon,
- MenuIcon,
- HideIcon,
-};
+import { BaseIconProps } from '../../../Interfaces';
+import { Icon } from '../AddIcon';
+
+export const BackIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5692" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M737.664 419.328H426.666667v42.666667h311.296l-84.48 84.437333a21.333333 21.333333 0 0 0 30.208 30.165333l120.746666-120.704a21.290667 21.290667 0 0 0 0-30.165333l-120.746666-120.661333a21.333333 21.333333 0 0 0-30.165334 30.165333l84.138667 84.096zM213.333333 632.661333a213.333333 213.333333 0 0 1 213.333334-213.333333v42.666667a170.666667 170.666667 0 0 0-170.666667 170.666666H213.333333z m0 0h42.666667v64a21.333333 21.333333 0 0 1-42.666667 0v-64z"
+ p-id="5693"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const ForwardIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5565" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M287.018667 419.328h310.997333v42.666667H286.72l84.48 84.437333a21.333333 21.333333 0 1 1-30.208 30.165333l-120.746667-120.704a21.248 21.248 0 0 1 0-30.165333l120.746667-120.661333a21.333333 21.333333 0 0 1 30.165333 30.165333L287.018667 419.328z m524.330666 213.333333a213.333333 213.333333 0 0 0-213.333333-213.333333v42.666667a170.666667 170.666667 0 0 1 170.666667 170.666666h42.666666z m0 0h-42.666666v64a21.333333 21.333333 0 1 0 42.666666 0v-64z"
+ p-id="5566"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const FormatIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5955" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M725.333333 213.333333v85.333334h85.333334v234.666666h-298.666667V597.333333h21.333333v213.333334h-85.333333v-213.333334h21.333333v-106.666666h298.666667V341.333333h-42.666667v85.333334H213.333333V213.333333h512z m-42.666666 42.666667H256v128h426.666667V256z"
+ p-id="5956"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const NextIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="nextIcon" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5311" width="1em" height="1em" fill="currentColor">
+ <path d="M512 682.666667L170.666667 341.333333h682.666666z" p-id="5312"></path>
+ </svg>
+ </Icon>
+);
+
+export const RightIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="rightIcon" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5311" width="1em" height="1em" fill="currentColor">
+ <path d="M682.666667 512l-341.333334 341.333333V170.666667z" p-id="5312"></path>
+ </svg>
+ </Icon>
+);
+
+export const CorrectIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5311" width="1em" height="1em" fill="currentColor">
+ <path d="M268.032 523.434667l60.373333-60.330667 211.2 211.2-60.373333 60.330667z" p-id="5312"></path>
+ <path d="M780.928 312.234667l60.373333 60.330666-331.904 331.861334-60.330666-60.330667z" p-id="5313"></path>
+ </svg>
+ </Icon>
+);
+
+export const LtIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
+ <svg width="1em" height="1em" fill="currentColor" className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1732">
+ <path d="M224.45 538.68l575.11-346.21-0.05-68.75-575.03 345.61-0.03 69.35z" p-id="1733"></path>
+ <path d="M224.45 538.68l575.08 356.96v-69.52L224.48 469.33l-0.03 69.35z" p-id="1734"></path>
+ </svg>
+ </Icon>
+);
+
+export const CloseIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em" fill="currentColor">
+ <path d="M330.965333 270.634667l422.4 422.4-60.330666 60.330666-422.4-422.4z" p-id="5319"></path>
+ <path d="M753.365333 330.965333l-422.4 422.4-60.330666-60.330666 422.4-422.4z" p-id="5320"></path>
+ </svg>
+ </Icon>
+);
+
+export const MenuIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5446" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M213.333333 469.333333h597.333334v85.333334H213.333333zM213.333333 213.333333h597.333334v85.333334H213.333333zM213.333333 725.333333h597.333334v85.333334H213.333333z"
+ p-id="5447"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const HideIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6513" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M512 219.428571c161.645714 0 307.931429 97.499429 438.857143 292.571429-130.925714 195.072-277.211429 292.571429-438.857143 292.571429S204.068571 707.072 73.142857 512c130.925714-195.072 277.211429-292.571429 438.857143-292.571429z m0 73.142858c-124.123429 0-241.225143 65.462857-365.714286 219.428571 119.661714 147.968 231.424 213.577143 365.714286 219.428571 124.196571 0 241.298286-65.462857 365.714286-219.428571-119.588571-147.968-231.350857-213.577143-365.714286-219.428571z"
+ p-id="6514"
+ ></path>
+ <path d="M818.614857 146.285714l51.712 51.712L197.997714 870.4 146.285714 818.688z" p-id="6515"></path>
+ <path
+ d="M512 365.714286a146.285714 146.285714 0 1 1 0 292.571428 146.285714 146.285714 0 0 1 0-292.571428z m0 73.142857a73.142857 73.142857 0 1 0 0 146.285714 73.142857 73.142857 0 0 0 0-146.285714z"
+ p-id="6516"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export default {
+ BackIcon,
+ ForwardIcon,
+ FormatIcon,
+ NextIcon,
+ RightIcon,
+ CorrectIcon,
+ LtIcon,
+ CloseIcon,
+ MenuIcon,
+ HideIcon,
+};
diff --git a/packages/base-ui/src/Components/Icon/Insert/index.tsx b/packages/base-ui/src/Components/Icon/Insert/index.tsx
index 5ba2a01f9f..ea75c7ead9 100644
--- a/packages/base-ui/src/Components/Icon/Insert/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Insert/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const PhotoIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8090" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8090" width="1em" height="1em" fill="currentColor">
<path
d="M810.666667 213.333333v597.333334H213.333333V213.333333h597.333334z m-42.666667 263.381334l-233.984 190.890666-118.613333-98.218666L256 704.64V768h512v-291.285333zM768 256H256v392.704l159.146667-134.954667 119.04 98.602667L768 421.674667V256zM384 341.333333a42.666667 42.666667 0 1 1 0 85.333334 42.666667 42.666667 0 0 1 0-85.333334z"
p-id="8091"
@@ -14,7 +14,7 @@ export const PhotoIcon = (props: BaseIconProps) => (
export const LinkIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7962" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7962" width="1em" height="1em" fill="currentColor">
<path
d="M771.584 251.733333c-49.066667-51.2-132.266667-51.2-181.333333 0l-74.666667 76.8c-8.533333 8.533333-8.533333 23.466667 0 32 8.533333 8.533333 21.333333 8.533333 29.866667 0l74.666666-76.8c34.133333-34.133333 87.466667-34.133333 121.6 0 34.133333 34.133333 34.133333 89.6 0 123.733334l-121.6 123.733333c-34.133333 34.133333-87.466667 34.133333-121.6 0-8.533333-8.533333-21.333333-8.533333-29.866666 0-8.533333 8.533333-8.533333 23.466667 0 32 49.066667 51.2 132.266667 51.2 181.333333 0l121.6-123.733333c51.2-53.333333 51.2-136.533333 0-187.733334z"
p-id="7963"
@@ -29,7 +29,7 @@ export const LinkIcon = (props: BaseIconProps) => (
export const ChartIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7833" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7833" width="1em" height="1em" fill="currentColor">
<path d="M256 213.333333H213.333333v597.333334h597.333334v-42.666667H256z" p-id="7834"></path>
<path
d="M490.666667 343.466667V554.666667h185.6c-19.2 72.533333-85.333333 128-164.266667 128-93.866667 0-170.666667-76.8-170.666667-170.666667 0-87.466667 66.133333-157.866667 149.333334-168.533333M512 298.666667c-117.333333 0-213.333333 96-213.333333 213.333333s96 213.333333 213.333333 213.333333 213.333333-96 213.333333-213.333333h-192V298.666667H512z"
diff --git a/packages/base-ui/src/Components/Icon/Logo/index.tsx b/packages/base-ui/src/Components/Icon/Logo/index.tsx
index fc2452ce0c..f21835285c 100644
--- a/packages/base-ui/src/Components/Icon/Logo/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Logo/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const LogoIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="logo" style={props.style}>
- <svg class="icon" viewBox="0 0 4864 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8477" fill="currentColor">
+ <svg className="icon" viewBox="0 0 4864 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8477" fill="currentColor">
<path
d="M1023.168 131.36c0 234.4-190.016 424.416-424.416 424.416 0-234.4 190.016-424.416 424.416-424.416zM131.36 1023.168c0-234.4 190.016-424.416 424.416-424.416 0 234.4-190.016 424.416-424.416 424.416zM929.696 929.696c-182.784 0-330.944-148.16-330.944-330.944 182.752 0 330.944 148.16 330.944 330.944z"
fill="#2D7FF9"
diff --git a/packages/base-ui/src/Components/Icon/Math/index.tsx b/packages/base-ui/src/Components/Icon/Math/index.tsx
index aa02b4d22d..bb35208f8d 100644
--- a/packages/base-ui/src/Components/Icon/Math/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Math/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const AddNumIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6466" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6466" width="1em" height="1em" fill="currentColor">
<path d="M533.333333 789.333333m-42.666666 0a42.666667 42.666667 0 1 0 85.333333 0 42.666667 42.666667 0 1 0-85.333333 0Z" p-id="6467"></path>
<path
d="M682.666667 554.666667a85.333333 85.333333 0 0 0-85.333334 85.333333v85.333333a85.333333 85.333333 0 1 0 170.666667 0V640a85.333333 85.333333 0 0 0-85.333333-85.333333z m0 42.666666a42.666667 42.666667 0 0 1 42.666666 42.666667v85.333333a42.666667 42.666667 0 1 1-85.333333 0V640a42.666667 42.666667 0 0 1 42.666667-42.666667z"
@@ -24,7 +24,7 @@ export const AddNumIcon = (props: BaseIconProps) => (
export const ReduceNumIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6336" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6336" width="1em" height="1em" fill="currentColor">
<path d="M533.333333 448m-42.666666 0a42.666667 42.666667 0 1 0 85.333333 0 42.666667 42.666667 0 1 0-85.333333 0Z" p-id="6337"></path>
<path d="M341.333333 789.333333m-42.666666 0a42.666667 42.666667 0 1 0 85.333333 0 42.666667 42.666667 0 1 0-85.333333 0Z" p-id="6338"></path>
<path
@@ -41,7 +41,7 @@ export const ReduceNumIcon = (props: BaseIconProps) => (
export const PercentIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6209" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6209" width="1em" height="1em" fill="currentColor">
<path
d="M653.525333 213.333333l36.949334 21.333334-320 554.24-36.949334-21.333334L653.525333 213.333333zM682.666667 469.333333c71.68 0 128 67.626667 128 149.333334S754.346667 768 682.666667 768s-128-67.626667-128-149.333333 56.32-149.333333 128-149.333334z m0 42.666667c-46.165333 0-85.333333 46.976-85.333334 106.666667s39.168 106.666667 85.333334 106.666666c46.165333 0 85.333333-46.976 85.333333-106.666666s-39.168-106.666667-85.333333-106.666667zM341.333333 234.666667c71.68 0 128 67.626667 128 149.333333s-56.32 149.333333-128 149.333333S213.333333 465.706667 213.333333 384s56.32-149.333333 128-149.333333z m0 42.666666C295.168 277.333333 256 324.309333 256 384s39.168 106.666667 85.333333 106.666667c46.165333 0 85.333333-46.976 85.333334-106.666667s-39.168-106.666667-85.333334-106.666667z"
p-id="6210"
@@ -52,7 +52,7 @@ export const PercentIcon = (props: BaseIconProps) => (
export const MoneyIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6082" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6082" width="1em" height="1em" fill="currentColor">
<path
d="M658.816 256l34.986667 24.490667-124.629334 177.92h119.04v42.666666h-149.333333v85.333334h149.333333v42.666666h-149.333333v128h-42.666667v-128h-149.333333v-42.666666h149.333333v-85.333334h-149.333333v-42.666666h119.04L341.333333 280.490667 376.32 256l141.226667 201.728L658.816 256z"
p-id="6083"
@@ -63,7 +63,7 @@ export const MoneyIcon = (props: BaseIconProps) => (
export const FxIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5446" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5446" width="1em" height="1em" fill="currentColor">
<path
d="M771.072 391.253333a6.698667 6.698667 0 0 0-0.512-9.514666 6.997333 6.997333 0 0 0-4.48-1.749334h-61.354667c-1.962667 0-3.84 0.853333-5.12 2.346667l-103.893333 122.709333a6.698667 6.698667 0 0 1-11.392-1.621333l-53.674667-119.381333a6.656 6.656 0 0 0-6.144-4.010667H381.866667l0.853333-3.968 6.741333-35.712c8.874667-46.933333 32.085333-68.864 72.533334-68.864 15.658667 0 29.994667 1.450667 41.258666 4.010667l11.861334-56.490667a197.888 197.888 0 0 0-46.464-5.12c-87.296 0-132.224 37.418667-148.650667 124.458667l-7.978667 41.813333H229.632a6.698667 6.698667 0 0 0-6.613333 5.376l-9.130667 43.818667a6.826667 6.826667 0 0 0 6.570667 8.106666h79.786666l-75.264 363.52a6.826667 6.826667 0 0 0 6.570667 8.234667H287.573333c3.242667 0 5.973333-2.346667 6.570667-5.418667l75.861333-366.165333h114.773334l57.685333 117.546667a6.570667 6.570667 0 0 1-1.024 7.381333l-152.746667 171.690667a6.826667 6.826667 0 0 0 5.12 11.264h61.44c2.005333 0 3.882667-0.853333 5.162667-2.389334l104.576-123.989333a6.826667 6.826667 0 0 1 11.392 1.493333l55.594667 120.661334a6.741333 6.741333 0 0 0 6.186666 3.968h54.613334a6.784 6.784 0 0 0 6.101333-9.770667L618.325333 567.466667a6.698667 6.698667 0 0 1 1.066667-7.466667l151.722667-168.661333-0.042667-0.042667z"
p-id="5447"
@@ -74,7 +74,7 @@ export const FxIcon = (props: BaseIconProps) => (
export const AddIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em" fill="currentColor">
<path d="M213.333333 469.333333h597.333334v85.333334H213.333333z" p-id="5319"></path>
<path d="M554.666667 213.333333v597.333334h-85.333334V213.333333z" p-id="5320"></path>
</svg>
@@ -83,7 +83,7 @@ export const AddIcon = (props: BaseIconProps) => (
export const ReduceIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em" fill="currentColor">
<path d="M213.333333 469.333333h597.333334v85.333334H213.333333z" p-id="5319"></path>
</svg>
</Icon>
diff --git a/packages/base-ui/src/Components/Icon/Other/index.tsx b/packages/base-ui/src/Components/Icon/Other/index.tsx
index f56f9c4d34..2d47e78bfe 100644
--- a/packages/base-ui/src/Components/Icon/Other/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Other/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const Close = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="logo" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4224" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4224" width="1em" height="1em" fill="currentColor">
<path d="M119.808 180.053333l60.330667-60.245333 724.053333 724.053333-60.330667 60.330667z" p-id="4225"></path>
<path d="M843.946667 119.808l60.245333 60.330667-724.053333 724.053333-60.330667-60.330667z" p-id="4226"></path>
</svg>
@@ -11,7 +11,7 @@ export const Close = (props: BaseIconProps) => (
);
export const DropDownIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="dropdown" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4519" width="1em" height="1em">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4519" width="1em" height="1em">
<path d="M149.930667 444.330667l60.330666-60.330667 362.069334 362.069333L512 806.4z" fill="#B5B8BD" p-id="4520"></path>
<path d="M813.738667 384l60.330666 60.330667L512 806.4l-60.330667-60.330667z" fill="#B5B8BD" p-id="4521"></path>
</svg>
diff --git a/packages/base-ui/src/Components/Icon/Sheet/index.tsx b/packages/base-ui/src/Components/Icon/Sheet/index.tsx
index 994e2acd30..31a1897c80 100644
--- a/packages/base-ui/src/Components/Icon/Sheet/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Sheet/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const CommentIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7705" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7705" width="1em" height="1em" fill="currentColor">
<path d="M352 490.666667a32 32 0 1 0 64 0 32 32 0 0 0-64 0z m128 0a32 32 0 1 0 64 0 32 32 0 0 0-64 0z m128 0a32 32 0 1 0 64 0 32 32 0 0 0-64 0z" p-id="7706"></path>
<path
d="M768 298.666667H256c-23.466667 0-42.666667 19.2-42.666667 42.666666v298.666667c0 23.466667 19.2 42.666667 42.666667 42.666667h106.666667v128l128-128H768c23.466667 0 42.666667-19.2 42.666667-42.666667V341.333333c0-23.466667-19.2-42.666667-42.666667-42.666666z m0 320c0 12.8-8.533333 21.333333-21.333333 21.333333H469.333333l-64 64V640h-128c-12.8 0-21.333333-8.533333-21.333333-21.333333v-256c0-12.8 8.533333-21.333333 21.333333-21.333334h469.333334c12.8 0 21.333333 8.533333 21.333333 21.333334v256z"
@@ -15,7 +15,7 @@ export const CommentIcon = (props: BaseIconProps) => (
export const FreezeIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5448" width="1em" height="1em">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5448" width="1em" height="1em">
<path d="M256.426667 256.426667h255.317333v553.130666H256.426667z" fill="#B5B8BD" p-id="5449"></path>
<path
d="M809.557333 213.930667v595.626666H213.930667V213.930667h595.626666z m-42.538666 42.538666H256.426667v510.549334h510.549333V256.426667z"
@@ -35,7 +35,7 @@ export const FreezeIcon = (props: BaseIconProps) => (
export const conditionalFormatIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6039" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6039" width="1em" height="1em" fill="currentColor">
<path
d="M810.666667 213.333333v597.333334H213.333333V213.333333h597.333334z m-42.666667 320h-106.666667V768H768v-234.666667z m-405.376 0h-106.666667V768h106.666667v-234.666667z m256.042667 86.784L445.482667 768H618.666667v-147.882667z m0-162.346666l-213.376 179.968v108.885333l213.376-179.072v-109.781333z m0-163.669334l-213.333334 179.029334v108.885333l213.333334-179.072V294.101333zM768 256h-103.936l-2.730667 2.304V490.666667H768V256zM362.666667 256H256v234.666667h106.666667V256z m235.008 0H405.333333v161.408L597.674667 256z"
p-id="6040"
@@ -46,7 +46,7 @@ export const conditionalFormatIcon = (props: BaseIconProps) => (
export const DivideIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5501" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5501" width="1em" height="1em" fill="currentColor">
<path
d="M544.896 389.717333h110.762667v46.933334c6.698667 6.613333 15.658667 6.613333 22.357333 0l84.949333-55.125334c6.698667-4.437333 6.698667-13.226667 0-19.84l-84.906666-57.386666c-6.741333-6.613333-15.701333-6.613333-22.4 0v41.258666h-133.12l-89.429334 154.453334H343.722667v0.128h-22.698667c-11.178667 0-22.357333 11.050667-22.357333 22.058666 0 11.050667 11.178667 22.058667 22.357333 22.058667h134.101333l-0.085333-0.128h0.426667l89.386666-154.453333h0.042667z m133.12 198.954667a15.061333 15.061333 0 0 0-22.314667 0v43.690667h-66.133333l-67.029333-110.293334-22.357334 44.117334s62.592 103.68 67.072 110.293333h88.448V721.066667a15.061333 15.061333 0 0 0 22.314667 0l84.949333-55.168c6.698667-4.437333 6.698667-13.226667 0-19.84l-84.906666-57.386667h-0.042667z"
p-id="5502"
@@ -57,7 +57,7 @@ export const DivideIcon = (props: BaseIconProps) => (
export const ReplaceIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4859" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4859" width="1em" height="1em" fill="currentColor">
<path
d="M768 430.933333H280.405333l-4.394666-0.554666c-5.461333-0.853333-6.570667-1.749333-12.885334-6.528l-2.986666-5.376c-6.4-11.946667-5.376-13.738667 2.986666-28.885334L440.618667 213.333333l34.218666 34.048-136.362666 135.424H768v48.170667z m-7.594667 163.242667L585.472 768l-34.261333-34.048 136.362666-135.424H258.048v-48.170667h484.096c10.453333 0 19.882667 6.272 23.893333 15.872a25.6 25.6 0 0 1-5.632 27.989334z"
p-id="4860"
@@ -68,7 +68,7 @@ export const ReplaceIcon = (props: BaseIconProps) => (
export const SearchIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4732" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4732" width="1em" height="1em" fill="currentColor">
<path
d="M664.832 634.624l128.554667 128.597333a21.333333 21.333333 0 1 1-30.165334 30.165334l-128.597333-128.597334a256 256 0 1 1 30.165333-30.165333zM469.333333 682.666667a213.333333 213.333333 0 1 0 0-426.666667 213.333333 213.333333 0 0 0 0 426.666667z"
p-id="4733"
@@ -79,7 +79,7 @@ export const SearchIcon = (props: BaseIconProps) => (
export const LockIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4605" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4605" width="1em" height="1em" fill="currentColor">
<path
d="M810.666667 213.333333v597.333334H213.333333V213.333333h597.333334zM341.333333 383.872H256V768h85.333333V383.872z m426.666667 0H383.872V768H768V383.872z m-149.333333 21.461333a64 64 0 0 1 63.701333 57.856L682.666667 469.333333v64h42.666666v213.333334h-298.666666v-213.333334h42.666666V469.333333a64 64 0 0 1 57.856-63.701333L533.333333 405.333333h85.333334z m64 170.666667h-213.333334v128h213.333334v-128z m-106.666667 21.333333a21.333333 21.333333 0 0 1 21.333333 21.333334v42.666666a21.333333 21.333333 0 1 1-42.666666 0v-42.666666a21.333333 21.333333 0 0 1 21.333333-21.333334z m42.666667-149.333333h-85.333334a21.333333 21.333333 0 0 0-20.992 17.493333L512 469.333333v64h128V469.333333a21.333333 21.333333 0 0 0-13.909333-20.010666l-3.584-0.981334-3.84-0.341333zM768 256H383.872v85.290667L768 341.333333V256zM341.333333 256H256v85.333333l85.333333-0.042666V256z"
p-id="4606"
@@ -90,7 +90,7 @@ export const LockIcon = (props: BaseIconProps) => (
export const LocationIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5579" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5579" width="1em" height="1em" fill="currentColor">
<path
d="M618.666667 723.584V661.333333a21.333333 21.333333 0 1 1 42.666666 0v62.250667a128.128 128.128 0 0 0 104.917334-104.917333H704a21.333333 21.333333 0 1 1 0-42.666667h62.250667a128.128 128.128 0 0 0-104.917334-104.874667V533.333333a21.333333 21.333333 0 1 1-42.666666 0v-62.208a128.085333 128.085333 0 0 0-104.874667 104.874667H576a21.333333 21.333333 0 0 1 0 42.666667h-62.208a128.128 128.128 0 0 0 104.874667 104.917333z m149.333333-296.96a213.12 213.12 0 0 0-42.666667-24.874667V277.333333a21.333333 21.333333 0 0 0-21.333333-21.333333h-426.666667a21.333333 21.333333 0 0 0-21.333333 21.333333v341.333334a21.333333 21.333333 0 0 0 21.333333 21.333333h153.6c2.986667 14.848 7.594667 29.098667 13.482667 42.666667H256a42.666667 42.666667 0 0 1-42.666667-42.666667V256a42.666667 42.666667 0 0 1 42.666667-42.666667h469.333333a42.666667 42.666667 0 0 1 42.666667 42.666667v170.666667zM640 768a170.666667 170.666667 0 1 1 0-341.333333 170.666667 170.666667 0 0 1 0 341.333333z"
p-id="5580"
@@ -101,7 +101,7 @@ export const LocationIcon = (props: BaseIconProps) => (
export const PageIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5318" width="1em" height="1em">
<path d="M810.666667 213.333333v597.333334H213.333333V213.333333h597.333334z m-42.666667 42.666667H256v512h512V256z" p-id="5319"></path>
<path d="M256 512h256v42.666667H256zM554.666667 256v298.666667h-42.666667V256z" p-id="5320"></path>
<path d="M405.333333 256v298.666667h-42.666666V256z" p-id="5321"></path>
@@ -111,7 +111,7 @@ export const PageIcon = (props: BaseIconProps) => (
export const RegularIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5447" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5447" width="1em" height="1em" fill="currentColor">
<path d="M256 256h554.666667v42.666667H256z" p-id="5448"></path>
<path
d="M298.666667 256v554.666667H256V256zM810.666667 256v554.666667h-42.666667V256zM469.333333 256v554.666667h-42.666666V256zM640 256v554.666667h-42.666667V256z"
@@ -124,7 +124,7 @@ export const RegularIcon = (props: BaseIconProps) => (
export const LayoutIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5576" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5576" width="1em" height="1em" fill="currentColor">
<path
d="M810.666667 213.333333v42.666667h-170.709334L640 768h170.666667v42.666667h-213.333334V213.333333h213.333334z m-384 0l-0.042667 554.666667H426.666667v42.666667H213.333333v-42.666667h170.624L384 256H213.333333V213.333333h213.333334z m106.666666 512v85.333334h-42.666666v-85.333334h42.666666z m0-170.666666v85.333333h-42.666666v-85.333333h42.666666z m0-170.666667v85.333333h-42.666666V384h42.666666z m0-170.666667v85.333334h-42.666666V213.333333h42.666666z"
p-id="5577"
@@ -135,7 +135,7 @@ export const LayoutIcon = (props: BaseIconProps) => (
export const TableIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6094" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6094" width="1em" height="1em" fill="currentColor">
<path
d="M913.988 173.68H110.05c-25.671 0-46.676 21.007-46.676 46.679v665.897c0 25.651 20.987 46.638 46.637 46.638H913.95c25.671 0 46.676-21.004 46.676-46.676V220.32c0-25.651-20.988-46.64-46.638-46.64zM339.796 896.142c0 12.016-9.34 21.353-21.305 21.353H104.864c-11.965 0-21.303-9.337-21.303-21.353V768.023c0-12.014 9.338-21.353 21.303-21.353h213.627c11.965 0 21.305 9.34 21.305 21.353v128.118z m0-224.995c0 12.015-9.34 21.353-21.305 21.353H104.864c-11.965 0-21.303-9.338-21.303-21.353V543.029c0-12.013 9.338-21.354 21.303-21.354h213.627c11.965 0 21.305 9.34 21.305 21.354v128.117z m0-223.432c0 12.016-9.34 21.353-21.305 21.353H104.864c-11.965 0-21.303-9.337-21.303-21.353V319.596c0-12.013 9.338-21.353 21.303-21.353h213.627c11.965 0 21.305 9.34 21.305 21.353v128.118zM639.269 896.14c0 12.016-9.34 21.353-21.306 21.353H404.337c-11.966 0-21.305-9.337-21.305-21.353V768.023c0-12.014 9.34-21.353 21.305-21.353h213.626c11.966 0 21.306 9.34 21.306 21.353v128.118z m0-224.995c0 12.015-9.34 21.353-21.306 21.353H404.337c-11.966 0-21.305-9.338-21.305-21.353V543.029c0-12.013 9.34-21.354 21.305-21.354h213.626c11.966 0 21.306 9.34 21.306 21.354v128.117z m0-223.432c0 12.016-9.34 21.353-21.306 21.353H404.337c-11.966 0-21.305-9.337-21.305-21.353V319.596c0-12.013 9.34-21.353 21.305-21.353h213.626c11.966 0 21.306 9.34 21.306 21.353v128.118zM941.864 896.14c0 12.016-9.34 21.353-21.304 21.353H706.933c-11.966 0-21.304-9.337-21.304-21.353V768.023c0-12.014 9.338-21.353 21.304-21.353h213.626c11.966 0 21.304 9.34 21.304 21.353v128.118z m0-224.995c0 12.015-9.34 21.353-21.304 21.353H706.933c-11.966 0-21.304-9.338-21.304-21.353V543.029c0-12.013 9.338-21.354 21.304-21.354h213.626c11.966 0 21.304 9.34 21.304 21.354v128.117z m0-223.432c0 12.016-9.34 21.353-21.304 21.353H706.933c-11.966 0-21.304-9.337-21.304-21.353V319.596c0-12.013 9.338-21.353 21.304-21.353h213.626c11.966 0 21.304 9.34 21.304 21.353v128.118z"
p-id="6095"
diff --git a/packages/base-ui/src/Components/Icon/Text/index.tsx b/packages/base-ui/src/Components/Icon/Text/index.tsx
index bd956e9a41..1f9d96505e 100644
--- a/packages/base-ui/src/Components/Icon/Text/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Text/index.tsx
@@ -1,185 +1,185 @@
-import { BaseIconProps } from '../../../Interfaces';
-import { Icon } from '../AddIcon';
-
-export const LeftAlignIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7250" width="1em" height="1em" fill="currentColor">
- <path
- d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666z m0 128h341.333333a21.333333 21.333333 0 0 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z m0 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666z m0 128h341.333333a21.333333 21.333333 0 0 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
- p-id="7251"
- ></path>
- </svg>
- </Icon>
-);
-
-export const CenterAlignIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7377" width="1em" height="1em" fill="currentColor">
- <path
- d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666zM341.333333 426.666667h341.333334a21.333333 21.333333 0 1 1 0 42.666666H341.333333a21.333333 21.333333 0 0 1 0-42.666666z m-106.666666 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666zM341.333333 682.666667h341.333334a21.333333 21.333333 0 1 1 0 42.666666H341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
- p-id="7378"
- ></path>
- </svg>
- </Icon>
-);
-
-export const RightAlignIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7504" width="1em" height="1em" fill="currentColor">
- <path
- d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666z m213.333333 128h341.333333a21.333333 21.333333 0 1 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z m-213.333333 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666z m213.333333 128h341.333333a21.333333 21.333333 0 1 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
- p-id="7505"
- ></path>
- </svg>
- </Icon>
-);
-
-export const TopVerticalIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7631" width="1em" height="1em" fill="currentColor">
- <path
- d="M298.666667 384h426.666666v42.666667H298.666667zM416 527.829333l90.496-90.496 90.538667 90.496-30.165334 30.165334-37.802666-37.717334v290.090667h-42.666667v-292.565333l-40.234667 40.192-30.165333-30.165334z"
- p-id="7632"
- ></path>
- </svg>
- </Icon>
-);
-
-export const CenterVerticalIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7758" width="1em" height="1em" fill="currentColor">
- <path
- d="M725.333333 533.333333H298.666667v-42.666666h426.666666zM426.666667 634.496l90.496-90.496 90.538666 90.496-30.165333 30.165333-39.936-39.850666v121.557333h-42.666667v-119.765333l-38.101333 38.058666-30.165333-30.165333zM426.666667 389.162667l90.496 90.538666 90.538666-90.538666-30.165333-30.165334-39.936 39.893334V277.333333h-42.666667v119.765334l-38.101333-38.101334-30.165333 30.165334z"
- p-id="7759"
- ></path>
- </svg>
- </Icon>
-);
-
-export const BottomVerticalIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7885" width="1em" height="1em" fill="currentColor">
- <path
- d="M725.333333 725.333333H298.666667v-42.666666h426.666666zM608 581.504l-90.496 90.496-90.538667-90.496 30.165334-30.165333 37.802666 37.717333V298.965333h42.666667v292.565334l40.234667-40.192 30.165333 30.165333z"
- p-id="7886"
- ></path>
- </svg>
- </Icon>
-);
-
-export const TextRotateIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8217" width="1em" height="1em" fill="currentColor">
- <path
- d="M549.546667 213.333333l77.653333 213.333334h0.64l-0.042667 1.621333 53.76 147.712h-45.354666l-38.826667-106.666667h-152.405333l-38.826667 106.666667H360.789333l53.674667-147.498667 0.042667-1.834666h0.64l77.610666-213.333334h56.789334z m-28.416 46.634667L460.458667 426.666667h121.386666l-60.714666-166.698667zM709.162667 618.666667l90.538666 90.496-90.538666 90.538666-30.165334-30.165333 37.76-37.802667H256v-42.666666h463.232l-40.234667-40.234667 30.165334-30.165333z"
- p-id="8218"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateAngleUpIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4524" width="1em" height="1em" fill="currentColor">
- <path
- d="M290.944 289.365333l205.738667 95.914667 0.469333-0.426667 1.109333 1.152 142.506667 66.432-32.128 32.085334-102.826667-47.957334-107.818666 107.733334 48 102.912-32.085334 32.042666-66.346666-142.250666-1.28-1.28 0.469333-0.512-96-205.696 40.192-40.149334z m12.885333 53.034667l74.965334 160.810667 85.845333-85.845334L303.786667 342.4zM690.432 463.104h128v128h-42.666667v-53.418667l-325.845333 325.802667-30.165333-30.165333 327.552-327.552h-56.874667v-42.666667z"
- fill="#444D5A"
- p-id="4525"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateAngleDownIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4659" width="1em" height="1em" fill="currentColor">
- <path
- d="M755.968 312.277333l-95.914667 205.738667 0.426667 0.469333-1.152 1.109334-66.432 142.506666-32.085333-32.128 47.957333-102.826666-107.733333-107.818667-102.912 48-32.042667-32.085333 142.250667-66.346667 1.28-1.28 0.512 0.469333 205.696-96 40.149333 40.192z m-53.034667 12.885334l-160.810666 74.965333 85.845333 85.845333 74.965333-160.810666zM582.229333 711.765333v128h-128v-42.666666h53.418667l-325.802667-325.845334 30.165334-30.165333 327.552 327.552v-56.874667h42.666666z"
- fill="#444D5A"
- p-id="4660"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateVerticalIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4794" width="1em" height="1em" fill="currentColor">
- <path
- d="M636.757333 298.666667l77.653334 213.333333h0.64l-0.042667 1.621333 53.76 147.712h-45.354667l-38.826666-106.666666h-152.405334l-38.826666 106.666666H448l53.674667-147.498666 0.042666-1.834667h0.64l77.610667-213.333333h56.789333z m-28.416 46.634666L547.669333 512h121.386667l-60.714667-166.698667zM394.368 698.496L303.786667 789.034667 213.333333 698.453333l30.165334-30.165333 37.802666 37.76V245.333333h42.666667v463.232l40.234667-40.234666 30.165333 30.165333z"
- fill="#444D5A"
- p-id="4795"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateRotationUpIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4929" width="1em" height="1em" fill="currentColor">
- <path
- d="M192 495.786667l213.333333-77.653334v-0.64l1.621334 0.042667L554.666667 363.776v45.354667l-106.666667 38.826666v152.405334l106.666667 38.826666v45.354667l-147.498667-53.674667-1.834667-0.042666v-0.64l-213.333333-77.610667V495.786667z m46.634667 28.416L405.333333 584.874667v-121.386667l-166.698666 60.714667zM597.333333 336.170667l90.496-90.538667 90.538667 90.538667-30.165333 30.165333-37.802667-37.76V789.333333h-42.666667V326.101333l-40.234666 40.234667L597.333333 336.170667z"
- fill="#444D5A"
- p-id="4930"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateRotationDownIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5199" width="1em" height="1em" fill="currentColor">
- <path
- d="M789.333333 528.213333l-213.333333 77.653334v0.64l-1.621333-0.042667L426.666667 660.224v-45.354667l106.666666-38.826666V423.637333l-106.666666-38.826666V339.456l147.498666 53.674667 1.834667 0.042666v0.64l213.333333 77.610667v56.789333z m-46.634666-28.416L576 439.125333v121.386667l166.698667-60.714667zM384 687.829333l-90.496 90.538667-90.538667-90.538667 30.165334-30.165333 37.802666 37.76V234.666667h42.666667v463.232l40.234667-40.234667 30.165333 30.165333z"
- fill="#444D5A"
- p-id="5200"
- ></path>
- </svg>
- </Icon>
-);
-
-export const BrIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8736" width="1em" height="1em" fill="currentColor">
- <path
- d="M213.333333 213.333333h85.12v597.333334H213.333333V213.333333z m225.450667 477.44l25.557333-21.333333-72.362666-63.786667 72.362666-63.872-25.557333-21.248-93.610667 80.853334h4.266667-4.266667l93.610667 89.386666z"
- p-id="8737"
- ></path>
- <path d="M768 213.333333h42.581333v597.333334H768z" p-id="8738"></path>
- <path
- d="M540.928 367.274667H391.978667v42.581333h148.949333c59.605333 0 106.410667 38.314667 106.410667 85.12s-46.805333 85.12-106.410667 85.12H391.978667v42.581333h148.949333c85.12 0 157.482667-55.338667 157.482667-127.701333s-72.362667-127.701333-157.44-127.701333z"
- p-id="8739"
- ></path>
- </svg>
- </Icon>
-);
-
-export const OverflowIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8608" width="1em" height="1em" fill="currentColor">
- <path
- d="M300.288 810.666667H213.333333V213.333333h86.954667v279.978667h441.898667l-91.306667-85.845333 26.624-26.112L810.666667 512l-133.162667 130.688-26.624-26.154667 91.306667-85.845333-441.898667-0.042667z"
- p-id="8609"
- ></path>
- <path d="M530.688 213.333333h42.666667v242.688h-42.666667V213.333333z m0 354.688h42.666667V810.666667h-42.666667v-242.688z" p-id="8610"></path>
- </svg>
- </Icon>
-);
-
-export const CutIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8865" width="1em" height="1em" fill="currentColor">
- <path d="M767.829333 213.333333h42.496v597.333334h-42.496z" p-id="8866"></path>
- <path d="M767.146667 553.216h-384v-42.496h384v42.496zM213.333333 213.333333h84.992v597.333334H213.333333V213.333333z" p-id="8867"></path>
- </svg>
- </Icon>
-);
-
-export default {
- LeftAlignIcon,
- CenterAlignIcon,
- RightAlignIcon,
- TopVerticalIcon,
- CenterVerticalIcon,
- BottomVerticalIcon,
- TextRotateIcon,
- TextRotateAngleUpIcon,
- BrIcon,
- OverflowIcon,
- CutIcon,
-};
+import { BaseIconProps } from '../../../Interfaces';
+import { Icon } from '../AddIcon';
+
+export const LeftAlignIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7250" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666z m0 128h341.333333a21.333333 21.333333 0 0 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z m0 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666z m0 128h341.333333a21.333333 21.333333 0 0 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
+ p-id="7251"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const CenterAlignIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7377" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666zM341.333333 426.666667h341.333334a21.333333 21.333333 0 1 1 0 42.666666H341.333333a21.333333 21.333333 0 0 1 0-42.666666z m-106.666666 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666zM341.333333 682.666667h341.333334a21.333333 21.333333 0 1 1 0 42.666666H341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
+ p-id="7378"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const RightAlignIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7504" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666z m213.333333 128h341.333333a21.333333 21.333333 0 1 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z m-213.333333 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666z m213.333333 128h341.333333a21.333333 21.333333 0 1 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
+ p-id="7505"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const TopVerticalIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7631" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M298.666667 384h426.666666v42.666667H298.666667zM416 527.829333l90.496-90.496 90.538667 90.496-30.165334 30.165334-37.802666-37.717334v290.090667h-42.666667v-292.565333l-40.234667 40.192-30.165333-30.165334z"
+ p-id="7632"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const CenterVerticalIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7758" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M725.333333 533.333333H298.666667v-42.666666h426.666666zM426.666667 634.496l90.496-90.496 90.538666 90.496-30.165333 30.165333-39.936-39.850666v121.557333h-42.666667v-119.765333l-38.101333 38.058666-30.165333-30.165333zM426.666667 389.162667l90.496 90.538666 90.538666-90.538666-30.165333-30.165334-39.936 39.893334V277.333333h-42.666667v119.765334l-38.101333-38.101334-30.165333 30.165334z"
+ p-id="7759"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const BottomVerticalIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7885" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M725.333333 725.333333H298.666667v-42.666666h426.666666zM608 581.504l-90.496 90.496-90.538667-90.496 30.165334-30.165333 37.802666 37.717333V298.965333h42.666667v292.565334l40.234667-40.192 30.165333 30.165333z"
+ p-id="7886"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const TextRotateIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8217" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M549.546667 213.333333l77.653333 213.333334h0.64l-0.042667 1.621333 53.76 147.712h-45.354666l-38.826667-106.666667h-152.405333l-38.826667 106.666667H360.789333l53.674667-147.498667 0.042667-1.834666h0.64l77.610666-213.333334h56.789334z m-28.416 46.634667L460.458667 426.666667h121.386666l-60.714666-166.698667zM709.162667 618.666667l90.538666 90.496-90.538666 90.538666-30.165334-30.165333 37.76-37.802667H256v-42.666666h463.232l-40.234667-40.234667 30.165334-30.165333z"
+ p-id="8218"
+ ></path>
+ </svg>
+ </Icon>
+);
+export const TextRotateAngleUpIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4524" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M290.944 289.365333l205.738667 95.914667 0.469333-0.426667 1.109333 1.152 142.506667 66.432-32.128 32.085334-102.826667-47.957334-107.818666 107.733334 48 102.912-32.085334 32.042666-66.346666-142.250666-1.28-1.28 0.469333-0.512-96-205.696 40.192-40.149334z m12.885333 53.034667l74.965334 160.810667 85.845333-85.845334L303.786667 342.4zM690.432 463.104h128v128h-42.666667v-53.418667l-325.845333 325.802667-30.165333-30.165333 327.552-327.552h-56.874667v-42.666667z"
+ fill="#444D5A"
+ p-id="4525"
+ ></path>
+ </svg>
+ </Icon>
+);
+export const TextRotateAngleDownIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4659" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M755.968 312.277333l-95.914667 205.738667 0.426667 0.469333-1.152 1.109334-66.432 142.506666-32.085333-32.128 47.957333-102.826666-107.733333-107.818667-102.912 48-32.042667-32.085333 142.250667-66.346667 1.28-1.28 0.512 0.469333 205.696-96 40.149333 40.192z m-53.034667 12.885334l-160.810666 74.965333 85.845333 85.845333 74.965333-160.810666zM582.229333 711.765333v128h-128v-42.666666h53.418667l-325.802667-325.845334 30.165334-30.165333 327.552 327.552v-56.874667h42.666666z"
+ fill="#444D5A"
+ p-id="4660"
+ ></path>
+ </svg>
+ </Icon>
+);
+export const TextRotateVerticalIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4794" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M636.757333 298.666667l77.653334 213.333333h0.64l-0.042667 1.621333 53.76 147.712h-45.354667l-38.826666-106.666666h-152.405334l-38.826666 106.666666H448l53.674667-147.498666 0.042666-1.834667h0.64l77.610667-213.333333h56.789333z m-28.416 46.634666L547.669333 512h121.386667l-60.714667-166.698667zM394.368 698.496L303.786667 789.034667 213.333333 698.453333l30.165334-30.165333 37.802666 37.76V245.333333h42.666667v463.232l40.234667-40.234666 30.165333 30.165333z"
+ fill="#444D5A"
+ p-id="4795"
+ ></path>
+ </svg>
+ </Icon>
+);
+export const TextRotateRotationUpIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4929" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M192 495.786667l213.333333-77.653334v-0.64l1.621334 0.042667L554.666667 363.776v45.354667l-106.666667 38.826666v152.405334l106.666667 38.826666v45.354667l-147.498667-53.674667-1.834667-0.042666v-0.64l-213.333333-77.610667V495.786667z m46.634667 28.416L405.333333 584.874667v-121.386667l-166.698666 60.714667zM597.333333 336.170667l90.496-90.538667 90.538667 90.538667-30.165333 30.165333-37.802667-37.76V789.333333h-42.666667V326.101333l-40.234666 40.234667L597.333333 336.170667z"
+ fill="#444D5A"
+ p-id="4930"
+ ></path>
+ </svg>
+ </Icon>
+);
+export const TextRotateRotationDownIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5199" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M789.333333 528.213333l-213.333333 77.653334v0.64l-1.621333-0.042667L426.666667 660.224v-45.354667l106.666666-38.826666V423.637333l-106.666666-38.826666V339.456l147.498666 53.674667 1.834667 0.042666v0.64l213.333333 77.610667v56.789333z m-46.634666-28.416L576 439.125333v121.386667l166.698667-60.714667zM384 687.829333l-90.496 90.538667-90.538667-90.538667 30.165334-30.165333 37.802666 37.76V234.666667h42.666667v463.232l40.234667-40.234667 30.165333 30.165333z"
+ fill="#444D5A"
+ p-id="5200"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const BrIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8736" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M213.333333 213.333333h85.12v597.333334H213.333333V213.333333z m225.450667 477.44l25.557333-21.333333-72.362666-63.786667 72.362666-63.872-25.557333-21.248-93.610667 80.853334h4.266667-4.266667l93.610667 89.386666z"
+ p-id="8737"
+ ></path>
+ <path d="M768 213.333333h42.581333v597.333334H768z" p-id="8738"></path>
+ <path
+ d="M540.928 367.274667H391.978667v42.581333h148.949333c59.605333 0 106.410667 38.314667 106.410667 85.12s-46.805333 85.12-106.410667 85.12H391.978667v42.581333h148.949333c85.12 0 157.482667-55.338667 157.482667-127.701333s-72.362667-127.701333-157.44-127.701333z"
+ p-id="8739"
+ ></path>
+ </svg>
+ </Icon>
+);
+
+export const OverflowIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8608" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M300.288 810.666667H213.333333V213.333333h86.954667v279.978667h441.898667l-91.306667-85.845333 26.624-26.112L810.666667 512l-133.162667 130.688-26.624-26.154667 91.306667-85.845333-441.898667-0.042667z"
+ p-id="8609"
+ ></path>
+ <path d="M530.688 213.333333h42.666667v242.688h-42.666667V213.333333z m0 354.688h42.666667V810.666667h-42.666667v-242.688z" p-id="8610"></path>
+ </svg>
+ </Icon>
+);
+
+export const CutIcon = (props: BaseIconProps) => (
+ <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8865" width="1em" height="1em" fill="currentColor">
+ <path d="M767.829333 213.333333h42.496v597.333334h-42.496z" p-id="8866"></path>
+ <path d="M767.146667 553.216h-384v-42.496h384v42.496zM213.333333 213.333333h84.992v597.333334H213.333333V213.333333z" p-id="8867"></path>
+ </svg>
+ </Icon>
+);
+
+export default {
+ LeftAlignIcon,
+ CenterAlignIcon,
+ RightAlignIcon,
+ TopVerticalIcon,
+ CenterVerticalIcon,
+ BottomVerticalIcon,
+ TextRotateIcon,
+ TextRotateAngleUpIcon,
+ BrIcon,
+ OverflowIcon,
+ CutIcon,
+};
diff --git a/packages/base-ui/src/Components/Icon/View/index.tsx b/packages/base-ui/src/Components/Icon/View/index.tsx
index 288116a33a..80879b12e1 100644
--- a/packages/base-ui/src/Components/Icon/View/index.tsx
+++ b/packages/base-ui/src/Components/Icon/View/index.tsx
@@ -3,7 +3,7 @@ import { Icon } from '../AddIcon';
export const PrintIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4476" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4476" width="1em" height="1em" fill="currentColor">
<path
d="M743.125333 341.333333c35.669333 0 64.384 28.885333 67.285334 65.024l0.256 6.101334V682.666667h-149.76v-42.666667H768V412.458667c0-14.592-9.514667-26.154667-21.333333-28.16L743.168 384H280.874667c-12.16 0-22.784 10.24-24.576 24.149333l-0.298667 4.266667V640h127.36v42.666667H213.333333V412.458667c0-36.906667 26.794667-67.712 61.653334-70.826667L280.874667 341.333333h462.250666z"
p-id="4477"
@@ -19,7 +19,7 @@ export const PrintIcon = (props: BaseIconProps) => (
export const ScreenshotIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5374" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5374" width="1em" height="1em" fill="currentColor">
<path
d="M590.848 567.04l-265.386667-306.645333a28.245333 28.245333 0 0 1 3.2-40.149334 29.141333 29.141333 0 0 1 40.789334 3.242667l267.946666 309.674667a124.885333 124.885333 0 0 1 144.213334 34.474666 125.141333 125.141333 0 0 1-16.042667 176.256 125.141333 125.141333 0 0 1-176.341333-14.805333 125.013333 125.013333 0 0 1 1.621333-162.048z m40.149333 18.133333c-18.602667 15.701333-29.312 38.826667-29.312 63.189334 0 45.909333 37.461333 83.157333 83.754667 83.157333a83.413333 83.413333 0 0 0 83.712-83.157333 83.413333 83.413333 0 0 0-83.712-83.114667c-15.189333 0-29.44 4.010667-41.685333 11.008a28.458667 28.458667 0 0 1-12.757334 8.96v-0.042667z m-150.698666-52.565333l-38.229334 44.16a29.653333 29.653333 0 0 1-0.768 0.810667 124.885333 124.885333 0 0 1-6.528 151.509333 125.141333 125.141333 0 0 1-176.341333 14.805333C205.226667 699.306667 198.101333 620.373333 242.346667 567.637333a124.928 124.928 0 0 1 156.416-28.544l38.528-44.501333c9.514667 17.237333 24.746667 30.634667 43.008 37.973333z m105.6-122.026667a85.632 85.632 0 0 0-43.818667-37.12l129.749333-150.016a29.141333 29.141333 0 0 1 40.789334-3.242666 28.245333 28.245333 0 0 1 3.2 40.149333l-129.92 150.186667z m-300.8 301.44c35.413333 29.738667 88.064 25.301333 117.546666-9.813333a83.413333 83.413333 0 0 0-10.666666-117.546667 83.456 83.456 0 0 0-117.589334 9.856 83.456 83.456 0 0 0 10.709334 117.504z"
p-id="5375"
@@ -30,7 +30,7 @@ export const ScreenshotIcon = (props: BaseIconProps) => (
export const PrintAreaIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5706" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5706" width="1em" height="1em" fill="currentColor">
<path
d="M727.04 706.218667a11.946667 11.946667 0 0 1 8.704 3.754666 13.312 13.312 0 0 1 3.626667 9.130667V810.666667H583.253333v-91.52c0-3.413333 1.28-6.741333 3.626667-9.173334a11.946667 11.946667 0 0 1 8.661333-3.754666zM362.666667 725.333333v42.666667h-128v-42.666667h128z m128 0v42.666667h-42.666667v-42.666667h42.666667z m301.696-143.957333a18.773333 18.773333 0 0 1 18.304 19.2v117.205333c0 10.581333-8.277333 19.2-18.346667 19.2h-28.458667v-11.434666c-0.128-21.333333-16.554667-38.570667-36.778666-38.570667h-131.498667c-20.224 0-36.693333 17.237333-36.778667 38.570667v11.477333h-28.458666a18.858667 18.858667 0 0 1-18.346667-19.2v-117.248c0-10.581333 8.277333-19.2 18.346667-19.2zM256 533.333333v128H213.333333v-128h42.666667z m411.477333 85.845334H567.04a12.586667 12.586667 0 0 0-12.245333 12.8c0.042667 7.125333 5.546667 12.885333 12.245333 12.842666h100.394667a12.586667 12.586667 0 0 0 12.202666-12.8c0-7.082667-5.504-12.8-12.202666-12.8zM723.072 512a14.506667 14.506667 0 0 1 14.165333 14.805333v35.84H585.386667v-35.84a14.506667 14.506667 0 0 1 14.165333-14.805333zM768 362.666667v128h-42.666667v-128h42.666667z m-512-42.666667v128H213.333333v-128h42.666667zM768 213.333333v64h-42.666667V256h-64V213.333333H768zM362.666667 213.333333v42.666667H256v21.333333H213.333333V213.333333h149.333334z m213.333333 0v42.666667h-128V213.333333h128z"
p-id="5707"
@@ -41,7 +41,7 @@ export const PrintAreaIcon = (props: BaseIconProps) => (
export const PrintTitleIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5833" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5833" width="1em" height="1em" fill="currentColor">
<path
d="M727.04 706.218667a11.946667 11.946667 0 0 1 8.704 3.754666 13.312 13.312 0 0 1 3.626667 9.130667V810.666667H583.253333v-91.52c0-3.413333 1.28-6.741333 3.626667-9.173334a11.946667 11.946667 0 0 1 8.661333-3.754666zM768 213.333333v277.333334h-42.666667V256H256v469.333333h234.666667v42.666667H213.333333V213.333333h554.666667z m24.362667 368.042667a18.773333 18.773333 0 0 1 18.304 19.2v117.205333c0 10.581333-8.277333 19.2-18.346667 19.2h-28.458667v-11.434666c-0.128-21.333333-16.554667-38.570667-36.778666-38.570667h-131.498667c-20.224 0-36.693333 17.237333-36.778667 38.570667v11.477333h-28.458666a18.858667 18.858667 0 0 1-18.346667-19.2v-117.248c0-10.581333 8.277333-19.2 18.346667-19.2z m-124.885334 37.802667H567.04a12.586667 12.586667 0 0 0-12.245333 12.8c0.042667 7.125333 5.546667 12.885333 12.245333 12.842666h100.394667a12.586667 12.586667 0 0 0 12.202666-12.8c0-7.082667-5.504-12.8-12.202666-12.8zM723.072 512a14.506667 14.506667 0 0 1 14.165333 14.805333v35.84H585.386667v-35.84a14.506667 14.506667 0 0 1 14.165333-14.805333z"
p-id="5834"
@@ -53,7 +53,7 @@ export const PrintTitleIcon = (props: BaseIconProps) => (
export const ImageIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5815" width="1em" height="1em" fill="currentColor">
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5815" width="1em" height="1em" fill="currentColor">
<path
d="M810.666667 213.333333v597.333334H213.333333V213.333333h597.333334z m-42.666667 263.381334l-233.984 190.890666-118.613333-98.218666L256 704.64V768h512v-291.285333zM768 256H256v392.704l159.146667-134.954667 119.04 98.602667L768 421.674667V256zM384 341.333333a42.666667 42.666667 0 1 1 0 85.333334 42.666667 42.666667 0 0 1 0-85.333334z"
fill="#444D5A"
diff --git a/packages/base-ui/src/Components/Icon/index.tsx b/packages/base-ui/src/Components/Icon/index.tsx
index dc000e261e..6afb425fd8 100644
--- a/packages/base-ui/src/Components/Icon/index.tsx
+++ b/packages/base-ui/src/Components/Icon/index.tsx
@@ -74,3 +74,4 @@ export * from './Font';
export * from './Cell';
export * from './Text';
export * from './Sheet';
+export * from './Math';
diff --git a/packages/base-ui/src/Components/Icon/test/index.test.tsx b/packages/base-ui/src/Components/Icon/test/index.test.tsx
index 017378dda6..018a7aff9a 100644
--- a/packages/base-ui/src/Components/Icon/test/index.test.tsx
+++ b/packages/base-ui/src/Components/Icon/test/index.test.tsx
@@ -1,22 +1,22 @@
-import Enzyme from 'enzyme';
-import Adapter from 'enzyme-adapter-preact-pure';
-import { render } from '@testing-library/preact';
-import { Icon } from '../AddIcon';
-
-Enzyme.configure({ adapter: new Adapter() });
-
-describe('icon', () => {
- test('icon', () => {
- const { container } = render(
- <Icon spin rotate={90}>
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5565" width="1em" height="1em" fill="currentColor">
- <path
- d="M287.018667 419.328h310.997333v42.666667H286.72l84.48 84.437333a21.333333 21.333333 0 1 1-30.208 30.165333l-120.746667-120.704a21.248 21.248 0 0 1 0-30.165333l120.746667-120.661333a21.333333 21.333333 0 0 1 30.165333 30.165333L287.018667 419.328z m524.330666 213.333333a213.333333 213.333333 0 0 0-213.333333-213.333333v42.666667a170.666667 170.666667 0 0 1 170.666667 170.666666h42.666666z m0 0h-42.666666v64a21.333333 21.333333 0 1 0 42.666666 0v-64z"
- p-id="5566"
- ></path>
- </svg>
- </Icon>
- );
- expect(container);
- });
-});
+import Enzyme from 'enzyme';
+import Adapter from 'enzyme-adapter-preact-pure';
+import { render } from '@testing-library/preact';
+import { Icon } from '../AddIcon';
+
+Enzyme.configure({ adapter: new Adapter() });
+
+describe('icon', () => {
+ test('icon', () => {
+ const { container } = render(
+ <Icon spin rotate={90}>
+ <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5565" width="1em" height="1em" fill="currentColor">
+ <path
+ d="M287.018667 419.328h310.997333v42.666667H286.72l84.48 84.437333a21.333333 21.333333 0 1 1-30.208 30.165333l-120.746667-120.704a21.248 21.248 0 0 1 0-30.165333l120.746667-120.661333a21.333333 21.333333 0 0 1 30.165333 30.165333L287.018667 419.328z m524.330666 213.333333a213.333333 213.333333 0 0 0-213.333333-213.333333v42.666667a170.666667 170.666667 0 0 1 170.666667 170.666666h42.666666z m0 0h-42.666666v64a21.333333 21.333333 0 1 0 42.666666 0v-64z"
+ p-id="5566"
+ ></path>
+ </svg>
+ </Icon>
+ );
+ expect(container);
+ });
+});
diff --git a/packages/base-ui/src/Components/Input/input.tsx b/packages/base-ui/src/Components/Input/input.tsx
index 69ba5de8d7..12cb71f4d6 100644
--- a/packages/base-ui/src/Components/Input/input.tsx
+++ b/packages/base-ui/src/Components/Input/input.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseInputProps, InputComponent } from '../../Interfaces';
import { joinClassNames } from '../../Utils';
@@ -89,21 +89,21 @@ export class Input extends Component<BaseInputProps, IState> {
// get input value
getValue = () => this.ref.current.value;
- componentWillMount() {
+ UNSAFE_componentWillMount() {
if (this.props.value) {
this.setValue(this.props.value);
}
}
- componentWillReceiveProps(nextProps: Readonly<BaseInputProps>) {
+ UNSAFE_componentWillReceiveProps(nextProps: Readonly<BaseInputProps>) {
if (nextProps.value && nextProps.value !== this.state.value) {
this.setValue(nextProps.value);
}
}
- render(props: BaseInputProps, state: IState) {
- const { id, disabled, type, placeholder, bordered = true, className = '', readonly } = props;
- const { value } = state;
+ render() {
+ const { id, disabled, type, placeholder, bordered = true, className = '', readonly } = this.props;
+ const { value } = this.state;
const classes = joinClassNames(
styles.input,
@@ -126,7 +126,7 @@ export class Input extends Component<BaseInputProps, IState> {
onChange={this.handleChange}
value={value}
onClick={this.onClick}
- readonly={readonly}
+ readOnly={readonly}
id={id}
onKeyUp={this.handlePressEnter}
></input>
diff --git a/packages/base-ui/src/Components/Item/Item.tsx b/packages/base-ui/src/Components/Item/Item.tsx
index 89ba2085ab..3e33c9496f 100644
--- a/packages/base-ui/src/Components/Item/Item.tsx
+++ b/packages/base-ui/src/Components/Item/Item.tsx
@@ -1,4 +1,4 @@
-import { ComponentChildren, Component } from 'preact';
+import { ComponentChildren, Component } from 'react';
import { BaseMenuItem } from '../../Interfaces';
import { joinClassNames } from '../../Utils';
import { CustomLabel } from '../CustomLabel';
diff --git a/packages/base-ui/src/Components/Layout/Layout.tsx b/packages/base-ui/src/Components/Layout/Layout.tsx
index 01ae8cd918..5bd3525295 100644
--- a/packages/base-ui/src/Components/Layout/Layout.tsx
+++ b/packages/base-ui/src/Components/Layout/Layout.tsx
@@ -1,5 +1,4 @@
-import { Component, createRef, Ref } from 'preact';
-import { forwardRef } from 'preact/compat';
+import { Component, createRef, Ref, forwardRef } from 'react';
import { BaseLayoutProps } from '../../Interfaces';
import { getFirstChildren } from '../../Utils';
import styles from './index.module.less';
@@ -39,9 +38,9 @@ export class Layout extends Component<BaseLayoutProps, IState> {
}
}
- render(props: BaseLayoutProps, state: IState) {
- const { children, style, className = '' } = props;
- const { isAside } = state;
+ render() {
+ const { children, style, className = '' } = this.props;
+ const { isAside } = this.state;
return (
<section
style={style}
diff --git a/packages/base-ui/src/Components/Menu/Menu.tsx b/packages/base-ui/src/Components/Menu/Menu.tsx
index fed7c909c0..44acc85500 100644
--- a/packages/base-ui/src/Components/Menu/Menu.tsx
+++ b/packages/base-ui/src/Components/Menu/Menu.tsx
@@ -1,5 +1,5 @@
import { ICommandService, isRealNum } from '@univerjs/core';
-import { Component, ComponentChild, createRef } from 'preact';
+import { Component, ComponentChild, createRef, Fragment } from 'react';
import { Subscription } from 'rxjs';
import { AppContext } from '../../Common/AppContext';
@@ -32,7 +32,7 @@ export class Menu extends Component<BaseMenuProps, IBaseMenuState> {
this.getSubMenus();
}
- override componentWillReceiveProps(nextProps: Readonly<BaseMenuProps>): void {
+ override UNSAFE_componentWillReceiveProps(nextProps: Readonly<BaseMenuProps>): void {
if (this.props.menuId !== nextProps.menuId) {
this.getSubMenus();
}
@@ -128,10 +128,10 @@ export class Menu extends Component<BaseMenuProps, IBaseMenuState> {
{menu?.map((item: BaseMenuItem, index: number) => {
if (item.show === false) return;
return (
- <>
+ <Fragment key={index}>
<li
className={joinClassNames(styles.colsMenuitem, item.className ?? '', item.disabled ? styles.colsMenuitemDisabled : '')}
- style={item.style ?? ''}
+ style={item.style}
onClick={(e) => this.handleClick(e, item, index)}
onMouseEnter={(e) => {
this.mouseEnter(e, index);
@@ -157,7 +157,7 @@ export class Menu extends Component<BaseMenuProps, IBaseMenuState> {
)}
</li>
{item.border ? <div className={styles.colsMenuitemLine}></div> : ''}
- </>
+ </Fragment>
);
})}
{options?.map((option: IValueOption | ICustomComponentOption, index: number) => {
@@ -166,6 +166,7 @@ export class Menu extends Component<BaseMenuProps, IBaseMenuState> {
if (isValueOption) {
return (
<li
+ key={index}
className={joinClassNames(styles.colsMenuitem, option.disabled ? styles.colsMenuitemDisabled : '')}
onClick={() => {
if (option.value) {
@@ -188,7 +189,7 @@ export class Menu extends Component<BaseMenuProps, IBaseMenuState> {
// custom component option
const CustomComponent = context.componentManager?.get(option.id);
return (
- <li className={joinClassNames(styles.colsMenuitem, option.disabled ? styles.colsMenuitemDisabled : '')}>
+ <li key={index} className={joinClassNames(styles.colsMenuitem, option.disabled ? styles.colsMenuitemDisabled : '')}>
<CustomComponent
onValueChange={(v: string | number) => {
this.props.onOptionSelect!({ value: v, label: option.id });
@@ -198,10 +199,6 @@ export class Menu extends Component<BaseMenuProps, IBaseMenuState> {
</li>
);
})}
- {/* render submenus */}
- {menuItems?.map((item: IDisplayMenuItem<IMenuItem>, index) => (
- <MenuItem menuItem={item} index={index} onClick={this.handleItemClick.bind(this, item as IMenuButtonItem)} />
- ))}
</ul>
);
}
@@ -286,7 +283,7 @@ export class MenuItem extends Component<IMenuItemProps, IMenuItemState> {
this.valueSubscription?.unsubscribe();
}
- override componentWillReceiveProps(nextProps: Readonly<IMenuItemProps>): void {
+ override UNSAFE_componentWillReceiveProps(nextProps: Readonly<IMenuItemProps>): void {
if (this.props.menuItem.id !== nextProps.menuItem.id) {
this.getSubMenus();
}
diff --git a/packages/base-ui/src/Components/Modal/Modal.tsx b/packages/base-ui/src/Components/Modal/Modal.tsx
index 91f17a713f..2f1eeb5d3f 100644
--- a/packages/base-ui/src/Components/Modal/Modal.tsx
+++ b/packages/base-ui/src/Components/Modal/Modal.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseModalProps, ModalComponent } from '../../Interfaces';
import { Button } from '../Button';
@@ -34,7 +34,7 @@ class Modal extends Component<BaseModalProps, IState> {
}));
};
- override componentWillReceiveProps(props: BaseModalProps) {
+ override UNSAFE_componentWillReceiveProps(props: BaseModalProps) {
if (props.visible !== this.state.visible) {
this.setState({
visible: props.visible,
@@ -95,8 +95,8 @@ class Modal extends Component<BaseModalProps, IState> {
<div className={styles.modalBody}>{children}</div>
{footer ? (
<div className={styles.modalFooter}>
- {group.map((item) => (
- <Button type={item.type} onClick={() => this.handleClick(item.onClick)}>
+ {group.map((item, index) => (
+ <Button key={index} type={item.type} onClick={() => this.handleClick(item.onClick)}>
<CustomLabel label={item.label} />
</Button>
))}
diff --git a/packages/base-ui/src/Components/Prompt/Prompt.tsx b/packages/base-ui/src/Components/Prompt/Prompt.tsx
index fd1cef7c60..b5e2129af9 100644
--- a/packages/base-ui/src/Components/Prompt/Prompt.tsx
+++ b/packages/base-ui/src/Components/Prompt/Prompt.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
import { Modal } from '../Modal';
import { CustomLabel } from '../CustomLabel';
import styles from './index.module.less';
@@ -49,7 +49,7 @@ export class Prompt extends Component<BaseConfirmProps, IState> {
return group;
}
- componentWillReceiveProps(props: BaseConfirmProps): void {
+ UNSAFE_componentWillReceiveProps(props: BaseConfirmProps): void {
if (props.show !== this.props.show) {
this.setState({
show: props.show,
diff --git a/packages/base-ui/src/Components/Radio/Radio.tsx b/packages/base-ui/src/Components/Radio/Radio.tsx
index 292c48a6a7..c1edcabd29 100644
--- a/packages/base-ui/src/Components/Radio/Radio.tsx
+++ b/packages/base-ui/src/Components/Radio/Radio.tsx
@@ -1,4 +1,4 @@
-import { Component, VNode, cloneElement } from 'preact';
+import { Component, VNode, cloneElement } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseRadioGroupProps, BaseRadioIProps, RadioComponent } from '../../Interfaces';
import styles from './index.module.less';
@@ -28,7 +28,7 @@ class RadioGroup extends Component<BaseRadioGroupProps, IState> {
const { vertical, className = '' } = this.props;
return (
<div className={`${vertical ? styles.radioGroup : ''} ${className || ''}`}>
- {this.props.children.map((item: VNode<BaseRadioIProps>) => {
+ {this.props.children.map((item: VNode<BaseRadioIProps>, index) => {
const isActive = this.props.active === item.props.value;
/**
*
@@ -39,6 +39,7 @@ class RadioGroup extends Component<BaseRadioGroupProps, IState> {
Argument of type 'Radio & ComponentChildren' is not assignable to parameter of type 'VNode<any>'.
*/
return cloneElement(item, {
+ key: index,
label: item.props.label,
children: item.props.children,
value: item.props.value,
diff --git a/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.tsx b/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.tsx
index efe89e26ed..c72ba7eb96 100644
--- a/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.tsx
+++ b/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useRef } from 'preact/hooks';
+import { useEffect, useRef } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseResizeDialogProps, ResizeDialogComponent } from '../../Interfaces';
import styles from './index.module.less';
diff --git a/packages/base-ui/src/Components/SearchTree/SearchTree.tsx b/packages/base-ui/src/Components/SearchTree/SearchTree.tsx
index 597c53bf5c..b64047286b 100644
--- a/packages/base-ui/src/Components/SearchTree/SearchTree.tsx
+++ b/packages/base-ui/src/Components/SearchTree/SearchTree.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseSearchTreeProps, SearchTreeComponent } from '../../Interfaces';
import * as Icon from '../Icon';
@@ -115,7 +115,7 @@ class SearchTree extends Component<BaseSearchTreeProps, IState> {
});
}
- componentWillMount() {
+ UNSAFE_componentWillMount() {
this.setState({ dataClone: this.state.data });
}
@@ -133,7 +133,7 @@ class SearchTree extends Component<BaseSearchTreeProps, IState> {
</div>
<div>
{this.state.dataClone.map((item, index: number) => (
- <div>
+ <div key={index}>
<input type="checkbox" checked={item.checked} onClick={this.onClick.bind(this, index)} />
{item.label}
</div>
diff --git a/packages/base-ui/src/Components/Select/Select.tsx b/packages/base-ui/src/Components/Select/Select.tsx
index 886bca399c..0f8f0743be 100644
--- a/packages/base-ui/src/Components/Select/Select.tsx
+++ b/packages/base-ui/src/Components/Select/Select.tsx
@@ -1,5 +1,4 @@
-import { ComponentChildren, createRef, RefObject } from 'preact';
-import { PureComponent } from 'preact/compat';
+import { ComponentChildren, createRef, RefObject, PureComponent } from 'react';
import { AppContext, ICustomComponent } from '../../Common';
import { BaseMenuItem } from '../../Interfaces';
import { Dropdown } from '../Dropdown';
@@ -270,7 +269,7 @@ export class Select extends PureComponent<BaseSelectProps, IState> {
this.initData();
}
- override componentWillReceiveProps(nextProps: BaseSelectProps) {
+ override UNSAFE_componentWillReceiveProps(nextProps: BaseSelectProps) {
this.updateData();
}
diff --git a/packages/base-ui/src/Components/SiderModal/SiderModal.tsx b/packages/base-ui/src/Components/SiderModal/SiderModal.tsx
index a15d0b5f67..9626fe9999 100644
--- a/packages/base-ui/src/Components/SiderModal/SiderModal.tsx
+++ b/packages/base-ui/src/Components/SiderModal/SiderModal.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
import { BaseSiderModalProps } from '../../Interfaces';
import { Icon } from '../index';
import Style from './index.module.less';
@@ -34,16 +34,16 @@ class SiderModal extends Component<BaseSiderModalProps, IState> {
});
}
- componentWillReceiveProps(props: BaseSiderModalProps): void {
+ UNSAFE_componentWillReceiveProps(props: BaseSiderModalProps): void {
this.setState({
show: props.show ?? true,
});
}
- render(props: BaseSiderModalProps) {
- const { className = '', style } = props;
+ render() {
+ const { className = '', style } = this.props;
const { zIndex, show } = this.state;
- this.context.zIndexManager.setIndex(props.name, zIndex);
+ this.context.zIndexManager.setIndex(this.props.name, zIndex);
return show ? (
<div className={`${Style.siderModal} ${className}`} style={{ ...style, zIndex }} onClick={() => this.handleClick()}>
diff --git a/packages/base-ui/src/Components/Slider/Slider.tsx b/packages/base-ui/src/Components/Slider/Slider.tsx
index 0ee7dc9892..b8b15409c8 100644
--- a/packages/base-ui/src/Components/Slider/Slider.tsx
+++ b/packages/base-ui/src/Components/Slider/Slider.tsx
@@ -1,4 +1,4 @@
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseSliderRangeProps, BaseSliderSingleProps, SliderComponent } from '../../Interfaces';
import { randomId } from '../../Utils';
@@ -82,7 +82,7 @@ export class Slider extends Component<BaseSliderRangeProps | BaseSliderSinglePro
);
};
- componentWillMount() {
+ UNSAFE_componentWillMount() {
// 生成随机id
this.idPrev = randomId('slider');
this.idNext = randomId('slider');
@@ -129,22 +129,22 @@ export class Slider extends Component<BaseSliderRangeProps | BaseSliderSinglePro
}
}
- render(props: BaseSliderSingleProps | BaseSliderRangeProps, state: SliderState) {
- const { valuePrev, valueNext } = state;
- const { step = 1, min = 0, max = 100, range = false } = props;
+ render() {
+ const { valuePrev, valueNext } = this.state;
+ const { step = 1, min = 0, max = 100, range = false } = this.props;
if (range) {
return (
<div className={styles.slider} role="group" aria-labelledby="multi-lbl" style={{ '--min': min, '--max': max }} ref={this.ref}>
- <label class="sr-only" for={this.idPrev}></label>
+ <label className="sr-only" htmlFor={this.idPrev}></label>
<input id={this.idPrev} type="range" min={min} value={valuePrev} max={max} step={step} onInput={(e) => this.onInput(0, e)} />
- <label class="sr-only" for={this.idNext}></label>
+ <label className="sr-only" htmlFor={this.idNext}></label>
<input id={this.idNext} type="range" min={min} value={valueNext} max={max} step={step} onInput={(e) => this.onInput(1, e)} />
</div>
);
}
return (
<div className={styles.slider} role="group" aria-labelledby="multi-lbl" style={{ '--min': min, '--max': max }} ref={this.ref} onClick={(e) => this.onClick(0, e)}>
- <label class="sr-only" for={this.idPrev}></label>
+ <label className="sr-only" htmlFor={this.idPrev}></label>
<input id={this.idPrev} type="range" min={min} value={valuePrev} max={max} step={step} onInput={(e) => this.onInput(0, e)} />
</div>
);
diff --git a/packages/base-ui/src/Components/Slot/Slot.tsx b/packages/base-ui/src/Components/Slot/Slot.tsx
index 725b0908cf..19ba2c0bf9 100644
--- a/packages/base-ui/src/Components/Slot/Slot.tsx
+++ b/packages/base-ui/src/Components/Slot/Slot.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
import { BaseComponentProps } from '../../BaseComponent';
import { SlotComponent } from '../../Common/SlotManager';
import { AppContext } from '../../Common';
@@ -76,7 +76,7 @@ export class Slot extends Component<IProps, IState> {
slotGroup.forEach((item, index) => {
const Label = this.context.componentManager.get(item.component.name);
if (Label) {
- arr.push(<Label ref={(ref: any) => (this._refs[index as any] = ref)} {...item.component.props} />);
+ arr.push(<Label key={index} ref={(ref: any) => (this._refs[index as any] = ref)} {...item.component.props} />);
}
});
return arr;
diff --git a/packages/base-ui/src/Components/Tabs/Tabs.tsx b/packages/base-ui/src/Components/Tabs/Tabs.tsx
index 3c80f3ac8e..b1431affdf 100644
--- a/packages/base-ui/src/Components/Tabs/Tabs.tsx
+++ b/packages/base-ui/src/Components/Tabs/Tabs.tsx
@@ -1,5 +1,4 @@
-import { JSX, toChildArray } from 'preact';
-import { PureComponent } from 'preact/compat';
+import { JSX, toChildArray, PureComponent } from 'react';
import { JSXComponent } from '../../BaseComponent';
import { BaseTabProps, BaseTabPaneProps, TabComponent, TabPaneComponent } from '../../Interfaces';
import { randomId, joinClassNames } from '../../Utils';
@@ -51,7 +50,7 @@ export class Tab extends PureComponent<BaseTabProps> {
);
};
- componentWillMount() {
+ UNSAFE_componentWillMount() {
this.setValue({ active: this.props.activeKey, children: this.props.children });
}
@@ -63,13 +62,13 @@ export class Tab extends PureComponent<BaseTabProps> {
const id = `${randomId('tab')}-${keys}`;
if (active === keys) {
return (
- <div id={id} onClick={this.handleClick} className={joinClassNames(styles.tabsTab, styles.tabsTabActive)}>
+ <div key={id} id={id} onClick={this.handleClick} className={joinClassNames(styles.tabsTab, styles.tabsTabActive)}>
{tab}
</div>
);
}
return (
- <div id={id} onClick={this.handleClick} className={styles.tabsTab}>
+ <div key={id} id={id} onClick={this.handleClick} className={styles.tabsTab}>
{tab}
</div>
);
@@ -86,8 +85,8 @@ export class Tab extends PureComponent<BaseTabProps> {
this.props.onTabClick?.(value, e);
};
- render(props: BaseTabProps, state: BaseTabState) {
- const { children, type = 'line', className = '' } = props;
+ render() {
+ const { children, type = 'line', className = '' } = this.props;
const classes = joinClassNames(
styles.tabs,
{
@@ -106,8 +105,8 @@ export class Tab extends PureComponent<BaseTabProps> {
</div>
</div>
<div className={styles.tabsContent}>
- {children.map((item: JSX.Element) => (
- <TabPane keys={item.props.keys} active={item.props.keys === this.state.active}>
+ {children.map((item: JSX.Element, index: number) => (
+ <TabPane key={index} keys={item.props.keys} active={item.props.keys === this.state.active}>
{item.props.children}
</TabPane>
))}
diff --git a/packages/base-ui/src/Components/Tooltip/Tooltip.tsx b/packages/base-ui/src/Components/Tooltip/Tooltip.tsx
index cdf5f9dca2..43829f2031 100644
--- a/packages/base-ui/src/Components/Tooltip/Tooltip.tsx
+++ b/packages/base-ui/src/Components/Tooltip/Tooltip.tsx
@@ -1,8 +1,6 @@
-import { createRef } from 'preact';
-import { useState, useContext } from 'preact/hooks';
+import { createRef, useState } from 'react';
import { BaseTooltipProps } from '../../Interfaces';
import { joinClassNames } from '../../Utils';
-import { AppContext } from '../../Common';
import { CustomLabel } from '../CustomLabel';
import style from './index.module.less';
@@ -32,7 +30,6 @@ const placementClassNames: { [index: string]: string } = {
};
export function Tooltip(props: BaseTooltipProps) {
- const context = useContext(AppContext);
const tooltip = createRef<HTMLDivElement>();
const [state, setState] = useState<TooltipState>({
placement: props.placement || 'top',
diff --git a/packages/base-ui/src/Components/Tooltip/test/index.test.tsx b/packages/base-ui/src/Components/Tooltip/test/index.test.tsx
index 67b871c529..ea65f1fdd1 100644
--- a/packages/base-ui/src/Components/Tooltip/test/index.test.tsx
+++ b/packages/base-ui/src/Components/Tooltip/test/index.test.tsx
@@ -1,6 +1,6 @@
// import Enzyme, { mount } from 'enzyme';
// import Adapter from 'enzyme-adapter-preact-pure';
-// import { h } from 'preact';
+// import { h } from 'react';
// import { render, fireEvent, screen, waitFor } from '@testing-library/preact';
// import { Tooltip } from '..';
// Enzyme.configure({ adapter: new Adapter() });
diff --git a/packages/base-ui/src/Interfaces/Checkbox.ts b/packages/base-ui/src/Interfaces/Checkbox.ts
index 5947326a2a..87275ecfc9 100644
--- a/packages/base-ui/src/Interfaces/Checkbox.ts
+++ b/packages/base-ui/src/Interfaces/Checkbox.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
export interface BaseCheckboxProps extends BaseComponentProps {
diff --git a/packages/base-ui/src/Interfaces/Collapse.ts b/packages/base-ui/src/Interfaces/Collapse.ts
index 7e14b2e3d6..b8e44bea76 100644
--- a/packages/base-ui/src/Interfaces/Collapse.ts
+++ b/packages/base-ui/src/Interfaces/Collapse.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, JSXComponent } from '../BaseComponent';
export interface BasePanelProps {
diff --git a/packages/base-ui/src/Interfaces/Container.ts b/packages/base-ui/src/Interfaces/Container.ts
index e4069c236f..17299b397c 100644
--- a/packages/base-ui/src/Interfaces/Container.ts
+++ b/packages/base-ui/src/Interfaces/Container.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
export interface BaseContainerProps extends BaseComponentProps {
diff --git a/packages/base-ui/src/Interfaces/CustomLabel.ts b/packages/base-ui/src/Interfaces/CustomLabel.ts
index 34b293b9f3..d2eeb1fe9a 100644
--- a/packages/base-ui/src/Interfaces/CustomLabel.ts
+++ b/packages/base-ui/src/Interfaces/CustomLabel.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, JSXComponent } from '../BaseComponent';
import { ICustomComponent } from '../Common';
import { BaseSelectChildrenProps, DisplayTypes } from '../Components/Select/Select';
diff --git a/packages/base-ui/src/Interfaces/Dropdown.ts b/packages/base-ui/src/Interfaces/Dropdown.ts
index 4fd0d1f657..bf7e454b6e 100644
--- a/packages/base-ui/src/Interfaces/Dropdown.ts
+++ b/packages/base-ui/src/Interfaces/Dropdown.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, JSXComponent } from '../BaseComponent';
import { BaseMenuProps } from './Menu';
diff --git a/packages/base-ui/src/Interfaces/Icon.ts b/packages/base-ui/src/Interfaces/Icon.ts
index ccb5059c0a..8935884bb0 100644
--- a/packages/base-ui/src/Interfaces/Icon.ts
+++ b/packages/base-ui/src/Interfaces/Icon.ts
@@ -1,17 +1,17 @@
-import { ComponentChildren } from 'preact';
-import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
-
-export interface BaseIconProps extends BaseComponentProps {
- spin?: boolean;
- rotate?: number;
- style?: JSX.CSSProperties;
- className?: string;
- children?: ComponentChildren;
- name?: string;
- width?: string;
- height?: string;
-}
-
-export interface IconComponent extends BaseComponent<BaseIconProps> {
- render(): JSXComponent<BaseIconProps>;
-}
+import { ComponentChildren } from 'react';
+import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
+
+export interface BaseIconProps extends BaseComponentProps {
+ spin?: boolean;
+ rotate?: number;
+ style?: JSX.CSSProperties;
+ className?: string;
+ children?: ComponentChildren;
+ name?: string;
+ width?: string;
+ height?: string;
+}
+
+export interface IconComponent extends BaseComponent<BaseIconProps> {
+ render(): JSXComponent<BaseIconProps>;
+}
diff --git a/packages/base-ui/src/Interfaces/Input.ts b/packages/base-ui/src/Interfaces/Input.ts
index 5a34b012ef..d911d26018 100644
--- a/packages/base-ui/src/Interfaces/Input.ts
+++ b/packages/base-ui/src/Interfaces/Input.ts
@@ -1,4 +1,4 @@
-import { RefObject } from 'preact';
+import { RefObject } from 'react';
import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
export interface BaseInputProps extends BaseComponentProps {
diff --git a/packages/base-ui/src/Interfaces/Menu.ts b/packages/base-ui/src/Interfaces/Menu.ts
index d7241da82a..9e45722659 100644
--- a/packages/base-ui/src/Interfaces/Menu.ts
+++ b/packages/base-ui/src/Interfaces/Menu.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren, JSX } from 'preact';
+import { ComponentChildren, JSX } from 'react';
import { BaseComponent, JSXComponent } from '../BaseComponent';
import { ICustomComponentOption, IValueOption } from '../services/menu/menu';
import { DisplayTypes } from '../Components/Select/Select';
diff --git a/packages/base-ui/src/Interfaces/Modal.ts b/packages/base-ui/src/Interfaces/Modal.ts
index e1ee2a4a0f..43ddd0400f 100644
--- a/packages/base-ui/src/Interfaces/Modal.ts
+++ b/packages/base-ui/src/Interfaces/Modal.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, JSXComponent } from '../BaseComponent';
export interface BaseModalProps {
diff --git a/packages/base-ui/src/Interfaces/Radio.ts b/packages/base-ui/src/Interfaces/Radio.ts
index ebfac87652..2163f260e1 100644
--- a/packages/base-ui/src/Interfaces/Radio.ts
+++ b/packages/base-ui/src/Interfaces/Radio.ts
@@ -1,4 +1,4 @@
-import { VNode } from 'preact';
+import { VNode } from 'react';
import { BaseComponent, JSXComponent } from '../BaseComponent';
export interface BaseRadioIProps {
diff --git a/packages/base-ui/src/Interfaces/ResizeDialog.ts b/packages/base-ui/src/Interfaces/ResizeDialog.ts
index b0aa831f27..6b413cc1bb 100644
--- a/packages/base-ui/src/Interfaces/ResizeDialog.ts
+++ b/packages/base-ui/src/Interfaces/ResizeDialog.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
export interface BaseResizeDialogProps extends BaseComponentProps {
diff --git a/packages/base-ui/src/Interfaces/RightMenu.ts b/packages/base-ui/src/Interfaces/RightMenu.ts
index d2a0283abe..d98765002d 100644
--- a/packages/base-ui/src/Interfaces/RightMenu.ts
+++ b/packages/base-ui/src/Interfaces/RightMenu.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
export interface List {
diff --git a/packages/base-ui/src/Interfaces/SiderModal.ts b/packages/base-ui/src/Interfaces/SiderModal.ts
index 754cf0331e..9f765a364e 100644
--- a/packages/base-ui/src/Interfaces/SiderModal.ts
+++ b/packages/base-ui/src/Interfaces/SiderModal.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren, RefObject } from 'preact';
+import { ComponentChildren, RefObject } from 'react';
import { BaseComponent, JSXComponent } from '../BaseComponent';
export interface BaseSiderModalProps {
diff --git a/packages/base-ui/src/Interfaces/Slider.ts b/packages/base-ui/src/Interfaces/Slider.ts
index cd63a3c93e..e78394ed13 100644
--- a/packages/base-ui/src/Interfaces/Slider.ts
+++ b/packages/base-ui/src/Interfaces/Slider.ts
@@ -1,4 +1,4 @@
-import { RefObject } from 'preact';
+import { RefObject } from 'react';
import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
interface SliderBaseProps {
diff --git a/packages/base-ui/src/Interfaces/Tooltip.ts b/packages/base-ui/src/Interfaces/Tooltip.ts
index 49029302e0..587c01ddc6 100644
--- a/packages/base-ui/src/Interfaces/Tooltip.ts
+++ b/packages/base-ui/src/Interfaces/Tooltip.ts
@@ -1,4 +1,4 @@
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BaseComponent, BaseComponentProps, JSXComponent } from '../BaseComponent';
export interface BaseTooltipProps extends BaseComponentProps {
diff --git a/packages/base-ui/src/Utils/util.ts b/packages/base-ui/src/Utils/util.ts
index 89b24c7746..eb64efeb80 100644
--- a/packages/base-ui/src/Utils/util.ts
+++ b/packages/base-ui/src/Utils/util.ts
@@ -1,4 +1,4 @@
-import { Component, RefObject } from 'preact';
+import { Component, RefObject } from 'react';
/**
* check element
@@ -204,10 +204,11 @@ export function getRefElement(ref: RefObject<HTMLElement | Component> | Componen
}
const refCurrent = (ref as RefObject<Component>).current as Component<{}, {}>;
+ // TODO: need to fix
if (refCurrent) {
- return refCurrent?.base as HTMLElement;
+ return refCurrent?.contentRef.current as HTMLElement;
}
- return (ref as Component).base as HTMLElement;
+ return (ref as Component).contentRef.current as HTMLElement;
}
export function printableCharacter(keycode: number) {
diff --git a/packages/sheets-plugin-filter/src/UI/FilterButton.tsx b/packages/sheets-plugin-filter/src/UI/FilterButton.tsx
index b163fcdf27..25c0b95d2d 100644
--- a/packages/sheets-plugin-filter/src/UI/FilterButton.tsx
+++ b/packages/sheets-plugin-filter/src/UI/FilterButton.tsx
@@ -1,5 +1,5 @@
import { BaseSelectProps, Icon, Select } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { Nullable, Observer, Workbook } from '@univerjs/core';
import { IProps } from '../IData';
import { FilterPlugin } from '../FilterPlugin';
@@ -51,7 +51,7 @@ export class FilterButton extends Component<IProps, IState> {
/**
* init
*/
- override componentWillMount() {
+ override UNSAFE_componentWillMount() {
this.setLocale();
// subscribe Locale change event
@@ -96,8 +96,8 @@ export class FilterButton extends Component<IProps, IState> {
*
* @returns {void}
*/
- render(props: IProps, state: IState) {
- const { filter } = state;
+ render() {
+ const { filter } = this.state;
return <Select tooltip={filter.tooltip} key={filter.locale} children={filter.children as BaseSelectProps[]} label={filter.label} icon={filter.icon} />;
}
}
diff --git a/packages/sheets-plugin-find/src/View/UI/FindModal.tsx b/packages/sheets-plugin-find/src/View/UI/FindModal.tsx
index faa7efdbdf..ed84c74075 100644
--- a/packages/sheets-plugin-find/src/View/UI/FindModal.tsx
+++ b/packages/sheets-plugin-find/src/View/UI/FindModal.tsx
@@ -1,5 +1,5 @@
import { BaseCheckboxGroupOptions, BaseComponentProps, Button, CellRange, CheckboxGroup, Icon, Input, Modal, Select, CustomLabel } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { BaseItemProps } from '@univerjs/base-ui/src/Components/Item/Item';
import styles from './index.module.less';
diff --git a/packages/sheets-plugin-find/src/View/UI/LocationContent.tsx b/packages/sheets-plugin-find/src/View/UI/LocationContent.tsx
index 0e47dc4888..739da28fa8 100644
--- a/packages/sheets-plugin-find/src/View/UI/LocationContent.tsx
+++ b/packages/sheets-plugin-find/src/View/UI/LocationContent.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
type LocationProps = {
config: any;
diff --git a/packages/sheets-plugin-find/src/View/UI/SearchContent.tsx b/packages/sheets-plugin-find/src/View/UI/SearchContent.tsx
index 698744c9ad..5b56139510 100644
--- a/packages/sheets-plugin-find/src/View/UI/SearchContent.tsx
+++ b/packages/sheets-plugin-find/src/View/UI/SearchContent.tsx
@@ -1,4 +1,4 @@
-import { Component } from '@univerjs/base-ui';
+import { Component } from 'react';
import { Nullable } from '@univerjs/core';
interface SearchProps {
@@ -51,7 +51,7 @@ export class SearchContent extends Component<SearchProps, SearchState> {
// });
// }
- render(props: SearchProps, state: SearchState) {
+ render() {
// const Tab = this.Render.renderFunction('Tab');
// const TabPane = this.Render.renderFunction('TabPane');
// const Button = this.Render.renderFunction('Button');
diff --git a/packages/sheets-plugin-formula/src/FormulaPlugin.tsx b/packages/sheets-plugin-formula/src/FormulaPlugin.tsx
index de2edf632a..3e1ceea2f2 100644
--- a/packages/sheets-plugin-formula/src/FormulaPlugin.tsx
+++ b/packages/sheets-plugin-formula/src/FormulaPlugin.tsx
@@ -45,19 +45,17 @@ export class FormulaPlugin extends Plugin<FormulaPluginObserve> {
});
const sheetContainerUIController = this._injector.get(SheetContainerUIController);
- const formulaBar = sheetContainerUIController.getFormulaBarUIController().getFormulaBar();
sheetContainerUIController.UIDidMount(() => {
this.initializeDependencies(this._injector);
this.registerExtension();
+ const formulaBar = sheetContainerUIController.getFormulaBarUIController().getFormulaBar();
const formulaEngineService = this._injector.get(FormulaEngineService);
this._formulaController.setFormulaEngine(formulaEngineService);
firstLoader(this._formulaController);
- const componentManager = this._injector.get(ComponentManager);
- componentManager.register('FxIcon', Icon.Math.FxIcon);
formulaBar.setFx({
onClick: () => {
diff --git a/packages/sheets-plugin-formula/src/View/UI/FormulaLabel.tsx b/packages/sheets-plugin-formula/src/View/UI/FormulaLabel.tsx
index c1f872c819..ae0bc6e089 100644
--- a/packages/sheets-plugin-formula/src/View/UI/FormulaLabel.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/FormulaLabel.tsx
@@ -1,5 +1,5 @@
import { Icon } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
interface IProps {
label: string;
diff --git a/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/HelpFunction.tsx b/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/HelpFunction.tsx
index 7fea85842c..9c65aa2eed 100644
--- a/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/HelpFunction.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/HelpFunction.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, CustomLabel } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { IKeyValue } from '@univerjs/core';
import { FormulaParamType, FormulaType } from '../../../Basics';
import styles from './index.module.less';
@@ -39,7 +39,7 @@ export class HelpFunction extends Component<IProps, IState> {
};
}
- override componentWillMount() {}
+ override UNSAFE_componentWillMount() {}
override componentDidMount() {
this.props.getComponent?.(this);
@@ -65,8 +65,8 @@ export class HelpFunction extends Component<IProps, IState> {
return this.contentRef;
}
- render(props: IProps, state: IState) {
- const { activeIndex, functionInfo, helpFormulaActive, position } = state;
+ render() {
+ const { activeIndex, functionInfo, helpFormulaActive, position } = this.state;
return (
<div
@@ -74,7 +74,7 @@ export class HelpFunction extends Component<IProps, IState> {
style={{ display: helpFormulaActive ? 'block' : 'none', position: 'absolute', left: `${position.left}px`, top: `${position.top}px` }}
ref={this.contentRef}
>
- <div class={styles.helpFunctionTitle}>
+ <div className={styles.helpFunctionTitle}>
<Help title={functionInfo.n} value={functionInfo.p} type="name" active={activeIndex} />
</div>
<div className={styles.helpFunctionContent}>
@@ -91,6 +91,7 @@ export class HelpFunction extends Component<IProps, IState> {
functionInfo.p &&
functionInfo.p.map((item: FormulaParamType, i: number) => (
<Params
+ key={i}
className={activeIndex === i ? styles.helpFunctionActive : ''}
title={(<CustomLabel label={item.name} />) as unknown as string}
value={(<CustomLabel label={item.detail} />) as unknown as string}
@@ -130,17 +131,17 @@ interface IHelpProps {
interface IHelpState {}
class Help extends Component<IHelpProps, IHelpState> {
- render(props: IHelpProps, state: IHelpState) {
+ render() {
return (
<div>
<span>
- {props.title}
+ {this.props.title}
{'('}
</span>
- {props.value &&
- props.value.map((item: FormulaParamType, i: number) => (
- <span className={props.active === i ? styles.helpFunctionActive : ''}>
- <CustomLabel label={(item as IKeyValue)[`${props.type}`]} />,
+ {this.props.value &&
+ this.props.value.map((item: FormulaParamType, i: number) => (
+ <span key={i} className={this.props.active === i ? styles.helpFunctionActive : ''}>
+ <CustomLabel label={(item as IKeyValue)[`${this.props.type}`]} />,
</span>
))}
<span>{')'}</span>
diff --git a/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/SearchFunction.tsx b/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/SearchFunction.tsx
index bdf05e0917..cbca8aeed6 100644
--- a/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/SearchFunction.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/SearchFunction.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, CustomLabel } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { IKeyValue } from '@univerjs/core';
import styles from './index.module.less';
@@ -69,8 +69,8 @@ export class SearchFunction extends Component<IProps, IState> {
return this.state;
}
- render(props: IProps, state: IState) {
- const { selectIndex, formula, searchActive, position } = state;
+ render() {
+ const { selectIndex, formula, searchActive, position } = this.state;
return (
<ul
className={styles.searchFunction}
@@ -79,7 +79,7 @@ export class SearchFunction extends Component<IProps, IState> {
ref={this.contentRef}
>
{formula.map((item: any, i: number) => (
- <li className={selectIndex === i ? styles.searchFunctionActive : ''}>
+ <li key={i} className={selectIndex === i ? styles.searchFunctionActive : ''}>
<div className={styles.formulaName}>{item.n}</div>
<div className={styles.formulaDetail}>
<CustomLabel label={item.d} />
diff --git a/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx b/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx
index 3cae92338c..73c44fc5d1 100644
--- a/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx
@@ -1,5 +1,5 @@
import { BaseButtonProps, BaseModalProps, BaseSelectProps, FunctionComponent, Button, Modal, Select, AppContext } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { Nullable, Observer, Workbook } from '@univerjs/core';
import { IConfig } from '../../../Basics/Interfaces/IFormula';
import styles from './index.module.less';
@@ -46,7 +46,7 @@ class IfGenerate extends Component<IProps, IState> {
/**
* init
*/
- override componentWillMount() {
+ override UNSAFE_componentWillMount() {
this.setLocale();
this._localeObserver = this.context.observerManager.requiredObserver('onAfterChangeUILocaleObservable', 'core')?.add(() => {
this.setLocale();
diff --git a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaContent.tsx b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaContent.tsx
index 230f2c53f9..0a047cb908 100644
--- a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaContent.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaContent.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, debounce, Input, Select, CustomLabel } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { FormulaType, FunListILabel, Label } from '../../../Basics';
import styles from './index.module.less';
@@ -146,7 +146,7 @@ export class SearchFormulaContent extends Component<IProps, IState> {
</div>
<ul className={styles.functionLists}>
{functionList?.map((item, index) => (
- <li className={`${styles.functionListsItem}`} onClick={() => this.handleClick(item, index)}>
+ <li key={index} className={`${styles.functionListsItem}`} onClick={() => this.handleClick(item, index)}>
<div className={styles.functionListsItemName}>{item.n}</div>
<div className={styles.functionListsItemDetail}>{item.d}</div>
</li>
diff --git a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaModal.tsx b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaModal.tsx
index bfa7579ee8..d7f3297c56 100644
--- a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaModal.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaModal.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, Modal } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { SearchFormulaModalData } from '../../../Basics/Interfaces/IFormula';
interface IProps extends BaseComponentProps {}
@@ -45,10 +45,10 @@ export class SearchFormulaModal extends Component<IProps, IState> {
// Set Provider for entire Container
return (
<>
- {modalData.map((item) => {
+ {modalData.map((item, index) => {
if (!item.show) return;
return (
- <Modal isDrag={true} mask={item.mask} title={item.label?.funParams.n} visible={item.show} group={item.group} onCancel={item.onCancel}>
+ <Modal key={index} isDrag={true} mask={item.mask} title={item.label?.funParams.n} visible={item.show} group={item.group} onCancel={item.onCancel}>
{item.modal}
</Modal>
);
diff --git a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchItem.tsx b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchItem.tsx
index 3a1e89ef6d..da8ffe9179 100644
--- a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchItem.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchItem.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, CellRange, CustomLabel } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { FormulaParamType, FunParams } from '../../../Basics';
import styles from './index.module.less';
@@ -64,7 +64,7 @@ export class SearchItem extends Component<IProps, IState> {
<div className={styles.functionParamModal}>
<div className={styles.functionParamList}>
{funParams.funParams?.p?.map((item, index) => (
- <div>
+ <div key={index}>
<span>{item.name}:</span>
<div onClick={() => this.handleClick(index)}>
<CellRange
diff --git a/packages/sheets-plugin-image/src/View/UI/ImagePanel/ImagePanelUI.tsx b/packages/sheets-plugin-image/src/View/UI/ImagePanel/ImagePanelUI.tsx
index e259787ad1..6142290d1d 100644
--- a/packages/sheets-plugin-image/src/View/UI/ImagePanel/ImagePanelUI.tsx
+++ b/packages/sheets-plugin-image/src/View/UI/ImagePanel/ImagePanelUI.tsx
@@ -1,5 +1,5 @@
import { ColorPickerCircleButton, SiderModal } from '@univerjs/base-ui';
-import { Component, VNode } from 'preact';
+import { Component, VNode } from 'react';
import { BorderType, NormalType } from '../../../Basics';
import Style from './ImagePanelUI.module.less';
diff --git a/packages/sheets-plugin-image/src/View/UI/ImageUploadButton/ImageUploadButtonUI.tsx b/packages/sheets-plugin-image/src/View/UI/ImageUploadButton/ImageUploadButtonUI.tsx
index cbb6e27609..d1ca2cb7be 100644
--- a/packages/sheets-plugin-image/src/View/UI/ImageUploadButton/ImageUploadButtonUI.tsx
+++ b/packages/sheets-plugin-image/src/View/UI/ImageUploadButton/ImageUploadButtonUI.tsx
@@ -1,4 +1,4 @@
-import { Component } from 'preact';
+import { Component } from 'react';
export interface ImageUploadButtonUIProps {
chooseCallback: (url: string, file: File) => void;
diff --git a/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts b/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts
index 00a5b39890..b255d251cc 100644
--- a/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts
+++ b/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts
@@ -36,14 +36,14 @@ export class NumfmtPlugin extends Plugin<NumfmtPluginObserve> {
sheetContainerUIController.UIDidMount(() => {
this.initializeDependencies(_injector);
this.registerExtension();
+ this._numfmtController = this._injector.get(NumfmtController);
+ this._numfmtModalController = this._injector.get(NumfmtModalController);
});
}
override onMounted(): void {
install(this);
this._localeService.getLocale().load({ en, zh });
- this._numfmtController = this._injector.get(NumfmtController);
- this._numfmtModalController = this._injector.get(NumfmtModalController);
// const actionRegister = this._commandManager.getActionExtensionManager().getRegister();
// actionRegister.add(this._numfmtActionExtensionFactory);
}
diff --git a/packages/sheets-plugin-numfmt/src/View/UI/FormatContent.tsx b/packages/sheets-plugin-numfmt/src/View/UI/FormatContent.tsx
index 438b555cc5..58fdb91d7b 100644
--- a/packages/sheets-plugin-numfmt/src/View/UI/FormatContent.tsx
+++ b/packages/sheets-plugin-numfmt/src/View/UI/FormatContent.tsx
@@ -1,5 +1,5 @@
import { BaseComponentRender, BaseComponentSheet } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import styles from './index.module.less';
interface IProps {
diff --git a/packages/sheets-plugin-numfmt/src/View/UI/FormatItem.tsx b/packages/sheets-plugin-numfmt/src/View/UI/FormatItem.tsx
index bd23e8e62e..3b10aa923f 100644
--- a/packages/sheets-plugin-numfmt/src/View/UI/FormatItem.tsx
+++ b/packages/sheets-plugin-numfmt/src/View/UI/FormatItem.tsx
@@ -1,6 +1,5 @@
import { AppContext, AppContextValues, BaseMenuItem, Icon, joinClassNames } from '@univerjs/base-ui';
-import { ComponentChildren } from 'preact';
-import { useContext } from 'preact/hooks';
+import { ComponentChildren, useContext } from 'react';
import styles from './FormatItem.module.less';
diff --git a/packages/sheets-plugin-numfmt/src/View/UI/NumfmtModal.tsx b/packages/sheets-plugin-numfmt/src/View/UI/NumfmtModal.tsx
index fa8b136b94..86339541ef 100644
--- a/packages/sheets-plugin-numfmt/src/View/UI/NumfmtModal.tsx
+++ b/packages/sheets-plugin-numfmt/src/View/UI/NumfmtModal.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, BaseComponentRender, BaseComponentSheet } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { SheetPlugin } from '@univerjs/base-sheets';
import { PLUGIN_NAMES } from '@univerjs/core';
import { NUMFMT_PLUGIN_NAME } from '../../Basics/Const';
diff --git a/packages/sheets-plugin-operation/src/UI/ClipboardInput.tsx b/packages/sheets-plugin-operation/src/UI/ClipboardInput.tsx
index 7df15d7659..68a58d0993 100644
--- a/packages/sheets-plugin-operation/src/UI/ClipboardInput.tsx
+++ b/packages/sheets-plugin-operation/src/UI/ClipboardInput.tsx
@@ -1,5 +1,5 @@
import { BaseComponentRender, Input } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
interface IProps {
prefix?: string;
diff --git a/packages/ui-plugin-docs/src/View/App.tsx b/packages/ui-plugin-docs/src/View/App.tsx
index 2cce44f431..89a772cce8 100644
--- a/packages/ui-plugin-docs/src/View/App.tsx
+++ b/packages/ui-plugin-docs/src/View/App.tsx
@@ -1,5 +1,5 @@
import { AppContext, BaseComponentProps, ComponentManager } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { LocaleService, LocaleType } from '@univerjs/core';
import { BaseDocContainerProps, DocContainer } from './DocContainer';
diff --git a/packages/ui-plugin-docs/src/View/Common/ColorSelect/ColorSelect.tsx b/packages/ui-plugin-docs/src/View/Common/ColorSelect/ColorSelect.tsx
index 3f87b4241c..148599e9c8 100644
--- a/packages/ui-plugin-docs/src/View/Common/ColorSelect/ColorSelect.tsx
+++ b/packages/ui-plugin-docs/src/View/Common/ColorSelect/ColorSelect.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, ICustomComponent, CustomLabel } from '@univerjs/base-ui';
-import { Component, ComponentChildren } from 'preact';
+import { Component, ComponentChildren } from 'react';
import styles from './index.module.less';
interface IProps extends BaseComponentProps {
@@ -17,7 +17,7 @@ export class ColorSelect extends Component<IProps, IState> {
this.props.getComponent?.(this);
}
- override componentWillReceiveProps(props: IProps) {
+ override UNSAFE_componentWillReceiveProps(props: IProps) {
this.setState({
color: props.color,
});
diff --git a/packages/ui-plugin-docs/src/View/DocContainer/DocContainer.tsx b/packages/ui-plugin-docs/src/View/DocContainer/DocContainer.tsx
index 7c23ebf120..351eee652c 100644
--- a/packages/ui-plugin-docs/src/View/DocContainer/DocContainer.tsx
+++ b/packages/ui-plugin-docs/src/View/DocContainer/DocContainer.tsx
@@ -2,7 +2,7 @@ import { BaseComponentProps, Container, Content, Footer, Layout, Sider } from '@
import defaultSkin from '@univerjs/base-ui/Basics/CSS/Skin/default.module.less';
import { Tools } from '@univerjs/core';
import cssVars from 'css-vars-ponyfill';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { IDocUIPluginConfig } from '../../Basics';
import style from './index.module.less';
diff --git a/packages/ui-plugin-docs/src/View/index.tsx b/packages/ui-plugin-docs/src/View/index.tsx
index 6b567ebafd..9b23721a7c 100644
--- a/packages/ui-plugin-docs/src/View/index.tsx
+++ b/packages/ui-plugin-docs/src/View/index.tsx
@@ -1,5 +1,5 @@
import { isElement } from '@univerjs/base-ui';
-import { render } from 'preact';
+import { createRoot } from 'react-dom/client';
import { App, BaseUIProps } from './App';
@@ -35,7 +35,8 @@ export class UI {
renderContainer.id = 'univer';
}
- render(<App {...props} />, renderContainer);
+ const root = createRoot(renderContainer);
+ root.render(<App {...props} />);
}
}
diff --git a/packages/ui-plugin-sheets/src/Controller/CellEditorUIController.ts b/packages/ui-plugin-sheets/src/Controller/CellEditorUIController.ts
index 03dc8b0ef3..1f47315955 100644
--- a/packages/ui-plugin-sheets/src/Controller/CellEditorUIController.ts
+++ b/packages/ui-plugin-sheets/src/Controller/CellEditorUIController.ts
@@ -3,7 +3,7 @@ import { CANVAS_VIEW_KEY, CanvasView, CellEditorController, ISelectionManager, S
import { $$, CellEditExtensionManager, getRefElement, handleDomToJson, handleStringToStyle, isCtrlPressed, KeyboardManager, setLastCaretPosition } from '@univerjs/base-ui';
import { Direction, handleStyleToString, ICellData, isKeyPrintable, ObserverManager, Tools, UIObserver } from '@univerjs/core';
import { Inject, SkipSelf } from '@wendellhu/redi';
-import { RefObject } from 'preact';
+import { RefObject } from 'react';
import { RichText } from '../View/RichText';
diff --git a/packages/ui-plugin-sheets/src/Controller/RightMenuUIController.ts b/packages/ui-plugin-sheets/src/Controller/RightMenuUIController.ts
index 3ea1bd7c01..a464cff3aa 100644
--- a/packages/ui-plugin-sheets/src/Controller/RightMenuUIController.ts
+++ b/packages/ui-plugin-sheets/src/Controller/RightMenuUIController.ts
@@ -3,7 +3,7 @@ import { CanvasView } from '@univerjs/base-sheets';
import { BaseMenuItem, ComponentManager, ICustomLabelType, IMenuItemFactory, IMenuService, MenuPosition } from '@univerjs/base-ui';
import { Disposable } from '@univerjs/core';
import { Inject, Injector } from '@wendellhu/redi';
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { SheetRightMenuConfig } from '../Basics';
import { RightMenu, RightMenuInput, RightMenuItem } from '../View';
diff --git a/packages/ui-plugin-sheets/src/Controller/ToolbarUIController.ts b/packages/ui-plugin-sheets/src/Controller/ToolbarUIController.ts
index 6e477cfc4f..42c574f6ea 100644
--- a/packages/ui-plugin-sheets/src/Controller/ToolbarUIController.ts
+++ b/packages/ui-plugin-sheets/src/Controller/ToolbarUIController.ts
@@ -2,7 +2,7 @@ import { BaseSelectChildrenProps, BaseSelectProps, ColorPicker, ComponentManager
import { IMenuItemFactory } from '@univerjs/base-ui/src/services/menu/menu';
import { Disposable } from '@univerjs/core';
import { Inject, Injector } from '@wendellhu/redi';
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { SHEET_UI_PLUGIN_NAME, SheetToolbarConfig } from '../Basics';
import { ColorSelect, LineBold, LineColor, Toolbar } from '../View';
diff --git a/packages/ui-plugin-sheets/src/View/App.tsx b/packages/ui-plugin-sheets/src/View/App.tsx
index 604733d0d1..791f105b1a 100644
--- a/packages/ui-plugin-sheets/src/View/App.tsx
+++ b/packages/ui-plugin-sheets/src/View/App.tsx
@@ -1,5 +1,5 @@
import { AppContext, BaseComponentProps, ComponentManager, ZIndexManager } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { LocaleService, LocaleType, ObserverManager } from '@univerjs/core';
import { BaseSheetContainerProps, SheetContainer } from './SheetContainer';
diff --git a/packages/ui-plugin-sheets/src/View/Common/ColorSelect/ColorSelect.tsx b/packages/ui-plugin-sheets/src/View/Common/ColorSelect/ColorSelect.tsx
index 1f2028b2dd..555deb3a9b 100644
--- a/packages/ui-plugin-sheets/src/View/Common/ColorSelect/ColorSelect.tsx
+++ b/packages/ui-plugin-sheets/src/View/Common/ColorSelect/ColorSelect.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, ICustomComponent, CustomLabel } from '@univerjs/base-ui';
-import { Component, ComponentChildren } from 'preact';
+import { Component, ComponentChildren } from 'react';
import styles from './index.module.less';
interface IProps extends BaseComponentProps {
@@ -19,7 +19,7 @@ export class ColorSelect extends Component<IProps, IState> {
this.props.getComponent?.(this);
}
- override componentWillReceiveProps(props: IProps) {
+ override UNSAFE_componentWillReceiveProps(props: IProps) {
this.setState({
color: props.color,
});
diff --git a/packages/ui-plugin-sheets/src/View/Common/Line/LineBold.tsx b/packages/ui-plugin-sheets/src/View/Common/Line/LineBold.tsx
index c564953e01..320e39b66c 100644
--- a/packages/ui-plugin-sheets/src/View/Common/Line/LineBold.tsx
+++ b/packages/ui-plugin-sheets/src/View/Common/Line/LineBold.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, AppContext, Icon, CustomLabel } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { BORDER_SIZE_CHILDREN } from '../../../Controller/menu/border.menu';
interface IState {
@@ -32,7 +32,7 @@ export class LineBold extends Component<IProps, IState> {
this.props.getComponent?.(this);
}
- override componentWillReceiveProps(props: IProps) {
+ override UNSAFE_componentWillReceiveProps(props: IProps) {
this.setState({
img: props.value,
});
diff --git a/packages/ui-plugin-sheets/src/View/Common/Line/LineColor.tsx b/packages/ui-plugin-sheets/src/View/Common/Line/LineColor.tsx
index 76a7e703db..73292067ac 100644
--- a/packages/ui-plugin-sheets/src/View/Common/Line/LineColor.tsx
+++ b/packages/ui-plugin-sheets/src/View/Common/Line/LineColor.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, CustomLabel, Icon } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
interface IState {
color: string;
@@ -26,7 +26,7 @@ export class LineColor extends Component<IProps, IState> {
this.props.getComponent?.(this);
}
- override componentWillReceiveProps(props: IProps): void {
+ override UNSAFE_componentWillReceiveProps(props: IProps): void {
this.setState({
color: props.color,
});
diff --git a/packages/ui-plugin-sheets/src/View/Common/test.tsx b/packages/ui-plugin-sheets/src/View/Common/test.tsx
index 05713f083a..76c275599d 100644
--- a/packages/ui-plugin-sheets/src/View/Common/test.tsx
+++ b/packages/ui-plugin-sheets/src/View/Common/test.tsx
@@ -1,5 +1,5 @@
import { SiderModal } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
type IProps = {};
diff --git a/packages/ui-plugin-sheets/src/View/Common/test1.tsx b/packages/ui-plugin-sheets/src/View/Common/test1.tsx
index 8b34752b20..559ca14620 100644
--- a/packages/ui-plugin-sheets/src/View/Common/test1.tsx
+++ b/packages/ui-plugin-sheets/src/View/Common/test1.tsx
@@ -1,5 +1,5 @@
import { SiderModal } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
type IProps = {};
diff --git a/packages/ui-plugin-sheets/src/View/CountBar/CountBar.tsx b/packages/ui-plugin-sheets/src/View/CountBar/CountBar.tsx
index c1d7debc7b..528cb624cb 100644
--- a/packages/ui-plugin-sheets/src/View/CountBar/CountBar.tsx
+++ b/packages/ui-plugin-sheets/src/View/CountBar/CountBar.tsx
@@ -1,5 +1,5 @@
import { BaseCountBarProps, Button, CountBarComponent, Icon, JSXComponent, Slider, AppContext } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { ObserverManager, PLUGIN_NAMES } from '@univerjs/core';
import { Injector } from '@wendellhu/redi';
import styles from './index.module.less';
@@ -90,8 +90,8 @@ export class CountBar extends Component<CountBarProps, CountState> {
(this.context.injector as Injector).get(ObserverManager).getObserver<CountBar>('onCountBarDidMountObservable', PLUGIN_NAMES.SPREADSHEET)?.notifyObservers(this);
}
- render(props: BaseCountBarProps, state: CountState) {
- const { zoom, content } = state;
+ render() {
+ const { zoom, content } = this.state;
// const PageIcon = this.getComponentRender().renderFunction('PageIcon');
// const LayoutIcon = this.getComponentRender().renderFunction('LayoutIcon');
return (
diff --git a/packages/ui-plugin-sheets/src/View/FormulaBar/FormulaBar.tsx b/packages/ui-plugin-sheets/src/View/FormulaBar/FormulaBar.tsx
index ead482c725..68481bca5d 100644
--- a/packages/ui-plugin-sheets/src/View/FormulaBar/FormulaBar.tsx
+++ b/packages/ui-plugin-sheets/src/View/FormulaBar/FormulaBar.tsx
@@ -1,5 +1,5 @@
-import { BaseComponentProps, BaseComponentRender, BaseSelectChildrenProps, debounce, Icon } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { AppContext, BaseComponentProps, BaseComponentRender, BaseSelectChildrenProps, debounce, Icon } from '@univerjs/base-ui';
+import { Component } from 'react';
import { Nullable } from '@univerjs/core';
import styles from './index.module.less';
@@ -18,6 +18,8 @@ export type Fx = {
export interface BaseFormulaBarProps extends BaseComponentProps {}
export class FormulaBar extends Component<BaseFormulaBarProps, FormulaState> {
+ static override contextType = AppContext;
+
private _render: BaseComponentRender;
// formulaContent = createRef<HTMLDivElement>();
@@ -80,19 +82,19 @@ export class FormulaBar extends Component<BaseFormulaBarProps, FormulaState> {
return <Icon />;
}
- render(props: BaseFormulaBarProps, state: FormulaState) {
+ render() {
// TODO: formula bar top left menu: 1. cell edit formula ,use formula list 2. cell selection ,use named range, 3. cell edit no formula, disable select
- const { namedRanges, fx } = state;
+ const { namedRanges, fx } = this.state;
return (
<div className={styles.formulaBox}>
{/* <Select children={namedRanges} type={0}></Select> */}
<div className={styles.formulaBar}>
<div className={styles.formulaIcon}>
- <span className={state.spanClass}>
+ <span className={this.state.spanClass}>
<Icon.Format.CloseIcon />
</span>
- <span className={state.spanClass}>
+ <span className={this.state.spanClass}>
<Icon.Format.CorrectIcon />
</span>
{fx ? (
@@ -102,9 +104,13 @@ export class FormulaBar extends Component<BaseFormulaBarProps, FormulaState> {
) : null}
</div>
<div className={styles.formulaInput}>
- <div autoFocus contentEditable={true} className={styles.formulaContent} onKeyUp={(e) => this.printChange(e)}>
- {state.formulaContent}
- </div>
+ <div
+ autoFocus
+ contentEditable={true}
+ className={styles.formulaContent}
+ onKeyUp={(e) => this.printChange(e)}
+ dangerouslySetInnerHTML={{ __html: this.state.formulaContent }}
+ />
</div>
</div>
</div>
diff --git a/packages/ui-plugin-sheets/src/View/InfoBar/InfoBar.tsx b/packages/ui-plugin-sheets/src/View/InfoBar/InfoBar.tsx
index 05de343d25..fc75035cac 100644
--- a/packages/ui-plugin-sheets/src/View/InfoBar/InfoBar.tsx
+++ b/packages/ui-plugin-sheets/src/View/InfoBar/InfoBar.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, Container, CustomLabel, Input, Tooltip } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { Nullable } from '@univerjs/core';
import { BaseInfoBarProps } from '../../Controller/InfoBarUIController';
import styles from './index.module.less';
diff --git a/packages/ui-plugin-sheets/src/View/RichText/RichText.tsx b/packages/ui-plugin-sheets/src/View/RichText/RichText.tsx
index 29b01313b5..bef10234b5 100644
--- a/packages/ui-plugin-sheets/src/View/RichText/RichText.tsx
+++ b/packages/ui-plugin-sheets/src/View/RichText/RichText.tsx
@@ -1,6 +1,6 @@
// import { CellInputHandler } from '@univerjs/sheets-plugin-formula/src/Controller/CellInputHandler';
import { BaseComponentProps, xssDeal } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { CellTextStyle } from './CellTextStyle';
import styles from './index.module.less';
// interface IProps {
@@ -153,7 +153,7 @@ export class RichText extends Component<BaseRichTextProps, IRichTextState> {
/**
* init
*/
- override componentWillMount() {}
+ override UNSAFE_componentWillMount() {}
override componentDidMount() {
this.props.getComponent?.(this);
@@ -169,8 +169,8 @@ export class RichText extends Component<BaseRichTextProps, IRichTextState> {
// this._context.getObserverManager().getObserver<WorkBook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);
}
- render(props: BaseRichTextProps, state: IRichTextState) {
- const { style, className = '', onClick, text } = props;
+ render() {
+ const { style, className = '', onClick, text } = this.props;
return (
<div className={`${styles.richTextEditorContainer} ${className}`} style={style} ref={this.container}>
<div
diff --git a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenu.tsx b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenu.tsx
index ffd07e80e9..47d782958e 100644
--- a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenu.tsx
+++ b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenu.tsx
@@ -1,6 +1,6 @@
import { IMouseEvent } from '@univerjs/base-render';
import { BaseRightMenuProps, IDisplayMenuItem, IMenuItem, Menu, MenuPosition } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { RightMenuProps } from '../../Controller';
import Style from './index.module.less';
diff --git a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuButton.tsx b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuButton.tsx
index 1fe7f97b88..18a6564a2f 100644
--- a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuButton.tsx
+++ b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuButton.tsx
@@ -1,5 +1,5 @@
import { Button } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
interface IProps {
label: string;
@@ -17,8 +17,8 @@ export class RightMenuButton extends Component<IProps> {
return (
<div>
{label}
- {children.map((item: IPropsChildren) => (
- <Button type="primary">{item.label}</Button>
+ {children.map((item: IPropsChildren, index) => (
+ <Button key={index} type="primary">{item.label}</Button>
))}
</div>
);
diff --git a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuInput.tsx b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuInput.tsx
index 48b8871607..600a9e62d5 100644
--- a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuInput.tsx
+++ b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuInput.tsx
@@ -1,5 +1,5 @@
import { CustomLabel, ICustomComponentProps, Input } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
interface IProps extends ICustomComponentProps<string> {
prefix: string;
diff --git a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuItem.tsx b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuItem.tsx
index d9d5d1dffe..64c895f9cf 100644
--- a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuItem.tsx
+++ b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuItem.tsx
@@ -1,5 +1,5 @@
import { CustomLabel, Icon } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import styles from './index.module.less';
interface IProps {
diff --git a/packages/ui-plugin-sheets/src/View/SheetBar/SheetBar.tsx b/packages/ui-plugin-sheets/src/View/SheetBar/SheetBar.tsx
index 054e5a8765..bcfcee5099 100644
--- a/packages/ui-plugin-sheets/src/View/SheetBar/SheetBar.tsx
+++ b/packages/ui-plugin-sheets/src/View/SheetBar/SheetBar.tsx
@@ -1,7 +1,7 @@
import { SetWorksheetActivateCommand } from '@univerjs/base-sheets';
import { AppContext, BaseMenuItem, BaseSheetBarProps, Button, CustomLabel, Icon, IDisplayMenuItem, IMenuItem, Menu, MenuPosition } from '@univerjs/base-ui';
import { ICommandService } from '@univerjs/core';
-import { Component, createRef, RefObject } from 'preact';
+import { Component, createRef, RefObject } from 'react';
import styles from './index.module.less';
import { ISheetBarMenuItem, SheetBarMenu } from './SheetBarMenu';
@@ -235,8 +235,9 @@ export class SheetBar extends Component<BaseSheetBarProps, SheetState> {
return currentSheet?.sheetId;
}
- render(props: BaseSheetBarProps, state: SheetState) {
- const { sheetList, menuList, sheetUl } = state;
+ render() {
+ const { sheetList, menuList, sheetUl } = this.state;
+
const { addSheet, selectSheet } = this.props;
if (!sheetList.length) return;
diff --git a/packages/ui-plugin-sheets/src/View/SheetBar/SheetBarMenu.tsx b/packages/ui-plugin-sheets/src/View/SheetBar/SheetBarMenu.tsx
index 4bfdcc3cb5..3ddba8e17b 100644
--- a/packages/ui-plugin-sheets/src/View/SheetBar/SheetBarMenu.tsx
+++ b/packages/ui-plugin-sheets/src/View/SheetBar/SheetBarMenu.tsx
@@ -1,5 +1,5 @@
import { CustomLabel, Icon, joinClassNames } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import styles from './index.module.less';
@@ -150,7 +150,7 @@ export class SheetBarMenu extends Component<ISheetBarMenuProps, IState> {
return (
<ul className={styles.sheetBarMenu} style={{ ...style, display: show ? 'block' : ' none' }}>
{menu.map((item) => (
- <li onClick={(e) => this.handleClick(e, item)} className={joinClassNames(styles.sheetBarMenuItem)}>
+ <li key={item.index} onClick={(e) => this.handleClick(e, item)} className={joinClassNames(styles.sheetBarMenuItem)}>
<span className={styles.sheetBarMenuIcon}>
<EffIcon item={item}></EffIcon>
</span>
diff --git a/packages/ui-plugin-sheets/src/View/SheetContainer/SheetContainer.tsx b/packages/ui-plugin-sheets/src/View/SheetContainer/SheetContainer.tsx
index a57b2cfcba..6433435649 100644
--- a/packages/ui-plugin-sheets/src/View/SheetContainer/SheetContainer.tsx
+++ b/packages/ui-plugin-sheets/src/View/SheetContainer/SheetContainer.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, Container, Content, Footer, Header, Layout, Sider, Slot, defaultSkin } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { Tools } from '@univerjs/core';
import cssVars from 'css-vars-ponyfill';
import style from './index.module.less';
@@ -35,7 +35,7 @@ export class SheetContainer extends Component<BaseSheetContainerProps> {
contentRef = createRef<HTMLDivElement>();
constructor(props: BaseSheetContainerProps) {
- super();
+ super(props);
this.changeSkin(props.config.container as string, 'default');
}
diff --git a/packages/ui-plugin-sheets/src/View/Slot/Slot.tsx b/packages/ui-plugin-sheets/src/View/Slot/Slot.tsx
index f6fb5db3c4..4c33ee51fc 100644
--- a/packages/ui-plugin-sheets/src/View/Slot/Slot.tsx
+++ b/packages/ui-plugin-sheets/src/View/Slot/Slot.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { SlotGroupProps } from '../../Controller/SlotController';
interface IState {
@@ -49,6 +49,7 @@ export class Slot extends Component<IProps, IState> {
if (!Slot) return;
group.push(
<Slot
+ key={k}
ref={(ele: Slot) => {
this.refMap.set(k, ele);
}}
diff --git a/packages/ui-plugin-sheets/src/View/Toolbar/DataBar.tsx b/packages/ui-plugin-sheets/src/View/Toolbar/DataBar.tsx
index f0f4350aa8..12a716f03b 100644
--- a/packages/ui-plugin-sheets/src/View/Toolbar/DataBar.tsx
+++ b/packages/ui-plugin-sheets/src/View/Toolbar/DataBar.tsx
@@ -15,7 +15,7 @@ export const DataBar = (props: BarProps) => {
return (
<div style="display: flex;">
{list.map((item, index) => (
- <div onClick={() => handleClick(item, index)} style={{ width: '28px', height: '26px', background, backgroundPosition: `${item.x} ${item.y}` }}></div>
+ <div key={index} onClick={() => handleClick(item, index)} style={{ width: '28px', height: '26px', background, backgroundPosition: `${item.x} ${item.y}` }}></div>
))}
</div>
);
diff --git a/packages/ui-plugin-sheets/src/View/Toolbar/Toolbar.tsx b/packages/ui-plugin-sheets/src/View/Toolbar/Toolbar.tsx
index 4487bf8d94..490e53f954 100644
--- a/packages/ui-plugin-sheets/src/View/Toolbar/Toolbar.tsx
+++ b/packages/ui-plugin-sheets/src/View/Toolbar/Toolbar.tsx
@@ -1,5 +1,5 @@
import { AppContext, BaseComponentProps, Button, Container, CustomLabel, debounce, IDisplayMenuItem, IMenuItem, Select, Tooltip } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { IToolbarItemProps, SheetContainerUIController } from '../../Controller';
import styles from './index.module.less';
import { ToolbarItem } from './ToolbarItem';
diff --git a/packages/ui-plugin-sheets/src/View/Toolbar/ToolbarItem.tsx b/packages/ui-plugin-sheets/src/View/Toolbar/ToolbarItem.tsx
index 46b32ea810..9642897df6 100644
--- a/packages/ui-plugin-sheets/src/View/Toolbar/ToolbarItem.tsx
+++ b/packages/ui-plugin-sheets/src/View/Toolbar/ToolbarItem.tsx
@@ -1,6 +1,6 @@
import { AppContext, Button, CustomLabel, IDisplayMenuItem, IMenuButtonItem, IMenuItem, IMenuSelectorItem, IValueOption, MenuItemType, Select, Tooltip } from '@univerjs/base-ui';
import { ICommandService } from '@univerjs/core';
-import { Component, ComponentChild } from 'preact';
+import { Component, ComponentChild } from 'react';
import { Subscription } from 'rxjs';
import styles from './index.module.less';
@@ -52,7 +52,7 @@ export class ToolbarItem extends Component<IDisplayMenuItem<IMenuItem>, IToolbar
}
}
- override componentWillMount() {
+ override UNSAFE_componentWillMount() {
this.disabledSubscription?.unsubscribe();
this.activatedSubscription?.unsubscribe();
this.currentValueSubscription?.unsubscribe();
diff --git a/packages/ui-plugin-sheets/src/View/index.tsx b/packages/ui-plugin-sheets/src/View/index.tsx
index 308c9a167a..e155757ed3 100644
--- a/packages/ui-plugin-sheets/src/View/index.tsx
+++ b/packages/ui-plugin-sheets/src/View/index.tsx
@@ -1,5 +1,5 @@
import { isElement } from '@univerjs/base-ui';
-import { render } from 'preact';
+import { createRoot } from 'react-dom/client';
import { App, BaseUIProps } from './App';
interface BaseSheetUIConfig extends BaseUIProps {
@@ -34,7 +34,8 @@ export class UI {
renderContainer.id = 'univer';
}
- render(<App {...props} />, renderContainer);
+ const root = createRoot(renderContainer);
+ root.render(<App {...props} />);
}
}
diff --git a/packages/ui-plugin-slides/src/Controller/ToolbarUIController.ts b/packages/ui-plugin-slides/src/Controller/ToolbarUIController.ts
index 9c54025da3..43c4fb42e8 100644
--- a/packages/ui-plugin-slides/src/Controller/ToolbarUIController.ts
+++ b/packages/ui-plugin-slides/src/Controller/ToolbarUIController.ts
@@ -1,6 +1,6 @@
import { BorderInfo } from '@univerjs/base-slides';
import { BaseSelectChildrenProps, BaseSelectProps, ColorPicker, ComponentManager } from '@univerjs/base-ui';
-import { ComponentChildren } from 'preact';
+import { ComponentChildren } from 'react';
import { BorderType, HorizontalAlign, ICurrentUniverService, IKeyValue, ObserverManager, Tools, UIObserver, VerticalAlign, WrapStrategy } from '@univerjs/core';
import { Inject, SkipSelf } from '@wendellhu/redi';
import { DefaultToolbarConfig, SlideToolbarConfig, SLIDE_UI_PLUGIN_NAME } from '../Basics';
diff --git a/packages/ui-plugin-slides/src/View/App.tsx b/packages/ui-plugin-slides/src/View/App.tsx
index be547dd733..af6d8b2f4c 100644
--- a/packages/ui-plugin-slides/src/View/App.tsx
+++ b/packages/ui-plugin-slides/src/View/App.tsx
@@ -1,5 +1,5 @@
import { AppContext, BaseComponentProps, ComponentManager } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { LocaleService, LocaleType } from '@univerjs/core';
import { BaseSlideContainerProps, SlideContainer } from './SlideContainer';
diff --git a/packages/ui-plugin-slides/src/View/Common/ColorSelect/ColorSelect.tsx b/packages/ui-plugin-slides/src/View/Common/ColorSelect/ColorSelect.tsx
index 3f87b4241c..148599e9c8 100644
--- a/packages/ui-plugin-slides/src/View/Common/ColorSelect/ColorSelect.tsx
+++ b/packages/ui-plugin-slides/src/View/Common/ColorSelect/ColorSelect.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, ICustomComponent, CustomLabel } from '@univerjs/base-ui';
-import { Component, ComponentChildren } from 'preact';
+import { Component, ComponentChildren } from 'react';
import styles from './index.module.less';
interface IProps extends BaseComponentProps {
@@ -17,7 +17,7 @@ export class ColorSelect extends Component<IProps, IState> {
this.props.getComponent?.(this);
}
- override componentWillReceiveProps(props: IProps) {
+ override UNSAFE_componentWillReceiveProps(props: IProps) {
this.setState({
color: props.color,
});
diff --git a/packages/ui-plugin-slides/src/View/Common/Line/LineBold.tsx b/packages/ui-plugin-slides/src/View/Common/Line/LineBold.tsx
index 01520fca4f..9f921df244 100644
--- a/packages/ui-plugin-slides/src/View/Common/Line/LineBold.tsx
+++ b/packages/ui-plugin-slides/src/View/Common/Line/LineBold.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, Icon, CustomLabel } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { SlideUIPlugin } from '../../..';
import { SLIDE_UI_PLUGIN_NAME } from '../../../Basics';
@@ -28,7 +28,7 @@ export class LineBold extends Component<IProps, IState> {
this.props.getComponent?.(this);
}
- override componentWillReceiveProps(props: IProps) {
+ override UNSAFE_componentWillReceiveProps(props: IProps) {
this.setState({
img: props.img,
});
diff --git a/packages/ui-plugin-slides/src/View/Common/Line/LineColor.tsx b/packages/ui-plugin-slides/src/View/Common/Line/LineColor.tsx
index 76a7e703db..73292067ac 100644
--- a/packages/ui-plugin-slides/src/View/Common/Line/LineColor.tsx
+++ b/packages/ui-plugin-slides/src/View/Common/Line/LineColor.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, CustomLabel, Icon } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
interface IState {
color: string;
@@ -26,7 +26,7 @@ export class LineColor extends Component<IProps, IState> {
this.props.getComponent?.(this);
}
- override componentWillReceiveProps(props: IProps): void {
+ override UNSAFE_componentWillReceiveProps(props: IProps): void {
this.setState({
color: props.color,
});
diff --git a/packages/ui-plugin-slides/src/View/InfoBar/InfoBar.tsx b/packages/ui-plugin-slides/src/View/InfoBar/InfoBar.tsx
index 8bdb5ebc5f..0f44e50e5b 100644
--- a/packages/ui-plugin-slides/src/View/InfoBar/InfoBar.tsx
+++ b/packages/ui-plugin-slides/src/View/InfoBar/InfoBar.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, Container, CustomLabel, Input, Tooltip } from '@univerjs/base-ui';
-import { Component } from 'preact';
+import { Component } from 'react';
import { Nullable } from '@univerjs/core';
import { BaseInfoBarProps } from '../../Controller/InfoBarUIController';
import styles from './index.module.less';
diff --git a/packages/ui-plugin-slides/src/View/SlideBar/SlideBar.tsx b/packages/ui-plugin-slides/src/View/SlideBar/SlideBar.tsx
index 3db6aad17a..e0c033d480 100644
--- a/packages/ui-plugin-slides/src/View/SlideBar/SlideBar.tsx
+++ b/packages/ui-plugin-slides/src/View/SlideBar/SlideBar.tsx
@@ -1,5 +1,5 @@
import { AppContext, BaseComponentProps, Button } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { ISlidePage } from '@univerjs/core';
import styles from './index.module.less';
@@ -72,7 +72,7 @@ export class SlideBar extends Component<IProps, SlideBarState> {
<div className={styles.slideBar} ref={this.slideBarRef}>
<div className={styles.slideBarContent}>
{slideList.map((item, index) => (
- <div className={`${styles.slideBarItem} ${this.isActive(item.id, index)}`} onClick={() => this.activeSlide(item.id, index)}>
+ <div key={index} className={`${styles.slideBarItem} ${this.isActive(item.id, index)}`} onClick={() => this.activeSlide(item.id, index)}>
<span>{index + 1}</span>
<div className={styles.slideBarBox}></div>
</div>
diff --git a/packages/ui-plugin-slides/src/View/SlideContainer/SlideContainer.tsx b/packages/ui-plugin-slides/src/View/SlideContainer/SlideContainer.tsx
index c2fd7f17b2..a5f70df6d6 100644
--- a/packages/ui-plugin-slides/src/View/SlideContainer/SlideContainer.tsx
+++ b/packages/ui-plugin-slides/src/View/SlideContainer/SlideContainer.tsx
@@ -1,5 +1,5 @@
import { BaseComponentProps, Container, Content, Footer, Header, Layout, Sider } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import defaultSkin from '@univerjs/base-ui/Basics/CSS/Skin/default.module.less';
import { Tools } from '@univerjs/core';
import cssVars from 'css-vars-ponyfill';
diff --git a/packages/ui-plugin-slides/src/View/Toolbar/DataBar.tsx b/packages/ui-plugin-slides/src/View/Toolbar/DataBar.tsx
index f0f4350aa8..12a716f03b 100644
--- a/packages/ui-plugin-slides/src/View/Toolbar/DataBar.tsx
+++ b/packages/ui-plugin-slides/src/View/Toolbar/DataBar.tsx
@@ -15,7 +15,7 @@ export const DataBar = (props: BarProps) => {
return (
<div style="display: flex;">
{list.map((item, index) => (
- <div onClick={() => handleClick(item, index)} style={{ width: '28px', height: '26px', background, backgroundPosition: `${item.x} ${item.y}` }}></div>
+ <div key={index} onClick={() => handleClick(item, index)} style={{ width: '28px', height: '26px', background, backgroundPosition: `${item.x} ${item.y}` }}></div>
))}
</div>
);
diff --git a/packages/ui-plugin-slides/src/View/Toolbar/Toolbar.tsx b/packages/ui-plugin-slides/src/View/Toolbar/Toolbar.tsx
index b530a4d05e..5d9c895dac 100644
--- a/packages/ui-plugin-slides/src/View/Toolbar/Toolbar.tsx
+++ b/packages/ui-plugin-slides/src/View/Toolbar/Toolbar.tsx
@@ -1,5 +1,5 @@
import { AppContext, BaseComponentProps, Button, Container, debounce, Select, Tooltip, CustomLabel } from '@univerjs/base-ui';
-import { Component, createRef } from 'preact';
+import { Component, createRef } from 'react';
import { SlideUIPlugin } from '../..';
import { SLIDE_UI_PLUGIN_NAME } from '../../Basics';
import { IToolbarItemProps } from '../../Controller';
@@ -188,11 +188,11 @@ export class Toolbar extends Component<IProps, IState> {
// 渲染dom
getToolbarList(list: IToolbarItemProps[]) {
- return list.map((item) => {
+ return list.map((item, index) => {
if (item.toolbarType) {
if (item.show) {
return (
- <Tooltip title={item.tooltip} placement={'bottom'}>
+ <Tooltip key={index} title={item.tooltip} placement={'bottom'}>
<Button unActive={item.unActive} className={styles.textButton} type="text" active={item.active} onClick={item.onClick}>
<CustomLabel label={item.label} />
</Button>
@@ -203,6 +203,7 @@ export class Toolbar extends Component<IProps, IState> {
if (item.show) {
return (
<Select
+ key={index}
tooltip={item.tooltip}
type={item.type}
display={item.display}
diff --git a/packages/ui-plugin-slides/src/View/index.tsx b/packages/ui-plugin-slides/src/View/index.tsx
index d44ab2bb86..f580de1062 100644
--- a/packages/ui-plugin-slides/src/View/index.tsx
+++ b/packages/ui-plugin-slides/src/View/index.tsx
@@ -1,5 +1,5 @@
import { isElement } from '@univerjs/base-ui';
-import { render } from 'preact';
+import { createRoot } from 'react-dom/client';
import { App, BaseUIProps } from './App';
interface BaseSlideUIConfig extends BaseUIProps {
@@ -34,7 +34,8 @@ export class UI {
renderContainer.id = 'univer';
}
- render(<App {...props} />, renderContainer);
+ const root = createRoot(renderContainer);
+ root.render(<App {...props} />);
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f25d933bf0..b7e00d567c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -11,6 +11,12 @@ importers:
pnpm:
specifier: ^8.6.4
version: 8.6.4
+ react:
+ specifier: ^18.2.0
+ version: 18.2.0
+ react-dom:
+ specifier: ^18.2.0
+ version: 18.2.0([email protected])
devDependencies:
'@changesets/cli':
specifier: ^2.22.0
@@ -39,6 +45,12 @@ importers:
'@types/numeral':
specifier: ^2.0.2
version: 2.0.2
+ '@types/react':
+ specifier: ^18.2.21
+ version: 18.2.21
+ '@types/react-dom':
+ specifier: ^18.2.7
+ version: 18.2.7
'@typescript-eslint/eslint-plugin':
specifier: ^5.54.0
version: 5.54.0(@typescript-eslint/[email protected])([email protected])([email protected])
@@ -200,106 +212,6 @@ importers:
specifier: ^4.4.1-rc
version: 4.7.2
- examples/univer-preact-ts:
- dependencies:
- '@univerjs/base-docs':
- specifier: workspace:^0.0.1
- version: link:../../packages/base-docs
- '@univerjs/base-render':
- specifier: workspace:^0.0.1
- version: link:../../packages/base-render
- '@univerjs/base-sheets':
- specifier: workspace:^0.0.1
- version: link:../../packages/base-sheets
- '@univerjs/base-slides':
- specifier: workspace:^0.0.1
- version: link:../../packages/base-slides
- '@univerjs/base-ui':
- specifier: workspace:^0.0.1
- version: link:../../packages/base-ui
- '@univerjs/common-plugin-collaboration':
- specifier: workspace:^0.0.1
- version: link:../../packages/common-plugin-collaboration
- '@univerjs/common-plugin-data':
- specifier: workspace:^0.0.1
- version: link:../../packages/common-plugin-data
- '@univerjs/core':
- specifier: workspace:^0.0.1
- version: link:../../packages/core
- '@univerjs/sheets-plugin-formula':
- specifier: workspace:^0.0.1
- version: link:../../packages/sheets-plugin-formula
- '@univerjs/sheets-plugin-import-xlsx':
- specifier: workspace:^0.0.1
- version: link:../../packages/sheets-plugin-import-xlsx
- '@univerjs/sheets-plugin-numfmt':
- specifier: workspace:^0.0.1
- version: link:../../packages/sheets-plugin-numfmt
- '@univerjs/sheets-plugin-operation':
- specifier: workspace:^0.0.1
- version: link:../../packages/sheets-plugin-operation
- '@univerjs/ui-plugin-docs':
- specifier: workspace:^0.0.1
- version: link:../../packages/ui-plugin-docs
- '@univerjs/ui-plugin-sheets':
- specifier: workspace:^0.0.1
- version: link:../../packages/ui-plugin-sheets
- '@univerjs/ui-plugin-slides':
- specifier: workspace:^0.0.1
- version: link:../../packages/ui-plugin-slides
- preact:
- specifier: ^10.12.1
- version: 10.17.1
- devDependencies:
- '@preact/preset-vite':
- specifier: 2.0.0
- '@testing-library/preact':
- specifier: ^2.0.1
- version: 2.0.1([email protected])
- '@types/jest':
- specifier: ^27.5.2
- version: 27.5.2
- '@types/node':
- specifier: ^18.14.0
- version: 18.14.0
- enzyme:
- specifier: ^3.11.0
- version: 3.11.0
- enzyme-adapter-preact-pure:
- specifier: ^3.3.0
- identity-obj-proxy:
- specifier: ^3.0.0
- version: 3.0.0
- jest-dev-server:
- specifier: ^6.1.1
- version: 6.1.1([email protected])
- jest-environment-jsdom:
- specifier: ^29.0.3
- version: 29.0.3
- less:
- specifier: ^4.1.1
- version: 4.1.1
- prettier:
- specifier: ^2.3.2
- version: 2.3.2
- ts-jest:
- specifier: 29.0.1
- ts-node:
- specifier: ^10.9.1
- version: 10.9.1(@types/[email protected])([email protected])
- typescript:
- specifier: ^4.4.1-rc
- version: 4.7.2
- vite:
- specifier: ^2.4.4
- version: 2.4.4
- vite-plugin-external:
- specifier: 1.2.3
- version: 1.2.3
-
examples/univer-sheet-ts:
dependencies:
'@univerjs/base-render':
@@ -901,64 +813,6 @@ importers:
specifier: ^4.4.1-rc
version: 4.7.2
- packages/common-plugin-collaboration:
- dependencies:
- '@univerjs/base-docs':
- specifier: workspace:^0.0.1
- version: link:../base-docs
- '@univerjs/base-render':
- specifier: workspace:^0.0.1
- version: link:../base-render
- '@univerjs/base-sheets':
- specifier: workspace:^0.0.1
- version: link:../base-sheets
- '@univerjs/base-slides':
- specifier: workspace:^0.0.1
- version: link:../base-slides
- '@univerjs/base-ui':
- specifier: workspace:^0.0.1
- version: link:../base-ui
- '@univerjs/core':
- specifier: workspace:^0.0.1
- version: link:../core
- preact:
- specifier: ^10.12.1
- version: 10.17.1
- devDependencies:
- '@preact/preset-vite':
- specifier: 2.0.0
- '@testing-library/preact':
- specifier: ^2.0.1
- version: 2.0.1([email protected])
- '@types/jest':
- specifier: ^27.0.1
- version: 27.0.3
- '@types/node':
- specifier: ^18.14.0
- version: 18.14.0
- '@vitejs/plugin-legacy':
- specifier: ^1.5.1
- version: 1.5.1([email protected])
- less:
- specifier: ^4.1.1
- version: 4.1.1
- prettier:
- specifier: ^2.3.2
- version: 2.3.2
- ts-jest:
- specifier: 29.0.1
- ts-node:
- specifier: ^10.9.1
- version: 10.9.1(@types/[email protected])([email protected])
- typescript:
- specifier: ^4.4.1-rc
- version: 4.7.2
- vite:
- specifier: ^2.4.4
- version: 2.4.4
-
packages/common-plugin-data:
dependencies:
'@univerjs/core':
@@ -4145,6 +3999,24 @@ packages:
resolution: {integrity: sha512-A8F30k2gYJ/6e07spSCPpkuZu79LCnkPTvqmIWQzNGcrzwFKpVOydG41lNt5wZXjSI149qjyzC2L1+F2PD/NUA==}
dev: true
+ resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==}
+ dev: true
+
+ resolution: {integrity: sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==}
+ dependencies:
+ '@types/react': 18.2.21
+ dev: true
+
+ resolution: {integrity: sha512-neFKG/sBAwGxHgXiIxnbm3/AAVQ/cMRS93hvBpg8xYRbeQSPVABp9U2bRnPf0iI4+Ucdv3plSxKK+3CW2ENJxA==}
+ dependencies:
+ '@types/prop-types': 15.7.5
+ '@types/scheduler': 0.16.3
+ csstype: 3.1.2
+ dev: true
+
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
dependencies:
@@ -4158,6 +4030,10 @@ packages:
sass: 1.66.1
dev: true
+ resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==}
+ dev: true
+
resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==}
dev: true
@@ -5307,6 +5183,10 @@ packages:
cssom: 0.3.8
dev: true
+ resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
+ dev: true
+
resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==}
dev: true
@@ -9559,6 +9439,7 @@ packages:
resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==}
+ requiresBuild: true
dev: true
optional: true
@@ -9989,6 +9870,7 @@ packages:
resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==}
+ requiresBuild: true
dev: true
optional: true
diff --git a/scripts/common.js b/scripts/common.js
index a18caffcf5..c950fc3a77 100644
--- a/scripts/common.js
+++ b/scripts/common.js
@@ -11,9 +11,6 @@ const commonBuildOptions = {
'.svg': 'file',
},
sourcemap: true,
- alias: {
- react: 'preact/compat',
- },
plugins: [
stylePlugin({
cssModulesOptions: {
diff --git a/scripts/start.js b/scripts/start.js
index 9f74c38235..93d58555dd 100644
--- a/scripts/start.js
+++ b/scripts/start.js
@@ -1,51 +1,47 @@
-// import * as esbuild from 'esbuild';
-// import { promises } from 'fs';
-// import { exec } from 'child_process';
-// import minimist from 'minimist';
-// import { commonBuildOptions, hasFolder, paths } from './common';
-// import { Bright, FgCyan, FgGreen, Reset } from './color';
-const esbuild = require('esbuild');
-const { promises } = require('fs');
-const { exec } = require('child_process');
-const minimist = require('minimist');
-const { resolve, join } = require('path');
-const { commonBuildOptions, hasFolder } = require('./common');
-const { Bright, FgCyan, FgGreen, Reset } = require('./color');
-
-(async () => {
- const args = minimist(process.argv.slice(2));
- const target = args.t;
- const paths = {
- entry: resolve(__dirname, `../examples/univer-${target}-ts/src/main.tsx`),
- // cssEntry: resolve(root, "./src/index.css"),
- index: resolve(__dirname, `../examples/univer-${target}-ts/public/index.html`),
- out: resolve(__dirname, `../examples/univer-${target}-ts/dist`),
- outDev: resolve(__dirname, `../examples/univer-${target}-ts/local`),
- };
-
- if (hasFolder(paths.outDev)) {
- await promises.rm(paths.outDev, { recursive: true });
- }
- await promises.mkdir(paths.outDev);
- await promises.copyFile(paths.index, `${paths.outDev}/index.html`);
-
- let ctx = await esbuild.context({
- ...commonBuildOptions,
- entryPoints: [paths.entry],
- outdir: paths.outDev,
- });
-
- await ctx.watch();
-
- let { host, port } = await ctx.serve({
- servedir: paths.outDev,
- port: 3002,
- });
-
- let url = `http://localhost:${port}`;
-
- console.log(`${Bright}${FgGreen}Local server: ${FgCyan}${url}${Reset}`);
-
- let start = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
- exec(`${start} ${url}`);
-})();
+// import * as esbuild from 'esbuild';
+// import { promises } from 'fs';
+// import { exec } from 'child_process';
+// import minimist from 'minimist';
+// import { commonBuildOptions, hasFolder, paths } from './common';
+// import { Bright, FgCyan, FgGreen, Reset } from './color';
+const esbuild = require('esbuild');
+const { promises } = require('fs');
+const minimist = require('minimist');
+const { resolve } = require('path');
+const { commonBuildOptions, hasFolder } = require('./common');
+const { Bright, FgCyan, FgGreen, Reset } = require('./color');
+
+(async () => {
+ const args = minimist(process.argv.slice(2));
+ const target = args.t;
+ const paths = {
+ entry: resolve(__dirname, `../examples/univer-${target}-ts/src/main.tsx`),
+ // cssEntry: resolve(root, "./src/index.css"),
+ index: resolve(__dirname, `../examples/univer-${target}-ts/public/index.html`),
+ out: resolve(__dirname, `../examples/univer-${target}-ts/dist`),
+ outDev: resolve(__dirname, `../examples/univer-${target}-ts/local`),
+ };
+
+ if (hasFolder(paths.outDev)) {
+ await promises.rm(paths.outDev, { recursive: true });
+ }
+ await promises.mkdir(paths.outDev);
+ await promises.copyFile(paths.index, `${paths.outDev}/index.html`);
+
+ const ctx = await esbuild.context({
+ ...commonBuildOptions,
+ entryPoints: [paths.entry],
+ outdir: paths.outDev,
+ });
+
+ await ctx.watch();
+
+ const { host, port } = await ctx.serve({
+ servedir: paths.outDev,
+ port: 3002,
+ });
+
+ const url = `http://localhost:${port}`;
+
+ console.log(`${Bright}${FgGreen}Local server: ${FgCyan}${url}${Reset}`);
+})();
diff --git a/tsconfig.json b/tsconfig.json
index e7a8d005ca..c491ce2468 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -13,7 +13,7 @@
"declarationMap": true,
"experimentalDecorators": true,
"jsx": "react-jsx",
- "jsxImportSource": "preact",
+ "jsxImportSource": "react",
"sourceMap": true,
"resolveJsonModule": true,
"strict": true,